Skip to content

Commit cc6d850

Browse files
committed
Add documentation for spawning a model alongside launch ros_gz_bridge
Signed-off-by: Aarav Gupta <[email protected]>
1 parent 10afa24 commit cc6d850

File tree

1 file changed

+13
-0
lines changed

1 file changed

+13
-0
lines changed

harmonic/ros2_spawn_model.md

Lines changed: 13 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -60,3 +60,16 @@ within this tag. Here's an example:
6060
In this case the `<gz_spawn_model>` parameters are read from the command line.
6161
That's an option but not strictly necessary as you could decide to hardcode some
6262
of the values or not even use all of the parameters.
63+
64+
65+
## Spawning a model alongside launching ros_gz_bridge
66+
67+
An example launch file for XML can be viewed [here](https://github.com/gazebosim/ros_gz/blob/jazzy/ros_gz_sim/launch/ros_gz_spawn_model.launch)
68+
An example launch file for Python can be viewed [here](https://github.com/gazebosim/ros_gz/blob/jazzy/ros_gz_sim/launch/ros_gz_spawn_model.launch.py)
69+
70+
Example command for directly using these launch files from the terminal:
71+
```bash
72+
ros2 launch ros_gz_sim ros_gz_spawn_model.launch.py world:=empty file:=$(ros2 pkg prefix --share ros_gz_sim_demos)/models/vehicle/model.sdf entity_name:=my_vehicle x:=5.0 y:=5.0 z:=0.5 bridge_name:=ros_gz_bridge config_file:=<path_to_your_YAML_file>
73+
```
74+
75+
More info about `ros_gz_bridge` can be viewed [here](ros2_integration).

0 commit comments

Comments
 (0)