A class implementing a Simbody generalized coordinate. More...
#include <Coordinate.h>
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 Object * | copy () const |
Copy this coordinate and return a pointer to the copy. | |
Coordinate & | operator= (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 Joint & | getJoint () const |
Get the joint to which this coordinate belongs. | |
Model & | getModel () 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::Function * | getPrescribedFunction () 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 |
A class implementing a Simbody generalized coordinate.
Coordinate::Coordinate | ( | ) |
Default constructor.
Coordinate::Coordinate | ( | const std::string & | aName, | |
MotionType | aMotionType, | |||
double | aRangeMin, | |||
double | aRangeMax | |||
) |
Constructor.
Coordinate::Coordinate | ( | const Coordinate & | aCoordinate | ) |
Copy constructor.
aCoordinate | Coordinate to be copied. |
Coordinate::~Coordinate | ( | ) | [virtual] |
Destructor.
Object * Coordinate::copy | ( | ) | const [virtual] |
Copy this coordinate and return a pointer to the copy.
The copy constructor for this class is used.
Reimplemented from OpenSim::Object.
void Coordinate::copyData | ( | const Coordinate & | aCoordinate | ) |
Copy data members from one Coordinate to another.
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.
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.
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.
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.
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.
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 | ) |
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.
aDefaultValue | default value to change to. |
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.
isPrescribed | If true the coordinate is prescribed; if false not prescribed. |
void Coordinate::setJoint | ( | const Joint & | aOwningJoint | ) | [virtual] |
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.
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.
aRange | range min and man to change to. |
bool Coordinate::setRangeMax | ( | double | aMax | ) | [virtual] |
Set the range max.
aRange | range max to change to. |
bool Coordinate::setRangeMin | ( | double | aMin | ) | [virtual] |
Set the range min.
aRange | range min to change to. |
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.
aModel | OpenSim model containing this Coordinate. |
bool Coordinate::setValue | ( | SimTK::State & | s, | |
double | aValue, | |||
bool | enforceConstraints = true | |||
) | const [virtual] |
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.
aCoordinate | coordinate to update from |
friend class Constraint [friend] |
friend class CoordinateCouplerConstraint [friend] |
friend class Joint [friend] |
friend class Model [friend] |
SimTK::MobilizedBodyIndex OpenSim::Coordinate::_bodyIndex [protected] |
ID of the body which this coordinate serves.
bool& OpenSim::Coordinate::_clamped [protected] |
PropertyBool OpenSim::Coordinate::_clampedProp [protected] |
Flag indicating whether the coordinate is clamped or not.
Clamped means that the coordinate is not allowed to go outside its range.
double& OpenSim::Coordinate::_defaultSpeedValue [protected] |
double& OpenSim::Coordinate::_defaultValue [protected] |
PropertyDbl OpenSim::Coordinate::_defaultValueProp [protected] |
double& OpenSim::Coordinate::_initialValue [protected] |
PropertyDbl OpenSim::Coordinate::_initialValueProp [protected] |
bool& OpenSim::Coordinate::_isPrescribed [protected] |
PropertyBool OpenSim::Coordinate::_isPrescribedProp [protected] |
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] |
PropertyBool OpenSim::Coordinate::_lockedProp [protected] |
Flag indicating whether the coordinate is locked or not.
Locked means fixed at one value.
SimTK::Function* OpenSim::Coordinate::_lockFunction [protected] |
int OpenSim::Coordinate::_mobilityIndex [protected] |
Mobility index for this coordinate.
Model* OpenSim::Coordinate::_model [protected] |
OpenSim model that contains this coordintate.
MotionType OpenSim::Coordinate::_motionType [protected] |
Motion type (translational, rotational or combination).
std::string& OpenSim::Coordinate::_motionTypeName [protected] |
PropertyStr OpenSim::Coordinate::_motionTypeNameProp [protected] |
OpenSim::Function*& OpenSim::Coordinate::_prescribedFunction [protected] |
Specify the desired prescribed motion as a function of time.
Array<double>& OpenSim::Coordinate::_range [protected] |
PropertyDblArray OpenSim::Coordinate::_rangeProp [protected] |