Add Example 19 for DiffBot with launch_ros2_control - #1078
Conversation
Signed-off-by: SuperJappie08 <36795178+SuperJappie08@users.noreply.github.com>
Signed-off-by: SuperJappie08 <36795178+SuperJappie08@users.noreply.github.com>
There was a problem hiding this comment.
Thanks for the contribution. I would avoid copying the launch files but rather cross-reference them. This makes it very confusing and hard to maintain.
Also, I am encouraging that we remove controller manager parameters from the "controllers.yaml" and add type to each controller directly. See #1028 for an example.
| Controller( | ||
| name="pid_controller_left_wheel_joint", | ||
| # This file can technically be omitted, since it is loaded | ||
| # by the controller manager at startup |
There was a problem hiding this comment.
Let's not load by controller manager. This should become obsolete.
| package="controller_manager", | ||
| executable="ros2_control_node", | ||
| output="both", | ||
| parameters=[controller_config_file], |
There was a problem hiding this comment.
Rather set here only update_rate as this is the only required parameter.
| value="$(find-pkg-share ros2_control_demo_example_16)/config/diffbot_chained_controllers.yaml" /> | ||
|
|
||
| <node pkg="controller_manager" exec="ros2_control_node" output="both"> | ||
| <param from="$(var controller_config_file)" /> |
|
|
||
| <spawn_controller> | ||
| <controller name="pid_controller_left_wheel_joint"> | ||
| <!-- This file can technically be omitted, since it is loaded |
| Example 17: "RRBot with Hardware Component that publishes diagnostics" | ||
| This example shows how to publish diagnostics from a hardware component using the Executor passed from Controller Manager. | ||
|
|
||
| Example 19: "DiffBot with Conditionally Chained Controllers" |
| @@ -0,0 +1,71 @@ | |||
| # Launch-file for ros2_control_demos Example 16 | |||
There was a problem hiding this comment.
These examples were originally the examples from my original package.
In which I reimplemented examples 2 and 16 and also introduced the new 2_16, which is setup to such that it can toggle between the two.
| controller: | ||
| - name: pid_controller_left_wheel_joint | ||
| param: | ||
| # This file can technically be omitted, since it is loaded |
| # | ||
| # Based on ros-controls/ros2_control_demos/example2/bringup/launch/diffbot.launch.py | ||
|
|
||
| # Launch-file for ros2_control_demos Example 2 |
| ) | ||
|
|
||
| # Use global parameters to ensure parameter overriding happens in the correct order | ||
| ld.add_action(SetParametersFromFile(diffbot_controller_parameters)) |
| # controller configs at spawn time | ||
| parameters=[ | ||
| { | ||
| "type": "diff_drive_controller/DiffDriveController", |
@destogl Thank you for the feedback. Currently this reimplements examples 2 and 16 with the launch extension; would you suggest removing those launch files or replacing their current version in the other examples? |
|
This PR is stale because it has been open for 45 days with no activity. Please tag a maintainer for help on completing this PR, or close it if you think it has become obsolete. |
|
Ping, to keep alive (hopefully I have time and energy to look at this soonish) |
Adds the examples previously found in
SuperJappie08/launch_ros2_control.Requires ros-controls/ros2_control#3122
New Examples (Checklist)
Additional Information
It could probably use a thorough read-through.