SMACC2
Public Member Functions | Public Attributes | Protected Attributes | List of all members
smacc2::client_behaviors::CbRosLaunch Class Reference

#include <cb_ros_launch.hpp>

Inheritance diagram for smacc2::client_behaviors::CbRosLaunch:
Inheritance graph
Collaboration diagram for smacc2::client_behaviors::CbRosLaunch:
Collaboration graph

Public Member Functions

 CbRosLaunch ()
 
virtual ~CbRosLaunch ()
 
template<typename TOrthogonal , typename TSourceObject >
void onOrthogonalAllocation ()
 
void onEntry () 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)
 
- 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)
 

Public Attributes

std::optional< std::string > packageName_
 
std::optional< std::string > launchFileName_
 

Protected Attributes

std::string result_
 
smacc2::client_bases::ClRosLaunchclient_
 

Additional Inherited Members

- Protected Member Functions inherited from smacc2::SmaccAsyncClientBehavior
void postSuccessEvent ()
 
void postFailureEvent ()
 
virtual void dispose () override
 
bool isShutdownRequested ()
 
- Protected Member Functions inherited from smacc2::ISmaccClientBehavior
virtual void runtimeConfigure ()
 
virtual void onEntry ()
 
virtual void onExit ()
 
template<typename EventType >
void postEvent (const EventType &ev)
 
template<typename EventType >
void postEvent ()
 
ISmaccStategetCurrentState ()
 
virtual void dispose ()
 
virtual rclcpp::Node::SharedPtr getNode ()
 
virtual rclcpp::Logger getLogger ()
 

Detailed Description

Definition at line 29 of file cb_ros_launch.hpp.

Constructor & Destructor Documentation

◆ CbRosLaunch()

smacc2::client_behaviors::CbRosLaunch::CbRosLaunch ( )

Definition at line 26 of file cb_ros_launch.cpp.

26{}

◆ ~CbRosLaunch()

smacc2::client_behaviors::CbRosLaunch::~CbRosLaunch ( )
virtual

Definition at line 33 of file cb_ros_launch.cpp.

33{}

Member Function Documentation

◆ onEntry()

void smacc2::client_behaviors::CbRosLaunch::onEntry ( )
overridevirtual

Reimplemented from smacc2::ISmaccClientBehavior.

Definition at line 41 of file cb_ros_launch.cpp.

42{
43 RCLCPP_INFO_STREAM(getLogger(), "[CbRosLaunch] OnEntry");
44
45 std::string packageName, launchFileName;
47 {
48 RCLCPP_INFO_STREAM(
49 getLogger(), "[CbRosLaunch] launching: " << *packageName_ << " , " << *launchFileName_);
51 *packageName_, *launchFileName_, []() { return false; });
52 }
53 else
54 {
55 RCLCPP_INFO_STREAM(getLogger(), "[CbRosLaunch] finding Ros Launch client");
56
58 if (client_ != nullptr)
59 {
60 RCLCPP_INFO_STREAM(
61 getLogger(), "[CbRosLaunch] launching from client: " << client_->packageName_ << " , "
63
64 client_->launch();
65 }
66 else
67 {
68 RCLCPP_ERROR(
69 getLogger(),
70 "[CbRosLaunch] Inccorrect ros launch operation. No Ros Launch client specified neither "
71 "package/roslaunch file path.");
72 }
73 }
74}
void requiresClient(SmaccClientType *&storage)
static std::future< std::string > executeRosLaunch(std::string packageName, std::string launchFilename, std::function< bool()> cancelCondition)
std::optional< std::string > launchFileName_
smacc2::client_bases::ClRosLaunch * client_
std::optional< std::string > packageName_

References client_, smacc2::client_bases::ClRosLaunch::executeRosLaunch(), smacc2::ISmaccClientBehavior::getLogger(), smacc2::client_bases::ClRosLaunch::launch(), smacc2::client_bases::ClRosLaunch::launchFileName_, launchFileName_, smacc2::client_bases::ClRosLaunch::packageName_, packageName_, and smacc2::ISmaccClientBehavior::requiresClient().

Here is the call graph for this function:

◆ onOrthogonalAllocation()

template<typename TOrthogonal , typename TSourceObject >
void smacc2::client_behaviors::CbRosLaunch::onOrthogonalAllocation ( )
inline

Definition at line 39 of file cb_ros_launch.hpp.

40 {
41 smacc2::SmaccAsyncClientBehavior::onOrthogonalAllocation<TOrthogonal, TSourceObject>();
42 }

Member Data Documentation

◆ client_

smacc2::client_bases::ClRosLaunch* smacc2::client_behaviors::CbRosLaunch::client_
protected

Definition at line 52 of file cb_ros_launch.hpp.

Referenced by onEntry().

◆ launchFileName_

std::optional<std::string> smacc2::client_behaviors::CbRosLaunch::launchFileName_

Definition at line 47 of file cb_ros_launch.hpp.

Referenced by onEntry().

◆ packageName_

std::optional<std::string> smacc2::client_behaviors::CbRosLaunch::packageName_

Definition at line 46 of file cb_ros_launch.hpp.

Referenced by onEntry().

◆ result_

std::string smacc2::client_behaviors::CbRosLaunch::result_
protected

Definition at line 50 of file cb_ros_launch.hpp.


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