![]() |
Programming Mecanum
Hi! I'm having trouble programming the mecanum wheels. I can make the robot move sideways and rotate but I cannot make it move forward and backward and I'm not sure why. I included the important parts of my code below.
Code:
Joystick joy1 = new Joystick(1); |
Re: Programming Mecanum
Have you tried just using the X, Y, and Z axis instead of the Magnitude and Direction?
|
Re: Programming Mecanum
I have but it didn't help.
|
Re: Programming Mecanum
Put the bot up on blocks (wheels off the ground) and give it a pure forward command. Tell us what each of the four wheels do. |
Re: Programming Mecanum
You could check to see if your drive motors need to be inverted. You could do this in code, or just swap red/black on one side of your robot.
Might not be the answer but another thing to try! |
Re: Programming Mecanum
Quote:
Code:
RobotDrive drivetrain = new RobotDrive(1, 2, 3, 4); |
Re: Programming Mecanum
Quote:
|
Re: Programming Mecanum
Quote:
|
Re: Programming Mecanum
Quote:
What do the wheels do when you give a pure reverse command? A pure strafe right command? etc |
Re: Programming Mecanum
Quote:
|
Re: Programming Mecanum
Quote:
Code:
RobotDrive(int frontLeftMotor, int rearLeftMotor, int frontRightMotor, int rearRightMotor) |
Re: Programming Mecanum
Code for doing Mecanum with joysticks looks like this:
Code:
myRobotDrive.mecanumDrive_Cartesian(joy1.getX(), joy1.getY(), joy1.getTwist());One possible problem is that some of the motors may need to be inverted depending on how they are configured. To determine that, put the robot on blocks and drive it with the joysticks and see what it is doing. You can call the Code:
setInvertedMotor() |
| All times are GMT -5. The time now is 09:33. |
Powered by vBulletin® Version 3.6.4
Copyright ©2000 - 2017, Jelsoft Enterprises Ltd.
Copyright © Chief Delphi