Mount: AlexMos fix to stop crashing before init

This commit is contained in:
Randy Mackay 2015-06-05 12:26:13 +09:00
parent 66d2328163
commit b8e3fe8f26

View File

@ -76,6 +76,10 @@ void AP_Mount_Alexmos::set_mode(enum MAV_MOUNT_MODE mode)
// status_msg - called to allow mounts to send their status to GCS using the MOUNT_STATUS message // status_msg - called to allow mounts to send their status to GCS using the MOUNT_STATUS message
void AP_Mount_Alexmos::status_msg(mavlink_channel_t chan) void AP_Mount_Alexmos::status_msg(mavlink_channel_t chan)
{ {
if (!_initialised) {
return;
}
get_angles(); get_angles();
mavlink_msg_mount_status_send(chan, 0, 0, _current_angle.y*100, _current_angle.x*100, _current_angle.z*100); mavlink_msg_mount_status_send(chan, 0, 0, _current_angle.y*100, _current_angle.x*100, _current_angle.z*100);
} }