Servo not working with mavsdk

Hello,

I have a problem when I try to move servo9 of the simulated drone ArduCopter.

When I send a COMMAND LONG DO_SET_SERVO so I can move it, it moves when the command is sent with mavproxy or ArduCopter directly.

We can see that the command is sent and we have a response from the autopilot.

But when i try to send the same message with a mavsdk c++ code :

the message is sent to the autopilot, but with no response.

I am using :

  • Raspberry Pi 4B, Ubuntu 20.04;
  • Mavsdk v0.39.0;
  • Ardupilot 4.6.0;

Here is Servo parameters :

  • SERVO9_FUNCTION 0
  • SERVO9_MAX 1900
  • SERVO9_MIN 1100
  • SERVO9_REVERSED 0
  • SERVO9_TRIM 1500

I found a solution.

It is better to send a command than a raw mavlink message.

Mavsdk code

1 Like