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

#include <hysteresis.h>

Collaboration diagram for systemlib::Hysteresis:

Public Member Functions

 Hysteresis (bool init_state)
 
 Hysteresis ()=delete
 
 ~Hysteresis ()=default
 
bool get_state () const
 
void set_hysteresis_time_from (const bool from_state, const hrt_abstime new_hysteresis_time_us)
 
void set_state_and_update (const bool new_state, const hrt_abstime &now_us)
 
void update (const hrt_abstime &now_us)
 

Private Attributes

hrt_abstime _last_time_to_change_state {0}
 
hrt_abstime _time_from_true_us {0}
 
hrt_abstime _time_from_false_us {0}
 
bool _state
 
bool _requested_state
 

Detailed Description

Definition at line 49 of file hysteresis.h.

Constructor & Destructor Documentation

◆ Hysteresis() [1/2]

systemlib::Hysteresis::Hysteresis ( bool  init_state)
inlineexplicit

Definition at line 52 of file hysteresis.h.

References Hysteresis(), and ~Hysteresis().

Here is the call graph for this function:

◆ Hysteresis() [2/2]

systemlib::Hysteresis::Hysteresis ( )
delete

Referenced by Hysteresis().

Here is the caller graph for this function:

◆ ~Hysteresis()

systemlib::Hysteresis::~Hysteresis ( )
default

Referenced by Hysteresis().

Here is the caller graph for this function:

Member Function Documentation

◆ get_state()

bool systemlib::Hysteresis::get_state ( ) const
inline

Definition at line 60 of file hysteresis.h.

References _state, hrt_abstime, set_hysteresis_time_from(), set_state_and_update(), and update().

Referenced by land_detector::MulticopterLandDetector::_get_landed_state(), land_detector::MulticopterLandDetector::_get_maybe_landed_state(), ObstacleAvoidance::checkAvoidanceProgress(), MulticopterPositionControl::failsafe(), ObstacleAvoidance::injectAvoidanceSetpoints(), Commander::run(), land_detector::LandDetector::Run(), TEST(), FailureDetector::updateAttitudeStatus(), and Takeoff::updateTakeoffState().

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

◆ set_hysteresis_time_from()

void systemlib::Hysteresis::set_hysteresis_time_from ( const bool  from_state,
const hrt_abstime  new_hysteresis_time_us 
)

◆ set_state_and_update()

void systemlib::Hysteresis::set_state_and_update ( const bool  new_state,
const hrt_abstime now_us 
)

Definition at line 57 of file hysteresis.cpp.

References _last_time_to_change_state, _requested_state, _state, and update().

Referenced by land_detector::LandDetector::_update_state(), ObstacleAvoidance::checkAvoidanceProgress(), MulticopterPositionControl::failsafe(), get_state(), ObstacleAvoidance::injectAvoidanceSetpoints(), Commander::run(), MulticopterPositionControl::Run(), TEST(), FailureDetector::updateAttitudeStatus(), and Takeoff::updateTakeoffState().

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

◆ update()

void systemlib::Hysteresis::update ( const hrt_abstime now_us)

Definition at line 73 of file hysteresis.cpp.

References _last_time_to_change_state, _requested_state, _state, _time_from_false_us, _time_from_true_us, and hrt_abstime.

Referenced by get_state(), set_state_and_update(), and TEST().

Here is the caller graph for this function:

Member Data Documentation

◆ _last_time_to_change_state

hrt_abstime systemlib::Hysteresis::_last_time_to_change_state {0}
private

Definition at line 70 of file hysteresis.h.

Referenced by set_state_and_update(), and update().

◆ _requested_state

bool systemlib::Hysteresis::_requested_state
private

Definition at line 76 of file hysteresis.h.

Referenced by set_state_and_update(), and update().

◆ _state

bool systemlib::Hysteresis::_state
private

Definition at line 75 of file hysteresis.h.

Referenced by get_state(), set_state_and_update(), and update().

◆ _time_from_false_us

hrt_abstime systemlib::Hysteresis::_time_from_false_us {0}
private

Definition at line 73 of file hysteresis.h.

Referenced by set_hysteresis_time_from(), and update().

◆ _time_from_true_us

hrt_abstime systemlib::Hysteresis::_time_from_true_us {0}
private

Definition at line 72 of file hysteresis.h.

Referenced by set_hysteresis_time_from(), and update().


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