mirror of
https://github.com/paparazzi/paparazzi.git
synced 2026-06-04 22:17:01 +08:00
[nav] change GRAVITY to NAV_GRAVITY to avoid collision
This commit is contained in:
@@ -139,7 +139,7 @@ void nav_circle_XY(float x, float y, float radius) {
|
|||||||
(dist2_center > Square(abs_radius + dist_carrot)
|
(dist2_center > Square(abs_radius + dist_carrot)
|
||||||
|| dist2_center < Square(abs_radius - dist_carrot)) ?
|
|| dist2_center < Square(abs_radius - dist_carrot)) ?
|
||||||
0 :
|
0 :
|
||||||
atan((*stateGetHorizontalSpeedNorm_f())*(*stateGetHorizontalSpeedNorm_f()) / (GRAVITY*radius));
|
atan((*stateGetHorizontalSpeedNorm_f())*(*stateGetHorizontalSpeedNorm_f()) / (NAV_GRAVITY*radius));
|
||||||
|
|
||||||
float carrot_angle = dist_carrot / abs_radius;
|
float carrot_angle = dist_carrot / abs_radius;
|
||||||
carrot_angle = Min(carrot_angle, M_PI/4);
|
carrot_angle = Min(carrot_angle, M_PI/4);
|
||||||
|
|||||||
@@ -41,7 +41,7 @@
|
|||||||
#include "subsystems/navigation/common_flight_plan.h"
|
#include "subsystems/navigation/common_flight_plan.h"
|
||||||
#include "subsystems/navigation/common_nav.h"
|
#include "subsystems/navigation/common_nav.h"
|
||||||
|
|
||||||
#define GRAVITY 9.806
|
#define NAV_GRAVITY 9.806
|
||||||
#define Square(_x) ((_x)*(_x))
|
#define Square(_x) ((_x)*(_x))
|
||||||
#define DistanceSquare(p1_x, p1_y, p2_x, p2_y) (Square(p1_x-p2_x)+Square(p1_y-p2_y))
|
#define DistanceSquare(p1_x, p1_y, p2_x, p2_y) (Square(p1_x-p2_x)+Square(p1_y-p2_y))
|
||||||
|
|
||||||
|
|||||||
Reference in New Issue
Block a user