/Drone-Project-code

SDR, autonomy pipeline, and flight path generator codes for a drone-based antenna calibrator project.

Primary LanguagePythonApache License 2.0Apache-2.0

Drone-Project-code 🚁

Description

The Precision Radio Instrument for Antenna Measurements (PRAM) is a high accuracy drone-based calibrator targeted primarily towards low-frequency radio astronomy instruments. These are codes for the base station, payload computer, and for generating flight paths. The following README will detail how to install dependencies on the base station computer and run the SITL simulations. These simulations combine the SDR code with ROS and the flight stack to make the calibration autonomous. More details inside each folder.

Tip

Start by cloning the repo into a catkin workspace:

mkdir /home/$USER/catkin_ws/src/ -p
cd /home/$USER/catkin_ws/src
git clone https://github.com/km5es/Drone-Project-code.git

Dependencies:

As of now, these are the most pertinent top-level software dependencies:

  • Ubuntu 18.04
  • Python 2.7
  • Ardupilot firmware for the flight controller.

Here are (some) of the additional dependencies. Follow instructions in the links for more. Payload computer dependencies and instructions are provided here.

UHD and GNU Radio

Follow instructions here. Tested with UHD 3.13.0.0 and 3.15.0.0 and GNU Radio v3.7.13.4.

Note: GNU Radio v3.8 and higher use Python 3. A complete migration to Python 3 is TBD.

ROS Melodic + SITL toolchain

1. A convenience shell script will install ROS, Gazebo, MAVROS, Geographiclib and everything else. It will also set up a catkin workspace.

cd /home/$USER/catkin_ws/src/Drone-Project-code/
source ubuntu_sim_ros_melodic.sh

3. Some additional dependencies that the shell script does not address (after getting repeated build errors):

sudo apt-get install libprotobuf-dev libprotoc-dev protobuf-compiler libeigen3-dev libxml2-utils python-rospkg python-jinja2
sudo apt-get install libgstreamer-plugins-base1.0-dev gstreamer1.0-plugins-bad gstreamer1.0-plugins-base gstreamer1.0-plugins-good gstreamer1.0-plugins-ugly –y
pip install geographiclib termcolor && pip3 install geographiclib termcolor 

4. Ardupilot firmware:

Follow instructions here. To set a custom start location for the simulation edit the /home/$USER/.config/ardupilot/locations.txt file like so:

#NAME=latitude,longitude,absolute-altitude,heading
MiltonAirfield=37.994125,-78.397535,28.5,90

If locations.txt does not exist, create it. Change coordinates and the name of the starting location as necessary.

Install Geographiclib datasets:

cd ~/catkin_ws/src/Drone-Project-code/
chmod +x install_geographiclib_datasets
sudo ./install_geographiclib_datasets

Install MAVROS:

sudo apt-get install ros-melodic-mavros

Install mavlink-routerd by following instructions here.

5. Install QGroundControl. Detailed instructions here. Before downloading the app image do this:

sudo usermod -a -G dialout $USER
sudo apt-get remove modemmanager -y
sudo apt install gstreamer1.0-plugins-bad gstreamer1.0-libav gstreamer1.0-gl -y

Log out and log back in. Then download the app image file from here.

chmod +x ./QGroundControl.AppImage
./QGroundControl.AppImage  (or double click)

6. Build the ROS nodes:

cd /home/$USER/catkin_ws/
catkin_make