forked from Archive/PX4-Autopilot
mavlink receiver: include mavlink buttons in the manual control setpoint topic
This commit is contained in:
parent
8dcfcf5b9e
commit
59d79499de
|
@ -35,6 +35,8 @@ float32 aux4
|
|||
float32 aux5
|
||||
float32 aux6
|
||||
|
||||
uint16 buttons # A bitfield corresponding to the joystick buttons' 0-15 current state, 1 for pressed, 0 for released. The lowest bit corresponds to button 1 of 16.
|
||||
|
||||
bool sticks_moving
|
||||
|
||||
# TOPICS manual_control_setpoint manual_control_input
|
||||
|
|
|
@ -2089,6 +2089,7 @@ MavlinkReceiver::handle_message_manual_control(mavlink_message_t *msg)
|
|||
// For backwards compatibility at the moment interpret throttle in range [0,1000]
|
||||
manual_control_setpoint.throttle = ((mavlink_manual_control.z / 1000.f) * 2.f) - 1.f;
|
||||
manual_control_setpoint.yaw = mavlink_manual_control.r / 1000.f;
|
||||
manual_control_setpoint.buttons = mavlink_manual_control.buttons;
|
||||
manual_control_setpoint.data_source = manual_control_setpoint_s::SOURCE_MAVLINK_0 + _mavlink->get_instance_id();
|
||||
manual_control_setpoint.timestamp = manual_control_setpoint.timestamp_sample = hrt_absolute_time();
|
||||
manual_control_setpoint.valid = true;
|
||||
|
|
Loading…
Reference in New Issue