From 335c319b2ea7755f902b2787d0e8c490f54b6116 Mon Sep 17 00:00:00 2001 From: Matthew Edwards Date: Sun, 22 Oct 2017 17:52:18 +1300 Subject: [PATCH] vmount: Use MNT_DO_STAB parameter for defaults in InputMavlinkCmdMount as well. --- src/drivers/vmount/input_mavlink.cpp | 3 ++- src/drivers/vmount/input_mavlink.h | 2 +- src/drivers/vmount/vmount.cpp | 4 ++-- src/drivers/vmount/vmount_params.c | 4 ++-- 4 files changed, 7 insertions(+), 6 deletions(-) diff --git a/src/drivers/vmount/input_mavlink.cpp b/src/drivers/vmount/input_mavlink.cpp index d34174d6f3..38c011ce8b 100644 --- a/src/drivers/vmount/input_mavlink.cpp +++ b/src/drivers/vmount/input_mavlink.cpp @@ -173,7 +173,8 @@ void InputMavlinkROI::print_status() } -InputMavlinkCmdMount::InputMavlinkCmdMount() +InputMavlinkCmdMount::InputMavlinkCmdMount(bool stabilize) + : _stabilize {stabilize, stabilize, stabilize} { param_t handle = param_find("MAV_SYS_ID"); diff --git a/src/drivers/vmount/input_mavlink.h b/src/drivers/vmount/input_mavlink.h index bd9588223a..9479259363 100644 --- a/src/drivers/vmount/input_mavlink.h +++ b/src/drivers/vmount/input_mavlink.h @@ -82,7 +82,7 @@ private: class InputMavlinkCmdMount : public InputBase { public: - InputMavlinkCmdMount(); + InputMavlinkCmdMount(bool stabilize); virtual ~InputMavlinkCmdMount(); virtual void print_status(); diff --git a/src/drivers/vmount/vmount.cpp b/src/drivers/vmount/vmount.cpp index 94a775d840..d1df7c5cd9 100644 --- a/src/drivers/vmount/vmount.cpp +++ b/src/drivers/vmount/vmount.cpp @@ -276,7 +276,7 @@ static int vmount_thread_main(int argc, char *argv[]) case 0: // Automatic - thread_data.input_objs[0] = new InputMavlinkCmdMount(); + thread_data.input_objs[0] = new InputMavlinkCmdMount(params.mnt_do_stab); thread_data.input_objs[1] = new InputMavlinkROI(); // RC is on purpose last here so that if there are any mavlink @@ -296,7 +296,7 @@ static int vmount_thread_main(int argc, char *argv[]) break; case 3: //MAVLINK_DO_MOUNT - thread_data.input_objs[0] = new InputMavlinkCmdMount(); + thread_data.input_objs[0] = new InputMavlinkCmdMount(params.mnt_do_stab); break; default: diff --git a/src/drivers/vmount/vmount_params.c b/src/drivers/vmount/vmount_params.c index 6ed17f0dfa..8ef37c4a28 100644 --- a/src/drivers/vmount/vmount_params.c +++ b/src/drivers/vmount/vmount_params.c @@ -158,8 +158,8 @@ PARAM_DEFINE_INT32(MNT_MAN_PITCH, 0); PARAM_DEFINE_INT32(MNT_MAN_YAW, 0); /** -* Stabilize the mount (true for servo gimbal, false for passthrough). -* Only affects RC input; Mavlink input can set this with the DO_MOUNT_CONFIGURE command. +* Stabilize the mount (set to true for servo gimbal, false for passthrough). +* Does not affect MAVLINK_ROI input. * * @boolean * @group Mount