31namespace client_behavior_bases
50template <
typename TAction>
54 using Goal =
typename TAction::Goal;
55 using GoalHandle = rclcpp_action::ClientGoalHandle<TAction>;
60 template <
typename TOrthogonal,
typename TSourceObject>
98 getLogger(),
"[%s] State exited with the action goal still in flight - cancelling",
117 getLogger(),
"[%s] Action server not available, cannot send goal",
getName().c_str());
141 if (goalHandleFuture.wait_for(std::chrono::milliseconds(50)) == std::future_status::ready)
143 if (goalHandleFuture.get() !=
nullptr)
149 RCLCPP_ERROR(
getLogger(),
"[%s] Goal was rejected by the action server",
getName().c_str());
165 "[%s] No goal response from the action server after %ld ms; assuming the goal was "
166 "accepted (a rejection responds promptly) - result signals will finish this behavior",
187 RCLCPP_INFO(
getLogger(),
"[%s] Action succeeded, propagating success event",
getName().c_str());
194 RCLCPP_INFO(
getLogger(),
"[%s] Action failed, propagating failure event",
getName().c_str());
210 rclcpp_action::ResultCode
actionResult_ = rclcpp_action::ResultCode::UNKNOWN;
std::string getName() const
virtual rclcpp::Logger getLogger() const
void requiresComponent(SmaccComponentType *&storage, ComponentRequirement requirementType=ComponentRequirement::SOFT)
bool isShutdownRequested()
onEntry is executed in a new thread. However the current state cannot be left until the onEntry threa...
void onStateOrthogonalAllocation()
virtual ~CbActionClientBehaviorBase()
void onStateOrthogonalAllocation()
bool resultConnectionsInitialized_
ActionClientComponent * actionClient_
void dispatchActionAbort(const WrappedResult &result)
std::chrono::milliseconds goalResponseTimeout_
rclcpp_action::ClientGoalHandle< TAction > GoalHandle
void dispatchActionFeedback(const Feedback &feedback)
std::string actionClientName_
virtual void onActionAbort(const WrappedResult &result)
void setActionClientName(std::string name)
virtual void onActionFeedback(const Feedback &)
std::atomic< bool > goalActivitySeen_
typename GoalHandle::WrappedResult WrappedResult
typename TAction::Goal Goal
virtual void onActionSuccess(const WrappedResult &result)
std::atomic< bool > goalInFlight_
void dispatchActionSuccess(const WrappedResult &result)
typename TAction::Feedback Feedback
rclcpp_action::ResultCode actionResult_
bool sendGoal(Goal &goal)
smacc2::SmaccSignalConnection onSucceeded(void(T::*callback)(const WrappedResult &), T *object)
std::shared_future< typename GoalHandle::SharedPtr > sendGoal(Goal &goal, typename smacc2::SmaccSignal< void(const WrappedResult &)>::WeakPtr resultCallback=typename smacc2::SmaccSignal< void(const WrappedResult &)>::WeakPtr())
smacc2::SmaccSignalConnection onFeedback(void(T::*callback)(const Feedback &), T *object)
smacc2::SmaccSignalConnection onAborted(void(T::*callback)(const WrappedResult &), T *object)
smacc2::SmaccSignalConnection onCancelled(void(T::*callback)(const WrappedResult &), T *object)
bool isServerReady() const