This repository is a Python-based ROS 2 Humble package that uses MAVROS for drone navigation. It includes an action server that accepts PoseStamped waypoints to guide the drone along a defined route. The package relies on ROS 2 communication and MAVROS integration with MAVLink-compatible flight controllers, and it is designed to be easy to deploy and customize.
This package was tested in an Ubuntu 22.04 environment using ROS Humble
Tested with ROS Humble https://docs.ros.org/en/humble/Installation.html
PX4 Autopilot (see this link )
- git clone https://github.com/PX4/PX4-Autopilot.git --recursive
- bash PX4_Autopilot/Tools/setup/ubuntu.sh
- sudo apt remove gz-harmonic
- sudo apt install aptitude
- sudo aptitude install gazebo libgazebo11 libgazebo-dev
- cd PX4_Autopilot
- make px4_sitl gazebo-classic
- sudo apt install ros-humble-mavros
- source /opt/ros/humble/setup.basah
- ros2 run mavros install_geographiclib_datasets.sh
- source /opt/ros/{ROS_DISTRO}/setup.bash
- On the package folder
- colcon build
- cd PX4-Autopilot/
- export PX4_HOME_LAT={HOME_LATITUDE}; export PX4_HOME_LON={HOME_LONGITUDE}; export PX4_HOME_ALT={HOME_ALTITUDE}; make px4_sitl gazebo-classic HEADLESS=1
- The headless option is to disable the gazebo GUI.
- "gazebo-classic" part may be different accordingly to your simulation setup, see this for more information
- source /opt/ros/{ROS_DISTRO}/setup.bash
- ros2 run mavros mavros_node --ros-args --param fcu_url:=udp://:14540@
- source /opt/ros/{ROS_DISTRO}/setup.bash
- On the package folder
- source install/setup.bash
- ros2 launch launch/example_launch.py
- The "path_planner.py" node is just a simple example that reads x and y files, this is a very simple implementation designed specifically for a purpose in another system, you should change it for your application