abstract_mediator.h
Go to the documentation of this file.
1 #ifndef ABSTRACT_MEDIATOR_
2 #define ABSTRACT_MEDIATOR_
3 
4 #include <ros/ros.h>
5 #include <ros/package.h>
6 #include <yaml-cpp/yaml.h>
7 #include <octomap/octomap.h>
8 #include <pcl/point_cloud.h>
9 #include <pcl/octree/octree.h>
10 #include <filesystem>
11 
12 #include <fstream>
13 
15 #include "robot/abstract_robot.h"
16 #include "robot/ceti_robot.h"
18 #include "reader/wing_reader.h"
19 #include "reader/robot_reader.h"
20 #include "reader/ts_reader.h"
21 #include "reader/cuboid_reader.h"
22 
23 
24 
26 struct wing_BP {
27  std::string name_;
28  tf2::Transform pos_;
29  tf2::Vector3 size_;
30 };
31 
34  std::string name_;
35  tf2::Transform tf_;
37 };
38 
40 
44  protected:
45  std::shared_ptr<ros::NodeHandle> nh_;
46  std::unique_ptr<TSReader> task_space_reader_;
47  std::map<std::string, std::unique_ptr<AbstractRobotDecorator>> robots_;
48  std::vector<std::vector<std::vector<tf2::Transform>>> relative_bounds_;
49 
50  std::map<const std::string, std::vector<pcl::PointXYZ>> result_vector_;
51  std::map<const std::string, std::vector<std::unique_ptr<AbstractRobotElement>>> wings_;
52  std::string dirname_;
53 
54  std::unique_ptr<WingReader> wing_reader_;
55  std::unique_ptr<RobotReader> robot_reader_;
56  std::unique_ptr<CuboidReader> cuboid_reader_;
57 
58 
59  public:
61 
65  AbstractMediator(std::shared_ptr<ros::NodeHandle> const& d);
66 
68 
71  inline void setResultVector(std::map<const std::string, std::vector<pcl::PointXYZ>>& res) {result_vector_ = res;}
72 
74 
77  inline std::map<const std::string, std::vector<std::unique_ptr<AbstractRobotElement>>>& wings() {return wings_;}
78 
80 
83  inline std::map<const std::string, std::vector<pcl::PointXYZ>>& resultVector() {return result_vector_;}
84 
86 
89  inline std::map<std::string, std::unique_ptr<AbstractRobotDecorator>>& robots(){return robots_;}
90 
92 
95  inline void setDirname(std::string& dirn) {dirname_ = dirn;}
96 
98 
101  inline std::string& dirname() {return dirname_;}
102 
103 
105 
110  pcl::PointCloud< pcl::PointXYZ >::Ptr vector2cloud(std::vector<pcl::PointXYZ>& vector);
111 
113 
116  virtual void connectRobots(std::unique_ptr<AbstractRobotDecorator> robot)=0;
117 
119  virtual void mediate()=0;
120 
122  virtual void setPanel()=0;
123 
125 
128  inline WingReader* wingReader() {return wing_reader_.get();}
129 
131 
134  inline RobotReader* robotReader() {return robot_reader_.get();}
135 
137 
140  inline CuboidReader* cuboidReader() {return cuboid_reader_.get();}
141 
142 
143 };
144 
145 
146 #endif
wing_BP::pos_
tf2::Transform pos_
Definition: abstract_mediator.h:28
protobuf_entry::name_
std::string name_
Definition: abstract_mediator.h:34
AbstractMediator::mediate
virtual void mediate()=0
pure virtual mediate methode
AbstractMediator::result_vector_
std::map< const std::string, std::vector< pcl::PointXYZ > > result_vector_
Result_vector of base positions linked to robot.
Definition: abstract_mediator.h:50
cuboid_reader.h
wing_BP
Blueprint of panel data.
Definition: abstract_mediator.h:26
abstract_robot_decorator.h
AbstractMediator::wingReader
WingReader * wingReader()
Get Wing_reader.
Definition: abstract_mediator.h:128
AbstractMediator::wings_
std::map< const std::string, std::vector< std::unique_ptr< AbstractRobotElement > > > wings_
Definition: abstract_mediator.h:51
abstract_robot.h
ceti_robot.h
AbstractMediator::connectRobots
virtual void connectRobots(std::unique_ptr< AbstractRobotDecorator > robot)=0
pure virtual robot connecting methode
wing_BP::name_
std::string name_
Definition: abstract_mediator.h:27
AbstractMediator::AbstractMediator
AbstractMediator(std::shared_ptr< ros::NodeHandle > const &d)
AbstractMediator constructor.
Definition: abstract_mediator.cpp:3
AbstractMediator::setPanel
virtual void setPanel()=0
pure virtual Sets panels for robots
AbstractMediator::dirname_
std::string dirname_
Dirname of the reference protobuff.
Definition: abstract_mediator.h:52
AbstractMediator::wings
std::map< const std::string, std::vector< std::unique_ptr< AbstractRobotElement > > > & wings()
Get wings.
Definition: abstract_mediator.h:77
AbstractMediator::wing_reader_
std::unique_ptr< WingReader > wing_reader_
Wing_reader which collects panel information of robots.
Definition: abstract_mediator.h:54
AbstractMediator::nh_
std::shared_ptr< ros::NodeHandle > nh_
Nodehandle for access to the Rosparam server.
Definition: abstract_mediator.h:45
wing_BP::size_
tf2::Vector3 size_
Definition: abstract_mediator.h:29
protobuf_entry
Protobuf entry.
Definition: abstract_mediator.h:33
AbstractMediator::robots
std::map< std::string, std::unique_ptr< AbstractRobotDecorator > > & robots()
Get robots.
Definition: abstract_mediator.h:89
AbstractMediator::robot_reader_
std::unique_ptr< RobotReader > robot_reader_
Robot_reader which collects robot poses.
Definition: abstract_mediator.h:55
AbstractMediator
AbstractMediator.
Definition: abstract_mediator.h:43
AbstractMediator::vector2cloud
pcl::PointCloud< pcl::PointXYZ >::Ptr vector2cloud(std::vector< pcl::PointXYZ > &vector)
Cloud converter.
Definition: abstract_mediator.cpp:11
AbstractMediator::cuboidReader
CuboidReader * cuboidReader()
Get Cuboid_reader.
Definition: abstract_mediator.h:140
AbstractMediator::resultVector
std::map< const std::string, std::vector< pcl::PointXYZ > > & resultVector()
Get result_vector.
Definition: abstract_mediator.h:83
AbstractMediator::robots_
std::map< std::string, std::unique_ptr< AbstractRobotDecorator > > robots_
Robots agents.
Definition: abstract_mediator.h:47
wing_reader.h
robot_reader.h
ts_reader.h
protobuf_entry::wing_config_
int wing_config_
Definition: abstract_mediator.h:36
CuboidReader
Cuboid reader.
Definition: cuboid_reader.h:17
AbstractMediator::setResultVector
void setResultVector(std::map< const std::string, std::vector< pcl::PointXYZ >> &res)
Set result vector.
Definition: abstract_mediator.h:71
AbstractMediator::dirname
std::string & dirname()
Get dirname.
Definition: abstract_mediator.h:101
WingReader
Wing reader.
Definition: wing_reader.h:14
AbstractMediator::cuboid_reader_
std::unique_ptr< CuboidReader > cuboid_reader_
coboidReader instance that distinguishes between scene objects of type bin and box
Definition: abstract_mediator.h:56
RobotReader
Robot reader.
Definition: robot_reader.h:15
AbstractMediator::setDirname
void setDirname(std::string &dirn)
Set dirname.
Definition: abstract_mediator.h:95
AbstractMediator::robotReader
RobotReader * robotReader()
Get Robot_reader.
Definition: abstract_mediator.h:134
AbstractMediator::relative_bounds_
std::vector< std::vector< std::vector< tf2::Transform > > > relative_bounds_
total bound a workspace
Definition: abstract_mediator.h:48
protobuf_entry::tf_
tf2::Transform tf_
Definition: abstract_mediator.h:35
abstract_robot_element.h
AbstractMediator::task_space_reader_
std::unique_ptr< TSReader > task_space_reader_
Task_space reader which provides drop off positions.
Definition: abstract_mediator.h:46


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