![]() |
Mecanum Java Code
Hi, so on my teams demo robot we're using mecanum wheels, a 4 slot cRIO and some victor 884s and we cant seem to get it working right. I don't know that much about code so it'd be great if I could get some help.
The code can be found below, any suggestions/correction are very much appreciated. Code:
package edu.wpi.first.wpilibj.templates; |
Re: Mecanum Java Code
What problems are you having with it? Are you getting errors? Does the robot move at all?
Quickly looking it over I don't see any problems. |
Re: Mecanum Java Code
3 of our wheels don't go in the same direction and one doesn't move unless told to turn on the spot. Tried swapping some PWMs and that didn't help. I'm also not getting any errors with the code either...
|
Re: Mecanum Java Code
First, I would make sure you have the PWMs mapped correctly. If you are sure these are correct, it will make debugging everything else much easier.
Also, if you haven't already, put the robot on blocks so you can see what the motors are doing without having it try to drive around. My guess is that you need to invert some of the motors. You can do this either in code (using myDrive.setInvertedMotor()), or by reversing the polarity of the wires that go from the Victor to the motor. When you push the joystick forward, all the wheels should move. If they don't you either have a problem with your joystick axes (what joystick are you using?) or your motor controller. Once all 4 wheels are moving when you command the robot to go forward, invert all the ones that are going backwards. |
Re: Mecanum Java Code
Quote:
Put the bot on blocks. In software, give the following commands, and for each, record what each of the wheels is doing: Pure Forward... then post your results. From those results, it will be possible to identify what needs to be changed. |
Re: Mecanum Java Code
When I'm back in our robotics space tomorrow I'll get the information about the wheels, and we're currently running the robot on top of a tote bin. :)
|
Re: Mecanum Java Code
So after trying some stuff out, here's the list of things you asked for Ether. We're also using a Logitech Extreme 3D Pro for our joystick.
Pure Forward: Front Right = Spins forward Front Left = Not working at all Back Right = Spins forward Back Left = Spins forward Strafe Right: Front Right = Spins forwards Front Left = Not working at all Back Right = Spins backwards Back Left = Spins forwards Rotating clockwise: Front Right = Spins forwards Front Left = Not working at all Back Right = Spins forwards Back Left = Spins backwards ***NOTE: FRONT LEFT TURNS FORWARDS WHEN TURNING COUNTER-CLOCKWISE |
Re: Mecanum Java Code
Quote:
Quote:
Quote:
Try swapping Front Right and Front Left PWM cables and re-run the test. See if the problem follows the cables. |
Re: Mecanum Java Code
After all of the help I've received through this thread, we've manged to get everything working correctly. Thank you guys so much.
|
Re: Mecanum Java Code
Quote:
|
Re: Mecanum Java Code
The motor controller wasn't working correctly. We replaced it with another Victor 884 and it worked just fine. We also had a little incident of it another 884 sparking out and dying today so we'll also be changing it to use Talon SRs shortly.
|
Re: Mecanum Java Code
Quote:
Was this part of the process of identifying that problem? Quote:
|
Re: Mecanum Java Code
The problem solving process was swapping PWM cables as well as remembering that our old mecanum drive train had a major problems with shorting Victor 884s. Under further inspection, the controller was also having trouble initializing and didn't initialize most of the time.
|
| All times are GMT -5. The time now is 08:19 AM. |
Powered by vBulletin® Version 3.6.4
Copyright ©2000 - 2017, Jelsoft Enterprises Ltd.
Copyright © Chief Delphi