Skip to content

Commit ec9ccc0

Browse files
Add documentation for system.bash and updated platform.extras.launch (#475)
1 parent 3172298 commit ec9ccc0

File tree

2 files changed

+72
-7
lines changed

2 files changed

+72
-7
lines changed

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

Lines changed: 48 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -12,11 +12,12 @@ Despite all current customization options, we still would like our users to be a
1212
Extras have the following entries:
1313

1414
- **urdf:**
15-
- **package:** name of the ROS 2 package that contains the extras URDF (optional).
1615
- **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).
16+
- **package:** name of the ROS 2 package that contains the extras URDF (optional)
17+
- **launch:** a list of objects containing
1918
- **path:** relative path within the package or absolute path to robot extras launch file
19+
- **package:** name of the ROS 2 package that contains the extras launch file (optional)
20+
- **args:** launch arguments to pass to the launch file when it is started (optional)
2021
- **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.
2122

2223
```yaml
@@ -25,8 +26,8 @@ extras:
2526
package: package_name
2627
path: relative/path/to/urdf/in/package.urdf.xacro # or can contain /absolute/path/to/urdf.urdf.xacro
2728
launch:
28-
package: package_name
29-
path: relative/path/to/launch/in/package.launch.py
29+
- package: package_name
30+
path: relative/path/to/launch/in/package.launch.py
3031
ros_parameters: {} # node parameters, see below
3132
```
3233
@@ -132,8 +133,48 @@ The robot's URDF will now include the antenna, as shown in the image below:
132133

133134
## Extras Launch
134135

135-
If an `extras.launch` is specified, it is launched as part of the `clearpath-platform-extras.service` job. To check the status
136-
of the extras launch, run
136+
The launch files specified in this section are started as part of the `clearpath-platform-extras.service` job. Each launch file can be specified either as an absolute path or as a relative path within a package. Additionally, launch arguments may be specified with the `args` field:
137+
138+
```yaml
139+
platform:
140+
extras:
141+
launch:
142+
- path: /absolute/path/to/some/file.launch.py
143+
- path: launch/my_launch_file.launch.py
144+
package: my_package
145+
- path: launch/my_launch_with_args.launch.py
146+
package: my_other_package
147+
args:
148+
spam: eggs
149+
foo: bar
150+
```
151+
152+
The three launches above are equivalent to the following command-line invocations:
153+
154+
```bash
155+
ros2 launch /absolute/path/to/some/file.launch.py
156+
157+
ros2 launch my_package launch/my_launch_file.launch.py
158+
159+
ros2 launch my_other_package launch/my_launch_with_args.launch.py spam:=eggs foo:=bar
160+
```
161+
162+
:::note
163+
164+
In `2.7.x` and earlier `extras.launch` only supported a single launch file:
165+
166+
```yaml
167+
platform:
168+
extras:
169+
path: launch/my_launch_file.launch.py
170+
package: my_package
171+
```
172+
173+
If your `robot.yaml` file contains the old format you will see a deprecation notice. We recommend updating your `robot.yaml` to the new format by converting `extras.launch` to a list.
174+
175+
:::
176+
177+
To check the status of the extras launch, run
137178

138179
```bash
139180
systemctl status clearpath-platform-extras.service

docs_versioned_docs/version-ros2jazzy/ros/config/yaml/system.mdx

Lines changed: 24 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -121,6 +121,30 @@ servers:
121121
enabled: True
122122
```
123123

124+
## Bash Environment
125+
126+
Some ROS nodes may expect additional environment variables to be set. Instead of setting these system-wide, you may instead use the `system.bash` section to define additional environment variables or source additional bash files _before_ any ROS nodes are started by the Clearpath systemd jobs.
127+
128+
```yaml
129+
system:
130+
bash:
131+
source:
132+
- /path/to/some_config.bash
133+
- /path/to/another_setup.bash
134+
env:
135+
ADDITIONAL_ENVAR: spam
136+
ANOTHER_ENVAR: eggs
137+
```
138+
139+
This example will include the following in the generated `setup.bash` file used by all Clearpath systemd jobs:
140+
141+
```bash
142+
source /path/to/some_config.bash
143+
source /path/to/another_setup.bash
144+
export ADDITIONAL_ENVAR="spam"
145+
export ANOTHER_ENVAR="eggs"
146+
```
147+
124148
## Sample
125149

126150
<details>

0 commit comments

Comments
 (0)