SMACC2
|
#include <cp_action_client.hpp>
Public Types | |
using | ActionClient = rclcpp_action::Client<ActionType> |
using | Goal = typename ActionType::Goal |
using | Feedback = typename ActionType::Feedback |
using | Result = typename ActionType::Result |
using | GoalHandle = rclcpp_action::ClientGoalHandle<ActionType> |
using | WrappedResult = typename GoalHandle::WrappedResult |
using | SendGoalOptions = typename ActionClient::SendGoalOptions |
using | GoalResponseCallback |
using | FeedbackCallback = typename GoalHandle::FeedbackCallback |
using | ResultCallback = typename GoalHandle::ResultCallback |
Public Member Functions | |
CpActionClient ()=default | |
CpActionClient (const std::string &actionServerName) | |
virtual | ~CpActionClient ()=default |
std::shared_future< typename GoalHandle::SharedPtr > | sendGoal (Goal &goal, typename smacc2::SmaccSignal< void(const WrappedResult &)>::WeakPtr resultCallback=typename smacc2::SmaccSignal< void(const WrappedResult &)>::WeakPtr()) |
bool | cancelGoal () |
bool | isServerReady () const |
void | waitForServer () |
void | onInitialize () override |
template<typename TOrthogonal , typename TSourceObject > | |
void | onComponentInitialization () |
template<typename T > | |
boost::signals2::connection | onSucceeded (void(T::*callback)(const WrappedResult &), T *object) |
template<typename T > | |
boost::signals2::connection | onAborted (void(T::*callback)(const WrappedResult &), T *object) |
template<typename T > | |
boost::signals2::connection | onCancelled (void(T::*callback)(const WrappedResult &), T *object) |
template<typename T > | |
boost::signals2::connection | onFeedback (void(T::*callback)(const Feedback &), T *object) |
std::shared_ptr< ActionClient > | getActionClient () const |
![]() | |
ISmaccComponent () | |
virtual | ~ISmaccComponent () |
virtual std::string | getName () const |
Public Attributes | |
std::optional< std::string > | actionServerName |
std::optional< std::chrono::milliseconds > | serverTimeout |
smacc2::SmaccSignal< void(const WrappedResult &)> | onActionSucceeded_ |
smacc2::SmaccSignal< void(const WrappedResult &)> | onActionAborted_ |
smacc2::SmaccSignal< void(const WrappedResult &)> | onActionCancelled_ |
smacc2::SmaccSignal< void(const Feedback &)> | onActionFeedback_ |
smacc2::SmaccSignal< void()> | onGoalAccepted_ |
smacc2::SmaccSignal< void()> | onGoalRejected_ |
std::function< void(const WrappedResult &)> | postSuccessEvent |
std::function< void(const WrappedResult &)> | postAbortedEvent |
std::function< void(const WrappedResult &)> | postCancelledEvent |
std::function< void(const Feedback &)> | postFeedbackEvent |
Private Member Functions | |
void | onFeedback (typename GoalHandle::SharedPtr, const std::shared_ptr< const Feedback > feedback_msg) |
void | onResult (const WrappedResult &result_msg) |
template<typename EvType > | |
void | postResultEvent (const WrappedResult &) |
Private Attributes | |
std::shared_ptr< ActionClient > | client_ = nullptr |
std::optional< std::shared_future< typename GoalHandle::SharedPtr > > | lastRequest_ |
std::optional< std::shared_future< typename rclcpp_action::Client< ActionType >::CancelResponse::SharedPtr > > | lastCancelResponse_ |
FeedbackCallback | feedbackCallback_ |
std::mutex | actionMutex_ |
Additional Inherited Members | |
![]() | |
template<typename TOrthogonal , typename TClient > | |
void | onComponentInitialization () |
template<typename EventType > | |
void | postEvent (const EventType &ev) |
template<typename EventType > | |
void | postEvent () |
template<typename TOrthogonal , typename TSourceObject > | |
void | onOrthogonalAllocation () |
template<typename TOrthogonal , typename TSourceObject > | |
void | onStateOrthogonalAllocation () |
template<typename TComponent > | |
void | requiresComponent (TComponent *&requiredComponentStorage, bool throwExceptionIfNotExist) |
template<typename TComponent > | |
void | requiresComponent (std::string name, TComponent *&requiredComponentStorage, bool throwExceptionIfNotExist) |
template<typename TComponent > | |
void | requiresComponent (TComponent *&requiredComponentStorage, ComponentRequirement requirementType=ComponentRequirement::SOFT) |
template<typename TComponent > | |
void | requiresComponent (std::string name, TComponent *&requiredComponentStorage, ComponentRequirement requirementType=ComponentRequirement::SOFT) |
template<typename TClient > | |
void | requiresClient (TClient *&requiredClientStorage) |
template<typename SmaccComponentType , typename TOrthogonal , typename TClient , typename... TArgs> | |
SmaccComponentType * | createSiblingComponent (TArgs... targs) |
template<typename SmaccComponentType , typename TOrthogonal , typename TClient , typename... TArgs> | |
SmaccComponentType * | createSiblingNamedComponent (std::string name, TArgs... targs) |
rclcpp::Node::SharedPtr | getNode () |
rclcpp::Logger | getLogger () const |
ISmaccStateMachine * | getStateMachine () |
![]() | |
ISmaccStateMachine * | stateMachine_ |
ISmaccClient * | owner_ |
Definition at line 36 of file cp_action_client.hpp.
using smacc2::client_core_components::CpActionClient< ActionType >::ActionClient = rclcpp_action::Client<ActionType> |
Definition at line 40 of file cp_action_client.hpp.
using smacc2::client_core_components::CpActionClient< ActionType >::Feedback = typename ActionType::Feedback |
Definition at line 42 of file cp_action_client.hpp.
using smacc2::client_core_components::CpActionClient< ActionType >::FeedbackCallback = typename GoalHandle::FeedbackCallback |
Definition at line 49 of file cp_action_client.hpp.
using smacc2::client_core_components::CpActionClient< ActionType >::Goal = typename ActionType::Goal |
Definition at line 41 of file cp_action_client.hpp.
using smacc2::client_core_components::CpActionClient< ActionType >::GoalHandle = rclcpp_action::ClientGoalHandle<ActionType> |
Definition at line 44 of file cp_action_client.hpp.
using smacc2::client_core_components::CpActionClient< ActionType >::GoalResponseCallback |
Definition at line 47 of file cp_action_client.hpp.
using smacc2::client_core_components::CpActionClient< ActionType >::Result = typename ActionType::Result |
Definition at line 43 of file cp_action_client.hpp.
using smacc2::client_core_components::CpActionClient< ActionType >::ResultCallback = typename GoalHandle::ResultCallback |
Definition at line 50 of file cp_action_client.hpp.
using smacc2::client_core_components::CpActionClient< ActionType >::SendGoalOptions = typename ActionClient::SendGoalOptions |
Definition at line 46 of file cp_action_client.hpp.
using smacc2::client_core_components::CpActionClient< ActionType >::WrappedResult = typename GoalHandle::WrappedResult |
Definition at line 45 of file cp_action_client.hpp.
|
default |
|
inline |
Definition at line 73 of file cp_action_client.hpp.
|
virtualdefault |
|
inline |
Definition at line 122 of file cp_action_client.hpp.
References smacc2::client_core_components::CpActionClient< ActionType >::actionMutex_, smacc2::client_core_components::CpActionClient< ActionType >::client_, smacc2::ISmaccComponent::getLogger(), smacc2::ISmaccComponent::getName(), smacc2::client_core_components::CpActionClient< ActionType >::lastCancelResponse_, and smacc2::client_core_components::CpActionClient< ActionType >::lastRequest_.
|
inline |
Definition at line 226 of file cp_action_client.hpp.
References smacc2::client_core_components::CpActionClient< ActionType >::client_.
Referenced by smacc2::client_behaviors::CbWaitActionServer2< ActionT >::onEntry().
|
inline |
Definition at line 141 of file cp_action_client.hpp.
References smacc2::client_core_components::CpActionClient< ActionType >::client_.
|
inline |
Definition at line 208 of file cp_action_client.hpp.
References smacc2::ISmaccStateMachine::createSignalConnection(), and smacc2::ISmaccComponent::getStateMachine().
|
inline |
Definition at line 214 of file cp_action_client.hpp.
References smacc2::ISmaccStateMachine::createSignalConnection(), and smacc2::ISmaccComponent::getStateMachine().
|
inline |
Definition at line 178 of file cp_action_client.hpp.
References smacc2::ISmaccComponent::getLogger(), smacc2::ISmaccComponent::getName(), smacc2::client_core_components::CpActionClient< ActionType >::postAbortedEvent, smacc2::client_core_components::CpActionClient< ActionType >::postCancelledEvent, smacc2::ISmaccComponent::postEvent(), smacc2::client_core_components::CpActionClient< ActionType >::postFeedbackEvent, smacc2::client_core_components::CpActionClient< ActionType >::postResultEvent(), and smacc2::client_core_components::CpActionClient< ActionType >::postSuccessEvent.
|
inlineprivate |
Definition at line 237 of file cp_action_client.hpp.
References smacc2::client_core_components::CpActionClient< ActionType >::onActionFeedback_, and smacc2::client_core_components::CpActionClient< ActionType >::postFeedbackEvent.
|
inline |
Definition at line 220 of file cp_action_client.hpp.
References smacc2::ISmaccStateMachine::createSignalConnection(), and smacc2::ISmaccComponent::getStateMachine().
Referenced by smacc2::client_core_components::CpActionClient< ActionType >::onInitialize().
|
inlineoverridevirtual |
Reimplemented from smacc2::ISmaccComponent.
Definition at line 155 of file cp_action_client.hpp.
References smacc2::client_core_components::CpActionClient< ActionType >::actionServerName, smacc2::client_core_components::CpActionClient< ActionType >::client_, smacc2::client_core_components::CpActionClient< ActionType >::feedbackCallback_, smacc2::ISmaccComponent::getLogger(), smacc2::ISmaccComponent::getName(), smacc2::ISmaccComponent::getNode(), and smacc2::client_core_components::CpActionClient< ActionType >::onFeedback().
|
inlineprivate |
Definition at line 245 of file cp_action_client.hpp.
References smacc2::ISmaccComponent::getLogger(), smacc2::ISmaccComponent::getName(), smacc2::client_core_components::CpActionClient< ActionType >::onActionAborted_, smacc2::client_core_components::CpActionClient< ActionType >::onActionCancelled_, smacc2::client_core_components::CpActionClient< ActionType >::onActionSucceeded_, smacc2::client_core_components::CpActionClient< ActionType >::postAbortedEvent, smacc2::client_core_components::CpActionClient< ActionType >::postCancelledEvent, and smacc2::client_core_components::CpActionClient< ActionType >::postSuccessEvent.
Referenced by smacc2::client_core_components::CpActionClient< ActionType >::sendGoal().
|
inline |
Definition at line 202 of file cp_action_client.hpp.
References smacc2::ISmaccStateMachine::createSignalConnection(), and smacc2::ISmaccComponent::getStateMachine().
|
inlineprivate |
Definition at line 280 of file cp_action_client.hpp.
References smacc2::introspection::demangleSymbol(), smacc2::ISmaccComponent::getLogger(), smacc2::ISmaccComponent::getName(), and smacc2::ISmaccComponent::postEvent().
Referenced by smacc2::client_core_components::CpActionClient< ActionType >::onComponentInitialization().
|
inline |
Definition at line 78 of file cp_action_client.hpp.
References smacc2::client_core_components::CpActionClient< ActionType >::actionMutex_, smacc2::client_core_components::CpActionClient< ActionType >::client_, smacc2::client_core_components::CpActionClient< ActionType >::feedbackCallback_, smacc2::ISmaccComponent::getLogger(), smacc2::ISmaccComponent::getName(), smacc2::client_core_components::CpActionClient< ActionType >::lastRequest_, and smacc2::client_core_components::CpActionClient< ActionType >::onResult().
|
inline |
Definition at line 143 of file cp_action_client.hpp.
References smacc2::client_core_components::CpActionClient< ActionType >::client_, smacc2::ISmaccComponent::getLogger(), and smacc2::ISmaccComponent::getName().
|
private |
Definition at line 235 of file cp_action_client.hpp.
Referenced by smacc2::client_core_components::CpActionClient< ActionType >::cancelGoal(), and smacc2::client_core_components::CpActionClient< ActionType >::sendGoal().
std::optional<std::string> smacc2::client_core_components::CpActionClient< ActionType >::actionServerName |
Definition at line 53 of file cp_action_client.hpp.
Referenced by smacc2::client_core_components::CpActionClient< ActionType >::onInitialize().
|
private |
Definition at line 229 of file cp_action_client.hpp.
Referenced by smacc2::client_core_components::CpActionClient< ActionType >::cancelGoal(), smacc2::client_core_components::CpActionClient< ActionType >::getActionClient(), smacc2::client_core_components::CpActionClient< ActionType >::isServerReady(), smacc2::client_core_components::CpActionClient< ActionType >::onInitialize(), smacc2::client_core_components::CpActionClient< ActionType >::sendGoal(), and smacc2::client_core_components::CpActionClient< ActionType >::waitForServer().
|
private |
Definition at line 234 of file cp_action_client.hpp.
Referenced by smacc2::client_core_components::CpActionClient< ActionType >::onInitialize(), and smacc2::client_core_components::CpActionClient< ActionType >::sendGoal().
|
private |
Definition at line 233 of file cp_action_client.hpp.
Referenced by smacc2::client_core_components::CpActionClient< ActionType >::cancelGoal().
|
private |
Definition at line 230 of file cp_action_client.hpp.
Referenced by smacc2::client_core_components::CpActionClient< ActionType >::cancelGoal(), and smacc2::client_core_components::CpActionClient< ActionType >::sendGoal().
smacc2::SmaccSignal<void(const WrappedResult &)> smacc2::client_core_components::CpActionClient< ActionType >::onActionAborted_ |
Definition at line 58 of file cp_action_client.hpp.
Referenced by smacc2::client_core_components::CpActionClient< ActionType >::onResult().
smacc2::SmaccSignal<void(const WrappedResult &)> smacc2::client_core_components::CpActionClient< ActionType >::onActionCancelled_ |
Definition at line 59 of file cp_action_client.hpp.
Referenced by smacc2::client_core_components::CpActionClient< ActionType >::onResult().
smacc2::SmaccSignal<void(const Feedback &)> smacc2::client_core_components::CpActionClient< ActionType >::onActionFeedback_ |
Definition at line 60 of file cp_action_client.hpp.
Referenced by smacc2::client_core_components::CpActionClient< ActionType >::onFeedback().
smacc2::SmaccSignal<void(const WrappedResult &)> smacc2::client_core_components::CpActionClient< ActionType >::onActionSucceeded_ |
Definition at line 57 of file cp_action_client.hpp.
Referenced by smacc2::client_core_components::CpActionClient< ActionType >::onResult().
smacc2::SmaccSignal<void()> smacc2::client_core_components::CpActionClient< ActionType >::onGoalAccepted_ |
Definition at line 61 of file cp_action_client.hpp.
smacc2::SmaccSignal<void()> smacc2::client_core_components::CpActionClient< ActionType >::onGoalRejected_ |
Definition at line 62 of file cp_action_client.hpp.
std::function<void(const WrappedResult &)> smacc2::client_core_components::CpActionClient< ActionType >::postAbortedEvent |
Definition at line 66 of file cp_action_client.hpp.
Referenced by smacc2::client_core_components::CpActionClient< ActionType >::onComponentInitialization(), and smacc2::client_core_components::CpActionClient< ActionType >::onResult().
std::function<void(const WrappedResult &)> smacc2::client_core_components::CpActionClient< ActionType >::postCancelledEvent |
Definition at line 67 of file cp_action_client.hpp.
Referenced by smacc2::client_core_components::CpActionClient< ActionType >::onComponentInitialization(), and smacc2::client_core_components::CpActionClient< ActionType >::onResult().
std::function<void(const Feedback &)> smacc2::client_core_components::CpActionClient< ActionType >::postFeedbackEvent |
Definition at line 68 of file cp_action_client.hpp.
Referenced by smacc2::client_core_components::CpActionClient< ActionType >::onComponentInitialization(), and smacc2::client_core_components::CpActionClient< ActionType >::onFeedback().
std::function<void(const WrappedResult &)> smacc2::client_core_components::CpActionClient< ActionType >::postSuccessEvent |
Definition at line 65 of file cp_action_client.hpp.
Referenced by smacc2::client_core_components::CpActionClient< ActionType >::onComponentInitialization(), and smacc2::client_core_components::CpActionClient< ActionType >::onResult().
std::optional<std::chrono::milliseconds> smacc2::client_core_components::CpActionClient< ActionType >::serverTimeout |
Definition at line 54 of file cp_action_client.hpp.