opal::ServoMotor Class Reference

#include <ServoMotor.h>

Inheritance diagram for opal::ServoMotor:

opal::Motor List of all members.

Public Member Functions

 ServoMotor ()
virtual ~ServoMotor ()
virtual void OPAL_CALL init (const ServoMotorData &data)
virtual const ServoMotorData
&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 setDesiredAngle (real a)
virtual void OPAL_CALL setDesiredAngleNorm (real a)
virtual real OPAL_CALL getDesiredAngle () const
virtual void OPAL_CALL setDesiredVel (real vel)
virtual real OPAL_CALL getDesiredVel () const
virtual void OPAL_CALL setMaxTorque (real max)
virtual real OPAL_CALL getMaxTorque () const
virtual void OPAL_CALL setRestoreSpeed (real speed)
virtual real OPAL_CALL getRestoreSpeed () const
virtual void OPAL_CALL internal_update ()
virtual bool OPAL_CALL internal_dependsOnJoint (Joint *j)

Protected Attributes

ServoMotorData mData

Detailed Description

This is a Motor with an internal feedback loop, allowing precise positioning control with minimal overshooting. This Motor only works on rotational Joint axes. It controls a single Joint axis. Depending on the desired mode of operation, it tries to achieve a desired angle or angular velocity using up to a limited maximum force.

Definition at line 44 of file ServoMotor.h.


Constructor & Destructor Documentation

opal::ServoMotor::ServoMotor  ) 
 

Definition at line 32 of file ServoMotor.cpp.

opal::ServoMotor::~ServoMotor  )  [virtual]
 

Definition at line 38 of file ServoMotor.cpp.

References opal::MotorData::enabled, opal::Joint::internal_setDesiredVel(), opal::Joint::internal_setMaxTorque(), opal::ServoMotorData::joint, opal::ServoMotorData::jointAxisNum, and mData.


Member Function Documentation

const ServoMotorData & opal::ServoMotor::getData  )  const [virtual]
 

Returns all data describing the Motor.

Definition at line 70 of file ServoMotor.cpp.

References mData.

real opal::ServoMotor::getDesiredAngle  )  const [virtual]
 

Gets the desired angle, a value between the Joint axis' limits.

Definition at line 196 of file ServoMotor.cpp.

References opal::ServoMotorData::desiredAngle, and mData.

real opal::ServoMotor::getDesiredVel  )  const [virtual]
 

Returns the desired velocity.

Definition at line 207 of file ServoMotor.cpp.

References opal::ServoMotorData::desiredVel, and mData.

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

Returns the maximum amount of torque this Motor can use.

Definition at line 218 of file ServoMotor.cpp.

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

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

Returns the Motor's name.

Implements opal::Motor.

Definition at line 85 of file ServoMotor.cpp.

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

real opal::ServoMotor::getRestoreSpeed  )  const [virtual]
 

Returns the restore speed.

Definition at line 228 of file ServoMotor.cpp.

References mData, and opal::ServoMotorData::restoreSpeed.

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

Returns the Motor type.

Implements opal::Motor.

Definition at line 75 of file ServoMotor.cpp.

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

void opal::ServoMotor::init const ServoMotorData data  )  [virtual]
 

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

Definition at line 50 of file ServoMotor.cpp.

References opal::Joint::getNumAxes(), opal::Motor::init(), opal::Joint::isRotational(), opal::ServoMotorData::joint, opal::ServoMotorData::jointAxisNum, mData, opal::Motor::mInitCalled, and setEnabled().

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

Returns true if this Motor depends on the given Joint.

Reimplemented from opal::Motor.

Definition at line 233 of file ServoMotor.cpp.

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

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

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

Implements opal::Motor.

Definition at line 121 of file ServoMotor.cpp.

References opal::DESIRED_ANGLE_MODE, opal::ServoMotorData::desiredAngle, opal::MotorData::enabled, opal::Joint::getAngle(), opal::Joint::internal_setDesiredVel(), opal::ServoMotorData::joint, opal::ServoMotorData::jointAxisNum, mData, opal::ServoMotorData::mode, opal::ServoMotorData::restoreSpeed, and opal::Joint::wakeSolids().

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

Returns true if the Motor is enabled.

Implements opal::Motor.

Definition at line 90 of file ServoMotor.cpp.

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

void opal::ServoMotor::setDesiredAngle real  a  )  [virtual]
 

Sets the desired angle to a value between the Joint axis' limits. Clamps given angle into allowed range for the joint.

Definition at line 159 of file ServoMotor.cpp.

References opal::ServoMotorData::desiredAngle, opal::Joint::getHighLimit(), opal::Joint::getLowLimit(), opal::ServoMotorData::joint, opal::ServoMotorData::jointAxisNum, and mData.

void opal::ServoMotor::setDesiredAngleNorm real  a  )  [virtual]
 

Sets the desired angle to a value between 0.0 and 1.0 which will be mapped to the Joint axis' limits. Clamps given angle into [0,1] range.

Definition at line 177 of file ServoMotor.cpp.

References opal::ServoMotorData::desiredAngle, opal::Joint::getHighLimit(), opal::Joint::getLowLimit(), opal::defaults::joint::highLimit, opal::ServoMotorData::joint, opal::ServoMotorData::jointAxisNum, opal::defaults::joint::lowLimit, and mData.

void opal::ServoMotor::setDesiredVel real  vel  )  [virtual]
 

Sets the desired velocity.

Definition at line 201 of file ServoMotor.cpp.

References opal::ServoMotorData::desiredVel, opal::Joint::internal_setDesiredVel(), opal::ServoMotorData::joint, opal::ServoMotorData::jointAxisNum, and mData.

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

Sets whether the Motor has any effect.

Implements opal::Motor.

Definition at line 95 of file ServoMotor.cpp.

References opal::ServoMotorData::desiredVel, opal::MotorData::enabled, opal::Joint::internal_setDesiredVel(), opal::Joint::internal_setMaxTorque(), opal::ServoMotorData::joint, opal::ServoMotorData::jointAxisNum, opal::ServoMotorData::maxTorque, and mData.

Referenced by init().

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

Sets the maximum amount of torque this Motor can use.

Definition at line 212 of file ServoMotor.cpp.

References opal::Joint::internal_setMaxTorque(), opal::ServoMotorData::joint, opal::ServoMotorData::jointAxisNum, opal::ServoMotorData::maxTorque, and mData.

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

Sets the Motor's name.

Implements opal::Motor.

Definition at line 80 of file ServoMotor.cpp.

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

void opal::ServoMotor::setRestoreSpeed real  speed  )  [virtual]
 

Sets the restore speed, the parameter used to scale how fast the Motor will achieve its desired position. Only used in the desired position mode.

Definition at line 223 of file ServoMotor.cpp.

References mData, and opal::ServoMotorData::restoreSpeed.


Member Data Documentation

ServoMotorData opal::ServoMotor::mData [protected]
 

Stores data describing the Motor.

Definition at line 113 of file ServoMotor.h.

Referenced by getData(), getDesiredAngle(), getDesiredVel(), getMaxTorque(), getName(), getRestoreSpeed(), getType(), init(), internal_dependsOnJoint(), internal_update(), isEnabled(), setDesiredAngle(), setDesiredAngleNorm(), setDesiredVel(), setEnabled(), setMaxTorque(), setName(), setRestoreSpeed(), and ~ServoMotor().


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