Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Update core bindings 092624 #1521

Merged
merged 3 commits into from
Oct 9, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Original file line number Diff line number Diff line change
Expand Up @@ -162,10 +162,25 @@ public double getLengtheningSpeed(State s) {
return opensimSimulationJNI.AbstractGeometryPath_getLengtheningSpeed(swigCPtr, this, State.getCPtr(s), s);
}

/**
* Requests that the concrete implementation produces forces resulting from<br>
* applying a tension along its path, emitting them into the supplied<br>
* `ForceConsumer`.<br>
* <br>
* @param state the state used to evaluate forces<br>
* @param tension scalar of the applied (+ve) tensile force<br>
* @param forceConsumer a `ForceConsumer` shall receive each produced force
*/
public void produceForces(State state, double tension, SWIGTYPE_p_OpenSim__ForceConsumer forceConsumer) {
opensimSimulationJNI.AbstractGeometryPath_produceForces(swigCPtr, this, State.getCPtr(state), state, tension, SWIGTYPE_p_OpenSim__ForceConsumer.getCPtr(forceConsumer));
}

/**
* Add in the equivalent body and generalized forces to be applied to the<br>
* multibody system resulting from a tension along the AbstractGeometryPath.<br>
* <br>
* Note: this internally uses `produceForces`<br>
* <br>
* @param state state used to evaluate forces<br>
* @param tension scalar of the applied (+ve) tensile force<br>
* @param bodyForces Vector of forces (SpatialVec's) on bodies<br>
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -15,7 +15,7 @@
* <br>
* @author Ajay Seth
*/
public class Actuator extends Force {
public class Actuator extends ForceProducer {
private transient long swigCPtr;

public Actuator(long cPtr, boolean cMemoryOwn) {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -166,6 +166,33 @@ public void computeEquilibrium(State s) {
opensimSimulationJNI.ActuatorIterator_computeEquilibrium(swigCPtr, this, State.getCPtr(s), s);
}

/**
* Uses `implProduceForces` to produce (emit) forces evaluated from `state` into the<br>
* provided `ForceConsumer`.<br>
* <br>
* Note: this function only produces the forces and does not apply them to anything. It's<br>
* up to the `ForceConsumer` implementation to handle the forces. Therefore,<br>
* `Force::appliesForces` is ignored by this method.<br>
* <br>
* @param state the state used to evaluate forces<br>
*
*/
public void produceForces(State state, SWIGTYPE_p_OpenSim__ForceConsumer forceConsumer) {
opensimSimulationJNI.ActuatorIterator_produceForces(swigCPtr, this, State.getCPtr(state), state, SWIGTYPE_p_OpenSim__ForceConsumer.getCPtr(forceConsumer));
}

/**
* Inhereted from `OpenSim::Force`.<br>
* <br>
* `ForceProducer` overrides `OpenSim::Force::computeForce` with a default<br>
* implementation that, provided `OpenSim::Force::appliesForces` is `true`,<br>
* internally uses `produceForces` to mutate the provided `bodyForces` in a<br>
* manner that's compatible with the `OpenSim::Force` API.
*/
public void computeForce(State state, VectorOfSpatialVec bodyForces, Vector generalizedForces) {
opensimSimulationJNI.ActuatorIterator_computeForce(swigCPtr, this, State.getCPtr(state), state, VectorOfSpatialVec.getCPtr(bodyForces), bodyForces, Vector.getCPtr(generalizedForces), generalizedForces);
}

public boolean get_appliesForce(int i) {
return opensimSimulationJNI.ActuatorIterator_get_appliesForce__SWIG_0(swigCPtr, this, i);
}
Expand Down Expand Up @@ -707,7 +734,11 @@ public AbstractOutput getOutput(String name) {
* @see Component#resolveVariableNameAndOwner()
*/
public int getModelingOption(State state, String path) {
return opensimSimulationJNI.ActuatorIterator_getModelingOption(swigCPtr, this, State.getCPtr(state), state, path);
return opensimSimulationJNI.ActuatorIterator_getModelingOption__SWIG_0(swigCPtr, this, State.getCPtr(state), state, path);
}

public int getModelingOption(State state, ComponentPath path) {
return opensimSimulationJNI.ActuatorIterator_getModelingOption__SWIG_1(swigCPtr, this, State.getCPtr(state), state, ComponentPath.getCPtr(path), path);
}

/**
Expand Down Expand Up @@ -736,7 +767,11 @@ public int getModelingOption(State state, String path) {
* @see Component#resolveVariableNameAndOwner()
*/
public void setModelingOption(State state, String path, int flag) {
opensimSimulationJNI.ActuatorIterator_setModelingOption(swigCPtr, this, State.getCPtr(state), state, path, flag);
opensimSimulationJNI.ActuatorIterator_setModelingOption__SWIG_0(swigCPtr, this, State.getCPtr(state), state, path, flag);
}

public void setModelingOption(State state, ComponentPath path, int flag) {
opensimSimulationJNI.ActuatorIterator_setModelingOption__SWIG_1(swigCPtr, this, State.getCPtr(state), state, ComponentPath.getCPtr(path), path, flag);
}

/**
Expand Down Expand Up @@ -770,7 +805,7 @@ public double getStateVariableValue(State state, String name) {
}<br>
* <br>
* @param state the State for which to get the value<br>
* <br>
* @param path path to the state variable of interest<br>
* @throws ComponentHasNoSystem if this Component has not been added to a<br>
* System (i.e., if initSystem has not been called)
*/
Expand Down Expand Up @@ -835,7 +870,19 @@ public void setStateVariableValues(State state, Vector values) {
* System (i.e., if initSystem has not been called)
*/
public double getStateVariableDerivativeValue(State state, String name) {
return opensimSimulationJNI.ActuatorIterator_getStateVariableDerivativeValue(swigCPtr, this, State.getCPtr(state), state, name);
return opensimSimulationJNI.ActuatorIterator_getStateVariableDerivativeValue__SWIG_0(swigCPtr, this, State.getCPtr(state), state, name);
}

/**
* Get the value of a state variable derivative computed by this Component.<br>
* <br>
* @param state the State for which to get the derivative value<br>
* @param path path to the state variable of interest<br>
* @throws ComponentHasNoSystem if this Component has not been added to a<br>
* System (i.e., if initSystem has not been called)
*/
public double getStateVariableDerivativeValue(State state, ComponentPath path) {
return opensimSimulationJNI.ActuatorIterator_getStateVariableDerivativeValue__SWIG_1(swigCPtr, this, State.getCPtr(state), state, ComponentPath.getCPtr(path), path);
}

/**
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -60,8 +60,7 @@ public ActuatorList(Component root, ComponentFilter f) {

/**
* Constructor that takes only a Component to iterate over (itself and its<br>
* descendants). ComponentFilterMatchAll is used internally. You can<br>
* change the filter using setFilter() method.
* descendants). You can change the filter using setFilter() method.
*/
public ActuatorList(Component root) {
this(opensimSimulationJNI.new_ActuatorList__SWIG_1(Component.getCPtr(root), root), true);
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -147,7 +147,7 @@ When scaling a model (using the ScaleTool) that contains a


*/
public class Blankevoort1991Ligament extends Force {
public class Blankevoort1991Ligament extends ForceProducer {
private transient long swigCPtr;

public Blankevoort1991Ligament(long cPtr, boolean cMemoryOwn) {
Expand Down Expand Up @@ -579,10 +579,6 @@ public double computeMomentArm(State s, Coordinate aCoord) {
return opensimSimulationJNI.Blankevoort1991Ligament_computeMomentArm(swigCPtr, this, State.getCPtr(s), s, Coordinate.getCPtr(aCoord), aCoord);
}

public void computeForce(State s, VectorOfSpatialVec bodyForces, Vector generalizedForces) {
opensimSimulationJNI.Blankevoort1991Ligament_computeForce(swigCPtr, this, State.getCPtr(s), s, VectorOfSpatialVec.getCPtr(bodyForces), bodyForces, Vector.getCPtr(generalizedForces), generalizedForces);
}

public double computePotentialEnergy(State state) {
return opensimSimulationJNI.Blankevoort1991Ligament_computePotentialEnergy(swigCPtr, this, State.getCPtr(state), state);
}
Expand Down
28 changes: 24 additions & 4 deletions Gui/opensim/modeling/src/org/opensim/modeling/BodyIterator.java
Original file line number Diff line number Diff line change
Expand Up @@ -984,7 +984,11 @@ public AbstractOutput getOutput(String name) {
* @see Component#resolveVariableNameAndOwner()
*/
public int getModelingOption(State state, String path) {
return opensimSimulationJNI.BodyIterator_getModelingOption(swigCPtr, this, State.getCPtr(state), state, path);
return opensimSimulationJNI.BodyIterator_getModelingOption__SWIG_0(swigCPtr, this, State.getCPtr(state), state, path);
}

public int getModelingOption(State state, ComponentPath path) {
return opensimSimulationJNI.BodyIterator_getModelingOption__SWIG_1(swigCPtr, this, State.getCPtr(state), state, ComponentPath.getCPtr(path), path);
}

/**
Expand Down Expand Up @@ -1013,7 +1017,11 @@ public int getModelingOption(State state, String path) {
* @see Component#resolveVariableNameAndOwner()
*/
public void setModelingOption(State state, String path, int flag) {
opensimSimulationJNI.BodyIterator_setModelingOption(swigCPtr, this, State.getCPtr(state), state, path, flag);
opensimSimulationJNI.BodyIterator_setModelingOption__SWIG_0(swigCPtr, this, State.getCPtr(state), state, path, flag);
}

public void setModelingOption(State state, ComponentPath path, int flag) {
opensimSimulationJNI.BodyIterator_setModelingOption__SWIG_1(swigCPtr, this, State.getCPtr(state), state, ComponentPath.getCPtr(path), path, flag);
}

/**
Expand Down Expand Up @@ -1047,7 +1055,7 @@ public double getStateVariableValue(State state, String name) {
}<br>
* <br>
* @param state the State for which to get the value<br>
* <br>
* @param path path to the state variable of interest<br>
* @throws ComponentHasNoSystem if this Component has not been added to a<br>
* System (i.e., if initSystem has not been called)
*/
Expand Down Expand Up @@ -1112,7 +1120,19 @@ public void setStateVariableValues(State state, Vector values) {
* System (i.e., if initSystem has not been called)
*/
public double getStateVariableDerivativeValue(State state, String name) {
return opensimSimulationJNI.BodyIterator_getStateVariableDerivativeValue(swigCPtr, this, State.getCPtr(state), state, name);
return opensimSimulationJNI.BodyIterator_getStateVariableDerivativeValue__SWIG_0(swigCPtr, this, State.getCPtr(state), state, name);
}

/**
* Get the value of a state variable derivative computed by this Component.<br>
* <br>
* @param state the State for which to get the derivative value<br>
* @param path path to the state variable of interest<br>
* @throws ComponentHasNoSystem if this Component has not been added to a<br>
* System (i.e., if initSystem has not been called)
*/
public double getStateVariableDerivativeValue(State state, ComponentPath path) {
return opensimSimulationJNI.BodyIterator_getStateVariableDerivativeValue__SWIG_1(swigCPtr, this, State.getCPtr(state), state, ComponentPath.getCPtr(path), path);
}

/**
Expand Down
3 changes: 1 addition & 2 deletions Gui/opensim/modeling/src/org/opensim/modeling/BodyList.java
Original file line number Diff line number Diff line change
Expand Up @@ -60,8 +60,7 @@ public BodyList(Component root, ComponentFilter f) {

/**
* Constructor that takes only a Component to iterate over (itself and its<br>
* descendants). ComponentFilterMatchAll is used internally. You can<br>
* change the filter using setFilter() method.
* descendants). You can change the filter using setFilter() method.
*/
public BodyList(Component root) {
this(opensimSimulationJNI.new_BodyList__SWIG_1(Component.getCPtr(root), root), true);
Expand Down
28 changes: 24 additions & 4 deletions Gui/opensim/modeling/src/org/opensim/modeling/Component.java
Original file line number Diff line number Diff line change
Expand Up @@ -863,7 +863,11 @@ public AbstractOutput updOutput(String name) {
* @see Component#resolveVariableNameAndOwner()
*/
public int getModelingOption(State state, String path) {
return opensimCommonJNI.Component_getModelingOption(swigCPtr, this, State.getCPtr(state), state, path);
return opensimCommonJNI.Component_getModelingOption__SWIG_0(swigCPtr, this, State.getCPtr(state), state, path);
}

public int getModelingOption(State state, ComponentPath path) {
return opensimCommonJNI.Component_getModelingOption__SWIG_1(swigCPtr, this, State.getCPtr(state), state, ComponentPath.getCPtr(path), path);
}

/**
Expand Down Expand Up @@ -892,7 +896,11 @@ public int getModelingOption(State state, String path) {
* @see Component#resolveVariableNameAndOwner()
*/
public void setModelingOption(State state, String path, int flag) {
opensimCommonJNI.Component_setModelingOption(swigCPtr, this, State.getCPtr(state), state, path, flag);
opensimCommonJNI.Component_setModelingOption__SWIG_0(swigCPtr, this, State.getCPtr(state), state, path, flag);
}

public void setModelingOption(State state, ComponentPath path, int flag) {
opensimCommonJNI.Component_setModelingOption__SWIG_1(swigCPtr, this, State.getCPtr(state), state, ComponentPath.getCPtr(path), path, flag);
}

/**
Expand Down Expand Up @@ -926,7 +934,7 @@ public double getStateVariableValue(State state, String name) {
}<br>
* <br>
* @param state the State for which to get the value<br>
* <br>
* @param path path to the state variable of interest<br>
* @throws ComponentHasNoSystem if this Component has not been added to a<br>
* System (i.e., if initSystem has not been called)
*/
Expand Down Expand Up @@ -991,7 +999,19 @@ public void setStateVariableValues(State state, Vector values) {
* System (i.e., if initSystem has not been called)
*/
public double getStateVariableDerivativeValue(State state, String name) {
return opensimCommonJNI.Component_getStateVariableDerivativeValue(swigCPtr, this, State.getCPtr(state), state, name);
return opensimCommonJNI.Component_getStateVariableDerivativeValue__SWIG_0(swigCPtr, this, State.getCPtr(state), state, name);
}

/**
* Get the value of a state variable derivative computed by this Component.<br>
* <br>
* @param state the State for which to get the derivative value<br>
* @param path path to the state variable of interest<br>
* @throws ComponentHasNoSystem if this Component has not been added to a<br>
* System (i.e., if initSystem has not been called)
*/
public double getStateVariableDerivativeValue(State state, ComponentPath path) {
return opensimCommonJNI.Component_getStateVariableDerivativeValue__SWIG_1(swigCPtr, this, State.getCPtr(state), state, ComponentPath.getCPtr(path), path);
}

/**
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -587,7 +587,11 @@ public AbstractOutput getOutput(String name) {
* @see Component#resolveVariableNameAndOwner()
*/
public int getModelingOption(State state, String path) {
return opensimCommonJNI.ComponentIterator_getModelingOption(swigCPtr, this, State.getCPtr(state), state, path);
return opensimCommonJNI.ComponentIterator_getModelingOption__SWIG_0(swigCPtr, this, State.getCPtr(state), state, path);
}

public int getModelingOption(State state, ComponentPath path) {
return opensimCommonJNI.ComponentIterator_getModelingOption__SWIG_1(swigCPtr, this, State.getCPtr(state), state, ComponentPath.getCPtr(path), path);
}

/**
Expand Down Expand Up @@ -616,7 +620,11 @@ public int getModelingOption(State state, String path) {
* @see Component#resolveVariableNameAndOwner()
*/
public void setModelingOption(State state, String path, int flag) {
opensimCommonJNI.ComponentIterator_setModelingOption(swigCPtr, this, State.getCPtr(state), state, path, flag);
opensimCommonJNI.ComponentIterator_setModelingOption__SWIG_0(swigCPtr, this, State.getCPtr(state), state, path, flag);
}

public void setModelingOption(State state, ComponentPath path, int flag) {
opensimCommonJNI.ComponentIterator_setModelingOption__SWIG_1(swigCPtr, this, State.getCPtr(state), state, ComponentPath.getCPtr(path), path, flag);
}

/**
Expand Down Expand Up @@ -650,7 +658,7 @@ public double getStateVariableValue(State state, String name) {
}<br>
* <br>
* @param state the State for which to get the value<br>
* <br>
* @param path path to the state variable of interest<br>
* @throws ComponentHasNoSystem if this Component has not been added to a<br>
* System (i.e., if initSystem has not been called)
*/
Expand Down Expand Up @@ -715,7 +723,19 @@ public void setStateVariableValues(State state, Vector values) {
* System (i.e., if initSystem has not been called)
*/
public double getStateVariableDerivativeValue(State state, String name) {
return opensimCommonJNI.ComponentIterator_getStateVariableDerivativeValue(swigCPtr, this, State.getCPtr(state), state, name);
return opensimCommonJNI.ComponentIterator_getStateVariableDerivativeValue__SWIG_0(swigCPtr, this, State.getCPtr(state), state, name);
}

/**
* Get the value of a state variable derivative computed by this Component.<br>
* <br>
* @param state the State for which to get the derivative value<br>
* @param path path to the state variable of interest<br>
* @throws ComponentHasNoSystem if this Component has not been added to a<br>
* System (i.e., if initSystem has not been called)
*/
public double getStateVariableDerivativeValue(State state, ComponentPath path) {
return opensimCommonJNI.ComponentIterator_getStateVariableDerivativeValue__SWIG_1(swigCPtr, this, State.getCPtr(state), state, ComponentPath.getCPtr(path), path);
}

/**
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -65,6 +65,13 @@ public synchronized void delete() {
}
}

/**
* Returns the separator used to delimit path elements in the path
*/
public static char separator() {
return opensimCommonJNI.ComponentPath_separator();
}

/**
* Returns the root component path (i.e. "/")
*/
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -60,8 +60,7 @@ public ComponentsList(Component root, ComponentFilter f) {

/**
* Constructor that takes only a Component to iterate over (itself and its<br>
* descendants). ComponentFilterMatchAll is used internally. You can<br>
* change the filter using setFilter() method.
* descendants). You can change the filter using setFilter() method.
*/
public ComponentsList(Component root) {
this(opensimCommonJNI.new_ComponentsList__SWIG_1(Component.getCPtr(root), root), true);
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,7 @@

/**
* A class implementing a constraint that maintains a constant distance between<br>
* between two points on separate PhysicalFrames. <br>
* two points on separate PhysicalFrames. <br>
* The underlying SimTK::Constraint in Simbody is a SimTK::Constraint::Rod.<br>
* <br>
* @author Matt DeMers
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -11,25 +11,25 @@
/**
* Generate a force that acts to limit the range of motion of a coordinate.<br>
* Force is experienced at upper and lower limits of the coordinate value<br>
* according to a constant stiffnesses K_upper and K_lower, with a C2 continuous<br>
* according to constant stiffnesses K_upper and K_lower, with a C2-continuous<br>
* transition from 0 to K. The transition parameter defines how far beyond the<br>
* limit the stiffness becomes constant. The integrator will like smoother<br>
* (i.e. larger transition regions).<br>
* (i.e. larger) transition regions.<br>
* <br>
* Damping factor is also phased in through the transition region from 0 to the<br>
* value provided.<br>
* <br>
* Limiting force is guaranteed to be zero within the upper and lower limits.<br>
* <br>
* The potential energy stored in the spring component of the force is<br>
* accessible as well as the power (nd optionally energy) dissipated.<br>
* accessible as well as the power (and, optionally, energy) dissipated.<br>
* The function has the following shape:<br>
* <br>
* <img src="coordinate_limit_force.png"/><br>
* <br>
* @author Ajay Seth
*/
public class CoordinateLimitForce extends Force {
public class CoordinateLimitForce extends ForceProducer {
private transient long swigCPtr;

public CoordinateLimitForce(long cPtr, boolean cMemoryOwn) {
Expand Down
Loading
Loading