osrf / vrx

Virtual RobotX (VRX) resources.
Apache License 2.0
390 stars 180 forks source link

support full paths to world files #682

Closed M1chaelM closed 1 year ago

M1chaelM commented 1 year ago

This provides the quickest fix to issue #680 by extracting a normalized world name from any incoming path, and adding a few likely names to our list of worlds that we recognize and create bridges for. It doesn't fix the deeper conceptual problems described in #680.

To test:

Run a task using an absolute path:

ros2 launch vrx_gz competition.launch.py world:=`pwd`/src/vrx/vrx_gz/worlds/stationkeeping_task.sdf

in another terminal run

ros2 topic list

and verify that you see the correct list of topics. Next, rename one of our task worlds to one of the generic names we use in our testing, and check the topics again to verify that it still works:

cp `pwd`/src/vrx/vrx_gz/worlds/stationkeeping_task.sdf stationkeeping0.sdf
ros2 launch vrx_gz competition.launch.py world:=`pwd`/stationkeeping0.sdf

Bonus: Gazebo will no longer crash if the user accidentally includes the world file extension.