On realtime control of gimbal from companion computer

#1

What I am trying to do:

I have been looking into enabling offboard gimbal control from the companion computer to use it for human tracking. (such as what skydio does). The gimbal should be able to look at certain objects / positions while the vehicle is doing aggressive maneuvers. However, I quickly realized the current firmware doesn’t seem to support this functionality properly. I would like to get some comments on what is the right direction on implementing this.

This is how far I went so far:

  • I have been trying to use the actuator_control commands through mavros with group_mix=2 which is the gimbal.
  • Previously acutaotr_commands made the vehicle ignore every setpoint, So a fix was made in this Pull Request to not ignore offboard setpoints when the actuator commands were for the gimbal. In order to use this, vmount needs to be off
  • The video of using actuator setpoints using mavros in SITL is shown below. I am making the drone follow a circular trajectory by sending bodyrate and thrust setpoints. The tracking performance is not so good due to the jitter of the setpoints. Without the actuator setpoints, it can fly quite well

Issues:

  • Sending actuator setpoints result in glitches in the offboard setpoints. This I was not able to figure out why. body_rate setpoints becomes jittery when actuator setpoints are sent at high rates(100Hz).

Using actuator setpoints is a hack anyway, so an alternative would be using MAV_DO_MOUNT_CONTROL. However, this is a mission command and does not enable continous setpoints for the gimbal control.

Would defining more mavlink messages to enable this be necessary? or would there be a better way to enable this? I would appreciate any comments.