Search in sources :

Example 6 with BodyConnector

use of artisynth.core.mechmodels.BodyConnector 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)

Aggregations

BodyConnector (artisynth.core.mechmodels.BodyConnector)6 MechModel (artisynth.core.mechmodels.MechModel)4 RevoluteJoint (artisynth.core.mechmodels.RevoluteJoint)4 SphericalJoint (artisynth.core.mechmodels.SphericalJoint)4 RigidBody (artisynth.core.mechmodels.RigidBody)3 WayPoint (artisynth.core.probes.WayPoint)3 TargetPoint (artisynth.core.inverse.TargetPoint)1 AxialSpring (artisynth.core.mechmodels.AxialSpring)1 CollisionManager (artisynth.core.mechmodels.CollisionManager)1 FrameMarker (artisynth.core.mechmodels.FrameMarker)1 PlanarConnector (artisynth.core.mechmodels.PlanarConnector)1 MutableCompositeComponent (artisynth.core.modelbase.MutableCompositeComponent)1 NumericOutputProbe (artisynth.core.probes.NumericOutputProbe)1 Color (java.awt.Color)1 ArrayList (java.util.ArrayList)1 RigidTransform3d (maspack.matrix.RigidTransform3d)1 SparseBlockMatrix (maspack.matrix.SparseBlockMatrix)1 VectorNd (maspack.matrix.VectorNd)1 Property (maspack.properties.Property)1 InternalErrorException (maspack.util.InternalErrorException)1