Gimbal not moving with Typhoon_h480 in Gazebo

Hey guys,

I am using the Typhoon_h480 in gazebo with the attached gimbal. However, the gimbal is not moving. I tried it with the following piece of code:

void set_gimbal(float roll_, float pitch_, float yaw_)
{
  mavros_msgs::MountControl set_mount;
  set_mount.header.stamp = ros::Time::now();
  set_mount.mode = set_mount.MAV_MOUNT_MODE_MAVLINK_TARGETING;
  set_mount.roll = roll_;
  set_mount.pitch = pitch_ ;
  set_mount.yaw = yaw_ ;

  _pub_mountControl.publish(set_mount);
}

Is that the right way to control the gimbal through mavlink/mavros? Is my code wrong or might it be the .sdf file of the typhoon?

1 Like

Hi, I have the nearly problem.
At first, I set the parameter MNT_MODE_IN to MAVLINK_DO_MOUNT, then I can control the gimbal by mavros_msgs::MountControl message, which like yours.

When I set MNT_MODE_OUT to AUX, I can subscribe the topic /mavros/mount_control/orientation to get the orientation of the gimbal, but the model in gazebo not moving any more; When turn the MNT_MODE_OUT to MAVLink gimbal protocol v2, the model become normal, but not data in ros topic Orz.

1 Like