diff --git a/Rover/Parameters.cpp b/Rover/Parameters.cpp index 4d1d7df20b..47d3f0727d 100644 --- a/Rover/Parameters.cpp +++ b/Rover/Parameters.cpp @@ -667,6 +667,13 @@ const AP_Param::GroupInfo ParametersG2::var_info[] = { // @User: Advanced AP_GROUPINFO("GUID_OPTIONS", 52, ParametersG2, guided_options, 0), + // @Param: MANUAL_OPTIONS + // @DisplayName: Manual mode options + // @Description: Manual mode specific options + // @Bitmask: 0:Enable steering speed scaling + // @User: Advanced + AP_GROUPINFO("MANUAL_OPTIONS", 53, ParametersG2, manual_options, 0), + AP_GROUPEND }; diff --git a/Rover/Parameters.h b/Rover/Parameters.h index e8218a11f6..756ca70f47 100644 --- a/Rover/Parameters.h +++ b/Rover/Parameters.h @@ -425,6 +425,9 @@ public: // guided options bitmask AP_Int32 guided_options; + + // Rover options + AP_Int32 manual_options; }; extern const AP_Param::Info var_info[]; diff --git a/Rover/defines.h b/Rover/defines.h index c3982e2246..68aa99e6f0 100644 --- a/Rover/defines.h +++ b/Rover/defines.h @@ -102,3 +102,8 @@ enum frame_class { FRAME_BOAT = 2, FRAME_BALANCEBOT = 3, }; + +// manual mode options +enum ManualOptions { + SPEED_SCALING = (1 << 0), +}; diff --git a/Rover/mode_manual.cpp b/Rover/mode_manual.cpp index 622e7ec162..35aacfa9b5 100644 --- a/Rover/mode_manual.cpp +++ b/Rover/mode_manual.cpp @@ -37,6 +37,6 @@ void ModeManual::update() // copy RC scaled inputs to outputs g2.motors.set_throttle(desired_throttle); - g2.motors.set_steering(desired_steering, false); + g2.motors.set_steering(desired_steering, (g2.manual_options & ManualOptions::SPEED_SCALING)); g2.motors.set_lateral(desired_lateral); }