mirror of
https://github.com/wpilibsuite/allwpilib
synced 2026-06-20 00:51:42 +00:00
[examples] Invert right side of drive subsystems (#3437)
The right motors of a DifferentialDrive are no longer automatically inverted (#3340) so it needs to be done explicitly.
This commit is contained in:
committed by
GitHub
parent
186dadf14d
commit
b422665a3c
@@ -15,6 +15,11 @@ using namespace DriveConstants;
|
||||
// The Romi has onboard encoders that are hardcoded
|
||||
// to use DIO pins 4/5 and 6/7 for the left and right
|
||||
Drivetrain::Drivetrain() {
|
||||
// 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_rightMotor.SetInverted(true);
|
||||
|
||||
m_leftEncoder.SetDistancePerPulse(
|
||||
wpi::numbers::pi * kWheelDiameter.to<double>() / kCountsPerRevolution);
|
||||
m_rightEncoder.SetDistancePerPulse(
|
||||
|
||||
Reference in New Issue
Block a user