SMACC2
|
#include <smacc_action_client_base.hpp>
Public Types | |
typedef rclcpp_action::Client< ActionType > | ActionClient |
using | Goal = typename ActionClient::Goal |
using | Feedback = typename ActionClient::Feedback |
using | GoalHandle = rclcpp_action::ClientGoalHandle< ActionType > |
typedef GoalHandle::WrappedResult | WrappedResult |
using | SendGoalOptions = typename ActionClient::SendGoalOptions |
using | GoalResponseCallback = std::function< void(std::shared_future< typename GoalHandle::SharedPtr >)> |
using | FeedbackCallback = typename GoalHandle::FeedbackCallback |
using | ResultCallback = typename GoalHandle::ResultCallback |
using | CancelRequest = typename ActionType::Impl::CancelGoalService::Request |
using | CancelResponse = typename ActionType::Impl::CancelGoalService::Response |
using | CancelCallback = std::function< void(typename CancelResponse::SharedPtr)> |
typedef smacc2::SmaccSignal< void(const WrappedResult &)> | SmaccActionResultSignal |
Public Member Functions | |
SmaccActionClientBase (std::string actionServerName) | |
SmaccActionClientBase () | |
virtual | ~SmaccActionClientBase () |
virtual std::shared_ptr< rclcpp_action::ClientBase > | getClientBase () override |
void | onInitialize () override |
template<typename EvType > | |
void | postResultEvent (WrappedResult &) |
template<typename TOrthogonal , typename TSourceObject > | |
void | onOrthogonalAllocation () |
template<typename T > | |
boost::signals2::connection | onSucceeded (void(T::*callback)(WrappedResult &), T *object) |
template<typename T > | |
boost::signals2::connection | onSucceeded (std::function< void(WrappedResult &)> callback) |
template<typename T > | |
boost::signals2::connection | onAborted (void(T::*callback)(WrappedResult &), T *object) |
template<typename T > | |
boost::signals2::connection | onAborted (std::function< void(WrappedResult &)> callback) |
template<typename T > | |
boost::signals2::connection | onCancelled (void(T::*callback)(WrappedResult &), T *object) |
template<typename T > | |
boost::signals2::connection | onCancelled (std::function< void(WrappedResult &)> callback) |
virtual bool | cancelGoal () override |
std::shared_future< typename GoalHandle::SharedPtr > | sendGoal (Goal &goal, typename SmaccActionResultSignal::WeakPtr resultCallback=typename SmaccActionResultSignal::WeakPtr()) |
Public Member Functions inherited from smacc2::client_bases::ISmaccActionClient | |
ISmaccActionClient () | |
virtual | ~ISmaccActionClient () |
std::string | getNamespace () const |
virtual bool | cancelGoal ()=0 |
virtual std::shared_ptr< rclcpp_action::ClientBase > | getClientBase ()=0 |
virtual std::string | getName () const |
Public Member Functions inherited from smacc2::ISmaccClient | |
ISmaccClient () | |
virtual | ~ISmaccClient () |
virtual void | onInitialize () |
virtual std::string | getName () const |
template<typename TComponent > | |
TComponent * | getComponent () |
template<typename TComponent > | |
TComponent * | getComponent (std::string name) |
template<typename TComponent > | |
TComponent * | getComponent (int index) |
virtual smacc2::introspection::TypeInfo::Ptr | getType () |
ISmaccStateMachine * | getStateMachine () |
template<typename TSmaccSignal , typename T > | |
void | connectSignal (TSmaccSignal &signal, void(T::*callback)(), T *object) |
template<typename SmaccClientType > | |
void | requiresClient (SmaccClientType *&storage) |
void | getComponents (std::vector< std::shared_ptr< ISmaccComponent > > &components) |
const std::vector< std::shared_ptr< ISmaccComponent > > & | iterateComponents () const |
template<typename EventType > | |
void | postEvent (const EventType &ev) |
template<typename EventType > | |
void | postEvent () |
Static Public Member Functions | |
static std::string | getEventLabel () |
Public Attributes | |
std::string | action_endpoint_ |
std::optional< std::shared_future< typename GoalHandle::SharedPtr > > | lastRequest_ |
SmaccActionResultSignal | onSucceeded_ |
SmaccActionResultSignal | onAborted_ |
SmaccActionResultSignal | onCancelled_ |
std::function< void(WrappedResult)> | postSuccessEvent |
std::function< void(WrappedResult)> | postAbortedEvent |
std::function< void(WrappedResult)> | postCancelledEvent |
std::function< void(const Feedback &)> | postFeedbackEvent |
FeedbackCallback | feedback_cb |
Protected Member Functions | |
void | onFeedback (typename GoalHandle::SharedPtr, const std::shared_ptr< const Feedback > feedback_msg) |
void | onResult (const WrappedResult &result_msg) |
Protected Member Functions inherited from smacc2::ISmaccClient | |
template<typename TOrthogonal , typename TSourceObject > | |
void | onOrthogonalAllocation () |
template<typename SmaccComponentType , typename TOrthogonal , typename TClient , typename... TArgs> | |
SmaccComponentType * | createComponent (TArgs... targs) |
template<typename SmaccComponentType , typename TOrthogonal , typename TClient , typename... TArgs> | |
SmaccComponentType * | createNamedComponent (std::string name, TArgs... targs) |
rclcpp::Node::SharedPtr | getNode () |
rclcpp::Logger | getLogger () |
Protected Attributes | |
ActionClient::SharedPtr | client_ |
Protected Attributes inherited from smacc2::client_bases::ISmaccActionClient | |
std::string | name_ |
Protected Attributes inherited from smacc2::ISmaccClient | |
std::map< ComponentKey, std::shared_ptr< smacc2::ISmaccComponent > > | components_ |
Definition at line 37 of file smacc_action_client_base.hpp.
typedef rclcpp_action::Client<ActionType> smacc2::client_bases::SmaccActionClientBase< ActionType >::ActionClient |
Definition at line 42 of file smacc_action_client_base.hpp.
using smacc2::client_bases::SmaccActionClientBase< ActionType >::CancelCallback = std::function<void(typename CancelResponse::SharedPtr)> |
Definition at line 61 of file smacc_action_client_base.hpp.
using smacc2::client_bases::SmaccActionClientBase< ActionType >::CancelRequest = typename ActionType::Impl::CancelGoalService::Request |
Definition at line 59 of file smacc_action_client_base.hpp.
using smacc2::client_bases::SmaccActionClientBase< ActionType >::CancelResponse = typename ActionType::Impl::CancelGoalService::Response |
Definition at line 60 of file smacc_action_client_base.hpp.
using smacc2::client_bases::SmaccActionClientBase< ActionType >::Feedback = typename ActionClient::Feedback |
Definition at line 50 of file smacc_action_client_base.hpp.
using smacc2::client_bases::SmaccActionClientBase< ActionType >::FeedbackCallback = typename GoalHandle::FeedbackCallback |
Definition at line 57 of file smacc_action_client_base.hpp.
using smacc2::client_bases::SmaccActionClientBase< ActionType >::Goal = typename ActionClient::Goal |
Definition at line 49 of file smacc_action_client_base.hpp.
using smacc2::client_bases::SmaccActionClientBase< ActionType >::GoalHandle = rclcpp_action::ClientGoalHandle<ActionType> |
Definition at line 51 of file smacc_action_client_base.hpp.
using smacc2::client_bases::SmaccActionClientBase< ActionType >::GoalResponseCallback = std::function<void(std::shared_future<typename GoalHandle::SharedPtr>)> |
Definition at line 55 of file smacc_action_client_base.hpp.
using smacc2::client_bases::SmaccActionClientBase< ActionType >::ResultCallback = typename GoalHandle::ResultCallback |
Definition at line 58 of file smacc_action_client_base.hpp.
using smacc2::client_bases::SmaccActionClientBase< ActionType >::SendGoalOptions = typename ActionClient::SendGoalOptions |
Definition at line 54 of file smacc_action_client_base.hpp.
typedef smacc2::SmaccSignal<void(const WrappedResult &)> smacc2::client_bases::SmaccActionClientBase< ActionType >::SmaccActionResultSignal |
Definition at line 63 of file smacc_action_client_base.hpp.
typedef GoalHandle::WrappedResult smacc2::client_bases::SmaccActionClientBase< ActionType >::WrappedResult |
Definition at line 52 of file smacc_action_client_base.hpp.
|
inline |
Definition at line 66 of file smacc_action_client_base.hpp.
References smacc2::client_bases::SmaccActionClientBase< ActionType >::action_endpoint_.
|
inline |
Definition at line 71 of file smacc_action_client_base.hpp.
References smacc2::client_bases::ISmaccActionClient::name_.
|
inlinevirtual |
Definition at line 73 of file smacc_action_client_base.hpp.
|
inlineoverridevirtual |
Implements smacc2::client_bases::ISmaccActionClient.
Definition at line 214 of file smacc_action_client_base.hpp.
References smacc2::client_bases::SmaccActionClientBase< ActionType >::client_.
Referenced by cl_nav2z::CbNav2ZClientBehaviorBase::cancelGoal(), and cl_nav2z::CbAbortNavigation::onEntry().
|
inlineoverridevirtual |
Implements smacc2::client_bases::ISmaccActionClient.
Definition at line 75 of file smacc_action_client_base.hpp.
References smacc2::client_bases::SmaccActionClientBase< ActionType >::client_.
|
inlinestatic |
Definition at line 87 of file smacc_action_client_base.hpp.
|
inline |
Definition at line 171 of file smacc_action_client_base.hpp.
References smacc2::ISmaccStateMachine::createSignalConnection(), and smacc2::ISmaccClient::getStateMachine().
|
inline |
Definition at line 165 of file smacc_action_client_base.hpp.
References smacc2::ISmaccStateMachine::createSignalConnection(), and smacc2::ISmaccClient::getStateMachine().
|
inline |
Definition at line 183 of file smacc_action_client_base.hpp.
References smacc2::ISmaccStateMachine::createSignalConnection(), and smacc2::ISmaccClient::getStateMachine().
|
inline |
Definition at line 177 of file smacc_action_client_base.hpp.
References smacc2::ISmaccStateMachine::createSignalConnection(), and smacc2::ISmaccClient::getStateMachine().
|
inlineprotected |
Definition at line 380 of file smacc_action_client_base.hpp.
References smacc2::client_bases::SmaccActionClientBase< ActionType >::postFeedbackEvent.
Referenced by smacc2::client_bases::SmaccActionClientBase< ActionType >::onOrthogonalAllocation().
|
inlineoverridevirtual |
Reimplemented from smacc2::ISmaccClient.
Definition at line 77 of file smacc_action_client_base.hpp.
References smacc2::client_bases::SmaccActionClientBase< ActionType >::action_endpoint_, smacc2::client_bases::SmaccActionClientBase< ActionType >::client_, smacc2::introspection::demangleSymbol(), smacc2::ISmaccClient::getNode(), and smacc2::client_bases::ISmaccActionClient::name_.
|
inline |
Definition at line 125 of file smacc_action_client_base.hpp.
References smacc2::introspection::demangleType(), smacc2::client_bases::SmaccActionClientBase< ActionType >::feedback_cb, smacc2::ISmaccClient::getLogger(), smacc2::client_bases::SmaccActionClientBase< ActionType >::onFeedback(), smacc2::client_bases::SmaccActionClientBase< ActionType >::postAbortedEvent, smacc2::client_bases::SmaccActionClientBase< ActionType >::postCancelledEvent, smacc2::ISmaccClient::postEvent(), smacc2::client_bases::SmaccActionClientBase< ActionType >::postFeedbackEvent, and smacc2::client_bases::SmaccActionClientBase< ActionType >::postSuccessEvent.
|
inlineprotected |
Definition at line 387 of file smacc_action_client_base.hpp.
References smacc2::ISmaccClient::getLogger(), smacc2::client_bases::ISmaccActionClient::getName(), smacc2::client_bases::SmaccActionClientBase< ActionType >::onAborted_, smacc2::client_bases::SmaccActionClientBase< ActionType >::onCancelled_, smacc2::client_bases::SmaccActionClientBase< ActionType >::onSucceeded_, smacc2::client_bases::SmaccActionClientBase< ActionType >::postAbortedEvent, smacc2::client_bases::SmaccActionClientBase< ActionType >::postCancelledEvent, and smacc2::client_bases::SmaccActionClientBase< ActionType >::postSuccessEvent.
Referenced by smacc2::client_bases::SmaccActionClientBase< ActionType >::sendGoal().
|
inline |
Definition at line 159 of file smacc_action_client_base.hpp.
References smacc2::ISmaccStateMachine::createSignalConnection(), and smacc2::ISmaccClient::getStateMachine().
|
inline |
Definition at line 153 of file smacc_action_client_base.hpp.
References smacc2::ISmaccStateMachine::createSignalConnection(), and smacc2::ISmaccClient::getStateMachine().
|
inline |
Definition at line 114 of file smacc_action_client_base.hpp.
References smacc2::introspection::demangleSymbol(), smacc2::ISmaccClient::getLogger(), and smacc2::ISmaccClient::postEvent().
|
inline |
Function called whenever feedback is received for the goal.
Function called when the result for the goal is received.
Definition at line 245 of file smacc_action_client_base.hpp.
References smacc2::client_bases::SmaccActionClientBase< ActionType >::client_, smacc2::introspection::demangleSymbol(), smacc2::client_bases::SmaccActionClientBase< ActionType >::feedback_cb, smacc2::ISmaccClient::getLogger(), smacc2::client_bases::ISmaccActionClient::getName(), and smacc2::client_bases::SmaccActionClientBase< ActionType >::onResult().
Referenced by cl_nav2z::CbNav2ZClientBehaviorBase::sendGoal(), and cl_nav2z::WaypointNavigator::sendNextGoal().
std::string smacc2::client_bases::SmaccActionClientBase< ActionType >::action_endpoint_ |
Definition at line 65 of file smacc_action_client_base.hpp.
Referenced by smacc2::client_bases::SmaccActionClientBase< ActionType >::onInitialize(), and smacc2::client_bases::SmaccActionClientBase< ActionType >::SmaccActionClientBase().
|
protected |
Definition at line 378 of file smacc_action_client_base.hpp.
Referenced by smacc2::client_bases::SmaccActionClientBase< ActionType >::cancelGoal(), smacc2::client_bases::SmaccActionClientBase< ActionType >::getClientBase(), smacc2::client_bases::SmaccActionClientBase< ActionType >::onInitialize(), and smacc2::client_bases::SmaccActionClientBase< ActionType >::sendGoal().
FeedbackCallback smacc2::client_bases::SmaccActionClientBase< ActionType >::feedback_cb |
Definition at line 111 of file smacc_action_client_base.hpp.
Referenced by smacc2::client_bases::SmaccActionClientBase< ActionType >::onOrthogonalAllocation(), and smacc2::client_bases::SmaccActionClientBase< ActionType >::sendGoal().
std::optional<std::shared_future<typename GoalHandle::SharedPtr> > smacc2::client_bases::SmaccActionClientBase< ActionType >::lastRequest_ |
Definition at line 93 of file smacc_action_client_base.hpp.
SmaccActionResultSignal smacc2::client_bases::SmaccActionClientBase< ActionType >::onAborted_ |
Definition at line 97 of file smacc_action_client_base.hpp.
Referenced by smacc2::client_bases::SmaccActionClientBase< ActionType >::onResult().
SmaccActionResultSignal smacc2::client_bases::SmaccActionClientBase< ActionType >::onCancelled_ |
Definition at line 100 of file smacc_action_client_base.hpp.
Referenced by smacc2::client_bases::SmaccActionClientBase< ActionType >::onResult().
SmaccActionResultSignal smacc2::client_bases::SmaccActionClientBase< ActionType >::onSucceeded_ |
Definition at line 96 of file smacc_action_client_base.hpp.
Referenced by smacc2::client_bases::SmaccActionClientBase< ActionType >::onResult().
std::function<void(WrappedResult)> smacc2::client_bases::SmaccActionClientBase< ActionType >::postAbortedEvent |
Definition at line 104 of file smacc_action_client_base.hpp.
Referenced by smacc2::client_bases::SmaccActionClientBase< ActionType >::onOrthogonalAllocation(), and smacc2::client_bases::SmaccActionClientBase< ActionType >::onResult().
std::function<void(WrappedResult)> smacc2::client_bases::SmaccActionClientBase< ActionType >::postCancelledEvent |
Definition at line 105 of file smacc_action_client_base.hpp.
Referenced by smacc2::client_bases::SmaccActionClientBase< ActionType >::onOrthogonalAllocation(), and smacc2::client_bases::SmaccActionClientBase< ActionType >::onResult().
std::function<void(const Feedback &)> smacc2::client_bases::SmaccActionClientBase< ActionType >::postFeedbackEvent |
Definition at line 109 of file smacc_action_client_base.hpp.
Referenced by smacc2::client_bases::SmaccActionClientBase< ActionType >::onFeedback(), and smacc2::client_bases::SmaccActionClientBase< ActionType >::onOrthogonalAllocation().
std::function<void(WrappedResult)> smacc2::client_bases::SmaccActionClientBase< ActionType >::postSuccessEvent |
Definition at line 103 of file smacc_action_client_base.hpp.
Referenced by smacc2::client_bases::SmaccActionClientBase< ActionType >::onOrthogonalAllocation(), and smacc2::client_bases::SmaccActionClientBase< ActionType >::onResult().