ros_controllers
ros_controllers copied to clipboard
Unexpected behavior in desired accelerations
We have a forked version of the joint_trajectory_controller that's modified to use the accelerations in the incoming joint trajectory. The desired trajectory looks fine (visualized via /state topic exposed by the controller) when the input trajectory is generated using moveit's trajectory generator. However, when we use another off the shelf trajectory generator, I see oscillations in the desired accelerations sampled by the trajectory controller. Below are pictures of the input to the trajectory controller and the desired accelerations picked up by the trajectory controller. Any idea what might be causing these oscillations? I've been looking through the code that samples the trajectory through quintic splines but I haven't caught anything yet.
Input Acceleration

Desired accelerations sampled by the trajectory controller

I have the same issue using MoveIt! and the joint_trajectory_controller sampler (the QuinticSplineSegment). It seems the issue is more evident with MoveIt! trajectories trying to synchronize multiple joints. Note: the used Time parametrization in MoveIt! is the IterativeSplineParametrization.
I have attached the MoveIt! trajectory as a CSV, the resampled trajectory as a CSV, and a sample of C++ code I did to thinker with the sampler.
The following figure shows the MoveIt! pos, vel and acceleration trajectory for two joints (the smooth curves) and the resample trajectory.

The original trajectory: moveit_traj.csv
The resampled trajectory: moveit_sampled.csv
The code to resample it (build and run a.out movei_traj.csv): resample_code.zip
EDIT: I found the issue, it came from a custom time parametrization which modified incorrectly the original time parametrization.