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)> |
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) |
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) |
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_ |
GoalHandle::SharedPtr | goalHandle_ |
smacc2::SmaccSignal< void(const WrappedResult &)> | onSucceeded_ |
smacc2::SmaccSignal< void(const WrappedResult &)> | onAborted_ |
smacc2::SmaccSignal< void(const WrappedResult &)> | onCancelled_ |
std::function< void(WrappedResult)> | postSuccessEvent |
std::function< void(WrappedResult)> | postAbortedEvent |
std::function< void(WrappedResult)> | postCancelledEvent |
std::function< void(const Feedback &)> | postFeedbackEvent |
ResultCallback | done_cb |
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 GoalHandle::WrappedResult smacc2::client_bases::SmaccActionClientBase< ActionType >::WrappedResult |
Definition at line 52 of file smacc_action_client_base.hpp.
|
inline |
Definition at line 64 of file smacc_action_client_base.hpp.
References smacc2::client_bases::SmaccActionClientBase< ActionType >::action_endpoint_.
|
inline |
Definition at line 69 of file smacc_action_client_base.hpp.
References smacc2::client_bases::ISmaccActionClient::name_.
|
inlinevirtual |
Definition at line 71 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_, smacc2::ISmaccClient::getLogger(), smacc2::client_bases::ISmaccActionClient::getName(), smacc2::client_bases::ISmaccActionClient::getNamespace(), smacc2::ISmaccClient::getNode(), and smacc2::client_bases::SmaccActionClientBase< ActionType >::lastRequest_.
|
inlineoverridevirtual |
Implements smacc2::client_bases::ISmaccActionClient.
Definition at line 73 of file smacc_action_client_base.hpp.
References smacc2::client_bases::SmaccActionClientBase< ActionType >::client_.
|
inlinestatic |
Definition at line 85 of file smacc_action_client_base.hpp.
References generate_debs::type.
|
inline |
Definition at line 171 of file smacc_action_client_base.hpp.
References callback(), smacc2::ISmaccStateMachine::createSignalConnection(), and smacc2::ISmaccClient::getStateMachine().
|
inline |
Definition at line 165 of file smacc_action_client_base.hpp.
References callback(), smacc2::ISmaccStateMachine::createSignalConnection(), and smacc2::ISmaccClient::getStateMachine().
Referenced by cl_nav2z::CbNav2ZClientBehaviorBase::onOrthogonalAllocation(), and cl_nav2z::WaypointNavigator::sendNextGoal().
|
inline |
Definition at line 183 of file smacc_action_client_base.hpp.
References callback(), smacc2::ISmaccStateMachine::createSignalConnection(), and smacc2::ISmaccClient::getStateMachine().
|
inline |
Definition at line 177 of file smacc_action_client_base.hpp.
References callback(), smacc2::ISmaccStateMachine::createSignalConnection(), and smacc2::ISmaccClient::getStateMachine().
Referenced by cl_nav2z::CbNav2ZClientBehaviorBase::onOrthogonalAllocation(), and cl_nav2z::WaypointNavigator::sendNextGoal().
|
inlineprotected |
Definition at line 342 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 75 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 >::done_cb, smacc2::client_bases::SmaccActionClientBase< ActionType >::feedback_cb, smacc2::ISmaccClient::getLogger(), smacc2::client_bases::SmaccActionClientBase< ActionType >::onFeedback(), smacc2::client_bases::SmaccActionClientBase< ActionType >::onResult(), 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 349 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 >::onOrthogonalAllocation().
|
inline |
Definition at line 159 of file smacc_action_client_base.hpp.
References callback(), smacc2::ISmaccStateMachine::createSignalConnection(), and smacc2::ISmaccClient::getStateMachine().
|
inline |
Definition at line 153 of file smacc_action_client_base.hpp.
References callback(), smacc2::ISmaccStateMachine::createSignalConnection(), and smacc2::ISmaccClient::getStateMachine().
Referenced by cl_nav2z::CbNav2ZClientBehaviorBase::onOrthogonalAllocation(), sm_dance_bot::StNavigateForward1::runtimeConfigure(), sm_dance_bot_strikes_back::StNavigateForward1::runtimeConfigure(), and cl_nav2z::WaypointNavigator::sendNextGoal().
|
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 239 of file smacc_action_client_base.hpp.
References smacc2::client_bases::SmaccActionClientBase< ActionType >::client_, smacc2::client_bases::SmaccActionClientBase< ActionType >::done_cb, smacc2::client_bases::SmaccActionClientBase< ActionType >::feedback_cb, smacc2::ISmaccClient::getLogger(), smacc2::client_bases::ISmaccActionClient::getName(), smacc2::client_bases::SmaccActionClientBase< ActionType >::goalHandle_, and smacc2::client_bases::SmaccActionClientBase< ActionType >::lastRequest_.
Referenced by cl_nav2z::CbNavigateGlobalPosition::execute(), cl_nav2z::CbAbsoluteRotate::onEntry(), cl_nav2z::CbNavigateBackwards::onEntry(), cl_nav2z::CbNavigateForward::onEntry(), cl_nav2z::CbRotate::onEntry(), cl_nav2z::CbUndoPathBackwards::onEntry(), sm_dance_bot::cl_led::CbLEDOff::onEntry(), sm_dance_bot::cl_led::CbLEDOn::onEntry(), sm_dance_bot_strikes_back::cl_led::CbLEDOff::onEntry(), sm_dance_bot_strikes_back::cl_led::CbLEDOn::onEntry(), sm_dance_bot_warehouse::cl_led::CbLEDOff::onEntry(), sm_dance_bot_warehouse::cl_led::CbLEDOn::onEntry(), sm_dance_bot_warehouse_2::cl_led::CbLEDOff::onEntry(), sm_dance_bot_warehouse_2::cl_led::CbLEDOn::onEntry(), sm_dance_bot_warehouse_3::cl_led::CbLEDOff::onEntry(), sm_dance_bot_warehouse_3::cl_led::CbLEDOn::onEntry(), and cl_nav2z::WaypointNavigator::sendNextGoal().
std::string smacc2::client_bases::SmaccActionClientBase< ActionType >::action_endpoint_ |
Definition at line 63 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 340 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().
ResultCallback smacc2::client_bases::SmaccActionClientBase< ActionType >::done_cb |
Definition at line 109 of file smacc_action_client_base.hpp.
Referenced by smacc2::client_bases::SmaccActionClientBase< ActionType >::onOrthogonalAllocation(), 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().
GoalHandle::SharedPtr smacc2::client_bases::SmaccActionClientBase< ActionType >::goalHandle_ |
Definition at line 92 of file smacc_action_client_base.hpp.
Referenced by smacc2::client_bases::SmaccActionClientBase< ActionType >::sendGoal().
std::optional<std::shared_future<typename GoalHandle::SharedPtr> > smacc2::client_bases::SmaccActionClientBase< ActionType >::lastRequest_ |
Definition at line 91 of file smacc_action_client_base.hpp.
Referenced by smacc2::client_bases::SmaccActionClientBase< ActionType >::cancelGoal(), and smacc2::client_bases::SmaccActionClientBase< ActionType >::sendGoal().
smacc2::SmaccSignal<void(const WrappedResult &)> smacc2::client_bases::SmaccActionClientBase< ActionType >::onAborted_ |
Definition at line 95 of file smacc_action_client_base.hpp.
Referenced by smacc2::client_bases::SmaccActionClientBase< ActionType >::onResult().
smacc2::SmaccSignal<void(const WrappedResult &)> smacc2::client_bases::SmaccActionClientBase< ActionType >::onCancelled_ |
Definition at line 98 of file smacc_action_client_base.hpp.
Referenced by smacc2::client_bases::SmaccActionClientBase< ActionType >::onResult().
smacc2::SmaccSignal<void(const WrappedResult &)> smacc2::client_bases::SmaccActionClientBase< ActionType >::onSucceeded_ |
Definition at line 94 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 102 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 107 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 101 of file smacc_action_client_base.hpp.
Referenced by smacc2::client_bases::SmaccActionClientBase< ActionType >::onOrthogonalAllocation(), and smacc2::client_bases::SmaccActionClientBase< ActionType >::onResult().