|
|
|
@ -72,6 +72,15 @@ const AP_Param::GroupInfo AP_MotorsUGV::var_info[] = {
@@ -72,6 +72,15 @@ const AP_Param::GroupInfo AP_MotorsUGV::var_info[] = {
|
|
|
|
|
// @User: Standard
|
|
|
|
|
AP_GROUPINFO("THR_MAX", 6, AP_MotorsUGV, _throttle_max, 100), |
|
|
|
|
|
|
|
|
|
// @Param: SKID_FRIC
|
|
|
|
|
// @DisplayName: Motor skid steering friction compensation
|
|
|
|
|
// @Description: Motor output for skid steering vehicles will be increased by this percentage to overcome friction when stopped
|
|
|
|
|
// @Units: %
|
|
|
|
|
// @Range: 0 100
|
|
|
|
|
// @Increment: 1
|
|
|
|
|
// @User: Standard
|
|
|
|
|
AP_GROUPINFO("SKID_FRIC", 7, AP_MotorsUGV, _skid_friction, 0.0f), |
|
|
|
|
|
|
|
|
|
AP_GROUPEND |
|
|
|
|
}; |
|
|
|
|
|
|
|
|
@ -268,9 +277,10 @@ void AP_MotorsUGV::output_skid_steering(bool armed, float steering, float thrott
@@ -268,9 +277,10 @@ void AP_MotorsUGV::output_skid_steering(bool armed, float steering, float thrott
|
|
|
|
|
|
|
|
|
|
// deal with case of turning on the spot
|
|
|
|
|
if (is_zero(throttle_scaled)) { |
|
|
|
|
// full possible range is not used to keep response equivalent to non-zero throttle case
|
|
|
|
|
motor_left += steering_scaled * 0.5f; |
|
|
|
|
motor_right -= steering_scaled * 0.5f; |
|
|
|
|
// steering output split evenly between left and right motors and compensated for friction
|
|
|
|
|
const float friction_comp = MAX(0.0f, 1.0f + (_skid_friction * 0.01f)); |
|
|
|
|
motor_left += steering_scaled * 0.5f * friction_comp; |
|
|
|
|
motor_right -= steering_scaled * 0.5f * friction_comp; |
|
|
|
|
} else { |
|
|
|
|
// add in steering
|
|
|
|
|
const float dir = is_positive(throttle_scaled) ? 1.0f : -1.0f; |
|
|
|
|