fzi-forschungszentrum-informatik / cartesian_controllers

A set of Cartesian controllers for the ROS1 and ROS2-control framework.
BSD 3-Clause "New" or "Revised" License
351 stars 100 forks source link

How to give pose_array input to the Cartesian Compliance controller? #180

Closed GigabyteZX1 closed 2 months ago

GigabyteZX1 commented 3 months ago

Hi, I have a task where I have to move a UR10e bot on a flat surface, following a trajectory (defined using a set of Poses in a Pose_Array) while applying a constant force of 10N in Z direction. So far I have used Moveit to do this without the Force part. I have found that for my problem, using Cartesian compliance controller is the way to go. I have used this package to setup controller in my workspace, specific for UR10e robot. But now I can't understand how can i use the pose_array which I am publishing to implement motion in the real bot. More specifically, what type of input does the cartesian compliance controller support and how can i change pose_array input to that required input.

Any help would be appreciated. Thanks

stefanscherzinger commented 3 months ago

Hi @GigabyteZX1

Sorry for not responding earlier. The cartesian_compliance_controller takes a geometry_msgs/msg/PoseStamped as input. Check with

ros2 topic list | grep target

and look for the controller's target_frame. That's the input topic. You could basically publish the poses you already have at a pre-defined rate to that topic to move the robot. Be sure, however, to set the frame_id in the message's header to the robot_base_link that you specify for the controller. The controller will ignore the input if they don't match.

Also note that the controller moves to each target instantly. This can be a risk, depending on your current workspace layout. You could parameterize the controller, however, to interpolate slowly with this parameter. The closer this parameter is to 0.0, the slower does the controller move towards the individual poses.

When programming some trajectory, you could also move your robot with the cartesian_force_controller by hand and record the current_pose topic that you can activate with the publish_state_feedback parameter. You can then re-publish those poses to your cartesian_compliance_controller to achieve some form of programming by demonstration.

stefanscherzinger commented 2 months ago

Please re-open if still unclear.