mirror of
https://github.com/ArduPilot/ardupilot
synced 2025-01-03 06:28:27 -04:00
Sub: Added COMMAND_INT message type
This commit is contained in:
parent
1853935b71
commit
1d627a23ed
@ -1149,6 +1149,44 @@ void GCS_MAVLINK::handleMessage(mavlink_message_t* msg)
|
|||||||
break;
|
break;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
|
case MAVLINK_MSG_ID_COMMAND_INT:
|
||||||
|
{
|
||||||
|
// decode packet
|
||||||
|
mavlink_command_int_t packet;
|
||||||
|
mavlink_msg_command_int_decode(msg, &packet);
|
||||||
|
switch(packet.command)
|
||||||
|
{
|
||||||
|
case MAV_CMD_DO_SET_ROI: {
|
||||||
|
// param1 : /* Region of interest mode (not used)*/
|
||||||
|
// param2 : /* MISSION index/ target ID (not used)*/
|
||||||
|
// param3 : /* ROI index (not used)*/
|
||||||
|
// param4 : /* empty */
|
||||||
|
// x : lat
|
||||||
|
// y : lon
|
||||||
|
// z : alt
|
||||||
|
// sanity check location
|
||||||
|
if (labs(packet.x) >= 900000000l || labs(packet.y) >= 1800000000l) {
|
||||||
|
break;
|
||||||
|
}
|
||||||
|
Location roi_loc;
|
||||||
|
roi_loc.lat = packet.x;
|
||||||
|
roi_loc.lng = packet.y;
|
||||||
|
roi_loc.alt = (int32_t)(packet.z * 100.0f);
|
||||||
|
copter.set_auto_yaw_roi(roi_loc);
|
||||||
|
result = MAV_RESULT_ACCEPTED;
|
||||||
|
break;
|
||||||
|
}
|
||||||
|
default:
|
||||||
|
result = MAV_RESULT_UNSUPPORTED;
|
||||||
|
break;
|
||||||
|
}
|
||||||
|
|
||||||
|
// send ACK or NAK
|
||||||
|
mavlink_msg_command_ack_send_buf(msg, chan, packet.command, result);
|
||||||
|
break;
|
||||||
|
}
|
||||||
|
|
||||||
// Pre-Flight calibration requests
|
// Pre-Flight calibration requests
|
||||||
case MAVLINK_MSG_ID_COMMAND_LONG: // MAV ID: 76
|
case MAVLINK_MSG_ID_COMMAND_LONG: // MAV ID: 76
|
||||||
{
|
{
|
||||||
|
Loading…
Reference in New Issue
Block a user