
From:  Gautier Hattenberger 
Subject:  Re: [Paparazzidevel] circle navigation 
Date:  Thu, 17 Sep 2020 10:45:58 +0200 
Useragent:  Mozilla/5.0 (X11; Linux x86_64; rv:68.0) Gecko/20100101 Thunderbird/68.10.0 
Hello David,
You are right, it should be atanf(dist_carrot / abs_radius), approximated to the ratio only, assuming small angles, which is wrong most of the time...
The bounding makes it work in practice. I suspect that this code originally written for 8bit MCU for just good enough.
I'm not sure if it worth changing it or not, but we should probably keep the bounding anyway.
Gautier
Hi guys,
I was reviewing the source code on circle navigation, and specifically, the "nav_circle_xy" function:
What I don't seem to understand is the following lines (Line 140):
float carrot_angle = dist_carrot / abs_radius;
carrot_angle = Min(carrot_angle, M_PI / 4);
carrot_angle = Max(carrot_angle, M_PI / 16);
Specifically, I was expecting some kind of atan function used for the computation of "carrot_angle". How could the ratio itself be an angle? I wonder if this is a bug that is somewhat masked by the Min/Max bounding in the next two lines.
Best,David

SUNY BinghamtonDepartment of Computer ScienceYu David Liu
_______________________________________________ Paparazzidevel mailing list Paparazzidevel@nongnu.org https://lists.nongnu.org/mailman/listinfo/paparazzidevel
[Prev in Thread]  Current Thread  [Next in Thread] 