Search in sources :

Example 6 with TrackingController

use of artisynth.core.inverse.TrackingController in project artisynth_core by artisynth.

the class PointModel method addTrackingController.

public void addTrackingController() {
    TrackingController myTrackingController = new TrackingController(model, "tcon");
    for (AxialSpring s : model.axialSprings()) {
        if (s instanceof Muscle) {
            myTrackingController.addExciter((Muscle) s);
        }
    }
    // myTrackingController.addTerm(new StiffnessTerm(model, center));
    // StiffnessTerm kTerm = TrackingController.addStiffnessTarget(center, new int[]{0,2});
    // kTerm.setStiffnessTargetType(StiffnessTargetType.DIAG);
    // ComplianceTerm2d cterm = new ComplianceTerm2d(TrackingController, center, new int[]{0,2});
    // cterm.setComplianceTargetType(StiffnessTargetType.DIAG);
    // TrackingController.addTerm(cterm);
    myTrackingController.addL2RegularizationTerm();
    // myTrackingController.addTerm(new DampingTerm(TrackingController));
    // myTrackingController.addTerm(new StaticMotionTargetTerm(TrackingController));
    MotionTargetComponent target = myTrackingController.addMotionTarget(center);
    RenderProps.setPointRadius((Renderable) target, 0.525);
    if (useReactionForceTargetP) {
        ForceTargetTerm forceTerm = new ForceTargetTerm(myTrackingController);
        ForceTarget ft = forceTerm.addForceTarget(model.bodyConnectors().get("center_constraint"));
        ft.setArrowSize(2);
        RenderProps.setLineStyle(ft, LineStyle.CYLINDER);
        RenderProps.setLineRadius(ft, 0.25);
        forceTerm.setWeight(1d);
        myTrackingController.addForceTargetTerm(forceTerm);
    }
    // myTrackingController.getSolver().setBounds(0.01, 0.99);
    myTrackingController.createProbesAndPanel(this);
    addController(myTrackingController);
}
Also used : LinearAxialMuscle(artisynth.core.materials.LinearAxialMuscle) Muscle(artisynth.core.mechmodels.Muscle) ForceTargetTerm(artisynth.core.inverse.ForceTargetTerm) ForceTarget(artisynth.core.inverse.ForceTarget) MotionTargetComponent(artisynth.core.mechmodels.MotionTargetComponent) AxialSpring(artisynth.core.mechmodels.AxialSpring) TrackingController(artisynth.core.inverse.TrackingController)

Aggregations

TrackingController (artisynth.core.inverse.TrackingController)6 MuscleBundle (artisynth.core.femmodels.MuscleBundle)2 ForceTarget (artisynth.core.inverse.ForceTarget)2 ForceTargetTerm (artisynth.core.inverse.ForceTargetTerm)2 AxialSpring (artisynth.core.mechmodels.AxialSpring)2 Muscle (artisynth.core.mechmodels.Muscle)2 FemNode (artisynth.core.femmodels.FemNode)1 TargetPoint (artisynth.core.inverse.TargetPoint)1 LinearAxialMuscle (artisynth.core.materials.LinearAxialMuscle)1 SimpleAxialMuscle (artisynth.core.materials.SimpleAxialMuscle)1 ExcitationComponent (artisynth.core.mechmodels.ExcitationComponent)1 MechSystemBase (artisynth.core.mechmodels.MechSystemBase)1 MotionTargetComponent (artisynth.core.mechmodels.MotionTargetComponent)1 ModelComponent (artisynth.core.modelbase.ModelComponent)1 Color (java.awt.Color)1 VectorNd (maspack.matrix.VectorNd)1