This repository contains packages and setup files to run ROS-based robot simulations. The simulation environment is set up and run using the provided docker image (that needs to be built before use).
Empty world | Simple shapes world | Fire station world |
---|---|---|
Coolsingel world | Playground world | Collapsed house |
Rover | UAV | NXP Drone |
---|---|---|
If you are new to docker, have a look at the DOCKER_README.md
file in the simcloud/docker
folder to install docker and see how to build images.
To build the main simcloud image, run the following command from within the directory with the Dockerfile (simcloud/docker/ros_melodic_desktop_px4/
):
docker build -t ros_melodic_desktop_px4 .
To run a demonstration of the simulation environment (drone in a fire station), follow the provided DEMO_README.md
file in the demo
directory.
-
Move to the simcloud repository folder:
cd simcloud
-
Start your docker container from here using the provided script. Make sure to select the right script based on your machine's graphics card! (If it doesn't work you might need to build this docker image):
./docker/ros_melodic_desktop_px4/run.sh
or
./docker/ros_melodic_desktop_px4/run_intel.sh
Note: You can open multiple terminals running in the same docker container. To do this, from the host terminal run:
docker exec -it ros_melodic_desktop_px4 /bin/bash
(Remember to source the scripts below to set up required environment variables in this new terminal as well)
-
Move into the projects folder to access the simcloud files from your host:
cd /projects/
-
Move into the ros_packages folder (this will be your ros workspace):
cd ros_packages
-
Run
catkin_make
-
Source the ROS environment:
source devel/setup.bash
-
(Optional) If you would like to work with drones, you need to setup the px4 autopilot software. To do this, source the
init_uav_px4.sh
script in theuav
ROS package (to setup the correct variables):source $(rospack find uav)/scripts/init_uav_px4.sh # OR source src/uav/scripts/init_uav_px4.sh
Note: If you source your ROS workspace's
setup.bash
file again, you need to re-source theinit_uav_px4.sh
script to setup the ROS_PACKAGE_PATH environment variable. Otherwise thesetup.bash
will overwrite the ROS_PACKAGE_PATH and your program will not find the px4 package.
-
world with simple shapes:
roslaunch environments simple_shapes.launch
-
playground world:
roslaunch environments playground.launch
-
collapsed house world:
roslaunch environments collapsed_house.launch
-
coolsingel world:
roslaunch environments coolsingel.launch
-
collapsed fire station
roslaunch environments fire_station.launch
-
parking garage
roslaunch environments parking_garage.launch
-
roffa
roslaunch environments roffa.launch
-
Spawn a rover (TODO: add parameters to spawn multiple robots):
roslaunch rover_gazebo spawn_rover.launch
Tele-operate the rover using the [IJKL,] keys:
rosrun teleop_twist_keyboard teleop_twist_keyboard.py
-
Spawn an UAV in a certain configuration, currently available [iris_camera, iris_depth_camera, iris_front_camera, iris_lidar, iris_rplidar] (TODO: add parameters to spawn multiple robots):
roslaunch uav spawn_uav.launch uav_model:=iris_camera
Or spawn the NXP drone:
roslaunch uav spawn_nxp.launch
You can command the UAV (position control) using the scripts in
pos_control
. For example, in a new terminal, run:rosrun collapsed_house_pos_control FLYinCollapsedHouse.py
Finally, you need to arm the drone for flying by running the corresponding mavros commands in another terminal:
rosrun mavros mavsys mode -c OFFBOARD rosrun mavros mavsafety arm # OR run `rosrun uav arm_uav.sh`
-
UAV's with different sensors are available:
iris_camera
holds a downward facing camerairis_front_camera
has a front facing camerairis_rplidar
has a 2D rplidar on topiris_lidar
has a 3D velodyne lidar on topiris_lidar_camera
has a 3D velodyne lidar on top and a front facing camera --> however the tf tree seems broken for the lidar.
Add the name of these models as value for the
uav_model
argument, for example:roslaunch uav spawn_uav.launch uav_model:=iris_front_camera
To start QGroundControl move its folder and start the run script:
cd /QGroundControl
./qgroundcontrol-start.sh
In QGroundControl you can arm the UAV using the buttons highlighted in red in the below image.
You can also create a mission plan and set waypoints for the drone to follow (highlighted in blue in the images).
Finally, upload and start the mission (highlighted in green in the images). The drone should launch its flight in Gazebo.
-
Rover in the shapes environment:
-
Rover in the playground:
-
Rover in the collapsed house:
-
Rover on the Coolsingel:
-
UAV on the Coolsingel:
-
Multiple UAVs and a rover in the collapsed house:
- create new combined launch files for different scenarios
- use parameters to launch as many robots you want
- connect to a config file to set parameters
- create videos
- create cloud hosting
- MVP:
- Scripts to launch scenarios (Open API/Scenario)
- Rover, drone navigation stacks
- Cloud hosting
- GUI (Qtcreator?)
- Security and protected files
- ROS training pdfs
- Sensor menu card?
If you have already installed docker then you can use the following lines to start docker and open new terminals. If you need to install it, please jump to the installation section.
-
Move into the folder of the files you would like to use inside docker:
cd ~/<path-to-your-ros-packages>/
-
Start docker:
./<path-to-your-docker-image/run.sh
-
Inside the docker image move into the
/projects
folder to access the files from your host folder. -
Open a new terminal inside the docker environment:
docker exec -it <name-of-your-docker-image> /bin/bash
-
Source the environment variables in this terminal as well:
. ros_entrypoint.sh
-
Move into the projects folder to access files from your host:
cd projects/
-
Move into the ros_packages folder ( this will be your ros workspace):
cd ros_packages
-
Source the environment:
source devel/setup.bash