mirror of
https://github.com/wpilibsuite/allwpilib
synced 2026-06-20 00:51:42 +00:00
[examples] Correct Mecanum example axes (#3955)
This commit is contained in:
@@ -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());
|
||||
}
|
||||
|
||||
|
||||
@@ -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:
|
||||
|
||||
Reference in New Issue
Block a user