The services of xarm_api is the interface encapsulation of C++ SDK, which may be a single interface call or multiple interface calls. Note: The service path prefix (xarm/) used by rosservice is related to the startup parameters. The default xarm series is xarm/, and the Lite series is ufactory/. The following example uses xarm/, the actual use is modified according to the actual situation.
# pose: [x(mm), y(mm), z(mm), roll(rad), pitch(rad), yaw(rad)]# mvvelo: speed (mm/s)# mvacc: acceleration (mm/s^2)# coord: motion coordinate system indicator, base (0) or tool(1) coordinaterosservicecall/xarm/move_servo_cart ${pose} ${mvvelo} ${mvacc} ${coord} 0
move_line_aa
SDK API:
set_position_aa
rosservice:
# pose: [x(mm), y(mm), z(mm), roll(rad), pitch(rad), yaw(rad)]# mvvelo: speed (mm/s)# mvacc: acceleration (mm/s^2)# coord: motion coordinate system indicator, base (0) or tool(1) coordinate# relative: indicator of given target is relative (1) or not (0, absolute)rosservicecall/xarm/move_line_aa ${pose} ${mvvelo} ${mvacc} 0 ${coord} ${relative}
move_servo_cart_aa
SDK API:
set_servo_cartesian_aa
rosservice:
# pose: [x(mm), y(mm), z(mm), roll(rad), pitch(rad), yaw(rad)]# mvvelo: speed (mm/s)# mvacc: acceleration (mm/s^2)# coord: motion coordinate system indicator, base (0) or tool(1) coordinate# relative: indicator of given target is relative (1) or not (0, absolute)rosservicecall/xarm/move_servo_cart_aa ${pose} ${mvvelo} ${mvacc} 0 ${coord} ${relative}
velo_move_joint
SDK API:
vc_set_joint_velocity
rosservice:
# velocities: [joint1-velo(rad/s), ..., joint${dof}-velo(rad/s)]# jnt_sync: whether all joints accelerate and decelerate synchronously, 1 for yes, 0 for norosservicecall/xarm/velo_move_joint ${velocities} ${jnt_sync} 0
velo_move_line
SDK API:
vc_set_cartesian_velocity
rosservice:
# velocities: [velo-x(mm/s), velo-y(mm/s), velo-z(mm/s), velo-roll(rad/s), velo-pitch(rad/s), velo-yaw(rad/s)]# coord: whether motion is in tool coordinate(1) or not(0)rosservicecall/xarm/velo_move_joint ${velocities} 0 ${coord}
velo_move_joint_timed
SDK API:
vc_set_joint_velocity
rosservice:
# velocities: [joint1-velo(rad/s), ..., joint${dof}-velo(rad/s)]# is_sync: whether all joints accelerate and decelerate synchronously, 1 for yes, 0 for no# duration: the maximum duration of the speed, over this time will automatically set the speed to 0rosservicecall/xarm/velo_move_joint_timed ${velocities} ${is_sync} 0 ${duration}
velo_move_line_timed
SDK API:
vc_set_cartesian_velocity
rosservice:
# velocities: [velo-x(mm/s), velo-y(mm/s), velo-z(mm/s), velo-roll(rad/s), velo-pitch(rad/s), velo-yaw(rad/s)]# is_tool_coord: whether motion is in tool coordinate(1) or not(0)# duration: the maximum duration of the speed, over this time will automatically set the speed to 0rosservicecall/xarm/velo_move_line_timed ${velocities} 0 ${is_tool_coord} {duration}
# send_data: modbus data# respond_len: the length of the response modbus datarosservicecall/xarm/getset_tgpio_modbus_data ${send_data} ${respond_len}
get_tgpio_modbus_baudrate
SDK API:
get_tgpio_modbus_baudrate
rosservice:
rosservicecall/xarm/get_tgpio_modbus_baudrate
set_tgpio_modbus_timeout
SDK API:
set_tgpio_modbus_timeout
rosservice:
# timeout_ms: timeout(ms)# is_transparent_transmission: is transparent transmission or notrosservicecall/xarm/set_tgpio_modbus_timeout ${timeout_ms} ${is_transparent_transmission}
getset_tgpio_modbus_data
SDK API:
getset_tgpio_modbus_data
rosservice:
# send_data: modbus data# respond_len: the length of the response modbus data# host_id: host id, 9: END RS485, 10: Controller RS485# is_transparent_transmission: is transparent transmission or not# use_503_port: whether to use port 503 for communicationrosservicecall/xarm/getset_tgpio_modbus_data ${send_data} ${respond_len} ${host_id} ${is_transparent_transmission} ${use_503_port}