Skip to content

Commit 4815806

Browse files
committed
Fixing spatialFeedbackController.
Set the selectionMatrix.getAngularPar().setAxisSelection(false,false, true) makes error.
1 parent 8a91523 commit 4815806

File tree

2 files changed

+8
-5
lines changed

2 files changed

+8
-5
lines changed

ihmc-common-walking-control-modules/src/main/java/us/ihmc/commonWalkingControlModules/momentumBasedController/feedbackController/taskspace/SpatialFeedbackController.java

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -411,7 +411,8 @@ public void submitFeedbackControlCommand(SpatialFeedbackControlCommand command)
411411
dampingRatioMatrix.set(4,4, gains.getPositionGains().getDampingRatios()[1]);
412412
dampingRatioMatrix.set(5,5, gains.getPositionGains().getDampingRatios()[2]);
413413
command.getSpatialAccelerationCommand().getSelectionMatrix(selectionMatrix);
414-
selectionMatrix.getAngularPart().setAxisSelection(false, false, true);
414+
// This one should be set from the orientation gains, put zero for x, y kind of this way
415+
// selectionMatrix.getAngularPart().setAxisSelection(false, false, true);
415416
angularGainsFrame = command.getAngularGainsFrame();
416417
linearGainsFrame = command.getLinearGainsFrame();
417418

ihmc-common-walking-control-modules/src/test/java/us/ihmc/commonWalkingControlModules/momentumBasedController/feedbackController/taskspace/ImpedanceSpatialFeedbackControllerTest.java

Lines changed: 6 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -93,9 +93,9 @@ public void testBaseFrame()
9393
spatialFeedbackControlCommand.set(baseBody, endEffector);
9494
spatialFeedbackControlCommand.setGains(gains);
9595
spatialFeedbackControlCommand.setInverseDynamics(desiredPose, zero, zero);
96-
spatialFeedbackController.submitFeedbackControlCommand(spatialFeedbackControlCommand);
9796
spatialFeedbackController.setEnabled(true);
9897
spatialFeedbackController.setImpedanceEnabled(true);
98+
spatialFeedbackController.submitFeedbackControlCommand(spatialFeedbackControlCommand);
9999

100100
MotionQPInputCalculator motionQPInputCalculator = toolbox.getMotionQPInputCalculator();
101101
NativeQPInputTypeA motionQPInput = new NativeQPInputTypeA(MultiBodySystemTools.computeDegreesOfFreedom(joints));
@@ -174,9 +174,10 @@ public void testConvergence() throws Exception
174174
spatialFeedbackControlCommand.setGains(gains);
175175
spatialFeedbackControlCommand.setControlFrameFixedInEndEffector(bodyFixedPointToControl);
176176
spatialFeedbackControlCommand.setInverseDynamics(desiredOrientation, desiredPosition, new FrameVector3D(worldFrame), new FrameVector3D(worldFrame), new FrameVector3D(worldFrame), new FrameVector3D(worldFrame));
177-
spatialFeedbackController.submitFeedbackControlCommand(spatialFeedbackControlCommand);
178177
spatialFeedbackController.setEnabled(true);
179178
spatialFeedbackController.setImpedanceEnabled(true);
179+
spatialFeedbackController.submitFeedbackControlCommand(spatialFeedbackControlCommand);
180+
180181

181182
int numberOfDoFs = MultiBodySystemTools.computeDegreesOfFreedom(jointsToOptimizeFor);
182183
NativeQPInputTypeA motionQPInput = new NativeQPInputTypeA(numberOfDoFs);
@@ -275,16 +276,17 @@ public void testConvergenceWithJerryQP() throws Exception
275276
SpatialFeedbackControlCommand spatialFeedbackControlCommand = new SpatialFeedbackControlCommand();
276277
spatialFeedbackControlCommand.set(elevator, endEffector);
277278
DefaultPIDSE3Gains gains = new DefaultPIDSE3Gains();
278-
gains.getPositionGains().setProportialAndDerivativeGains(1.5, Double.NaN);
279+
gains.getPositionGains().setProportialAndDerivativeGains(10, Double.NaN);
279280
gains.getOrientationGains().setProportialAndDerivativeGains(1.5, Double.NaN);
280281
gains.getPositionGains().setDampingRatios(1);
281282
gains.getOrientationGains().setDampingRatios(1);
282283
spatialFeedbackControlCommand.setGains(gains);
283284
spatialFeedbackControlCommand.setControlFrameFixedInEndEffector(bodyFixedPointToControl);
284285
spatialFeedbackControlCommand.setInverseDynamics(desiredOrientation, desiredPosition, new FrameVector3D(worldFrame), new FrameVector3D(worldFrame), new FrameVector3D(worldFrame), new FrameVector3D(worldFrame));
285-
spatialFeedbackController.submitFeedbackControlCommand(spatialFeedbackControlCommand);
286286
spatialFeedbackController.setEnabled(true);
287287
spatialFeedbackController.setImpedanceEnabled(true);
288+
spatialFeedbackController.submitFeedbackControlCommand(spatialFeedbackControlCommand);
289+
288290

289291
int numberOfDoFs = MultiBodySystemTools.computeDegreesOfFreedom(jointsToOptimizeFor);
290292
NativeQPInputTypeA motionQPInput = new NativeQPInputTypeA(numberOfDoFs);

0 commit comments

Comments
 (0)