No announcement yet.

Problem strafing with mecanum wheels

  • Filter
  • Time
  • Show
Clear All
new posts

  • Problem strafing with mecanum wheels

    We are using Andy Mark 4" HD Mecanum Wheels. We can strafe without problem during teleop but during autonomous when the robot is supposed to strafe right, it moves backwards or turns right. The same thing happens when the robot is supposed strafe left except it turns left. We are using REV HD motors and the autonomous program uses the built in encoders. Can anyone help us fix this? Much thanks in advance!

  • #2
    Can you post your code or a link to your code?

    My suspicion based on your description is that your Teleop opMode initializes some of the motor directions to be REVERSE while your Autonomous opMode does not do this (or does it differently). That would cause the behavior you describe. That, or there's some bug in your code for strafing/turning that you use in Autonomous.

    Do you have common driveTrain classes and methods that are used by both Autonomous and Teleop opModes (e.g., driveTrain.init(), driveTrain.strafeLeft(), etc.)? That's a good practice to adopt to make sure that all opModes behave in similar ways.


    • #3
      Also, are you using RUN_USING_ENCODER motor modes? Or RUN_TO_POSITION? RUN_TO_POSITION works differently than the other two modes (e.g., you don't affect the direction using the motor speed in RUN_TO_POSITION mode, instead you set the direction by the sign of the target).