Translate or rotate the robot with a smooth acceleration.
The minimum_jerk_trajectory_planner repository contains the implementation of the library.
The following classes are used to generate a trajectory:
Accelerationcontains the parameters of an acceleration vector (x,y,theta)Velocitycontains the parameters of an velocity vector (x,y,theta)Posecontains the parameters of an pose vector (x,y,theta)Trajectorycompute the acceleration and the velocities (accelerations,velocities) from atimestampsvector and aposesvectorTrajectoryPlanner:- the constructor take
total_timewhich is the duration of the action anddtwhich is the interval between each intermediate pose, velocity, acceleration - the function
generate_trajectorycomputelist_timestampsvector and alist_posesvector from a start pose and a target pose
- the constructor take
Robot:- the constructor take a
ǹame, thetotal_timewhich is the duration of the action, a reference to a TrajectoryPlannerpath_finder_controller, the start posepose_start, the target posepose_targetand themove_type("r" or "tx" or "ty") - the function
generate_trajectorycompute the Trajectoryodometrywith the TrajectoryPlannerpath_finder_controller
- the constructor take a
All parameters of all classes are accessible with getters.
#goal definition
float32 target_yaw
float32 min_velocity
bool enable_collision_check
float32 yaw_goal_tolerance
bool enable_data_save
---
#result definition
builtin_interfaces/Duration total_elapsed_time
---
float32 angular_distance_traveled
#goal definition
float32 target_x
float32 min_velocity
bool enable_collision_check
float32 xy_goal_tolerance
bool enable_data_save
---
#result definition
builtin_interfaces/Duration total_elapsed_time
---
float32 distance_traveled
- Launch the minimum jerk lifecycle node:
ros2 launch minimum_jerk_ros minimum_jerk_launch.py - Request rotation:
ros2 action send_goal /rotate minimum_jerk_msgs/action/Rotate "{target_yaw: 2.7, min_velocity: 1, enable_collision_check: true, yaw_goal_tolerance: 0.1, enable_data_save: false}" --feedback - Robot should be rotating by 2.7 rad.
- Request translation:
ros2 action send_goal /translate minimum_jerk_msgs/action/Translate "{target_x: 2, min_velocity: 0.2, enable_collision_check: true, xy_goal_tolerance: 0.01, enable_data_save: false}" --feedback - Robot should be translating by 2 m.
See this documentation online.
