|
Re: Needing A header file
Quote:
|
Originally Posted by jweric
the reason why I must use a float point is because I need to have correct values, saddly I cant do it any other way.
|
That is incorrect, you just are not aware of another way. Use fixed-point integer notation.
An example variable declaration could be:
integer max_v; // 2FX12 (0x1000 = 1 foot/sec)
In the above example, the resolution of the variable for maximum velocity is
0.003 inches per second and the variable ranges from + +7.99975 to -7.99975 feet per second.
Choose your number system with care and beware of overflowing variables in your calculations. Also realize that 0x8000 (negative zero) is not a number!
I assure you that the 2004 Bobcat has no floating-point variables and, sensor accuracy notwithstanding, the mathematical accuracy of our position is less than a tenth of an inch.
Best of luck,
__________________
Mike Betts
Alumnus, Team 3518, Panthrobots, 2011
Alumnus, Team 177, Bobcat Robotics, 1995 - 2010
LRI, Connecticut Regional, 2007-2010
LRI, WPI Regional, 2009 - 2010
RI, South Florida Regional, 2012 - 2013
As easy as 355/113...
Last edited by Mike Betts : 23-01-2004 at 13:19.
|