opal::AccelerationSensor Class Reference

#include <AccelerationSensor.h>

Inheritance diagram for opal::AccelerationSensor:

opal::Sensor List of all members.

Public Member Functions

 AccelerationSensor (Simulator *s)
virtual ~AccelerationSensor ()
virtual void OPAL_CALL init (const AccelerationSensorData &data)
virtual const AccelerationSensorData
&OPAL_CALL 
getData () const
virtual Vec3r OPAL_CALL getGlobalLinearAccel () const
virtual Vec3r OPAL_CALL getGlobalAngularAccel () const
virtual Vec3r OPAL_CALL getLocalLinearAccel () const
virtual Vec3r OPAL_CALL getLocalAngularAccel () const
virtual void OPAL_CALL setEnabled (bool e)
virtual bool OPAL_CALL isEnabled () const
virtual void OPAL_CALL setTransform (const Matrix44r &t)
virtual const Matrix44r &OPAL_CALL getTransform () const
virtual SensorType OPAL_CALL getType () const
virtual void OPAL_CALL setName (const std::string &name)
virtual const std::string
&OPAL_CALL 
getName () const
virtual void OPAL_CALL internal_update ()
virtual bool OPAL_CALL internal_dependsOnSolid (Solid *s)

Protected Attributes

AccelerationSensorData mData
SimulatormSim
Vec3r mCurrentGlobalLinearVel
Vec3r mCurrentGlobalAngularVel
Vec3r mCurrentLocalLinearVel
Vec3r mCurrentLocalAngularVel
Vec3r mPrevGlobalLinearVel
Vec3r mPrevGlobalAngularVel
Vec3r mPrevLocalLinearVel
Vec3r mPrevLocalAngularVel

Detailed Description

A Sensor that monitors the linear and angular acceleration of a Solid. Using its transform, it can be set to a desired offset from the attached Solid. This Sensor does nothing if it is not attached to a Solid (i.e. its returned values are always zero).

Definition at line 43 of file AccelerationSensor.h.


Constructor & Destructor Documentation

opal::AccelerationSensor::AccelerationSensor Simulator s  ) 
 

Definition at line 33 of file AccelerationSensor.cpp.

References mSim.

opal::AccelerationSensor::~AccelerationSensor  )  [virtual]
 

Definition at line 49 of file AccelerationSensor.cpp.


Member Function Documentation

const AccelerationSensorData & opal::AccelerationSensor::getData  )  const [virtual]
 

Returns all data describing the Sensor.

Definition at line 59 of file AccelerationSensor.cpp.

References mData.

Vec3r opal::AccelerationSensor::getGlobalAngularAccel  )  const [virtual]
 

Returns the Sensor's global angular acceleration. If the Sensor is not attached to a Solid, this returns (0, 0, 0).

Definition at line 75 of file AccelerationSensor.cpp.

References opal::SensorData::enabled, opal::Simulator::getStepSize(), mCurrentGlobalAngularVel, mData, mPrevGlobalAngularVel, mSim, and opal::SensorData::solid.

Vec3r opal::AccelerationSensor::getGlobalLinearAccel  )  const [virtual]
 

Returns the Sensor's global linear acceleration. If the Sensor is not attached to a Solid, this returns (0, 0, 0).

Definition at line 64 of file AccelerationSensor.cpp.

References opal::SensorData::enabled, opal::Simulator::getStepSize(), mCurrentGlobalLinearVel, mData, mPrevGlobalLinearVel, mSim, and opal::SensorData::solid.

Vec3r opal::AccelerationSensor::getLocalAngularAccel  )  const [virtual]
 

Returns the Sensor's local angular acceleration. If the Sensor is not attached to a Solid, this returns (0, 0, 0).

Definition at line 97 of file AccelerationSensor.cpp.

References opal::SensorData::enabled, opal::Simulator::getStepSize(), mCurrentLocalAngularVel, mData, mPrevLocalAngularVel, mSim, and opal::SensorData::solid.

Vec3r opal::AccelerationSensor::getLocalLinearAccel  )  const [virtual]
 

Returns the Sensor's local linear acceleration. If the Sensor is not attached to a Solid, this returns (0, 0, 0).

Definition at line 86 of file AccelerationSensor.cpp.

References opal::SensorData::enabled, opal::Simulator::getStepSize(), mCurrentLocalLinearVel, mData, mPrevLocalLinearVel, mSim, and opal::SensorData::solid.

const std::string & opal::AccelerationSensor::getName  )  const [virtual]
 

Returns the Sensor's name.

Implements opal::Sensor.

Definition at line 143 of file AccelerationSensor.cpp.

References mData, and opal::SensorData::name.

const Matrix44r & opal::AccelerationSensor::getTransform  )  const [virtual]
 

Returns the Sensor's transform.

Implements opal::Sensor.

Definition at line 133 of file AccelerationSensor.cpp.

References mData, and opal::SensorData::transform.

SensorType opal::AccelerationSensor::getType  )  const [virtual]
 

Returns the Sensor type.

Implements opal::Sensor.

Definition at line 123 of file AccelerationSensor.cpp.

References opal::SensorData::getType(), and mData.

void opal::AccelerationSensor::init const AccelerationSensorData data  )  [virtual]
 

Initializes the Sensor with the given data structure. The Solid pointer should always be valid because this Sensor only works when attached to something.

Definition at line 53 of file AccelerationSensor.cpp.

References opal::Sensor::init(), and mData.

bool opal::AccelerationSensor::internal_dependsOnSolid Solid s  )  [virtual]
 

Returns true if this Sensor depends on the given Solid.

Reimplemented from opal::Sensor.

Definition at line 168 of file AccelerationSensor.cpp.

References mData, and opal::SensorData::solid.

void opal::AccelerationSensor::internal_update  )  [virtual]
 

Called regularly to update the Sensor. This does nothing if the Sensor is disabled.

Implements opal::Sensor.

Definition at line 148 of file AccelerationSensor.cpp.

References opal::SensorData::enabled, opal::Solid::getGlobalAngularVel(), opal::Solid::getGlobalLinearVel(), opal::Solid::getLocalAngularVel(), opal::Solid::getLocalLinearVel(), mCurrentGlobalAngularVel, mCurrentGlobalLinearVel, mCurrentLocalAngularVel, mCurrentLocalLinearVel, mData, mPrevGlobalAngularVel, mPrevGlobalLinearVel, mPrevLocalAngularVel, mPrevLocalLinearVel, and opal::SensorData::solid.

bool opal::AccelerationSensor::isEnabled  )  const [virtual]
 

Returns true if the Sensor is enabled.

Implements opal::Sensor.

Definition at line 118 of file AccelerationSensor.cpp.

References opal::SensorData::enabled, and mData.

void opal::AccelerationSensor::setEnabled bool  e  )  [virtual]
 

Sets whether the Sensor can update its measurements.

Implements opal::Sensor.

Definition at line 108 of file AccelerationSensor.cpp.

References opal::SensorData::enabled, and mData.

void opal::AccelerationSensor::setName const std::string &  name  )  [virtual]
 

Sets the Sensor's name.

Implements opal::Sensor.

Definition at line 138 of file AccelerationSensor.cpp.

References mData, and opal::SensorData::name.

void opal::AccelerationSensor::setTransform const Matrix44r t  )  [virtual]
 

Sets the Sensor's transform.

Implements opal::Sensor.

Definition at line 128 of file AccelerationSensor.cpp.

References mData, and opal::SensorData::transform.


Member Data Documentation

Vec3r opal::AccelerationSensor::mCurrentGlobalAngularVel [protected]
 

Stored copy of the current step's velocity data; used for acceleration calculations.

Definition at line 106 of file AccelerationSensor.h.

Referenced by getGlobalAngularAccel(), and internal_update().

Vec3r opal::AccelerationSensor::mCurrentGlobalLinearVel [protected]
 

Stored copy of the current step's velocity data; used for acceleration calculations.

Definition at line 102 of file AccelerationSensor.h.

Referenced by getGlobalLinearAccel(), and internal_update().

Vec3r opal::AccelerationSensor::mCurrentLocalAngularVel [protected]
 

Stored copy of the current step's velocity data; used for acceleration calculations.

Definition at line 114 of file AccelerationSensor.h.

Referenced by getLocalAngularAccel(), and internal_update().

Vec3r opal::AccelerationSensor::mCurrentLocalLinearVel [protected]
 

Stored copy of the current step's velocity data; used for acceleration calculations.

Definition at line 110 of file AccelerationSensor.h.

Referenced by getLocalLinearAccel(), and internal_update().

AccelerationSensorData opal::AccelerationSensor::mData [protected]
 

Stores data describing the Sensor.

Definition at line 94 of file AccelerationSensor.h.

Referenced by getData(), getGlobalAngularAccel(), getGlobalLinearAccel(), getLocalAngularAccel(), getLocalLinearAccel(), getName(), getTransform(), getType(), init(), internal_dependsOnSolid(), internal_update(), isEnabled(), setEnabled(), setName(), and setTransform().

Vec3r opal::AccelerationSensor::mPrevGlobalAngularVel [protected]
 

Stored copy of the previous step's velocity data; used for acceleration calculations.

Definition at line 122 of file AccelerationSensor.h.

Referenced by getGlobalAngularAccel(), and internal_update().

Vec3r opal::AccelerationSensor::mPrevGlobalLinearVel [protected]
 

Stored copy of the previous step's velocity data; used for acceleration calculations.

Definition at line 118 of file AccelerationSensor.h.

Referenced by getGlobalLinearAccel(), and internal_update().

Vec3r opal::AccelerationSensor::mPrevLocalAngularVel [protected]
 

Stored copy of the previous step's velocity data; used for acceleration calculations.

Definition at line 130 of file AccelerationSensor.h.

Referenced by getLocalAngularAccel(), and internal_update().

Vec3r opal::AccelerationSensor::mPrevLocalLinearVel [protected]
 

Stored copy of the previous step's velocity data; used for acceleration calculations.

Definition at line 126 of file AccelerationSensor.h.

Referenced by getLocalLinearAccel(), and internal_update().

Simulator* opal::AccelerationSensor::mSim [protected]
 

Pointer to the Simulator containing this Sensor. This is used to get an accurate dt value on every update.

Definition at line 98 of file AccelerationSensor.h.

Referenced by AccelerationSensor(), getGlobalAngularAccel(), getGlobalLinearAccel(), getLocalAngularAccel(), and getLocalLinearAccel().


The documentation for this class was generated from the following files:
Generated on Tue May 16 17:49:55 2006 for OPAL by  doxygen 1.4.6-NO