Quote:
Originally Posted by Jaci
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
...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?