/** * Converts this into an actual 3-by-3 selection matrix that is to be used with data expressed in * the {@code destinationFrame}. * <p> * Only the block (row=0, column=0) to (row=2, column=2) of {@code selectionMatrixToPack} is * edited to insert the selection matrix. The given dense-matrix is not reshaped. * </p> * * @param destinationFrame the reference frame in which the selection matrix is to be used. * @param selectionMatrixToPack the dense-matrix into which the 3-by-3 selection matrix is to be * inserted. Modified. * @throws MatrixDimensionException if the given matrix is too small. */ public void getFullSelectionMatrixInFrame(ReferenceFrame destinationFrame, DenseMatrix64F selectionMatrixToPack) { getFullSelectionMatrixInFrame(destinationFrame, 0, 0, selectionMatrixToPack); }
/** * Converts this into an actual 6-by-6 selection matrix that is to be used with data expressed in * the {@code destinationFrame}. * <p> * The given {@code selectionMatrixToPack} is first reshaped to be a 6-by-6 matrix which will be * set to represent this. * </p> * * @param destinationFrame the reference frame in which the selection matrix is to be used. * @param selectionMatrixToPack the dense-matrix is first reshaped to a 6-by-6 matrix and then * set to represent this. Modified. * @throws MatrixDimensionException if the given matrix is too small. */ public void getFullSelectionMatrixInFrame(ReferenceFrame destinationFrame, DenseMatrix64F selectionMatrixToPack) { selectionMatrixToPack.reshape(6, 6); selectionMatrixToPack.zero(); angularPart.getFullSelectionMatrixInFrame(destinationFrame, 0, 0, selectionMatrixToPack); linearPart.getFullSelectionMatrixInFrame(destinationFrame, 3, 3, selectionMatrixToPack); }
selectionMatrix3D.setSelectionFrame(selectionFrame); selectionMatrix3D.getFullSelectionMatrixInFrame(destinationFrame, expectedSelectionMatrix); MatrixTools.removeZeroRows(expectedSelectionMatrix, 1.0e-7);
public static void main(String[] args) { RigidBodyTransform t1 = new RigidBodyTransform(); Vector3D rotationVector = new Vector3D(); DenseMatrix64F rotationVectorMatrix = new DenseMatrix64F(3, 1); t1.appendYawRotation(Math.PI / 8.0); t1.getRotation(rotationVector); rotationVector.get(rotationVectorMatrix); SelectionMatrix3D selectionMatrix3d = new SelectionMatrix3D(); selectionMatrix3d.selectZAxis(false); DenseMatrix64F selectionMatrix = new DenseMatrix64F(3, 3); selectionMatrix3d.getFullSelectionMatrixInFrame(null, selectionMatrix); DenseMatrix64F result = new DenseMatrix64F(3, 1); CommonOps.mult(selectionMatrix, rotationVectorMatrix, result); System.out.println(result); rotationVector.set(result); RotationMatrix rm = new RotationMatrix(rotationVector); System.out.println(rm); } }
frameMatrix3D.setM22(zSelected ? 1.0 : 0.0); selectionMatrix3D.getFullSelectionMatrixInFrame(destinationFrame, actualSelectionMatrix); if (selectionFrame != null) frameMatrix3D.changeFrame(destinationFrame); DenseMatrix64F originalVector = new DenseMatrix64F(3, 1); randomVector.get(originalVector); selectionMatrix3D.getFullSelectionMatrixInFrame(destinationFrame, expectedSelectionMatrix); CommonOps.mult(expectedSelectionMatrix, originalVector, actualSubspaceVector);
angularPart3D.getFullSelectionMatrixInFrame(destinationFrame, 0, 0, expectedSelectionMatrix); linearPart3D.getFullSelectionMatrixInFrame(destinationFrame, 3, 3, expectedSelectionMatrix);
selectionMatrix3D.getFullSelectionMatrixInFrame(pelvisZUpFrame, selectionMatrix);
selectionMatrix3D.getFullSelectionMatrixInFrame(pelvisZUpFrame, selectionMatrix);