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

Concrete Mediator. More...

#include <base_calculation_mediator.h>

Inheritance diagram for BaseCalculationMediator:
Inheritance graph
[legend]

Public Member Functions

void approximation (std::map< const std::string, std::vector< tf2::Transform >> &workcell, std::vector< protobuf_entry > &wc_solution)
 Approximates other robots to fit in the workspace. More...
 
 BaseCalculationMediator (std::shared_ptr< ros::NodeHandle > const &d)
 BaseCalculationMediator constructor. More...
 
void calculate (std::map< const std::string, std::vector< tf2::Transform >> &workcell)
 Workspace calculator. More...
 
bool checkCollision (const std::string &robot, std::bitset< 3 > &panel_mask, bool &workload, std::vector< object_data > &ts)
 check_collision More...
 
void connectRobots (std::unique_ptr< AbstractRobotDecorator > robot) override
 Robot Connector implementation. More...
 
void generateGrounds (const tf2::Vector3 origin, const float diameter, float resolution)
 Ground generator. More...
 
void mediate () override
 Mediator implementation. More...
 
void publish (CetiRobot *r)
 Marker publishing methode. More...
 
bool sceneCollision (std::vector< protobuf_entry > &wc_solution)
 
void setPanel () override
 pure virtual Sets panels for robots More...
 
void setupRviz ()
 Rviz setup methode. More...
 
void writeFile (std::vector< protobuf_entry > &wc_solution)
 Writes result file. More...
 
- Public Member Functions inherited from AbstractMediator
 AbstractMediator (std::shared_ptr< ros::NodeHandle > const &d)
 AbstractMediator constructor. More...
 
CuboidReadercuboidReader ()
 Get Cuboid_reader. More...
 
std::string & dirname ()
 Get dirname. More...
 
std::map< const std::string, std::vector< pcl::PointXYZ > > & resultVector ()
 Get result_vector. More...
 
RobotReaderrobotReader ()
 Get Robot_reader. More...
 
std::map< std::string, std::unique_ptr< AbstractRobotDecorator > > & robots ()
 Get robots. More...
 
void setDirname (std::string &dirn)
 Set dirname. More...
 
void setResultVector (std::map< const std::string, std::vector< pcl::PointXYZ >> &res)
 Set result vector. More...
 
pcl::PointCloud< pcl::PointXYZ >::Ptr vector2cloud (std::vector< pcl::PointXYZ > &vector)
 Cloud converter. More...
 
WingReaderwingReader ()
 Get Wing_reader. More...
 
std::map< const std::string, std::vector< std::unique_ptr< AbstractRobotElement > > > & wings ()
 Get wings. More...
 

Protected Attributes

std::string filename_
 
std::map< const std::string, std::vector< pcl::PointXYZ > > grounds_
 Possible ground positions per robots. More...
 
std::vector< std::vector< std::vector< protobuf_entry > > > protobuf_
 Datastructure as product of all baseposition -> robot combinations. More...
 
std::unique_ptr< ros::Publisher > pub_
 Publisher sharing visualization messages of the scene. More...
 
std::vector< std::vector< std::unique_ptr< AbstractRobotElement > > > wings_
 Possible panels per robot. More...
 
- Protected Attributes inherited from AbstractMediator
std::unique_ptr< CuboidReadercuboid_reader_
 coboidReader instance that distinguishes between scene objects of type bin and box More...
 
std::string dirname_
 Dirname of the reference protobuff. More...
 
std::shared_ptr< ros::NodeHandle > nh_
 Nodehandle for access to the Rosparam server. More...
 
std::vector< std::vector< std::vector< tf2::Transform > > > relative_bounds_
 total bound a workspace More...
 
std::map< const std::string, std::vector< pcl::PointXYZ > > result_vector_
 Result_vector of base positions linked to robot. More...
 
std::unique_ptr< RobotReaderrobot_reader_
 Robot_reader which collects robot poses. More...
 
std::map< std::string, std::unique_ptr< AbstractRobotDecorator > > robots_
 Robots agents. More...
 
std::unique_ptr< TSReadertask_space_reader_
 Task_space reader which provides drop off positions. More...
 
std::unique_ptr< WingReaderwing_reader_
 Wing_reader which collects panel information of robots. More...
 
std::map< const std::string, std::vector< std::unique_ptr< AbstractRobotElement > > > 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 23 of file base_calculation_mediator.h.

Constructor & Destructor Documentation

◆ BaseCalculationMediator()

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

BaseCalculationMediator constructor.

initializes readers und publisher

Parameters
dRos nodehandle

Definition at line 3 of file base_calculation_mediator.cpp.

Member Function Documentation

◆ approximation()

void BaseCalculationMediator::approximation ( std::map< const std::string, std::vector< tf2::Transform >> &  workcell,
std::vector< protobuf_entry > &  wc_solution 
)

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 305 of file base_calculation_mediator.cpp.

◆ calculate()

void BaseCalculationMediator::calculate ( std::map< const std::string, std::vector< tf2::Transform >> &  workcell)

Workspace calculator.

calculates for given robots and corresponding base position, all possible combinations.

Parameters
workcellmap of robots with corresponding base position

Definition at line 203 of file base_calculation_mediator.cpp.

◆ checkCollision()

bool BaseCalculationMediator::checkCollision ( const std::string &  robot,
std::bitset< 3 > &  panel_mask,
bool &  workload,
std::vector< object_data > &  ts 
)

check_collision

Checks task_space of robot for collision. Also provides information about workload.

Parameters
robot[IN]std::string providing robot name
panel_mask[IN]bitmap providing which robot_elements to check
[OUT]workload desribing if robot/all robots_elements were used
Returns
true if task_space collides with robot/robot_elements

Definition at line 63 of file base_calculation_mediator.cpp.

◆ connectRobots()

void BaseCalculationMediator::connectRobots ( std::unique_ptr< AbstractRobotDecorator robot)
overridevirtual

Robot Connector implementation.

registers robot

Parameters
robot

Implements AbstractMediator.

Definition at line 25 of file base_calculation_mediator.cpp.

◆ generateGrounds()

void BaseCalculationMediator::generateGrounds ( const tf2::Vector3  origin,
const float  diameter,
float  resolution 
)

Ground generator.

initialize descrete ground

Parameters
originRos nodehandle
diameterRos nodehandle
resolutionRos nodehandle

Definition at line 13 of file base_calculation_mediator.cpp.

◆ mediate()

void BaseCalculationMediator::mediate ( )
overridevirtual

Mediator implementation.

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

Implements AbstractMediator.

Definition at line 130 of file base_calculation_mediator.cpp.

◆ publish()

void BaseCalculationMediator::publish ( CetiRobot r)

Marker publishing methode.

Publishes all markers of an robot

Parameters
rRobot

Definition at line 770 of file base_calculation_mediator.cpp.

◆ sceneCollision()

bool BaseCalculationMediator::sceneCollision ( std::vector< protobuf_entry > &  wc_solution)

Definition at line 469 of file base_calculation_mediator.cpp.

◆ setPanel()

void BaseCalculationMediator::setPanel ( )
overridevirtual

pure virtual Sets panels for robots

Implements AbstractMediator.

Definition at line 30 of file base_calculation_mediator.cpp.

◆ setupRviz()

void BaseCalculationMediator::setupRviz ( )

Rviz setup methode.

◆ writeFile()

void BaseCalculationMediator::writeFile ( std::vector< protobuf_entry > &  wc_solution)

Writes result file.

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

Parameters
wc_solution

Definition at line 555 of file base_calculation_mediator.cpp.

Member Data Documentation

◆ filename_

std::string BaseCalculationMediator::filename_
protected

Definition at line 29 of file base_calculation_mediator.h.

◆ grounds_

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

Possible ground positions per robots.

Definition at line 26 of file base_calculation_mediator.h.

◆ protobuf_

std::vector<std::vector<std::vector<protobuf_entry> > > BaseCalculationMediator::protobuf_
protected

Datastructure as product of all baseposition -> robot combinations.

Definition at line 28 of file base_calculation_mediator.h.

◆ pub_

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

Publisher sharing visualization messages of the scene.

Definition at line 25 of file base_calculation_mediator.h.

◆ wings_

std::vector<std::vector<std::unique_ptr<AbstractRobotElement> > > BaseCalculationMediator::wings_
protected

Possible panels per robot.

Definition at line 27 of file base_calculation_mediator.h.


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


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