Paparazzi UAS v7.0_unstable
Paparazzi is a free software Unmanned Aircraft System.
Loading...
Searching...
No Matches
mission_rover_nav.c File Reference

mission navigation for rovers More...

#include <stdio.h>
#include "modules/mission/mission_common.h"
#include "autopilot.h"
#include "firmwares/rover/navigation.h"
#include "generated/flight_plan.h"
+ Include dependency graph for mission_rover_nav.c:

Go to the source code of this file.

Macros

#define BUFFER_ZONE_DIST   10
 
#define MISSION_PATH_SKIP_GOTO   FALSE
 
#define MISSION_WAIT_TIMEOUT   30
 Implement waiting pattern Only called when MISSION_WAIT_TIMEOUT is not 0.
 

Functions

bool mission_point_of_lla (struct EnuCoor_f *point, struct LlaCoor_i *lla)
 Utility function: converts lla (int) to local point (float)
 
static bool mission_nav_wp (struct _mission_element *el)
 Navigation function to a single waypoint (2D)
 
static bool mission_nav_circle (struct _mission_element *el)
 Navigation function on a circle.
 
static bool mission_nav_segment (struct _mission_element *el)
 Navigation function along a segment (2D)
 
static bool mission_nav_path (struct _mission_element *el)
 Navigation function along a path (2D)
 
static bool mission_nav_custom (struct _mission_custom *custom, bool init)
 Call custom navigation function.
 
static bool mission_wait_pattern (void)
 
int mission_run ()
 Run mission.
 

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
 

Detailed Description

mission navigation for rovers

Implement specific navigation routines for the mission control of a rover.

Definition in file mission_rover_nav.c.

Macro Definition Documentation

◆ BUFFER_ZONE_DIST

#define BUFFER_ZONE_DIST   10

Definition at line 15 of file mission_rover_nav.c.

◆ MISSION_PATH_SKIP_GOTO

#define MISSION_PATH_SKIP_GOTO   FALSE

Definition at line 131 of file mission_rover_nav.c.

◆ MISSION_WAIT_TIMEOUT

#define MISSION_WAIT_TIMEOUT   30

Implement waiting pattern Only called when MISSION_WAIT_TIMEOUT is not 0.

Definition at line 184 of file mission_rover_nav.c.

Function Documentation

◆ mission_nav_circle()

static bool mission_nav_circle ( struct _mission_element el)
inlinestatic

Navigation function on a circle.

Definition at line 87 of file mission_rover_nav.c.

References _mission::element_time, foo, mission, nav, and RotorcraftNavigation::nav_circle.

Referenced by mission_run().

+ Here is the caller graph for this function:

◆ mission_nav_custom()

static bool mission_nav_custom ( struct _mission_custom custom,
bool  init 
)
inlinestatic

Call custom navigation function.

Definition at line 171 of file mission_rover_nav.c.

References foo, init, MissionInit, and MissionRun.

Referenced by mission_run().

+ Here is the caller graph for this function:

◆ mission_nav_path()

static bool mission_nav_path ( struct _mission_element el)
inlinestatic

Navigation function along a path (2D)

Definition at line 136 of file mission_rover_nav.c.

References CARROT, foo, last_mission_wp, mission_nav_wp(), MISSION_PATH_SKIP_GOTO, nav, RotorcraftNavigation::nav_approaching, nav_check_wp_time(), and RotorcraftNavigation::nav_route.

Referenced by mission_run().

+ Here is the call graph for this function:
+ Here is the caller graph for this function:

◆ mission_nav_segment()

static bool mission_nav_segment ( struct _mission_element el)
inlinestatic

Navigation function along a segment (2D)

Definition at line 109 of file mission_rover_nav.c.

References CARROT, foo, last_mission_wp, nav, RotorcraftNavigation::nav_approaching, nav_check_wp_time(), and RotorcraftNavigation::nav_route.

Referenced by mission_run().

+ Here is the call graph for this function:
+ Here is the caller graph for this function:

◆ mission_nav_wp()

static bool mission_nav_wp ( struct _mission_element el)
inlinestatic

Navigation function to a single waypoint (2D)

Definition at line 65 of file mission_rover_nav.c.

References CARROT, foo, last_mission_wp, nav, RotorcraftNavigation::nav_approaching, nav_check_wp_time(), and RotorcraftNavigation::nav_goto.

Referenced by mission_nav_path(), and mission_run().

+ Here is the call graph for this function:
+ Here is the caller graph for this function:

◆ mission_point_of_lla()

bool mission_point_of_lla ( struct EnuCoor_f point,
struct LlaCoor_i lla 
)

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 18 of file mission_rover_nav.c.

References LlaCoor_f::alt, LlaCoor_i::alt, BUFFER_ZONE_DIST, enu_of_lla_point_i(), float_vect2_norm(), foo, LLA_FLOAT_OF_BFP, max_dist_from_home, nav_utm_east0, nav_utm_north0, nav_utm_zone0, State::ned_initialized_i, state, stateGetNedOrigin_i(), utm_of_lla_f(), VECT2_DIFF, VECT2_SMUL, VECT3_SMUL, waypoint_get_x(), waypoint_get_y(), waypoints, FloatVect2::x, point::x, FloatVect2::y, point::y, and UtmCoor_f::zone.

Referenced by mission_parse_CIRCLE_LLA(), mission_parse_GOTO_WP_LLA(), mission_parse_PATH_LLA(), and mission_parse_SEGMENT_LLA().

+ Here is the call graph for this function:
+ Here is the caller graph for this function:

◆ mission_run()

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

Returns
return TRUE when the mission is running, FALSE when it is finished

Definition at line 208 of file mission_rover_nav.c.

References _mission::current_idx, dt_navigation, dt_navigation, _mission::element_time, foo, mission, MISSION_ELEMENT_NB, mission_get(), mission_nav_circle(), mission_nav_circle(), mission_nav_custom(), mission_nav_custom(), mission_nav_path(), mission_nav_path(), mission_nav_segment(), mission_nav_segment(), mission_nav_wp(), mission_nav_wp(), mission_wait_pattern(), mission_wait_pattern(), mission_wait_started, mission_wait_started, MissionCircle, MissionCustom, MissionPath, MissionSegment, and MissionWP.

+ Here is the call graph for this function:

◆ mission_wait_pattern()

static bool mission_wait_pattern ( void  )
static

Definition at line 203 of file mission_rover_nav.c.

Referenced by mission_run().

+ Here is the caller graph for this function:

Variable Documentation

◆ dt_navigation

const float dt_navigation = 1.0f / ((float)NAVIGATION_FREQUENCY)
static

Definition at line 58 of file mission_rover_nav.c.

Referenced by mission_run().

◆ last_mission_wp

struct EnuCoor_f last_mission_wp = { 0.f, 0.f, 0.f }

Definition at line 61 of file mission_rover_nav.c.

Referenced by mission_nav_path(), mission_nav_segment(), and mission_nav_wp().

◆ mission_wait_started

bool mission_wait_started = false
static

Definition at line 187 of file mission_rover_nav.c.

Referenced by mission_run().