SMACC2
Loading...
Searching...
No Matches
cl_nav2z::CbSeekWaypoint Class Reference

#include <cb_seek_waypoint.hpp>

Inheritance diagram for cl_nav2z::CbSeekWaypoint:
Inheritance graph
Collaboration diagram for cl_nav2z::CbSeekWaypoint:
Collaboration graph

Public Member Functions

 CbSeekWaypoint (std::string skip_until_name)
 
 CbSeekWaypoint (int count)
 
 ~CbSeekWaypoint () override
 
void onEntry () override
 
void onExit () override
 
- Public Member Functions inherited from smacc2::SmaccClientBehavior
 ~SmaccClientBehavior () override
 
void onEntry () override
 
void onExit () override
 
- Public Member Functions inherited from smacc2::ISmaccClientBehavior
 ISmaccClientBehavior ()
 
virtual ~ISmaccClientBehavior ()
 
 ISmaccClientBehavior (const ISmaccClientBehavior &)=delete
 
ISmaccClientBehavior & operator= (const ISmaccClientBehavior &)=delete
 
 ISmaccClientBehavior (ISmaccClientBehavior &&)=delete
 
ISmaccClientBehavior & operator= (ISmaccClientBehavior &&)=delete
 
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 (const std::string &name, SmaccComponentType *&storage, ComponentRequirement requirementType=ComponentRequirement::SOFT)
 
virtual void executeOnEntry ()
 
virtual void executeOnExit ()
 

Public Attributes

CpWaypointNavigator * waypointsNavigator_ = nullptr
 
NavigateNextWaypointOptions options_
 

Private Attributes

std::optional< int > count_
 
std::optional< std::string > seekWaypointName_
 

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 ()
 
void postInitializationFailureEvent (const std::string &what)
 
virtual void dispose ()
 
virtual rclcpp::Node::SharedPtr getNode () const
 
virtual rclcpp::Logger getLogger () const
 
std::string getTraceStateName () const
 
std::string getTraceOrthogonalName () const
 

Detailed Description

Definition at line 29 of file cb_seek_waypoint.hpp.

Constructor & Destructor Documentation

◆ CbSeekWaypoint() [1/2]

cl_nav2z::CbSeekWaypoint::CbSeekWaypoint ( std::string skip_until_name)

Definition at line 25 of file cb_seek_waypoint.cpp.

26: count_(std::nullopt), seekWaypointName_(seekWaypointName)
27{
28}
std::optional< std::string > seekWaypointName_
std::optional< int > count_

◆ CbSeekWaypoint() [2/2]

cl_nav2z::CbSeekWaypoint::CbSeekWaypoint ( int count)
explicit

Definition at line 30 of file cb_seek_waypoint.cpp.

30: count_(count), seekWaypointName_(std::nullopt) {}

◆ ~CbSeekWaypoint()

cl_nav2z::CbSeekWaypoint::~CbSeekWaypoint ( )
override

Definition at line 32 of file cb_seek_waypoint.cpp.

32{}

Member Function Documentation

◆ onEntry()

void cl_nav2z::CbSeekWaypoint::onEntry ( )
overridevirtual

Reimplemented from smacc2::ISmaccClientBehavior.

Definition at line 34 of file cb_seek_waypoint.cpp.

35{
36 this->requiresComponent(waypointsNavigator_, ComponentRequirement::HARD);
37
38 if (count_)
39 {
40 if (*count_ >= 0)
41 {
43 }
44 else
45 {
47 }
48 count_ = std::nullopt;
49 }
50 else if (seekWaypointName_)
51 {
53 seekWaypointName_ = std::nullopt;
54 }
55}
CpWaypointNavigator * waypointsNavigator_
void requiresComponent(SmaccComponentType *&storage, ComponentRequirement requirementType=ComponentRequirement::SOFT)

References count_, cl_nav2z::CpWaypointNavigatorBase::forward(), smacc2::ISmaccClientBehavior::requiresComponent(), cl_nav2z::CpWaypointNavigatorBase::rewind(), cl_nav2z::CpWaypointNavigatorBase::seekName(), seekWaypointName_, and waypointsNavigator_.

Here is the call graph for this function:

◆ onExit()

void cl_nav2z::CbSeekWaypoint::onExit ( )
overridevirtual

Reimplemented from smacc2::ISmaccClientBehavior.

Definition at line 57 of file cb_seek_waypoint.cpp.

57{}

Member Data Documentation

◆ count_

std::optional<int> cl_nav2z::CbSeekWaypoint::count_
private

Definition at line 48 of file cb_seek_waypoint.hpp.

Referenced by onEntry().

◆ options_

NavigateNextWaypointOptions cl_nav2z::CbSeekWaypoint::options_

Definition at line 45 of file cb_seek_waypoint.hpp.

◆ seekWaypointName_

std::optional<std::string> cl_nav2z::CbSeekWaypoint::seekWaypointName_
private

Definition at line 49 of file cb_seek_waypoint.hpp.

Referenced by onEntry().

◆ waypointsNavigator_

CpWaypointNavigator* cl_nav2z::CbSeekWaypoint::waypointsNavigator_ = nullptr

Definition at line 43 of file cb_seek_waypoint.hpp.

Referenced by onEntry().


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