![]() |
Mecanum-Code
This year we are trying to use mecanum wheels for the first time. However, we are having some programming issues when it comes to using different controllers. We are currently trying to find a code to work an Xbox 360 controller. Below is the current code that we are trying to use, but we can't seem to get it to work. If you have any advice on what we should try or do, please let us know. Also, we are a Java only team, as we have no other experience with other languages.
Code:
/*----------------------------------------------------------------------------*/ |
Re: Mecanum-Code
What behavior do you see?
I noticed that the joysticks are only read once at the beginning of the program, rather then inside telopPeriodic. |
Re: Mecanum-Code
Like Joe Ross said, your code only evaluates the value of the axes once, before teleoperated mode is ever started. To fix this, you need to retrieve the values of the axes you wish to use at the beginning of the teleop loop.
Also, for a mecanum drive robot, you want to call a mecanum drive function instead of the tankDrive() function. The RobotDrive defines two mecanum drive functions: mecanumDrive_Cartesian and mecanumDrive_Polar. Take a look at the Javadoc to learn how to implement them. |
Re: Mecanum-Code
Quote:
|
Re: Mecanum-Code
Quote:
|
Re: Mecanum-Code
Quote:
Joystick1 drives the vehicle in Arcade mode (Y fore/aft and X is rotate); Joystick2 controls strafe (X axis controls strafe right/left). Leave hands off Joystick2 and you've got basic Arcade drive. |
Re: Mecanum-Code
Quote:
Quote:
Also, you'll still want to move the retrieval of the axis values to the beginning of the loop. Another tip: the tangent of an angle equals opposite over adjacent (y/x). |
Re: Mecanum-Code
A couple things that might be helpful for you:
This ChiefDelphi post about Mecanum drive and C++ http://www.chiefdelphi.com/forums/sh...ad.php?t=88686 and this ScreenSteps document that essentially extracted the sample program from the above CD post: http://wpilib.screenstepslive.com/s/...-mecanum-drive |
Re: Mecanum-Code
Quote:
|
| All times are GMT -5. The time now is 11:01. |
Powered by vBulletin® Version 3.6.4
Copyright ©2000 - 2017, Jelsoft Enterprises Ltd.
Copyright © Chief Delphi