diff options
author | Anton Babushkin <anton.babushkin@me.com> | 2013-08-23 23:03:59 +0200 |
---|---|---|
committer | Anton Babushkin <anton.babushkin@me.com> | 2013-08-23 23:03:59 +0200 |
commit | 5e9b508ea0ec799ab6f8723d114c999beffc347e (patch) | |
tree | 635d8c3256b8079ac83819fad4e48dca1e7e195e /src/modules/mavlink/mavlink_receiver.cpp | |
parent | 330908225e5fcb1731df20e740dbfe403a7b30b9 (diff) | |
download | px4-firmware-5e9b508ea0ec799ab6f8723d114c999beffc347e.tar.gz px4-firmware-5e9b508ea0ec799ab6f8723d114c999beffc347e.tar.bz2 px4-firmware-5e9b508ea0ec799ab6f8723d114c999beffc347e.zip |
Indicate AUTO submodes in mavlink custom_mode.
Diffstat (limited to 'src/modules/mavlink/mavlink_receiver.cpp')
-rw-r--r-- | src/modules/mavlink/mavlink_receiver.cpp | 5 |
1 files changed, 4 insertions, 1 deletions
diff --git a/src/modules/mavlink/mavlink_receiver.cpp b/src/modules/mavlink/mavlink_receiver.cpp index 01bbabd46..86fa73656 100644 --- a/src/modules/mavlink/mavlink_receiver.cpp +++ b/src/modules/mavlink/mavlink_receiver.cpp @@ -67,6 +67,7 @@ #include <systemlib/err.h> #include <systemlib/airspeed.h> #include <mavlink/mavlink_log.h> +#include <commander/px4_custom_mode.h> __BEGIN_DECLS @@ -188,9 +189,11 @@ handle_message(mavlink_message_t *msg) mavlink_set_mode_t new_mode; mavlink_msg_set_mode_decode(msg, &new_mode); + union px4_custom_mode custom_mode; + custom_mode.data = new_mode.custom_mode; /* Copy the content of mavlink_command_long_t cmd_mavlink into command_t cmd */ vcmd.param1 = new_mode.base_mode; - vcmd.param2 = new_mode.custom_mode; + vcmd.param2 = custom_mode.data_float; vcmd.param3 = 0; vcmd.param4 = 0; vcmd.param5 = 0; |