Public Member Functions

OccupancyGrid2DProxy Class Reference

Proxy class used to add and manipulate 2D occupancy grids. More...

Inheritance diagram for OccupancyGrid2DProxy:
Inheritance graph
[legend]

List of all members.

Public Member Functions

 OccupancyGrid2DProxy (OccupancyGrid2DProxy &p)
OccupancyGrid2DProxyoperator= (const OccupancyGrid2DProxy &p)
OccupancyGrid2DProxyoperator= (const OccupancyGrid2DProxyBase &p)
DelayedDispatch assign (const ObjectProxyBase &p)
DelayedDispatch assign (PeekabotClient &client, const std::string &path)
DelayedDispatch assign (const ObjectProxyBase &parent, const std::string &rel_path)
DelayedDispatch add (PeekabotClient &client, const std::string &path, float cell_size, NameConflictPolicy conflict_policy=AUTO_ENUMERATE_ON_CONFLICT)
 Add a 2D occupancy grid to the scene.
DelayedDispatch add (const ObjectProxyBase &parent, const std::string &name, float cell_size, NameConflictPolicy conflict_policy=AUTO_ENUMERATE_ON_CONFLICT)
 Add a 2D occupancy grid to the scene.
DelayedDispatch add (PeekabotClient &client, const std::string &path, float cell_size, float unoccupied_r, float unoccupied_g, float unoccupied_b, float occupied_r, float occupied_g, float occupied_b, NameConflictPolicy conflict_policy=AUTO_ENUMERATE_ON_CONFLICT) PEEKABOT_DEPRECATED
DelayedDispatch add (const ObjectProxyBase &parent, const std::string &name, float cell_size, float unoccupied_r, float unoccupied_g, float unoccupied_b, float occupied_r, float occupied_g, float occupied_b, NameConflictPolicy conflict_policy=AUTO_ENUMERATE_ON_CONFLICT) PEEKABOT_DEPRECATED

Detailed Description

Proxy class used to add and manipulate 2D occupancy grids.

Cells in the occupancy grid are addressed by coordinates, rather than indices. To, for example, update the greyed cell in the example below one would specify any coordinate $(x,y)$ where $x\in(1.5d, 2.5d), y\in(0.5d, 1.5d)$.

og_coord_sys.png

As shown in the figure above, the object's origin is centered on a cell.

Cells for which there's no information are drawn as translucent, other cells are drawn in a color linearly interpolated between the set unoccupied color (for belief/occupancy = 0) to the set occupied color (belief/occupancy = 1).

The occupancy grid is drawn in object's local XY-plane, which means that any other wanted drawing plane can be achieved by rotating the object appropriately.

Usage example
 // Add an occupancy grid to the scene
 peekabot::OccupancyGrid2DProxy og;
 og.add(client, "root.og", 0.2,
        0.8, 0.8, 0.8,
        0.0, 0.0, 0.0);

 // Set a bunch of cells
 peekabot::OccupancySet2D cells;
 cells.set_cell(7.2, 9.8, 0.5);
 cells.set_cell(7.4, 9.8, 0.4);
 cells.set_cell(7.6, 10.0, 0.55);
 og.set_cells(cells);

Member Function Documentation

DelayedDispatch add ( PeekabotClient client,
const std::string &  path,
float  cell_size,
NameConflictPolicy  conflict_policy = AUTO_ENUMERATE_ON_CONFLICT 
)

Add a 2D occupancy grid to the scene.

Adds a occupancy grid to the scene at the given path and assigns the proxy to point to it. If an object already exists at the given path the outcome is governed by conflict_policy.

Parameters:
path The path where the object will be added, including the name of the object.
cell_size The length of the sides, in meters, of the (square) occupancy grid cells.
conflict_policy Determines how name conflicts are handled.
DelayedDispatch add ( PeekabotClient client,
const std::string &  path,
float  cell_size,
float  unoccupied_r,
float  unoccupied_g,
float  unoccupied_b,
float  occupied_r,
float  occupied_g,
float  occupied_b,
NameConflictPolicy  conflict_policy = AUTO_ENUMERATE_ON_CONFLICT 
)
DelayedDispatch add ( const ObjectProxyBase parent,
const std::string &  name,
float  cell_size,
float  unoccupied_r,
float  unoccupied_g,
float  unoccupied_b,
float  occupied_r,
float  occupied_g,
float  occupied_b,
NameConflictPolicy  conflict_policy = AUTO_ENUMERATE_ON_CONFLICT 
)

Add a 2D occupancy grid to the scene.

Adds a occupancy grid with the given name under the the object referred to by parent and assigns the proxy to point to it. If an object already exists at the given path the outcome is governed by conflict_policy.

Parameters:
parent The parent under which the object will be added.
name The name to assign to the created object.
cell_size The length of the sides, in meters, of the (square) occupancy grid cells.
conflict_policy Determines how name conflicts are handled.
Deprecated:
Deprecated since 0.8.0, use add(const ObjectProxyBase &, const std::string &, float, NameConflictPolicy), set_occupied_color() and set_unoccupied_color() instead.
DelayedDispatch add ( const ObjectProxyBase parent,
const std::string &  name,
float  cell_size,
NameConflictPolicy  conflict_policy = AUTO_ENUMERATE_ON_CONFLICT 
)

Add a 2D occupancy grid to the scene.

Adds a occupancy grid with the given name under the the object referred to by parent and assigns the proxy to point to it. If an object already exists at the given path the outcome is governed by conflict_policy.

Parameters:
parent The parent under which the object will be added.
name The name to assign to the created object.
cell_size The length of the sides, in meters, of the (square) occupancy grid cells.
conflict_policy Determines how name conflicts are handled.
DelayedDispatch assign ( PeekabotClient client,
const std::string &  path 
)

Assign the proxy to the object with the given path.

Parameters:
client The client to use for this proxy.
path The path of the object in the peeakbot scene.
DelayedDispatch assign ( const ObjectProxyBase parent,
const std::string &  rel_path 
)

Assign the proxy to the object with the given parent and name.

Parameters:
parent The parent of the object referred to by name.
rel_path The path of the object, relative the parent object, to assign this proxy to.
DelayedDispatch assign ( const ObjectProxyBase p  ) 

Upcast and assign from another proxy.

If the object pointed to by p is not of compatible type, the assignment will fail and subsequent operations performed on the proxy will fail.


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