Skip to content

Commit

Permalink
Update gui version45 (#1476)
Browse files Browse the repository at this point in the history
* Get changes to Model, MocoTrajectory, SmoothSegmentedFunction and PolynomialPathFitter

* Update Bundles

* update visualizer welcome page

* use newer splash screen

* Add contributor

* Update doxygen link to 4.5 documentation to be uploaded
  • Loading branch information
aymanhab authored Nov 30, 2023
1 parent dba4e3d commit 6062f55
Show file tree
Hide file tree
Showing 13 changed files with 142 additions and 11 deletions.
Original file line number Diff line number Diff line change
@@ -1,10 +1,10 @@
currentVersion=OpenSim 4.4
currentVersion=OpenSim 4.5
SPLASH_HEIGHT=472
SPLASH_WIDTH=380
SplashProgressBarBounds=0,466,380,6
SplashProgressBarColor=0xD1E27F
SplashRunningTextBounds=8,455,163,8
SplashRunningTextColor=0xFFFFFF
SplashRunningTextFontSize=15
LBL_splash_window_title=Starting OpenSim 4.4
LBL_splash_window_title=Starting OpenSim 4.5
SplashShowProgressBar=true
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Original file line number Diff line number Diff line change
@@ -1,3 +1,3 @@
CTL_MainWindow_Title=OpenSim 4.4
CTL_MainWindow_Title_No_Project=OpenSim 4.4
CTL_MainWindow_Title=OpenSim 4.5
CTL_MainWindow_Title_No_Project=OpenSim 4.5

Original file line number Diff line number Diff line change
Expand Up @@ -47,7 +47,7 @@ public final class OpenDoxygenAction extends CallableSystemAction {
public void performAction() {
try {
String basePath = TheApp.getCrossPlatformInstallDir();
String doxygenPath = BrowserLauncher.isConnected() ? "https://simtk.org/api_docs/opensim/api_docs44/" :
String doxygenPath = BrowserLauncher.isConnected() ? "https://simtk.org/api_docs/opensim/api_docs45/" :
new File(basePath + "/sdk/doc/OpenSimAPI.html").toURI().toURL().toString();

BrowserLauncher.openURL(doxygenPath);
Expand Down
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
24 changes: 24 additions & 0 deletions Gui/opensim/modeling/src/org/opensim/modeling/MocoTrajectory.java
Original file line number Diff line number Diff line change
Expand Up @@ -623,6 +623,14 @@ public int getNumSpeeds() {
return opensimMocoJNI.MocoTrajectory_getNumSpeeds(swigCPtr, this);
}

public int getNumMultibodyStates() {
return opensimMocoJNI.MocoTrajectory_getNumMultibodyStates(swigCPtr, this);
}

public int getNumAuxiliaryStates() {
return opensimMocoJNI.MocoTrajectory_getNumAuxiliaryStates(swigCPtr, this);
}

public int getNumAccelerations() {
return opensimMocoJNI.MocoTrajectory_getNumAccelerations(swigCPtr, this);
}
Expand Down Expand Up @@ -659,6 +667,14 @@ public StdVectorString getSpeedNames() {
return new StdVectorString(opensimMocoJNI.MocoTrajectory_getSpeedNames(swigCPtr, this), true);
}

public StdVectorString getMultibodyStateNames() {
return new StdVectorString(opensimMocoJNI.MocoTrajectory_getMultibodyStateNames(swigCPtr, this), true);
}

public StdVectorString getAuxiliaryStateNames() {
return new StdVectorString(opensimMocoJNI.MocoTrajectory_getAuxiliaryStateNames(swigCPtr, this), true);
}

public StdVectorString getAccelerationNames() {
return new StdVectorString(opensimMocoJNI.MocoTrajectory_getAccelerationNames(swigCPtr, this), true);
}
Expand Down Expand Up @@ -715,6 +731,14 @@ public Matrix getSpeedsTrajectory() {
return new Matrix(opensimMocoJNI.MocoTrajectory_getSpeedsTrajectory(swigCPtr, this), true);
}

public Matrix getMultibodyStatesTrajectory() {
return new Matrix(opensimMocoJNI.MocoTrajectory_getMultibodyStatesTrajectory(swigCPtr, this), true);
}

public Matrix getAuxiliaryStatesTrajectory() {
return new Matrix(opensimMocoJNI.MocoTrajectory_getAuxiliaryStatesTrajectory(swigCPtr, this), true);
}

public Matrix getAccelerationsTrajectory() {
return new Matrix(opensimMocoJNI.MocoTrajectory_getAccelerationsTrajectory(swigCPtr, this), true);
}
Expand Down
21 changes: 21 additions & 0 deletions Gui/opensim/modeling/src/org/opensim/modeling/Model.java
Original file line number Diff line number Diff line change
Expand Up @@ -1217,6 +1217,27 @@ public SWIGTYPE_p_SimTK__GeneralForceSubsystem updForceSubsystem() {
return new SWIGTYPE_p_SimTK__GeneralForceSubsystem(opensimSimulationJNI.Model_updForceSubsystem(swigCPtr, this), false);
}

/**
* (Advanced) Get read only access to internal Simbody RigidBodyForces at Dynamics stage *
*/
public VectorOfSpatialVec getRigidBodyForces(State state) {
return new VectorOfSpatialVec(opensimSimulationJNI.Model_getRigidBodyForces(swigCPtr, this, State.getCPtr(state), state), false);
}

/**
* (Advanced) Get read only access to internal Simbody Mobility Forces at Dynamics stage *
*/
public Vector getMobilityForces(State state) {
return new Vector(opensimSimulationJNI.Model_getMobilityForces(swigCPtr, this, State.getCPtr(state), state), false);
}

/**
* (Advanced) Get read only access to internal Simbody Body Forces due to Gravity *
*/
public VectorOfSpatialVec getGravityBodyForces(State state) {
return new VectorOfSpatialVec(opensimSimulationJNI.Model_getGravityBodyForces(swigCPtr, this, State.getCPtr(state), state), false);
}

/**
* ** Perform computations that depend only on time and earlier stages. *
*/
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -197,11 +197,12 @@ public PolynomialPathFitter(PolynomialPathFitter arg0) {
* polynomial-based path objects will be fitted.<br>
* <br>
* The model should be provided using a `ModelProcessor` object. We expect<br>
* the model to contain at least one path object derived from `AbstractGeometryPath`<br>
* and does not already contain any `FunctionBasedPath` objects. The bounds<br>
* for clamped coordinates are obeyed during the fitting process. Locked<br>
* coordinates are unlocked if data is provided for them, or replaced with<br>
* WeldJoints if no data is provided for them.
* the model to contain at least one path object derived from<br>
* `AbstractGeometryPath` and does not already contain any<br>
* `FunctionBasedPath` objects. The bounds for clamped coordinates are<br>
* obeyed during the fitting process. Locked coordinates are unlocked if<br>
* data is provided for them, or replaced with WeldJoints if no data is<br>
* provided for them.
*/
public void setModel(ModelProcessor model) {
opensimActuatorsAnalysesToolsJNI.PolynomialPathFitter_setModel(swigCPtr, this, ModelProcessor.getCPtr(model), model);
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -142,6 +142,75 @@ public double calcDerivative(double x, int order) {
return opensimCommonJNI.SmoothSegmentedFunction_calcDerivative(swigCPtr, this, x, order);
}

static public class ValueAndDerivative {
private transient long swigCPtr;
protected transient boolean swigCMemOwn;

public ValueAndDerivative(long cPtr, boolean cMemoryOwn) {
swigCMemOwn = cMemoryOwn;
swigCPtr = cPtr;
}

public static long getCPtr(ValueAndDerivative obj) {
return (obj == null) ? 0 : obj.swigCPtr;
}

public static long swigRelease(ValueAndDerivative obj) {
long ptr = 0;
if (obj != null) {
if (!obj.swigCMemOwn)
throw new RuntimeException("Cannot release ownership as memory is not owned");
ptr = obj.swigCPtr;
obj.swigCMemOwn = false;
obj.delete();
}
return ptr;
}

@SuppressWarnings("deprecation")
protected void finalize() {
delete();
}

public synchronized void delete() {
if (swigCPtr != 0) {
if (swigCMemOwn) {
swigCMemOwn = false;
opensimCommonJNI.delete_SmoothSegmentedFunction_ValueAndDerivative(swigCPtr);
}
swigCPtr = 0;
}
}

public void setValue(double value) {
opensimCommonJNI.SmoothSegmentedFunction_ValueAndDerivative_value_set(swigCPtr, this, value);
}

public double getValue() {
return opensimCommonJNI.SmoothSegmentedFunction_ValueAndDerivative_value_get(swigCPtr, this);
}

public void setDerivative(double value) {
opensimCommonJNI.SmoothSegmentedFunction_ValueAndDerivative_derivative_set(swigCPtr, this, value);
}

public double getDerivative() {
return opensimCommonJNI.SmoothSegmentedFunction_ValueAndDerivative_derivative_get(swigCPtr, this);
}

public ValueAndDerivative() {
this(opensimCommonJNI.new_SmoothSegmentedFunction_ValueAndDerivative(), true);
}

}

/**
* Returns the same as calcValue(x) and calcDerivative(x, 1), but more
*/
public SmoothSegmentedFunction.ValueAndDerivative calcValueAndFirstDerivative(double x) {
return new SmoothSegmentedFunction.ValueAndDerivative(opensimCommonJNI.SmoothSegmentedFunction_calcValueAndFirstDerivative(swigCPtr, this, x), true);
}

/**
* This will return the value of the integral of this objects curve <br>
* evaluated at x. <br>
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -1078,6 +1078,13 @@ public class opensimCommonJNI {
public final static native void delete_SmoothSegmentedFunction(long jarg1);
public final static native double SmoothSegmentedFunction_calcValue(long jarg1, SmoothSegmentedFunction jarg1_, double jarg2);
public final static native double SmoothSegmentedFunction_calcDerivative(long jarg1, SmoothSegmentedFunction jarg1_, double jarg2, int jarg3);
public final static native void SmoothSegmentedFunction_ValueAndDerivative_value_set(long jarg1, SmoothSegmentedFunction.ValueAndDerivative jarg1_, double jarg2);
public final static native double SmoothSegmentedFunction_ValueAndDerivative_value_get(long jarg1, SmoothSegmentedFunction.ValueAndDerivative jarg1_);
public final static native void SmoothSegmentedFunction_ValueAndDerivative_derivative_set(long jarg1, SmoothSegmentedFunction.ValueAndDerivative jarg1_, double jarg2);
public final static native double SmoothSegmentedFunction_ValueAndDerivative_derivative_get(long jarg1, SmoothSegmentedFunction.ValueAndDerivative jarg1_);
public final static native long new_SmoothSegmentedFunction_ValueAndDerivative();
public final static native void delete_SmoothSegmentedFunction_ValueAndDerivative(long jarg1);
public final static native long SmoothSegmentedFunction_calcValueAndFirstDerivative(long jarg1, SmoothSegmentedFunction jarg1_, double jarg2);
public final static native double SmoothSegmentedFunction_calcIntegral(long jarg1, SmoothSegmentedFunction jarg1_, double jarg2);
public final static native boolean SmoothSegmentedFunction_isIntegralAvailable(long jarg1, SmoothSegmentedFunction jarg1_);
public final static native boolean SmoothSegmentedFunction_isIntegralComputedLeftToRight(long jarg1, SmoothSegmentedFunction jarg1_);
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -1134,6 +1134,8 @@ public class opensimMocoJNI {
public final static native int MocoTrajectory_getNumDerivatives(long jarg1, MocoTrajectory jarg1_);
public final static native int MocoTrajectory_getNumValues(long jarg1, MocoTrajectory jarg1_);
public final static native int MocoTrajectory_getNumSpeeds(long jarg1, MocoTrajectory jarg1_);
public final static native int MocoTrajectory_getNumMultibodyStates(long jarg1, MocoTrajectory jarg1_);
public final static native int MocoTrajectory_getNumAuxiliaryStates(long jarg1, MocoTrajectory jarg1_);
public final static native int MocoTrajectory_getNumAccelerations(long jarg1, MocoTrajectory jarg1_);
public final static native int MocoTrajectory_getNumDerivativesWithoutAccelerations(long jarg1, MocoTrajectory jarg1_);
public final static native int MocoTrajectory_getNumParameters(long jarg1, MocoTrajectory jarg1_);
Expand All @@ -1143,6 +1145,8 @@ public class opensimMocoJNI {
public final static native long MocoTrajectory_getDerivativeNames(long jarg1, MocoTrajectory jarg1_);
public final static native long MocoTrajectory_getValueNames(long jarg1, MocoTrajectory jarg1_);
public final static native long MocoTrajectory_getSpeedNames(long jarg1, MocoTrajectory jarg1_);
public final static native long MocoTrajectory_getMultibodyStateNames(long jarg1, MocoTrajectory jarg1_);
public final static native long MocoTrajectory_getAuxiliaryStateNames(long jarg1, MocoTrajectory jarg1_);
public final static native long MocoTrajectory_getAccelerationNames(long jarg1, MocoTrajectory jarg1_);
public final static native long MocoTrajectory_getDerivativeNamesWithoutAccelerations(long jarg1, MocoTrajectory jarg1_);
public final static native long MocoTrajectory_getParameterNames(long jarg1, MocoTrajectory jarg1_);
Expand All @@ -1157,6 +1161,8 @@ public class opensimMocoJNI {
public final static native long MocoTrajectory_getDerivativesTrajectory(long jarg1, MocoTrajectory jarg1_);
public final static native long MocoTrajectory_getValuesTrajectory(long jarg1, MocoTrajectory jarg1_);
public final static native long MocoTrajectory_getSpeedsTrajectory(long jarg1, MocoTrajectory jarg1_);
public final static native long MocoTrajectory_getMultibodyStatesTrajectory(long jarg1, MocoTrajectory jarg1_);
public final static native long MocoTrajectory_getAuxiliaryStatesTrajectory(long jarg1, MocoTrajectory jarg1_);
public final static native long MocoTrajectory_getAccelerationsTrajectory(long jarg1, MocoTrajectory jarg1_);
public final static native long MocoTrajectory_getDerivativesWithoutAccelerationsTrajectory(long jarg1, MocoTrajectory jarg1_);
public final static native long MocoTrajectory_getParameters(long jarg1, MocoTrajectory jarg1_);
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -5343,6 +5343,9 @@ public class opensimSimulationJNI {
public final static native long Model_updGravityForce(long jarg1, Model jarg1_);
public final static native long Model_getForceSubsystem(long jarg1, Model jarg1_);
public final static native long Model_updForceSubsystem(long jarg1, Model jarg1_);
public final static native long Model_getRigidBodyForces(long jarg1, Model jarg1_, long jarg2, State jarg2_);
public final static native long Model_getMobilityForces(long jarg1, Model jarg1_, long jarg2, State jarg2_);
public final static native long Model_getGravityBodyForces(long jarg1, Model jarg1_, long jarg2, State jarg2_);
public final static native void Model_realizeTime(long jarg1, Model jarg1_, long jarg2, State jarg2_);
public final static native void Model_realizePosition(long jarg1, Model jarg1_, long jarg2, State jarg2_);
public final static native void Model_realizeVelocity(long jarg1, Model jarg1_, long jarg2, State jarg2_);
Expand Down
2 changes: 1 addition & 1 deletion opensim-visualizer

0 comments on commit 6062f55

Please sign in to comment.