View Single Post
  #12   Spotlight this post!  
Unread 17-01-2006, 22:49
BradAMiller BradAMiller is offline
Registered User
AKA: Brad
#0190 ( Gompei and the Herd)
Team Role: Mentor
 
Join Date: Mar 2004
Location: Worcester, MA
Posts: 588
BradAMiller has a brilliant futureBradAMiller has a brilliant futureBradAMiller has a brilliant futureBradAMiller has a brilliant futureBradAMiller has a brilliant futureBradAMiller has a brilliant futureBradAMiller has a brilliant futureBradAMiller has a brilliant futureBradAMiller has a brilliant futureBradAMiller has a brilliant futureBradAMiller has a brilliant future
Re: Welcome to the WPILib forum

Quote:
Originally Posted by Jon236
Brad,

Does WPILib have a math function library?

Jon Mittelman
Team236
Jon -

There is no explicit math library. It does link with the standard Microchip libraries so that gets you all the math.h stuff. However I would not recommend doing too much floating point math - it's really slow on the little PIC processor.

Last year we used this library of Cordic math functions - that used 24 bit (short long) arithmetic to do trig functions if that's what you're looking for. It was graciously posted by team 236.

It worked pretty well for us - those holonomic drive calculations needed a bunch of trig functions. So I'd recommend that solution to anyone who needs general purpose trig functions.

With that said, you might also try lookup tables if you don't need a small range of values to be calculated. This only works in some applications and might be useful this year.
__________________
Brad Miller
Robotics Resource Center
Worcester Polytechnic Institute