GCS_MAVLink: add support for MAV_CMD_DO_SET_ROI_NONE

This commit is contained in:
Peter Barker 2023-03-03 08:41:51 +11:00 committed by Randy Mackay
parent eae518329d
commit f8c2ceced7
2 changed files with 18 additions and 0 deletions

View File

@ -628,6 +628,8 @@ protected:
MAV_RESULT handle_command_do_set_roi_sysid(const uint8_t sysid); MAV_RESULT handle_command_do_set_roi_sysid(const uint8_t sysid);
MAV_RESULT handle_command_do_set_roi_sysid(const mavlink_command_int_t &packet); MAV_RESULT handle_command_do_set_roi_sysid(const mavlink_command_int_t &packet);
MAV_RESULT handle_command_do_set_roi_sysid(const mavlink_command_long_t &packet); MAV_RESULT handle_command_do_set_roi_sysid(const mavlink_command_long_t &packet);
MAV_RESULT handle_command_do_set_roi_none();
virtual MAV_RESULT handle_command_mount(const mavlink_command_long_t &packet); virtual MAV_RESULT handle_command_mount(const mavlink_command_long_t &packet);
MAV_RESULT handle_command_mag_cal(const mavlink_command_long_t &packet); MAV_RESULT handle_command_mag_cal(const mavlink_command_long_t &packet);
virtual MAV_RESULT handle_command_long_packet(const mavlink_command_long_t &packet); virtual MAV_RESULT handle_command_long_packet(const mavlink_command_long_t &packet);

View File

@ -4758,6 +4758,9 @@ MAV_RESULT GCS_MAVLINK::handle_command_long_packet(const mavlink_command_long_t
break; break;
} }
case MAV_CMD_DO_SET_ROI_NONE:
return handle_command_do_set_roi_none();
case MAV_CMD_DO_SET_ROI_SYSID: case MAV_CMD_DO_SET_ROI_SYSID:
return handle_command_do_set_roi_sysid(packet); return handle_command_do_set_roi_sysid(packet);
@ -5041,6 +5044,19 @@ MAV_RESULT GCS_MAVLINK::handle_command_int_do_set_home(const mavlink_command_int
return MAV_RESULT_ACCEPTED; return MAV_RESULT_ACCEPTED;
} }
MAV_RESULT GCS_MAVLINK::handle_command_do_set_roi_none()
{
#if HAL_MOUNT_ENABLED
AP_Mount *mount = AP::mount();
if (mount == nullptr) {
return MAV_RESULT_UNSUPPORTED;
}
mount->set_mode_to_default();
return MAV_RESULT_ACCEPTED;
#else
return MAV_RESULT_UNSUPPORTED;
#endif
}
MAV_RESULT GCS_MAVLINK::handle_command_do_set_roi_sysid(const uint8_t sysid) MAV_RESULT GCS_MAVLINK::handle_command_do_set_roi_sysid(const uint8_t sysid)
{ {