|
|
|
![]() |
|
|||||||
|
||||||||
![]() |
| Thread Tools | Rate Thread | Display Modes |
|
#1
|
||||
|
||||
|
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!! |
|
#2
|
||||||
|
||||||
|
Re: How to Program Mecanum
Given the changes to the driver station this year, that is not a correct assumption. The xBox controller mapping changed.
|
|
#3
|
|||||
|
|||||
|
Re: How to Program Mecanum
Agreed. As a quick test, try loading last year's tank drive software and see how it drives with mecanum. While you won't get anywhere near the performance that you would with rubber tires, tank mode commands on a mecanum platform shall produce the desired results for forward, reverse, spin left, and spin right.
|
|
#4
|
||||
|
||||
|
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?
|
|
#5
|
|||||
|
|||||
|
Re: How to Program Mecanum
Quote:
http://team358.org/files/programming...rolMapping.jpg |
|
#6
|
|||
|
|||
|
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. |
|
#7
|
||||
|
||||
|
Re: How to Program Mecanum
Quote:
|
|
#8
|
|||||
|
|||||
|
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:
Last edited by GeeTwo : 02-03-2015 at 02:35 PM. Reason: Added last paraagraph and end quote, then correction |
|
#9
|
||||
|
||||
|
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
|
|
#10
|
|||||
|
|||||
|
Re: How to Program Mecanum
Do your rollers form an X when viewed from above? Are you able to rotate?
|
|
#11
|
|||
|
|||
|
Re: How to Program Mecanum
Our wheels are mounted correctly and form an "X", perhaps I was just thinking wrong at the time as I did not have access to view our chassis. At any rate, when strafing, one side should have the wheels rotating towards the outside when viewed side on, and the other side should be rotating inwards.
|
|
#12
|
||||
|
||||
|
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:
|
|
#13
|
|||
|
|||
|
Re: How to Program Mecanum
Yes, you are correct. I was mistaken.
|
|
#14
|
||||
|
||||
|
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! |
|
#15
|
||||
|
||||
|
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.xml
Trying to override old definition of task classloader
clean:
[delete] Deleting directory C:\Users\Kristen\Documents\GitHub\Copy of Copy of Getting Started\build
[delete] Deleting directory C:\Users\Kristen\Documents\GitHub\Copy of Copy of Getting Started\dist
compile:
[mkdir] Created dir: C:\Users\Kristen\Documents\GitHub\Copy of Copy of Getting Started\build
[echo] [athena-compile] Compiling src with classpath=C:\Users\Kristen/wpilib/java/current/lib/WPILib.jar:C:\Users\Kristen/wpilib/java/current/lib/NetworkTables.jar to build
[javac] Compiling 8 source files to C:\Users\Kristen\Documents\GitHub\Copy of Copy of Getting Started\build
jar:
[echo] [athena-jar] Making jar dist/FRCUserProgram.jar.
[mkdir] Created dir: C:\Users\Kristen\Documents\GitHub\Copy of Copy of Getting Started\dist
[mkdir] Created dir: C:\Users\Kristen\Documents\GitHub\Copy of Copy of Getting Started\build\jars
[echo] [athena-jar] Copying jars from C:\Users\Kristen/wpilib/java/current/lib/WPILib.jar:C:\Users\Kristen/wpilib/java/current/lib/NetworkTables.jar to build/jars.
[copy] Copying 2 files to C:\Users\Kristen\Documents\GitHub\Copy of Copy of Getting Started\build\jars
[jar] Building jar: C:\Users\Kristen\Documents\GitHub\Copy of Copy of Getting Started\dist\FRCUserProgram.jar
get-target-ip:
[echo] Trying Target: roboRIO-4623.local
[echo] roboRIO found via mDNS
dependencies:
[echo] roboRIO image version validated
[echo] Checking for JRE. If this fails install the JRE using these instructions: https://wpilib.screenstepslive.com/s/4485/m/13503/l/288822-installing-java-8-on-the-roborio-using-the-frc-roborio-java-installer-java-only
[sshexec] Connecting to roboRIO-4623.local:22
[sshexec] cmd : test -d /usr/local/frc/JRE
deploy:
[echo] [athena-deploy] Copying code over.
[scp] Connecting to roboRIO-4623.local:22
[scp] done.
[scp] Connecting to roboRIO-4623.local:22
[scp] done.
[echo] [athena-deploy] Starting program.
[sshexec] Connecting to roboRIO-4623.local:22
[sshexec] cmd : . /etc/profile.d/natinst-path.sh; /usr/local/frc/bin/frcKillRobot.sh -t -r;
[sshexec] stopped process in pidfile '/var/run/natinst/FRC_UserProgram.pid' (pid 4205)
BUILD SUCCESSFUL
Total time: 13 seconds
https://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! Last edited by LFRobotics : 02-05-2015 at 11:23 AM. |
![]() |
| Thread Tools | |
| Display Modes | Rate This Thread |
|
|