0

when I run

export TURTLEBOT3_MODEL=burger && \
ros2 launch turtlebot3_gazebo turtlebot3_world.launch.py

I can see a world with a robot. but when I create a world with gazeboo (test.world) and save objects in this world and then run

export TURTLEBOT3_MODEL=burger && \
ros2 launch turtlebot3_gazebo turtlebot3_world.launch.py world:=test.world

the world is not exporting.

I found a file turtlebot3_worlds/burger.model

<model name="turtlebot3_world">
<static>1</static>
<include>
    <uri>model://turtlebot3_world</uri>
</include>
</model>

and when I commend this part it removes the world, but I didn't find a way to launch tirtlebot3 and my world. I get empty world if I comment that model. But navigation doesn't work when I run slam part

export TURTLEBOT3_MODEL=burger && \
ros2 launch turtlebot3_cartographer cartographer.launch.py use_sim_time:=True

and nav part

export TURTLEBOT3_MODEL=burger && \
ros2 launch turtlebot3_navigation2 navigation2.launch.py use_sim_time:=True map:=$HOME/map.yaml
le4a
  • 39
  • 4
  • If you want to load your own world, you have to create your own launch file. I couldn't find a launch file with a world parameter to load, unfortunately. Just copy the `turtlebot3_world.launch.py` file and [change the path to the world file here](https://github.com/ROBOTIS-GIT/turtlebot3_simulations/blob/humble-devel/turtlebot3_gazebo/launch/turtlebot3_world.launch.py#L36-L40). – Darkproduct Mar 20 '23 at 13:54
  • it's strange but I have a little different lines of code I don't really have 'turtlebot3_world.world' but I will try it `world_file_name = 'turtlebot3_worlds/' + TURTLEBOT3_MODEL + '.model' world = os.path.join(get_package_share_directory('turtlebot3_gazebo'), 'worlds', world_file_name)` – le4a Mar 20 '23 at 15:55
  • Checkout the branch for the ros distro you are using. I linked the version from ros2 humble. – Darkproduct Mar 20 '23 at 16:21
  • I am using foxy. I cloned the repo changed turtlebot_3 world directly but it seems it loads the world from /opt/ros/foxy/share/turtlebot3_gazebo and in the file path refers to a model world_file_name = 'turtlebot3_worlds/' + TURTLEBOT3_MODEL + '.model' that I said above – le4a Mar 20 '23 at 16:25
  • is it possible to run turtlebot3_world.launch file in the repo and modify it? – le4a Mar 20 '23 at 16:27
  • If you used a cloned version of this repo directly you need to uninstall the binary version. The path to the world file is set with `get_package_share_directory('turtlebot3_gazebo')` which searches for the `turtlebot3_gazebo` package and it finds the binary one first. – Darkproduct Mar 20 '23 at 16:32
  • Let us [continue this discussion in chat](https://chat.stackoverflow.com/rooms/252620/discussion-between-darkproduct-and-le4a). – Darkproduct Mar 20 '23 at 16:33

0 Answers0