Skip to content

Commit a9979b9

Browse files
committed
Merge branch 'develop' into feature/door-perception
2 parents c2a6b92 + fa9bdd2 commit a9979b9

File tree

10 files changed

+334
-68
lines changed

10 files changed

+334
-68
lines changed

ihmc-avatar-interfaces/src/main/java/us/ihmc/avatar/drcRobot/CommunicationsSyncedRobotModel.java

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -68,7 +68,8 @@ public CommunicationsSyncedRobotModel(DRCRobotModel robotModel,
6868
{
6969
for (RobotSide side : handModels.sides())
7070
{
71-
handWrenchCalculators.put(side, new HandWrenchCalculator(side, fullRobotModel, null, StateEstimatorParameters.ROBOT_CONFIGURATION_DATA_PUBLISH_DT));
71+
if (robotModel.getRobotVersion().hasSakeGripperJoints(side))
72+
handWrenchCalculators.put(side, new HandWrenchCalculator(side, fullRobotModel, null, StateEstimatorParameters.ROBOT_CONFIGURATION_DATA_PUBLISH_DT));
7273
}
7374
}
7475
}

ihmc-common-walking-control-modules/src/main/java/us/ihmc/commonWalkingControlModules/controllerCore/command/feedbackController/OneDoFJointFeedbackControlCommand.java

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -391,7 +391,7 @@ else if (object instanceof OneDoFJointFeedbackControlCommand)
391391
@Override
392392
public String toString()
393393
{
394-
return getClass().getSimpleName() + ": control mode: " + controlMode + ", q: " + referencePosition + ", qd: " + referenceVelocity + ", qdd: "
394+
return getClass().getSimpleName() + ": joint: " + joint.getName() + ", control mode: " + controlMode + ", q: " + referencePosition + ", qd: " + referenceVelocity + ", qdd: "
395395
+ referenceAcceleration + ", tau: " + referenceEffort;
396396
}
397397
}

ihmc-common-walking-control-modules/src/main/java/us/ihmc/commonWalkingControlModules/controllerCore/command/feedbackController/SpatialFeedbackControlCommand.java

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1326,8 +1326,8 @@ else if (object instanceof SpatialFeedbackControlCommand)
13261326
public String toString()
13271327
{
13281328
String ret = getClass().getSimpleName() + ": ";
1329-
ret += "base = " + spatialAccelerationCommand.getBase() + ", ";
1330-
ret += "endEffector = " + spatialAccelerationCommand.getEndEffector() + ", ";
1329+
ret += "base = " + spatialAccelerationCommand.getBase().getName() + ", ";
1330+
ret += "endEffector = " + spatialAccelerationCommand.getEndEffector().getName() + ", ";
13311331
ret += "position = " + referencePosition + ", orientation = " + referenceOrientation.toStringAsYawPitchRoll();
13321332
return ret;
13331333
}

ihmc-common-walking-control-modules/src/main/java/us/ihmc/commonWalkingControlModules/wrenchDistribution/CoPObjectiveCalculator.java

Lines changed: 12 additions & 33 deletions
Original file line numberDiff line numberDiff line change
@@ -1,12 +1,12 @@
1+
12
package us.ihmc.commonWalkingControlModules.wrenchDistribution;
23

4+
import org.ejml.data.DMatrix;
35
import org.ejml.data.DMatrixRMaj;
46
import org.ejml.dense.row.CommonOps_DDRM;
57
import us.ihmc.euclid.referenceFrame.interfaces.FramePoint2DReadOnly;
68
import us.ihmc.matrixlib.NativeMatrix;
79

8-
import java.lang.annotation.Native;
9-
1010
public class CoPObjectiveCalculator
1111
{
1212
private final DMatrixRMaj fzRow = new DMatrixRMaj(0, 0);
@@ -15,35 +15,8 @@ public class CoPObjectiveCalculator
1515
public void computeTask(DMatrixRMaj wrenchJacobianInPlaneFrame,
1616
FramePoint2DReadOnly desiredCoPInPlaneFrame,
1717
int rhoSize,
18-
NativeMatrix jacobianToPack,
19-
NativeMatrix objectiveToPack)
20-
{
21-
fzRow.reshape(1, rhoSize);
22-
singleCopRow.reshape(1, rhoSize);
23-
24-
int fzIndex = 5;
25-
CommonOps_DDRM.extractRow(wrenchJacobianInPlaneFrame, fzIndex, fzRow);
26-
27-
// [x_cop * J_fz + J_ty] * rho == 0
28-
int tauYIndex = 1;
29-
CommonOps_DDRM.extractRow(wrenchJacobianInPlaneFrame, tauYIndex, singleCopRow);
30-
CommonOps_DDRM.add(desiredCoPInPlaneFrame.getX(), fzRow, 1.0, singleCopRow, singleCopRow);
31-
jacobianToPack.insert(singleCopRow, 0, 0);
32-
33-
// [y_cop * J_fz - J_tx] * rho == 0
34-
int tauXIndex = 0;
35-
CommonOps_DDRM.extractRow(wrenchJacobianInPlaneFrame, tauXIndex, singleCopRow);
36-
CommonOps_DDRM.add(desiredCoPInPlaneFrame.getY(), fzRow, -1.0, singleCopRow, singleCopRow);
37-
jacobianToPack.insert(singleCopRow, 1, 0);
38-
39-
objectiveToPack.zero();
40-
}
41-
42-
public void computeTask(DMatrixRMaj wrenchJacobianInPlaneFrame,
43-
FramePoint2DReadOnly desiredCoPInPlaneFrame,
44-
int rhoSize,
45-
DMatrixRMaj jacobianToPack,
46-
DMatrixRMaj objectiveToPack)
18+
DMatrix jacobianToPack,
19+
DMatrix objectiveToPack)
4720
{
4821
fzRow.reshape(1, rhoSize);
4922
singleCopRow.reshape(1, rhoSize);
@@ -55,13 +28,19 @@ public void computeTask(DMatrixRMaj wrenchJacobianInPlaneFrame,
5528
int tauYIndex = 1;
5629
CommonOps_DDRM.extractRow(wrenchJacobianInPlaneFrame, tauYIndex, singleCopRow);
5730
CommonOps_DDRM.add(desiredCoPInPlaneFrame.getX(), fzRow, 1.0, singleCopRow, singleCopRow);
58-
CommonOps_DDRM.insert(singleCopRow, jacobianToPack, 0, 0);
31+
if (jacobianToPack instanceof NativeMatrix jacobian)
32+
jacobian.insert(singleCopRow, 0, 0);
33+
else
34+
CommonOps_DDRM.insert(singleCopRow, jacobianToPack, 0, 0);
5935

6036
// [y_cop * J_fz - J_tx] * rho == 0
6137
int tauXIndex = 0;
6238
CommonOps_DDRM.extractRow(wrenchJacobianInPlaneFrame, tauXIndex, singleCopRow);
6339
CommonOps_DDRM.add(desiredCoPInPlaneFrame.getY(), fzRow, -1.0, singleCopRow, singleCopRow);
64-
CommonOps_DDRM.insert(singleCopRow, jacobianToPack, 1, 0);
40+
if (jacobianToPack instanceof NativeMatrix jacobian)
41+
jacobian.insert(singleCopRow, 1, 0);
42+
else
43+
CommonOps_DDRM.insert(singleCopRow, jacobianToPack, 1, 0);
6544

6645
objectiveToPack.zero();
6746
}

ihmc-common-walking-control-modules/src/main/java/us/ihmc/commonWalkingControlModules/wrenchDistribution/WrenchMatrixCalculator.java

Lines changed: 3 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -284,6 +284,7 @@ public boolean getNextCenterOfPressureInput(NativeQPInputTypeA inputToPack)
284284
rhoStartIndex += helper.getRhoSize();
285285
}
286286

287+
// This reshape call also zeros the task objectives, jacobians, and weights
287288
inputToPack.reshape(2);
288289
inputToPack.setConstraintType(command.getConstraintType());
289290

@@ -293,14 +294,12 @@ public boolean getNextCenterOfPressureInput(NativeQPInputTypeA inputToPack)
293294
inputToPack.getTaskJacobian(),
294295
inputToPack.getTaskObjective());
295296

296-
inputToPack.getTaskObjective().zero();
297-
inputToPack.getTaskWeightMatrix().zero();
298297
if (command.getConstraintType() == ConstraintType.OBJECTIVE)
299298
{
300299
weight.setIncludingFrame(command.getWeight());
301300
weight.changeFrameAndProjectToXYPlane(planeFrame);
302-
inputToPack.getTaskWeightMatrix().set(0, 0, command.getWeight().getX());
303-
inputToPack.getTaskWeightMatrix().set(1, 1, command.getWeight().getY());
301+
inputToPack.getTaskWeightMatrix().set(0, 0, weight.getX());
302+
inputToPack.getTaskWeightMatrix().set(1, 1, weight.getY());
304303
}
305304
else if (command.getConstraintType() != ConstraintType.EQUALITY)
306305
{

0 commit comments

Comments
 (0)