Go to the documentation of this file. 1 #ifndef SimTK_SIMBODY_ASSEMBLY_CONDITION_QVALUE_H_
2 #define SimTK_SIMBODY_ASSEMBLY_CONDITION_QVALUE_H_
49 mobodIndex(mbx), qIndex(qx), value(value) {}
64 error[0] = mobod.
getOneQ(state, qIndex) - value;
81 if (thisFreeIx.isValid())
108 if (thisFreeIx.isValid())
109 grad[thisFreeIx] = mobod.
getOneQ(state, qIndex) - value;
122 #endif // SimTK_SIMBODY_ASSEMBLY_CONDITION_QVALUE_H_
This object is intended to contain all state information for a SimTK::System, except topological info...
Definition: State.h:280
Assembler::FreeQIndex getFreeQIndexOfQ(QIndex qx) const
Ask the assembler where to find the free q (if any) that corresponds to a given q in the State; only ...
Definition: AssemblyCondition.h:176
QIndex getFirstQIndex(const State &state) const
Return the global QIndex of the first q for this mobilizer; all the q's range from getFirstQIndex() t...
int calcErrorJacobian(const State &state, Matrix &J) const override
Override to supply an analytic Jacobian for the assembly errors returned by calcErrors().
Definition: AssemblyCondition_QValue.h:69
int calcGoalGradient(const State &state, Vector &grad) const override
Override to supply an analytic gradient for this assembly condition's goal.
Definition: AssemblyCondition_QValue.h:96
const MobilizedBody & getMobilizedBody(MobilizedBodyIndex) const
Given a MobilizedBodyIndex, return a read-only (const) reference to the corresponding MobilizedBody w...
void setValue(Real newValue)
Change the value to be used for this generalized coordinate; this can be done repeatedly during track...
Definition: AssemblyCondition_QValue.h:56
This is a System that represents the dynamics of a particle moving along a smooth surface.
Definition: Assembler.h:37
unsigned char square(unsigned char u)
Definition: Scalar.h:349
const SimbodyMatterSubsystem & getMatterSubsystem() const
Ask the assembler for the MultibodySystem with which it is associated and extract the SimbodyMatterSu...
Definition: AssemblyCondition.h:183
This subsystem contains the bodies ("matter") in the multibody system, the mobilizers (joints) that d...
Definition: SimbodyMatterSubsystem.h:133
int calcErrors(const State &state, Vector &error) const override
Calculate the amount by which this assembly condition is violated by the q values in the given state,...
Definition: AssemblyCondition_QValue.h:60
int getNumEquations(const State &) const
Definition: AssemblyCondition_QValue.h:59
int calcGoal(const State &state, Real &goal) const override
Calculate the current contribution (>= 0) of this assembly condition to the goal value that is being ...
Definition: AssemblyCondition_QValue.h:88
A MobilizedBody is Simbody's fundamental body-and-joint object used to parameterize a system's motion...
Definition: MobilizedBody.h:168
Real getValue() const
Return the currently set value to be used for this generalized coordinate.
Definition: AssemblyCondition_QValue.h:53
SimTK_Real Real
This is the default compiled-in floating point type for SimTK, either float or double.
Definition: SimTKcommon/include/SimTKcommon/internal/common.h:606
int getNumFreeQs() const
Ask the assembler how many free q's there are; only valid after initialization but does not invoke in...
Definition: AssemblyCondition.h:167
QValue(MobilizedBodyIndex mbx, MobilizerQIndex qx, Real value)
Construct an assembly condition that requests that the specified generalized coordinate be brought to...
Definition: AssemblyCondition_QValue.h:46
Define an assembly condition consisting of a scalar goal and/or a related set of assembly error equat...
Definition: AssemblyCondition.h:44
Real getOneQ(const State &state, int which) const
Return one of the generalized coordinates q from this mobilizer's partition of the matter subsystem's...
This AssemblyCondition requests that a particular generalized coordinate end up with a specified valu...
Definition: AssemblyCondition_QValue.h:41