Offboard low-level control using thrust and torque setpoints

Hi everyone,

I want to send thrust and torque set points generated by a geometric controller. I am using ROS2 and the UXRCE protocol. I am utilizing this repository to send commands on topics.

There are two different modes: one of them is thrust + attitude setpoint, and the other is thrust + torque setpoint. When I implement the first mode, the drone is stable and can track any type of trajectory. However, when I switch to the second mode, the drone can fly but has an offset in the trajectory. This means that while the drone can fly and remain stable, it cannot accurately track the trajectory. Additionally, if I send a point setpoint to the drone, it hovers with slight oscillations and has an offset near the desired position setpoint.

I have tested both modes in Gazebo, and they work well, but I face this problem in real implementation. Interestingly, I encounter the same behavior when I implement a NMPC controller. I would really appreciate any help. (My drone is an X500 V2, and I am using firmware v1.14.)

“I found that when I was using thrust and torque for control, I set the thrust to [0, 0, -0.52] and torque = [0, 0, 0]. In the Gazebo simulation, after takeoff, the drone experiences a downward pitch, and after flying for a certain distance, the pitch suddenly increases dramatically until the drone flips. Do you know how to solve this?”