#include <base_calculation_mediator.h>
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_reader * | robot_reader () |
Get Robot_reader. More... | |
void | set_panel () |
Sets panels for robots. More... | |
void | setup_rviz () |
Rviz setup methode. More... | |
Wing_reader * | wing_reader () |
Get Wing_reader. More... | |
void | write_file (Ceti_robot *A, Ceti_robot *B) |
Writes result file. More... | |
![]() | |
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_reader > | robot_reader_ |
Robot_reader which collects robot poses. More... | |
std::unique_ptr< Wing_reader > | wing_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... | |
![]() | |
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_reader > | task_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_ |
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.
Base_calculation_mediator::Base_calculation_mediator | ( | std::shared_ptr< ros::NodeHandle > const & | d | ) |
Base_calculation_mediator constructor.
initializes readers und publisher
d | Ros nodehandle |
Definition at line 3 of file base_calculation_mediator.cpp.
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
robot | next robot to fit in |
Definition at line 218 of file base_calculation_mediator.cpp.
|
overridevirtual |
Resets wings of a robot.
Rebuild robot wings by comparing robot observer mask and requested configuration
wings | requested wings |
robot | robot index |
Implements Abstract_mediator.
Definition at line 422 of file base_calculation_mediator.cpp.
void Base_calculation_mediator::calculate | ( | std::vector< tf2::Transform > & | ground_per_robot | ) |
Ground position calculator.
ground_per_robot | Robot |
Definition at line 140 of file base_calculation_mediator.cpp.
|
overridevirtual |
check_collision
Collsision checker impelementation including Rviz visualization
robot | Robot by index |
Implements Abstract_mediator.
Definition at line 45 of file base_calculation_mediator.cpp.
|
overridevirtual |
Robot Connector implementation.
registers robot
robot |
Implements Abstract_mediator.
Definition at line 22 of file base_calculation_mediator.cpp.
void Base_calculation_mediator::generate_grounds | ( | 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 9 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 Abstract_mediator.
Definition at line 99 of file base_calculation_mediator.cpp.
void Base_calculation_mediator::publish | ( | Ceti_robot * | r | ) |
Marker publishing methode.
Publishes all markers of an robot
r | Robot |
Definition at line 441 of file base_calculation_mediator.cpp.
|
inline |
void Base_calculation_mediator::set_panel | ( | ) |
Sets panels for robots.
Definition at line 28 of file base_calculation_mediator.cpp.
void Base_calculation_mediator::setup_rviz | ( | ) |
Rviz setup methode.
|
inline |
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
A | Robots |
B | Robots |
Definition at line 299 of file base_calculation_mediator.cpp.
|
protected |
Possible ground positions per robots.
Definition at line 29 of file base_calculation_mediator.h.
|
protected |
Publisher sharing visualization messages of the scene.
Definition at line 24 of file base_calculation_mediator.h.
|
protected |
Robot_reader which collects robot poses.
Definition at line 26 of file base_calculation_mediator.h.
|
protected |
Wing_reader which collects panel information of robots.
Definition at line 25 of file base_calculation_mediator.h.
|
protected |
Possible panels per robot.
Definition at line 30 of file base_calculation_mediator.h.