Experimental/2021/RomiToy2021/src/main/cpp/subsystems/Drivetrain.cpp
// The Romi has the left and right motors set to
// PWM channels 0 and 1 respectively
// The Romi has onboard encoders that are hardcoded
// to use DIO pins 4/5 and 6/7 for the left and right
The Romi has the left and right motors set to
PWM channels 0 and 1 respectively
The Romi has onboard encoders that are hardcoded
to use DIO pins 4/5 and 6/7 for the left and right
The Romi has the left and right motors set to PWM channels 0 and 1 respectively The Romi has onboard encoders that are hardcoded to use DIO pins 4 / 5 and 6 / 7 for the left and right
Drivetrain::Drivetrain() : m_odometry(units::degree_t(0)) {
  m_leftEncoder.SetDistancePerPulse(
      wpi::math::pi * kWheelDiameter.to<double>() / kCountsPerRevolution);
  m_rightEncoder.SetDistancePerPulse(
      wpi::math::pi * kWheelDiameter.to<double>() / kCountsPerRevolution);
  ResetOdometry(frc::Pose2d(0_m, 0_m, frc::Rotation2d(0_deg)));
  ConfigureShuffleboard();
}
Drivetrain :: Drivetrain ( ) : m_odometry ( units :: degree_t ( 0 ) ) { m_leftEncoder . SetDistancePerPulse ( wpi :: math :: pi * kWheelDiameter . to < double > ( ) / kCountsPerRevolution ) ; m_rightEncoder . SetDistancePerPulse ( wpi :: math :: pi * kWheelDiameter . to < double > ( ) / kCountsPerRevolution ) ; ResetOdometry ( frc :: Pose2d ( 0 _m , 0 _m , frc :: Rotation2d ( 0 _deg ) ) ) ; ConfigureShuffleboard ( ) ; }
The Romi has the left and right motors set to
PWM channels 0 and 1 respectively
The Romi has onboard encoders that are hardcoded
to use DIO pins 4/5 and 6/7 for the left and right
The Romi has the left and right motors set to PWM channels 0 and 1 respectively The Romi has onboard encoders that are hardcoded to use DIO pins 4 / 5 and 6 / 7 for the left and right
// Set the encoders up so that when we call "GetRate()", we'll get the // rate of turn in meters/sec.