Functions
area_division.cpp File Reference
#include "area_division.h"
Include dependency graph for area_division.cpp:

Go to the source code of this file.

Functions

void behavior_state_callback (const cpswarm_msgs::StateEvent::ConstPtr &msg)
 Callback function for behavior state updates. More...
 
void deinit ()
 Shutdown ROS communication. More...
 
void divide_area ()
 Divide the area of the grid map equally among multiple CPSs. More...
 
void division_callback (const cpswarm_msgs::AreaDivisionEvent::ConstPtr &msg)
 Callback function to receive area division requests from other CPSs. More...
 
void downsample (nav_msgs::OccupancyGrid &map)
 Decrease the resolution of a occupancy grid map. More...
 
void init ()
 Initialize this node. More...
 
int main (int argc, char **argv)
 A ROS node that divides the available area among a swarm of CPSs. More...
 
void map_callback (const nav_msgs::OccupancyGrid::ConstPtr &msg)
 Callback function to receive the grid map. More...
 
void pose_callback (const geometry_msgs::PoseStamped::ConstPtr &msg)
 Callback function for position updates. More...
 
geometry_msgs::Point rotate (geometry_msgs::Point point, double angle)
 Rotate a point by a given angle around the origin. More...
 
double rotate (nav_msgs::OccupancyGrid &map)
 Rotate an occupancy grid map so the lower boundary is horizontal. More...
 
void swarm_state_callback (const cpswarm_msgs::ArrayOfStates::ConstPtr &msg)
 Callback function to receive the states of the other CPSs. More...
 
void sync ()
 Synchronize The CPSs by exchanging an event. More...
 
void to_sync ()
 Switch to the synchronization state. More...
 
void translate (nav_msgs::OccupancyGrid &map)
 Shift a map to be aligned with the grid, i.e., the origin should be an even number. More...
 
void uuid_callback (const swarmros::String::ConstPtr &msg)
 Callback function to receive the UUID from the communication library. More...
 

Function Documentation

void behavior_state_callback ( const cpswarm_msgs::StateEvent::ConstPtr &  msg)

Callback function for behavior state updates.

Parameters
msgState received from the CPS.

Definition at line 28 of file area_division.cpp.

void deinit ( )

Shutdown ROS communication.

Definition at line 236 of file area_division.cpp.

void divide_area ( )

Divide the area of the grid map equally among multiple CPSs.

Definition at line 483 of file area_division.cpp.

void division_callback ( const cpswarm_msgs::AreaDivisionEvent::ConstPtr &  msg)

Callback function to receive area division requests from other CPSs.

Parameters
msgUUIDs and position of the other CPS.

Definition at line 50 of file area_division.cpp.

void downsample ( nav_msgs::OccupancyGrid &  map)

Decrease the resolution of a occupancy grid map.

Parameters
mapA reference to the occupancy grid map to downsample.

Definition at line 409 of file area_division.cpp.

void init ( )

Initialize this node.

Definition at line 170 of file area_division.cpp.

int main ( int  argc,
char **  argv 
)

A ROS node that divides the available area among a swarm of CPSs.

Parameters
argcNumber of command line arguments.
argvArray of command line arguments.
Returns
Success.

Definition at line 555 of file area_division.cpp.

void map_callback ( const nav_msgs::OccupancyGrid::ConstPtr &  msg)

Callback function to receive the grid map.

Parameters
msgGlobal grid map.

Definition at line 85 of file area_division.cpp.

void pose_callback ( const geometry_msgs::PoseStamped::ConstPtr &  msg)

Callback function for position updates.

Parameters
msgPosition received from the CPS.

Definition at line 102 of file area_division.cpp.

geometry_msgs::Point rotate ( geometry_msgs::Point  point,
double  angle 
)

Rotate a point by a given angle around the origin.

Parameters
pointThe point to rotate.
angleThe angle by which to rotate the point.
Returns
The rotated point.

Definition at line 285 of file area_division.cpp.

double rotate ( nav_msgs::OccupancyGrid &  map)

Rotate an occupancy grid map so the lower boundary is horizontal.

Parameters
mapA reference to the occupancy grid map to rotate.
Returns
The angle by which the map has been rotated.

Definition at line 303 of file area_division.cpp.

void swarm_state_callback ( const cpswarm_msgs::ArrayOfStates::ConstPtr &  msg)

Callback function to receive the states of the other CPSs.

Parameters
msgUUIDs and states of the other CPSs.

Definition at line 116 of file area_division.cpp.

void sync ( )

Synchronize The CPSs by exchanging an event.

Definition at line 260 of file area_division.cpp.

void to_sync ( )

Switch to the synchronization state.

Definition at line 6 of file area_division.cpp.

void translate ( nav_msgs::OccupancyGrid &  map)

Shift a map to be aligned with the grid, i.e., the origin should be an even number.

Parameters
mapThe map to shift.

Definition at line 390 of file area_division.cpp.

void uuid_callback ( const swarmros::String::ConstPtr &  msg)

Callback function to receive the UUID from the communication library.

Parameters
msgUUID of this node.

Definition at line 162 of file area_division.cpp.



area_division
Author(s): Micha Sende
autogenerated on Tue Jan 19 2021 03:30:02