ROS Resources: Documentation | Support | Discussion Forum | Index | Service Status | ros @ Robotics Stack Exchange
Ask Your Question
1

[ros2_control] Is it bad practice to cascade controllers?

asked 2021-08-20 14:04:20 -0600

shonigmann gravatar image

Would it be bad practice to cascade controllers using ros2_control?

For instance, if you had a legged robot, you may have a low level controller to command joint positions, and a higher level limb trajectory controller, and maybe an even higher level robot body controller.

+-----------------+             +-----------------+              +------------------+
| body controller | ----------->| limb controller | -----------> | joint controller | 
+-----------------+             +-----------------+              +------------------+

Would it be reasonable to have each of these controllers as separate ros2_controller interfaces, publishing updates to each other?

Or would the additional publish-subscribe interfaces add to the control latency/jitter, and would it instead be preferable to write a single node that does all 3?

edit retag flag offensive close merge delete

Comments

3

No, I wouldn't call that bad practice. But without a real-time / deterministic OS, together with an RT capable/compatible RMW and RT capable/compatible controllers, it's likely this setup will -- with the current state of ros2_control -- introduce jitter and delays.

Ideally however, the setup you describe is how it all could be done. And IIRC, is also one of the goals of ros2_control. It's just that right now, the state of things like ROS 2's executors and a bunch of other parts of the infrastructure make this infeasible.

gvdhoorn gravatar image gvdhoorn  ( 2021-08-22 02:09:23 -0600 )edit

1 Answer

Sort by ยป oldest newest most voted
0

answered 2023-08-08 11:51:56 -0600

shonigmann gravatar image

(Adding an answer to summarize @gvdhoorn's response and some more recent context, to close this question out prior to the stack overflow migration)

Original response from @gvdhoorn:

No, I wouldn't call that bad practice. But without a real-time / deterministic OS, together with an RT capable/compatible RMW and RT capable/compatible controllers, it's likely this setup will -- with the current state of ros2_control -- introduce jitter and delays. Ideally however, the setup you describe is how it all could be done. And IIRC, is also one of the goals of ros2_control. It's just that right now, the state of things like ROS 2's executors and a bunch of other parts of the infrastructure make this infeasible.

Update: ros2_control has since added support for chained controllers, as documented here, although I'll admit I'm unaware of any potential performance ramifications.

edit flag offensive delete link more

Question Tools

4 followers

Stats

Asked: 2021-08-20 14:04:20 -0600

Seen: 364 times

Last updated: Aug 08 '23