Simbody
|
This is a subclass of Constraint::Custom which uses a Function object to define a holonomic (position) constraint. More...
#include <Constraint.h>
Public Member Functions | |
CoordinateCoupler (SimbodyMatterSubsystem &matter, const Function *function, const Array_< MobilizedBodyIndex > &coordBody, const Array_< MobilizerQIndex > &coordIndex) | |
Create a CoordinateCoupler. | |
CoordinateCoupler (SimbodyMatterSubsystem &matter, const Function *function, const std::vector< MobilizedBodyIndex > &coordBody, const std::vector< MobilizerQIndex > &coordIndex) | |
For compatibility with std::vector; no copying is done. |
This is a subclass of Constraint::Custom which uses a Function object to define a holonomic (position) constraint.
You provide a Function which takes some subset of the system's generalized coordinates 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.
SimTK::Constraint::CoordinateCoupler::CoordinateCoupler | ( | SimbodyMatterSubsystem & | matter, |
const Function * | function, | ||
const Array_< MobilizedBodyIndex > & | coordBody, | ||
const Array_< MobilizerQIndex > & | coordIndex | ||
) |
Create a CoordinateCoupler.
You specify a Function and a list of generalized coordinates to pass to it as arguments. Each generalized coordinate is specified by a MobilizedBody and the index of the coordinate within that body. For example matter.getMobilizedBody(bodies[2]).getOneQ(state, coordinates[2]) will be passed to the function as the value of the second argument.
matter | the matter subsystem this constraint will be added to |
function | the Function whose value should equal 0 at all times. The constraint takes over ownership of this object, and automatically deletes in when the constraint is deleted. |
coordBody | the MobilizedBody corresponding to each generalized coordinate that should be passed as a function argument |
coordIndex | the index corresponding to each generalized coordinate that should be passed as a function argument |
SimTK::Constraint::CoordinateCoupler::CoordinateCoupler | ( | SimbodyMatterSubsystem & | matter, |
const Function * | function, | ||
const std::vector< MobilizedBodyIndex > & | coordBody, | ||
const std::vector< MobilizerQIndex > & | coordIndex | ||
) | [inline] |
For compatibility with std::vector; no copying is done.