Skip to content

Accept a urdf per model in vrx_gz spawn configs - #895

Open
luisfelipewb wants to merge 1 commit into
osrf:jazzyfrom
luisfelipewb:model_urdf_config
Open

luisfelipewb wants to merge 1 commit into
osrf:jazzyfrom
luisfelipewb:model_urdf_config

Conversation

@luisfelipewb

Copy link
Copy Markdown

competition.launch.py has two ways to spawn: config_file:= sets the pose (and supports several vehicles) but ignores any URDF, while urdf:= sets the URDF but uses the fixed default pose. So a custom vehicle can't be spawned at a chosen position.

This PR lets each spawn config entry set urdf, and set_urdf() resolves package://<pkg>/<path> against the package's share directory, so both the config key and the existing urdf:= argument accept it:

- model_name: my_boat
  model_type: usv
  urdf: package://my_boat_gazebo/urdf/my_boat.urdf.xacro
  position:
    xyz: [-532, 162, 0.1]
    rpy: [0, 0, 1]

Entries without urdf behave as before. Related: #894 (robot_state_publisher uses the model name, needed for vehicles not named wamv).

Testing

Ubuntu 24.04, ROS 2 Jazzy, Gazebo Harmonic:

Spawn config entries can now set urdf:, so a config file can spawn vehicles other than the WAM-V. set_urdf() also resolves package://<pkg>/<path> against the package's share directory, which the urdf launch argument gets as well.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Signed-off-by: Luis Felipe Wolf Batista <luis.batista@gatech.edu>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant