SMACC2
Loading...
Searching...
No Matches
smacc2::client_core_components::CpActionClient< ActionType > Class Template Reference

#include <cp_action_client.hpp>

Inheritance diagram for smacc2::client_core_components::CpActionClient< ActionType >:
Inheritance graph
Collaboration diagram for smacc2::client_core_components::CpActionClient< ActionType >:
Collaboration graph

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 >
smacc2::SmaccSignalConnection onSucceeded (void(T::*callback)(const WrappedResult &), T *object)
 
template<typename T >
smacc2::SmaccSignalConnection onAborted (void(T::*callback)(const WrappedResult &), T *object)
 
template<typename T >
smacc2::SmaccSignalConnection onCancelled (void(T::*callback)(const WrappedResult &), T *object)
 
template<typename T >
smacc2::SmaccSignalConnection onFeedback (void(T::*callback)(const Feedback &), T *object)
 
std::shared_ptr< ActionClientgetActionClient () const
 
- Public Member Functions inherited from smacc2::ISmaccComponent
 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 &result)
 

Private Attributes

std::shared_ptr< ActionClientclient_ = 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

- Protected Member Functions inherited from smacc2::ISmaccComponent
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 onStateOrthogonalAllocation ()
 
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
 
ISmaccStateMachinegetStateMachine ()
 
- Protected Attributes inherited from smacc2::ISmaccComponent
ISmaccStateMachinestateMachine_
 
ISmaccClientowner_
 

Detailed Description

template<typename ActionType>
class smacc2::client_core_components::CpActionClient< ActionType >

Definition at line 36 of file cp_action_client.hpp.

Member Typedef Documentation

◆ ActionClient

template<typename ActionType >
using smacc2::client_core_components::CpActionClient< ActionType >::ActionClient = rclcpp_action::Client<ActionType>

Definition at line 40 of file cp_action_client.hpp.

◆ Feedback

template<typename ActionType >
using smacc2::client_core_components::CpActionClient< ActionType >::Feedback = typename ActionType::Feedback

Definition at line 42 of file cp_action_client.hpp.

◆ FeedbackCallback

template<typename ActionType >
using smacc2::client_core_components::CpActionClient< ActionType >::FeedbackCallback = typename GoalHandle::FeedbackCallback

Definition at line 49 of file cp_action_client.hpp.

◆ Goal

template<typename ActionType >
using smacc2::client_core_components::CpActionClient< ActionType >::Goal = typename ActionType::Goal

Definition at line 41 of file cp_action_client.hpp.

◆ GoalHandle

template<typename ActionType >
using smacc2::client_core_components::CpActionClient< ActionType >::GoalHandle = rclcpp_action::ClientGoalHandle<ActionType>

Definition at line 44 of file cp_action_client.hpp.

◆ GoalResponseCallback

template<typename ActionType >
using smacc2::client_core_components::CpActionClient< ActionType >::GoalResponseCallback
Initial value:
std::function<void(std::shared_future<typename GoalHandle::SharedPtr>)>

Definition at line 47 of file cp_action_client.hpp.

◆ Result

template<typename ActionType >
using smacc2::client_core_components::CpActionClient< ActionType >::Result = typename ActionType::Result

Definition at line 43 of file cp_action_client.hpp.

◆ ResultCallback

template<typename ActionType >
using smacc2::client_core_components::CpActionClient< ActionType >::ResultCallback = typename GoalHandle::ResultCallback

Definition at line 50 of file cp_action_client.hpp.

◆ SendGoalOptions

template<typename ActionType >
using smacc2::client_core_components::CpActionClient< ActionType >::SendGoalOptions = typename ActionClient::SendGoalOptions

Definition at line 46 of file cp_action_client.hpp.

◆ WrappedResult

template<typename ActionType >
using smacc2::client_core_components::CpActionClient< ActionType >::WrappedResult = typename GoalHandle::WrappedResult

Definition at line 45 of file cp_action_client.hpp.

Constructor & Destructor Documentation

◆ CpActionClient() [1/2]

template<typename ActionType >
smacc2::client_core_components::CpActionClient< ActionType >::CpActionClient ( )
default

◆ CpActionClient() [2/2]

template<typename ActionType >
smacc2::client_core_components::CpActionClient< ActionType >::CpActionClient ( const std::string & actionServerName)
inline

Definition at line 73 of file cp_action_client.hpp.

◆ ~CpActionClient()

template<typename ActionType >
virtual smacc2::client_core_components::CpActionClient< ActionType >::~CpActionClient ( )
virtualdefault

Member Function Documentation

◆ cancelGoal()

template<typename ActionType >
bool smacc2::client_core_components::CpActionClient< ActionType >::cancelGoal ( )
inline

Definition at line 147 of file cp_action_client.hpp.

148 {
149 std::lock_guard<std::mutex> lock(actionMutex_);
150
151 if (client_ != nullptr && lastRequest_ && lastRequest_->valid())
152 {
153 RCLCPP_INFO_STREAM(getLogger(), "[" << this->getName() << "] Cancelling current goal");
154
155 auto cancelFuture = client_->async_cancel_all_goals();
156 lastCancelResponse_ = cancelFuture;
157 return true;
158 }
159 else
160 {
161 RCLCPP_WARN_STREAM(getLogger(), "[" << this->getName() << "] No active goal to cancel");
162 return false;
163 }
164 }
virtual std::string getName() const
rclcpp::Logger getLogger() const
std::optional< std::shared_future< typename GoalHandle::SharedPtr > > lastRequest_
std::optional< std::shared_future< typename rclcpp_action::Client< ActionType >::CancelResponse::SharedPtr > > lastCancelResponse_

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_.

Referenced by smacc2::client_behavior_bases::CbActionClientBehaviorBase< TAction >::cancelGoal().

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

◆ getActionClient()

template<typename ActionType >
std::shared_ptr< ActionClient > smacc2::client_core_components::CpActionClient< ActionType >::getActionClient ( ) const
inline

Definition at line 255 of file cp_action_client.hpp.

255{ return client_; }

References smacc2::client_core_components::CpActionClient< ActionType >::client_.

Referenced by smacc2::client_behaviors::CbWaitActionServer2< ActionT >::onEntry().

Here is the caller graph for this function:

◆ isServerReady()

template<typename ActionType >
bool smacc2::client_core_components::CpActionClient< ActionType >::isServerReady ( ) const
inline

Definition at line 166 of file cp_action_client.hpp.

166{ return client_ && client_->action_server_is_ready(); }

References smacc2::client_core_components::CpActionClient< ActionType >::client_.

Referenced by smacc2::client_behavior_bases::CbActionClientBehaviorBase< TAction >::sendGoal().

Here is the caller graph for this function:

◆ onAborted()

template<typename ActionType >
template<typename T >
smacc2::SmaccSignalConnection smacc2::client_core_components::CpActionClient< ActionType >::onAborted ( void(T::* callback )(const WrappedResult &),
T * object )
inline

Definition at line 237 of file cp_action_client.hpp.

238 {
239 return this->getStateMachine()->createSignalConnection(onActionAborted_, callback, object);
240 }
ISmaccStateMachine * getStateMachine()
smacc2::SmaccSignalConnection createSignalConnection(TSmaccSignal &signal, TMemberFunctionPrototype callback, TSmaccObjectType *object)
smacc2::SmaccSignal< void(const WrappedResult &)> onActionAborted_

References smacc2::ISmaccStateMachine::createSignalConnection(), and smacc2::ISmaccComponent::getStateMachine().

Referenced by smacc2::client_behavior_bases::CbActionClientBehaviorBase< TAction >::onStateOrthogonalAllocation().

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

◆ onCancelled()

template<typename ActionType >
template<typename T >
smacc2::SmaccSignalConnection smacc2::client_core_components::CpActionClient< ActionType >::onCancelled ( void(T::* callback )(const WrappedResult &),
T * object )
inline

Definition at line 243 of file cp_action_client.hpp.

244 {
245 return this->getStateMachine()->createSignalConnection(onActionCancelled_, callback, object);
246 }
smacc2::SmaccSignal< void(const WrappedResult &)> onActionCancelled_

References smacc2::ISmaccStateMachine::createSignalConnection(), and smacc2::ISmaccComponent::getStateMachine().

Referenced by smacc2::client_behavior_bases::CbActionClientBehaviorBase< TAction >::onStateOrthogonalAllocation().

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

◆ onComponentInitialization()

template<typename ActionType >
template<typename TOrthogonal , typename TSourceObject >
void smacc2::client_core_components::CpActionClient< ActionType >::onComponentInitialization ( )
inline

Definition at line 203 of file cp_action_client.hpp.

204 {
205 // Event source type is THIS COMPONENT, not the owning client: the event
206 // payload type is TSource::WrappedResult, and typing it on the client would
207 // wrongly assume the client's WrappedResult typedef matches this component's
208 // action - which breaks as soon as a client owns action clients of more than
209 // one action type. Nothing in-tree listens to client-typed events from this
210 // component (domain interfaces like CpNav2ActionInterface post those).
211 postSuccessEvent = [this](const WrappedResult & result)
212 { this->postResultEvent<EvActionSucceeded<CpActionClient<ActionType>, TOrthogonal>>(result); };
213
214 postAbortedEvent = [this](const WrappedResult & result)
215 { this->postResultEvent<EvActionAborted<CpActionClient<ActionType>, TOrthogonal>>(result); };
216
217 postCancelledEvent = [this](const WrappedResult & result)
218 { this->postResultEvent<EvActionCancelled<CpActionClient<ActionType>, TOrthogonal>>(result); };
219
220 postFeedbackEvent = [this](const Feedback & feedback)
221 {
222 auto actionFeedbackEvent = new EvActionFeedback<Feedback, TOrthogonal>();
223 actionFeedbackEvent->feedbackMessage = feedback;
224 this->postEvent(actionFeedbackEvent);
225 RCLCPP_DEBUG(getLogger(), "[%s] FEEDBACK EVENT", this->getName().c_str());
226 };
227 }
std::function< void(const WrappedResult &)> postCancelledEvent
std::function< void(const WrappedResult &)> postSuccessEvent
void postResultEvent(const WrappedResult &result)
std::function< void(const WrappedResult &)> postAbortedEvent
std::function< void(const Feedback &)> postFeedbackEvent

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.

Here is the call graph for this function:

◆ onFeedback() [1/2]

template<typename ActionType >
void smacc2::client_core_components::CpActionClient< ActionType >::onFeedback ( typename GoalHandle::SharedPtr ,
const std::shared_ptr< const Feedback > feedback_msg )
inlineprivate

◆ onFeedback() [2/2]

template<typename ActionType >
template<typename T >
smacc2::SmaccSignalConnection smacc2::client_core_components::CpActionClient< ActionType >::onFeedback ( void(T::* callback )(const Feedback &),
T * object )
inline

◆ onInitialize()

template<typename ActionType >
void smacc2::client_core_components::CpActionClient< ActionType >::onInitialize ( )
inlineoverridevirtual

Reimplemented from smacc2::ISmaccComponent.

Definition at line 180 of file cp_action_client.hpp.

181 {
182 if (!actionServerName)
183 {
184 RCLCPP_ERROR_STREAM(getLogger(), "[" << this->getName() << "] Action server name not set!");
185 return;
186 }
187
188 RCLCPP_INFO_STREAM(
189 getLogger(),
190 "[" << this->getName() << "] Initializing action client for: " << *actionServerName);
191
192 client_ = rclcpp_action::create_client<ActionType>(getNode(), *actionServerName);
193 RCLCPP_INFO_STREAM(
194 getLogger(),
195 "[" << this->getName() << "] DONE Initializing action client for: " << *actionServerName);
196
197 // Set up feedback callback
198 feedbackCallback_ = [this](auto goalHandle, auto feedback)
199 { this->onFeedback(goalHandle, feedback); };
200 }
rclcpp::Node::SharedPtr getNode()
smacc2::SmaccSignalConnection onFeedback(void(T::*callback)(const Feedback &), T *object)

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().

Here is the call graph for this function:

◆ onResult()

template<typename ActionType >
void smacc2::client_core_components::CpActionClient< ActionType >::onResult ( const WrappedResult & result_msg)
inlineprivate

Definition at line 274 of file cp_action_client.hpp.

275 {
276 const auto & resultType = result_msg.code;
277
278 RCLCPP_INFO_STREAM(
279 getLogger(), "[" << this->getName() << "] Action result ["
280 << rclcpp_action::to_string(result_msg.goal_id) << "]: " << (int)resultType);
281
282 if (resultType == rclcpp_action::ResultCode::SUCCEEDED)
283 {
284 RCLCPP_INFO(getLogger(), "[%s] Action result: Success", this->getName().c_str());
285 onActionSucceeded_(result_msg);
286 postSuccessEvent(result_msg);
287 }
288 else if (resultType == rclcpp_action::ResultCode::ABORTED)
289 {
290 RCLCPP_INFO(getLogger(), "[%s] Action result: Aborted", this->getName().c_str());
291 onActionAborted_(result_msg);
292 postAbortedEvent(result_msg);
293 }
294 else if (resultType == rclcpp_action::ResultCode::CANCELED)
295 {
296 RCLCPP_INFO(getLogger(), "[%s] Action result: Cancelled", this->getName().c_str());
297 onActionCancelled_(result_msg);
298 postCancelledEvent(result_msg);
299 }
300 else
301 {
302 RCLCPP_WARN(
303 getLogger(), "[%s] Action result: Unhandled type: %d", this->getName().c_str(),
304 (int)resultType);
305 }
306 }
smacc2::SmaccSignal< void(const WrappedResult &)> onActionSucceeded_

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().

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

◆ onSucceeded()

template<typename ActionType >
template<typename T >
smacc2::SmaccSignalConnection smacc2::client_core_components::CpActionClient< ActionType >::onSucceeded ( void(T::* callback )(const WrappedResult &),
T * object )
inline

Definition at line 231 of file cp_action_client.hpp.

232 {
233 return this->getStateMachine()->createSignalConnection(onActionSucceeded_, callback, object);
234 }

References smacc2::ISmaccStateMachine::createSignalConnection(), and smacc2::ISmaccComponent::getStateMachine().

Referenced by smacc2::client_behavior_bases::CbActionClientBehaviorBase< TAction >::onStateOrthogonalAllocation().

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

◆ postResultEvent()

template<typename ActionType >
template<typename EvType >
void smacc2::client_core_components::CpActionClient< ActionType >::postResultEvent ( const WrappedResult & result)
inlineprivate

Definition at line 309 of file cp_action_client.hpp.

310 {
311 auto * ev = new EvType();
312 ev->resultMessage = result;
313 RCLCPP_INFO(
314 getLogger(), "[%s] Posting event: %s", this->getName().c_str(),
315 smacc2::demangleSymbol(typeid(ev).name()).c_str());
316 this->postEvent(ev);
317 }
std::string demangleSymbol()

References smacc2::introspection::demangleSymbol(), smacc2::ISmaccComponent::getLogger(), smacc2::ISmaccComponent::getName(), and smacc2::ISmaccComponent::postEvent().

Referenced by smacc2::client_core_components::CpActionClient< ActionType >::onComponentInitialization().

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

◆ sendGoal()

template<typename ActionType >
std::shared_future< typename GoalHandle::SharedPtr > smacc2::client_core_components::CpActionClient< ActionType >::sendGoal ( Goal & goal,
typename smacc2::SmaccSignal< void(const WrappedResult &)>::WeakPtr resultCallback = typename smacc2::SmaccSignal<void(const WrappedResult &)>::WeakPtr() )
inline

Definition at line 78 of file cp_action_client.hpp.

81 {
82 std::lock_guard<std::mutex> lock(actionMutex_);
83
84 if (client_ == nullptr)
85 {
86 RCLCPP_ERROR_STREAM(
87 getLogger(), "[" << this->getName()
88 << "] Cannot send goal: action client not initialized (was the "
89 "component created with an action server name?)");
90 return std::shared_future<typename GoalHandle::SharedPtr>();
91 }
92
93 SendGoalOptions options;
94
95 // Set up feedback callback
96 options.feedback_callback = feedbackCallback_;
97
98 // Goal acceptance/rejection notification. Without this a rejected goal is
99 // silent: the result callback never fires and no signal is emitted.
100 options.goal_response_callback = [this](typename GoalHandle::SharedPtr goalHandle)
101 {
102 if (goalHandle != nullptr)
103 {
104 RCLCPP_INFO_STREAM(getLogger(), "[" << this->getName() << "] Goal accepted by server");
106 }
107 else
108 {
109 RCLCPP_ERROR_STREAM(getLogger(), "[" << this->getName() << "] Goal rejected by server");
111 }
112 };
113
114 // Set up result callback
115 options.result_callback = [this, resultCallback](const WrappedResult & result)
116 {
117 std::lock_guard<std::mutex> lock(actionMutex_);
118
119 RCLCPP_INFO_STREAM(
120 getLogger(), "[" << this->getName() << "] Action result callback, goal id: "
121 << rclcpp_action::to_string(result.goal_id));
122
123 auto resultCallbackPtr = resultCallback.lock();
124 if (resultCallbackPtr != nullptr)
125 {
126 RCLCPP_INFO_STREAM(getLogger(), "[" << this->getName() << "] Calling user result callback");
127 (*resultCallbackPtr)(result);
128 }
129 else
130 {
131 RCLCPP_INFO_STREAM(
132 getLogger(), "[" << this->getName() << "] Using default result handling");
133 this->onResult(result);
134 }
135 };
136
137 RCLCPP_INFO_STREAM(
138 getLogger(),
139 "[" << this->getName() << "] Sending goal to action server: " << (long)client_.get());
140
141 auto goalFuture = client_->async_send_goal(goal, options);
142 lastRequest_ = goalFuture;
143
144 return goalFuture;
145 }
typename ActionClient::SendGoalOptions SendGoalOptions
void onResult(const WrappedResult &result_msg)

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_, smacc2::client_core_components::CpActionClient< ActionType >::onGoalAccepted_, smacc2::client_core_components::CpActionClient< ActionType >::onGoalRejected_, and smacc2::client_core_components::CpActionClient< ActionType >::onResult().

Referenced by smacc2::client_behavior_bases::CbActionClientBehaviorBase< TAction >::sendGoal().

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

◆ waitForServer()

template<typename ActionType >
void smacc2::client_core_components::CpActionClient< ActionType >::waitForServer ( )
inline

Definition at line 168 of file cp_action_client.hpp.

169 {
170 if (client_)
171 {
172 RCLCPP_INFO_STREAM(
173 getLogger(),
174 "[" << this->getName() << "] Waiting for action server: " << *actionServerName);
175 client_->wait_for_action_server();
176 }
177 }

References smacc2::client_core_components::CpActionClient< ActionType >::client_, smacc2::ISmaccComponent::getLogger(), and smacc2::ISmaccComponent::getName().

Here is the call graph for this function:

Member Data Documentation

◆ actionMutex_

◆ actionServerName

template<typename ActionType >
std::optional<std::string> smacc2::client_core_components::CpActionClient< ActionType >::actionServerName

◆ client_

◆ feedbackCallback_

◆ lastCancelResponse_

template<typename ActionType >
std::optional< std::shared_future<typename rclcpp_action::Client<ActionType>::CancelResponse::SharedPtr> > smacc2::client_core_components::CpActionClient< ActionType >::lastCancelResponse_
private

◆ lastRequest_

template<typename ActionType >
std::optional<std::shared_future<typename GoalHandle::SharedPtr> > smacc2::client_core_components::CpActionClient< ActionType >::lastRequest_
private

◆ onActionAborted_

template<typename ActionType >
smacc2::SmaccSignal<void(const WrappedResult &)> smacc2::client_core_components::CpActionClient< ActionType >::onActionAborted_

◆ onActionCancelled_

template<typename ActionType >
smacc2::SmaccSignal<void(const WrappedResult &)> smacc2::client_core_components::CpActionClient< ActionType >::onActionCancelled_

◆ onActionFeedback_

template<typename ActionType >
smacc2::SmaccSignal<void(const Feedback &)> smacc2::client_core_components::CpActionClient< ActionType >::onActionFeedback_

◆ onActionSucceeded_

template<typename ActionType >
smacc2::SmaccSignal<void(const WrappedResult &)> smacc2::client_core_components::CpActionClient< ActionType >::onActionSucceeded_

◆ onGoalAccepted_

template<typename ActionType >
smacc2::SmaccSignal<void()> smacc2::client_core_components::CpActionClient< ActionType >::onGoalAccepted_

◆ onGoalRejected_

template<typename ActionType >
smacc2::SmaccSignal<void()> smacc2::client_core_components::CpActionClient< ActionType >::onGoalRejected_

◆ postAbortedEvent

◆ postCancelledEvent

◆ postFeedbackEvent

◆ postSuccessEvent

◆ serverTimeout

template<typename ActionType >
std::optional<std::chrono::milliseconds> smacc2::client_core_components::CpActionClient< ActionType >::serverTimeout

Definition at line 54 of file cp_action_client.hpp.


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