estar::FacadeReadInterface Class Reference

#include <FacadeReadInterface.hpp>

Inheritance diagram for estar::FacadeReadInterface:

Inheritance graph
[legend]
List of all members.

Detailed Description

Abstraction of operations that "read" from a Facade.

We split this from "write" operations in order to implement comparing repaired navigation functions with entirely replanned ones. See also class FacadeWriteInterface.


Public Types

enum  node_status_t {
  OUT_OF_GRID, UPWIND, DOWNWIND, WAVEFRONT,
  GOAL, OBSTACLE
}
 Useful for deciding whether a client has to keep propagating. More...

Public Member Functions

virtual ~FacadeReadInterface ()
virtual double GetScale () const=0
 
Returns:
The spacing between grid cells.

virtual double GetFreespaceMeta () const=0
 
Returns:
The kernel-dependent "meta" which is used to represent a cell that lies entirely in freespace, i.e.

virtual double GetObstacleMeta () const=0
 
Returns:
The kernel-dependent "meta" which is used to represent an obstacle cell, i.e.

virtual double GetValue (ssize_t ix, ssize_t iy) const=0
 
Returns:
The navigation function value of a cell, i.e.

virtual double GetMeta (ssize_t ix, ssize_t iy) const=0
 
Returns:
The kernel-dependent "meta" of the cell.

virtual bool IsGoal (ssize_t ix, ssize_t iy) const=0
 
Returns:
true if the cell at index (ix, iy) is a goal cell.

virtual bool HaveWork () const=0
 
Returns:
true if the wavefront is non-empty.

virtual node_status_t GetStatus (ssize_t ix, ssize_t iy) const=0
 Determines the node_status_t of the cell at (ix, iy).
virtual node_status_t GetStatus (vertex_t vertex) const=0
 You don't need a node's coordinates in order to compute it's status.
virtual bool IsValidIndex (ssize_t ix, ssize_t iy) const=0
 
Returns:
true if there is a cell at index (ix, iy).

virtual bool GetLowestInconsistentValue (double &value) const =0
 The "lowest inconsistent value" is the "height" of the cell which would be propagated next.
virtual const AlgorithmGetAlgorithm () const=0
 
Returns:
The underlying Algorithm instance.

virtual const KernelGetKernel () const=0
 
Returns:
The underlying Kernel instance.

virtual int TraceCarrot (double robot_x, double robot_y, double distance, double stepsize, size_t maxsteps, carrot_trace &trace) const=0
 Compute a global path via iterative gradient descent.
virtual boost::shared_ptr<
GridCSpace const > 
GetCSpace () const=0

Protected Member Functions

virtual boost::shared_ptr<
Grid const > 
GetGrid () const=0
 
Note:
this is a hack for legacy code, don't rely on it


Friends

void dump_raw (const FacadeReadInterface &, FILE *, FILE *)
 Similar to eg dump_raw_value(), but writes all values and meta data through a facade instance to two streams (writes sequentially, so things will not get mixed up if you provide the same stream twice).
void dump_queue (const FacadeReadInterface &, size_t, FILE *)
void dump_facade_range_highlight (const FacadeReadInterface &, ssize_t, ssize_t, ssize_t, ssize_t, ssize_t, ssize_t, FILE *)


Member Enumeration Documentation

enum estar::FacadeReadInterface::node_status_t

Useful for deciding whether a client has to keep propagating.

If a cell has status DOWNWIND or WAVEFRONT, its value has not yet been determined and you should keep propagating.

Enumerator:
OUT_OF_GRID  the provided node (index) is outside of the grid
UPWIND  the node is upwind (globally consistent, usable, your best friend)
DOWNWIND  the node is downwind, it's value might change during propagation
WAVEFRONT  the node is on the wavefront, all bets are off
GOAL  the node is in a goal region
OBSTACLE  the node is in an obstacle

Reimplemented in estar::Facade.


Constructor & Destructor Documentation

virtual estar::FacadeReadInterface::~FacadeReadInterface (  )  [inline, virtual]


Member Function Documentation

virtual double estar::FacadeReadInterface::GetScale (  )  const [pure virtual]

Returns:
The spacing between grid cells.

Implemented in estar::Facade.

virtual double estar::FacadeReadInterface::GetFreespaceMeta (  )  const [pure virtual]

Returns:
The kernel-dependent "meta" which is used to represent a cell that lies entirely in freespace, i.e.

it is completely traversable (collision risk is zero).

Implemented in estar::Facade.

virtual double estar::FacadeReadInterface::GetObstacleMeta (  )  const [pure virtual]

Returns:
The kernel-dependent "meta" which is used to represent an obstacle cell, i.e.

it is completely non-traversable (collision risk is one).

Implemented in estar::Facade.

virtual double estar::FacadeReadInterface::GetValue ( ssize_t  ix,
ssize_t  iy 
) const [pure virtual]

Returns:
The navigation function value of a cell, i.e.

its "height" when you consider the navigation function to be a potential.

Implemented in estar::Facade.

virtual double estar::FacadeReadInterface::GetMeta ( ssize_t  ix,
ssize_t  iy 
) const [pure virtual]

Returns:
The kernel-dependent "meta" of the cell.

Use GetFreespaceMeta() and GetObstacleMeta() to determine if the cell is an obstacle, in freespace, or something in between.

Implemented in estar::Facade.

virtual bool estar::FacadeReadInterface::IsGoal ( ssize_t  ix,
ssize_t  iy 
) const [pure virtual]

Returns:
true if the cell at index (ix, iy) is a goal cell.

Implemented in estar::Facade.

virtual bool estar::FacadeReadInterface::HaveWork (  )  const [pure virtual]

Returns:
true if the wavefront is non-empty.

Note:
Depending on the application, it is usually better to use GetStatus() to find out if there is a need to keep propagating.

Implemented in estar::Facade.

virtual node_status_t estar::FacadeReadInterface::GetStatus ( ssize_t  ix,
ssize_t  iy 
) const [pure virtual]

Determines the node_status_t of the cell at (ix, iy).

This can be used to determine whether to call ComputeOne() or not. Typically, the cell (ix, iy) is where the robot is currently at, and you only need to propagate the wavefront further if GetStatus returns WAVEFRONT or DOWNWIND.

Note:
If you don't know the indices of a node, use GetStatus(vertex_t).

Implemented in estar::Facade.

virtual node_status_t estar::FacadeReadInterface::GetStatus ( vertex_t  vertex  )  const [pure virtual]

You don't need a node's coordinates in order to compute it's status.

Just call this variant of GetStatus(ssize_t, ssize_t) instead.

Implemented in estar::Facade.

virtual bool estar::FacadeReadInterface::IsValidIndex ( ssize_t  ix,
ssize_t  iy 
) const [pure virtual]

Returns:
true if there is a cell at index (ix, iy).

Implemented in estar::Facade.

virtual bool estar::FacadeReadInterface::GetLowestInconsistentValue ( double &  value  )  const [pure virtual]

The "lowest inconsistent value" is the "height" of the cell which would be propagated next.

This value is needed if you want to figure out, for example, if a given cell is in the region of knownstabilized navigation function or not. However, due to replanning, a cell with a value higher than GetLowestInconsistentValue() can already be at its "stable" height. It will only change if the cell lies in the shadow of one of the changes that triggered the current replanning.

Returns:
false only if the queue is empty (all nodes are already locally consistent).

Implemented in estar::Facade.

virtual const Algorithm& estar::FacadeReadInterface::GetAlgorithm (  )  const [pure virtual]

Returns:
The underlying Algorithm instance.

Implemented in estar::Facade.

virtual boost::shared_ptr<Grid const> estar::FacadeReadInterface::GetGrid (  )  const [protected, pure virtual]

Note:
this is a hack for legacy code, don't rely on it

Implemented in estar::Facade.

virtual const Kernel& estar::FacadeReadInterface::GetKernel (  )  const [pure virtual]

Returns:
The underlying Kernel instance.

Implemented in estar::Facade.

virtual int estar::FacadeReadInterface::TraceCarrot ( double  robot_x,
double  robot_y,
double  distance,
double  stepsize,
size_t  maxsteps,
carrot_trace trace 
) const [pure virtual]

Compute a global path via iterative gradient descent.

Start at the position (robot_x, robot_y) and repeatedly move stepsize along the gradient of the E* navigation function. The trace stops if one of the following conditions is met: The curvilinear distance reached the parameter distance, the number of iterations has reached maxsteps, or the trace has reached a goal location.

Note:
The trace is computed in the grid frame of reference. The trace is cleared prior to filling it.
Returns:
0 on success
1 if distance wasn't reached after maxstep iterations
-1 if the robot is outside the grid
-2 if the grid is a hexgrid (not implemented yet)
other negative numbers would represent errors that were not yet defined at the time when this documentation was written... look at the implementation in Facade::TraceCarrot().
Todo:
URGENT: Need ridge detection (and avoidance) to avoid going straight toward obstacle in case the robot is on the ridge where two wavefronts meet after they swept around an obstacle. In such a case, one direction should be chosen at "random"!

Implemented in estar::Facade.

virtual boost::shared_ptr<GridCSpace const> estar::FacadeReadInterface::GetCSpace (  )  const [pure virtual]

Implemented in estar::Facade.


Friends And Related Function Documentation

void dump_raw ( const FacadeReadInterface ,
FILE *  ,
FILE *   
) [friend]

Similar to eg dump_raw_value(), but writes all values and meta data through a facade instance to two streams (writes sequentially, so things will not get mixed up if you provide the same stream twice).

Set a stream to NULL if you're not interested in that part of the dump. Uses -1 as infinity_replacement for dump_raw_value().

void dump_queue ( const FacadeReadInterface facade,
size_t  limit,
FILE *  stream 
) [friend]

void dump_facade_range_highlight ( const FacadeReadInterface facade,
ssize_t  ix0,
ssize_t  iy0,
ssize_t  ix1,
ssize_t  iy1,
ssize_t  ixhigh,
ssize_t  iyhigh,
FILE *  stream 
) [friend]


The documentation for this class was generated from the following file:
doxygen SourceForge.net Logo
E* Interpolated Graph Replanner Wed Dec 12 18:55:50 2007