xarm_ros
xarm_ros copied to clipboard
Trajectory recording and Playing back for XARM
I would like to ask you is about Trajectory recording and playback on arm. I have tested the provided scripts on GitHub in xarm_python_sdk for recording and playing back trajectories. But I can't find how to record trajectory in xarm_ros though I can see set_trajectory, save_traj, play_traj in ROS services but don't know how to record one. Any leads on that will highly be appreciated.
After @Vinman's help I was able to solve the issue by following procedure:
Recording:
- set robot to teach mode
rosservice call /xarm/set_mode 2
rosservice call /xarm/set_state 0
- start recording
rosservice call /xarm/set_recording 1
- stop recording
rosservice call /xarm/set_recording 0
- save trajectory
rosservice call /xarm/save_traj '{str_data: "test.traj"}'
- set robot to position mode
rosservice call /xarm/set_mode 0
Playback:
- set robot to position mode
rosservice call /xarm/set_mode 0
rosservice call /xarm/set_state 0
- play the trajectory
rosservice call /xarm/play_traj '{traj_file: "test.traj", speed_factor: 1, repeat_times: 1}'
I have a few more questions about the trajectory recorded and access to the source .traj file.
- As per documentation in in the SDK, trajectories are saved in the controller box. Is there any way to get access to that or copy them from controller box to the comupter and vice versa? This will be helpful in visualizing trajectories in RVIZ.
- For how long the trajectories saved are stored in the controller box? Also is it possible to see list of available
.trajfiles on the controller box?
@mbs-tahir
- Since the recording and playback of the track is 250HZ, the recording and playback of the track are currently controlled by the control box software, and there is no API access for the time being.
- The maximum recording time is 5 minutes and 15 seconds, the same name will be overwritten