|
Paparazzi UAS
v5.18.0_stable
Paparazzi is a free software Unmanned Aircraft System.
|
Go to the documentation of this file.
47 float leg_length2 =
Max((wp_diff.
x * wp_diff.
x + wp_diff.
y * wp_diff.
y), 0.1f);
70 if (approaching_time > 0.
f) {
74 VECT2_SMUL(estimated_progress, *speed, approaching_time);
75 VECT2_SUM(estimated_pos, *pos, estimated_progress);
97 return (diff.
x * from_diff.
x + diff.
y * from_diff.
y < 0.f);
113 NormRadAngle(trigo_diff);
117 float sign_radius = radius > 0.f ? 1.f : -1.f;
119 float abs_radius = fabsf(radius);
120 if (abs_radius > 0.1
f) {
123 carrot_angle =
Min(carrot_angle, M_PI / 4);
124 carrot_angle =
Max(carrot_angle, M_PI / 16);
146 #ifndef LINE_START_FUNCTION
147 #define LINE_START_FUNCTION {}
149 #ifndef LINE_STOP_FUNCTION
150 #define LINE_STOP_FUNCTION {}
171 float d = sqrtf(p2_p1_x * p2_p1_x + p2_p1_y * p2_p1_y);
248 #if PERIODIC_TELEMETRY
253 pprz_msg_send_SEGMENT(trans,
dev, AC_ID,
262 pprz_msg_send_CIRCLE(trans,
dev, AC_ID,
272 pprz_msg_send_ROTORCRAFT_NAV_STATUS(trans,
dev, AC_ID,
274 &dist_home, &dist_wp,
298 #if PERIODIC_TELEMETRY
float dist2_to_home
squared distance to home waypoint
#define VECT2_SMUL(_vo, _vi, _s)
float leg_progress
progress over leg
static void send_circle(struct transport_tx *trans, struct link_device *dev)
float dist2_to_wp
squared distance to next waypoint
static void _nav_oval_init(void)
static struct EnuCoor_f * stateGetPositionEnu_f(void)
Get position in local ENU coordinates (float).
bool nav_approaching_from(struct EnuCoor_i *wp, struct EnuCoor_i *from, int16_t approaching_time)
Proximity tests on approaching a wp.
struct EnuCoor_f target
final target
#define NAV_MODE_WAYPOINT
Nav modes.
#define NavQdrCloseTo(x)
True if x (in degrees) is close to the current QDR (less than 10 degrees)
struct RoverNavigation nav
int32_t int32_atan2_2(int32_t y, int32_t x)
struct point waypoints[NB_WAYPOINT]
size == nb_waypoint, waypoint 0 is a dummy waypoint
#define VECT2_DIFF(_c, _a, _b)
#define VECT2_COPY(_a, _b)
void nav_register_goto_wp(nav_rover_goto nav_goto, nav_rover_route nav_route, nav_rover_approaching nav_approaching)
Register functions.
#define CARROT
default approaching_time for a wp
struct FloatVect2 pos_diff
struct EnuCoor_f from
start WP position
static float float_vect2_norm(struct FloatVect2 *v)
enum oval_status status
oval status
#define DEFAULT_CIRCLE_RADIUS
default nav_circle_radius in meters
static void send_nav_status(struct transport_tx *trans, struct link_device *dev)
#define ANGLE_BFP_OF_REAL(_af)
static const struct usb_device_descriptor dev
float get_dist2_to_point(struct EnuCoor_i *p)
Returns squared horizontal distance to given point.
int8_t register_periodic_telemetry(struct periodic_telemetry *_pt, uint8_t _id, telemetry_cb _cb)
Register a telemetry callback function.
vector in East North Up coordinates Units: meters
struct EnuCoor_f center
center WP position
static void nav_circle(struct EnuCoor_f *wp_center, float radius)
#define LINE_START_FUNCTION
Navigation along a figure O.
struct RoverNavBase nav_rover_base
float radians
incremental angular distance
struct RoverNavCircle circle
void nav_register_circle(nav_rover_circle nav_circle)
uint16_t f
Camera baseline, in meters (i.e. horizontal distance between the two cameras of the stereo setup)
#define VECT2_ASSIGN(_a, _x, _y)
static void nav_route(struct EnuCoor_f *wp_start, struct EnuCoor_f *wp_end)
static void send_segment(struct transport_tx *trans, struct link_device *dev)
void nav_rover_init(void)
Init and register nav functions.
static struct EnuCoor_f * stateGetSpeedEnu_f(void)
Get ground speed in local ENU coordinates (float).
static void nav_oval(struct EnuCoor_f *wp1, struct EnuCoor_f *wp2, float radius)
#define VECT2_SUM(_c, _a, _b)
#define ARRIVED_AT_WAYPOINT
minimum horizontal distance to waypoint to mark as arrived
float leg_length
leg length
#define INT32_DEG_OF_RAD(_rad)
void nav_register_oval(nav_rover_oval_init nav_oval_init, nav_rover_oval nav_oval)
uint8_t count
number of laps
#define POS_BFP_OF_REAL(_af)
static void nav_goto(struct EnuCoor_f *wp)
Implement basic nav function.
struct RoverNavGoto goto_wp
float radius
radius in meters
uint8_t nav_oval_count
Navigation along a figure O.
#define LINE_STOP_FUNCTION
#define DefaultPeriodic
Set default periodic telemetry.
vector in East North Up coordinates
struct EnuCoor_f to
end WP position
static bool nav_approaching(struct EnuCoor_f *wp, struct EnuCoor_f *from, float approaching_time)