use ros2_control to achieve real-time control of robot

asked 2022-12-11 07:32:06 -0500

xibeisiber gravatar image

updated 2022-12-11 07:47:30 -0500

Hi all,

I intend to write a ros2 package (named plan_pkg) to do the trajectory planning for different tasks, and use ros2_controller to easily support different robots.

The package plan_pkg is going to output the command joint positions at a fixed frequency (say every 1ms). I wonder how ros2_controller will receive the commands and forward them to the hardware. As far as I can understand from the ros2_control_demo, it seems plan_pkg should have a ros2 topic publisher to send the commands, and the ros2_controller should have a ros2 topic subscriber to receive the commands. Will the message transmission affect the hard real-time?

Another way: ros2_controller has a FollowJointTrajectory action server, and plan_pkg calls this server as long as a trajectory has been planned. The problem is that if I have many trajectories or a loop for many trajectories, and I want the trajectories are executed immediately one after another, this action calling method seems not good since it takes some time to begin another call after one is finished.

If I want to achieve the hybrid position/force control, should I implement the hybrid control algorithm in plan_pkg to send out online position cmd, or should I implement the hybrid control algorithm in a self-defined ros2_controller? I assume both ways work, which one is better?

Thanks for any help and suggestions!

edit retag flag offensive close merge delete