mirror of
https://github.com/ArduPilot/ardupilot
synced 2025-02-22 07:44:03 -04:00
AP_Mount: report MAVLink gimbal angle to the GCS
This commit is contained in:
parent
b3c35aee4e
commit
255c5b3025
@ -178,6 +178,12 @@ void AP_Gimbal::update_target(Vector3f newTarget)
|
||||
|
||||
}
|
||||
|
||||
Vector3f AP_Gimbal::getGimbalEstimateEF()
|
||||
{
|
||||
Quaternion quatEst;_ekf.getQuat(quatEst);Vector3f eulerEst;quatEst.to_euler(eulerEst.x, eulerEst.y, eulerEst.z);
|
||||
return eulerEst;
|
||||
}
|
||||
|
||||
uint8_t AP_Gimbal::isCopterFliped(){
|
||||
return fabs(_ahrs.roll)>1.0f || fabs(_ahrs.pitch)>1.0f;
|
||||
}
|
@ -43,6 +43,8 @@ public:
|
||||
void update_target(Vector3f newTarget);
|
||||
void receive_feedback(mavlink_channel_t chan, mavlink_message_t *msg);
|
||||
|
||||
Vector3f getGimbalEstimateEF();
|
||||
|
||||
struct Measurament {
|
||||
float delta_time;
|
||||
Vector3f delta_angles;
|
||||
|
@ -87,7 +87,8 @@ void AP_Mount_MAVLink::set_mode(enum MAV_MOUNT_MODE mode)
|
||||
// status_msg - called to allow mounts to send their status to GCS using the MOUNT_STATUS message
|
||||
void AP_Mount_MAVLink::status_msg(mavlink_channel_t chan)
|
||||
{
|
||||
// do nothing - we rely on the mount sending the messages directly
|
||||
Vector3f est = _gimbal.getGimbalEstimateEF();
|
||||
mavlink_msg_mount_status_send(chan, 0, 0, degrees(est.y)*100, degrees(est.x)*100, degrees(est.z)*100);
|
||||
}
|
||||
|
||||
/*
|
||||
|
Loading…
Reference in New Issue
Block a user