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

Private Member Functions

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

Private Attributes

ros::Duration timeout_
 
ros::Time startTime_
 

Additional Inherited Members

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

Detailed Description

Definition at line 131 of file smacc_runtime_test_node.cpp.

Member Function Documentation

◆ init()

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

Reimplemented from TestPolicy.

Definition at line 136 of file smacc_runtime_test_node.cpp.

137 {
138 ROS_INFO("[TimeoutFailureTestPolicy] initializating");
139 startTime_ = ros::Time::now();
140 timeout_ = ros::Duration((double)initXmlRpcValue["duration"]);
141
142 ROS_INFO_STREAM("[TimeoutFailureTestPolicy] duration: " << timeout_);
143 }

References startTime_, and timeout_.

◆ update()

virtual void TimeoutFailureTestPolicy::update ( )
inlineprivatevirtual

Reimplemented from TestPolicy.

Definition at line 145 of file smacc_runtime_test_node.cpp.

146 {
147 auto now = ros::Time::now();
148
149 auto elapsed = now - startTime_;
150
151 if (elapsed > timeout_)
152 {
153 this->owner_->failure(std::string("timeout failure: ") + std::to_string(timeout_.toSec()));
154 }
155 }
void failure(std::string msg)
SmaccTestRuntimeNode * owner_

References SmaccTestRuntimeNode::failure(), TestPolicy::owner_, startTime_, and timeout_.

Here is the call graph for this function:

Member Data Documentation

◆ startTime_

ros::Time TimeoutFailureTestPolicy::startTime_
private

Definition at line 134 of file smacc_runtime_test_node.cpp.

Referenced by init(), and update().

◆ timeout_

ros::Duration TimeoutFailureTestPolicy::timeout_
private

Definition at line 133 of file smacc_runtime_test_node.cpp.

Referenced by init(), and update().


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