use of artisynth.core.probes.NumericOutputProbe in project artisynth_core by artisynth.
the class SpringMeshDemo method addProbes.
public void addProbes(MechModel mech) {
try {
NumericInputProbe inprobe = new NumericInputProbe(mech, "particles/pnt0:targetPosition", ArtisynthPath.getSrcRelativePath(SpringMeshDemo.class, // inprobe.setDefaultDisplayRange (-10, 10);
"springMeshIn.txt"));
inprobe.setStopTime(10);
// NumericInputProbe inprobe =
// new NumericInputProbe (
// mech, "particles/0" + sep + "targetPosition", 0, 10);
// inprobe.addData (
// new double[] { 0, 2, -2, 0, 5, 2, -2, 0, 10, 2, -2, 0 },
// NumericInputProbe.EXPLICIT_TIME);
addInputProbe(inprobe);
// for (int i=0; i<3; i++) {
// inprobe = new NumericInputProbe (
// mech, "particles/0:targetPosition", i*2.2, i*2.2+2);
// addInputProbe (inprobe);
// }ply
NumericOutputProbe collector = new NumericOutputProbe(mech, "particles/pnt7:position", ArtisynthPath.getSrcRelativePath(this, "springMeshOut.txt"), 0.01);
collector.setDefaultDisplayRange(-40, 20);
collector.setStartTime(0);
collector.setStopTime(10);
addOutputProbe(collector);
} catch (Exception e) {
e.printStackTrace();
}
}
use of artisynth.core.probes.NumericOutputProbe in project artisynth_core by artisynth.
the class MassSpringDemo method addOutputProbe.
protected void addOutputProbe() {
try {
NumericOutputProbe collector = new NumericOutputProbe(this, "models/massSpring/particles/0:position", null, 0.01);
collector.setDefaultDisplayRange(-40, 20);
collector.setStopTime(10);
addOutputProbe(collector);
} catch (Exception e) {
e.printStackTrace();
}
}
use of artisynth.core.probes.NumericOutputProbe in project artisynth_core by artisynth.
the class MuscleArm method addProbes.
public void addProbes() {
NumericInputProbe ip;
NumericOutputProbe op;
double rate = 0.01;
try {
String path = ArtisynthPath.getHomeRelativePath("src/artisynth/demos/mech/", ".");
ip = new NumericInputProbe(model, "axialSprings/muscle:excitation", path + "muscleArmActivation.txt");
ip.setStartStopTimes(0, 10.0);
ip.setName("Muscle Activation");
// ip.setActive (false);
addInputProbe(ip);
// op = new NumericOutputProbe(model,
// "axialSprings/muscle/forceNorm",
// "muscleForce.txt", rate);
// op.setName("Muscle Force");
// op.setStartStopTimesSec (0, 10.0);
// addOutputProbe(op);
// op = new NumericOutputProbe(model,
// "frameMarkers/endPoint/displacement",
// "displacement.txt", rate);
// op.setName("End Point Displacement");
// op.setStartStopTimesSec (0, 10.0);
// addOutputProbe(op);
} catch (Exception e) {
System.out.println(e.getMessage());
}
}
use of artisynth.core.probes.NumericOutputProbe in project artisynth_core by artisynth.
the class WrappedMuscleArm method addProbes.
public void addProbes() {
NumericInputProbe ip;
NumericOutputProbe op;
double rate = 0.01;
try {
String path = ArtisynthPath.getHomeRelativePath("src/artisynth/demos/mech/", ".");
ip = new NumericInputProbe(model, "multiPointSprings/muscle:excitation", path + "muscleArmActivation.txt");
ip.setStartStopTimes(0, 10.0);
ip.setName("Muscle Activation");
// ip.setActive (false);
addInputProbe(ip);
} catch (Exception e) {
System.out.println(e.getMessage());
}
}
use of artisynth.core.probes.NumericOutputProbe in project artisynth_core by artisynth.
the class InverseManager method findOrCreateOutputProbe.
public static NumericOutputProbe findOrCreateOutputProbe(RootModel root, String name) {
NumericOutputProbe outProbe;
Probe p = root.getOutputProbes().get(name);
if (p != null && p instanceof NumericOutputProbe) {
outProbe = (NumericOutputProbe) p;
} else {
outProbe = new NumericOutputProbe();
outProbe.setName(name);
root.addOutputProbe(outProbe);
}
return outProbe;
}
Aggregations