/px4_ros2_sim

Px4 Simulation with Gazebo and ROS2 RTPS

Primary LanguageC++

Setup

Use uORB custom messages with ROS2

If you want to use other msgs beside default rtps msgs for ROS2, add them to urtps_bridge_topics.yaml, in:

cd px4_ros2_sim/PX4-Autopilot/msg/tools

python3 uorb_to_ros_urtps_topics.py -i urtps_bridge_topics.yaml -o ../../../px4_ros_com_ros2/src/px4_ros_com/templates/urtps_bridge_topics.yaml

cd ../.. 

make clean 

Then fallow the instructions below

Usage

To run the simulation and a sample mission, run the following parts.

Running PX4 Simulation

# In a new termianl
# Starting in the root of repo

cd ~/px4_ros2_sim/PX4-Autopilot/

make px4_sitl_rtps gazebo

Running micrortps

# In a new termianl

cd px4_ros2_sim/px4_ros_com_ros2/ #Or Where ever the file is and then cd

source install/setup.bash

micrortps_agent -t UDP

Running a Sample Mission

# In a new termianl

cd px4_ros2_sim/px4_ros_com_ros2/ #Or Where ever the file is and then cd

source install/setup.bash

#For Vel CMD
ros2 run px4_missions offBoardRTPS_Vel

#For Vel Pose
ros2 run px4_missions offBoardRTPS_Pose

Acknowledgement