ceti_robot.h
Go to the documentation of this file.
1 #ifndef CETI_ROBOT_
2 #define CETI_ROBOT_
3 
4 #include "ros/ros.h"
5 #include "robot/abstract_robot.h"
10 
11 #include <moveit/planning_scene_interface/planning_scene_interface.h>
12 #include <moveit/move_group_interface/move_group_interface.h>
13 #include <moveit_msgs/ApplyPlanningScene.h>
14 #include <moveit/robot_model_loader/robot_model_loader.h>
15 #include <moveit/planning_scene/planning_scene.h>
16 #include <moveit/kinematic_constraints/utils.h>
17 
19 
22 class Ceti_robot : public Abstract_robot{
23  protected:
24  std::vector<std::unique_ptr<Abstract_robot_element>> observers_;
25  std::vector<std::unique_ptr<Abstract_robot_element>> access_fields_;
26  std::vector<std::shared_ptr<moveit_msgs::CollisionObject>> coll_markers_;
27  std::bitset<3> observer_mask_;
28 
29 
30  public:
32 
38  Ceti_robot(std::string& name, tf2::Transform tf, tf2::Vector3 size);
39 
40 
41 
42  std::string& name() override {return name_;}
43  tf2::Transform& tf() override {return tf_;}
44  tf2::Vector3& size() override {return size_;}
45  tf2::Transform& root_tf() override {return root_tf_;}
46  std::vector<tf2::Transform>& bounds() override {return bounds_;}
47  std::vector<tf2::Transform>& robot_root_bounds() override {return robot_root_bounds_;}
48 
50 
53  inline std::vector<std::unique_ptr<Abstract_robot_element>>& observers() { return observers_;}
54 
56 
59  inline std::vector<std::unique_ptr<Abstract_robot_element>>& access_fields() { return access_fields_;}
60 
62 
65  inline void add_coll_markers(std::shared_ptr<moveit_msgs::CollisionObject> marker) {coll_markers_.push_back(marker);}
66 
68 
71  inline std::vector<std::shared_ptr<moveit_msgs::CollisionObject>> coll_markers(){ return coll_markers_;}
72 
74 
78  void register_observers(std::unique_ptr<Abstract_robot_element> wd);
79 
81  void reset();
82 
85 
87 
92  bool in_collision(Ceti_robot* R);
93 
95 
101  bool check_single_object_collision(tf2::Transform& obj, std::string& str) override;
102 
104 
109  void workload_checker(std::vector<int>& count_vector, tf2::Transform& obj) override;
110 
112 
115  void notify() override;
116 
117  inline std::bitset<3> observer_mask() {return observer_mask_;}
118  inline void set_observer_mask(int i) {observer_mask_ = std::bitset<3>(i);}
119 
120 
121 
122 };
123 
124 
125 
126 
127 #endif
abstract_robot_element.h
Ceti_robot::notify
void notify() override
Observer pattern.
Definition: ceti_robot.cpp:113
Ceti_robot::generate_access_fields
void generate_access_fields()
Generate access fields as surrounding poses for possible robots.
Definition: ceti_robot.cpp:12
Abstract_robot::root_tf_
tf2::Transform root_tf_
Robot root on table top.
Definition: impl/abstract_robot.h:30
Ceti_robot::set_observer_mask
void set_observer_mask(int i)
Definition: ceti_robot.h:118
Ceti_robot::tf
tf2::Transform & tf() override
Definition: ceti_robot.h:43
Ceti_robot::register_observers
void register_observers(std::unique_ptr< Abstract_robot_element > wd)
Register observers in vector.
Definition: ceti_robot.cpp:162
Ceti_robot::size
tf2::Vector3 & size() override
Definition: ceti_robot.h:44
Ceti_robot::coll_markers_
std::vector< std::shared_ptr< moveit_msgs::CollisionObject > > coll_markers_
to be checked
Definition: ceti_robot.h:26
Ceti_robot::access_fields
std::vector< std::unique_ptr< Abstract_robot_element > > & access_fields()
Get access fields.
Definition: ceti_robot.h:59
abstract_robot.h
Ceti_robot::access_fields_
std::vector< std::unique_ptr< Abstract_robot_element > > access_fields_
Serrounding Fields shared pointers.
Definition: ceti_robot.h:25
Abstract_robot::bounds_
std::vector< tf2::Transform > bounds_
Bounds of table top surface.
Definition: impl/abstract_robot.h:31
Ceti_robot::in_collision
bool in_collision(Ceti_robot *R)
Collsion calculation.
Definition: ceti_robot.cpp:118
Abstract_robot::tf_
tf2::Transform tf_
Pose of table.
Definition: impl/abstract_robot.h:29
Ceti_robot::observer_mask_
std::bitset< 3 > observer_mask_
Bitmap to set observers.
Definition: ceti_robot.h:27
Ceti_robot::bounds
std::vector< tf2::Transform > & bounds() override
Definition: ceti_robot.h:46
Ceti_robot::observers
std::vector< std::unique_ptr< Abstract_robot_element > > & observers()
Get observers.
Definition: ceti_robot.h:53
Ceti_robot::reset
void reset()
Resset all robot properties.
Definition: ceti_robot.cpp:106
Ceti_robot::add_coll_markers
void add_coll_markers(std::shared_ptr< moveit_msgs::CollisionObject > marker)
Adds marker to array.
Definition: ceti_robot.h:65
Ceti_robot
Concrete Ceti-Robot.
Definition: ceti_robot.h:22
Ceti_robot::observers_
std::vector< std::unique_ptr< Abstract_robot_element > > observers_
Wing shared pointers.
Definition: ceti_robot.h:24
Ceti_robot::observer_mask
std::bitset< 3 > observer_mask()
Definition: ceti_robot.h:117
Abstract_robot::name_
std::string name_
Name of robot.
Definition: impl/abstract_robot.h:27
Abstract_robot::size_
tf2::Vector3 size_
Size of table.
Definition: impl/abstract_robot.h:28
field.h
abstract_robot_element_decorator.h
Ceti_robot::name
std::string & name() override
Definition: ceti_robot.h:42
Ceti_robot::check_single_object_collision
bool check_single_object_collision(tf2::Transform &obj, std::string &str) override
Collsion calculation for single objects.
Definition: ceti_robot.cpp:65
Ceti_robot::root_tf
tf2::Transform & root_tf() override
Definition: ceti_robot.h:45
Ceti_robot::robot_root_bounds
std::vector< tf2::Transform > & robot_root_bounds() override
Definition: ceti_robot.h:47
Ceti_robot::workload_checker
void workload_checker(std::vector< int > &count_vector, tf2::Transform &obj) override
Object counter.
Definition: ceti_robot.cpp:38
Abstract_robot
Definition: impl/abstract_robot.h:25
Abstract_robot::robot_root_bounds_
std::vector< tf2::Transform > robot_root_bounds_
Bounds of robot arm as sub-region of table top.
Definition: impl/abstract_robot.h:32
panel.h
Ceti_robot::Ceti_robot
Ceti_robot(std::string &name, tf2::Transform tf, tf2::Vector3 size)
Ceti robot constructor.
Definition: ceti_robot.cpp:3
Ceti_robot::coll_markers
std::vector< std::shared_ptr< moveit_msgs::CollisionObject > > coll_markers()
Get collision markers.
Definition: ceti_robot.h:71


multi_cell_builder
Author(s): MA
autogenerated on Thu Jan 12 2023 23:45:43