SMACC2
Loading...
Searching...
No Matches
Public Member Functions | Public Attributes | List of all members
cl_nitrosz::CbLoadWaypointsFile Struct Reference

#include <cb_load_waypoints_file.hpp>

Inheritance diagram for cl_nitrosz::CbLoadWaypointsFile:
Inheritance graph
Collaboration diagram for cl_nitrosz::CbLoadWaypointsFile:
Collaboration graph

Public Member Functions

 CbLoadWaypointsFile (std::string filepath)
 
 CbLoadWaypointsFile (std::string parameter_name, std::string packagenamespace)
 
void onEntry () override
 
void onExit () override
 
- Public Member Functions inherited from smacc2::SmaccAsyncClientBehavior
template<typename TOrthogonal , typename TSourceObject >
void onOrthogonalAllocation ()
 
virtual ~SmaccAsyncClientBehavior ()
 
template<typename TCallback , typename T >
boost::signals2::connection onSuccess (TCallback callback, T *object)
 
template<typename TCallback , typename T >
boost::signals2::connection onFinished (TCallback callback, T *object)
 
template<typename TCallback , typename T >
boost::signals2::connection onFailure (TCallback callback, T *object)
 
void requestForceFinish ()
 
void executeOnEntry () override
 
void executeOnExit () override
 
void waitOnEntryThread (bool requestFinish)
 
template<typename TCallbackMethod , typename T >
boost::signals2::connection onSuccess (TCallbackMethod callback, T *object)
 
template<typename TCallbackMethod , typename T >
boost::signals2::connection onFinished (TCallbackMethod callback, T *object)
 
template<typename TCallbackMethod , typename T >
boost::signals2::connection onFailure (TCallbackMethod callback, T *object)
 
- Public Member Functions inherited from smacc2::ISmaccClientBehavior
 ISmaccClientBehavior ()
 
virtual ~ISmaccClientBehavior ()
 
ISmaccStateMachinegetStateMachine ()
 
std::string getName () const
 
template<typename SmaccClientType >
void requiresClient (SmaccClientType *&storage)
 
template<typename SmaccComponentType >
void requiresComponent (SmaccComponentType *&storage, bool throwExceptionIfNotExist=false)
 

Public Attributes

std::optional< std::string > filepath_
 
std::optional< std::string > parameterName_
 
std::optional< std::string > packageNamespace_
 
cl_nitrosz::CpWaypointNavigatorBasewaypointsNavigator_
 

Additional Inherited Members

- Protected Member Functions inherited from smacc2::SmaccAsyncClientBehavior
void postSuccessEvent ()
 
void postFailureEvent ()
 
virtual void dispose () override
 
bool isShutdownRequested ()
 onEntry is executed in a new thread. However the current state cannot be left until the onEntry thread finishes. This flag can be checked from the onEntry thread to force finishing the thread.
 
- Protected Member Functions inherited from smacc2::ISmaccClientBehavior
virtual void runtimeConfigure ()
 
template<typename EventType >
void postEvent (const EventType &ev)
 
template<typename EventType >
void postEvent ()
 
ISmaccStategetCurrentState ()
 
virtual rclcpp::Node::SharedPtr getNode () const
 
virtual rclcpp::Logger getLogger () const
 

Detailed Description

Definition at line 28 of file cb_load_waypoints_file.hpp.

Constructor & Destructor Documentation

◆ CbLoadWaypointsFile() [1/2]

cl_nitrosz::CbLoadWaypointsFile::CbLoadWaypointsFile ( std::string  filepath)

Definition at line 28 of file cb_load_waypoints_file.cpp.

28: filepath_(filepath) {}
std::optional< std::string > filepath_

◆ CbLoadWaypointsFile() [2/2]

cl_nitrosz::CbLoadWaypointsFile::CbLoadWaypointsFile ( std::string  parameter_name,
std::string  packagenamespace 
)

Definition at line 30 of file cb_load_waypoints_file.cpp.

31: parameterName_(parameter_name), packageNamespace_(packagenamespace)
32{
33}
std::optional< std::string > parameterName_
std::optional< std::string > packageNamespace_

Member Function Documentation

◆ onEntry()

void cl_nitrosz::CbLoadWaypointsFile::onEntry ( )
overridevirtual

Reimplemented from smacc2::ISmaccClientBehavior.

Definition at line 35 of file cb_load_waypoints_file.cpp.

36{
37 requiresComponent(waypointsNavigator_); // this is a component from the
38 // nitrosz_client library
39
40 if (filepath_)
41 {
43 }
44 else
45 {
46 RCLCPP_INFO(getLogger(), "Loading waypoints from parameter %s", parameterName_.value().c_str());
48 parameterName_.value(), packageNamespace_.value());
49 }
50
51 // change this to skip some points of the yaml file, default = 0
53 this->postSuccessEvent();
54}
void loadWayPointsFromFile(std::string filepath)
void loadWaypointsFromYamlParameter(std::string parameter_name, std::string yaml_file_package_name)
virtual rclcpp::Logger getLogger() const
void requiresComponent(SmaccComponentType *&storage, bool throwExceptionIfNotExist=false)
cl_nitrosz::CpWaypointNavigatorBase * waypointsNavigator_

References cl_nitrosz::CpWaypointNavigatorBase::currentWaypoint_, filepath_, smacc2::ISmaccClientBehavior::getLogger(), cl_nitrosz::CpWaypointNavigatorBase::loadWayPointsFromFile(), cl_nitrosz::CpWaypointNavigatorBase::loadWaypointsFromYamlParameter(), packageNamespace_, parameterName_, smacc2::SmaccAsyncClientBehavior::postSuccessEvent(), smacc2::ISmaccClientBehavior::requiresComponent(), and waypointsNavigator_.

Here is the call graph for this function:

◆ onExit()

void cl_nitrosz::CbLoadWaypointsFile::onExit ( )
overridevirtual

Reimplemented from smacc2::ISmaccClientBehavior.

Definition at line 56 of file cb_load_waypoints_file.cpp.

56{}

Member Data Documentation

◆ filepath_

std::optional<std::string> cl_nitrosz::CbLoadWaypointsFile::filepath_

Definition at line 39 of file cb_load_waypoints_file.hpp.

Referenced by onEntry().

◆ packageNamespace_

std::optional<std::string> cl_nitrosz::CbLoadWaypointsFile::packageNamespace_

Definition at line 42 of file cb_load_waypoints_file.hpp.

Referenced by onEntry().

◆ parameterName_

std::optional<std::string> cl_nitrosz::CbLoadWaypointsFile::parameterName_

Definition at line 41 of file cb_load_waypoints_file.hpp.

Referenced by onEntry().

◆ waypointsNavigator_

cl_nitrosz::CpWaypointNavigatorBase* cl_nitrosz::CbLoadWaypointsFile::waypointsNavigator_

Definition at line 44 of file cb_load_waypoints_file.hpp.

Referenced by onEntry().


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