Simbody
Public Member Functions

SimTK::Constraint::SpeedCoupler Class Reference

This is a subclass of Constraint::Custom which uses a Function object to define a nonholonomic (velocity) constraint. More...

#include <Constraint.h>

Inheritance diagram for SimTK::Constraint::SpeedCoupler:

List of all members.

Public Member Functions

 SpeedCoupler (SimbodyMatterSubsystem &matter, const Function *function, const Array_< MobilizedBodyIndex > &speedBody, const Array_< MobilizerUIndex > &speedIndex)
 Create a SpeedCoupler.
 SpeedCoupler (SimbodyMatterSubsystem &matter, const Function *function, const std::vector< MobilizedBodyIndex > &speedBody, const std::vector< MobilizerUIndex > &speedIndex)
 For compatibility with std::vector; no copying is done.
 SpeedCoupler (SimbodyMatterSubsystem &matter, const Function *function, const Array_< MobilizedBodyIndex > &speedBody, const Array_< MobilizerUIndex > &speedIndex, const Array_< MobilizedBodyIndex > &coordBody, const Array_< MobilizerQIndex > &coordIndex)
 Create a SpeedCoupler.
 SpeedCoupler (SimbodyMatterSubsystem &matter, const Function *function, const std::vector< MobilizedBodyIndex > &speedBody, const std::vector< MobilizerUIndex > &speedIndex, const std::vector< MobilizedBodyIndex > &coordBody, const std::vector< MobilizerQIndex > &coordIndex)
 For compatibility with std::vector; no copying is done.

Detailed Description

This is a subclass of Constraint::Custom which uses a Function object to define a nonholonomic (velocity) constraint.

You provide a Function which takes some subset of the system's generalized speeds as arguments, and returns a single value. It also must support partial derivatives up to second order. The constraint enforces that the value of the function should equal 0 at all times.

The Function may optionally depend on coordinates (q) as well as speeds (u), but it only acts as a constraint on the speeds. The constraint takes the current values of the coordinates as constants, then tries to modify only the speeds so as to satisfy the constraint.


Constructor & Destructor Documentation

SimTK::Constraint::SpeedCoupler::SpeedCoupler ( SimbodyMatterSubsystem matter,
const Function function,
const Array_< MobilizedBodyIndex > &  speedBody,
const Array_< MobilizerUIndex > &  speedIndex 
)

Create a SpeedCoupler.

You specify a Function and a list of generalized speeds to pass to it as arguments. Each generalized speed is specified by a MobilizedBody and the index of the speeds within that body. For example matter.getMobilizedBody(bodies[2]).getOneU(state, speeds[2]) will be passed to the function as the value of the second argument.

Parameters:
matterthe matter subsystem this constraint will be added to
functionthe Function whose value should equal 0 at all times. The constraint takes over ownership of this object, and automatically deletes it when the constraint is deleted.
speedBodythe MobilizedBody corresponding to each generalized speed that should be passed as a function argument
speedIndexthe index corresponding to each generalized speed that should be passed as a function argument
SimTK::Constraint::SpeedCoupler::SpeedCoupler ( SimbodyMatterSubsystem matter,
const Function function,
const std::vector< MobilizedBodyIndex > &  speedBody,
const std::vector< MobilizerUIndex > &  speedIndex 
) [inline]

For compatibility with std::vector; no copying is done.

SimTK::Constraint::SpeedCoupler::SpeedCoupler ( SimbodyMatterSubsystem matter,
const Function function,
const Array_< MobilizedBodyIndex > &  speedBody,
const Array_< MobilizerUIndex > &  speedIndex,
const Array_< MobilizedBodyIndex > &  coordBody,
const Array_< MobilizerQIndex > &  coordIndex 
)

Create a SpeedCoupler.

You specify a Function and a list of generalized coordinates and speeds to pass to it as arguments. Each generalized speed is specified by a MobilizedBody and the index of the speeds within that body. For example matter.getMobilizedBody(bodies[2]).getOneU(state, speeds[2]) will be passed to the function as the value of the second argument. Generalized coordinates come after generalized speeds in the argument list. For example, if you specify three generalized speeds and two generalized coordinates, the Function must take a total of five arguments. The first three are the speeds, and the last two are the coordinates.

Parameters:
matterthe matter subsystem this constraint will be added to
functionthe Function whose value should equal 0 at all times. The constraint takes over ownership of this object, and automatically deletes it when the constraint is deleted.
speedBodythe MobilizedBody corresponding to each generalized speed that should be passed as a function argument
speedIndexthe index corresponding to each generalized speed that should be passed as a function argument
coordBodythe MobilizedBody corresponding to each generalized coordinate that should be passed as a function argument
coordIndexthe index corresponding to each generalized coordinate that should be passed as a function argument
SimTK::Constraint::SpeedCoupler::SpeedCoupler ( SimbodyMatterSubsystem matter,
const Function function,
const std::vector< MobilizedBodyIndex > &  speedBody,
const std::vector< MobilizerUIndex > &  speedIndex,
const std::vector< MobilizedBodyIndex > &  coordBody,
const std::vector< MobilizerQIndex > &  coordIndex 
) [inline]

For compatibility with std::vector; no copying is done.


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