ROS node to control a px4-firmware drone. Waypoints following, intelligent landing.
- Install Gazebo, jMAVsim simulators and Pixhawk tools, reference:
wget https://raw.githubusercontent.com/PX4/Firmware/master/Tools/setup/ubuntu.sh
wget https://raw.githubusercontent.com/PX4/Firmware/master/Tools/setup/requirements.txt
bash ubuntu.sh
sudo apt-get install ros-melodic-mavros ros-melodic-mavros-extras
wget https://raw.githubusercontent.com/mavlink/mavros/master/mavros/scripts/install_geographiclib_datasets.sh
sudo bash install_geographiclib_datasets.sh
- Clone and build PX4 Firmware:
mkdir ~/src; cd ~/src
git clone https://github.com/PX4/Firmware.git --recursive
cd ~/src/Firmware
make px4_sitl_default
- Create ROS catkin workspace and build the package:
mkdir -p ~/catkin_ws/src
cd ~/catkin_ws/src
git clone https://github.com/RuslanAgishev/px4_control/
cd ~/catkin_ws
catkin_make
source ~/catkin_ws/devel/setup.bash
- In order to fly in a simulator:
- launch a simulated environment (Jmavsim):
cd PX4/Firmware/
make px4_sitl_default jmavsim
if it shows ant: command not found error, do:
sudo apt-get update
sudo apt-get install ant
if it shows "Ant needs tools.jar and unable to find it", do:
sudo apt-get install openjdk-8-jdk
- connect to the simulated drone:
cd aerovr_ws/
source ~/aerovr_ws/devel/setup.bash
roslaunch px4_control px4_sim.launch
- execute flight command:
rosrun px4_control drone_test.py