API
4.5
For C++ developers
|
An OffsetFrame is a Frame whose transform (translation and orientation) with respect to another (parent) Frame is constant in time. More...
OpenSim Properties, Sockets, Outputs, Inputs | |
Properties (single-value) | |
SimTK::Vec3 | translation |
"Translational offset (in meters) of this frame's origin from the parent " "frame's origin, expressed in the parent frame." More... | |
SimTK::Vec3 | orientation |
"Orientation offset (in radians) of this frame in its parent frame, " "expressed as a frame-fixed x-y-z rotation sequence." More... | |
Sockets | |
C | parent |
"The parent frame to this frame." More... | |
Public Member Functions | |
OffsetFrame () | |
By default, the frame is not connected to any parent frame, and its transform is an identity transform. More... | |
OffsetFrame (const C &parent, const SimTK::Transform &offset) | |
A convenience constructor that initializes the parent connection and offset Transform in the parent frame. More... | |
OffsetFrame (const std::string &name, const C &parent, const SimTK::Transform &offset) | |
A convenience constructor that initializes the parent connection by name and of the offset Transform in the parent frame. More... | |
OffsetFrame (const std::string &name, const std::string &parentName, const SimTK::Transform &offset) | |
A convenience constructor that initializes the parent connection by name and of the offset Transform in the parent frame. More... | |
void | setParentFrame (const C &parent) |
Sets the parent reference frame. More... | |
const C & | getParentFrame () const |
Get the parent reference frame. More... | |
const SimTK::Transform & | getOffsetTransform () const |
Get the transform that describes the translational and rotational offset of this frame (F frame) relative to its parent frame (B frame). More... | |
void | setOffsetTransform (const SimTK::Transform &offset) |
Sets the transform the translates and rotates this frame (F frame) from its parent frame (P frame). More... | |
void | extendScale (const SimTK::State &s, const ScaleSet &scaleSet) override |
Scale the offset given scale factors for spatial (XYZ) dimensions. More... | |
Property-related functions | |
const SimTK::Vec3 & | get_translation () const |
Get the value of the translation property. More... | |
SimTK::Vec3 & | upd_translation () |
Get a writable reference to the translation property. More... | |
void | set_translation (const SimTK::Vec3 &value) |
Set the value of the translation property. More... | |
const SimTK::Vec3 & | get_orientation () const |
Get the value of the orientation property. More... | |
SimTK::Vec3 & | upd_orientation () |
Get a writable reference to the orientation property. More... | |
void | set_orientation (const SimTK::Vec3 &value) |
Set the value of the orientation property. More... | |
Socket-related functions | |
void | connectSocket_parent (const OpenSim::Object &object) |
Connect the 'parent' Socket to an object of type C. More... | |
Public Types | |
typedef OffsetFrame | Self |
This typedef might be useful within the member functions of this class. More... | |
typedef C | Super |
Use this typedef to refer to the superclass of this class. More... | |
Protected Member Functions | |
const Frame & | extendFindBaseFrame () const override final |
Extend how OffsetFrame determines its base Frame. More... | |
SimTK::Transform | extendFindTransformInBaseFrame () const override final |
Extend how OffsetFrame determines its transform in its base Frame. More... | |
SimTK::Transform | calcTransformInGround (const SimTK::State &state) const override final |
SimTK::SpatialVec | calcVelocityInGround (const SimTK::State &state) const override final |
SimTK::SpatialVec | calcAccelerationInGround (const SimTK::State &state) const override final |
Component Interface | |
These methods adhere to the Component Interface | |
void | extendFinalizeFromProperties () override |
void | extendConnectToModel (Model &model) override |
Auto-generated functions | |
static OffsetFrame * | safeDownCast (OpenSim::Object *obj) |
For use in MATLAB and Python to access the concrete class. More... | |
static const std::string & | getClassName () |
This returns "OffsetFrame_<T>_". More... | |
void | assign (Object &aObject) override |
This allows copy assignment in the Java GUI. More... | |
OffsetFrame * | clone () const override=0 |
const std::string & | getConcreteClassName () const override=0 |
An OffsetFrame is a Frame whose transform (translation and orientation) with respect to another (parent) Frame is constant in time.
It acts as an extension of the parent Frame type so that an OffsetFrame<PhysicalFrame>, for example, can be treated as a PhysicalFrame. This enables Frames to be filtered by their type (e.g. Physical or not), regardless of whether or not the Frame is also an OffsetFrame. (A class whose super class is a template parameter is called a mixin class.)
OffsetFrames also have the property that if they form a chain or a tree, each OffsetFrame shares the same Base which is the parent of the first/root OffsetFrame in the tree. This allows Solvers and algorithms to work directly with the Base which can be more efficient.
OffsetFrame is an abstract class. Derive concrete subclasses in order to accommodate new Frame types that require their offsets to retain the same type as the parent. For example:
C | The type of the parent frame, as well as the super class. Must be of type Frame. |
typedef OffsetFrame OpenSim::OffsetFrame< C >::Self |
This typedef might be useful within the member functions of this class.
This is generated by the OpenSim_DECLARE_*_OBJECT
macros.
typedef C OpenSim::OffsetFrame< C >::Super |
Use this typedef to refer to the superclass of this class.
Avoid using the explicit type name of the superclass; this would introduce bugs if the superclass is changed.
This is generated by the OpenSim_DECLARE_*_OBJECT
macros.
OpenSim::OffsetFrame< C >::OffsetFrame | ( | ) |
By default, the frame is not connected to any parent frame, and its transform is an identity transform.
OpenSim::OffsetFrame< C >::OffsetFrame | ( | const C & | parent, |
const SimTK::Transform & | offset | ||
) |
A convenience constructor that initializes the parent connection and offset Transform in the parent frame.
[in] | parent | The parent reference frame. |
[in] | offset | The offset transform between this frame and its parent |
OpenSim::OffsetFrame< C >::OffsetFrame | ( | const std::string & | name, |
const C & | parent, | ||
const SimTK::Transform & | offset | ||
) |
A convenience constructor that initializes the parent connection by name and of the offset Transform in the parent frame.
[in] | name | The name of this OffsetFrame. |
[in] | parent | The parent reference frame. |
[in] | offset | The offset Transform between this frame and its parent |
OpenSim::OffsetFrame< C >::OffsetFrame | ( | const std::string & | name, |
const std::string & | parentName, | ||
const SimTK::Transform & | offset | ||
) |
A convenience constructor that initializes the parent connection by name and of the offset Transform in the parent frame.
[in] | name | The name of this OffsetFrame. |
[in] | parentName | The name of the parent reference Frame. |
[in] | offset | The offset Transform between this frame and its parent |
|
inlineoverride |
This allows copy assignment in the Java GUI.
Exception | if the argument is not of type OffsetFrame. |
|
finaloverrideprotected |
|
finaloverrideprotected |
|
finaloverrideprotected |
|
overridepure virtual |
Implemented in OpenSim::PhysicalOffsetFrame.
|
inline |
Connect the 'parent' Socket to an object of type C.
Call finalizeConnections() afterwards to update the socket's connectee path property. The reference to the connectee set here takes precedence over the connectee path property.
|
overrideprotected |
|
overrideprotected |
|
finaloverrideprotected |
Extend how OffsetFrame determines its base Frame.
|
finaloverrideprotected |
Extend how OffsetFrame determines its transform in its base Frame.
|
inlineoverride |
Scale the offset given scale factors for spatial (XYZ) dimensions.
|
inline |
Get the value of the orientation property.
|
inline |
Get the value of the translation property.
|
inlinestatic |
This returns "OffsetFrame_<T>_".
T is the template argument for this class. See getConcreteClassName() if you want the class name of the underlying concrete object instead.
This is generated by the OpenSim_DECLARE_*_OBJECT
macros.
|
overridepure virtual |
Implemented in OpenSim::PhysicalOffsetFrame.
const SimTK::Transform & OpenSim::OffsetFrame< C >::getOffsetTransform | ( | ) | const |
Get the transform that describes the translational and rotational offset of this frame (F frame) relative to its parent frame (B frame).
This method returns the transform converting quantities expressed in F frame to quantities expressed in the B frame. This is mathematically stated as, vec_P = X_BF*vec_F , where X_BF is the transform returned by getTransform.
This transform is computed using the translation and orientation properties of this object.
const C & OpenSim::OffsetFrame< C >::getParentFrame | ( | ) | const |
Get the parent reference frame.
|
inlinestatic |
For use in MATLAB and Python to access the concrete class.
Example: cObj = OffsetFrame.safeDownCast(obj)
. This is equivalent to dynamic_cast<OffsetFrame*>(obj)
in C++.
|
inline |
Set the value of the orientation property.
|
inline |
Set the value of the translation property.
void OpenSim::OffsetFrame< C >::setOffsetTransform | ( | const SimTK::Transform & | offset | ) |
Sets the transform the translates and rotates this frame (F frame) from its parent frame (P frame).
You should provide the transform X_PF such that vec_P = X_PF*vec_F.
This transform is stored via the translation and orientation properties of this object.
offset | The transform between this frame and its parent frame. |
void OpenSim::OffsetFrame< C >::setParentFrame | ( | const C & | parent | ) |
Sets the parent reference frame.
|
inline |
Get a writable reference to the orientation property.
|
inline |
Get a writable reference to the translation property.
SimTK::Vec3 OpenSim::OffsetFrame< C >::orientation |
"Orientation offset (in radians) of this frame in its parent frame, " "expressed as a frame-fixed x-y-z rotation sequence."
This property appears in XML files under the tag <orientation>. This property was generated with the OpenSim_DECLARE_PROPERTY macro; see Property to learn about the property system.
C OpenSim::OffsetFrame< C >::parent |
"The parent frame to this frame."
In an XML file, you can set this Socket's connectee path via the <socket_parent > element. This socket was generated with the OpenSim_DECLARE_SOCKET macro; see AbstractSocket for more information.
SimTK::Vec3 OpenSim::OffsetFrame< C >::translation |
"Translational offset (in meters) of this frame's origin from the parent " "frame's origin, expressed in the parent frame."
This property appears in XML files under the tag <translation>. This property was generated with the OpenSim_DECLARE_PROPERTY macro; see Property to learn about the property system.