Rover: Add manual speed scaled steering option

This commit is contained in:
TunaLobster 2022-07-05 13:21:10 -05:00 committed by Peter Hall
parent 86096261d0
commit 717a729128
4 changed files with 16 additions and 1 deletions

View File

@ -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
};

View File

@ -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[];

View File

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

View File

@ -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);
}