Skip to content

Commit c396c43

Browse files
author
gwiedebach
committed
Removed last method with argument from the WalkingControllerParameters! The configuring of the ToeSlippingDetectior now works through a parameter class.
1 parent 8624d94 commit c396c43

File tree

5 files changed

+60
-38
lines changed

5 files changed

+60
-38
lines changed

Atlas/src/us/ihmc/atlas/parameters/AtlasWalkingControllerParameters.java

Lines changed: 3 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -18,8 +18,8 @@
1818
import us.ihmc.commonWalkingControlModules.configurations.SteppingParameters;
1919
import us.ihmc.commonWalkingControlModules.configurations.SwingTrajectoryParameters;
2020
import us.ihmc.commonWalkingControlModules.configurations.ToeOffParameters;
21+
import us.ihmc.commonWalkingControlModules.configurations.ToeSlippingDetectorParameters;
2122
import us.ihmc.commonWalkingControlModules.configurations.WalkingControllerParameters;
22-
import us.ihmc.commonWalkingControlModules.controlModules.foot.ToeSlippingDetector;
2323
import us.ihmc.commonWalkingControlModules.controlModules.rigidBody.RigidBodyControlMode;
2424
import us.ihmc.commonWalkingControlModules.controllerCore.command.inverseDynamics.JointAccelerationIntegrationSettings;
2525
import us.ihmc.commonWalkingControlModules.instantaneousCapturePoint.ICPControlGains;
@@ -141,13 +141,9 @@ public boolean enableToeOffSlippingDetection()
141141

142142
/** {@inheritDoc} */
143143
@Override
144-
public void configureToeSlippingDetector(ToeSlippingDetector toeSlippingDetectorToConfigure)
144+
public ToeSlippingDetectorParameters getToeSlippingDetectorParameters()
145145
{
146-
double forceMagnitudeThreshold = 25.0;
147-
double velocityThreshold = 0.4;
148-
double slippageDistanceThreshold = 0.04;
149-
double filterBreakFrequency = 10.0;
150-
toeSlippingDetectorToConfigure.configure(forceMagnitudeThreshold, velocityThreshold, slippageDistanceThreshold, filterBreakFrequency);
146+
return new ToeSlippingDetectorParameters();
151147
}
152148

153149
/** @inheritDoc */
Lines changed: 39 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,39 @@
1+
package us.ihmc.commonWalkingControlModules.configurations;
2+
3+
public class ToeSlippingDetectorParameters
4+
{
5+
/**
6+
* Returns the forceMagnitudeThreshold. As long as the foot force magnitude remains above this
7+
* threshold, the toe will be considered as not slipping.
8+
*/
9+
public double getForceMagnitudeThreshold()
10+
{
11+
return 25.0;
12+
}
13+
14+
/**
15+
* Returns the velocityThreshold. This is one of the conditions to trigger the slipping detection: the
16+
* toe linear velocity magnitude has to be greater than this threshold.
17+
*/
18+
public double getVelocityThreshold()
19+
{
20+
return 0.4;
21+
}
22+
23+
/**
24+
* Returns the slippageDistanceThreshold. This is one of the condition to trigger the slipping
25+
* detection: the amount of slipping has to be greater than this threshold.
26+
*/
27+
public double getSlippageDistanceThreshold()
28+
{
29+
return 0.04;
30+
}
31+
32+
/**
33+
* Returns the filterBreakFrequency. This the break frequency to use for the internal low-pass filters.
34+
*/
35+
public double getFilterBreakFrequency()
36+
{
37+
return 10.0;
38+
}
39+
}

CommonWalkingControlModules/src/us/ihmc/commonWalkingControlModules/configurations/WalkingControllerParameters.java

Lines changed: 6 additions & 13 deletions
Original file line numberDiff line numberDiff line change
@@ -99,23 +99,16 @@ public boolean enableToeOffSlippingDetection()
9999
}
100100

101101
/**
102-
* Method will set robot specific parameters in the provided {@link #ToeSlippingDetector}.
103-
* Note that this method is only called if {@link #enableToeOffSlippingDetection()} returns {@code true}.
104-
* </p>
105-
* Override this method to configure the parameters as follows:
106-
* </p>
107-
* {@code double forceMagnitudeThreshold = 25.0;}</br>
108-
* {@code double velocityThreshold = 0.4;}</br>
109-
* {@code double double slippageDistanceThreshold = 0.04;}</br>
110-
* {@code double filterBreakFrequency = 10.0;}</br>
111-
* {@code toeSlippingDetectorToConfigure.configure(forceMagnitudeThreshold, velocityThreshold, slippageDistanceThreshold, filterBreakFrequency);}
102+
* Method returns robot specific parameters for the {@link #ToeSlippingDetector}.
103+
* <p>
104+
* Must be overwritten if {@link #enableToeOffSlippingDetection()} returns {@code true}.
112105
* </p>
113-
* @param toeSlippingDetectorToConfigure (modified)
106+
* @return the parameters for slip detection during toe off.
114107
* @see ToeSlippingDetector#configure(double, double, double, double)
115108
*/
116-
public void configureToeSlippingDetector(ToeSlippingDetector toeSlippingDetectorToConfigure)
109+
public ToeSlippingDetectorParameters getToeSlippingDetectorParameters()
117110
{
118-
throw new RuntimeException("Override this method if using the " + ToeSlippingDetector.class.getSimpleName());
111+
return null;
119112
}
120113

121114
/**

CommonWalkingControlModules/src/us/ihmc/commonWalkingControlModules/controlModules/foot/FootControlHelper.java

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -75,7 +75,7 @@ public FootControlHelper(RobotSide robotSide, WalkingControllerParameters walkin
7575
double controlDT = controllerToolbox.getControlDT();
7676
FootSwitchInterface footSwitch = controllerToolbox.getFootSwitches().get(robotSide);
7777
toeSlippingDetector = new ToeSlippingDetector(namePrefix, controlDT, foot, footSwitch, registry);
78-
walkingControllerParameters.configureToeSlippingDetector(toeSlippingDetector);
78+
toeSlippingDetector.configure(walkingControllerParameters.getToeSlippingDetectorParameters());
7979
}
8080
else
8181
{

CommonWalkingControlModules/src/us/ihmc/commonWalkingControlModules/controlModules/foot/ToeSlippingDetector.java

Lines changed: 11 additions & 17 deletions
Original file line numberDiff line numberDiff line change
@@ -1,8 +1,6 @@
11
package us.ihmc.commonWalkingControlModules.controlModules.foot;
22

3-
import us.ihmc.yoVariables.registry.YoVariableRegistry;
4-
import us.ihmc.yoVariables.variable.YoBoolean;
5-
import us.ihmc.yoVariables.variable.YoDouble;
3+
import us.ihmc.commonWalkingControlModules.configurations.ToeSlippingDetectorParameters;
64
import us.ihmc.euclid.referenceFrame.FramePoint3D;
75
import us.ihmc.euclid.referenceFrame.FrameVector3D;
86
import us.ihmc.euclid.referenceFrame.ReferenceFrame;
@@ -13,6 +11,9 @@
1311
import us.ihmc.robotics.screwTheory.Twist;
1412
import us.ihmc.robotics.screwTheory.Wrench;
1513
import us.ihmc.robotics.sensors.FootSwitchInterface;
14+
import us.ihmc.yoVariables.registry.YoVariableRegistry;
15+
import us.ihmc.yoVariables.variable.YoBoolean;
16+
import us.ihmc.yoVariables.variable.YoDouble;
1617

1718
public class ToeSlippingDetector
1819
{
@@ -69,22 +70,15 @@ public ToeSlippingDetector(String namePrefix, double controlDT, RigidBody foot,
6970
* toe-off is strongly slipping. When this is the case, the walking controller will attempt to
7071
* stop the toe-off by swinging the foot.
7172
* </p>
72-
*
73-
* @param forceMagnitudeThreshold as long as the foot force magnitude remains above this
74-
* threshold, the toe will be considered as not slipping.
75-
* @param velocityThreshold this is one of the condition to trigger the slipping detection: the
76-
* toe linear velocity magnitude has to be greater than this threshold.
77-
* @param slippageDistanceThreshold this is one of the condition to trigger the slipping
78-
* detection: the amount of slipping has to be greater than this threshold.
79-
* @param filterBreakFrequency this the break frequency to use for the internal low-pass filters.
73+
* @param parameters contain the values that the internal parameters will be set to.
74+
* @see ToeSlippingDetectorParameters
8075
*/
81-
public void configure(double forceMagnitudeThreshold, double velocityThreshold, double slippageDistanceThreshold,
82-
double filterBreakFrequency)
76+
public void configure(ToeSlippingDetectorParameters parameters)
8377
{
84-
this.forceMagnitudeThreshold.set(forceMagnitudeThreshold);
85-
this.velocityThreshold.set(velocityThreshold);
86-
this.slippageDistanceThreshold.set(slippageDistanceThreshold);
87-
alpha.set(AlphaFilteredYoVariable.computeAlphaGivenBreakFrequencyProperly(filterBreakFrequency, dt));
78+
this.forceMagnitudeThreshold.set(parameters.getForceMagnitudeThreshold());
79+
this.velocityThreshold.set(parameters.getVelocityThreshold());
80+
this.slippageDistanceThreshold.set(parameters.getSlippageDistanceThreshold());
81+
alpha.set(AlphaFilteredYoVariable.computeAlphaGivenBreakFrequencyProperly(parameters.getFilterBreakFrequency(), dt));
8882
}
8983

9084
private final FramePoint3D toeContactPointPosition = new FramePoint3D();

0 commit comments

Comments
 (0)