This is a dynamic simulation environment built with ROS 2 foxy and Gazebo 11.14.0 on Ubuntu 20.04. This project allows for the creation and spawning of random mazes and objects, providing a versatile platform for testing and development. It also enables adding Epucks to interact with the created worlds.
Structure:
- workspace: project_ws,
- package: my_simulation,
- worlds:
room.world
: world with a simple rectangular room,maze.world
: world with a fixed maze,maze_gen.world
: world with a random maze,
- launch files:
objects.launch.py
: launches a random number of random static objects inroom.world
,epuck_objects.launch.py
: the same as previous but also launches an Epuck in the world,epuck_objects_bezier.launch.py
: the same as previous but also launches randomly shaped movable objects,epuck_bezier.launch.py
: launches an Epuck along with a randomly shaped movable object,epuck_maze.launch.py
: launches an Epuck inmaze_gen.world
,epuck_maze_objects.launch.py
: launches an Epuck inmaze.world
along with some movable objects,epuck.launch.py
: launches an Epuck inroom.world
,
- scripts folder: different scripts used by the launch files and
epuck_teleop_key.py
: used to move an Epuck when you have only one Epuck,epuck_teleop_key_two.py
: used to move an Epuck when you have two Epucks,epuck_controller.py
: used to move an Epuck inroom.world
from the spawn location to a pre-set location,epuck_maze_controller.py
: used to navigate an Epuck trough a maze inmaze_gen.world
from the spawn location to a pre-set location,
- models forlder:
.sdf
and.urdf
files for the objects and the Epuck, - meshes folder: meshes used to create the objects and the Epuck.
Instructions to run on Ubuntu 20.04:
- Make sure you have installed the right versions of Gazebo and ROS 2.
- Open the terminal and navigate to the location where you want the cloned repository. Then copy the HTTPS link for this repository and run
git clone HTTPS_LINK
. - Open project_ws in the terminal.
- Run:
-
colcon build
-
source install/setup.bash
-
where you replace ... with the location of project_ws on your computer.
export GAZEBO_MODEL_PATH=/.../project_ws/src/my_simulation/my_simulation/models:$GAZEBO_MODEL_PATH
- Depending on what simulation you want to run, choose the appropriate launch file.
ros2 launch my_simulation CHOSEN_LAUNCH_FILE
-
- The simulation should start.
- If you want to move your Epuck open project_ws in a new terminal while the simulation is running. Then choose one of the mentioned files in the scripts folder and run the following lines.
-
source install/setup.bash
-
ros2 run my_simulation CHOSEN_PYTHON_FILE (without .py)
-