lobot::DangerZone Class Reference

An object for monitoring the robot's danger zone. More...

#include <Robots/LoBot/io/LoDangerZone.H>

Collaboration diagram for lobot::DangerZone:
Collaboration graph
[legend]

List of all members.

Classes

class  Block

Public Member Functions

 ~DangerZone ()
 Clean-up.

Static Public Member Functions

static int num_blocks ()
 How many blocks does the danger zone have?
static float max ()
static void use (const LaserRangeFinder *lrf)
static void update ()
static bool penetrated ()
static const LRFDatalrf_data ()

static Blocks::const_iterator begin ()
static Blocks::const_iterator end ()

Friends

class singleton< DangerZone >



typedef std::vector< BlockBlocks
 The Robolocust danger zone consists of several blocks.

Detailed Description

An object for monitoring the robot's danger zone.

This class provides an API for keeping track of the robot's danger zone. The Robolocust danger zone works by dividing the laser range finder's FOV into several angular blocks. Each block has three fundamental settings:

The extents define the block's angular range. A blocks's distance setting specifies the minimum distance between the robot and obstacles. A block's threshold setting specifies the minimum number of LRF distance measurements that must be less than its distance setting for the block to be actually considered as being "penetrated" or "active."

For example, let us say we have a danger zone block with extents [-30, 30], distance 350 and threshold 20. This means that when we have >= 20 LRF readings that are <= 350mm in the angular range -30 degrees to +30 degrees, an obstacle has penetrated this particular portion of the robot's danger zone and, thus, activated this block.

The danger zone settings are specified in the Robolocust config file.

The main thread is supposed to update the danger zone object after calling the laser range finder object's update() method.

Other threads, viz., the behaviours that need to monitor the danger zone, may use the lobot::DangerZone state access APIs to ascertain the current conditions of the danger zone and take appropriate action.

As it does for updating other objects, the main thread must use lobot::UpdateLock's write lock when updating the danger zone. Other threads must use lobot::UpdateLock's read lock when accessing the danger zone's current state.

Definition at line 111 of file LoDangerZone.H.


Member Typedef Documentation

The Robolocust danger zone consists of several blocks.

Definition at line 223 of file LoDangerZone.H.


Constructor & Destructor Documentation

lobot::DangerZone::~DangerZone (  ) 

Clean-up.

Definition at line 204 of file LoDangerZone.C.


Member Function Documentation

static Blocks::const_iterator lobot::DangerZone::begin (  )  [inline, static]

Iterators for walking through the list of danger zone blocks.

NOTE: Client should use lobot::UpdateLock's read lock when calling thess functions.

Definition at line 278 of file LoDangerZone.H.

static const LRFData& lobot::DangerZone::lrf_data (  )  [inline, static]

Retrieving the LRF measurements snapshot corresponding to the current danger zone state.

NOTE: Client should use lobot::UpdateLock's read lock when calling this function.

Definition at line 287 of file LoDangerZone.H.

static int lobot::DangerZone::num_blocks (  )  [inline, static]

How many blocks does the danger zone have?

Definition at line 230 of file LoDangerZone.H.

bool lobot::DangerZone::penetrated (  )  [static]

A convenience function to check if any block in the danger zone has been penetrated or not.

NOTE: Client should use lobot::UpdateLock's read lock when calling this function.

Definition at line 192 of file LoDangerZone.C.

void lobot::DangerZone::update (  )  [static]

This method updates the danger zone using the current laser range finder measurements. It is meant to be called only by the main thread, which should use lobot::UpdateLock's write lock when calling this function.

Definition at line 180 of file LoDangerZone.C.

Referenced by lobot::App::run().


The documentation for this class was generated from the following files:
Generated on Sun May 8 08:30:32 2011 for iLab Neuromorphic Vision Toolkit by  doxygen 1.6.3