ROS Resources: Documentation | Support | Discussion Forum | Index | Service Status | ros @ Robotics Stack Exchange |
![]() | 1 | initial version |
Hello
Instead of modifying the controller code, I have implemented a simple logic in order to perform the play, pause logic in MoveIt!.
I have implemented a set of functions to do it.
The executefunction(), pause() and play(), control_bit = false
In play(): Set the control_bit = false In pause(): Set the control_bit=true, and movegroup.stop() to stop the current trajectory
In executefunction():
The logic is, when we activate the play and pause using a ROS service, it will set a control flag and change the direction of the execution. If the control bit false, it will call the movegroup.execute() function, if we call the pause function, the movegrup.stop() will be called, and set the control_flag as true. If the control_flag is true, it will clear all the targets using movegroup.clearPoseTargets(). then it will switch to infinite while and check the value of control bit to be false. If it false, it will execute the last joint values again, and call the executefunction() to execute the same.
Regards