You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Focus on `wbot_base_control.nonlimited` and `wbot_base_control.limited` as you drive to see command limiting in action.
57
-
58
61
## 4. Visualize introspection values in PlotJuggler
59
-
Introspection of the ros2_control setup
60
-
With the integration of the pal_statistics package, the controller_manager node publishes the registered variables within the same process to the ~/introspection_data topics. By default, all State and Command interfaces in the controller_manager are registered when they are added, and are unregistered when they are removed from the ResourceManager. The state of the all the registered entities are published at the end of every update cycle of the controller_manager. For instance, In a complete synchronous ros2_control setup (with synchronous controllers and hardware components), this data in the Command interface is the command used by the hardware components to command the hardware.
62
+
With the integration of the pal_statistics package, the controller_manager node publishes the registered variables within the same process to the `~/introspection_data` topics. By default, all State and Command interfaces in the controller_manager are registered when they are added, and are unregistered when they are removed from the ResourceManager. The state of the all the registered entities are published at the end of every update cycle of the controller_manager. For instance, In a complete synchronous ros2_control setup (with synchronous controllers and hardware components), this data in the Command interface is the command used by the hardware components to command the hardware.
61
63
62
64
What gets published (message types):
63
65
-`/controller_manager/introspection_data/full` (`pal_statistics_msgs/msg/StatisticsValues`): publishes the full introspection data, so names and values travel together for quick CLI inspection.
64
66
-`/controller_manager/introspection_data/names` (`pal_statistics_msgs/msg/StatisticsNames`): publishes the names of the registered variables whenever interfaces are registered or removed.
65
67
-`/controller_manager/introspection_data/values` (`pal_statistics_msgs/msg/StatisticsValues`): publishes only the changing values every update cycle when a subscriber is present (ideal for PlotJuggler).
66
68
67
-
All the registered variables are still published over the 3 topics: ~/introspection_data/full, ~/introspection_data/names, and ~/introspection_data/values. The topics ~/introspection_data/full and ~/introspection_data/values are always published on every update cycle asynchronously, provided that there is at least one subscriber to these topics.
69
+
All the registered variables are still published over the 3 topics: `~/introspection_data/full`, `~/introspection_data/names`, and `~/introspection_data/values`. The topics `~/introspection_data/full` and `~/introspection_data/values` are always published on every update cycle asynchronously, provided that there is at least one subscriber to these topics.
68
70
69
-
You can wire these directly into a visualization:
70
-
- The topic ~/introspection_data/full can be used to integrate with your custom visualization tools or to track the variables from the command line.
71
-
- The topic ~/introspection_data/names and ~/introspection_data/values are to be used for visualization tools like PlotJuggler or RQT plot to visualize the data.
72
-
- In PlotJuggler, add the `/controller_manager/introspection_data/values` stream and expand the interface names to plot wheel commands, joint states, or controller timings in real time.
71
+
To visualize the data in PlotJuggler, install the `plotjuggler-ros` package and run PlotJuggler:
73
72
74
73
```bash
75
-
sudo apt install ros-jazzy-plotjuggler
74
+
sudo apt install ros-jazzy-plotjuggler-ros
76
75
ros2 run plotjuggler plotjuggler
77
76
```
78
77

@@ -193,7 +192,7 @@ ros2 control list_hardware_components
Copy file name to clipboardExpand all lines: workshop/source/_source/control/06_Example.md
+17-16Lines changed: 17 additions & 16 deletions
Display the source diff
Display the rich diff
Original file line number
Diff line number
Diff line change
@@ -1,6 +1,6 @@
1
1
# How to Setup Tricycle Robot
2
2
3
-
## What you'll need
3
+
###What you'll need
4
4
- First you need to have a working URDF with all the joint types properly assigned.
5
5
- The resource manager will pick up the joints which are either "revolute", "continuous", or prismatic types
6
6
- Fixed joints will not be used by ros2_control because they are not actuated
@@ -9,7 +9,7 @@ This example is aim: follow the sequence URDF → hardware plugin → controller
9
9
10
10
The reference file `ros2_control_demo_description/tricyclebot/urdf/tricyclebot_description.urdf.xacro`
11
11
12
-
## Robot description xacro
12
+
###Robot description xacro
13
13
Start from a clean URDF/xacro description so you know exactly which joints ros2_control will expose.
14
14
15
15
```xml
@@ -87,12 +87,12 @@ Start from a clean URDF/xacro description so you know exactly which joints ros2_
87
87
</robot>
88
88
89
89
```
90
-
### Why these joint types matter
90
+
####Why these joint types matter
91
91
-`rear_left_wheel_joint` and `rear_right_wheel_joint` are `continuous`, so ros2_control treats them as driven wheels that can spin forever.
92
92
-`front_steering_joint` is `revolute`, so the steering actuator expects a bounded angle command.
93
93
- If a joint should move in your own robot, make sure it is `revolute`, `continuous`, or `prismatic` before you hook it to controllers.
94
94
95
-
## Writing my own plugin for hardware components
95
+
###Writing my own plugin for hardware components
96
96
97
97
The hardware components realize communication to physical hardware and represent its abstraction in the ros2_control framework. The components have to be exported as plugins using pluginlib-library. The Resource Manager dynamically loads those plugins and manages their lifecycle.
98
98
@@ -110,7 +110,7 @@ Simple (1 DOF) robotic hardware like motors, valves, and similar. An actuator im
Methods return `hardware_interface::CallbackReturn` with these meanings:
116
116
@@ -181,7 +181,7 @@ private:
181
181
182
182
`hardware_interface::(Actuator|Sensor|System)Interface` defines the base class for your hardware plugin. Override the lifecycle methods to manage initialization, configuration, activation, and deactivation of your hardware. Implement the `read` and `write` methods to handle data exchange between ros2_control and your hardware.
183
183
184
-
## Export the Plugin
184
+
###Export the Plugin
185
185
186
186
To export the plugin, create the file `example_18/ros2_control_demo_example_18.xml` with the following content:
187
187
@@ -198,7 +198,7 @@ To export the plugin, create the file `example_18/ros2_control_demo_example_18.x
198
198
```
199
199
200
200
This XML file is required by `pluginlib` so that `controller_manager` can construct your class by name at runtime. During the build process, the macro `pluginlib_export_plugin_description_file(hardware_interface ros2_control_demo_example_18.xml)` will export it.
201
-
## Load the plugin in the robot xacro
201
+
###Load the plugin in the robot xacro
202
202
203
203
During the build, the plugin is exported with `pluginlib_export_plugin_description_file(hardware_interface ros2_control_demo_example_18.xml)` and then loaded into `ros2_control.xacro`:
204
204
@@ -244,7 +244,7 @@ The `<ros2_control>` tag defines the hardware interface and joints controlled by
The controller configuration file `example_18/bringup/config/tricyclebot_controllers.yaml` defines which controllers to load and encodes the tricycle base geometry. Adjust `wheelbase`, `traction_track_width`, and `traction_wheels_radius` to match your URDF:
250
250
@@ -277,7 +277,7 @@ tricycle_steering_controller:
277
277
- Joint names must match your URDF exactly or the controller will fail.
278
278
- `update_rate` controls command frequency to hardware.
279
279
280
-
## How to launch
280
+
### How to launch
281
281
282
282
The launch file in `example_18/bringup/launch` starts `ros2_control_node`, brings up the joint state broadcaster, and loads the tricycle steering controller with an optional TF remap flag to match your tf tree in RViz.
283
283
@@ -314,22 +314,23 @@ Each component:
314
314
- `joint_state_broadcaster`publishes `sensor_msgs/msg/JointState` for RViz visualization.
315
315
- `tricycle_steering_controller`spawns with the same parameters file; `--controller-ros-args` remaps `/tf` if needed for your frame tree.
316
316
317
-
# Example 18: TricycleBot (steering)
317
+
## Example 18: TricycleBot (steering)
318
318
319
319
*TricycleBot* is a simple mobile base with two driven rear wheels and a single steerable front wheel. This example demonstrates using the `tricycle_steering_controller` from `ros2_controllers` to command a vehicle with two traction joints and one steering joint.
*TricycleBot* is a mobile base with a single front wheel that is both driven and steered plus two trailing rear wheels. This example demonstrates using the `tricycle_controller` from `ros2_controllers` to command translational and rotational velocity on a steer-drive wheel.
0 commit comments