Thread: Floats
View Single Post
  #3   Spotlight this post!  
Unread 02-02-2005, 01:08
Unsung FIRST Hero
miketwalker miketwalker is offline
Robot Lifeguard
FRC #1902 (Exploding Bacon)
 
Join Date: Dec 2001
Rookie Year: 2002
Location: Orlando, FL
Posts: 878
miketwalker has a reputation beyond reputemiketwalker has a reputation beyond reputemiketwalker has a reputation beyond reputemiketwalker has a reputation beyond reputemiketwalker has a reputation beyond reputemiketwalker has a reputation beyond reputemiketwalker has a reputation beyond reputemiketwalker has a reputation beyond reputemiketwalker has a reputation beyond reputemiketwalker has a reputation beyond reputemiketwalker has a reputation beyond repute
Send a message via AIM to miketwalker
Re: Floats

Dave brings up good points. I didn't intend to state that I wanted to use a ridiculous number of floats in my operations, but I've found that for certain things, the precision is necessary. However, I know that a few floats won't kill the controller and make it skip packets unless you go overboard, so you don't actually have a problem (unless I'm mistaken). If I didn't have to use floats for certain operations, I wouldn't because they do add alot more strain then any programmer would like to have in a limited resource system. I guess I'm just curious where the line is drawn between being safe in your use of floats, and when you'll start to observe packet loss (which is something nobody wants). I've been coding using the fewest floats I can while still getting the precision I need in some parts (with sensor calculations specifically).

Dave, do you know any other ways to work with the decimal calculations in these sensor calculations so that you run the least risk of having problems meanwhile still keeping the accuracy neccessary? Currently, I'm just doing my best to use the least number of floats possible. Thanks!