opal::GearedMotor Class Reference

#include <GearedMotor.h>

Inheritance diagram for opal::GearedMotor:

opal::Motor List of all members.

Public Member Functions

 GearedMotor ()
virtual ~GearedMotor ()
virtual void OPAL_CALL init (const GearedMotorData &data)
virtual const GearedMotorData
&OPAL_CALL 
getData () const
virtual MotorType OPAL_CALL getType () const
virtual void OPAL_CALL setName (const std::string &name)
virtual const std::string
&OPAL_CALL 
getName () const
virtual bool OPAL_CALL isEnabled () const
virtual void OPAL_CALL setEnabled (bool e)
virtual void OPAL_CALL setMaxTorque (real max)
virtual real OPAL_CALL getMaxTorque () const
virtual void OPAL_CALL setMaxVelocity (real max)
virtual real OPAL_CALL getMaxVelocity () const
virtual void OPAL_CALL setThrottle (real t)
virtual real OPAL_CALL getThrottle () const
virtual void OPAL_CALL internal_update ()
virtual bool OPAL_CALL internal_dependsOnJoint (Joint *j)

Protected Attributes

GearedMotorData mData

Detailed Description

The GearedMotor is intended to simulate an automobile engine. This Motor only works on rotational Joint axes. It applies a torque to one of its degrees of freedom, but the amount of torque decreases linearly as the angular velocity increases, similar to an automobile engine. The Motor's max torque is applied when angular velocity is zero. When the angular velocity reaches the Motor's max velocity, zero torque is applied. Thus, there is always more torque available when the Joint axis is at the lower end of its velocity range.

Definition at line 46 of file GearedMotor.h.


Constructor & Destructor Documentation

opal::GearedMotor::GearedMotor  ) 
 

Definition at line 33 of file GearedMotor.cpp.

opal::GearedMotor::~GearedMotor  )  [virtual]
 

Definition at line 39 of file GearedMotor.cpp.


Member Function Documentation

const GearedMotorData & opal::GearedMotor::getData  )  const [virtual]
 

Returns all data describing the Motor.

Definition at line 59 of file GearedMotor.cpp.

References mData.

real opal::GearedMotor::getMaxTorque  )  const [virtual]
 

Returns the max torque parameter.

Definition at line 118 of file GearedMotor.cpp.

References opal::GearedMotorData::maxTorque, and mData.

real opal::GearedMotor::getMaxVelocity  )  const [virtual]
 

Returns the max velocity parameter.

Definition at line 129 of file GearedMotor.cpp.

References opal::GearedMotorData::maxVelocity, and mData.

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

Returns the Motor's name.

Implements opal::Motor.

Definition at line 74 of file GearedMotor.cpp.

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

real opal::GearedMotor::getThrottle  )  const [virtual]
 

Returns the throttle parameter.

Definition at line 140 of file GearedMotor.cpp.

References mData, and opal::GearedMotorData::throttle.

MotorType opal::GearedMotor::getType  )  const [virtual]
 

Returns the Motor type.

Implements opal::Motor.

Definition at line 64 of file GearedMotor.cpp.

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

void opal::GearedMotor::init const GearedMotorData data  )  [virtual]
 

Initializes the Motor with the given data structure. Joint pointer in the data must be valid.

Definition at line 51 of file GearedMotor.cpp.

References opal::Motor::init(), opal::Joint::isRotational(), opal::GearedMotorData::joint, opal::GearedMotorData::jointAxisNum, and mData.

bool opal::GearedMotor::internal_dependsOnJoint Joint j  )  [virtual]
 

Returns true if this Motor depends on the given Joint.

Reimplemented from opal::Motor.

Definition at line 145 of file GearedMotor.cpp.

References opal::GearedMotorData::joint, and mData.

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

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

Implements opal::Motor.

Definition at line 94 of file GearedMotor.cpp.

References opal::Joint::addTorque(), opal::MotorData::enabled, opal::Joint::getVelocity(), opal::GearedMotorData::joint, opal::GearedMotorData::jointAxisNum, opal::GearedMotorData::maxTorque, opal::GearedMotorData::maxVelocity, mData, and opal::GearedMotorData::throttle.

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

Returns true if the Motor is enabled.

Implements opal::Motor.

Definition at line 79 of file GearedMotor.cpp.

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

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

Sets whether the Motor has any effect.

Implements opal::Motor.

Definition at line 84 of file GearedMotor.cpp.

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

void opal::GearedMotor::setMaxTorque real  max  )  [virtual]
 

Sets the max torque parameter.

Definition at line 113 of file GearedMotor.cpp.

References opal::GearedMotorData::maxTorque, and mData.

void opal::GearedMotor::setMaxVelocity real  max  )  [virtual]
 

Sets the max velocity parameter. The maximum cannot be set to zero.

Definition at line 123 of file GearedMotor.cpp.

References opal::GearedMotorData::maxVelocity, and mData.

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

Sets the Motor's name.

Implements opal::Motor.

Definition at line 69 of file GearedMotor.cpp.

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

void opal::GearedMotor::setThrottle real  t  )  [virtual]
 

Sets the throttle parameter.

Definition at line 134 of file GearedMotor.cpp.

References mData, and opal::GearedMotorData::throttle.


Member Data Documentation

GearedMotorData opal::GearedMotor::mData [protected]
 

Stores data describing the Motor.

Definition at line 102 of file GearedMotor.h.

Referenced by getData(), getMaxTorque(), getMaxVelocity(), getName(), getThrottle(), getType(), init(), internal_dependsOnJoint(), internal_update(), isEnabled(), setEnabled(), setMaxTorque(), setMaxVelocity(), setName(), and setThrottle().


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