|
34 | 34 | Desc: Grasp generator stage using deep learning based grasp synthesizers |
35 | 35 | */ |
36 | 36 |
|
37 | | - #pragma once |
| 37 | +#pragma once |
38 | 38 |
|
39 | | - #include <moveit/task_constructor/stages/generate_pose.h> |
| 39 | +#include <moveit/task_constructor/stages/generate_pose.h> |
40 | 40 |
|
41 | | - #include <memory> |
| 41 | +#include <memory> |
42 | 42 |
|
43 | | - #include <moveit_task_constructor_msgs/GenerateDeepGraspPoseAction.h> |
44 | | - #include <actionlib/client/simple_action_client.h> |
45 | | - // #include <actionlib/action_definition.h> |
| 43 | +#include <moveit_task_constructor_msgs/GenerateDeepGraspPoseAction.h> |
| 44 | +#include <actionlib/client/simple_action_client.h> |
46 | 45 |
|
47 | | - namespace moveit { |
48 | | - namespace task_constructor { |
49 | | - namespace stages { |
| 46 | +#include <moveit/task_constructor/action_base.h> |
50 | 47 |
|
51 | | - template<class ActionSpec> |
52 | | - class ActionStageBase |
53 | | - { |
54 | | - private: |
55 | | - ACTION_DEFINITION(ActionSpec); |
56 | 48 |
|
57 | | - public: |
58 | | - ActionStageBase() |
59 | | - { |
60 | | - clientPtr_.reset(new actionlib::SimpleActionClient<ActionSpec>("topic_name", true)); |
61 | | - } |
62 | | - // void feedbackCallback(const FeedbackConstPtr &feedback); |
63 | | - |
64 | | -protected: |
65 | | - std::unique_ptr<actionlib::SimpleActionClient<ActionSpec>> clientPtr_; |
66 | | -}; |
| 49 | +namespace moveit { |
| 50 | +namespace task_constructor { |
| 51 | +namespace stages { |
67 | 52 |
|
68 | 53 |
|
69 | | - class DeepGraspPose : public GeneratePose |
70 | | - { |
71 | | - public: |
72 | | - DeepGraspPose(const std::string& name = "generate grasp pose"); |
| 54 | +class DeepGraspPose : public GeneratePose |
| 55 | +{ |
| 56 | +public: |
| 57 | + DeepGraspPose(const std::string& name = "generate grasp pose"); |
73 | 58 |
|
74 | | - void init(const core::RobotModelConstPtr& robot_model) override; |
75 | | - void compute() override; |
| 59 | + void init(const core::RobotModelConstPtr& robot_model) override; |
| 60 | + void compute() override; |
76 | 61 |
|
77 | | - void setEndEffector(const std::string& eef) { setProperty("eef", eef); } |
78 | | - void setObject(const std::string& object) { setProperty("object", object); } |
| 62 | + void setEndEffector(const std::string& eef) { setProperty("eef", eef); } |
| 63 | + void setObject(const std::string& object) { setProperty("object", object); } |
79 | 64 |
|
80 | | - void setPreGraspPose(const std::string& pregrasp) { properties().set("pregrasp", pregrasp); } |
81 | | - void setPreGraspPose(const moveit_msgs::RobotState& pregrasp) { properties().set("pregrasp", pregrasp); } |
82 | | - void setGraspPose(const std::string& grasp) { properties().set("grasp", grasp); } |
83 | | - void setGraspPose(const moveit_msgs::RobotState& grasp) { properties().set("grasp", grasp); } |
| 65 | + void setPreGraspPose(const std::string& pregrasp) { properties().set("pregrasp", pregrasp); } |
| 66 | + void setPreGraspPose(const moveit_msgs::RobotState& pregrasp) { properties().set("pregrasp", pregrasp); } |
| 67 | + void setGraspPose(const std::string& grasp) { properties().set("grasp", grasp); } |
| 68 | + void setGraspPose(const moveit_msgs::RobotState& grasp) { properties().set("grasp", grasp); } |
84 | 69 |
|
85 | | - protected: |
86 | | - void onNewSolution(const SolutionBase& s) override; |
| 70 | +protected: |
| 71 | + void onNewSolution(const SolutionBase& s) override; |
87 | 72 |
|
88 | 73 | actionlib::SimpleActionClient<moveit_task_constructor_msgs::GenerateDeepGraspPoseAction> client_; |
89 | | - }; |
90 | | - } // namespace stages |
91 | | - } // namespace task_constructor |
92 | | - } // namespace moveit |
| 74 | +}; |
| 75 | +} // namespace stages |
| 76 | +} // namespace task_constructor |
| 77 | +} // namespace moveit |
0 commit comments