AIS-Bonn / opt_control

Time-optimal Trajectory Generation and Control
95 stars 28 forks source link

Max velocities, accelerations, jerks might not be loaded properly from cfg file. #4

Closed jettan closed 5 years ago

jettan commented 6 years ago

Hi again,

I was looking at the code and I think that the individual Vmax, Amax and Jmax per axes are not being loaded properly in the dynamic_reconfigure_callback. The parameters in the CFG file for Vmax, Amax and Jmax are an array, but in main.cpp these are loaded in as a single double.

Declarations of said parameters in main.cpp: https://github.com/AIS-Bonn/opt_control/blob/master/ROS/opt_control/src/main.cpp#L76-L81

Place where said parameters are set in main.cpp: https://github.com/AIS-Bonn/opt_control/blob/master/ROS/opt_control/src/main.cpp#L215-L236

Place where the inputs are set to the single values: https://github.com/AIS-Bonn/opt_control/blob/master/ROS/opt_control/src/main.cpp#L402-L407

MariusBeul commented 6 years ago

Thank you for the comment! Imho the behavior is correct. Although the trajectory generation method is capable of respecting asymmetric velocity, acceleration and jerk constraints on a per axis per trajectory-segment basis, in this simple demo example, the same global limits are mapped to all axes and all trajectory-segments here:

https://github.com/AIS-Bonn/opt_control/blob/master/ROS/opt_control/src/main.cpp#L402-L407

Individual mapping requires 6 m n parameters to be defined (with m axes and n trajectory-segments) which is impractical using dynamic reconfigure.