Collection of Gazebo ROS Simulation environments from various sources and prepared for testing with different ROS packages.
build the docker images (base ros2 > development overlay)
# move to workspace directory
cd ws_robot_worlds
./src/robot_worlds/docker/build_docker.sh
If the build is successful, run the docker container with the development workspace. The local folders are mounted to the docker workspace when running. this allows you to edit/view your code directly on your filesystem, which runs in the docker container.
run:
./src/robot_worlds/docker/run_docker.sh
This opens up a bash terminal in a new preconfigured and sourced ROS2 workspace.
Proceed to build and source your workspace
colcon build --symlink-install && source install/setup.bash
mkdir -p robot_worlds_ws/src
cd robot_worlds_ws
git clone https://github.com/yojuna/robot-worlds
colcon build --symlink-install
source install/setup.bash
handle missing dependencies
rosdep install --from-paths src -y --ignore-src
or install manually if somethings gets missed.
- index for different launch files to be included eventually.
run,
ros2 launch robot_worlds tb3_om_gz_moveit.launch.py
tb3 simulation setup guide: https://emanual.robotis.com/docs/en/platform/turtlebot3/simulation/
cd src
git clone -b humble-devel https://github.com/ROBOTIS-GIT/turtlebot3_simulations.git
cd ../
colcon build --symlink-install && source install/setup.bash
Run the tb3 world simulation
ros2 launch robot_worlds tb3_world.launch
if gazebo throws errors when using with docker: run:
. /usr/share/gazebo/setup.sh
this sets up necessary gazebo environment variables and other things. ref: https://answers.ros.org/question/358847/cannot-launch-gzclient-on-a-launch-file-results-in-shared_ptr-assertion-error/
Turtlebot3 simulation worlds
reference: robotis turtlebot3 E manual
after building, run,
export TURTLEBOT3_MODEL=waffle
ros2 launch robot_worlds tb3_house.launch.py
This starts gazebo with preconfigured rviz (camera, odom, laserscan in the /odom global frame) and a teleop node to move the turtlebot around.
run,
export TURTLEBOT3_MODEL=waffle
ros2 launch robot_worlds tb3_world.launch.py
This repository would not have been possible without the painstaking work of these references:
-
Gazebo models and worlds collection
- referred sources:
-
Gazebo Small Warehouse, Bookstore and Small House worlds available for simulation | ROS Discourse
- A set of Gazebo worlds models and maps that I use for testing Navigation2
- These models are tested using Gazebo 9 and Gazebo 11.
1- Copy the model you want to use in .gazebo/models directory.
or
- Set Gazebo model path for the worlds with models directory
2- Gazebo -> Insert -> <World_Model_Name>
or
- go to gazebo word directory and type
gazebo example.world
Most models come with maps.
export GAZEBO_MODEL_PATH=/home/<user_name>/.gazebo/models/small_house/models/
gazebo small_house.world
- unzip the models_part# into a dicrectory called models
export GAZEBO_MODEL_PATH=/home/<user_name>/.gazebo/models/hospital/models/
gazebo hospital.world
gazebo hospital_two_floors.world