Robotics StackExchange | Archived questions

use ros2_control to achieve real-time control of robot

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 ros2controller will receive the commands and forward them to the hardware. As far as I can understand from the ros2controldemo, it seems **planpkg** 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: ros2controller has a FollowJointTrajectory action server, and **planpkg** 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!

Asked by xibeisiber on 2022-12-11 08:32:06 UTC

Comments

Answers