Send actuator_controls_0 from ROS 2 to PX4. But px4_ros_com is deprecated

My goal is to send [roll, pitch, yaw, thrust] commands from ROS 2 to PX4. I was following this guide:

However, I quickly realized that the documentation is outdated and that px4_ros_com is now deprecated (reference).

I’m not targeting make px4_sitl_rtps at the moment, and now I’m really confused about the current supported way to send actuator commands (like actuator_controls_0) from ROS 2 to PX4.

Can someone clarify what the modern and recommended approach is for this use case?

This is the new thing that you’re supposed to use: uXRCE-DDS (PX4-ROS 2/DDS Bridge) | PX4 Guide (main)

JulianOes Thank you very much for your reply.
Is actuator_controls_0 deprecated in PX4 v1.14, v1.15? Is there any replacement for actuator_controls_0
If so, is there another recommended way to send [roll, pitch, yaw, thrust] commands, similar to a control panel interface?

I can see my values in the attitude target field in MAVLink Inspector, but the drone doesn’t fly

have you tried mavros, u can send control cmds to some topic via ros nodes

You need to populate the /fmu/in/vehicle_command topic with a message of type px4_msgs::msg::VehicleCommand as shown below. This will allow you to control the desired motor.


#define MC_MOTOR_1 (101.00f)
#define MC_MOTOR_2 (102.00f)
#define MC_MOTOR_3 (103.00f)
#define MC_MOTOR_4 (104.00f)
#define OFFSET_ACTUATOR_SET_1 (301.00f)
#define OFFSET_ACTUATOR_SET_2 (302.00f)
#define OFFSET_ACTUATOR_SET_3 (303.00f)
#define OFFSET_ACTUATOR_SET_4 (304.00f)
#define OFFSET_ACTUATOR_SET_5 (305.00f)
#define OFFSET_ACTUATOR_SET_6 (306.00f)
.
.
.

publishVehicleCommand(uint16_t command, float param1, float param2, float param5, uint8_t system){
  VehicleCommand msg{};
  msg.param1 = param1;
  msg.param2 = param2;
  msg.param5 = ((system == 255) ? 1000.00f + param5 : param5);
  msg.command = command;
  msg.target_system = 1;
  msg.target_component = 1;
  msg.source_system = system;
  msg.source_component = 1;
  msg.from_external = true;
  msg.timestamp = this->get_clock()->now().nanoseconds() / 1000;
}
.
.
.
publishVehicleCommand(VehicleCommand::VEHICLE_CMD_ACTUATOR_TEST, 10, 1.00f, MC_MOTOR_1, 255);