SMACC
Loading...
Searching...
No Matches
Private Member Functions | Private Attributes | List of all members
ReachedStateSuccessTestPolicy Class Reference
Inheritance diagram for ReachedStateSuccessTestPolicy:
Inheritance graph
Collaboration diagram for ReachedStateSuccessTestPolicy:
Collaboration graph

Private Member Functions

virtual void init (XmlRpc::XmlRpcValue &initXmlRpcValue) override
 
virtual void update ()
 

Private Attributes

std::string targetStateName_
 

Additional Inherited Members

virtual void init (XmlRpc::XmlRpcValue &initXmlRpcValue)
 
virtual void update ()
 
- Public Attributes inherited from TestPolicy
SmaccTestRuntimeNodeowner_
 

Detailed Description

Definition at line 158 of file smacc_runtime_test_node.cpp.

Member Function Documentation

◆ init()

virtual void ReachedStateSuccessTestPolicy::init ( XmlRpc::XmlRpcValue &  initXmlRpcValue)
inlineoverrideprivatevirtual

Reimplemented from TestPolicy.

Definition at line 161 of file smacc_runtime_test_node.cpp.

162 {
163 ROS_INFO("[ReachedStateSuccessTestPolicy] initializating");
164 targetStateName_ = ((std::string)initXmlRpcValue["state_name"]);
165 ROS_INFO_STREAM("[ReachedStateSuccessTestPolicy] success state: " << targetStateName_);
166 this->owner_->onSmaccTransition.connect(
167 [=](auto& msg)
168 {
169 ROS_INFO_STREAM("[ReachedStateSuccessTestPolicy] received state: " << msg.transition.destiny_state_name);
170
171 if(msg.transition.destiny_state_name == targetStateName_)
172 {
173 this->owner_->success(std::string("success destiny state ") + targetStateName_);
174 }
175 });
176 }
void success(std::string msg)
boost::signals2::signal< void(const smacc_msgs::SmaccTransitionLogEntry &)> onSmaccTransition
SmaccTestRuntimeNode * owner_

References SmaccTestRuntimeNode::onSmaccTransition, TestPolicy::owner_, SmaccTestRuntimeNode::success(), and targetStateName_.

Here is the call graph for this function:

◆ update()

virtual void ReachedStateSuccessTestPolicy::update ( )
inlineprivatevirtual

Reimplemented from TestPolicy.

Definition at line 178 of file smacc_runtime_test_node.cpp.

179 {
180
181 }

Member Data Documentation

◆ targetStateName_

std::string ReachedStateSuccessTestPolicy::targetStateName_
private

Definition at line 160 of file smacc_runtime_test_node.cpp.

Referenced by init().


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