Public Member Functions | Protected Attributes | List of all members
Base_calculation_mediator Class Reference

Concrete Mediator. More...

#include <base_calculation_mediator.h>

Inheritance diagram for Base_calculation_mediator:
Inheritance graph
[legend]

Public Member Functions

void approximation (Ceti_robot *robot)
 Approximates other robots to fit in the workspace. More...
 
 Base_calculation_mediator (std::shared_ptr< ros::NodeHandle > const &d)
 Base_calculation_mediator constructor. More...
 
void build_wings (std::bitset< 3 > &wings, int &robot) override
 Resets wings of a robot. More...
 
void calculate (std::vector< tf2::Transform > &ground_per_robot)
 Ground position calculator. More...
 
bool check_collision (const int &robot) override
 check_collision More...
 
void connect_robots (std::unique_ptr< Abstract_robot_decorator > robot) override
 Robot Connector implementation. More...
 
std::vector< pcl::PointXYZ > generate_grounds (const tf2::Vector3 origin, const float diameter, float resolution)
 Ground generator. More...
 
void mediate () override
 Mediator implementation. More...
 
void publish (Ceti_robot *r)
 Marker publishing methode. More...
 
Robot_readerrobot_reader ()
 Get Robot_reader. More...
 
void set_panel ()
 Sets panels for robots. More...
 
void setup_rviz ()
 Rviz setup methode. More...
 
Wing_readerwing_reader ()
 Get Wing_reader. More...
 
void write_file (Ceti_robot *A, Ceti_robot *B)
 Writes result file. More...
 
- Public Member Functions inherited from Abstract_mediator
 Abstract_mediator (std::shared_ptr< ros::NodeHandle > const &d)
 Abstract mediator constructor. More...
 
 Abstract_mediator (std::vector< std::vector< tf2::Transform >> objects, ros::Publisher *pub)
 
virtual void connect_robots (Abstract_robot *robot)=0
 
std::string & dirname ()
 
std::string & dirname ()
 Get dirname. More...
 
std::vector< pcl::PointXYZ > generate_Ground (const tf2::Vector3 origin, const float diameter, float resolution)
 
std::vector< std::vector< pcl::PointXYZ > > & result_vector ()
 
std::map< const std::string, std::vector< pcl::PointXYZ > > & result_vector ()
 Get result_vector. More...
 
std::vector< Abstract_robot * > robots ()
 
std::vector< std::unique_ptr< Abstract_robot_decorator > > & robots ()
 Get robots. More...
 
void set_dirname (std::string &dirn)
 
void set_dirname (std::string &dirn)
 Set dirname. More...
 
void set_result_vector (std::map< const std::string, std::vector< pcl::PointXYZ >> &res)
 Set result vector. More...
 
void set_result_vector (std::vector< std::vector< pcl::PointXYZ >> &res)
 
virtual void set_wings (std::vector< std::pair< std::vector< object_data >, int >> &wbp)=0
 
pcl::PointCloud< pcl::PointXYZ >::Ptr vector_to_cloud (std::vector< pcl::PointXYZ > &vector)
 
pcl::PointCloud< pcl::PointXYZ >::Ptr vector_to_cloud (std::vector< pcl::PointXYZ > &vector)
 Cloud converter. More...
 
std::vector< std::vector< Abstract_robot_element * > > wings ()
 
std::map< const std::string, std::vector< std::unique_ptr< Abstract_robot_element > > > & wings ()
 Get wings. More...
 

Protected Attributes

std::map< const std::string, std::vector< pcl::PointXYZ > > grounds_
 Possible ground positions per robots. More...
 
std::unique_ptr< ros::Publisher > pub_
 Publisher sharing visualization messages of the scene. More...
 
std::unique_ptr< Robot_readerrobot_reader_
 Robot_reader which collects robot poses. More...
 
std::unique_ptr< Wing_readerwing_reader_
 Wing_reader which collects panel information of robots. More...
 
std::vector< std::vector< std::unique_ptr< Abstract_robot_element > > > wings_
 Possible panels per robot. More...
 
- Protected Attributes inherited from Abstract_mediator
std::string dirname_
 Dirname of the reference protobuff. More...
 
std::shared_ptr< ros::NodeHandle > nh_
 Ros nodehandle object. More...
 
std::vector< std::vector< tf2::Transform > > objects_
 
ros::Publisher * pub_
 
std::vector< std::vector< std::vector< tf2::Transform > > > relative_bounds_
 total bound a workspace More...
 
std::vector< std::vector< pcl::PointXYZ > > result_vector_
 
std::map< const std::string, std::vector< pcl::PointXYZ > > result_vector_
 Result_vector of base positions linked to robot. More...
 
std::vector< Abstract_robot * > robots_
 
std::vector< std::unique_ptr< Abstract_robot_decorator > > robots_
 Robots agents. More...
 
std::unique_ptr< Ts_readertask_space_reader_
 Task_space reader which provides drop off positions. More...
 
std::vector< std::vector< Abstract_robot_element * > > wings_
 
std::map< const std::string, std::vector< std::unique_ptr< Abstract_robot_element > > > wings_
 

Detailed Description

Concrete Mediator.

Base calculation mediator, which mediates agents to form a multi-cell by placing/rotating and perform collision checks

Definition at line 22 of file base_calculation_mediator.h.

Constructor & Destructor Documentation

◆ Base_calculation_mediator()

Base_calculation_mediator::Base_calculation_mediator ( std::shared_ptr< ros::NodeHandle > const &  d)

Base_calculation_mediator constructor.

initializes readers und publisher

Parameters
dRos nodehandle

Definition at line 3 of file base_calculation_mediator.cpp.

Member Function Documentation

◆ approximation()

void Base_calculation_mediator::approximation ( Ceti_robot robot)

Approximates other robots to fit in the workspace.

Places and rotates robot to fit in a previous robots surrounding

Parameters
robotnext robot to fit in

Definition at line 218 of file base_calculation_mediator.cpp.

◆ build_wings()

void Base_calculation_mediator::build_wings ( std::bitset< 3 > &  wings,
int &  robot 
)
overridevirtual

Resets wings of a robot.

Rebuild robot wings by comparing robot observer mask and requested configuration

Parameters
wingsrequested wings
robotrobot index

Implements Abstract_mediator.

Definition at line 422 of file base_calculation_mediator.cpp.

◆ calculate()

void Base_calculation_mediator::calculate ( std::vector< tf2::Transform > &  ground_per_robot)

Ground position calculator.

Parameters
ground_per_robotRobot

Definition at line 140 of file base_calculation_mediator.cpp.

◆ check_collision()

bool Base_calculation_mediator::check_collision ( const int &  robot)
overridevirtual

check_collision

Collsision checker impelementation including Rviz visualization

Parameters
robotRobot by index

Implements Abstract_mediator.

Definition at line 45 of file base_calculation_mediator.cpp.

◆ connect_robots()

void Base_calculation_mediator::connect_robots ( std::unique_ptr< Abstract_robot_decorator robot)
overridevirtual

Robot Connector implementation.

registers robot

Parameters
robot

Implements Abstract_mediator.

Definition at line 22 of file base_calculation_mediator.cpp.

◆ generate_grounds()

void Base_calculation_mediator::generate_grounds ( const tf2::Vector3  origin,
const float  diameter,
float  resolution 
)

Ground generator.

initialize descrete ground

Parameters
originRos nodehandle
diameterRos nodehandle
resolutionRos nodehandle

Definition at line 9 of file base_calculation_mediator.cpp.

◆ mediate()

void Base_calculation_mediator::mediate ( )
overridevirtual

Mediator implementation.

Places and rotates robots till no collisions exists, all objects are somewhere on the tables

Implements Abstract_mediator.

Definition at line 99 of file base_calculation_mediator.cpp.

◆ publish()

void Base_calculation_mediator::publish ( Ceti_robot r)

Marker publishing methode.

Publishes all markers of an robot

Parameters
rRobot

Definition at line 441 of file base_calculation_mediator.cpp.

◆ robot_reader()

Robot_reader* Base_calculation_mediator::robot_reader ( )
inline

Get Robot_reader.

Returns
robot reader

Definition at line 60 of file base_calculation_mediator.h.

◆ set_panel()

void Base_calculation_mediator::set_panel ( )

Sets panels for robots.

Definition at line 28 of file base_calculation_mediator.cpp.

◆ setup_rviz()

void Base_calculation_mediator::setup_rviz ( )

Rviz setup methode.

◆ wing_reader()

Wing_reader* Base_calculation_mediator::wing_reader ( )
inline

Get Wing_reader.

Returns
wing reader

Definition at line 54 of file base_calculation_mediator.h.

◆ write_file()

void Base_calculation_mediator::write_file ( Ceti_robot A,
Ceti_robot B 
)

Writes result file.

Writes Protobuff file containing all robots, panels, Drop off locations and actual box positions

Parameters
ARobots
BRobots

Definition at line 299 of file base_calculation_mediator.cpp.

Member Data Documentation

◆ grounds_

std::map<const std::string, std::vector<pcl::PointXYZ> > Base_calculation_mediator::grounds_
protected

Possible ground positions per robots.

Definition at line 29 of file base_calculation_mediator.h.

◆ pub_

std::unique_ptr<ros::Publisher> Base_calculation_mediator::pub_
protected

Publisher sharing visualization messages of the scene.

Definition at line 24 of file base_calculation_mediator.h.

◆ robot_reader_

std::unique_ptr<Robot_reader> Base_calculation_mediator::robot_reader_
protected

Robot_reader which collects robot poses.

Definition at line 26 of file base_calculation_mediator.h.

◆ wing_reader_

std::unique_ptr<Wing_reader> Base_calculation_mediator::wing_reader_
protected

Wing_reader which collects panel information of robots.

Definition at line 25 of file base_calculation_mediator.h.

◆ wings_

std::vector<std::vector<std::unique_ptr<Abstract_robot_element> > > Base_calculation_mediator::wings_
protected

Possible panels per robot.

Definition at line 30 of file base_calculation_mediator.h.


The documentation for this class was generated from the following files:


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