View Single Post
  #12   Spotlight this post!  
Unread 03-30-2016, 11:46 AM
Ether's Avatar
Ether Ether is offline
systems engineer (retired)
no team
 
Join Date: Nov 2009
Rookie Year: 1969
Location: US
Posts: 7,997
Ether has a reputation beyond reputeEther has a reputation beyond reputeEther has a reputation beyond reputeEther has a reputation beyond reputeEther has a reputation beyond reputeEther has a reputation beyond reputeEther has a reputation beyond reputeEther has a reputation beyond reputeEther has a reputation beyond reputeEther has a reputation beyond reputeEther has a reputation beyond repute
Re: Pathfinder - Fast Motion Profiling for Java and C++, Tank and Swerve Drive

Quote:
Originally Posted by Jaci View Post
The way it currently works is like so:
X+ is forward from where your robot starts.
X- is backward from where your robot starts.
Y+ is to the right of your robot where it starts.
Y- is to the left of your robot where it starts.

Positive headings are going from X+ towards Y+, Negative Headings from X+ to Y-.
Not a big deal, but I'm curious why you chose the above convention?

Quote:
Originally Posted by Jaci View Post
...From what I can tell it's a Div By Zero error, as some trigonometric functions give a 0 result for a 90 degree angle. Coupling that with the fact that Y doesn't change, it produces an error. Perhaps I can do a check for if it's 90 degrees to adjust it to something like 89.5 and print out a notice message.
It seems like there has to be a better way. Quite often, it's possible to make a small change to the order or method of computation to completely avoid those kind of errors. And if not, isn't there a way to trap floating point errors and make an alternate calculation in an exception handler?


Reply With Quote