dRonin  adbada4
dRonin firmware
 All Data Structures Namespaces Files Functions Variables Typedefs Enumerations Enumerator Macros Groups Pages
VtolNavigationFsmMethods

Functions

static int vtol_fsm_enter_state (enum vtol_fsm_state state)
 
static bool vtol_fsm_process_event (enum vtol_fsm_event event)
 
static void vtol_fsm_process_auto ()
 
static void vtol_fsm_fsm_init (const struct vtol_fsm_transition *goal)
 
static void vtol_fsm_inject_event (enum vtol_fsm_event event)
 
static int32_t vtol_fsm_static ()
 

Variables

static const struct
vtol_fsm_transition
current_goal
 The currently selected goal FSM. More...
 
static enum vtol_fsm_state curr_state
 The current state within the goal fsm. More...
 

Detailed Description

These functions actually compute the control values to achieve the desired navigation action.

Function Documentation

static int vtol_fsm_enter_state ( enum vtol_fsm_state  state)
static

Enter a new state. Reacts appropriately (e.g. does nothing) if you pass FSM_STATE_UNCHANGED.

Parameters
[in]stateThe desired state.
Returns
true if there was a state transition, false otherwise.

Definition at line 284 of file vtol_follower_fsm.c.

static void vtol_fsm_fsm_init ( const struct vtol_fsm_transition goal)
static

Initialize the selected FSM

Parameters
[in]goalThe FSM to make active and initialize

Definition at line 334 of file vtol_follower_fsm.c.

static void vtol_fsm_inject_event ( enum vtol_fsm_event  event)
static

Process an event in the currently active goal fsm

This method will first update the current state curr_state based on the current state and the active current_goal. When it enters a new state it calls the appropriate entry_fn if it exists.

This differs from vtol_fsm_process_event in that it handles auto transitions afterwards.

Definition at line 354 of file vtol_follower_fsm.c.

static void vtol_fsm_process_auto ( )
static

Process any sequence of automatic state transitions

Definition at line 325 of file vtol_follower_fsm.c.

static bool vtol_fsm_process_event ( enum vtol_fsm_event  event)
static

Update the state machine based on an event.

Parameters
[in]eventThe event in question
Returns
true if there was a state transition, false otherwise.

Definition at line 309 of file vtol_follower_fsm.c.

static int32_t vtol_fsm_static ( )
static

vtol_fsm_static is called regularly and checks whether a timeout event has occurred and also runs the static method on the current state.

Returns
0 if successful or < 0 if an error occurred

Definition at line 368 of file vtol_follower_fsm.c.

Variable Documentation

enum vtol_fsm_state curr_state
static

The current state within the goal fsm.

Definition at line 276 of file vtol_follower_fsm.c.

const struct vtol_fsm_transition* current_goal
static

The currently selected goal FSM.

Definition at line 274 of file vtol_follower_fsm.c.