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);
}
Aggregations