[examples] Fix drive Joystick axes in several examples (#3769)

This commit is contained in:
Jason Daming
2021-12-06 18:40:10 -06:00
committed by GitHub
parent 8ee6257e92
commit 1ac02d2f58
3 changed files with 8 additions and 7 deletions

View File

@@ -30,12 +30,14 @@ RobotContainer::RobotContainer() {
ConfigureButtonBindings();
// Set up default drive command
// The left stick controls translation of the robot.
// Turning is controlled by the X axis of the right stick.
m_drive.SetDefaultCommand(frc2::RunCommand(
[this] {
m_drive.Drive(
units::meters_per_second_t(m_driverController.GetLeftY()),
units::meters_per_second_t(m_driverController.GetRightY()),
units::radians_per_second_t(m_driverController.GetLeftX()), false);
units::meters_per_second_t(m_driverController.GetLeftX()),
units::radians_per_second_t(m_driverController.GetRightX()), false);
},
{&m_drive}));
}