Drone control using OptiTrack cameras with ROS.
This package has been tested on Ubuntu 16.04 in native and Virtual Machine with ROS Kinetic but other Linux and ROS configurations may work as well.
To run this program, you will need:
-
A Windows computer connected to the OptiTrack cameras running Motive.
-
An Ubuntu computer (or Virtual Machine) connected on the same network as the Windows one.
-
A drone equipped of a PixHawk running PX4 auto-pilot.
-
A WiFi card or dongle on the Ubuntu computer to connect to the drone's WiFi access point.
-
A WindShape fans array connected on the same network as the Ubuntu computer.
-
Install Ubuntu 16.04 (download).
-
Install ROS Kinetic as described in this tutorial.
-
Configure your ROS environment as described here.
Note: You will have to source your catkin workspace at each terminal prompt opening using:
source <path/to/your/catkin_ws>/devel/setup.bash
.To avoid that, in a terminal prompt, you can do the following:
Open bashrc (the script executed at each new terminal window) in gedit.
gedit ~/.bashrc
Then add this line at the end of the file (usually path is ~/catkin_ws):
source <path/to/your/catkin_ws>/devel/setup.bash
-
Install vrpn_client_ros (to collect 6DOF data from Motive):
sudo apt-get install ros-kinetic-vrpn-client-ros
-
Install MAVROS (to communicate with the flight controller running PX4 autopilot):
Install the ROS package:
sudo apt-get install ros-kinetic-mavros ros-kinetic-mavros-extras
Then 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 chmod +x install_geographiclib_datasets.sh sudo ./install_geographiclib_datasets.sh
-
Install the following Python libraries:
pip install numpy
-
(Optional) Install QGroundControl to monitor your drone:
First download the AppImage as described here.
Then, if QGC crashes when you launch the AppImage, enter in a terminal prompt:
sudo usermod -a -G dialout $USER sudo apt-get remove modemanager
The latest version of this package can be installed as follows:
In a terminal prompt, go to your catkin workspace source directory (usually located under $HOME/catkin_ws/src):
cd ~/catkin_ws/src
Download the source files (or fork and copy it manually):
git clone git://github.com/Adrien4193/windshape.git
Return to catkin root directory (catkin_ws here):
cd ..
Setup your environment using catkin (DO NOT run setup.py directly):
catkin_make
Setup your ROS environment to include the new development workspace:
. devel/setup.bash
Run the demo using roslaunch command:
roslaunch drone_control control.launch
It enables the control of the drone's thrust using a target detected by the motion capture.
The parameters can be edited in config/drone_control.yaml.
- Adrien Fleury - Package creation - Adrien4193
This project is licensed under the BDS License - see the LICENSE.md file for details
Please report bugs (haha).