ROS2 → PX4 Offboard Servo Control: actuator_servos Subscriber Issue and Servo Resetting to Neutral

HELLO EVERYONE !

My goal is to control the Pixhawk’s servo motor entirely via ROS 2 commands. I’ve already set up uxrce_dds_client and microXRCEAgent so that the communication link is working, and I’ve armed the drone in OFFBOARD mode using QGroundControl. Then I run:

ros2 topic pub -r 20 /fmu/in/actuator_servos px4_msgs/msg/ActuatorServos "{
  timestamp: $(date +%s%N),
  timestamp_sample: $(date +%s%N),
  control: [0.8, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0]
}"

I can see that my command actually reaches the servo, but for some reason it immediately snaps back to an initial or default value, so the servo oscillates instead of holding the desired position. I confirmed those alternating values by running:

ros2 topic echo /fmu/out/actuator_servos

What I want to know is: why is there something overriding my command back to the default value? I need only my command to take effect so the servo can move to and hold the specified position.

THANK YOU

Hi. It seems that there are other modules publishing the actuator_servos uORB message. Have you ever checked which modules do that?

This topic was automatically closed 90 days after the last reply. New replies are no longer allowed.