mirror of
https://github.com/wpilibsuite/allwpilib
synced 2026-06-19 00:41:43 +00:00
[examples] Ensure right side motors are inverted (#3836)
Fixes #3827 Adds MotorController inversion for right side, removes inversion in setVoltage methods. Also fixes various XboxController negations (was inconsistent throughout examples).
This commit is contained in:
@@ -20,7 +20,14 @@
|
||||
*/
|
||||
class Drivetrain {
|
||||
public:
|
||||
Drivetrain() { m_gyro.Reset(); }
|
||||
Drivetrain() {
|
||||
m_gyro.Reset();
|
||||
// We need to invert one side of the drivetrain so that positive voltages
|
||||
// result in both sides moving forward. Depending on how your robot's
|
||||
// gearbox is constructed, you might have to invert the left side instead.
|
||||
m_frontRightMotor.SetInverted(true);
|
||||
m_backRightMotor.SetInverted(true);
|
||||
}
|
||||
|
||||
frc::MecanumDriveWheelSpeeds GetCurrentState() const;
|
||||
void SetSpeeds(const frc::MecanumDriveWheelSpeeds& wheelSpeeds);
|
||||
|
||||
Reference in New Issue
Block a user