Simbody  3.4 (development)
SimTK::MobilizedBody::FunctionBased Class Reference

This is a subclass of MobilizedBody::Custom which uses a set of Function objects to define the behavior of the MobilizedBody. More...

#include <MobilizedBody_FunctionBased.h>

+ Inheritance diagram for SimTK::MobilizedBody::FunctionBased:

List of all members.

Public Member Functions

 FunctionBased ()
 Default constructor provides an empty handle that can be assigned to reference any MobilizedBody::FunctionBased.
 FunctionBased (MobilizedBody &parent, const Body &bodyInfo, int nmobilities, const Array_< const Function * > &functions, const Array_< Array_< int > > &coordIndices, Direction direction=Forward)
 Create a FunctionBased MobilizedBody.
 FunctionBased (MobilizedBody &parent, const Body &bodyInfo, int nmobilities, const std::vector< const Function * > &functions, const std::vector< std::vector< int > > &coordIndices, Direction direction=Forward)
 For compatibility with std::vector.
 FunctionBased (MobilizedBody &parent, const Transform &X_PF, const Body &bodyInfo, const Transform &X_BM, int nmobilities, const Array_< const Function * > &functions, const Array_< Array_< int > > &coordIndices, Direction direction=Forward)
 Create a FunctionBased MobilizedBody.
 FunctionBased (MobilizedBody &parent, const Transform &X_PF, const Body &bodyInfo, const Transform &X_BM, int nmobilities, const std::vector< const Function * > &functions, const std::vector< std::vector< int > > &coordIndices, Direction direction=Forward)
 For compatibility with std::vector.
 FunctionBased (MobilizedBody &parent, const Body &bodyInfo, int nmobilities, const Array_< const Function * > &functions, const Array_< Array_< int > > &coordIndices, const Array_< Vec3 > &axes, Direction direction=Forward)
 Create a FunctionBased MobilizedBody.
 FunctionBased (MobilizedBody &parent, const Body &bodyInfo, int nmobilities, const std::vector< const Function * > &functions, const std::vector< std::vector< int > > &coordIndices, const std::vector< Vec3 > &axes, Direction direction=Forward)
 For compatibility with std::vector.
 FunctionBased (MobilizedBody &parent, const Transform &X_PF, const Body &bodyInfo, const Transform &X_BM, int nmobilities, const Array_< const Function * > &functions, const Array_< Array_< int > > &coordIndices, const Array_< Vec3 > &axes, Direction direction=Forward)
 Create a FunctionBased MobilizedBody.
 FunctionBased (MobilizedBody &parent, const Transform &X_PF, const Body &bodyInfo, const Transform &X_BM, int nmobilities, const std::vector< const Function * > &functions, const std::vector< std::vector< int > > &coordIndices, const std::vector< Vec3 > &axes, Direction direction=Forward)
 For compatibility with std::vector.

Detailed Description

This is a subclass of MobilizedBody::Custom which uses a set of Function objects to define the behavior of the MobilizedBody.

When you create it, you specify the number of generalized coordinates, and six Function objects which calculate the spatial rotations and translations based on those coordinates. It assumes there is a one to one correspondence between generalized coordinates and generalized speeds, so qdot == u.

Each of the Function objects must take some subset of the generalized coordinates as inputs, and produce a single number as its output. It also must support derivatives up to second order. Taken together, the six functions define a SpatialVec giving the body's mobilizer transform.


Constructor & Destructor Documentation

Default constructor provides an empty handle that can be assigned to reference any MobilizedBody::FunctionBased.

SimTK::MobilizedBody::FunctionBased::FunctionBased ( MobilizedBody parent,
const Body bodyInfo,
int  nmobilities,
const Array_< const Function * > &  functions,
const Array_< Array_< int > > &  coordIndices,
Direction  direction = Forward 
)

Create a FunctionBased MobilizedBody.

Parameters:
parentthe MobilizedBody's parent body
bodyInfodescribes this MobilizedBody's physical properties
nmobilitiesthe number of generalized coordinates belonging to this MobilizedBody
functionsthe Functions describing how the body moves based on its generalized coordinates. This must be of length 6. The elements correspond to, in order, x rotation, y rotation, z rotation, x translation, y translation, and z translation. The MobilizedBody takes over ownership of the functions, and automatically deletes them when the MobilizedBody is deleted.
coordIndicesthe indices of the generalized coordinates that are inputs to each function. For example, if coordIndices[2] = {0, 1}, that means that functions[2] takes two input arguments, and q[0] and q[1] respectively should be passed as those arguments.
directionwhether you want the coordinates defined as though parent & child were swapped
See also:
MobilizedBody for a diagram and explanation of terminology.
SimTK::MobilizedBody::FunctionBased::FunctionBased ( MobilizedBody parent,
const Body bodyInfo,
int  nmobilities,
const std::vector< const Function * > &  functions,
const std::vector< std::vector< int > > &  coordIndices,
Direction  direction = Forward 
) [inline]

For compatibility with std::vector.

SimTK::MobilizedBody::FunctionBased::FunctionBased ( MobilizedBody parent,
const Transform X_PF,
const Body bodyInfo,
const Transform X_BM,
int  nmobilities,
const Array_< const Function * > &  functions,
const Array_< Array_< int > > &  coordIndices,
Direction  direction = Forward 
)

Create a FunctionBased MobilizedBody.

Parameters:
parentthe MobilizedBody's parent body
X_PFthe default inboard frame
bodyInfodescribes this MobilizedBody's physical properties
X_BMthe default outboard frame
nmobilitiesthe number of generalized coordinates belonging to this MobilizedBody
functionsthe Functions describing how the body moves based on its generalized coordinates. This must be of length 6. The elements correspond to, in order, x rotation, y rotation, z rotation, x translation, y translation, and z translation. The MobilizedBody takes over ownership of the functions, and automatically deletes them when the MobilizedBody is deleted.
coordIndicesthe indices of the generalized coordinates that are inputs to each function. For example, if coordIndices[2] = {0, 1}, that means that functions[2] takes two input arguments, and q[0] and q[1] respectively should be passed as those arguments.
directionwhether you want the coordinates defined as though parent & child were swapped
See also:
MobilizedBody for a diagram and explanation of terminology.
SimTK::MobilizedBody::FunctionBased::FunctionBased ( MobilizedBody parent,
const Transform X_PF,
const Body bodyInfo,
const Transform X_BM,
int  nmobilities,
const std::vector< const Function * > &  functions,
const std::vector< std::vector< int > > &  coordIndices,
Direction  direction = Forward 
) [inline]

For compatibility with std::vector.

SimTK::MobilizedBody::FunctionBased::FunctionBased ( MobilizedBody parent,
const Body bodyInfo,
int  nmobilities,
const Array_< const Function * > &  functions,
const Array_< Array_< int > > &  coordIndices,
const Array_< Vec3 > &  axes,
Direction  direction = Forward 
)

Create a FunctionBased MobilizedBody.

Parameters:
parentthe MobilizedBody's parent body
bodyInfodescribes this MobilizedBody's physical properties
nmobilitiesthe number of generalized coordinates belonging to this MobilizedBody
functionsthe Functions describing how the body moves based on its generalized coordinates. This must be of length 6. The elements correspond to, in order, x rotation, y rotation, z rotation, x translation, y translation, and z translation. The MobilizedBody takes over ownership of the functions, and automatically deletes them when the MobilizedBody is deleted.
coordIndicesthe indices of the generalized coordinates that are inputs to each function. For example, if coordIndices[2] = {0, 1}, that means that functions[2] takes two input arguments, and q[0] and q[1] respectively should be passed as those arguments.
axesthe axes directions (as Vec3's) for each spatial coordinate, which each function describes, and is therefore length 6. First 3 and last 3 axes must be linearly independent, otherwise there will be redundant speeds for the same motion.
directionwhether you want the coordinates defined as though parent & child were swapped
See also:
MobilizedBody for a diagram and explanation of terminology.
SimTK::MobilizedBody::FunctionBased::FunctionBased ( MobilizedBody parent,
const Body bodyInfo,
int  nmobilities,
const std::vector< const Function * > &  functions,
const std::vector< std::vector< int > > &  coordIndices,
const std::vector< Vec3 > &  axes,
Direction  direction = Forward 
) [inline]

For compatibility with std::vector.

SimTK::MobilizedBody::FunctionBased::FunctionBased ( MobilizedBody parent,
const Transform X_PF,
const Body bodyInfo,
const Transform X_BM,
int  nmobilities,
const Array_< const Function * > &  functions,
const Array_< Array_< int > > &  coordIndices,
const Array_< Vec3 > &  axes,
Direction  direction = Forward 
)

Create a FunctionBased MobilizedBody.

Parameters:
parentthe MobilizedBody's parent body
X_PFthe default inboard frame
bodyInfodescribes this MobilizedBody's physical properties
X_BMthe default outboard frame
nmobilitiesthe number of generalized coordinates belonging to this MobilizedBody
functionsthe Functions describing how the body moves based on its generalized coordinates. This must be of length 6. The elements correspond to, in order, x rotation, y rotation, z rotation, x translation, y translation, and z translation. The MobilizedBody takes over ownership of the functions, and automatically deletes them when the MobilizedBody is deleted.
coordIndicesthe indices of the generalized coordinates that are inputs to each function. For example, if coordIndices[2] = {0, 1}, that means that functions[2] takes two input arguments, and q[0] and q[1] respectively should be passed as those arguments.
axesthe axes directions (as Vec3's) for each spatial coordinate, which each function describes, and is therefore length 6. First 3 and last 3 axes must be linearly independent, otherwise there will be redundant speeds for the same motion.
directionwhether you want the coordinates defined as though parent & child were swapped
See also:
MobilizedBody for a diagram and explanation of terminology.
SimTK::MobilizedBody::FunctionBased::FunctionBased ( MobilizedBody parent,
const Transform X_PF,
const Body bodyInfo,
const Transform X_BM,
int  nmobilities,
const std::vector< const Function * > &  functions,
const std::vector< std::vector< int > > &  coordIndices,
const std::vector< Vec3 > &  axes,
Direction  direction = Forward 
) [inline]

For compatibility with std::vector.


The documentation for this class was generated from the following file:
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Defines