mirror of
https://github.com/wpilibsuite/allwpilib
synced 2026-06-23 01:21:42 +00:00
Add setting to invert the right side of the drive (#1045)
This commit is contained in:
committed by
Peter Johnson
parent
73439d8213
commit
17401e10f0
@@ -115,6 +115,9 @@ class DifferentialDrive : public RobotDriveBase {
|
||||
void SetQuickStopThreshold(double threshold);
|
||||
void SetQuickStopAlpha(double alpha);
|
||||
|
||||
bool IsRightSideInverted() const;
|
||||
void SetRightSideInverted(bool rightSideInverted);
|
||||
|
||||
void StopMotor() override;
|
||||
void GetDescription(wpi::raw_ostream& desc) const override;
|
||||
|
||||
@@ -127,6 +130,7 @@ class DifferentialDrive : public RobotDriveBase {
|
||||
double m_quickStopThreshold = kDefaultQuickStopThreshold;
|
||||
double m_quickStopAlpha = kDefaultQuickStopAlpha;
|
||||
double m_quickStopAccumulator = 0.0;
|
||||
double m_rightSideInvertMultiplier = -1.0;
|
||||
};
|
||||
|
||||
} // namespace frc
|
||||
|
||||
@@ -76,6 +76,9 @@ class MecanumDrive : public RobotDriveBase {
|
||||
double gyroAngle = 0.0);
|
||||
void DrivePolar(double magnitude, double angle, double zRotation);
|
||||
|
||||
bool IsRightSideInverted() const;
|
||||
void SetRightSideInverted(bool rightSideInverted);
|
||||
|
||||
void StopMotor() override;
|
||||
void GetDescription(wpi::raw_ostream& desc) const override;
|
||||
|
||||
@@ -87,6 +90,8 @@ class MecanumDrive : public RobotDriveBase {
|
||||
SpeedController& m_frontRightMotor;
|
||||
SpeedController& m_rearRightMotor;
|
||||
|
||||
double m_rightSideInvertMultiplier = -1.0;
|
||||
|
||||
bool reported = false;
|
||||
};
|
||||
|
||||
|
||||
Reference in New Issue
Block a user