Search in sources :

Example 11 with NumericOutputProbe

use of artisynth.core.probes.NumericOutputProbe in project artisynth_core by artisynth.

the class ForceTargetDemo method addConForceProbe.

public void addConForceProbe(double duration, double interval) {
    ArrayList<Property> props = new ArrayList<Property>();
    for (BodyConnector rbc : mech.bodyConnectors()) {
        if (rbc.isEnabled() && rbc.getProperty("activation") != null) {
            props.add(rbc.getProperty("activation"));
        }
    }
    Property[] proparray = new Property[props.size()];
    for (int i = 0; i < props.size(); i++) {
        proparray[i] = props.get(i);
    }
    String name = "conforce";
    NumericOutputProbe p = new NumericOutputProbe(proparray, interval);
    p.setStartStopTimes(0, duration);
    p.setName(name);
    p.setAttachedFileName(name + "_output.txt");
    p.setDefaultDisplayRange(-0.1, 0.1);
    addOutputProbe(p);
}
Also used : ArrayList(java.util.ArrayList) NumericOutputProbe(artisynth.core.probes.NumericOutputProbe) Property(maspack.properties.Property) BodyConnector(artisynth.core.mechmodels.BodyConnector) TargetPoint(artisynth.core.inverse.TargetPoint)

Example 12 with NumericOutputProbe

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

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