PX4 Firmware
PX4 Autopilot Software http://px4.io
SafetyButton Class Reference

#include <SafetyButton.hpp>

Inheritance diagram for SafetyButton:
Collaboration diagram for SafetyButton:

Public Member Functions

 SafetyButton ()
 
virtual ~SafetyButton ()
 
int print_status () override
 
void Run () override
 
int Start ()
 

Static Public Member Functions

static int task_spawn (int argc, char *argv[])
 
static int custom_command (int argc, char *argv[])
 
static int print_usage (const char *reason=nullptr)
 

Private Member Functions

void CheckButton ()
 
void FlashButton ()
 

Private Attributes

uORB::Subscription _armed_sub {ORB_ID(actuator_armed)}
 
uORB::Publication< safety_s_to_safety {ORB_ID(safety)}
 
uint8_t _button_counter {0}
 
uint8_t _blink_counter {0}
 
bool _safety_off {false}
 State of the safety button from the subscribed safety topic. More...
 
bool _safety_btn_off {false}
 State of the safety button read from the HW button. More...
 

Detailed Description

Definition at line 50 of file SafetyButton.hpp.

Constructor & Destructor Documentation

◆ SafetyButton()

SafetyButton::SafetyButton ( )
inline

Definition at line 53 of file SafetyButton.hpp.

References CheckButton(), custom_command(), FlashButton(), print_status(), print_usage(), Run(), Start(), task_spawn(), and ~SafetyButton().

Here is the call graph for this function:

◆ ~SafetyButton()

SafetyButton::~SafetyButton ( )
virtual

Definition at line 49 of file SafetyButton.cpp.

Referenced by SafetyButton().

Here is the caller graph for this function:

Member Function Documentation

◆ CheckButton()

void SafetyButton::CheckButton ( )
private

Definition at line 55 of file SafetyButton.cpp.

References CYCLE_COUNT, and safety_button_pressed.

Referenced by SafetyButton().

Here is the caller graph for this function:

◆ custom_command()

int SafetyButton::custom_command ( int  argc,
char *  argv[] 
)
static
See also
ModuleBase

Definition at line 197 of file SafetyButton.cpp.

References print_usage().

Referenced by SafetyButton().

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

◆ FlashButton()

void SafetyButton::FlashButton ( )
private

Definition at line 95 of file SafetyButton.cpp.

References df_bebop_bus_wrapper::_armed_sub, actuator_armed_s::armed, armed, FMU_ARMED, FMU_OK_TO_ARM, FMU_REFUSE_TO_ARM, IO_ARMED, and IO_FMU_ARMED.

Referenced by SafetyButton().

Here is the caller graph for this function:

◆ print_status()

int SafetyButton::print_status ( )
override
See also
ModuleBase::print_status()

Definition at line 203 of file SafetyButton.cpp.

Referenced by SafetyButton().

Here is the caller graph for this function:

◆ print_usage()

int SafetyButton::print_usage ( const char *  reason = nullptr)
static
See also
ModuleBase

Definition at line 211 of file SafetyButton.cpp.

Referenced by SafetyButton().

Here is the caller graph for this function:

◆ Run()

void SafetyButton::Run ( )
override

Definition at line 132 of file SafetyButton.cpp.

References hrt_absolute_time(), safety, safety_s::safety_off, safety_s::safety_switch_available, and safety_s::timestamp.

Referenced by SafetyButton().

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

◆ Start()

int SafetyButton::Start ( )

Definition at line 189 of file SafetyButton.cpp.

Referenced by SafetyButton(), and task_spawn().

Here is the caller graph for this function:

◆ task_spawn()

int SafetyButton::task_spawn ( int  argc,
char *  argv[] 
)
static
See also
ModuleBase

Definition at line 154 of file SafetyButton.cpp.

References CBRK_IO_SAFETY_KEY, circuit_breaker_enabled(), ll40ls::instance, and Start().

Referenced by SafetyButton().

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

Member Data Documentation

◆ _armed_sub

uORB::Subscription SafetyButton::_armed_sub {ORB_ID(actuator_armed)}
private

Definition at line 78 of file SafetyButton.hpp.

◆ _blink_counter

uint8_t SafetyButton::_blink_counter {0}
private

Definition at line 82 of file SafetyButton.hpp.

◆ _button_counter

uint8_t SafetyButton::_button_counter {0}
private

Definition at line 81 of file SafetyButton.hpp.

◆ _safety_btn_off

bool SafetyButton::_safety_btn_off {false}
private

State of the safety button read from the HW button.

Definition at line 84 of file SafetyButton.hpp.

◆ _safety_off

bool SafetyButton::_safety_off {false}
private

State of the safety button from the subscribed safety topic.

Definition at line 83 of file SafetyButton.hpp.

◆ _to_safety

uORB::Publication<safety_s> SafetyButton::_to_safety {ORB_ID(safety)}
private

Definition at line 79 of file SafetyButton.hpp.


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