Concrete Mediator. More...
#include <base_calculation_mediator.h>
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... | |
![]() | |
AbstractMediator (std::shared_ptr< ros::NodeHandle > const &d) | |
AbstractMediator constructor. More... | |
CuboidReader * | cuboidReader () |
Get Cuboid_reader. More... | |
std::string & | dirname () |
Get dirname. More... | |
std::map< const std::string, std::vector< pcl::PointXYZ > > & | resultVector () |
Get result_vector. More... | |
RobotReader * | robotReader () |
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... | |
WingReader * | wingReader () |
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... | |
![]() | |
std::unique_ptr< CuboidReader > | cuboid_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< RobotReader > | robot_reader_ |
Robot_reader which collects robot poses. More... | |
std::map< std::string, std::unique_ptr< AbstractRobotDecorator > > | robots_ |
Robots agents. More... | |
std::unique_ptr< TSReader > | task_space_reader_ |
Task_space reader which provides drop off positions. More... | |
std::unique_ptr< WingReader > | wing_reader_ |
Wing_reader which collects panel information of robots. More... | |
std::map< const std::string, std::vector< std::unique_ptr< AbstractRobotElement > > > | wings_ |
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.
BaseCalculationMediator::BaseCalculationMediator | ( | std::shared_ptr< ros::NodeHandle > const & | d | ) |
BaseCalculationMediator constructor.
initializes readers und publisher
d | Ros nodehandle |
Definition at line 3 of file base_calculation_mediator.cpp.
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
robot | next robot to fit in |
Definition at line 305 of file base_calculation_mediator.cpp.
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.
workcell | map of robots with corresponding base position |
Definition at line 203 of file base_calculation_mediator.cpp.
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.
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 |
Definition at line 63 of file base_calculation_mediator.cpp.
|
overridevirtual |
Robot Connector implementation.
registers robot
robot |
Implements AbstractMediator.
Definition at line 25 of file base_calculation_mediator.cpp.
void BaseCalculationMediator::generateGrounds | ( | const tf2::Vector3 | origin, |
const float | diameter, | ||
float | resolution | ||
) |
Ground generator.
initialize descrete ground
origin | Ros nodehandle |
diameter | Ros nodehandle |
resolution | Ros nodehandle |
Definition at line 13 of file base_calculation_mediator.cpp.
|
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.
void BaseCalculationMediator::publish | ( | CetiRobot * | r | ) |
Marker publishing methode.
Publishes all markers of an robot
r | Robot |
Definition at line 770 of file base_calculation_mediator.cpp.
bool BaseCalculationMediator::sceneCollision | ( | std::vector< protobuf_entry > & | wc_solution | ) |
Definition at line 469 of file base_calculation_mediator.cpp.
|
overridevirtual |
pure virtual Sets panels for robots
Implements AbstractMediator.
Definition at line 30 of file base_calculation_mediator.cpp.
void BaseCalculationMediator::setupRviz | ( | ) |
Rviz setup methode.
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
wc_solution |
Definition at line 555 of file base_calculation_mediator.cpp.
|
protected |
Definition at line 29 of file base_calculation_mediator.h.
|
protected |
Possible ground positions per robots.
Definition at line 26 of file base_calculation_mediator.h.
|
protected |
Datastructure as product of all baseposition -> robot combinations.
Definition at line 28 of file base_calculation_mediator.h.
|
protected |
Publisher sharing visualization messages of the scene.
Definition at line 25 of file base_calculation_mediator.h.
|
protected |
Possible panels per robot.
Definition at line 27 of file base_calculation_mediator.h.