ROS Setup - mzahana/dlp GitHub Wiki
The DLP package provides ROS interface for a multi-quadrotor simulation environment in Gazebo. The quadrotor flight control is based on PX4 firmware, which is easily interfaced to ROS using MAVROS. This package is tested with ROS Kinetic on Ubuntu 16.04LTS.
NOTE: For multi-drone simulation, a good PC is needed as the simulation requires a lot of resources.
Setup
NOTE: It is assumed that the DLP package is not installed as it is included in the following steps.
- Install ROS Kinetic on Ubuntu 16.04
- Install package building tools
sudo apt-get install python-catkin-tools python-rosinstall-generator -y
- Install MAVROS using
apt-getas described here. Follow the binary installation procedure. Basically, you execute the following steps
sudo apt-get install ros-kinetic-mavros ros-kinetic-mavros-extras
install GeographicLib datasets by running the install_geographiclib_datasets.sh script
wget https://raw.githubusercontent.com/mavlink/mavros/master/mavros/scripts/install_geographiclib_datasets.sh
and run the script:
sudo bash ./install_geographiclib_datasets.sh
-
Install PX4 environment. Use the script mentioned in Pixhawk/NuttX (and jMAVSim) section. The script name is
ubuntu_sim_nuttx.sh. This step will prepare the PX4 simulation environment. -
Create a
catkin_wsfor ROS development
cd ~
mkdir -p ~/catkin_ws/src
cd ~/catkin_ws
catkin init
wstool init src
- Clone the DLP package inside
~/catkin_ws/src/folder.
cd ~/catkin_ws/src
git clone https://github.com/mzahana/dlp.git
cd cd ~/catkin_ws/
-
Install the GLPK library as mentioned in the stand-alone setup page of this Wiki.
-
Compile your
catkin_ws
cd ~/catkin_ws/
catkin build
- make symbolic links of the
PX4andmavlink_sitl_gazebopackages inside yourcatkin_ws. Assuming that the PX4 firmware folder is located in~/src/Firmware
# navigate to catkin_ws
cd ~/catkin_ws/src
# create symbolic link
ln -s ~/src/Firmware/ px4
ln -s ~/src/Firmware/Tools/sitl_gazebo/ mavlink_sitl_gazebo
# compile your workspace
cd ~/catkin_ws
catkin build
Copying simulation files to PX4 Firmware folder
- Copy
~/catkin_ws/src/dlp/simulation_files/single_vehcile_spawn.launchtoFirmware/launch/ - Copy all files in
~/catkin_ws/src/dlp/simulation_files/ekf2/toFirmware/posix-configs/SITL/init/ekf2/ - test if the simulation works. open a terminal and execute
roslaunch dlp gazebo_and_px4_3vs3_medium_world.launch
Done!