Paparazzi UAS
v7.0_unstable
Paparazzi is a free software Unmanned Aircraft System.
|
mission navigation for rotorcrafts More...
#include <stdio.h>
#include "modules/mission/mission_common.h"
#include "autopilot.h"
#include "firmwares/rotorcraft/navigation.h"
#include "generated/flight_plan.h"
Go to the source code of this file.
Macros | |
#define | BUFFER_ZONE_DIST 10 |
#define | MISSION_WAIT_TIMEOUT 30 |
Implement waiting pattern Only called when MISSION_WAIT_TIMEOUT is not 0. More... | |
Functions | |
bool | mission_point_of_lla (struct EnuCoor_f *point, struct LlaCoor_i *lla) |
Utility function: converts lla (int) to local point (float) More... | |
static bool | mission_nav_wp (struct _mission_element *el) |
Navigation function to a single waypoint. More... | |
static bool | mission_nav_circle (struct _mission_element *el) |
Navigation function on a circle. More... | |
static bool | mission_nav_segment (struct _mission_element *el) |
Navigation function along a segment. More... | |
static bool | mission_nav_path (struct _mission_element *el) |
Navigation function along a path. More... | |
static bool | mission_nav_custom (struct _mission_custom *custom, bool init) |
Call custom navigation function. More... | |
static bool | mission_wait_pattern (void) |
int | mission_run () |
Run mission. More... | |
Variables | |
static const float | dt_navigation = 1.0f / ((float)NAVIGATION_FREQUENCY) |
struct EnuCoor_f | last_mission_wp = { 0.f, 0.f, 0.f } |
static bool | mission_wait_started = false |
static float | mission_wait_time = 0.f |
static struct _mission_element | mission_wait_wp |
mission navigation for rotorcrafts
Implement specific navigation routines for the mission control of a rotorcraft
Definition in file mission_rotorcraft_nav.c.
#define BUFFER_ZONE_DIST 10 |
Definition at line 38 of file mission_rotorcraft_nav.c.
#define MISSION_WAIT_TIMEOUT 30 |
Implement waiting pattern Only called when MISSION_WAIT_TIMEOUT is not 0.
Definition at line 215 of file mission_rotorcraft_nav.c.
|
inlinestatic |
Navigation function on a circle.
Definition at line 113 of file mission_rotorcraft_nav.c.
References _mission_element::duration, _mission_element::element, _mission::element_time, mission, nav, RotorcraftNavigation::nav_circle, NavVerticalAltitudeMode, NavVerticalAutoThrottleMode, and EnuCoor_f::z.
Referenced by mission_run().
|
inlinestatic |
Call custom navigation function.
Definition at line 202 of file mission_rotorcraft_nav.c.
References _mission_registered::cb, init, MissionInit, MissionRun, _mission_custom::nb, _mission_custom::params, and _mission_custom::reg.
Referenced by mission_run().
|
inlinestatic |
Navigation function along a path.
Definition at line 161 of file mission_rotorcraft_nav.c.
References CARROT, _mission_element::duration, _mission_element::element, last_mission_wp, mission_nav_wp(), nav, RotorcraftNavigation::nav_approaching, nav_check_wp_time(), RotorcraftNavigation::nav_route, NavVerticalAltitudeMode, NavVerticalAutoThrottleMode, stateGetPositionEnu_f(), and EnuCoor_f::z.
Referenced by mission_run().
|
inlinestatic |
Navigation function along a segment.
Definition at line 132 of file mission_rotorcraft_nav.c.
References CARROT, _mission_element::duration, _mission_element::element, last_mission_wp, nav, RotorcraftNavigation::nav_approaching, nav_check_wp_time(), RotorcraftNavigation::nav_route, NavVerticalAltitudeMode, NavVerticalAutoThrottleMode, stateGetPositionEnu_f(), and EnuCoor_f::z.
Referenced by mission_run().
|
inlinestatic |
Navigation function to a single waypoint.
Definition at line 86 of file mission_rotorcraft_nav.c.
References CARROT, _mission_element::duration, _mission_element::element, last_mission_wp, nav, RotorcraftNavigation::nav_approaching, nav_check_wp_time(), RotorcraftNavigation::nav_goto, NavVerticalAltitudeMode, NavVerticalAutoThrottleMode, stateGetPositionEnu_f(), and EnuCoor_f::z.
Referenced by mission_nav_path(), mission_run(), and mission_wait_pattern().
Utility function: converts lla (int) to local point (float)
Get the ENU component of LLA mission point This function is firmware specific.
TODO: don't convert to float, either use double or do completely in fixed point
Definition at line 41 of file mission_rotorcraft_nav.c.
References LlaCoor_f::alt, LlaCoor_i::alt, BUFFER_ZONE_DIST, UtmCoor_f::east, enu_of_lla_point_i(), float_vect2_norm(), LLA_FLOAT_OF_BFP, max_dist_from_home, nav_utm_east0, nav_utm_north0, nav_utm_zone0, State::ned_initialized_i, UtmCoor_f::north, state, stateGetHmslOrigin_i(), stateGetLlaOrigin_i(), stateGetNedOrigin_i(), utm_of_lla_f(), VECT2_DIFF, VECT2_SMUL, VECT2_SUM, VECT3_SMUL, waypoint_get_x(), waypoint_get_y(), waypoints, FloatVect2::x, point::x, FloatVect2::y, point::y, EnuCoor_f::z, and UtmCoor_f::zone.
Referenced by mission_parse_CIRCLE_LLA(), mission_parse_GOTO_WP_LLA(), mission_parse_PATH_LLA(), and mission_parse_SEGMENT_LLA().
int mission_run | ( | void | ) |
Run mission.
This function should be implemented into a dedicated file since navigation functions are different for different firmwares
Currently, this function should be called from the flight plan
Definition at line 238 of file mission_rotorcraft_nav.c.
References _mission::current_idx, dt_navigation, _mission_element::duration, _mission_element::element, _mission::element_time, mission, MISSION_ELEMENT_NB, mission_get(), mission_nav_circle(), mission_nav_custom(), mission_nav_path(), mission_nav_segment(), mission_nav_wp(), mission_wait_pattern(), mission_wait_started, MissionCircle, MissionCustom, MissionPath, MissionSegment, MissionWP, and _mission_element::type.
|
static |
Definition at line 222 of file mission_rotorcraft_nav.c.
References dt_navigation, _mission_element::element, mission_nav_wp(), mission_wait_started, mission_wait_time, MISSION_WAIT_TIMEOUT, mission_wait_wp, and stateGetPositionEnu_f().
Referenced by mission_run().
|
static |
Definition at line 79 of file mission_rotorcraft_nav.c.
Referenced by mission_run(), and mission_wait_pattern().
Definition at line 79 of file mission_rotorcraft_nav.c.
Referenced by mission_nav_path(), mission_nav_segment(), and mission_nav_wp().
|
static |
Definition at line 218 of file mission_rotorcraft_nav.c.
Referenced by mission_run(), and mission_wait_pattern().
|
static |
Definition at line 220 of file mission_rotorcraft_nav.c.
Referenced by mission_wait_pattern().
|
static |
Definition at line 220 of file mission_rotorcraft_nav.c.
Referenced by mission_wait_pattern().