How to use px4 offboard control in simulation

Run the px4 simulation with gazebo.

1
make px4_sitl_rtps gazebo

In the pxh ternimal, input:

1
2
3
param set COM_RCL_EXCEPT 4
param set NAV_DLL_ACT 0
param set NAV_RCL_ACT 0

warning Nnever use these parameters on a real drone, as it would allow it to fly without a backup RC connected.

use px4_ros_com.

Run micrortps_agent.

1
micrortps_agent -t UDP

Run the offboard control application.

Such as the demo in px4_ros_com.

1
ros2 run px4_ros_com offboard_control