@Override public ReferenceFrame getReferenceFrame() { return referenceAcceleration.getReferenceFrame(); }
private void checkExpressedInFrames(TwistReadOnly desiredTwist, SpatialAccelerationReadOnly feedForwardAcceleration, TwistReadOnly currentTwist) { checkExpressedInFrames(desiredTwist, currentTwist); feedForwardAcceleration.getReferenceFrame().checkReferenceFrameMatch(bodyFrame); }
/** * Gets a representative {@code String} of {@code spatialAcceleration} given a specific format to * use. * <p> * Using the default format {@link #DEFAULT_FORMAT}, this provides a {@code String} as follows: * * <pre> * Spatial acceleration of bodyFrame, with respect to baseFrame: [angular = ( 0.174, 0.732, -0.222 ), linear = ( 0.174, 0.732, -0.222 )] - expressedInFrame * </pre> * </p> * * @param format the format to use for each number. * @param spatialAcceleration the object to get the {@code String} of. Not modified. * @return the representative {@code String}. */ public static String getSpatialAccelerationString(String format, SpatialAccelerationReadOnly spatialAcceleration) { if (spatialAcceleration == null) return "null"; else return getSpatialAccelerationString(format, spatialAcceleration.getBodyFrame(), spatialAcceleration.getBaseFrame(), spatialAcceleration.getReferenceFrame(), spatialAcceleration.getAngularPart(), spatialAcceleration.getLinearPart()); }
if (getReferenceFrame() != getBodyFrame() && getReferenceFrame() != getBaseFrame()) throw new ReferenceFrameMismatchException("This spatial acceleration has to either be expressed in base frame or body frame to use this feature: body frame = " + getBodyFrame() + ", base frame = " + getBaseFrame() + ", expressed in frame = " + getReferenceFrame());
getBodyFrame().checkReferenceFrameMatch(getReferenceFrame()); checkReferenceFrameMatch(bodyTwist);
checkExpressedInFrameMatch(other.getReferenceFrame()); if (getBodyFrame() == other.getBaseFrame()) setBodyFrame(other.getBodyFrame());
checkExpressedInFrameMatch(other.getReferenceFrame());