diff --git a/ROMFS/px4fmu_common/init.d/rcS b/ROMFS/px4fmu_common/init.d/rcS index 964c31a9df..7ed9751f4c 100644 --- a/ROMFS/px4fmu_common/init.d/rcS +++ b/ROMFS/px4fmu_common/init.d/rcS @@ -1119,6 +1119,13 @@ then fi unset TEMP_CALIB_ARGS + # vmount to control mounts such as gimbals, disabled by default. + if param compare MNT_MODE_IN -1 + then + else + vmount start + fi + # End of autostart fi diff --git a/src/drivers/vmount/vmount.cpp b/src/drivers/vmount/vmount.cpp index 96e8206354..6b29870ae6 100644 --- a/src/drivers/vmount/vmount.cpp +++ b/src/drivers/vmount/vmount.cpp @@ -202,7 +202,7 @@ static int vmount_thread_main(int argc, char *argv[]) while (!thread_should_exit) { - if (!thread_data.input_objs[0] || test_input) { //need to initialize + if (!thread_data.input_objs[0] && (params.mnt_mode_in >= 0 || test_input)) { //need to initialize output_config.gimbal_normal_mode_value = params.mnt_ob_norm_mode; output_config.gimbal_retracted_mode_value = params.mnt_ob_lock_mode; diff --git a/src/drivers/vmount/vmount_params.c b/src/drivers/vmount/vmount_params.c index ef6ea9d607..0d627996e3 100644 --- a/src/drivers/vmount/vmount_params.c +++ b/src/drivers/vmount/vmount_params.c @@ -42,15 +42,17 @@ * RC uses the AUX input channels (see MNT_MAN_* parameters), * MAVLINK_ROI uses the MAV_CMD_DO_SET_ROI Mavlink message, and MAVLINK_DO_MOUNT the * MAV_CMD_DO_MOUNT_CONFIGURE and MAV_CMD_DO_MOUNT_CONTROL messages to control a mount. +* @value -1 DISABLED * @value 0 AUTO * @value 1 RC * @value 2 MAVLINK_ROI * @value 3 MAVLINK_DO_MOUNT -* @min 0 +* @min -1 * @max 3 * @group Mount +* @reboot_required true */ -PARAM_DEFINE_INT32(MNT_MODE_IN, 0); +PARAM_DEFINE_INT32(MNT_MODE_IN, -1); /** * Mount output mode