mirror of
https://github.com/ArduPilot/ardupilot
synced 2025-01-22 00:28:30 -04:00
Plane: Check MANUAL_CONTROL target
This commit is contained in:
parent
7ad0318d4f
commit
1af2155641
@ -1418,11 +1418,17 @@ void GCS_MAVLINK_Plane::handleMessage(mavlink_message_t* msg)
|
||||
|
||||
case MAVLINK_MSG_ID_MANUAL_CONTROL:
|
||||
{
|
||||
if (msg->sysid != plane.g.sysid_my_gcs) break; // Only accept control from our gcs
|
||||
if (msg->sysid != plane.g.sysid_my_gcs) {
|
||||
break; // only accept control from our gcs
|
||||
}
|
||||
|
||||
mavlink_manual_control_t packet;
|
||||
mavlink_msg_manual_control_decode(msg, &packet);
|
||||
|
||||
if (packet.target != plane.g.sysid_this_mav) {
|
||||
break; // only accept messages aimed at us
|
||||
}
|
||||
|
||||
bool override_active = false;
|
||||
int16_t roll = (packet.y == INT16_MAX) ? 0 : plane.channel_roll->get_radio_min() + (plane.channel_roll->get_radio_max() - plane.channel_roll->get_radio_min()) * (packet.y + 1000) / 2000.0f;
|
||||
int16_t pitch = (packet.x == INT16_MAX) ? 0 : plane.channel_pitch->get_radio_min() + (plane.channel_pitch->get_radio_max() - plane.channel_pitch->get_radio_min()) * (-packet.x + 1000) / 2000.0f;
|
||||
|
Loading…
Reference in New Issue
Block a user