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.
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.
Oh, you’re talking SITL, not the real Typhoon H480. Sorry I was confused. It’s time I take a break over Christmas .
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.
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.