SMACC2
Loading...
Searching...
No Matches
cl_px4_mr::CbObstacleGuard Class Reference

#include <cb_obstacle_guard.hpp>

Inheritance diagram for cl_px4_mr::CbObstacleGuard:
Inheritance graph
Collaboration diagram for cl_px4_mr::CbObstacleGuard:
Collaboration graph

Public Member Functions

 CbObstacleGuard ()
 
virtual ~CbObstacleGuard ()
 
template<typename TOrthogonal , typename TSourceObject >
void onStateOrthogonalAllocation ()
 
void onEntry () override
 
void onExit () override
 
- Public Member Functions inherited from smacc2::SmaccClientBehavior
virtual ~SmaccClientBehavior ()
 
void onEntry () override
 
void onExit () override
 
- Public Member Functions inherited from smacc2::ISmaccClientBehavior
 ISmaccClientBehavior ()
 
virtual ~ISmaccClientBehavior ()
 
ISmaccStateMachine * getStateMachine ()
 
std::string getName () const
 
template<typename SmaccClientType >
void requiresClient (SmaccClientType *&storage)
 
template<typename SmaccComponentType >
void requiresComponent (SmaccComponentType *&storage, ComponentRequirement requirementType=ComponentRequirement::SOFT)
 
template<typename SmaccComponentType >
void requiresComponent (std::string name, SmaccComponentType *&storage, ComponentRequirement requirementType=ComponentRequirement::SOFT)
 
virtual void executeOnEntry ()
 
virtual void executeOnExit ()
 

Private Member Functions

void onTooClose ()
 
void onCleared ()
 

Private Attributes

CpForwardObstacleGuard * guard_ = nullptr
 
std::function< void()> postTooClose_
 
std::function< void()> postCleared_
 

Additional Inherited Members

- Protected Member Functions inherited from smacc2::ISmaccClientBehavior
virtual void runtimeConfigure ()
 
template<typename EventType >
void postEvent (const EventType &ev)
 
template<typename EventType >
void postEvent ()
 
ISmaccState * getCurrentState ()
 
virtual void dispose ()
 
virtual rclcpp::Node::SharedPtr getNode () const
 
virtual rclcpp::Logger getLogger () const
 

Detailed Description

Definition at line 37 of file cb_obstacle_guard.hpp.

Constructor & Destructor Documentation

◆ CbObstacleGuard()

cl_px4_mr::CbObstacleGuard::CbObstacleGuard ( )

Definition at line 26 of file cb_obstacle_guard.cpp.

26{}

◆ ~CbObstacleGuard()

cl_px4_mr::CbObstacleGuard::~CbObstacleGuard ( )
virtual

Definition at line 28 of file cb_obstacle_guard.cpp.

28{}

Member Function Documentation

◆ onCleared()

void cl_px4_mr::CbObstacleGuard::onCleared ( )
private

Definition at line 58 of file cb_obstacle_guard.cpp.

59{
60 if (postCleared_)
61 {
63 }
64}
std::function< void()> postCleared_

References postCleared_.

Referenced by onEntry().

Here is the caller graph for this function:

◆ onEntry()

void cl_px4_mr::CbObstacleGuard::onEntry ( )
overridevirtual

Reimplemented from smacc2::ISmaccClientBehavior.

Definition at line 30 of file cb_obstacle_guard.cpp.

31{
33 if (guard_ == nullptr)
34 {
35 RCLCPP_ERROR(
36 getLogger(), "CbObstacleGuard: CpForwardObstacleGuard not found - obstacle events disabled");
37 return;
38 }
39 // start from a clean slate: whatever the cone saw before this behavior
40 // existed (the ground while on the pad, walls swept during a turn) is not a
41 // detection; a real obstacle re-triggers within a couple of clouds
42 guard_->reset();
45 RCLCPP_INFO(getLogger(), "CbObstacleGuard: armed");
46}
CpForwardObstacleGuard * guard_
smacc2::SmaccSignalConnection onObstacleTooClose(void(T::*callback)(), T *object)
smacc2::SmaccSignalConnection onObstacleCleared(void(T::*callback)(), T *object)
virtual rclcpp::Logger getLogger() const
void requiresComponent(SmaccComponentType *&storage, ComponentRequirement requirementType=ComponentRequirement::SOFT)

References smacc2::ISmaccClientBehavior::getLogger(), guard_, onCleared(), cl_px4_mr::CpForwardObstacleGuard::onObstacleCleared(), cl_px4_mr::CpForwardObstacleGuard::onObstacleTooClose(), onTooClose(), smacc2::ISmaccClientBehavior::requiresComponent(), and cl_px4_mr::CpForwardObstacleGuard::reset().

Here is the call graph for this function:

◆ onExit()

void cl_px4_mr::CbObstacleGuard::onExit ( )
overridevirtual

Reimplemented from smacc2::ISmaccClientBehavior.

Definition at line 48 of file cb_obstacle_guard.cpp.

48{ RCLCPP_INFO(getLogger(), "CbObstacleGuard: disarmed"); }

References smacc2::ISmaccClientBehavior::getLogger().

Here is the call graph for this function:

◆ onStateOrthogonalAllocation()

template<typename TOrthogonal , typename TSourceObject >
void cl_px4_mr::CbObstacleGuard::onStateOrthogonalAllocation ( )
inline

Definition at line 44 of file cb_obstacle_guard.hpp.

References postCleared_, smacc2::ISmaccClientBehavior::postEvent(), and postTooClose_.

Here is the call graph for this function:

◆ onTooClose()

void cl_px4_mr::CbObstacleGuard::onTooClose ( )
private

Definition at line 50 of file cb_obstacle_guard.cpp.

51{
52 if (postTooClose_)
53 {
55 }
56}

References postTooClose_.

Referenced by onEntry().

Here is the caller graph for this function:

Member Data Documentation

◆ guard_

CpForwardObstacleGuard* cl_px4_mr::CbObstacleGuard::guard_ = nullptr
private

Definition at line 57 of file cb_obstacle_guard.hpp.

Referenced by onEntry().

◆ postCleared_

std::function<void()> cl_px4_mr::CbObstacleGuard::postCleared_
private

Definition at line 59 of file cb_obstacle_guard.hpp.

Referenced by onCleared(), and onStateOrthogonalAllocation().

◆ postTooClose_

std::function<void()> cl_px4_mr::CbObstacleGuard::postTooClose_
private

Definition at line 58 of file cb_obstacle_guard.hpp.

Referenced by onStateOrthogonalAllocation(), and onTooClose().


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