Search in sources :

Example 6 with NumericOutputProbe

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();
    }
}
Also used : NumericInputProbe(artisynth.core.probes.NumericInputProbe) NumericOutputProbe(artisynth.core.probes.NumericOutputProbe)

Example 7 with NumericOutputProbe

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();
    }
}
Also used : NumericOutputProbe(artisynth.core.probes.NumericOutputProbe)

Example 8 with NumericOutputProbe

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());
    }
}
Also used : NumericInputProbe(artisynth.core.probes.NumericInputProbe) NumericOutputProbe(artisynth.core.probes.NumericOutputProbe) IOException(java.io.IOException)

Example 9 with NumericOutputProbe

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());
    }
}
Also used : NumericInputProbe(artisynth.core.probes.NumericInputProbe) NumericOutputProbe(artisynth.core.probes.NumericOutputProbe) IOException(java.io.IOException)

Example 10 with NumericOutputProbe

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;
}
Also used : NumericOutputProbe(artisynth.core.probes.NumericOutputProbe) NumericOutputProbe(artisynth.core.probes.NumericOutputProbe) Probe(artisynth.core.probes.Probe) NumericInputProbe(artisynth.core.probes.NumericInputProbe)

Aggregations

NumericOutputProbe (artisynth.core.probes.NumericOutputProbe)12 NumericInputProbe (artisynth.core.probes.NumericInputProbe)9 IOException (java.io.IOException)6 ArrayList (java.util.ArrayList)4 Property (maspack.properties.Property)4 WayPoint (artisynth.core.probes.WayPoint)2 File (java.io.File)2 AddComponentsCommand (artisynth.core.gui.editorManager.AddComponentsCommand)1 InputNumericProbeEditor (artisynth.core.gui.probeEditor.InputNumericProbeEditor)1 NumericProbeEditor (artisynth.core.gui.probeEditor.NumericProbeEditor)1 OutputNumericProbeEditor (artisynth.core.gui.probeEditor.OutputNumericProbeEditor)1 TargetPoint (artisynth.core.inverse.TargetPoint)1 BodyConnector (artisynth.core.mechmodels.BodyConnector)1 Frame (artisynth.core.mechmodels.Frame)1 Point (artisynth.core.mechmodels.Point)1 ModelComponent (artisynth.core.modelbase.ModelComponent)1 NumericProbeVariable (artisynth.core.probes.NumericProbeVariable)1 Probe (artisynth.core.probes.Probe)1 Point (java.awt.Point)1 LinkedHashMap (java.util.LinkedHashMap)1