Simbody
3.4 (development)
|
This is a Constraint that uses a Function object to define a single holonomic (position) constraint equation acting to relate a set of generalized coordinates q. More...
#include <Constraint.h>
Public Member Functions | |
CoordinateCoupler (SimbodyMatterSubsystem &matter, const Function *function, const Array_< MobilizedBodyIndex > &coordMobod, const Array_< MobilizerQIndex > &coordQIndex) | |
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. | |
CoordinateCoupler () | |
Default constructor creates an empty handle. |
This is a Constraint that uses a Function object to define a single holonomic (position) constraint equation acting to relate a set of generalized coordinates q.
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. For example, if you wanted q1 and q2 to be constrained to have the same value you could define your function f as f=q1-q2.
SimTK::Constraint::CoordinateCoupler::CoordinateCoupler | ( | SimbodyMatterSubsystem & | matter, |
const Function * | function, | ||
const Array_< MobilizedBodyIndex > & | coordMobod, | ||
const Array_< MobilizerQIndex > & | coordQIndex | ||
) |
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 its mobilizer. For example
matter.getMobilizedBody(coordMobod[2]).getOneQ(state, coordQIndex[2])
will be passed to the Function as the value of the second argument.
matter | The matter subsystem to which this constraint will be added. |
function | The Function whose value should be maintained at zero by this constraint at all times. The constraint takes over ownership of this object, and automatically deletes in when the constraint is deleted. |
coordMobod | The MobilizedBody corresponding to each generalized coordinate that should be passed as a function argument. |
coordQIndex | 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.
Default constructor creates an empty handle.