circle navigation

classic Classic list List threaded Threaded
3 messages Options
Reply | Threaded
Open this post in threaded view
|

circle navigation

david
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




--
Yu David Liu
Department of Computer Science
SUNY Binghamton

_______________________________________________
Paparazzi-devel mailing list
[hidden email]
https://lists.nongnu.org/mailman/listinfo/paparazzi-devel
Reply | Threaded
Open this post in threaded view
|

Re: circle navigation

Gautier Hattenberger-3

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

Le 17/09/2020 à 04:57, Yu David Liu a écrit :
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




--
Yu David Liu
Department of Computer Science
SUNY Binghamton

_______________________________________________
Paparazzi-devel mailing list
[hidden email]
https://lists.nongnu.org/mailman/listinfo/paparazzi-devel

_______________________________________________
Paparazzi-devel mailing list
[hidden email]
https://lists.nongnu.org/mailman/listinfo/paparazzi-devel
Reply | Threaded
Open this post in threaded view
|

Re: circle navigation

Hector Garcia de Marina-2
Hi guys,

I remember I answered a similar question time ago from another user. It seems a popular question xD.

Summarizing:

From the point of view of control, it is okei to use this expression since when the angle is big (he vehicle still converges to the desired behavior, and when it is small is a very good approximation (so we save some computations).

Cheers,

On Thu, 17 Sep 2020, 10.46 Gautier Hattenberger, <[hidden email]> wrote:

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

Le 17/09/2020 à 04:57, Yu David Liu a écrit :
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




--
Yu David Liu
Department of Computer Science
SUNY Binghamton

_______________________________________________
Paparazzi-devel mailing list
[hidden email]
https://lists.nongnu.org/mailman/listinfo/paparazzi-devel
_______________________________________________
Paparazzi-devel mailing list
[hidden email]
https://lists.nongnu.org/mailman/listinfo/paparazzi-devel

_______________________________________________
Paparazzi-devel mailing list
[hidden email]
https://lists.nongnu.org/mailman/listinfo/paparazzi-devel