Using pymavlink to control bluerov

Hi @JiaXu_Zhang, welcome to the forum :slight_smile:

RC inputs are not the same as RC outputs.

  1. Have you configured your output 9 channel to correspond to Lights1 inputs (by setting SERVO9_FUNCTION to RCIN9, or via the Lights page in QGroundControl)?
  2. Does it work to control the lights using QGroundControl?
  3. Is there a reason you’ve changed the set_rc_channel_pwm function to use zero-based indexing for the channel-id, and only provide 12 values instead of the 18 used in our example?

That shouldn’t be necessary. Both lights control and mode changing are working fine for me on Pymavlink 2.4.37 (I just updated it to the latest version).

Note that if you’re using BlueOS there may be issues with changing mode if you have not explicitly waited for an autopilot heartbeat, because there are other MAVLink components on the same system.