Skip to content

Conversation

@fmauch
Copy link
Contributor

@fmauch fmauch commented Dec 2, 2025

When executing a trajectory with a start time in the future, the trajectory interpolation will create a setpoint at the robot's current configuration based on the state interface information.

However, when the state interface for example doesn't have acceleration information, but the trajectory does contain position, velocity and acceleration, the segment from the current state to the first trajectory point will not use quintic spline interpolation, though the rest of the trajectory will.

This commit fills the current state with velocity and acceleration information if it is not given in the state interfaces but it is defined in the trajectory's first point.

This fixes #2015

Velocity profile with first point in the future / at other position without this PR applied:
velocity_default

Velocity profile with first point in the future / at other position with this PR applied:
velocity_with_acceleration

I know that this is strictly speaking behavior changing, but I would nevertheless consider this a bugfix. This could, of course get an opt-in parameter on released versions to avoid the behavior change if desired.

When executing a trajectory with a start time in the future, the
trajectory interpolation will create a setpoint at the robot's current
configuration based on the state interface information.

However, when the state interface for example doesn't have acceleration
information, but the trajectory does contain position, velocity and
acceleration, the segment from the current state to the first trajectory
point will not use quintic spline interpolation, though the rest of the
trajectory will.

This commit fills the current state with velocity and acceleration
information if it is not given in the state interfaces but it is defined
in the trajectory's first point.
@codecov
Copy link

codecov bot commented Dec 2, 2025

Codecov Report

✅ All modified and coverable lines are covered by tests.
✅ Project coverage is 84.92%. Comparing base (36cfca8) to head (408fec6).

Additional details and impacted files
@@           Coverage Diff           @@
##           master    #2043   +/-   ##
=======================================
  Coverage   84.91%   84.92%           
=======================================
  Files         148      148           
  Lines       14367    14403   +36     
  Branches     1230     1232    +2     
=======================================
+ Hits        12200    12232   +32     
- Misses       1740     1742    +2     
- Partials      427      429    +2     
Flag Coverage Δ
unittests 84.92% <100.00%> (+<0.01%) ⬆️

Flags with carried forward coverage won't be shown. Click here to find out more.

Files with missing lines Coverage Δ
joint_trajectory_controller/src/trajectory.cpp 89.90% <100.00%> (-1.73%) ⬇️
...int_trajectory_controller/test/test_trajectory.cpp 100.00% <100.00%> (ø)
🚀 New features to boost your workflow:
  • ❄️ Test Analytics: Detect flaky tests, report on failures, and find test suite problems.

Copy link
Member

@christophfroehlich christophfroehlich left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

LGTM.

I'm not sure if the ABI checker is right here, do we care? Do you want to backport this?
image

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

[JTC] Trajectory with accelerations has jerk if HW doesn't have an acceleration interface

2 participants