Getting gimbal position, Typhoon H480

I am using ROS Noetic and running a Gazebo with a Typhoon H480 model.
I need to get the angles of gimbal. I found three topics that seem to be useful to me:
/mavros/mount_control/command
/mavros/mount_control/orientation
/mavros/mount_control/status
But when I listen to topics “/mavros/mount_control/orientation” and “/mavros/mount_control/status”, there are no messages there, instead I get:
WARNING: no messages received and simulated time is active.
Is /clock being published?

What am I doing wrong? How do I get the gimbal angles?

I think the MAVLink message that you should expect is MOUNT_ORIENTATION. Can you check if you see that one coming in? E.g. using QGC MAVLink inspector.

The most similar thing I found was GIMBAL_DEVICE_ATTITUDE_STATUS. But I don’t understand at all how I can get its values in ROS


Ok, this means the new gimbal v2 protocol is supported, which is great. I’m the author of that protocol but I forgot that we ported it to Typhoon H480. What sort of version of PX4 are you running on the Typhoon H480?

And this explains why it doesn’t show up in MAVROS. I assume MAVROS does not support gimbal v2 yet.

I use v1.13.1.
What do you advise me to do?

  1. Switch to an older version of autopilot (which one?)
  2. Wait for protocol support in ROS (is work underway now?)
  3. Maybe I can somehow change the protocol to an older one using QGC

Oh, you’re talking SITL, not the real Typhoon H480. Sorry I was confused. It’s time I take a break over Christmas :smile:.

So, I suggest you switch to the gimbal v1 protocol. In theory you should be able to change the protocol which is used between MAVROS (and QGC) and PX4 only but does not change the way how PX4 talks to the Gazebo gimbal plugin.

For this, you would change the param MNT_MODE_IN to 3, and then you restart SITL. (Or you change it in the startup script if you want it to stick.

And maybe make an issue for MAVROS to raise awareness regarding gimbal v1 vs. v2.

More docs are here: Gimbal Protocol v2 · MAVLink Developer Guide

Unfortunately, it didn’t help. I set MNT_MODE_IN to 3: MAVLINK_DO_MOUNT (protocol v1, to be deprecated) and rebooted.
But message MOUNT_ORIENTATION did not appear, message GIMBAL_DEVICE_ATTITUDE_STATUS remained.

I will definitely make an issue for MAVROS

GIMBAL_DEVICE_ATTITUDE_STATUS is still sent because the gimbal itself sends it.

Now, MOUNT_ORIENTATION probably needs to be requested or started manually. For the onboard mode it should be sent automatically, see here:

And onboard is what is used on the MAVLink instance on UDP port 14540, see:

Is that the one you’re using?

If you’re using 14550 instead, then it might not be sent by default and you have to request it.

Then the next question is if the gimbal module actually publishes MOUNT_ORIENTATION.
The publish method is there: PX4-Autopilot/output.cpp at fe80e7aa468a50bec6b035d0e8e4e37e516c84ff · PX4/PX4-Autopilot · GitHub

And then here is your answer why it doesn’t work:

I think you need to change that part to make it always send for you.