OpenSim::Coordinate Class Reference

A class implementing a Simbody generalized coordinate. More...

#include <Coordinate.h>

Inheritance diagram for OpenSim::Coordinate:
OpenSim::Object

List of all members.

Public Types

enum  MotionType { Rotational, Translational, Coupled }
 

Motion type that is described by the coordinate.

More...

Public Member Functions

 Coordinate ()
 Default constructor.
 Coordinate (const std::string &aName, MotionType aMotionType, double aRangeMin, double aRangeMax)
 Constructor.
 Coordinate (const Coordinate &aCoordinate)
 Copy constructor.
virtual ~Coordinate ()
 Destructor.
virtual Objectcopy () const
 Copy this coordinate and return a pointer to the copy.
Coordinateoperator= (const Coordinate &aCoordinate)
 Assignment operator.
void copyData (const Coordinate &aCoordinate)
 Copy data members from one Coordinate to another.
virtual void setup (Model &aModel)
 Perform some set up functions that happen after the object has been deserialized or copied.
void initState (SimTK::State &s) const
void setDefaultsFromState (const SimTK::State &state)
virtual void setJoint (const Joint &aOwningJoint)
 Set the joint to which this coordinate belongs.
virtual const JointgetJoint () const
 Get the joint to which this coordinate belongs.
ModelgetModel () const
virtual void updateFromCoordinate (const Coordinate &aCoordinate)
 Update an existing coordinate with parameter values from a new one, but only for the parameters that were explicitly specified in the XML node.
virtual double getValue (const SimTK::State &s) const
 Get the value.
virtual bool setValue (SimTK::State &s, double aValue, bool aEnforceContraints=true) const
 Set the value.
virtual double getSpeedValue (const SimTK::State &s) const
virtual bool setSpeedValue (SimTK::State &s, double aValue) const
const std::string getSpeedName () const
virtual double getAccelerationValue (const SimTK::State &s) const
virtual bool getValueUseDefault () const
virtual void getRange (double rRange[2]) const
virtual bool setRange (double aRange[2])
 Set the range min and max.
virtual double getRangeMin () const
virtual double getRangeMax () const
virtual bool setRangeMin (double aMin)
 Set the range min.
virtual bool setRangeMax (double aMax)
 Set the range max.
virtual bool getRangeUseDefault () const
virtual double getDefaultValue () const
virtual bool setDefaultValue (double aDefaultValue)
 Set the default value.
double getDefaultSpeedValue () const
void setDefaultSpeedValue (double aDefaultSpeedValue)
virtual double getInitialValue () const
virtual void setInitialValue (double aInitialValue)
 Set the initial value.
virtual bool getDefaultValueUseDefault () const
virtual bool getClamped (const SimTK::State &s) const
 Get whether or not this coordinate is clamped.
virtual bool setClamped (SimTK::State &s, bool aClamped) const
virtual bool getDefaultClamped () const
virtual void setDefaultClamped (bool aClamped)
virtual bool getClampedUseDefault () const
virtual bool getLocked (const SimTK::State &s) const
 Get whether or not this coordinate is locked.
virtual bool setLocked (SimTK::State &s, bool aLocked) const
 Set whether or not this coordinate is locked.
virtual bool getDefaultLocked () const
virtual void setDefaultLocked (bool aLocked)
virtual bool getLockedUseDefault () const
virtual bool isPrescribed (const SimTK::State &s) const
void setIsPrescribed (SimTK::State &s, bool isPrescribed) const
 Set whether or not this coordinate is being prescribed.
virtual bool getDefaultIsPrescribed () const
void setDefaultIsPrescribed (bool isPrescribed)
void setPrescribedFunction (const Function &function)
 Set the prescribed motion function.
virtual OpenSim::FunctiongetPrescribedFunction () const
 Get the prescribed motion function.
virtual MotionType getMotionType () const
virtual void setMotionType (MotionType aMotionType)
 Set coordinate's motion type.
virtual bool isConstrained () const
 Determine if the the coordinate is constrained or not.
int getMobilityIndex () const
SimTK::MobilizedBodyIndex getBodyIndex () const
 OPENSIM_DECLARE_DERIVED (Coordinate, Object)

Protected Attributes

PropertyStr _motionTypeNameProp
std::string & _motionTypeName
PropertyDbl _defaultValueProp
double & _defaultValue
PropertyDbl _defaultSpeedValueProp
double & _defaultSpeedValue
PropertyDbl _initialValueProp
double & _initialValue
PropertyDblArray _rangeProp
Array< double > & _range
PropertyBool _clampedProp
 Flag indicating whether the coordinate is clamped or not.
bool & _clamped
PropertyBool _lockedProp
 Flag indicating whether the coordinate is locked or not.
bool & _locked
SimTK::Function * _lockFunction
PropertyBool _isPrescribedProp
 Flag indicating whether the coordinate is prescribed or not.
bool & _isPrescribed
PropertyObjPtr< OpenSim::Function_prescribedFunctionProp
 Specify the desired prescribed motion as a function of time.
OpenSim::Function *& _prescribedFunction
SimTK::MobilizedBodyIndex _bodyIndex
 ID of the body which this coordinate serves.
int _mobilityIndex
 Mobility index for this coordinate.
MotionType _motionType
 Motion type (translational, rotational or combination).
Joint const * _joint
 Simbody joint that owns this coordinate.
Model_model
 OpenSim model that contains this coordintate.

Friends

class Constraint
class CoordinateCouplerConstraint
class Joint
class Model

Detailed Description

A class implementing a Simbody generalized coordinate.

Author:
Frank C. Anderson, Ajay Seth, Jeffrey A. Reinbolt
Version:
1.0

Member Enumeration Documentation

Motion type that is described by the coordinate.

Enumerator:
Rotational 
Translational 
Coupled 

Constructor & Destructor Documentation

Coordinate::Coordinate (  ) 

Default constructor.

Coordinate::Coordinate ( const std::string &  aName,
MotionType  aMotionType,
double  aRangeMin,
double  aRangeMax 
)

Constructor.

Coordinate::Coordinate ( const Coordinate aCoordinate  ) 

Copy constructor.

Parameters:
aCoordinate Coordinate to be copied.
Coordinate::~Coordinate (  )  [virtual]

Destructor.


Member Function Documentation

Object * Coordinate::copy (  )  const [virtual]

Copy this coordinate and return a pointer to the copy.

The copy constructor for this class is used.

Returns:
Pointer to a copy of this Coordinate.

Reimplemented from OpenSim::Object.

void Coordinate::copyData ( const Coordinate aCoordinate  ) 

Copy data members from one Coordinate to another.

Parameters:
aCoordinate Coordinate to be copied.
double Coordinate::getAccelerationValue ( const SimTK::State &  s  )  const [virtual]
SimTK::MobilizedBodyIndex OpenSim::Coordinate::getBodyIndex (  )  const [inline]
bool Coordinate::getClamped ( const SimTK::State &  s  )  const [virtual]

Get whether or not this coordinate is clamped.

Calls the underlying constraint at the dynamics level.

Returns:
true if the coordinate is clamped.
virtual bool OpenSim::Coordinate::getClampedUseDefault (  )  const [inline, virtual]
virtual bool OpenSim::Coordinate::getDefaultClamped (  )  const [inline, virtual]
virtual bool OpenSim::Coordinate::getDefaultIsPrescribed (  )  const [inline, virtual]
virtual bool OpenSim::Coordinate::getDefaultLocked (  )  const [inline, virtual]
double OpenSim::Coordinate::getDefaultSpeedValue (  )  const [inline]
virtual double OpenSim::Coordinate::getDefaultValue (  )  const [inline, virtual]
virtual bool OpenSim::Coordinate::getDefaultValueUseDefault (  )  const [inline, virtual]
virtual double OpenSim::Coordinate::getInitialValue (  )  const [inline, virtual]
const Joint & Coordinate::getJoint (  )  const [virtual]

Get the joint to which this coordinate belongs.

Returns:
Joint to which this coordinate belongs.
bool Coordinate::getLocked ( const SimTK::State &  s  )  const [virtual]

Get whether or not this coordinate is locked.

Calls the underlying constraint at the dynamics level.

Returns:
true if the coordinate is locked and false if unlocked.
virtual bool OpenSim::Coordinate::getLockedUseDefault (  )  const [inline, virtual]
int OpenSim::Coordinate::getMobilityIndex (  )  const [inline]
Model& OpenSim::Coordinate::getModel (  )  const [inline]
virtual MotionType OpenSim::Coordinate::getMotionType (  )  const [inline, virtual]
OpenSim::Function * Coordinate::getPrescribedFunction (  )  const [virtual]

Get the prescribed motion function.

Returns:
Pointer to the constraint function.
virtual void OpenSim::Coordinate::getRange ( double  rRange[2]  )  const [inline, virtual]
virtual double OpenSim::Coordinate::getRangeMax (  )  const [inline, virtual]
virtual double OpenSim::Coordinate::getRangeMin (  )  const [inline, virtual]
virtual bool OpenSim::Coordinate::getRangeUseDefault (  )  const [inline, virtual]
const std::string Coordinate::getSpeedName (  )  const
double Coordinate::getSpeedValue ( const SimTK::State &  s  )  const [virtual]
double Coordinate::getValue ( const SimTK::State &  s  )  const [virtual]

Get the value.

Returns:
The current value of the coordinate.
virtual bool OpenSim::Coordinate::getValueUseDefault (  )  const [inline, virtual]
void OpenSim::Coordinate::initState ( SimTK::State &  s  )  const
bool Coordinate::isConstrained (  )  const [virtual]

Determine if the the coordinate is constrained or not.

Specifically, is it a dependent coordinate in any of the constraints?\ If so return true, false otherwise.

virtual bool OpenSim::Coordinate::isPrescribed ( const SimTK::State &  s  )  const [inline, virtual]
OpenSim::Coordinate::OPENSIM_DECLARE_DERIVED ( Coordinate  ,
Object   
)
Coordinate & Coordinate::operator= ( const Coordinate aCoordinate  ) 

Assignment operator.

Returns:
Reference to this object.

Reimplemented from OpenSim::Object.

virtual bool OpenSim::Coordinate::setClamped ( SimTK::State &  s,
bool  aClamped 
) const [virtual]
virtual void OpenSim::Coordinate::setDefaultClamped ( bool  aClamped  )  [inline, virtual]
void OpenSim::Coordinate::setDefaultIsPrescribed ( bool  isPrescribed  )  [inline]
virtual void OpenSim::Coordinate::setDefaultLocked ( bool  aLocked  )  [inline, virtual]
void Coordinate::setDefaultsFromState ( const SimTK::State &  state  ) 
void OpenSim::Coordinate::setDefaultSpeedValue ( double  aDefaultSpeedValue  )  [inline]
bool Coordinate::setDefaultValue ( double  aDefaultValue  )  [virtual]

Set the default value.

Parameters:
aDefaultValue default value to change to.
Returns:
Whether or not the default value was changed.
void Coordinate::setInitialValue ( double  aInitialValue  )  [virtual]

Set the initial value.

Used to initialize the initial_value field in sdm.q

void Coordinate::setIsPrescribed ( SimTK::State &  s,
bool  isPrescribed 
) const

Set whether or not this coordinate is being prescribed.

A prescribed constraint is used specify motion at the dynamics level. If isPrescribed is set after clamping or locking it takes precedence- and clamped and locked are false.

Parameters:
isPrescribed If true the coordinate is prescribed; if false not prescribed.
void Coordinate::setJoint ( const Joint aOwningJoint  )  [virtual]

Set the joint to which this coordinate belongs.

Parameters:
aowningJoint Joint to which this coordinate belongs.
bool Coordinate::setLocked ( SimTK::State &  s,
bool  aLocked 
) const [virtual]

Set whether or not this coordinate is locked.

A prescribed constraint is used to lock the joint at the dynamics level. If lock is applied after clamping or prescribed motion it takes precedence.

Parameters:
aLocked If true the joint is locked; if false the joint is unlocked.
void Coordinate::setMotionType ( MotionType  aMotionType  )  [virtual]

Set coordinate's motion type.

void Coordinate::setPrescribedFunction ( const Function function  ) 

Set the prescribed motion function.

bool Coordinate::setRange ( double  aRange[2]  )  [virtual]

Set the range min and max.

Parameters:
aRange range min and man to change to.
Returns:
Whether or not the range was changed.
bool Coordinate::setRangeMax ( double  aMax  )  [virtual]

Set the range max.

Parameters:
aRange range max to change to.
Returns:
Whether or not the range max was changed.
bool Coordinate::setRangeMin ( double  aMin  )  [virtual]

Set the range min.

Parameters:
aRange range min to change to.
Returns:
Whether or not the range min was changed.
bool Coordinate::setSpeedValue ( SimTK::State &  s,
double  aValue 
) const [virtual]
void Coordinate::setup ( Model aModel  )  [virtual]

Perform some set up functions that happen after the object has been deserialized or copied.

Parameters:
aModel OpenSim model containing this Coordinate.
bool Coordinate::setValue ( SimTK::State &  s,
double  aValue,
bool  enforceConstraints = true 
) const [virtual]

Set the value.

Parameters:
aValue value to change to.
Returns:
Whether or not the value was changed.
void Coordinate::updateFromCoordinate ( const Coordinate aCoordinate  )  [virtual]

Update an existing coordinate with parameter values from a new one, but only for the parameters that were explicitly specified in the XML node.

Parameters:
aCoordinate coordinate to update from

Friends And Related Function Documentation

friend class Constraint [friend]
friend class CoordinateCouplerConstraint [friend]
friend class Joint [friend]
friend class Model [friend]

Member Data Documentation

SimTK::MobilizedBodyIndex OpenSim::Coordinate::_bodyIndex [protected]

ID of the body which this coordinate serves.

bool& OpenSim::Coordinate::_clamped [protected]

Flag indicating whether the coordinate is clamped or not.

Clamped means that the coordinate is not allowed to go outside its range.

Flag indicating whether the coordinate is prescribed or not.

Prescribed means the value will vary with time according to the Prescribed Function, which must be set first.

Joint const* OpenSim::Coordinate::_joint [protected]

Simbody joint that owns this coordinate.

bool& OpenSim::Coordinate::_locked [protected]

Flag indicating whether the coordinate is locked or not.

Locked means fixed at one value.

SimTK::Function* OpenSim::Coordinate::_lockFunction [protected]

Mobility index for this coordinate.

OpenSim model that contains this coordintate.

Motion type (translational, rotational or combination).

std::string& OpenSim::Coordinate::_motionTypeName [protected]

Specify the desired prescribed motion as a function of time.

Array<double>& OpenSim::Coordinate::_range [protected]

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

Generated on Wed Dec 16 15:03:47 2009 for OpenSim by  doxygen 1.6.1