Skip to content

Commit d6eedfc

Browse files
Add documentation for the new platform-extras service (#330)
* Add documentation for the new platform-extras service * Add platform extras to jazzy generators page * Remove extras launch from sensors generation * Fix section headers in mermaid diagram * humble -> jazzy, fix path to platform-extras launch
1 parent 1915046 commit d6eedfc

File tree

3 files changed

+82
-15
lines changed

3 files changed

+82
-15
lines changed

Diff for: docs_versioned_docs/version-ros2jazzy/ros/config/generators.mdx

+57-15
Original file line numberDiff line numberDiff line change
@@ -21,7 +21,7 @@ Generator scripts do not need to be modified by the user. Rather the user should
2121

2222
### Bash
2323

24-
The main bash script that needs to be generated is the `setup.bash` file. This file will source the Humble `setup.bash`, as well as any
24+
The main bash script that needs to be generated is the `setup.bash` file. This file will source the Jazzy `setup.bash`, as well as any
2525
additional workspaces. It will also contain environment variables for setting up ROS 2. This file will be sourced by the `robot_upstart` job, as well
2626
as the user terminal. This way we can ensure that the bash environment of the upstart jobs matches the user's.
2727

@@ -37,7 +37,7 @@ The semantic description generator will generate a `robot.srdf.xacro` and `robot
3737

3838
### Launch
3939

40-
The launch generator creates ROS 2 [python launch files](https://docs.ros.org/en/humble/Tutorials/Intermediate/Launch/Creating-Launch-Files.html). It will create both the platform and sensor launch files by parsing the robot config. Typically, the generated launch file will include a default launch file, and pass in launch arguments as appropriate. Python classes have been defined for adding other launch files, nodes, and processes to the generated launch file, making it intuitive to use.
40+
The launch generator creates ROS 2 [python launch files](https://docs.ros.org/en/jazzy/Tutorials/Intermediate/Launch/Creating-Launch-Files.html). It will create both the platform and sensor launch files by parsing the robot config. Typically, the generated launch file will include a default launch file, and pass in launch arguments as appropriate. Python classes have been defined for adding other launch files, nodes, and processes to the generated launch file, making it intuitive to use.
4141

4242
### Parameter
4343

@@ -65,10 +65,10 @@ By running the **bash**, **description**, **launch**, and **parameter** generato
6565
%% Robot Yaml
6666
yaml(((robot.yaml)))
6767
%% Generators
68-
g_bash{{<a href='https://github.com/clearpathrobotics/clearpath_common/blob/humble/clearpath_generator_common/clearpath_generator_common/bash/generator.py'><b>Bash Generator</b></a>}}
69-
g_urdf{{<a href='https://github.com/clearpathrobotics/clearpath_common/blob/humble/clearpath_generator_common/clearpath_generator_common/description/generator.py'><b>Description Generator</b></a>}}
68+
g_bash{{<a href='https://github.com/clearpathrobotics/clearpath_common/blob/jazzy/clearpath_generator_common/clearpath_generator_common/bash/generator.py'><b>Bash Generator</b></a>}}
69+
g_urdf{{<a href='https://github.com/clearpathrobotics/clearpath_common/blob/jazzy/clearpath_generator_common/clearpath_generator_common/description/generator.py'><b>Description Generator</b></a>}}
7070
g_launch{{<a href='https://github.com/clearpathrobotics/clearpath_robot/blob/jazzy/clearpath_generator_robot/clearpath_generator_robot/launch/generator.py'><b>Launch Generator</b></a>}}
71-
g_param{{<a href='https://github.com/clearpathrobotics/clearpath_common/blob/humble/clearpath_generator_common/clearpath_generator_common/param/generator.py'><b>Parameter Generator</b></a>}}
71+
g_param{{<a href='https://github.com/clearpathrobotics/clearpath_common/blob/jazzy/clearpath_generator_common/clearpath_generator_common/param/generator.py'><b>Parameter Generator</b></a>}}
7272
%% Generated Files
7373
bash([<div><b>setup.bash</b></div><div>/etc/clearpath/setup.bash</div>])
7474
urdf([<div><b>robot.urdf.xacro</b></div><div>/etc/clearpath/robot.urdf.xacro</div>])
@@ -100,6 +100,50 @@ By running the **bash**, **description**, **launch**, and **parameter** generato
100100
`}
101101
/>
102102

103+
### Platform Extras
104+
By running the **launch** generator, the launch file to run the user-specified extra platform nodes is created in the directory **/etc/clearpath/platform-extras**.
105+
The top level launch file to start all platform related nodes is the **platform-extras-service.launch.py**, which is generated in the **/etc/clearpath/platform-extras/launch**
106+
directory by the **launch** generator.
107+
108+
<Mermaid
109+
value={`
110+
%%{ \
111+
init: { \
112+
'themeVariables': { \
113+
'fontSize': '16px' \
114+
}, \
115+
'flowchart': { \
116+
'curve': 'stepAfter', \
117+
'rankSpacing': 20 , \
118+
'nodeSpacing': 50, \
119+
'diagramPadding': 0 \
120+
} \
121+
} \
122+
}%%
123+
flowchart LR
124+
%% Robot Yaml
125+
yaml(((robot.yaml)))
126+
%% Generators
127+
g_bash{{<a href='https://github.com/clearpathrobotics/clearpath_common/blob/jazzy/clearpath_generator_common/clearpath_generator_common/bash/generator.py'><b>Bash Generator</b></a>}}
128+
g_launch{{<a href='https://github.com/clearpathrobotics/clearpath_robot/blob/jazzy/clearpath_generator_robot/clearpath_generator_robot/launch/generator.py'><b>Launch Generator</b></a>}}
129+
%% Generated Files
130+
bash([<div><b>setup.bash</b></div><div>/etc/clearpath/setup.bash</div>])
131+
launch[[<div><b>platform-extras-service.launch.py</b></div><div>/etc/clearpath/platform-extras/launch/platform-extras-service.launch.py</div>]]
132+
subgraph Clearpath Generators
133+
yaml-.-g_bash
134+
yaml-.-g_launch
135+
end
136+
g_bash-->bash
137+
g_launch-->launch
138+
subgraph Clearpath Platform Extras Service
139+
bash-.->launch
140+
end
141+
classDef generator stroke-width:4px
142+
class g_bash generator
143+
class g_launch generator
144+
`}
145+
/>
146+
103147
### Sensors Generation
104148
Using the **parameter** and **launch** file generators, a pair of files is created for each sensor defined in the configuration file. Each sensor is enumerated given its order in sensor section of the **robot.yaml**. For example, if two cameras are added, then the first will be named **camera_0** and the second **camera_1**, irrespective of the model of camera. Each sensor launch file generated is included in the top level **sensors-service.launch.py** which is ran by the service.
105149
<Mermaid
@@ -122,15 +166,14 @@ Using the **parameter** and **launch** file generators, a pair of files is creat
122166
yaml(((robot.yaml)))
123167
%% Generators
124168
g_launch{{<a href='https://github.com/clearpathrobotics/clearpath_robot/blob/jazzy/clearpath_generator_robot/clearpath_generator_robot/launch/generator.py'><b>Launch Generator</b></a>}}
125-
g_param{{<a href='https://github.com/clearpathrobotics/clearpath_common/blob/humble/clearpath_generator_common/clearpath_generator_common/param/generator.py'><b>Parameter Generator</b></a>}}
169+
g_param{{<a href='https://github.com/clearpathrobotics/clearpath_common/blob/jazzy/clearpath_generator_common/clearpath_generator_common/param/generator.py'><b>Parameter Generator</b></a>}}
126170
%% Generated Launch Files
127171
sensor_launch[[<div><b>sensor-service.launch.py</b></div><div>/etc/clearpath/sensors/launch/sensors-service.launch.py</div>]]
128172
camera_launch[[<div><b>camera_0.launch.py</b></div><div>/etc/clearpath/sensors/launch/camera_0.launch.py</div>]]
129173
gps_launch[[<div><b>gps_0.launch.py</b></div><div>/etc/clearpath/sensors/launch/gps_0.launch.py</div>]]
130174
imu_launch[[<div><b>imu_0.launch.py</b></div><div>/etc/clearpath/sensors/launch/imu_0.launch.py</div>]]
131175
lidar2d_launch[[<div><b>lidar2d_0.launch.py</b></div><div>/etc/clearpath/sensors/launch/lidar2d_0.launch.py</div>]]
132176
lidar3d_launch[[<div><b>lidar3d_0.launch.py</b></div><div>/etc/clearpath/sensors/launch/lidar3d_0.launch.py</div>]]
133-
extras_launch[[<div><i>extras</i><b>.launch.py</b></div><div>package://<i>extras_package</i>/<i>extras_path</i>/<i>extras</i>.launch.py</div>]]
134177
%% Generated Parameter Files
135178
camera_param([<div><b>camera_0.yaml</b></div><div>/etc/clearpath/sensors/config/camera_0.yaml</div>])
136179
gps_param([<div><b>gps_0.yaml</b></div><div>/etc/clearpath/sensors/config/gps_0.yaml</div>])
@@ -163,7 +206,6 @@ Using the **parameter** and **launch** file generators, a pair of files is creat
163206
imu_launch-.-sensor_launch
164207
lidar2d_launch-.-sensor_launch
165208
lidar3d_launch-.-sensor_launch
166-
extras_launch-.-sensor_launch
167209
end
168210
classDef generator stroke-width:4px
169211
class g_bash generator
@@ -195,15 +237,15 @@ Using the **semantic_description**, **launch**, and **parameter** file generator
195237
%% Robot YAML
196238
yaml(((robot.yaml)))
197239
%% Generators
198-
g_semantic_description{{<a href='https://github.com/clearpathrobotics/clearpath_common/blob/humble/clearpath_generator_common/clearpath_generator_common/semantic_description/generator.py'><b>Semantic Description Generator</b></a>}}
240+
g_semantic_description{{<a href='https://github.com/clearpathrobotics/clearpath_common/blob/jazzy/clearpath_generator_common/clearpath_generator_common/semantic_description/generator.py'><b>Semantic Description Generator</b></a>}}
199241
g_launch{{<a href='https://github.com/clearpathrobotics/clearpath_robot/blob/jazzy/clearpath_generator_robot/clearpath_generator_robot/launch/generator.py'><b>Launch Generator</b></a>}}
200-
g_param{{<a href='https://github.com/clearpathrobotics/clearpath_common/blob/humble/clearpath_generator_common/clearpath_generator_common/param/generator.py'><b>Parameter Generator</b></a>}}
201-
g_collision{{<a href='https://github.com/clearpathrobotics/clearpath_common/blob/humble/clearpath_generator_common/src/moveit_collision_updater.cpp'><b>Collision Updater</b></a>}}
242+
g_param{{<a href='https://github.com/clearpathrobotics/clearpath_common/blob/jazzy/clearpath_generator_common/clearpath_generator_common/param/generator.py'><b>Parameter Generator</b></a>}}
243+
g_collision{{<a href='https://github.com/clearpathrobotics/clearpath_common/blob/jazzy/clearpath_generator_common/src/moveit_collision_updater.cpp'><b>Collision Updater</b></a>}}
202244
%% Default Parameter Files
203-
d_cartesian([<a href='https://github.com/clearpathrobotics/clearpath_common/blob/humble/clearpath_manipulators/config/cartesian_limits.yaml'><b>Default Cartesian Limits</b></a>])
204-
d_control([<a href='https://github.com/clearpathrobotics/clearpath_common/blob/humble/clearpath_manipulators/config/control.yaml'><b>Default Control</b></a>])
205-
d_scene([<a href='https://github.com/clearpathrobotics/clearpath_common/blob/humble/clearpath_manipulators/config/planning_scene.yaml'><b>Default Planning Scene</b></a>])
206-
d_trajexec([<a href='https://github.com/clearpathrobotics/clearpath_common/blob/humble/clearpath_manipulators/config/trajectory_execution.yaml'><b>Default Trajectory Execution</b></a>])
245+
d_cartesian([<a href='https://github.com/clearpathrobotics/clearpath_common/blob/jazzy/clearpath_manipulators/config/cartesian_limits.yaml'><b>Default Cartesian Limits</b></a>])
246+
d_control([<a href='https://github.com/clearpathrobotics/clearpath_common/blob/jazzy/clearpath_manipulators/config/control.yaml'><b>Default Control</b></a>])
247+
d_scene([<a href='https://github.com/clearpathrobotics/clearpath_common/blob/jazzy/clearpath_manipulators/config/planning_scene.yaml'><b>Default Planning Scene</b></a>])
248+
d_trajexec([<a href='https://github.com/clearpathrobotics/clearpath_common/blob/jazzy/clearpath_manipulators/config/trajectory_execution.yaml'><b>Default Trajectory Execution</b></a>])
207249
urdf([<div><b>robot.urdf.xacro</b></div><div>/etc/clearpath/robot.urdf.xacro</div>])
208250
yaml-.-g_semantic_description
209251
yaml-.-g_launch

Diff for: docs_versioned_docs/version-ros2jazzy/ros/config/services.mdx

+7
Original file line numberDiff line numberDiff line change
@@ -10,6 +10,7 @@ To run all ROS 2 nodes in the background and from boot, we use [robot_upstart](h
1010
the launch files as [systemd](https://manpages.ubuntu.com/manpages/jammy/en/man5/systemd.service.5.html) services. In ROS 1 there was a single `ros` service that
1111
ran everything. For ROS 2 Humble, we have split this into three separate services:
1212
[Platform](https://github.com/clearpathrobotics/clearpath_robot/blob/jazzy/clearpath_robot/services/clearpath-platform.service),
13+
[Platform Extras](https://github.com/clearpathrobotics/clearpath_robot/blob/jazzy/clearpath_robot/services/clearpath-platform-extras.service),
1314
[Sensors](https://github.com/clearpathrobotics/clearpath_robot/blob/jazzy/clearpath_robot/services/clearpath-sensors.service), and
1415
[Robot](https://github.com/clearpathrobotics/clearpath_robot/blob/jazzy/clearpath_robot/services/clearpath-robot.service).
1516

@@ -19,6 +20,12 @@ The `clearpath-platform` service launches the `platform-service.launch.py` file
1920
required to operate the base platform, such as control, teleop, localization, and more. Running this service alone is enough to drive the robot, visualise it
2021
in Rviz, and get platform data. This service can be stopped or started without interrupting the sensor service.
2122

23+
### Clearpath Platform Extras
24+
25+
The `clearpath-platform-extras` service launches the (optional) additional launch file specified in `platform.extras.launch` portion of `robot.yaml`.
26+
27+
This service is only for additional user-defined nodes and will be inactive by default if no user-defined launch file is specified.
28+
2229
### Clearpath Sensors
2330

2431
The `clearpath-sensors` service launches the `sensors-service.launch.py` file found under `/etc/clearpath/sensors/launch/`. This will launch any

Diff for: docs_versioned_docs/version-ros2jazzy/ros/config/yaml/platform/extras.mdx

+18
Original file line numberDiff line numberDiff line change
@@ -14,6 +14,9 @@ Extras have the following entries:
1414
- **urdf:**
1515
- **package:** name of the ROS 2 package that contains the extras URDF (optional).
1616
- **path:** relative path within the package or absolute path to robot extras URDF
17+
- **launch:**
18+
- **package:** name of the ROS 2 package that contains the extras launch file (optional).
19+
- **path:** relative path within the package or absolute path to robot extras launch file
1720
- **ros_parameters:** in YAML to pass in parameters to platform nodes. This is useful to change parameters such as the robot's velocity and acceleration.
1821

1922
```yaml
@@ -31,6 +34,21 @@ extras:
3134
Remember, absolute paths start with `/` and relative paths do not.
3235
:::
3336

37+
### Extras Launch
38+
39+
If an `extras.launch` is specified, it is launched as part of the `clearpath-platform-extras.service` job. To check the status
40+
of the extras launch, run
41+
42+
```bash
43+
systemctl status clearpath-platform-extras.service
44+
```
45+
46+
To view the raw output from the extras launch, run
47+
48+
```bash
49+
sudo journalctl -fu clearpath-platform-extras.service
50+
```
51+
3452
### ROS Parameters
3553
A common use case is to set and update the parameters to the `platform_velocity_controller` node. These can be used to modify the linear and angular velocity and acceleratation.
3654

0 commit comments

Comments
 (0)