More detailed step-by-step installation (should you require) can be found here. https://github.com/Intelligent-Quads/iq_tutorials/tree/master
- Do Desktop-full Install
- Follow until Step 1.7 at the end of the page
First, install ROS Noetic using the following instructions: http://wiki.ros.org/noetic/Installation/Ubuntu
We use catkin build instead of catkin_make. Please install the following:
sudo apt-get install python3-wstool python3-rosinstall-generator python3-catkin-lint python3-pip python3-catkin-tools
pip3 install osrf-pycommon
Then, initialize the catkin workspace:
mkdir -p ~/catkin_ws/src
cd ~/catkin_ws
catkin init
Install mavros and mavlink from source:
cd ~/catkin_ws
wstool init ~/catkin_ws/src
rosinstall_generator --upstream mavros | tee /tmp/mavros.rosinstall
rosinstall_generator mavlink | tee -a /tmp/mavros.rosinstall
wstool merge -t src /tmp/mavros.rosinstall
wstool update -t src
rosdep install --from-paths src --ignore-src --rosdistro `echo $ROS_DISTRO` -y
catkin build
Add a line to end of ~/.bashrc by running the following command:
echo "source ~/catkin_ws/devel/setup.bash" >> ~/.bashrc
update global variables
source ~/.bashrc
install geographiclib dependancy
sudo ~/catkin_ws/src/mavros/mavros/scripts/install_geographiclib_datasets.sh
Video Tutorial at https://youtu.be/1FpJvUVPxL0
In home directory:
cd ~
sudo apt install git
git clone https://github.com/ArduPilot/ardupilot.git
cd ardupilot
cd ardupilot
Tools/environment_install/install-prereqs-ubuntu.sh -y
reload profile
. ~/.profile
git config --global url.https://.insteadOf git://
git checkout Copter-4.0.4
git submodule update --init --recursive
Run SITL (Software In The Loop) once to set params:
cd ~/ardupilot/ArduCopter
sim_vehicle.py -w
Setup your computer to accept software from http://packages.osrfoundation.org:
sudo sh -c 'echo "deb http://packages.osrfoundation.org/gazebo/ubuntu-stable `lsb_release -cs` main" > /etc/apt/sources.list.d/gazebo-stable.list'
Setup keys:
wget http://packages.osrfoundation.org/gazebo.key -O - | sudo apt-key add -
Reload software list:
sudo apt update
Install Gazebo:
sudo apt-get install gazebo11 libgazebo11-dev
for more detailed instructions for installing gazebo checkout http://gazebosim.org/tutorials?tut=install_ubuntu
cd ~
git clone https://github.com/khancyr/ardupilot_gazebo.git
cd ardupilot_gazebo
build and install plugin
mkdir build
cd build
cmake ..
make -j4
sudo make install
echo 'source /usr/share/gazebo/setup.sh' >> ~/.bashrc
Set paths for models:
echo 'export GAZEBO_MODEL_PATH=~/ardupilot_gazebo/models' >> ~/.bashrc
. ~/.bashrc
In one Terminal (Terminal 1), run Gazebo:
gazebo --verbose ~/ardupilot_gazebo/worlds/iris_arducopter_runway.world
In another Terminal (Terminal 2), run SITL:
cd ~/ardupilot/ArduCopter/
sim_vehicle.py -v ArduCopter -f gazebo-iris --console
Install Drone Kit
sudo pip install dronekit simple-pid
Clone repository into catkin workspace.
cd catkin_ws/src/
git clone https://github.com/cweekiat/drone_sim.git
cd ~/catkin_ws/
catkin build
echo "GAZEBO_MODEL_PATH=${GAZEBO_MODEL_PATH}:$HOME/catkin_ws/src/drone_sim/models" >> ~/.bashrc
echo "GAZEBO_MODEL_PATH=${GAZEBO_MODEL_PATH}:$HOME/catkin_ws/src/drone_sim/worlds" >> ~/.bashrc
echo "GAZEBO_RESOURCE_PATH=~/ardupilot_gazebo/worlds:${GAZEBO_RESOURCE_PATH}" >> ~/.bashrc
echo "GAZEBO_PLUGIN_PATH=~/ardupilot_gazebo/build:${GAZEBO_PLUGIN_PATH}" >> ~/.bashrc
roslaunch drone_sim multi_drone.launch
Close all terminals you do not need and run simulation.
cd ~/catkin_ws/src/drone_sim/scripts
chmod +x start_sim end_sim multi-ardupilot.sh target.sh observer.sh
./start_sim
Note: start_sim will run every launch file and python script require for the simulation. It will open many terminals & windows in the process.