[examples] Correct Mecanum example axes (#3955)

This commit is contained in:
sciencewhiz
2022-01-27 21:57:41 -07:00
committed by GitHub
parent 7ea1be9c01
commit 560094ad92
4 changed files with 9 additions and 8 deletions

View File

@@ -10,8 +10,8 @@
/**
* This is a sample program that uses mecanum drive with a gyro sensor to
* maintain rotation vectorsin relation to the starting orientation of the robot
* (field-oriented controls).
* maintain rotation vectors in relation to the starting orientation of the
* robot (field-oriented controls).
*/
class Robot : public frc::TimedRobot {
public:
@@ -28,7 +28,7 @@ class Robot : public frc::TimedRobot {
* Mecanum drive is used with the gyro angle as an input.
*/
void TeleopPeriodic() override {
m_robotDrive.DriveCartesian(m_joystick.GetX(), m_joystick.GetY(),
m_robotDrive.DriveCartesian(-m_joystick.GetY(), m_joystick.GetX(),
m_joystick.GetZ(), m_gyro.GetAngle());
}

View File

@@ -24,7 +24,8 @@ class Robot : public frc::TimedRobot {
/* Use the joystick X axis for lateral movement, Y axis for forward
* movement, and Z axis for rotation.
*/
m_robotDrive.DriveCartesian(m_stick.GetX(), m_stick.GetY(), m_stick.GetZ());
m_robotDrive.DriveCartesian(-m_stick.GetY(), m_stick.GetX(),
m_stick.GetZ());
}
private: