Main Page | Modules | Namespace List | Class Hierarchy | Class List | Directories | File List | Class Members | File Members | Related Pages

VehPoseSource Class Reference
[Reconfigurable Interface Example: VehPose]

The VehPoseSource interface example. More...

#include <VehPoseSource.h>

Inheritance diagram for VehPoseSource:

Inheritance graph
[legend]
List of all members.

Public Member Functions

virtual ~VehPoseSource ()
 Empty virtual destructor for VehPoseSource.
virtual bool getPose (utils::Time time, VehPose &pose)=0
 Get the vehicle pose at a given time.
virtual bool getCurPose (utils::Time &time, VehPose &pose, bool blocking=0)
 Get the current vehicle pose.

Static Public Member Functions

static void interpolate (const VehPose &prev_pose, const VehPose &next_pose, double t, VehPose &sensor_pose)
 Convenience routine for interpolating between and extrapolating sensor poses.
static const char * intfName ()
 Get the interface name.
static VehPoseSource * create (const char *spec, utils::SymbolTable *globals=(0L))
 Create interface from string if not in symbol table already, put in symbol table afterwards under intfName()+Intf.
static VehPoseSource * create (utils::ConfigFile &params, utils::SymbolTable *globals=(0L))
 Create interface from file if not in symbol table already, put in symbol table afterwards under intfName().
static VehPoseSource * interface (const char *spec, utils::SymbolTable *globals=(0L))
 Create interface from string if not in symbol table already.
static VehPoseSource * interface (utils::ConfigFile &params, utils::SymbolTable *globals=(0L))
 Create interface from params if not in symbol table already.
static VehPoseSource * generate (const char *spec, utils::SymbolTable *globals=(0L))
 Create interface from string.
static VehPoseSource * generate (utils::ConfigFile &params, utils::SymbolTable *globals=(0L))
 Create interface from a parameter file.
static VehPoseSourceGenerator * generator (utils::SymbolTable *globals)
 Get the interface generator.
static VehPoseSource * getIntf (utils::SymbolTable *globals)
 Get the last result of create.
static void clear (utils::SymbolTable *globals)
 Clear the interface out of the symbol table.

Detailed Description

The VehPoseSource interface example.

An abstract interface to 3D road information given by an STL vector of 3D points

Definition at line 22 of file VehPoseSource.h.


Constructor & Destructor Documentation

virtual VehPoseSource::~VehPoseSource (   )  [inline, virtual]
 

Empty virtual destructor for VehPoseSource.

For C++ syntax reasons, it is a good idea to explicitly define a virtual destructor, even if empty like this one, to any abstract class like this.

Definition at line 28 of file VehPoseSource.h.


Member Function Documentation

bool VehPoseSource::getCurPose (  utils::Time &  time,
VehPose &  pose,
bool  blocking = 0
)  [virtual]
 

Get the current vehicle pose.

Returns the latest vehicle pose along with the time at which it was collected. The call can be blocking, i.e., we block until the next unread vehicle pose is acquired, but it is usually polling, i.e., it returns immediately with the most recent vehicle pose

Parameters:
[out] time The time at which the road information was collected. (0 if the road is invalid)
[out] pose The vehicle pose
[in] blocking If true, then the call is blocking, if false, it is polling.
Returns:
true if "new" data has been acquired successfully, false on an invalid read or if no new road data has been acquired since the last read. Note an invalid read can be verified by checking to see if time.isZero() is true.

Reimplemented in OutputVehPoseSource, PlayerVehPoseSource, and ShmemVehPoseSource.

Definition at line 10 of file VehPoseSource.cc.

References getPose().

Referenced by OutputVehPoseSource::getCurPose().

virtual bool VehPoseSource::getPose (  utils::Time  time,
VehPose &  pose
)  [pure virtual]
 

Get the vehicle pose at a given time.

Returns the vehicle pose at the given time. The implementation will attempt to interpolate or extrapolate from known poses to get the pose at the desired time.

Parameters:
[in] time The time for which to get the vehicle pose.
[out] pose The resulting vehicle pose
Returns:
true if the routine was able to obtain a vehicle pose at the desired time, false if not.

Implemented in FakeVehPoseSource, OutputVehPoseSource, PlayerVehPoseSource, and ShmemVehPoseSource.

Referenced by getCurPose(), and OutputVehPoseSource::getPose().

void VehPoseSource::interpolate (  const VehPose &  prev_pose,
const VehPose &  next_pose,
double  t,
VehPose &  sensor_pose
)  [static]
 

Convenience routine for interpolating between and extrapolating sensor poses.

Takes prev_pose and next_pose, and then interpolation factor t, where t=0 means prev_pose and t=1 means next_pose, and puts interpolated result in sensor_pose. If t > 1, then we do an extrapolation.

Parameters:
[in] prev_pose The beginning pose
[in] next_pose The end pose
[in] t The distance between the beginning and end pose to interpolate, with 0 being the beginning and 1 being the end
[out] sensor_pose The interpolated pose

Definition at line 16 of file VehPoseSource.cc.

References VehPose::ori, and VehPose::pos.

Referenced by VehPosePlayer::getPose(), and ShmemVehPoseSource::interpolate().


The documentation for this class was generated from the following files:
Generated on Fri Jun 16 13:21:26 2006 for ModUtils by  doxygen 1.4.4