Browse Source

Rover: Add manual speed scaled steering option

apm_2208
TunaLobster 3 years ago committed by Peter Hall
parent
commit
717a729128
  1. 7
      Rover/Parameters.cpp
  2. 3
      Rover/Parameters.h
  3. 5
      Rover/defines.h
  4. 2
      Rover/mode_manual.cpp

7
Rover/Parameters.cpp

@ -667,6 +667,13 @@ const AP_Param::GroupInfo ParametersG2::var_info[] = { @@ -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
};

3
Rover/Parameters.h

@ -425,6 +425,9 @@ public: @@ -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[];

5
Rover/defines.h

@ -102,3 +102,8 @@ enum frame_class { @@ -102,3 +102,8 @@ enum frame_class {
FRAME_BOAT = 2,
FRAME_BALANCEBOT = 3,
};
// manual mode options
enum ManualOptions {
SPEED_SCALING = (1 << 0),
};

2
Rover/mode_manual.cpp

@ -37,6 +37,6 @@ void ModeManual::update() @@ -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);
}

Loading…
Cancel
Save