22#include <rclcpp/rclcpp.hpp>
28namespace client_behaviors
38 auto onDelayedConfigureFn = first;
40 RCLCPP_INFO(
getLogger(),
"[SequenceNode %ld] Behavior on delayed sequence configure", (
long)
this);
41 bh_ = onDelayedConfigureFn();
42 std::string currentNodeName =
bh_->getName();
44 RCLCPP_INFO(
getLogger(),
"[SequenceNode %ld] Subscribing OnSuccess", (
long)
this);
49 getLogger(),
"[SequenceNode %ld] subnode %s on entry", (
long)
this, currentNodeName.c_str());
50 bh_->executeOnEntry();
52 getLogger(),
"[SequenceNode %ld] subnode %s on entry finished", (
long)
this,
53 currentNodeName.c_str());
54 bh_->waitOnEntryThread(
false);
56 getLogger(),
"[SequenceNode %ld] subnode %s thread finished", (
long)
this,
57 currentNodeName.c_str());
66 if (is_shutdown_requested)
71 rclcpp::sleep_for(std::chrono::milliseconds(200));
74 "[CbSequence %ld] Waiting for subnodes to finish %ld. Current head Behavior: %s ", (
long)
this,
80 this->
conn_.disconnect();
95 RCLCPP_INFO(
getLogger(),
"[CbSequence %ld] All subnodes finished", (
long)
this);
100 RCLCPP_INFO(
getLogger(),
"[CbSequence %ld] Aborting", (
long)
this);
117 this->
conn_.disconnect();
118 this->
conn2_.disconnect();
122 getLogger(),
"[CbSequence %ld] Abort NextCbSequence requesting for force finish", (
long)
this);
virtual rclcpp::Logger getLogger() const
virtual rclcpp::Node::SharedPtr getNode() const
bool isShutdownRequested()
void requestForceFinish()
void recursiveConsumeNext()
std::atomic< int > consume_
boost::signals2::connection conn_
boost::signals2::connection conn2_
std::list< std::function< std::shared_ptr< smacc2::SmaccAsyncClientBehavior >()> > sequenceNodes_
std::shared_ptr< smacc2::SmaccAsyncClientBehavior > bh_
std::string demangleType(const std::type_info *tinfo)