Rover: add MANUAL_STR_EXPO

This commit is contained in:
Randy Mackay 2022-11-10 11:08:18 +09:00
parent 0d9397f451
commit 3a36a1d405
3 changed files with 15 additions and 1 deletions

View File

@ -678,6 +678,14 @@ const AP_Param::GroupInfo ParametersG2::var_info[] = {
AP_SUBGROUPPTR(mode_dock_ptr, "DOCK", 54, ParametersG2, ModeDock),
#endif
// @Param: MANUAL_STR_EXPO
// @DisplayName: Manual Steering Expo
// @Description: Manual steering expo to allow faster steering when stick at edges
// @Values: 0:Disabled,0.1:Very Low,0.2:Low,0.3:Medium,0.4:High,0.5:Very High
// @Range: -0.5 0.95
// @User: Advanced
AP_GROUPINFO("MANUAL_STR_EXPO", 55, ParametersG2, manual_steering_expo, 0),
AP_GROUPEND
};

View File

@ -425,8 +425,11 @@ public:
// guided options bitmask
AP_Int32 guided_options;
// Rover options
// manual mode options
AP_Int32 manual_options;
// manual mode steering expo
AP_Float manual_steering_expo;
};
extern const AP_Param::Info var_info[];

View File

@ -12,6 +12,9 @@ void ModeManual::update()
get_pilot_desired_steering_and_throttle(desired_steering, desired_throttle);
get_pilot_desired_lateral(desired_lateral);
// apply manual steering expo
desired_steering = 4500.0 * input_expo(desired_steering / 4500, g2.manual_steering_expo);
// if vehicle is balance bot, calculate actual throttle required for balancing
if (rover.is_balancebot()) {
rover.balancebot_pitch_control(desired_throttle);