![]() |
How to Program Mecanum
Okay I have posted multiple posts and tried hours worth of useless troubleshooting and I still do not have a working program. I have gotten code from other people, but that code never works. I have gotten suggestions here but none of them seem to fix it. Our team is about to give up and redesign our chassis to put normal wheels in. In a last ditch effort I made this program. In Robot.java under autonomous you will see a lot of commented out mecanumDrive(value, value, value, value) those were used for testing when the mecanumDrive method used to be located there. They all worked for the intended direction in autonomous. I simply can't get our XBox controller to work with it. I want buttons LB and RB to control straffing and the left joystick to control forward/backward and turning. So I programmed it for that - using if statements in drivetele - thats because none of the built in polar or cartesian commands worked(everything was messed up) - and none of the buttons or joysticks on the controller make the robot do anything. I know my XBox class works because we used it for tank drive last year. I am lost and have no idea what to do so PLEASE help!
Here is the code: https://github.com/MrSTUDofCODE/NewM...team4623/robot THANKS!! |
Re: How to Program Mecanum
Quote:
|
Re: How to Program Mecanum
Quote:
|
Re: How to Program Mecanum
Okay - that would explain the problems I was having - the wrong joysticks were running the wrong things - what are the new mappings?
|
Re: How to Program Mecanum
Quote:
http://team358.org/files/programming...rolMapping.jpg |
Re: How to Program Mecanum
If you are using the SmartDashboard, you can display the values of each axis and play around with the controller to determine which axis is altered by what. Our team has gotten mecanum wheels working on a test chassis successfully using a sidewinder joystick. We are currently in the process of implementing an XBox controller system as well. We are, however, also working with field orientation which may not be helpful for you. If you would like, here is our drive code though it is still in the works.
After taking a quick glance at your code, you may also run into issues with strafing. If you want to strafe to the left, you want to drive the front left forward and rear left backwards while driving the front right backwards and the back right forwards. This creates a vector in only the left direction. You are currently, with this line: Code:
CommandBase.mecanum.mecanumDrive(-.3, .3, -.3, .3);A similar approach is required for strafing right, with the wheels driving the opposite direction of strafing left. |
Re: How to Program Mecanum
Quote:
|
Re: How to Program Mecanum
Quote:
Quote:
This is supported by the following observation, which shouldn't ever happen with properly oriented mecanums; if the torques add up to zero, and the translation adds up to zero, and the wheels are spinning, something's wrong. Quote:
|
Re: How to Program Mecanum
Those values are not the ones that are supposed to work - the ones that were suggested didn't work and I had to play around with them to make them work - all of that was already tested in autonomous and works
|
Re: How to Program Mecanum
Quote:
|
Re: How to Program Mecanum
Quote:
|
Re: How to Program Mecanum
Quote:
Assuming your wheels are mounted correctly, Strafe Left: - Left wheels rotate "inward" - Right wheels rotate "outward" Strafe Right: - Left wheels rotate "outward" - Right wheels rotate "inward" ... which is not the same as this: Quote:
|
Re: How to Program Mecanum
Yes, you are correct. I was mistaken.
|
Re: How to Program Mecanum
Okay I redid the program again and will test everything again tomorrow and get back to you - hopefully it works this time!
THANKS! |
Re: How to Program Mecanum
Okay that didn't work either. Nothing works. The program uploads - the DS doesn't through any errors - it shows all green lights - but nothing happens with the Joysticks - I can press anything on the XBox controller and nothing happens. I can still make the robot move using ,my preassigned values in autonomous.
Here is the upload for Eclipse: Code:
Buildfile: C:\Users\Kristen\Documents\GitHub\Copy of Copy of Getting Started\build.xmlhttps://github.com/MrSTUDofCODE/NewM...team4623/robot Also we have another person programming in labview - so I went into the web interface and checked disable RT startup - which should have switched it back to JAVA PLEASE help - THANKS! |
| All times are GMT -5. The time now is 08:44 AM. |
Powered by vBulletin® Version 3.6.4
Copyright ©2000 - 2017, Jelsoft Enterprises Ltd.
Copyright © Chief Delphi