use of artisynth.core.probes.NumericInputProbe in project artisynth_core by artisynth.
the class ForceTargetDemo method reloadTargetProbeData.
public void reloadTargetProbeData() throws IOException {
ArtisynthPath.setWorkingDir(new File(ArtisynthPath.getSrcRelativePath(this, "data/ForceTargetDemo")));
NumericInputProbe forceTargetProbe = (NumericInputProbe) getInputProbes().get("target forces");
forceTargetProbe.setAttachedFileName("force_target.txt");
forceTargetProbe.load();
forceTargetProbe.setActive(true);
NumericInputProbe motionTargetProbe = (NumericInputProbe) getInputProbes().get("target positions");
motionTargetProbe.setAttachedFileName("motion_target.txt");
motionTargetProbe.load();
motionTargetProbe.setActive(true);
}
use of artisynth.core.probes.NumericInputProbe in project artisynth_core by artisynth.
the class FemMuscleArm method addProbes.
public void addProbes() {
NumericInputProbe ip;
NumericOutputProbe op;
double rate = 0.01;
try {
ip = new NumericInputProbe(model, "models/muscle:excitation", 0, 2.0);
ip.addData(new double[] { 0, 0, 1, 0.5, 2, 0 }, NumericInputProbe.EXPLICIT_TIME);
ip.setName("Muscle Activation");
addInputProbe(ip);
op = new NumericOutputProbe(model, "frameMarkers/endPoint:displacement", 0, 2, -1);
op.setName("End Point Displacement");
addOutputProbe(op);
} catch (Exception e) {
System.out.println(e.getMessage());
}
}
use of artisynth.core.probes.NumericInputProbe in project artisynth_core by artisynth.
the class FemMuscleDemo method addProbes.
protected void addProbes(FemMuscleModel fem) {
try {
String[] exciters;
if (addMidMuscle) {
exciters = new String[] { "bundles/0:excitation", "bundles/1:excitation", "bundles/2:excitation" };
} else {
exciters = new String[] { "bundles/0:excitation", "bundles/1:excitation" };
}
NumericInputProbe inprobe = new NumericInputProbe(fem, exciters, 0, 5);
if (addMidMuscle) {
inprobe.addData(new double[] { 0, 0, 0, 0, 2.5, 0.1, 0, 0.1, 3.5, 0, 0, 0, 5, 0, 0, 0 }, NumericInputProbe.EXPLICIT_TIME);
} else {
inprobe.addData(new double[] { 0, 0, 0, 2.5, 0.1, 0, 3.5, 0, 0, 5, 0, 0 }, NumericInputProbe.EXPLICIT_TIME);
}
addInputProbe(inprobe);
} catch (Exception e) {
e.printStackTrace();
}
}
use of artisynth.core.probes.NumericInputProbe in project artisynth_core by artisynth.
the class CoupledSolveDemo method build.
public void build(String[] args) {
MechModel mechMod = new MechModel("mechModel");
mechMod.setPenetrationTol(1e-5);
mechMod.setMaxStepSize(0.01);
mechMod.setIntegrator(Integrator.ConstrainedBackwardEuler);
addModel(mechMod);
// add the FemMod
addFemModel();
addCollider();
NumericInputProbe probe = new NumericInputProbe(collider, "position", 0, 5.0);
probe.addData(new double[] { 0.0, 0, 0, 0.05, 1.0, 0, 0, 0.01, 1.5, 0, 0, 0.05, 2.5, 0, 0, 0.01, 3.0, 0, 0, 0.01, 3.5, 0, 0, 0.05, 4.5, 0, 0, 0.01, 5.0, 0, 0, 0.05 }, NumericInputProbe.EXPLICIT_TIME);
addInputProbe(probe);
probe = new NumericInputProbe(collider, "velocity", 0, 5.0);
probe.addData(new double[] { 0.0, 0, 0, -0.04, 0, 0, 0, 1.0, 0, 0, 0.08, 0, 0, 0, 1.5, 0, 0, -0.04, 0, 0, 0, 2.5, 0, 0, 0.00, 0, 0, 0, 3.0, 0, 0, 0.08, 0, 0, 0, 3.5, 0, 0, -0.04, 0, 0, 0, 4.5, 0, 0, 0.08, 0, 0, 0, 5.0, 0, 0, 0.00, 0, 0, 0 }, NumericInputProbe.EXPLICIT_TIME);
probe.setInterpolationOrder(Interpolation.Order.Step);
addInputProbe(probe);
addBreakPoint(2.5);
probe.setActive(true);
}
Aggregations