View Single Post
  #5   Spotlight this post!  
Unread 13-02-2013, 00:06
eat4fun's Avatar
eat4fun eat4fun is offline
sudoer
AKA: Eric Bryce
FRC #1325 (Inverse Paradox)
Team Role: Leadership
 
Join Date: Dec 2010
Rookie Year: 2010
Location: Mississauga, Canada
Posts: 9
eat4fun is an unknown quantity at this point
Re: Getting final vector from left & right drive encoders

Quote:
Originally Posted by flameout View Post
It will be very difficult to make this accurate. First, let me point out that wheel slip can and does occur (to limit this, you'll pretty much need to limit your acceleration severely). In particular, this will make heading measurement difficult.

As a result, I'd recommend adding a heading gyro as well, and use that for your heading reference.
I have a gyro presently mounted & wired in the bellypan to log temperature data, as I was afraid that having six CIM motors in close proximity could cause heat problems (turns out it didn't!). So I'll use that data. I was thinking I would try to hash out some sort of voting system to get an accurate heading figure.

Quote:
Originally Posted by xraymypanda View Post
I hope you have some knowledge of Trigonometry, that will help a little in this explanation. I am going to walk you through the formation of forumlae which work individually to find your deltaΘ and deltaLinearPosition. You can log these changes to create an always up to date heading or just utilize them individually to set your targets. With a little bit of manipulation these will give you vectors given that we have our angle and magnitude.
I'll implement your pseudocode and see how it turns out. Thanks for the explanation!

Quote:
Originally Posted by Chris Hibner View Post
Download the code samples here: http://www.chiefdelphi.com/media/papers/2553. Look in the exampleRobotCode folder and open Periodic Tasks.vi. Near the bottom of the fast loop you'll see calculations that is stored into global variables called "Heading" and "AvgDist". These do exactly what you're looking for. As a bonus, you'll also find "CalcXY.vi" which calculates your x,y coordinate position on the field.
Thanks for the code. I'll pore over it tomorrow. The CalcXY.vi looks like the real meat of the solution.