View Single Post
  #21   Spotlight this post!  
Unread 26-04-2015, 13:01
WillNess's Avatar
WillNess WillNess is offline
Programmer
AKA: Will Ness
FRC #4944 (The Hi Fives)
Team Role: Programmer
 
Join Date: Apr 2014
Rookie Year: 2014
Location: United States
Posts: 90
WillNess is just really niceWillNess is just really niceWillNess is just really niceWillNess is just really nice
Re: Getting Gyro Working w/ Mecanum Drive

Thanks, this helps a BUNCH! The problem is mixing mecanum drive with your code

Quote:
Originally Posted by dawonn View Post
The code is not particularly well documented, but here's the code we used this year:

https://github.com/CopperBots/Copper...obot.java#L632

We pass in the rotation joystick value that has already been deadband'ed.
If the joystick is at zero rotation, we use a proportional controller to keep the robot straight.
If the joystick is not at zero, we update the current heading of the robot and pass the joystick value back to the drive system unchanged.

We also have the option to disable gyro mode at any time in case something goes wrong like a bad calibration, or a loose cable.
There is also an option to update the kP value from the smart dashboard and some diagnostic information sent back to help troubleshoot when things go wrong.
__________________

Outreach Lead // Lead Programmer // Junior

2014 FRC:
Rookie Allstar, Highest Rookie Seed & Semifinalist @ Utah
Rookie Allstar, Highest Rookie Seed & Semifinalist @ Colorado
2015 FRC:
Creativity In Engineering & Semifinalist @ Arizona West
Reply With Quote