Skip to content

Commit ebd1260

Browse files
committed
Enhance documentation for WBot Mobile Manipulator and Tricycle Robot setup examples
1 parent f748fc4 commit ebd1260

File tree

2 files changed

+27
-27
lines changed

2 files changed

+27
-27
lines changed

workshop/source/_source/control/05_Example.md

Lines changed: 10 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -47,32 +47,31 @@ ros2 control list_hardware_components -v
4747
ros2 control list_hardware_interfaces
4848
```
4949

50+
- `list_controllers` shows active controllers.
51+
- `list_controller_types` shows available controller plugins.
52+
- `list_hardware_components` shows hardware components and their interfaces.
53+
- `list_hardware_interfaces` shows all registered interfaces.
54+
5055
For full controller manager introspection:
5156

5257
```sh
5358
ros2 topic echo /controller_manager/introspection_data/full
5459
```
5560

56-
Focus on `wbot_base_control.nonlimited` and `wbot_base_control.limited` as you drive to see command limiting in action.
57-
5861
## 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.
6163

6264
What gets published (message types):
6365
- `/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.
6466
- `/controller_manager/introspection_data/names` (`pal_statistics_msgs/msg/StatisticsNames`): publishes the names of the registered variables whenever interfaces are registered or removed.
6567
- `/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).
6668

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.
6870

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:
7372

7473
```bash
75-
sudo apt install ros-jazzy-plotjuggler
74+
sudo apt install ros-jazzy-plotjuggler-ros
7675
ros2 run plotjuggler plotjuggler
7776
```
7877
![Plotjuggler](plotjuggler_select_topics.png)
@@ -193,7 +192,7 @@ ros2 control list_hardware_components
193192

194193
Example output:
195194

196-
```text
195+
```sh
197196
Hardware Component 1
198197
name: wbot_arm_piper_control
199198
type: system

workshop/source/_source/control/06_Example.md

Lines changed: 17 additions & 16 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
# How to Setup Tricycle Robot
22

3-
## What you'll need
3+
### What you'll need
44
- First you need to have a working URDF with all the joint types properly assigned.
55
- The resource manager will pick up the joints which are either "revolute", "continuous", or prismatic types
66
- 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
99

1010
The reference file `ros2_control_demo_description/tricyclebot/urdf/tricyclebot_description.urdf.xacro`
1111

12-
## Robot description xacro
12+
### Robot description xacro
1313
Start from a clean URDF/xacro description so you know exactly which joints ros2_control will expose.
1414

1515
```xml
@@ -87,12 +87,12 @@ Start from a clean URDF/xacro description so you know exactly which joints ros2_
8787
</robot>
8888

8989
```
90-
### Why these joint types matter
90+
#### Why these joint types matter
9191
- `rear_left_wheel_joint` and `rear_right_wheel_joint` are `continuous`, so ros2_control treats them as driven wheels that can spin forever.
9292
- `front_steering_joint` is `revolute`, so the steering actuator expects a bounded angle command.
9393
- If a joint should move in your own robot, make sure it is `revolute`, `continuous`, or `prismatic` before you hook it to controllers.
9494

95-
## Writing my own plugin for hardware components
95+
### Writing my own plugin for hardware components
9696

9797
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.
9898

@@ -110,7 +110,7 @@ Simple (1 DOF) robotic hardware like motors, valves, and similar. An actuator im
110110
referece: https://github.com/ros-controls/roadmap/blob/master/design_drafts/hardware_access.md
111111

112112

113-
### Lifecycle of a Hardware Component
113+
#### Lifecycle of a Hardware Component
114114

115115
Methods return `hardware_interface::CallbackReturn` with these meanings:
116116

@@ -181,7 +181,7 @@ private:
181181

182182
`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.
183183

184-
## Export the Plugin
184+
### Export the Plugin
185185

186186
To export the plugin, create the file `example_18/ros2_control_demo_example_18.xml` with the following content:
187187

@@ -198,7 +198,7 @@ To export the plugin, create the file `example_18/ros2_control_demo_example_18.x
198198
```
199199

200200
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
202202

203203
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`:
204204

@@ -244,7 +244,7 @@ The `<ros2_control>` tag defines the hardware interface and joints controlled by
244244

245245
Reference: [Hardware Interface Types](https://control.ros.org/rolling/doc/ros2_control/hardware_interface/doc/hardware_interface_types_userdoc.html)
246246

247-
## Controller integration
247+
### Controller integration
248248

249249
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:
250250

@@ -277,7 +277,7 @@ tricycle_steering_controller:
277277
- Joint names must match your URDF exactly or the controller will fail.
278278
- `update_rate` controls command frequency to hardware.
279279

280-
## How to launch
280+
### How to launch
281281

282282
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.
283283

@@ -314,22 +314,23 @@ Each component:
314314
- `joint_state_broadcaster` publishes `sensor_msgs/msg/JointState` for RViz visualization.
315315
- `tricycle_steering_controller` spawns with the same parameters file; `--controller-ros-args` remaps `/tf` if needed for your frame tree.
316316

317-
# Example 18: TricycleBot (steering)
317+
## Example 18: TricycleBot (steering)
318318

319319
*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.
320320

321321
URDF files: `ros2_control_demo_description/tricyclebot/urdf`
322322

323-
## Tutorial steps
323+
### Tutorial steps
324324

325325
1. Verify the robot description
326326

327327
```sh
328328
ros2 launch ros2_control_demo_example_18 view_robot.launch.py
329329
```
330330

331-
Note: At startup you may see the warning
332-
"Warning: Invalid frame ID 'odom' passed to canTransform argument target_frame" — this is expected while `joint_state_publisher_gui` starts.
331+
332+
> **Note**: At startup you may see the warning
333+
> "Warning: Invalid frame ID 'odom' passed to canTransform argument target_frame" — this is expected while `joint_state_publisher_gui` starts.
333334

334335
2. Start the example
335336

@@ -393,13 +394,13 @@ You should see the robot turning in RViz and the hardware plugin printing update
393394

394395
Reference: https://github.com/ipa-vsp/ros2_control_demos (example_18 / tricycle demo)
395396

396-
# Example 19: TricycleBot (drive)
397+
## Example 19: TricycleBot (drive)
397398

398399
*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.
399400

400401
URDF files: `ros2_control_demo_description/tricyclebot/urdf`
401402

402-
## Tutorial steps
403+
### Tutorial steps
403404

404405
1. Verify the robot description
405406

@@ -466,7 +467,7 @@ ros2 topic pub --rate 30 /tricycle_controller/cmd_vel geometry_msgs/msg/TwistSta
466467

467468
You should see the robot turning in RViz and the hardware plugin printing updated steering angle and wheel velocity.
468469

469-
### Controllers from this demo
470+
#### Controllers from this demo
470471

471472
- Joint State Broadcaster: [ros2_controllers](https://github.com/ros-controls/ros2_controllers)
472473
- Tricycle Controller: [ros2_controllers](https://github.com/ros-controls/ros2_controllers)

0 commit comments

Comments
 (0)