how to pause and resume when controlling a robot arm with joint_trajectory_controller with FollowJointTrajectoryAction
I am able to send a joint trajectory (control_msgs::FollowJointTrajectoryGoal) to command the robot using FollowJointTrajectoryAction (from joint_trajectory_controller). However I want to be able to pause the resume the action. I notice there is a feedback callback function option available, but I don't think it is returning anything useful in order to pause/resume actions.
Does anybody know how to do this? I can only think of implementing something my own to trace where it is up to in a trajectory by polling the current jointstate myself. When I wanna pause, I stop the action. When I wanna resume, I resend the trajectory from where it was up to onwards.
Also does cancelAllGoals() function stop all the trajectory motion? (see code below)
#include <actionlib/client/simple_action_client.h>
typedef actionlib::SimpleActionClient< control_msgs::FollowJointTrajectoryAction > TrajClient;
// Initialize
TrajClient* traj_client_ = new TrajClient("/"+robot_part_name+"/joint_trajectory_controller/follow_joint_trajectory", true);
// Start
traj_client_->sendGoal(goal);
// Stop
traj_client_->cancelAllGoals();
Hi I'm trying to get the joint trajectory,Could you please teach me how to get this information or how to do?