TrcAccel Class Reference

#include <TrcAccel.h>

List of all members.

Public Member Functions

 TrcAccel (__in UINT32 slot, __in float period=0.02)
 ~TrcAccel (void)
double GetMetricAccelX (void)
double GetAccelX (void)
double GetMetricAccelY (void)
double GetAccelY (void)
double GetMetricAccelZ (void)
double GetAccelZ (void)
double GetMetricVelX (void)
double GetVelX (void)
double GetMetricVelY (void)
double GetVelY (void)
double GetMetricVelZ (void)
double GetVelZ (void)
double GetMetricDistX (void)
double GetDistX (void)
double GetMetricDistY (void)
double GetDistY (void)
double GetMetricDistZ (void)
double GetDistZ (void)
void Reset (void)
void SetEnabled (__in bool fEnabled)
void CalibrateZeroG (void)

Detailed Description

This class defines and implements the TrcAccel object. The TrcAccel object inherits the ADXL345_I2C accelerometer object from the WPI library. This object periodically sample the accelerometer value for the acceleration value. It also integrates the acceleration value to calculate the velocity and then integrates the velocity to calculate the distance value.


Constructor & Destructor Documentation

TrcAccel::TrcAccel ( __in UINT32  slot,
__in float  period = 0.02 
) [inline]

Constructor: Create an instance of the TrcAccel object. It initializes the object and starts the periodic timer.

Parameters:
slot Specifies the slot of the digital module on which the I2C port is used for the accelerometer.
period Specifies the sampling time for doing calculations. This period is used to integrate acceleration into speed and distance travelled.
TrcAccel::~TrcAccel ( void   )  [inline]

Destructor: Destroy an instance of the TrcAccel object.


Member Function Documentation

void TrcAccel::CalibrateZeroG ( void   )  [inline]

This function is called to calibrate the zero G point. It assumes the accelerometer is sitting still at level ground during the calibration. It samples a number of points on all axes and averages them to be the zero G point for the axes. Note that the Z-axis is not really at zero G when it is still. Z-axis should be 1G at level ground. But for the purpose of measuring relative G's on all axes, we calibrate zero G for all axes.

double TrcAccel::GetAccelX ( void   )  [inline]

This function returns the current acceleration value of the X axis in the unit of feet per second square.

Returns:
Returns the X acceleration value.
double TrcAccel::GetAccelY ( void   )  [inline]

This function returns the current acceleration value of the Y axis in the unit of feet per second square.

Returns:
Returns the Y acceleration value.
double TrcAccel::GetAccelZ ( void   )  [inline]

This function returns the current acceleration value of the Z axis in the unit of feet per second square.

Returns:
Returns the Z acceleration value.
double TrcAccel::GetDistX ( void   )  [inline]

This function returns the current distance value of the X axis in the unit of feet.

Returns:
Returns the X distance value.
double TrcAccel::GetDistY ( void   )  [inline]

This function returns the current distance value of the Y axis in the unit of feet.

Returns:
Returns the Y distance value.
double TrcAccel::GetDistZ ( void   )  [inline]

This function returns the current distance value of the Z axis in the unit of feet.

Returns:
Returns the Z distance value.
double TrcAccel::GetMetricAccelX ( void   )  [inline]

This function returns the current acceleration value of the X axis in the unit of meters per second square.

Returns:
Returns the X acceleration value.
double TrcAccel::GetMetricAccelY ( void   )  [inline]

This function returns the current acceleration value of the Y axis in the unit of meters per second square.

Returns:
Returns the Y acceleration value.
double TrcAccel::GetMetricAccelZ ( void   )  [inline]

This function returns the current acceleration value of the Z axis in the unit of meters per second square.

Returns:
Returns the Z acceleration value.
double TrcAccel::GetMetricDistX ( void   )  [inline]

This function returns the current distance value of the X axis in the unit of meters.

Returns:
Returns the X distance value.
double TrcAccel::GetMetricDistY ( void   )  [inline]

This function returns the current distance value of the Y axis in the unit of meters.

Returns:
Returns the Y distance value.
double TrcAccel::GetMetricDistZ ( void   )  [inline]

This function returns the current distance value of the Z axis in the unit of meters.

Returns:
Returns the Z distance value.
double TrcAccel::GetMetricVelX ( void   )  [inline]

This function returns the current velocity value of the X axis in the unit of meters per second.

Returns:
Returns the X velocity value.
double TrcAccel::GetMetricVelY ( void   )  [inline]

This function returns the current velocity value of the Y axis in the unit of meters per second.

Returns:
Returns the Y velocity value.
double TrcAccel::GetMetricVelZ ( void   )  [inline]

This function returns the current velocity value of the Z axis in the unit of meters per second.

Returns:
Returns the Z velocity value.
double TrcAccel::GetVelX ( void   )  [inline]

This function returns the current velocity value of the X axis in the unit of feet per second.

Returns:
Returns the X velocity value.
double TrcAccel::GetVelY ( void   )  [inline]

This function returns the current velocity value of the Y axis in the unit of feet per second.

Returns:
Returns the Y velocity value.
double TrcAccel::GetVelZ ( void   )  [inline]

This function returns the current velocity value of the Z axis in the unit of feet per second.

Returns:
Returns the Z velocity value.
void TrcAccel::Reset ( void   )  [inline]

This function resets the acceleration, velocity and distance values.

void TrcAccel::SetEnabled ( __in bool  fEnabled  )  [inline]

This function sets the accelerometer to enable or disable state.

Parameters:
fEnabled If true, enables the accelerometer, false otherwise.

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

Generated by  doxygen 1.6.2