Offset between Yaw lock & Yaw Follow modes in gimbal

Hello everyone,
I am currently working on a hexacopter with a gimbal in which I have to point the gimbal to a ROI while the drone moves around. The configuration is as follows :
Hexacopter; Pixhawk 6C; PX4; Gremsy S1V3 gimbal (latest fw); QGroundControl (latest); RPi 4 as a companion computer (tested with & without; issue exists in both)

The gimbal works perfectly in Yaw follow mode and points to the yaw, pitch & roll angles I input.

The moment I input an ROI or any coordinate (via QGC or RPi code) in the earth frame, the control switches to yaw lock (naturally). The problem is that once yaw lock is enabled, the gimbal physically rotates by an angle of about 170 degrees. Meaning, the gimbal would be pointing at P0 Y0 R0 initially; once I switch to yaw lock, QGC still shows it at P0 Y0 R0 but the actual gimbal would turn to P0 Y170 R0.

After this, any ROI I input would show that QGC representation is pointing in the correct direction, but the actual gimbal would have a 170 degree yaw offset. Does anyone know how to fix this ?

Thanks & regards,
Bharath

1 Like

@JulianOes Is this something you could advise on?

Thank you for the response @hamishwillee . I was starting to wonder if I would not get a solution for the problem. Do let me know if you need any screenshots or logs of the same and thanks in advance @JulianOes .

There is no guarantee he will help - he’s a busy man and a contractor.

What’s your PX4 version and PX4 configuration for the gimbal? So what are the MNT_ parameters set to? E.g. are you using the MAVLink gimbal v2 protocol?

And can you share the output of gimbal status in the MAVLink console when you use ROI and you see the wrong angle?

It does sound to me like there is some over-compensation of angles going on somewhere.