SMACC2
Loading...
Searching...
No Matches
Public Member Functions | Protected Attributes | List of all members
cl_nitrosz::CbNavigateNextWaypoint Class Reference

#include <cb_navigate_next_waypoint.hpp>

Inheritance diagram for cl_nitrosz::CbNavigateNextWaypoint:
Inheritance graph
Collaboration diagram for cl_nitrosz::CbNavigateNextWaypoint:
Collaboration graph

Public Member Functions

 CbNavigateNextWaypoint (std::optional< NavigateNextWaypointOptions > options=std::nullopt)
 
virtual ~CbNavigateNextWaypoint ()
 
void onEntry () override
 
void onExit () override
 
- Public Member Functions inherited from cl_nitrosz::CbNav2ZClientBehaviorBase
virtual ~CbNav2ZClientBehaviorBase ()
 
template<typename TOrthogonal , typename TSourceObject >
void onOrthogonalAllocation ()
 
- 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)
 

Protected Attributes

CpWaypointNavigatorwaypointsNavigator_
 
NavigateNextWaypointOptions options_
 
cl_nitrosz::ClNitrosZ::SmaccNavigateResultSignal::SharedPtr navigationCallback_
 
- Protected Attributes inherited from cl_nitrosz::CbNav2ZClientBehaviorBase
cl_nitrosz::ClNitrosZnitroszClient_
 
cl_nitrosz::ClNitrosZ::SmaccNavigateResultSignal::SharedPtr navigationCallback_
 
rclcpp_action::ResultCode navigationResult_
 
std::shared_future< std::shared_ptr< rclcpp_action::ClientGoalHandle< nav2_msgs::action::NavigateToPose > > > goalHandleFuture_
 

Additional Inherited Members

- Protected Member Functions inherited from cl_nitrosz::CbNav2ZClientBehaviorBase
void sendGoal (ClNitrosZ::Goal &goal)
 
void cancelGoal ()
 
bool isOwnActionResponse (const ClNitrosZ::WrappedResult &)
 
virtual void onNavigationResult (const ClNitrosZ::WrappedResult &)
 
virtual void onNavigationActionSuccess (const ClNitrosZ::WrappedResult &)
 
virtual void onNavigationActionAbort (const ClNitrosZ::WrappedResult &)
 
- 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 29 of file cb_navigate_next_waypoint.hpp.

Constructor & Destructor Documentation

◆ CbNavigateNextWaypoint()

cl_nitrosz::CbNavigateNextWaypoint::CbNavigateNextWaypoint ( std::optional< NavigateNextWaypointOptions options = std::nullopt)

Definition at line 25 of file cb_navigate_next_waypoint.cpp.

26{
27 if (options) options_ = *options;
28}

References options_.

◆ ~CbNavigateNextWaypoint()

cl_nitrosz::CbNavigateNextWaypoint::~CbNavigateNextWaypoint ( )
virtual

Definition at line 30 of file cb_navigate_next_waypoint.cpp.

30{}

Member Function Documentation

◆ onEntry()

void cl_nitrosz::CbNavigateNextWaypoint::onEntry ( )
overridevirtual

Reimplemented from smacc2::ISmaccClientBehavior.

Reimplemented in cl_nitrosz::CbNavigateNextWaypointUntilReached.

Definition at line 32 of file cb_navigate_next_waypoint.cpp.

33{
34 waypointsNavigator_ = nitroszClient_->getComponent<CpWaypointNavigator>();
35
36 this->navigationCallback_ = std::make_shared<cl_nitrosz::ClNitrosZ::SmaccNavigateResultSignal>();
37
39 *navigationCallback_, &CbNavigateNextWaypoint::onNavigationResult, this);
40
42
43 auto waypointname = waypointsNavigator_->getCurrentWaypointName();
44
45 if (waypointname)
46 {
47 RCLCPP_INFO(
48 getLogger(), "[CbNavigateNextWaypoint] current iteration waypoints i: %ld with name '%s'",
49 waypointsNavigator_->getCurrentWaypointIndex(), waypointname->c_str());
50 }
51 else
52 {
53 RCLCPP_INFO(
54 getLogger(), "[CbNavigateNextWaypoint] current iteration waypoints i: %ld",
56 }
57}
virtual void onNavigationResult(const ClNitrosZ::WrappedResult &)
cl_nitrosz::ClNitrosZ::SmaccNavigateResultSignal::SharedPtr navigationCallback_
std::optional< std::string > getCurrentWaypointName() const
std::optional< std::shared_future< std::shared_ptr< rclcpp_action::ClientGoalHandle< nav2_msgs::action::NavigateToPose > > > > sendNextGoal(std::optional< NavigateNextWaypointOptions > options=std::nullopt, cl_nitrosz::ClNitrosZ::SmaccNavigateResultSignal::WeakPtr callback=cl_nitrosz::ClNitrosZ::SmaccNavigateResultSignal::WeakPtr())
virtual rclcpp::Logger getLogger() const
boost::signals2::connection createSignalConnection(TSmaccSignal &signal, TMemberFunctionPrototype callback, TSmaccObjectType *object)

References smacc2::ISmaccStateMachine::createSignalConnection(), smacc2::ISmaccClient::getComponent(), cl_nitrosz::CpWaypointNavigatorBase::getCurrentWaypointIndex(), cl_nitrosz::CpWaypointNavigatorBase::getCurrentWaypointName(), smacc2::ISmaccClientBehavior::getLogger(), smacc2::ISmaccClientBehavior::getStateMachine(), navigationCallback_, cl_nitrosz::CbNav2ZClientBehaviorBase::nitroszClient_, cl_nitrosz::CbNav2ZClientBehaviorBase::onNavigationResult(), options_, cl_nitrosz::CpWaypointNavigator::sendNextGoal(), and waypointsNavigator_.

Referenced by cl_nitrosz::CbNavigateNamedWaypoint::onEntry(), and cl_nitrosz::CbNavigateNextWaypointUntilReached::onEntry().

Here is the call graph for this function:
Here is the caller graph for this function:

◆ onExit()

void cl_nitrosz::CbNavigateNextWaypoint::onExit ( )
overridevirtual

Member Data Documentation

◆ navigationCallback_

cl_nitrosz::ClNitrosZ::SmaccNavigateResultSignal::SharedPtr cl_nitrosz::CbNavigateNextWaypoint::navigationCallback_
protected

Definition at line 45 of file cb_navigate_next_waypoint.hpp.

Referenced by onEntry().

◆ options_

NavigateNextWaypointOptions cl_nitrosz::CbNavigateNextWaypoint::options_
protected

Definition at line 43 of file cb_navigate_next_waypoint.hpp.

Referenced by CbNavigateNextWaypoint(), and onEntry().

◆ waypointsNavigator_

CpWaypointNavigator* cl_nitrosz::CbNavigateNextWaypoint::waypointsNavigator_
protected

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