State Machine
Tools for creating and running general purpose state machines.
state_machine_ros::ActionClient< T > Class Template Reference

#include <ActionClient.hpp>

Public Types

using GoalState = actionlib::SimpleClientGoalState
 
using DoneCallback = typename Client::SimpleDoneCallback
 
using ActiveCallback = typename Client::SimpleActiveCallback
 
using FeedbackCallback = typename Client::SimpleFeedbackCallback
 

Public Member Functions

 ACTION_DEFINITION (T)
 
 ActionClient (ros::NodeHandle &nodeHandle, std::string action, StateRos *state)
 
void setIsCancelable (const bool isCancelable)
 
void setDoneCb (const DoneCallback &doneCb)
 
void setActiveCb (const ActiveCallback &activeCb)
 
void setFeedbackCb (const FeedbackCallback &feedbackCb)
 
bool execute (const Goal &goal, const double executionTimeout=0.0, const double cancellingTimeout=10.0)
 
void cancelExecution ()
 
bool isRunning ()
 
bool sendGoal (const Goal &goal)
 
bool cancelGoal (const double cancellingTimeout=0.0)
 
bool isServerConnected ()
 
bool waitForResult (const double timeout=0.0)
 
GoalState getGoalState ()
 
ResultConstPtr getResult ()
 

Protected Types

using Client = actionlib::SimpleActionClient< T >
 

Protected Attributes

std::string action_
 
StateRosstate_
 
std::shared_ptr< Clientclient_
 
std::atomic< bool > isCancelable_
 
DoneCallback doneCb_
 
ActiveCallback activeCb_
 
FeedbackCallback feedbackCb_
 
std::atomic< bool > isRunning_
 
std::atomic< bool > cancelRequested_
 
bool actionHasBeenCancelled_ = false
 
any_measurements::Time startingTime_
 
any_measurements::Time cancellingTime_
 

Member Typedef Documentation

◆ ActiveCallback

template<typename T >
using state_machine_ros::ActionClient< T >::ActiveCallback = typename Client::SimpleActiveCallback

◆ Client

template<typename T >
using state_machine_ros::ActionClient< T >::Client = actionlib::SimpleActionClient<T>
protected

◆ DoneCallback

template<typename T >
using state_machine_ros::ActionClient< T >::DoneCallback = typename Client::SimpleDoneCallback

◆ FeedbackCallback

template<typename T >
using state_machine_ros::ActionClient< T >::FeedbackCallback = typename Client::SimpleFeedbackCallback

◆ GoalState

template<typename T >
using state_machine_ros::ActionClient< T >::GoalState = actionlib::SimpleClientGoalState

Constructor & Destructor Documentation

◆ ActionClient()

template<typename T >
state_machine_ros::ActionClient< T >::ActionClient ( ros::NodeHandle &  nodeHandle,
std::string  action,
StateRos state 
)

Member Function Documentation

◆ ACTION_DEFINITION()

template<typename T >
state_machine_ros::ActionClient< T >::ACTION_DEFINITION ( )

◆ cancelExecution()

template<typename T >
void state_machine_ros::ActionClient< T >::cancelExecution ( )

◆ cancelGoal()

template<typename T >
bool state_machine_ros::ActionClient< T >::cancelGoal ( const double  cancellingTimeout = 0.0)

◆ execute()

template<typename T >
bool state_machine_ros::ActionClient< T >::execute ( const Goal &  goal,
const double  executionTimeout = 0.0,
const double  cancellingTimeout = 10.0 
)

◆ getGoalState()

template<typename T >
GoalState state_machine_ros::ActionClient< T >::getGoalState ( )

◆ getResult()

template<typename T >
ResultConstPtr state_machine_ros::ActionClient< T >::getResult ( )

◆ isRunning()

template<typename T >
bool state_machine_ros::ActionClient< T >::isRunning ( )

◆ isServerConnected()

template<typename T >
bool state_machine_ros::ActionClient< T >::isServerConnected ( )

◆ sendGoal()

template<typename T >
bool state_machine_ros::ActionClient< T >::sendGoal ( const Goal &  goal)

◆ setActiveCb()

template<typename T >
void state_machine_ros::ActionClient< T >::setActiveCb ( const ActiveCallback activeCb)

◆ setDoneCb()

template<typename T >
void state_machine_ros::ActionClient< T >::setDoneCb ( const DoneCallback doneCb)

◆ setFeedbackCb()

template<typename T >
void state_machine_ros::ActionClient< T >::setFeedbackCb ( const FeedbackCallback feedbackCb)

◆ setIsCancelable()

template<typename T >
void state_machine_ros::ActionClient< T >::setIsCancelable ( const bool  isCancelable)

◆ waitForResult()

template<typename T >
bool state_machine_ros::ActionClient< T >::waitForResult ( const double  timeout = 0.0)

Member Data Documentation

◆ action_

template<typename T >
std::string state_machine_ros::ActionClient< T >::action_
protected

◆ actionHasBeenCancelled_

template<typename T >
bool state_machine_ros::ActionClient< T >::actionHasBeenCancelled_ = false
protected

◆ activeCb_

template<typename T >
ActiveCallback state_machine_ros::ActionClient< T >::activeCb_
protected

◆ cancellingTime_

template<typename T >
any_measurements::Time state_machine_ros::ActionClient< T >::cancellingTime_
protected

◆ cancelRequested_

template<typename T >
std::atomic<bool> state_machine_ros::ActionClient< T >::cancelRequested_
protected

◆ client_

template<typename T >
std::shared_ptr<Client> state_machine_ros::ActionClient< T >::client_
protected

◆ doneCb_

template<typename T >
DoneCallback state_machine_ros::ActionClient< T >::doneCb_
protected

◆ feedbackCb_

template<typename T >
FeedbackCallback state_machine_ros::ActionClient< T >::feedbackCb_
protected

◆ isCancelable_

template<typename T >
std::atomic<bool> state_machine_ros::ActionClient< T >::isCancelable_
protected

◆ isRunning_

template<typename T >
std::atomic<bool> state_machine_ros::ActionClient< T >::isRunning_
protected

◆ startingTime_

template<typename T >
any_measurements::Time state_machine_ros::ActionClient< T >::startingTime_
protected

◆ state_

template<typename T >
StateRos* state_machine_ros::ActionClient< T >::state_
protected

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