mirror of
https://gitee.com/mirrors_PX4/PX4-Autopilot.git
synced 2026-10-21 12:13:34 +08:00
gimbal: correctly set gimbal_device_id
When we use a gimbal connected via "RC", so PWM via the Aux channels, we need to set the gimbal_device_id to 1 as per the protocol. This was missing for GIMBAL_DEVICE_ATTITUDE_STATUS, so I added that, and fixed the name of that variable while at it.
This commit is contained in:
@@ -3063,7 +3063,7 @@ MavlinkReceiver::handle_message_gimbal_device_information(mavlink_message_t *msg
|
||||
gimbal_information.yaw_max = gimbal_device_info_msg.yaw_max;
|
||||
gimbal_information.yaw_min = gimbal_device_info_msg.yaw_min;
|
||||
|
||||
gimbal_information.gimbal_device_compid = msg->compid;
|
||||
gimbal_information.gimbal_device_id = msg->compid;
|
||||
|
||||
_gimbal_device_information_pub.publish(gimbal_information);
|
||||
}
|
||||
|
||||
@@ -94,6 +94,11 @@ private:
|
||||
|
||||
msg.failure_flags = gimbal_device_attitude_status.failure_flags;
|
||||
|
||||
msg.delta_yaw = gimbal_device_attitude_status.delta_yaw;
|
||||
msg.delta_yaw_velocity = gimbal_device_attitude_status.delta_yaw_velocity;
|
||||
|
||||
msg.gimbal_device_id = gimbal_device_attitude_status.gimbal_device_id;
|
||||
|
||||
mavlink_msg_gimbal_device_attitude_status_send_struct(_mavlink->get_channel(), &msg);
|
||||
|
||||
return true;
|
||||
|
||||
Reference in New Issue
Block a user