diff options
author | Thomas Gubler <thomasgubler@gmail.com> | 2014-08-12 14:54:35 +0200 |
---|---|---|
committer | Thomas Gubler <thomasgubler@gmail.com> | 2014-08-12 14:57:14 +0200 |
commit | a04d70ed5a800ff6d74afc6800f7bb94ed472ad4 (patch) | |
tree | e208e473c9f57b2573d2ceec71ec9cb98054039d /src/modules/mavlink/mavlink_receiver.cpp | |
parent | 8bbaacb1e9381c29a83e0ecf37de6df3018bd38d (diff) | |
download | px4-firmware-a04d70ed5a800ff6d74afc6800f7bb94ed472ad4.tar.gz px4-firmware-a04d70ed5a800ff6d74afc6800f7bb94ed472ad4.tar.bz2 px4-firmware-a04d70ed5a800ff6d74afc6800f7bb94ed472ad4.zip |
offboard setpoints: correctly check for force setpoint
Diffstat (limited to 'src/modules/mavlink/mavlink_receiver.cpp')
-rw-r--r-- | src/modules/mavlink/mavlink_receiver.cpp | 6 |
1 files changed, 5 insertions, 1 deletions
diff --git a/src/modules/mavlink/mavlink_receiver.cpp b/src/modules/mavlink/mavlink_receiver.cpp index dfc5ddc91..418b81ee1 100644 --- a/src/modules/mavlink/mavlink_receiver.cpp +++ b/src/modules/mavlink/mavlink_receiver.cpp @@ -441,7 +441,11 @@ MavlinkReceiver::handle_message_set_position_target_local_ned(mavlink_message_t orb_copy(ORB_ID(vehicle_control_mode), _control_mode_sub, &_control_mode); } if (_control_mode.flag_control_offboard_enabled) { - if (offboard_control_sp.isForceSetpoint) { + if (offboard_control_sp.isForceSetpoint && + offboard_control_sp_ignore_position_all(offboard_control_sp) && + offboard_control_sp_ignore_velocity_all(offboard_control_sp)) { + /* The offboard setpoint is a force setpoint only, directly writing to the force + * setpoint topic and not publishing the setpoint triplet topic */ struct vehicle_force_setpoint_s force_sp; force_sp.x = offboard_control_sp.acceleration[0]; force_sp.y = offboard_control_sp.acceleration[1]; |