mirror of
https://github.com/ArduPilot/ardupilot
synced 2025-01-09 09:28:31 -04:00
Rover: Check MANUAL_CONTROL target
This commit is contained in:
parent
e840006ff9
commit
3bad3b2e68
@ -976,6 +976,10 @@ void GCS_MAVLINK_Rover::handleMessage(mavlink_message_t* msg)
|
|||||||
mavlink_manual_control_t packet;
|
mavlink_manual_control_t packet;
|
||||||
mavlink_msg_manual_control_decode(msg, &packet);
|
mavlink_msg_manual_control_decode(msg, &packet);
|
||||||
|
|
||||||
|
if (packet.target != rover.g.sysid_this_mav) {
|
||||||
|
break; // only accept control aimed at us
|
||||||
|
}
|
||||||
|
|
||||||
const int16_t roll = (packet.y == INT16_MAX) ? 0 : rover.channel_steer->get_radio_min() + (rover.channel_steer->get_radio_max() - rover.channel_steer->get_radio_min()) * (packet.y + 1000) / 2000.0f;
|
const int16_t roll = (packet.y == INT16_MAX) ? 0 : rover.channel_steer->get_radio_min() + (rover.channel_steer->get_radio_max() - rover.channel_steer->get_radio_min()) * (packet.y + 1000) / 2000.0f;
|
||||||
const int16_t throttle = (packet.z == INT16_MAX) ? 0 : rover.channel_throttle->get_radio_min() + (rover.channel_throttle->get_radio_max() - rover.channel_throttle->get_radio_min()) * (packet.z + 1000) / 2000.0f;
|
const int16_t throttle = (packet.z == INT16_MAX) ? 0 : rover.channel_throttle->get_radio_min() + (rover.channel_throttle->get_radio_max() - rover.channel_throttle->get_radio_min()) * (packet.z + 1000) / 2000.0f;
|
||||||
hal.rcin->set_override(uint8_t(rover.rcmap.roll() - 1), roll);
|
hal.rcin->set_override(uint8_t(rover.rcmap.roll() - 1), roll);
|
||||||
|
Loading…
Reference in New Issue
Block a user