xArm-Developer / xarm_ros

ROS packages for robotic products from UFACTORY
https://www.ufactory.cc/
BSD 3-Clause "New" or "Revised" License
196 stars 147 forks source link

How to set the base of arm as coordinated frame #216

Closed Akumar201 closed 3 months ago

Akumar201 commented 3 months ago

Hello, I am trying to code Servo_Cartesian (streamed Cartesian trajectory) example , I would like to know what is the default coordinate system when using Servo_Cartesian (streamed Cartesian trajectory) example, I feel like currently it's TCP in my case , how can I change it to base, and if possible how can I give offset from my world frame. I read the manual it tells us how can we do that in XArm Studio but I am not sure how can I do that in code.

penglongxiang commented 3 months ago

Please read the above mentioned section thoroughly, there are both base coordinate and tool coordinate example given. The switching parameter is the second last argument in the service call: 0 for base coordinate (absolute pose) and 1 for tool coordinate (relative pose).

As for the world frame offset, you can set it up in xarm studio and it will take effect in ros service side (but not Moveit). You can also do it by calling set_world_offset service, the srv type format is here, it is the same type format with set_tcp_offset.

Akumar201 commented 3 months ago

@penglongxiang Thank you for the help. I am closing this issue as it has been solved. If the problem persists, please comment and the issue will be reopened if appropriate