Coverage Control Library
|
The CoverageSystem class is the main class for the coverage control library. More...
#include <coverage_system.h>
Public Member Functions | |
Constructors | |
CoverageSystem ()=delete | |
CoverageSystem (Parameters const ¶ms) | |
Create random Gaussian distributions for the world IDF and random start positions for the robots. | |
CoverageSystem (Parameters const ¶ms, int const num_gaussians, int const num_robots) | |
Create random Gaussian distributions for the world IDF and random start positions for the robots. | |
CoverageSystem (Parameters const ¶ms, int const num_gaussians, int const num_polygons, int const num_robots) | |
CoverageSystem (Parameters const ¶ms, WorldIDF const &world_idf, std::string const &pos_file_name) | |
Create with given world IDF and robot positions from file. | |
CoverageSystem (Parameters const ¶ms, WorldIDF const &world_idf, std::vector< Point2 > const &robot_positions) | |
Constructor for given world IDF and robot positions as a vector. | |
CoverageSystem (Parameters const ¶ms, std::vector< BivariateNormalDistribution > const &dists, std::vector< Point2 > const &robot_positions) | |
Constructor for given normal distributions and robot positions. | |
Setters | |
void | SetLocalRobotPositions (std::vector< Point2 > const &relative_pos) |
void | SetLocalRobotPosition (size_t const robot_id, Point2 const &relative_pos) |
Set the position of robot_id with respect to its current position. | |
void | SetGlobalRobotPosition (size_t const robot_id, Point2 const &global_pos) |
Set the global position of robot_id. | |
void | SetGlobalRobotPositions (PointVector const &global_positions) |
Set the global positions of all robots. | |
void | SetRobotPositions (std::vector< Point2 > const &positions) |
void | SetWorldIDF (WorldIDF const &world_idf) |
Set the world IDF and recompute the world map. | |
Robot related functions | |
bool | StepActions (PointVector const &actions) |
Execute given actions for all robots. | |
bool | StepAction (size_t const robot_id, Point2 const action) |
Execute given action for robot_id. | |
bool | StepControl (size_t robot_id, Point2 const &direction, double const speed) |
Execute velocity control for robot_id. | |
Point2 | AddNoise (Point2 const pt) const |
Add noise to the given point and ensure within bounds. | |
bool | CheckOscillation (size_t const robot_id) const |
void | CheckRobotID (size_t const id) const |
void | ComputeVoronoiCells () |
bool | StepRobotToGoal (int const robot_id, Point2 const &goal, double const speed_factor=1) |
bool | StepRobotsToGoals (PointVector const &goals, PointVector &actions) |
void | ClearRobotMaps () |
void | ClearExploredIDF () |
I/O | |
int | WriteRobotPositions (std::string const &file_name) const |
int | WriteRobotPositions (std::string const &file_name, PointVector const &positions) const |
int | WriteEnvironment (std::string const &pos_filename, std::string const &env_filename) const |
Plot related functions | |
void | PlotFrontiers (std::string const &, int const &, PointVector const &) const |
void | PlotSystemMap (std::string const &dir_name, int const &step) const |
void | PlotSystemMap (std::string const &) const |
void | PlotSystemMap (std::string const &, int const &, std::vector< int > const &) const |
void | PlotMapVoronoi (std::string const &, int const &) |
void | PlotMapVoronoi (std::string const &, int const &, Voronoi const &, PointVector const &) const |
void | PlotWorldMap (std::string const &, std::string const &) const |
void | PlotWorldMapRobots (std::string const &, std::string const &) const |
void | PlotInitMap (std::string const &filename) const |
void | PlotInitMap (std::string const &, std::string const &) const |
void | PlotRobotLocalMap (std::string const &, int const &, int const &) |
void | PlotRobotSystemMap (std::string const &, int const &, int const &) |
void | PlotRobotExplorationMap (std::string const &, int const &, int const &) |
void | PlotRobotSensorView (std::string const &, int const &, int const &) |
void | PlotRobotObstacleMap (std::string const &, int const &, int const &) |
void | PlotRobotCommunicationMaps (std::string const &, int const &, int const &, size_t const &) |
void | RenderRecordedMap (std::string const &, std::string const &) const |
void | RecordPlotData (std::vector< int > const &, std::string const &) |
void | RecordPlotData (std::vector< int > const &robot_status) |
void | RecordPlotData (std::string const &map_name) |
void | RecordPlotData () |
Getters | |
std::shared_ptr< const WorldIDF > | GetWorldIDFPtr () const |
const WorldIDF & | GetWorldIDFObject () const |
const MapType & | GetSystemMap () const |
const MapType & | GetSystemExplorationMap () const |
const MapType & | GetSystemExploredIDFMap () const |
MapType & | GetSystemExploredIDFMapMutable () |
const MapType & | GetWorldMap () const |
Get the world map. | |
MapType & | GetWorldMapMutable () |
Get the world map (mutable) | |
MapType & | GetRobotMapMutable (size_t const id) |
auto | GetNumRobots () const |
auto | GetNumFeatures () const |
double | GetExplorationRatio () const |
double | GetWeightedExplorationRatio () const |
Get the weighted (by IDF) exploration ratio. | |
PointVector | GetRelativePositonsNeighbors (size_t const robot_id) |
std::vector< int > | GetNeighborIDs (size_t const robot_id) const |
PointVector | GetRobotPositions (bool force_no_noise=false) |
Get the global positions of all robots. | |
Point2 | GetRobotPosition (int const robot_id, bool force_no_noise=false) const |
const MapType & | GetRobotLocalMap (size_t const id) |
const MapType & | GetRobotMap (size_t const id) const |
const MapType & | GetRobotExplorationMap (size_t const id) |
const MapType & | GetRobotSystemMap (size_t const id) |
const MapType & | GetRobotObstacleMap (size_t const id) |
const MapType & | GetRobotSensorView (size_t const id) const |
auto | GetRobotsInCommunication (size_t const id) const |
std::pair< MapType, MapType > | GetRobotCommunicationMaps (size_t const, size_t) |
std::vector< MapType > | GetCommunicationMaps (size_t map_size) |
auto | GetObjectiveValue () |
auto | GetRobotExplorationFeatures () |
auto | GetRobotVoronoiFeatures () |
std::vector< double > | GetLocalVoronoiFeatures (int const robot_id) |
std::vector< std::vector< double > > | GetLocalVoronoiFeatures () |
auto | GetVoronoiCells () |
Voronoi & | GetVoronoi () |
auto | GetVoronoiCell (int const robot_id) |
double | GetNormalizationFactor () |
The CoverageSystem class is the main class for the coverage control library.
Definition at line 66 of file coverage_system.h.
|
delete |
Delete the default constructor
|
explicit |
Create random Gaussian distributions for the world IDF and random start positions for the robots.
params | Parameters for the coverage system |
Definition at line 39 of file coverage_system.cpp.
CoverageSystem | ( | Parameters const & | params, |
int const | num_gaussians, | ||
int const | num_robots ) |
Create random Gaussian distributions for the world IDF and random start positions for the robots.
params | Parameters for the coverage system |
num_gaussians | Number of gaussian distributions for the world IDF |
num_robots | Number of robots |
Definition at line 43 of file coverage_system.cpp.
CoverageSystem | ( | Parameters const & | params, |
int const | num_gaussians, | ||
int const | num_polygons, | ||
int const | num_robots ) |
Definition at line 47 of file coverage_system.cpp.
CoverageSystem | ( | Parameters const & | params, |
WorldIDF const & | world_idf, | ||
std::string const & | pos_file_name ) |
Create with given world IDF and robot positions from file.
params | Parameters for the coverage system |
world_idf | World IDF |
pos_file_name | File name for initial positions |
Definition at line 113 of file coverage_system.cpp.
CoverageSystem | ( | Parameters const & | params, |
WorldIDF const & | world_idf, | ||
std::vector< Point2 > const & | robot_positions ) |
Constructor for given world IDF and robot positions as a vector.
params | Parameters for the coverage system |
world_idf | World IDF |
robot_positions | Initial positions of the robots |
Definition at line 143 of file coverage_system.cpp.
CoverageSystem | ( | Parameters const & | params, |
std::vector< BivariateNormalDistribution > const & | dists, | ||
std::vector< Point2 > const & | robot_positions ) |
Constructor for given normal distributions and robot positions.
params | Parameters for the coverage system |
dists | Bivariate normal distributions for the world IDF |
robot_positions | Initial positions of the robots |
Definition at line 157 of file coverage_system.cpp.
Add noise to the given point and ensure within bounds.
Definition at line 339 of file coverage_system.cpp.
|
inline |
Check if the robot is oscillating about its current position
Definition at line 341 of file coverage_system.h.
|
inline |
Definition at line 365 of file coverage_system.h.
|
inline |
Definition at line 405 of file coverage_system.h.
|
inline |
Definition at line 399 of file coverage_system.h.
|
inline |
Definition at line 371 of file coverage_system.h.
|
inline |
Definition at line 587 of file coverage_system.h.
|
inline |
Definition at line 488 of file coverage_system.h.
|
inline |
Definition at line 626 of file coverage_system.h.
std::vector< double > GetLocalVoronoiFeatures | ( | int const | robot_id | ) |
Definition at line 648 of file coverage_system.cpp.
|
inline |
Definition at line 503 of file coverage_system.h.
|
inline |
Definition at line 640 of file coverage_system.h.
|
inline |
Definition at line 486 of file coverage_system.h.
|
inline |
Definition at line 485 of file coverage_system.h.
|
inline |
Definition at line 598 of file coverage_system.h.
PointVector GetRelativePositonsNeighbors | ( | size_t const | robot_id | ) |
Definition at line 625 of file coverage_system.cpp.
Definition at line 177 of file coverage_system.cpp.
|
inline |
Definition at line 603 of file coverage_system.h.
|
inline |
Definition at line 547 of file coverage_system.h.
|
inline |
Definition at line 537 of file coverage_system.h.
|
inline |
Definition at line 542 of file coverage_system.h.
|
inline |
Definition at line 480 of file coverage_system.h.
|
inline |
Definition at line 556 of file coverage_system.h.
|
inline |
Definition at line 526 of file coverage_system.h.
|
inline |
Get the global positions of all robots.
Can add noise to the positions based on the parameters
force_no_noise | If true, returns the positions without noise |
Definition at line 514 of file coverage_system.h.
|
inline |
Definition at line 561 of file coverage_system.h.
|
inline |
Definition at line 566 of file coverage_system.h.
|
inline |
Definition at line 552 of file coverage_system.h.
|
inline |
Definition at line 612 of file coverage_system.h.
|
inline |
Definition at line 472 of file coverage_system.h.
|
inline |
Definition at line 473 of file coverage_system.h.
|
inline |
Definition at line 474 of file coverage_system.h.
|
inline |
Definition at line 471 of file coverage_system.h.
|
inline |
Definition at line 636 of file coverage_system.h.
|
inline |
Definition at line 638 of file coverage_system.h.
|
inline |
Definition at line 635 of file coverage_system.h.
|
inline |
Get the weighted (by IDF) exploration ratio.
Definition at line 496 of file coverage_system.h.
|
inline |
Definition at line 470 of file coverage_system.h.
|
inline |
Definition at line 467 of file coverage_system.h.
|
inline |
Get the world map.
Definition at line 476 of file coverage_system.h.
|
inline |
Get the world map (mutable)
Definition at line 478 of file coverage_system.h.
void PlotFrontiers | ( | std::string const & | dir_name, |
int const & | step, | ||
PointVector const & | frontiers ) const |
Definition at line 549 of file coverage_system.cpp.
void PlotInitMap | ( | std::string const & | dir_name, |
std::string const & | map_name ) const |
Definition at line 519 of file coverage_system.cpp.
|
inline |
Definition at line 437 of file coverage_system.h.
void PlotMapVoronoi | ( | std::string const & | dir_name, |
int const & | step ) |
Definition at line 528 of file coverage_system.cpp.
void PlotMapVoronoi | ( | std::string const & | dir_name, |
int const & | step, | ||
Voronoi const & | voronoi, | ||
PointVector const & | goals ) const |
Definition at line 539 of file coverage_system.cpp.
void PlotRobotCommunicationMaps | ( | std::string const & | dir_name, |
int const & | robot_id, | ||
int const & | step, | ||
size_t const & | map_size ) |
Definition at line 608 of file coverage_system.cpp.
void PlotRobotExplorationMap | ( | std::string const & | dir_name, |
int const & | robot_id, | ||
int const & | step ) |
Definition at line 581 of file coverage_system.cpp.
void PlotRobotLocalMap | ( | std::string const & | dir_name, |
int const & | robot_id, | ||
int const & | step ) |
Definition at line 572 of file coverage_system.cpp.
void PlotRobotObstacleMap | ( | std::string const & | dir_name, |
int const & | robot_id, | ||
int const & | step ) |
Definition at line 598 of file coverage_system.cpp.
void PlotRobotSensorView | ( | std::string const & | dir_name, |
int const & | robot_id, | ||
int const & | step ) |
Definition at line 590 of file coverage_system.cpp.
void PlotRobotSystemMap | ( | std::string const & | dir_name, |
int const & | robot_id, | ||
int const & | step ) |
Definition at line 559 of file coverage_system.cpp.
void PlotSystemMap | ( | std::string const & | filename | ) | const |
Definition at line 478 of file coverage_system.cpp.
void PlotSystemMap | ( | std::string const & | dir_name, |
int const & | step, | ||
std::vector< int > const & | robot_status ) const |
Definition at line 489 of file coverage_system.cpp.
|
inline |
Definition at line 425 of file coverage_system.h.
void PlotWorldMap | ( | std::string const & | dir_name, |
std::string const & | map_name ) const |
Definition at line 510 of file coverage_system.cpp.
void PlotWorldMapRobots | ( | std::string const & | dir_name, |
std::string const & | map_name ) const |
Definition at line 499 of file coverage_system.cpp.
|
inline |
Definition at line 458 of file coverage_system.h.
|
inline |
Definition at line 454 of file coverage_system.h.
void RecordPlotData | ( | std::vector< int > const & | robot_status, |
std::string const & | map_name ) |
Definition at line 451 of file coverage_system.cpp.
|
inline |
Definition at line 451 of file coverage_system.h.
void RenderRecordedMap | ( | std::string const & | dir_name, |
std::string const & | video_name ) const |
Definition at line 405 of file coverage_system.cpp.
|
inline |
Set the global position of robot_id.
Definition at line 230 of file coverage_system.h.
|
inline |
Set the global positions of all robots.
Definition at line 236 of file coverage_system.h.
|
inline |
Set the position of robot_id with respect to its current position.
Definition at line 223 of file coverage_system.h.
|
inline |
Set the positions of all robots with respect to their current positions
Definition at line 218 of file coverage_system.h.
|
inline |
Set the positions of all robots with respect to their current positions
Definition at line 249 of file coverage_system.h.
|
inline |
Set the world IDF and recompute the world map.
Definition at line 261 of file coverage_system.h.
|
inlinenodiscard |
Execute given action for robot_id.
robot_id | ID of the robot |
action | Action for the robot |
Definition at line 303 of file coverage_system.h.
|
inlinenodiscard |
Execute given actions for all robots.
actions | Vector of actions for all robots |
Definition at line 279 of file coverage_system.h.
|
inlinenodiscard |
Execute velocity control for robot_id.
robot_id | ID of the robot |
direction | Velocity direction |
speed | Velocity magnitude |
Definition at line 325 of file coverage_system.h.
bool StepRobotsToGoals | ( | PointVector const & | goals, |
PointVector & | actions ) |
Step all robots towards given goals
goals | Vector of goals for the robots |
actions | Vector of actions for the robots |
Definition at line 313 of file coverage_system.cpp.
bool StepRobotToGoal | ( | int const | robot_id, |
Point2 const & | goal, | ||
double const | speed_factor = 1 ) |
Step a robot towards a given goal
robot_id | ID of the robot |
goal | Goal for the robot |
speed_factor | Speed factor for the robots |
Definition at line 293 of file coverage_system.cpp.
int WriteEnvironment | ( | std::string const & | pos_filename, |
std::string const & | env_filename ) const |
Definition at line 398 of file coverage_system.cpp.
int WriteRobotPositions | ( | std::string const & | file_name | ) | const |
Definition at line 368 of file coverage_system.cpp.
int WriteRobotPositions | ( | std::string const & | file_name, |
PointVector const & | positions ) const |
Definition at line 383 of file coverage_system.cpp.