Skip to content

Commit

Permalink
Add documentation for spawning a model alongside launch ros_gz_bridge
Browse files Browse the repository at this point in the history
Signed-off-by: Aarav Gupta <[email protected]>
  • Loading branch information
Amronos committed Oct 25, 2024
1 parent 10afa24 commit 8bde312
Showing 1 changed file with 13 additions and 0 deletions.
13 changes: 13 additions & 0 deletions harmonic/ros2_spawn_model.md
Original file line number Diff line number Diff line change
Expand Up @@ -60,3 +60,16 @@ within this tag. Here's an example:
In this case the `<gz_spawn_model>` parameters are read from the command line.
That's an option but not strictly necessary as you could decide to hardcode some
of the values or not even use all of the parameters.


## Spawning a model alongside launching ros_gz_bridge

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)
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)

Example command for directly using these launch files from the terminal:
```bash
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>
```

More info about `ros_gz_bridge` can be viewed [here](ros2_integration).

0 comments on commit 8bde312

Please sign in to comment.