mirror of
https://gitee.com/mirrors_PX4/PX4-Autopilot.git
synced 2026-04-14 10:07:39 +08:00
Manual control: Add switches
This commit is contained in:
parent
6e9a460c17
commit
f2a780dffd
@ -2057,7 +2057,14 @@ protected:
|
||||
msg.y = manual.y * 1000;
|
||||
msg.z = manual.z * 1000;
|
||||
msg.r = manual.r * 1000;
|
||||
unsigned shift = 2;
|
||||
msg.buttons = 0;
|
||||
msg.buttons |= (manual.mode_switch << (shift * 0));
|
||||
msg.buttons |= (manual.return_switch << (shift * 1));
|
||||
msg.buttons |= (manual.posctl_switch << (shift * 2));
|
||||
msg.buttons |= (manual.loiter_switch << (shift * 3));
|
||||
msg.buttons |= (manual.acro_switch << (shift * 4));
|
||||
msg.buttons |= (manual.offboard_switch << (shift * 5));
|
||||
|
||||
_mavlink->send_message(MAVLINK_MSG_ID_MANUAL_CONTROL, &msg);
|
||||
}
|
||||
|
||||
Loading…
x
Reference in New Issue
Block a user