OpenSim  OpenSim 3.0
 All Classes Namespaces Functions Variables Typedefs Enumerations Enumerator Friends Pages
OpenSim::EllipsoidJoint Class Reference

A class implementing an Ellipsoid joint. More...

#include <EllipsoidJoint.h>

Inheritance diagram for OpenSim::EllipsoidJoint:
OpenSim::Joint OpenSim::ModelComponent OpenSim::Object

Property declarations

These are the serializable properties associated with an EllipsoidJoint.

 OpenSim_DECLARE_PROPERTY (radii_x_y_z, SimTK::Vec3,"Ellipsoid radii mobilizer frame as a Vec3(rX, rY, rZ).")
 EllipsoidJoint ()
 EllipsoidJoint (const std::string &name, OpenSim::Body &parent, SimTK::Vec3 locationInParent, SimTK::Vec3 orientationInParent, OpenSim::Body &body, SimTK::Vec3 locationInBody, SimTK::Vec3 orientationInBody, SimTK::Vec3 ellipsoidRadii, bool reverse=false)
virtual ~EllipsoidJoint ()
virtual int numCoordinates () const
void setEllipsoidRadii (SimTK::Vec3 radii)
virtual void scale (const ScaleSet &aScaleSet)
 Scale a joint based on XYZ scale factors for the bodies.
void connectToModel (Model &aModel) override
 Perform some set up functions that happen after the object has been deserialized or copied.
void addToSystem (SimTK::MultibodySystem &system) const override
 
Add appropriate Simbody elements (if needed) to the System 

corresponding to this component and specify needed state resources.

void initStateFromProperties (SimTK::State &s) const override
 
Transfer property values or other state-independent initial values

into this component's state variables in the passed-in state argument.

void setPropertiesFromState (const SimTK::State &state) override
 
Update this component's property values to match the specified State,

if the component has created any state variable that is intended to correspond to a property.

Additional Inherited Members

- Public Member Functions inherited from OpenSim::Joint
 Joint ()
 DEFAULT CONSTRUCTION.
 Joint (const std::string &name, Body &parent, SimTK::Vec3 locationInParent, SimTK::Vec3 orientationInParent, Body &body, SimTK::Vec3 locationInBody, SimTK::Vec3 orientationInBody, bool reverse=false)
 Convenience Constructor.
virtual ~Joint ()
virtual void setBody (OpenSim::Body &aBody)
 Set the body to which this joint belongs.
const OpenSim::BodygetBody () const
 Get the body to which this joint belongs.
OpenSim::BodyupdBody ()
virtual void setLocation (const SimTK::Vec3 &aLocation)
virtual void getLocation (SimTK::Vec3 &rLocation) const
virtual void setOrientation (const SimTK::Vec3 &aOrientation)
virtual void getOrientation (SimTK::Vec3 &rOrientation) const
void setParentName (const std::string &aName)
std::string getParentName () const
void setParentBody (OpenSim::Body &aBody)
const OpenSim::BodygetParentBody () const
 Get the parent body to which this joint attaches.
OpenSim::BodyupdParentBody ()
virtual void setLocationInParent (const SimTK::Vec3 &aLocation)
virtual void getLocationInParent (SimTK::Vec3 &rLocation) const
virtual void setOrientationInParent (const SimTK::Vec3 &aOrientation)
virtual void getOrientationInParent (SimTK::Vec3 &rOrientation) const
virtual void getOrientationInChild (double rOrientation[]) const
virtual void getOrientationInParent (double rOrientation[]) const
virtual void getLocationInChild (double rLocation[]) const
virtual void getLocationInParent (double rLocation[]) const
virtual void setLocationInChild (const SimTK::Vec3 &aLocation)
virtual const SimTK::Vec3 & getLocationInChild () const
const CoordinateSetgetCoordinateSet () const
virtual bool getReverse () const
virtual void checkParentBody ()
 Verify that the parent specified by this joint is in the underlying Simbody model/system.
virtual bool isCoordinateUsed (Coordinate &aCoordinate) const
virtual SimTK::SpatialVec calcEquivalentSpatialForce (const SimTK::State &s, const SimTK::Vector &mobilityForces) const
 Given some system mobility (generalized) forces, calculate the equivalent spatial body force for this Joint.
virtual double calcPower (const SimTK::State &s) const
 Joints in general do not contribute power since the reaction space forces are orthogonal to the mobility space.
 OpenSim_DECLARE_PROPERTY (parent_body, std::string,"Name of the parent body to which this joint connects its owner body.")
 OpenSim_DECLARE_PROPERTY (location_in_parent, SimTK::Vec3,"Location of the joint in the parent body specified in the parent ""reference frame. Default is (0,0,0).")
 OpenSim_DECLARE_PROPERTY (orientation_in_parent, SimTK::Vec3,"Orientation of the joint in the parent body specified in the parent ""reference frame. Euler XYZ body-fixed rotation angles are used to ""express the orientation. Default is (0,0,0).")
 OpenSim_DECLARE_PROPERTY (location, SimTK::Vec3,"Location of the joint in the child body specified in the child ""reference frame. For SIMM models, this vector is always the zero ""vector (i.e., the body reference frame coincides with the joint). ")
 OpenSim_DECLARE_PROPERTY (orientation, SimTK::Vec3,"Orientation of the joint in the owing body specified in the owning body ""reference frame. Euler XYZ body-fixed rotation angles are used to ""express the orientation. ")
 OpenSim_DECLARE_UNNAMED_PROPERTY (CoordinateSet,"Set holding the generalized coordinates (q's) that parmeterize this joint.")
 OpenSim_DECLARE_PROPERTY (reverse, bool,"Whether the joint transform defines parent->child or child->parent.")
- Static Public Member Functions inherited from OpenSim::Object
static void registerType (const Object &defaultObject)
 
Register an instance of a class; if the class is already registered it

will be replaced.

static void renameType (const std::string &oldTypeName, const std::string &newTypeName)
 
Support versioning by associating the current %Object type with an 

old name.

static const ObjectgetDefaultInstanceOfType (const std::string &concreteClassName)
 
Return a pointer to the default instance of the registered (concrete)

Object whose class name is given, or NULL if the type is not registered.

template<class T >
static bool isObjectTypeDerivedFrom (const std::string &concreteClassName)
 
Return true if the given concrete object type represents a subclass of 

the template object type T, and thus could be referenced with a T*.

static ObjectnewInstanceOfType (const std::string &concreteClassName)
 
Create a new instance of the concrete %Object type whose class name is 

given as concreteClassName.

static void getRegisteredTypenames (Array< std::string > &typeNames)
 Retrieve all the typenames registered so far.
template<class T >
static void getRegisteredObjectsOfGivenType (ArrayPtrs< T > &rArray)
 
Return an array of pointers to the default instances of all registered

(concrete) Object types that derive from a given Object-derived type that does not have to be concrete.

static void PrintPropertyInfo (std::ostream &os, const std::string &classNameDotPropertyName)
 
Dump formatted property information to a given output stream, useful

for creating a "help" facility for registered objects.

static void PrintPropertyInfo (std::ostream &os, const std::string &className, const std::string &propertyName)
 
Same as the other signature but the class name and property name are

provided as two separate strings.

static ObjectmakeObjectFromFile (const std::string &fileName)
 
Create an %OpenSim object whose type is based on the tag at the root 

node of the XML file passed in.

static const std::string & getClassName ()
 Return the name of this class as a string; i.e., "Object".
static void setSerializeAllDefaults (bool shouldSerializeDefaults)
 
Static function to control whether all registered objects and

their properties are written to the defaults section of output files rather than only those values for which the default was explicitly overwritten when read in from an input file or set programmatically.

static bool getSerializeAllDefaults ()
 Report the value of the "serialize all defaults" flag.
static bool isKindOf (const char *type)
 
Returns true if the passed-in string is "Object"; each %Object-derived

class defines a method of this name for its own class name.

static void setDebugLevel (int newLevel)
 Set the debug level to get verbose output.
static int getDebugLevel ()
 Get current setting of debug level.
static ObjectSafeCopy (const Object *aObject)
 
Use the clone() method to duplicate the given object unless the pointer

is null in which case null is returned.

static void RegisterType (const Object &defaultObject)
 OBSOLETE alternate name for registerType().
static void RenameType (const std::string &oldName, const std::string &newName)
 OBSOLETE alternate name for renameType().
- Static Public Attributes inherited from OpenSim::Object
static const std::string DEFAULT_NAME
 Name used for default objects when they are serialized.
- Protected Member Functions inherited from OpenSim::Joint
void constructCoordinates ()
 Construct coordinates according to the mobilities of the Joint.
SimTK::MobilizedBodyIndex getMobilizedBodyIndex (Body *aBody) const
void setMobilizedBodyIndex (Body *aBody, SimTK::MobilizedBodyIndex index) const
void setCoordinateMobilizedBodyIndex (Coordinate *aCoord, SimTK::MobilizedBodyIndex index) const
void setCoordinateMobilizerQIndex (Coordinate *aCoord, int index) const
void setCoordinateModel (Coordinate *aCoord, Model *aModel) const
SimTK::SpatialVec calcEquivalentSpatialForceForMobilizedBody (const SimTK::State &s, const SimTK::MobilizedBodyIndex mbx, const SimTK::Vector &mobilityForces) const
- Protected Attributes inherited from OpenSim::ModelComponent
Model_model
 The model this component belongs to.

Detailed Description

A class implementing an Ellipsoid joint.

The underlying implementation in Simbody is a MobilizedBody::Ellipsoid.

Author
Ajay Seth
Version
1.0

Constructor & Destructor Documentation

OpenSim::EllipsoidJoint::EllipsoidJoint ( )
OpenSim::EllipsoidJoint::EllipsoidJoint ( const std::string &  name,
OpenSim::Body parent,
SimTK::Vec3  locationInParent,
SimTK::Vec3  orientationInParent,
OpenSim::Body body,
SimTK::Vec3  locationInBody,
SimTK::Vec3  orientationInBody,
SimTK::Vec3  ellipsoidRadii,
bool  reverse = false 
)
virtual OpenSim::EllipsoidJoint::~EllipsoidJoint ( )
virtual

Member Function Documentation

void OpenSim::EllipsoidJoint::addToSystem ( SimTK::MultibodySystem &  system) const
overrideprotectedvirtual

Add appropriate Simbody elements (if needed) to the System 

corresponding to this component and specify needed state resources.

addToSystem() is called when the Simbody System is being created to represent a completed Model for computation. That is, connectToModel() will already have been invoked on all components before any addToSystem() call is made. Helper methods for adding modeling options, state variables and their derivatives, discrete variables, and cache entries are available and can be called within addToSystem() only.

Note that this method is const; you must not modify your model component or the containing model during this call. Any modifications you need should instead be performed in connectToModel(), which is non-const. One exception is that you may need to record access information for resources you create in the system, such as an index number. You should declare those data members mutable so that you can set them here.

If you override this method, be sure to invoke the base class method first, using code like this:

void MyComponent::addToSystem(SimTK::MultibodySystem& system) const {
Super::addToSystem(system); // invoke parent class method
// ... your code goes here
}
Parameters
[in,out]systemThe System being created.
See Also
addModelingOption(), addStateVariable(), addDiscreteVariables(), addCacheVariable()

Reimplemented from OpenSim::Joint.

void OpenSim::EllipsoidJoint::connectToModel ( Model aModel)
overrideprotectedvirtual

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

Parameters
aModelOpenSim model containing this Joint.

Reimplemented from OpenSim::Joint.

void OpenSim::EllipsoidJoint::initStateFromProperties ( SimTK::State &  state) const
overrideprotectedvirtual

Transfer property values or other state-independent initial values

into this component's state variables in the passed-in state argument.

This is called after a SimTK::System and State have been created for the Model (that is, after addToSystem() has been called on all components). You should override this method if your component has properties (serializable values) that can affect initial values for your state variables. You can also perform any other state-independent calculations here that result in state initial conditions.

If you override this method, be sure to invoke the base class method first, using code like this:

void MyComponent::initStateFromProperties(SimTK::State& state) const {
Super::initStateFromProperties(state); // invoke parent class method
// ... your code goes here
}
Parameters
stateThe state that will receive the new initial conditions.
See Also
setPropertiesFromState()

Reimplemented from OpenSim::Joint.

virtual int OpenSim::EllipsoidJoint::numCoordinates ( ) const
inlinevirtual

Implements OpenSim::Joint.

OpenSim::EllipsoidJoint::OpenSim_DECLARE_PROPERTY ( radii_x_y_z  ,
SimTK::Vec3  ,
"Ellipsoid radii mobilizer frame as a Vec3(rX, rY, rZ)."   
)
virtual void OpenSim::EllipsoidJoint::scale ( const ScaleSet aScaleSet)
virtual

Scale a joint based on XYZ scale factors for the bodies.

Generic behavior is to scale the locations on parent and on the body according to scale factors of the bodies upon which they are located.

Joint subclasses should invoke this method before scaling joint specific properties

Parameters
aScaleSetSet of XYZ scale factors for the bodies.

Reimplemented from OpenSim::Joint.

void OpenSim::EllipsoidJoint::setEllipsoidRadii ( SimTK::Vec3  radii)
void OpenSim::EllipsoidJoint::setPropertiesFromState ( const SimTK::State &  state)
overrideprotectedvirtual

Update this component's property values to match the specified State,

if the component has created any state variable that is intended to correspond to a property.

Thus, state variable values can persist as part of the model component and be serialized as a property.

If you override this method, be sure to invoke the base class method first, using code like this:

void MyComponent::setPropertiesFromState(const SimTK::State& state) {
Super::setPropertiesFromState(state); // invoke parent class method
// ... your code goes here
}
Parameters
stateThe State from which values may be extracted to set persistent property values.
See Also
initStateFromProperties()

Reimplemented from OpenSim::Joint.


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