ros-controls / ros2_controllers

Generic robotic controllers to accompany ros2_control
https://control.ros.org
Apache License 2.0
384 stars 332 forks source link

Ask about controllers chaining YAML configs #1312

Open drfenixion opened 1 month ago

drfenixion commented 1 month ago

Hello, I am integrating ros2_controllers to RobotCAD and faced to some lack of examples of chaining ros2_controllers.

I found some examples here https://github.com/ros-controls/control.ros.org/blob/31f2c1d9c30aa0d4853d8d9e3c18b7516013dde5/doc/resources/urdfs%20and%20yamls/example_controllers.yaml#L123 But it is not clear for me and looks like outdate or future because of i dont see limiting_controllers/JointLimitingController in ros2_controllers. F.e. how can i command to PID controller from any other controller? I about YAML config options.

In PID_controller i see https://github.com/ros-controls/ros2_controllers/blob/97c1e2472f2bbc98a9cb86449b41611a3e298b30/pid_controller/src/pid_controller.cpp#L392 And looks like it takes reference from reference_and_state_dof_names but what i should fill here? Is it something like this: precedent_controller_name/joint or just joint? What if i want to fill YAML config of precedent controller instead of PID controller's reference_and_state_dof_names? Like command_joints option of admittance_controller and joint_trajectory_controller.

Steering library https://github.com/ros-controls/ros2_controllers/blob/97c1e2472f2bbc98a9cb86449b41611a3e298b30/steering_controllers_library/src/steering_controllers_library.cpp#L318 There is present reference_interfaces but it is not present in https://github.com/ros-controls/ros2_controllers/blob/master/steering_controllers_library/src/steering_controllers_library.yaml. How i should use it in YAML config of controller?

Please clarify chaining config params for me or better give examples of chaining of all chainable ros2_controllers.

Btw, at screenshoot my current progress of integration of ros2_controllers to RobotCAD. This will be available in one of RobotCAD future versions. ros2_controllers

christophfroehlich commented 1 month ago

Your linked yaml file is rather old tbh. There is a workshop page from last year's ROSCon, there will be another workshop next Monday, repo is still WIP I guess.

drfenixion commented 1 month ago

@christophfroehlich, thank you for links, there are lot of useful but only 2 examples of chaining currently.

https://github.com/ros-controls/roscon2023_control_workshop/blob/rolling/tiago_chaining/config/controllers.yaml#L55

https://github.com/ros-controls/roscon2024_control_workshop/blob/a312d3180c2da0edb7768e0fda04e2ef498df0b0/workshop_bringup/config/chaining_controllers.yaml#L76

And both examples with castom controllers.

I need examples with all standart chainable ros2_controllers because I need to fully understand how to generate their configs in chain mode from RobotCAD GUI.

Also it nice to have option in controllers params like - mandatory: true in future. Because i am using sophisticated logic to filter mandatory params for GUI. Example of config file where could be mandatory option of every param. https://github.com/ros-controls/ros2_controllers/blob/master/ackermann_steering_controller/src/ackermann_steering_controller.yaml

christophfroehlich commented 1 month ago

Not all controllers are chainable, i.e. preceded by other ones, only these here https://github.com/search?q=repo%3Aros-controls%2Fros2_controllers+chainable_controller_interface.hpp&type=code others can be after chainable_controllers but not before

drfenixion commented 1 month ago

@christophfroehlich looks like i understood you.

"_others can be after chainablecontrollers but not before" - this phrase confused me at first. It looks like the "before" and "after" are mixed up.

drfenixion commented 4 weeks ago

Is there are send bicycle steering controller/linear as reference in chain mode from any other standard controller? I mean via config. Or is it possible only from custom controller?

F.e. is it posible something like this?

joint_group_velocity_controller
    joints:
        bicycle_steering_controller/linear
        bicycle_steering_controller/angular