ROS 2 navigation package for PX4-based aerial vehicles with waypoint following and obstacle avoidance logic.
Designed for use with PX4 SITL and Gazebo, but extensible to real hardware.
Recommended environment:
- Ubuntu 22.04
- ROS 2 Humble
Required dependencies:
- PX4 Autopilot
px4_msgs(PX4 ROS 2 message definitions)- Micro XRCE-DDS Agent (PX4 ↔ ROS 2 communication)
- Gazebo (for SITL simulation)
Useful references:
- PX4 ROS 2 User Guide: https://docs.px4.io/main/en/ros2/user_guide
- PX4 Build & SITL: https://docs.px4.io/main/en/dev_setup/building_px4
- Micro XRCE-DDS: https://docs.px4.io/main/en/middleware/uxrce_dds
git clone https://github.com/PX4/PX4-Autopilot.git --recursive
cd PX4-Autopilot
bash ./Tools/setup/ubuntu.shRestart your terminal after installation.
mkdir -p ~/ros2_ws/src
cd ~/ros2_ws/srcClone required packages:
git clone https://github.com/WaliaRohan/px4_nav.git
git clone https://github.com/PX4/px4_msgs.gitcd ~/ros2_ws
source /opt/ros/humble/setup.bash
colcon build
source install/setup.bashIn a separate terminal:
cd PX4-Autopilot
make px4_sitl gazeboIn another terminal:
MicroXRCEAgent udp4 -p 8888source ~/ros2_ws/install/setup.bash
ros2 run px4_nav <node_executable>Replace <node_executable> with the actual executable name defined in CMakeLists.txt.
- This package assumes PX4 offboard control via ROS 2 topics.
- Message interfaces are defined using
px4_msgs.