public RateLimitedYoFramePoint(String namePrefix, String nameSuffix, YoVariableRegistry registry, DoubleProvider maxRate, double dt, FrameTuple3DReadOnly rawPosition) { this(namePrefix, nameSuffix, registry, maxRate, dt, rawPosition, rawPosition.getReferenceFrame()); }
/** * Sets reference frame, position, and orientation. * * @param position the tuple with the new position coordinates. Not modified. * @param orientation the new orientation. Not modified. * @throws ReferenceFrameMismatchException if {@code position} and {@code orientation} are not * expressed in the same reference frame. */ default void setIncludingFrame(FrameTuple3DReadOnly position, FrameOrientation3DReadOnly orientation) { position.checkReferenceFrameMatch(orientation); setReferenceFrame(position.getReferenceFrame()); set((Tuple3DReadOnly) position, (Orientation3DReadOnly) orientation); }
/** * Set the gravitational acceleration to account for in this multi-body system. * <p> * The acceleration of the root body is set to the opposite of the gravitational acceleration such * that it gets naturally propagated to the whole system. * </p> * * @param gravity the gravitational linear acceleration, it is usually equal to * {@code (0, 0, -9.81)}. */ public void setGravitionalAcceleration(FrameTuple3DReadOnly gravity) { gravity.checkReferenceFrameMatch(inertialFrame); setGravitionalAcceleration((Tuple3DReadOnly) gravity); }
@Override public double getX() { return scaleSupplier.getAsDouble() * referenceTuple.getX(); }
@Override public double getZ() { return scaleSupplier.getAsDouble() * referenceTuple.getZ(); }
@Override public double getY() { return scaleSupplier.getAsDouble() * referenceTuple.getY(); }
@Test public void testEpsilonEquals() throws Exception { Random random = new Random(621541L); double epsilon = 0.0; ReferenceFrame frame1 = ReferenceFrame.getWorldFrame(); ReferenceFrame frame2 = EuclidFrameRandomTools.nextReferenceFrame(random); double x = random.nextDouble(); double y = random.nextDouble(); double z = random.nextDouble(); F tuple1 = createFrameTuple(frame1, x, y, z); F tuple2 = createFrameTuple(frame1, x, y, z); F tuple3 = createFrameTuple(frame2, x, y, z); F tuple4 = createFrameTuple(frame2, x, y, z); assertTrue(tuple1.epsilonEquals(tuple2, epsilon)); assertFalse(tuple1.epsilonEquals(tuple3, epsilon)); assertFalse(tuple3.epsilonEquals(tuple2, epsilon)); assertTrue(tuple3.epsilonEquals(tuple4, epsilon)); }
@Test public void testEquals() throws Exception { Random random = new Random(621541L); ReferenceFrame frame1 = ReferenceFrame.getWorldFrame(); ReferenceFrame frame2 = EuclidFrameRandomTools.nextReferenceFrame(random); double x = random.nextDouble(); double y = random.nextDouble(); double z = random.nextDouble(); F tuple1 = createFrameTuple(frame1, x, y, z); F tuple2 = createFrameTuple(frame1, x, y, z); F tuple3 = createFrameTuple(frame2, x, y, z); F tuple4 = createFrameTuple(frame2, x, y, z); assertTrue(tuple1.equals(tuple2)); assertFalse(tuple1.equals(tuple3)); assertFalse(tuple3.equals(tuple2)); assertTrue(tuple3.equals(tuple4)); assertTrue(tuple1.equals((Object) tuple2)); assertFalse(tuple1.equals((Object) tuple3)); assertFalse(tuple3.equals((Object) tuple2)); assertTrue(tuple3.equals((Object) tuple4)); }
/** * Set the gravitational acceleration to account for in this multi-body system. * <p> * The acceleration of the root body is set to the opposite of the gravitational acceleration such * that it gets naturally propagated to the whole system. * </p> * * @param gravity the gravitational linear acceleration, it is usually equal to * {@code (0, 0, -9.81)}. */ public void setGravitionalAcceleration(FrameTuple3DReadOnly gravity) { gravity.checkReferenceFrameMatch(input.getInertialFrame()); setGravitionalAcceleration((Tuple3DReadOnly) gravity); }
public RateLimitedYoFrameVector(String namePrefix, String nameSuffix, YoVariableRegistry registry, DoubleProvider maxRate, double dt, FrameTuple3DReadOnly rawPosition) { this(namePrefix, nameSuffix, registry, maxRate, dt, rawPosition, rawPosition.getReferenceFrame()); }
/** * Set the gravitational acceleration to account for in this multi-body system. * <p> * The acceleration of the root body is set to the opposite of the gravitational acceleration such * that it gets naturally propagated to the whole system. * </p> * * @param gravity the gravitational linear acceleration, it is usually equal to * {@code (0, 0, -9.81)}. */ public void setGravitionalAcceleration(FrameTuple3DReadOnly gravity) { gravity.checkReferenceFrameMatch(input.getInertialFrame()); setGravitionalAcceleration((Tuple3DReadOnly) gravity); }
public AlphaFilteredYoFramePoint(String namePrefix, String nameSuffix, YoVariableRegistry registry, DoubleProvider alpha, FrameTuple3DReadOnly unfilteredFrameTuple3D) { this(namePrefix, nameSuffix, registry, alpha, unfilteredFrameTuple3D.getReferenceFrame(), unfilteredFrameTuple3D); }
public AlphaFilteredYoFrameVector(String namePrefix, String nameSuffix, YoVariableRegistry registry, DoubleProvider alpha, FrameTuple3DReadOnly unfilteredFrameTuple3D) { this(namePrefix, nameSuffix, registry, alpha, unfilteredFrameTuple3D.getReferenceFrame(), unfilteredFrameTuple3D); }
@Override public ReferenceFrame getReferenceFrame() { return referenceTuple.getReferenceFrame(); }
/** * Tests on a per component basis, if this tuple is exactly equal to {@code other}. * <p> * If the two tuples have different frames, this method returns {@code false}. * </p> * * @param other the other tuple to compare against this. Not modified. * @return {@code true} if the two tuples are exactly equal component-wise and are expressed in the * same reference frame, {@code false} otherwise. */ default boolean equals(FrameTuple3DReadOnly other) { if (other == null || getReferenceFrame() != other.getReferenceFrame()) return false; return Tuple3DReadOnly.super.equals(other); } }