xarm_ros icon indicating copy to clipboard operation
xarm_ros copied to clipboard

Trajectory recording and Playing back for XARM

Open mbs-tahir opened this issue 3 years ago • 3 comments

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.

mbs-tahir avatar Aug 12 '22 14:08 mbs-tahir

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}'

mbs-tahir avatar Aug 12 '22 14:08 mbs-tahir

I have a few more questions about the trajectory recorded and access to the source .traj file.

  1. 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.
  2. For how long the trajectories saved are stored in the controller box? Also is it possible to see list of available .traj files on the controller box?

mbs-tahir avatar Aug 12 '22 14:08 mbs-tahir

@mbs-tahir

  1. 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.
  2. The maximum recording time is 5 minutes and 15 seconds, the same name will be overwritten

vimior avatar Aug 15 '22 02:08 vimior