Drone and WindShape fans array control using OptiTrack cameras with ROS.
Check doxygen documentation here.
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
-
Numpy and MySQL Python API are necessary to run the main node. If not installed, it can be done using:
pip install numpy pip install MySQL-python
Note: If pip is not installed on your computer, use:
sudo apt-get install python-pip
-
(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
Note: QGC can also be installed on the Windows side.
The latest version of windshape 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 GUI using roslaunch command:
roslaunch windshape control.launch
You should see the interface and the drone will be automatically detected.
The parameters can be edited in windshape.yaml.
To see the replay of the plots:
rosrun windshape replay
You will have an interface to choose the log file (.txt).
Hover using offboard control: video here.
Drone control in mode "follow target": video here.
Drone control in mode "mimic target": video here.
Drone control in mode "reach position": video here.
Wind control using drone pitch (better with sound): video here.
Wind function: video here.
Drone and wind: video here.
- Adrien Fleury - Package creation - Adrien4193
This project is licensed under the BDS License - see the LICENSE.md file for details
Please report bugs (haha).