abstract_robot_decorator.h
Go to the documentation of this file.
1 #ifndef ABSTRACT_ROBOT_DECORATOR_
2 #define ABSTRACT_ROBOT_DECORATOR_
3 
4 #include <ros/ros.h>
5 
6 #include <moveit/planning_pipeline/planning_pipeline.h>
7 #include <moveit/planning_scene_interface/planning_scene_interface.h>
8 #include <moveit/move_group_interface/move_group_interface.h>
9 #include <moveit_msgs/ApplyPlanningScene.h>
10 #include <moveit/robot_model_loader/robot_model_loader.h>
11 #include <moveit/planning_scene/planning_scene.h>
12 #include <moveit/kinematic_constraints/utils.h>
13 #include <gb_grasp/MapGenerator.h>
14 
15 #include "robot/abstract_robot.h"
16 
17 
19 
23  protected:
24  std::unique_ptr<AbstractRobot> next_;
25  std::shared_ptr<moveit::planning_interface::MoveGroupInterface> mgi_;
26  std::shared_ptr<moveit::planning_interface::MoveGroupInterface> mgi_hand_;
27 
28  std::map<std::string, std::string> map_;
29  std::shared_ptr<MapGenerator> grasp_map_generator_;
30  std::string pattern_;
31 
32 
33  public:
35 
39  AbstractRobotDecorator(std::unique_ptr<AbstractRobot> next)
40  : AbstractRobot("blanc", tf2::Transform(tf2::Quaternion(0,0,0,1), tf2::Vector3(0,0,0)), tf2::Vector3(0,0,0))
41  , mgi_(nullptr)
42  , mgi_hand_(nullptr)
43  , next_(std::move(next))
44  , pattern_("*._arm([0-9]+)"){};
45 
47  std::string& name() override { return next_->name();}
48 
50  bool checkSingleObjectCollision(tf2::Transform& obj, std::string& robot_element, std::bitset<3>& panel_mask) override { return next_->checkSingleObjectCollision(obj, robot_element, panel_mask);}
51 
53  tf2::Transform& tf() override { return next_->tf();}
54 
56  tf2::Vector3& size() override { return next_->size();}
57 
59  tf2::Transform& rootTf() override { return next_->rootTf();}
60 
62  std::vector<tf2::Transform>& bounds() override {return next_->bounds();}
63 
65  std::vector<tf2::Transform>& robotRootBounds() override { return next_->robotRootBounds();}
66 
68  void notify() override {next_->notify();}
69 
71 
74  inline AbstractRobot* next(){return next_.get();}
75 
77  virtual void spezifieRootBounds()=0;
78 
80  virtual void spezifieRobotGroups()=0;
81 
82  inline std::string& pattern() {return pattern_;}
83 
84 
85  inline std::map<std::string, std::string>& map(){return map_;}
86 
87  inline std::shared_ptr<moveit::planning_interface::MoveGroupInterface> mgi() {return mgi_;}
88  inline std::shared_ptr<moveit::planning_interface::MoveGroupInterface> mgiHand() {return mgi_hand_;}
89 };
90 
91 #endif
AbstractRobotDecorator::notify
void notify() override
Redirects notify call to next_.
Definition: abstract_robot_decorator.h:68
AbstractRobotDecorator::AbstractRobotDecorator
AbstractRobotDecorator(std::unique_ptr< AbstractRobot > next)
Abstract Robot Decorator.
Definition: abstract_robot_decorator.h:39
AbstractRobotDecorator::spezifieRootBounds
virtual void spezifieRootBounds()=0
Pure virtual function to specify root bounds.
AbstractRobotDecorator::next_
std::unique_ptr< AbstractRobot > next_
Abstract Robot which is mimiced.
Definition: abstract_robot_decorator.h:24
AbstractRobotDecorator::checkSingleObjectCollision
bool checkSingleObjectCollision(tf2::Transform &obj, std::string &robot_element, std::bitset< 3 > &panel_mask) override
Redirects check_single_object_collision call.
Definition: abstract_robot_decorator.h:50
AbstractRobotDecorator::map_
std::map< std::string, std::string > map_
//!< Mapping of specific task constructor variables
Definition: abstract_robot_decorator.h:28
AbstractRobotDecorator::rootTf
tf2::Transform & rootTf() override
Redirects root_tf call to next_.
Definition: abstract_robot_decorator.h:59
AbstractRobotDecorator::mgiHand
std::shared_ptr< moveit::planning_interface::MoveGroupInterface > mgiHand()
Definition: abstract_robot_decorator.h:88
abstract_robot.h
AbstractRobotDecorator::tf
tf2::Transform & tf() override
Redirects tf call to next_.
Definition: abstract_robot_decorator.h:53
AbstractRobotDecorator::spezifieRobotGroups
virtual void spezifieRobotGroups()=0
Pure virtual function to specify root groupts.
AbstractRobotDecorator::pattern
std::string & pattern()
Definition: abstract_robot_decorator.h:82
AbstractRobotDecorator::mgi_
std::shared_ptr< moveit::planning_interface::MoveGroupInterface > mgi_
MoveGroup Interface for the robots arm.
Definition: abstract_robot_decorator.h:25
AbstractRobotDecorator::pattern_
std::string pattern_
Regexpattern.
Definition: abstract_robot_decorator.h:30
AbstractRobot
Abstract Robot implementation.
Definition: abstract_robot.h:25
AbstractRobotDecorator::mgi_hand_
std::shared_ptr< moveit::planning_interface::MoveGroupInterface > mgi_hand_
MoveGroup Interface for the Robots manipulator.
Definition: abstract_robot_decorator.h:26
AbstractRobotDecorator::bounds
std::vector< tf2::Transform > & bounds() override
Redirects bounds call to next_.
Definition: abstract_robot_decorator.h:62
AbstractRobotDecorator::next
AbstractRobot * next()
Call of mimiced objects.
Definition: abstract_robot_decorator.h:74
AbstractRobotDecorator::name
std::string & name() override
Redirects name call to next_.
Definition: abstract_robot_decorator.h:47
AbstractRobotDecorator
Abstract Robot Decorator.
Definition: abstract_robot_decorator.h:22
AbstractRobotDecorator::mgi
std::shared_ptr< moveit::planning_interface::MoveGroupInterface > mgi()
Definition: abstract_robot_decorator.h:87
AbstractRobotDecorator::robotRootBounds
std::vector< tf2::Transform > & robotRootBounds() override
Redirects robot_root_bounds call to next_.
Definition: abstract_robot_decorator.h:65
AbstractRobotDecorator::size
tf2::Vector3 & size() override
Redirects size call to next_.
Definition: abstract_robot_decorator.h:56
AbstractRobotDecorator::grasp_map_generator_
std::shared_ptr< MapGenerator > grasp_map_generator_
Coming soon.
Definition: abstract_robot_decorator.h:29


multi_cell_builder
Author(s): Matteo Anedda
autogenerated on Sun Apr 9 2023 23:59:51