Skip to content

Commit 6974d64

Browse files
committed
moved action_base into stages directory
1 parent 45d7243 commit 6974d64

File tree

1 file changed

+20
-10
lines changed

1 file changed

+20
-10
lines changed

core/include/moveit/task_constructor/action_base.h renamed to core/include/moveit/task_constructor/stages/action_base.h

Lines changed: 20 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -44,6 +44,7 @@
4444

4545
namespace moveit {
4646
namespace task_constructor {
47+
namespace stages {
4748

4849
/**
4950
* @brief Interface allowing stages to use a simple action client
@@ -54,22 +55,29 @@ namespace task_constructor {
5455
template<class ActionSpec>
5556
class ActionBase
5657
{
57-
private:
58+
protected:
5859
ACTION_DEFINITION(ActionSpec);
5960

6061
public:
6162
/**
6263
* @brief Constructor
63-
* @param name - action name
64+
* @param action_name - action namespace
6465
* @param server_timeout - connection to server time out (0 is considered infinite timeout)
6566
* @param goal_timeout - goal to completed time out (0 is considered infinite timeout)
6667
* @param spin_thread - spins a thread to service this action's subscriptions
6768
* @details Initialize the action client and time out parameters
6869
*/
69-
ActionBase(const std::string &name,
70+
ActionBase(const std::string &action_name,
7071
double server_timeout = 0.0,
7172
double goal_timeout = 0.0,
72-
bool spin_thread = true);
73+
bool spin_thread = true)
74+
: action_name_(action_name), server_timeout_(server_timeout), goal_timeout_(goal_timeout) {
75+
76+
clientPtr_.reset(new actionlib::SimpleActionClient<ActionSpec>(action_name, spin_thread));
77+
}
78+
79+
// ActionBase(const std::string &action_name) : action_name_(action_name) {};
80+
// ActionBase() {}
7381

7482
/* @brief Destructor */
7583
virtual ~ActionBase() = default;
@@ -89,14 +97,16 @@ class ActionBase
8997
* @param result - pointer to result message
9098
*/
9199
virtual void doneCallback(const actionlib::SimpleClientGoalState& state,
92-
const ActionResultConstPtr &result) = 0;
100+
const ResultConstPtr &result) = 0;
93101

94102
protected:
95-
std::unique_ptr<actionlib::SimpleActionClient<ActionSpec>> clientPtr_; // action client
96-
ActionGoal goal_; // goal message
97-
double server_timeout_, goal_timeout_; // connection and goal completed time out
103+
std::string action_name_;
104+
std::unique_ptr<actionlib::SimpleActionClient<ActionSpec>> clientPtr_; // action client
105+
ActionGoal goal_; // goal message
106+
double server_timeout_, goal_timeout_; // connection and goal completed time out
98107
};
99108

100109

101-
} // namespace task_constructor
102-
} // namespace moveit
110+
} // namespace stages
111+
} // namespace task_constructor
112+
} // namespace moveit

0 commit comments

Comments
 (0)