Simulator MRS

Tutorial - Installation


- Ubuntu LTS (Focal Fossa)

- Packages

$ sudo apt-get install git

Step 1 - Install the MRS package

In the prompt:

$ cd /tmp

$ echo '
mkdir -p $GIT_PATH

git clone

cd mrs_uav_system
git checkout master
git pull
./ -g $GIT_PATH
source ~/.bashrc ' > && source

Case. Error "exit code 1" change the file ~/git/mrs_uav_system/scripts/ to this file and run the installation again

Case. Error "exit code 100"  can to erase  “sudo apt-get -y update” of the filles with error

Note: user is computer user


Step 2: Install the package


$ cd ~/workspace/src

$ git clone

$ catkin build

$ . ~/workspace/devel/setup.bash

Step 3: Setting Gazebo

Start Gazebo by entering the following at the command prompt.

$ gazebo

Click in Edit -> Model Editor

Click in File -> Save as

Save the model in the Location: /workspace/src/robotica_movel/models.

See example, the instructions in this video are until the minute 1:30  (, 

Note: In the video appears the path "catkin_ws/src/Petrobras_Challenge/models" but in this case we will be "workspace/src/robotica_movel/models".

Step 4: Test the environment

$ cd

$ bash workspace/src/robotica_movel/src/start/

After this execution the uav will be flying on the scenario

Note: If the error appears “reference validation failed, potential collision with an obstacle!

In the prompt: 

$ cd ~/mrs_workspace/src/uav_core/ros_packages/mrs_uav_managers/src

Delete the control_manager.cpp. Copy the control_manager.cpp file from repository:, and paste in the same place.

$ catkin build

$ cd

$ bash mrs_workspace/src/robotica_movel/src/start/

Step 5: Use algorithms and information available from MRS

Repository 1:

Repository 2:

Topic Informations: 

Localization:  /uav1/odometry/odom_main

Laser: /uav1/garmin/range

Global motion: /uav1/control_manager/reference

Local motion: /uav1/control_manager/goto_fcu

Extra 1: Ways to stop the simulation

Press “CTRL + a” and after “k”  in the prompt 

If something remains open:

$ alias killg='killall gzclient && killall gzserver && killall rosmaster'

$ killall px4

$ tmux kill-server

Extra 2: Learning ROS

Communication with the MRS will be done through ROS. If you are not yet aware, it is interesting to carry out the tutorial 1.1.1 to 1.1.18 link:

Note: In the class - Week 02, we will see ROS, but it is important for improving your expertise to do the tutorials. That will be passed as Frequency Activity of Week 02.

Extra 3: Change environment

Open the file ~/workspace/src/robotica_movel/src/start/

The line 31 will be:

$ 'Gazebo' "waitForRos; roslaunch robotica_movel simulation_arena.launch world_name:=fase1 gui:=true

Change the world_name:=fase1 to world_name:=floresta, or some world present in ~/workspace/src/robotica_movel/worlds