Classes | Public Types | Public Member Functions | Private Types | Private Member Functions | Private Attributes | List of all members
rosflight_firmware::StateManager Class Reference

#include <state_manager.h>

Classes

struct  State
 

Public Types

enum  : uint16_t {
  ERROR_NONE = 0x0000, ERROR_INVALID_MIXER = 0x0001, ERROR_IMU_NOT_RESPONDING = 0x0002, ERROR_RC_LOST = 0x0004,
  ERROR_UNHEALTHY_ESTIMATOR = 0x0008, ERROR_TIME_GOING_BACKWARDS = 0x0010, ERROR_UNCALIBRATED_IMU = 0x0020
}
 
enum  Event {
  EVENT_INITIALIZED, EVENT_REQUEST_ARM, EVENT_REQUEST_DISARM, EVENT_RC_LOST,
  EVENT_RC_FOUND, EVENT_ERROR, EVENT_NO_ERROR, EVENT_CALIBRATION_COMPLETE,
  EVENT_CALIBRATION_FAILED
}
 

Public Member Functions

void clear_error (uint16_t error)
 
void init ()
 
void run ()
 
void set_error (uint16_t error)
 
void set_event (Event event)
 
const Statestate () const
 
 StateManager (ROSflight &parent)
 

Private Types

enum  FsmState {
  FSM_STATE_INIT, FSM_STATE_PREFLIGHT, FSM_STATE_ARMED, FSM_STATE_ERROR,
  FSM_STATE_FAILSAFE, FSM_STATE_CALIBRATING
}
 

Private Member Functions

void process_errors ()
 
void update_leds ()
 

Private Attributes

FsmState fsm_state_
 
uint32_t next_arming_error_msg_ms_ = 0
 
uint32_t next_led_blink_ms_ = 0
 
ROSflightRF_
 
State state_
 

Detailed Description

Definition at line 42 of file state_manager.h.

Member Enumeration Documentation

anonymous enum : uint16_t
Enumerator
ERROR_NONE 
ERROR_INVALID_MIXER 
ERROR_IMU_NOT_RESPONDING 
ERROR_RC_LOST 
ERROR_UNHEALTHY_ESTIMATOR 
ERROR_TIME_GOING_BACKWARDS 
ERROR_UNCALIBRATED_IMU 

Definition at line 67 of file state_manager.h.

Enumerator
EVENT_INITIALIZED 
EVENT_REQUEST_ARM 
EVENT_REQUEST_DISARM 
EVENT_RC_LOST 
EVENT_RC_FOUND 
EVENT_ERROR 
EVENT_NO_ERROR 
EVENT_CALIBRATION_COMPLETE 
EVENT_CALIBRATION_FAILED 

Definition at line 54 of file state_manager.h.

Enumerator
FSM_STATE_INIT 
FSM_STATE_PREFLIGHT 
FSM_STATE_ARMED 
FSM_STATE_ERROR 
FSM_STATE_FAILSAFE 
FSM_STATE_CALIBRATING 

Definition at line 98 of file state_manager.h.

Constructor & Destructor Documentation

rosflight_firmware::StateManager::StateManager ( ROSflight parent)

Definition at line 38 of file state_manager.cpp.

Member Function Documentation

void rosflight_firmware::StateManager::clear_error ( uint16_t  error)

Definition at line 82 of file state_manager.cpp.

void rosflight_firmware::StateManager::init ( )

Definition at line 47 of file state_manager.cpp.

void rosflight_firmware::StateManager::process_errors ( )
private

Definition at line 278 of file state_manager.cpp.

void rosflight_firmware::StateManager::run ( void  )

Definition at line 64 of file state_manager.cpp.

void rosflight_firmware::StateManager::set_error ( uint16_t  error)

Definition at line 73 of file state_manager.cpp.

void rosflight_firmware::StateManager::set_event ( StateManager::Event  event)

Definition at line 98 of file state_manager.cpp.

const State& rosflight_firmware::StateManager::state ( ) const
inline

Definition at line 82 of file state_manager.h.

void rosflight_firmware::StateManager::update_leds ( )
private

Definition at line 286 of file state_manager.cpp.

Member Data Documentation

FsmState rosflight_firmware::StateManager::fsm_state_
private

Definition at line 108 of file state_manager.h.

uint32_t rosflight_firmware::StateManager::next_arming_error_msg_ms_ = 0
private

Definition at line 96 of file state_manager.h.

uint32_t rosflight_firmware::StateManager::next_led_blink_ms_ = 0
private

Definition at line 95 of file state_manager.h.

ROSflight& rosflight_firmware::StateManager::RF_
private

Definition at line 92 of file state_manager.h.

State rosflight_firmware::StateManager::state_
private

Definition at line 93 of file state_manager.h.


The documentation for this class was generated from the following files:


rosflight_firmware
Author(s): Daniel Koch , James Jackson
autogenerated on Wed Jul 3 2019 19:59:31