Skip to content

Commit

Permalink
moved filtered parameters and pd gains to higher level projects
Browse files Browse the repository at this point in the history
removed unused visualizer types
  • Loading branch information
rjgriffin42 committed Oct 16, 2024
1 parent 67467a6 commit f1a2d76
Show file tree
Hide file tree
Showing 7 changed files with 28 additions and 470 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@
import us.ihmc.yoVariables.registry.YoRegistry;
import us.ihmc.yoVariables.variable.YoDouble;
import us.ihmc.robotics.math.filters.AccelerationLimitedYoVariable;
import us.ihmc.robotics.math.filters.FilteredVelocityYoVariable;
import us.ihmc.robotics.math.filters.FilteredFiniteDifferenceYoVariable;
import us.ihmc.robotics.math.functionGenerator.YoFunctionGenerator;
import us.ihmc.robotics.math.functionGenerator.YoFunctionGeneratorMode;
import us.ihmc.simulationconstructionset.Robot;
Expand All @@ -24,8 +24,8 @@ public class AccelerationLimitedYoVariableVisualizer

private final YoDouble raw;
private final YoDouble alphaVariable;
private final FilteredVelocityYoVariable rawRate;
private final FilteredVelocityYoVariable rawAcceleration;
private final FilteredFiniteDifferenceYoVariable rawRate;
private final FilteredFiniteDifferenceYoVariable rawAcceleration;

private static double amplitude = 2.0;
private static double frequency = 0.1;
Expand All @@ -43,8 +43,8 @@ public AccelerationLimitedYoVariableVisualizer()
raw = new YoDouble("raw", registry);
alphaVariable = new YoDouble("alpha", registry);
alphaVariable.set(0.0); //set to zero to prevent smoothing of velocity
rawRate = new FilteredVelocityYoVariable("rawRate", "", alphaVariable, raw, dt, registry);
rawAcceleration = new FilteredVelocityYoVariable("rawAcceleration", "", alphaVariable, rawRate, dt, registry);
rawRate = new FilteredFiniteDifferenceYoVariable("rawRate", "", alphaVariable, raw, dt, registry);
rawAcceleration = new FilteredFiniteDifferenceYoVariable("rawAcceleration", "", alphaVariable, rawRate, dt, registry);

scs = new SimulationConstructionSet(robot);
scs.changeBufferSize(bufferSize);
Expand Down

This file was deleted.

Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@

import us.ihmc.euclid.referenceFrame.FrameQuaternion;
import us.ihmc.euclid.referenceFrame.ReferenceFrame;
import us.ihmc.robotics.math.filters.FiniteDifferenceAngularVelocityYoFrameVector;
import us.ihmc.robotics.math.filters.FiniteDifferenceAngularVelocityYoFrameVector3D;
import us.ihmc.robotics.math.trajectories.SimpleOrientationTrajectoryGenerator;
import us.ihmc.simulationconstructionset.Robot;
import us.ihmc.simulationconstructionset.SimulationConstructionSet;
Expand All @@ -27,7 +27,7 @@ public FiniteDifferenceAngularVelocityYoFrameVectorVisualizer()
traj.initialize();

YoFrameQuaternion orientationToDifferentiate = new YoFrameQuaternion("orientationToDifferentiate", worldFrame, registry);
FiniteDifferenceAngularVelocityYoFrameVector filteredAngularVelocityYoFrameVector = new FiniteDifferenceAngularVelocityYoFrameVector("angularVelocityFD", orientationToDifferentiate, dt, registry);
FiniteDifferenceAngularVelocityYoFrameVector3D filteredAngularVelocityYoFrameVector = new FiniteDifferenceAngularVelocityYoFrameVector3D("angularVelocityFD", orientationToDifferentiate, dt, registry);

Robot robot = new Robot("Dummy");
YoDouble yoTime = robot.getYoTime();
Expand Down
Original file line number Diff line number Diff line change
@@ -1,8 +1,8 @@
package us.ihmc.scsVisualizers.filters;

import us.ihmc.robotics.math.filters.FirstOrderBandPassFilteredYoVariable;
import us.ihmc.robotics.math.filters.FirstOrderFilteredYoVariable;
import us.ihmc.robotics.math.filters.FirstOrderFilteredYoVariable.FirstOrderFilterType;
import us.ihmc.robotics.math.filters.FirstOrderBandPassFilteredYoDouble;
import us.ihmc.robotics.math.filters.FirstOrderFilteredYoDouble;
import us.ihmc.robotics.math.filters.FirstOrderFilteredYoDouble.FirstOrderFilterType;
import us.ihmc.simulationConstructionSetTools.util.inputdevices.MidiSliderBoard;
import us.ihmc.simulationconstructionset.Robot;
import us.ihmc.simulationconstructionset.SimulationConstructionSet;
Expand Down Expand Up @@ -56,9 +56,9 @@ private static class FilterController implements RobotController
private final YoDouble minPassThroughFreq_radPerSec;
private final YoDouble maxPassThroughFreq_radPerSec;

private final FirstOrderFilteredYoVariable highPass;
private final FirstOrderFilteredYoVariable lowPass;
private final FirstOrderBandPassFilteredYoVariable bandPass;
private final FirstOrderFilteredYoDouble highPass;
private final FirstOrderFilteredYoDouble lowPass;
private final FirstOrderBandPassFilteredYoDouble bandPass;

private final YoDouble properAmplitudeHighPass;
private final YoDouble properAmplitudeLowPass;
Expand Down Expand Up @@ -87,9 +87,15 @@ public FilterController(Robot robot, double DT, String name)
this.maxPassThroughFreq_radPerSec = new YoDouble("maxFreq_radPerSec", registry);
maxPassThroughFreq_radPerSec.set(100.0);

this.highPass = new FirstOrderFilteredYoVariable("highPass", "", minPassThroughFreq_radPerSec.getDoubleValue() / (2.0*Math.PI), robot.getYoTime(), FirstOrderFilterType.HIGH_PASS, registry);
this.lowPass = new FirstOrderFilteredYoVariable("lowPass", "", maxPassThroughFreq_radPerSec.getDoubleValue() / (2.0*Math.PI), robot.getYoTime(), FirstOrderFilterType.LOW_PASS, registry);
this.bandPass = new FirstOrderBandPassFilteredYoVariable("bandPass", "", minPassThroughFreq_radPerSec.getDoubleValue() / (2.0*Math.PI), maxPassThroughFreq_radPerSec.getDoubleValue() / (2.0*Math.PI), robot.getYoTime(), registry);
this.highPass = new FirstOrderFilteredYoDouble("highPass", "", minPassThroughFreq_radPerSec.getDoubleValue() / (2.0 * Math.PI), robot.getYoTime(), FirstOrderFilterType.HIGH_PASS, registry);
this.lowPass = new FirstOrderFilteredYoDouble("lowPass", "", maxPassThroughFreq_radPerSec.getDoubleValue() / (2.0 * Math.PI), robot.getYoTime(), FirstOrderFilterType.LOW_PASS, registry);
this.bandPass = new FirstOrderBandPassFilteredYoDouble("bandPass",
"",
minPassThroughFreq_radPerSec.getDoubleValue() / (2.0*Math.PI),
maxPassThroughFreq_radPerSec.getDoubleValue() / (2.0*Math.PI),
robot.getYoTime(),
FirstOrderBandPassFilteredYoDouble.FirstOrderFilterType.BAND,
registry);

this.properAmplitudeHighPass = new YoDouble("properAmplitudeHighPass", registry);
this.properAmplitudeLowPass = new YoDouble("properAmplitudeLowPass", registry);
Expand Down
Loading

0 comments on commit f1a2d76

Please sign in to comment.