Closed kleinma closed 8 years ago
In hDecaWave, all the square roots look protected from a negative value. Each is the sum of two squares.
double d1 = sqrt(pow(dw1x-xTag,2)+pow(dw1y-yTag,2));
double d2 = sqrt(pow(dw2x-xTag,2)+pow(dw2y-yTag,2));
double d3 = sqrt(pow(dw3x-xTag,2)+pow(dw3y-yTag,2));
double d4 = sqrt(pow(dw4x-xTag,2)+pow(dw4y-yTag,2));
in HDecaWave I wrote the square roots slightly differently. But, they still seem to be protected in the same way, with a minimum number of 0 under the radical.
double dist1 = pow(pow(dw1x-xTag,2)+pow(dw1y-yTag,2),0.5);
I am currently under the impression that a divide by zero is causing the problem. I'm going to close this issue and open another.
https://github.com/cwrucutter/snowmower_localization/blob/1c1ea38bc43369e5d111ad427bd2c815abcef81c/src/ekf.cpp#L192-L281