java.lang.Float Java Examples

The following examples show how to use java.lang.Float. You can vote up the ones you like or vote down the ones you don't like, and go to the original project or source file by following the links above each example. You may check out the related API usage on the sidebar.
Example #1
Source File: Odometry.java    From mavlink with MIT License 6 votes vote down vote up
private Odometry(BigInteger timeUsec, EnumValue<MavFrame> frameId,
        EnumValue<MavFrame> childFrameId, float x, float y, float z, List<Float> q, float vx,
        float vy, float vz, float rollspeed, float pitchspeed, float yawspeed,
        List<Float> poseCovariance, List<Float> velocityCovariance, int resetCounter,
        EnumValue<MavEstimatorType> estimatorType) {
    this.timeUsec = timeUsec;
    this.frameId = frameId;
    this.childFrameId = childFrameId;
    this.x = x;
    this.y = y;
    this.z = z;
    this.q = q;
    this.vx = vx;
    this.vy = vy;
    this.vz = vz;
    this.rollspeed = rollspeed;
    this.pitchspeed = pitchspeed;
    this.yawspeed = yawspeed;
    this.poseCovariance = poseCovariance;
    this.velocityCovariance = velocityCovariance;
    this.resetCounter = resetCounter;
    this.estimatorType = estimatorType;
}
 
Example #2
Source File: TrajectoryRepresentationWaypoints.java    From mavlink with MIT License 6 votes vote down vote up
private TrajectoryRepresentationWaypoints(BigInteger timeUsec, int validPoints,
        List<Float> posX, List<Float> posY, List<Float> posZ, List<Float> velX,
        List<Float> velY, List<Float> velZ, List<Float> accX, List<Float> accY,
        List<Float> accZ, List<Float> posYaw, List<Float> velYaw, EnumValue<MavCmd> command) {
    this.timeUsec = timeUsec;
    this.validPoints = validPoints;
    this.posX = posX;
    this.posY = posY;
    this.posZ = posZ;
    this.velX = velX;
    this.velY = velY;
    this.velZ = velZ;
    this.accX = accX;
    this.accY = accY;
    this.accZ = accZ;
    this.posYaw = posYaw;
    this.velYaw = velYaw;
    this.command = command;
}
 
Example #3
Source File: MaxFloatingPointTest.java    From j2objc with Apache License 2.0 6 votes vote down vote up
public void testFloatNarrowing() {
  if (System.getProperty("os.arch").equals("armv7")) {
    return;
  }
  float fmin = Float.NEGATIVE_INFINITY;
  float fmax = Float.POSITIVE_INFINITY;
  assertEquals("fmin as long failed", Long.MIN_VALUE, (long) fmin);
  assertEquals("fmax as long failed", Long.MAX_VALUE, (long) fmax);
  assertEquals("fmin as int failed", Integer.MIN_VALUE, (int) fmin);
  assertEquals("fmax as int failed", Integer.MAX_VALUE, (int) fmax);
  assertEquals("fmin as char failed", Character.MIN_VALUE, (char) fmin);
  assertEquals("fmax as char failed", Character.MAX_VALUE, (char) fmax);

  // Surprising values for shorts and bytes, but that's what's specified.
  assertEquals("fmin as short failed", 0, (short) fmin);
  assertEquals("fmax as short failed", -1, (short) fmax);
  assertEquals("fmin as byte failed", 0, (byte) fmin);
  assertEquals("fmax as byte failed", -1, (byte) fmax);
}
 
Example #4
Source File: SetHomePosition.java    From mavlink with MIT License 6 votes vote down vote up
private SetHomePosition(int targetSystem, int latitude, int longitude, int altitude, float x,
        float y, float z, List<Float> q, float approachX, float approachY, float approachZ,
        BigInteger timeUsec) {
    this.targetSystem = targetSystem;
    this.latitude = latitude;
    this.longitude = longitude;
    this.altitude = altitude;
    this.x = x;
    this.y = y;
    this.z = z;
    this.q = q;
    this.approachX = approachX;
    this.approachY = approachY;
    this.approachZ = approachZ;
    this.timeUsec = timeUsec;
}
 
Example #5
Source File: ShapeEntity.java    From SVGAPlayer-Android with Apache License 2.0 5 votes vote down vote up
public RectArgs(Float x, Float y, Float width, Float height, Float cornerRadius, ByteString unknownFields) {
  super(ADAPTER, unknownFields);
  this.x = x;
  this.y = y;
  this.width = width;
  this.height = height;
  this.cornerRadius = cornerRadius;
}
 
Example #6
Source File: CameraImageCaptured.java    From mavlink with MIT License 5 votes vote down vote up
private CameraImageCaptured(long timeBootMs, BigInteger timeUtc, int cameraId, int lat, int lon,
        int alt, int relativeAlt, List<Float> q, int imageIndex, int captureResult,
        String fileUrl) {
    this.timeBootMs = timeBootMs;
    this.timeUtc = timeUtc;
    this.cameraId = cameraId;
    this.lat = lat;
    this.lon = lon;
    this.alt = alt;
    this.relativeAlt = relativeAlt;
    this.q = q;
    this.imageIndex = imageIndex;
    this.captureResult = captureResult;
    this.fileUrl = fileUrl;
}
 
Example #7
Source File: ControlSystemState.java    From mavlink with MIT License 5 votes vote down vote up
/**
 * The attitude, represented as Quaternion 
 */
@MavlinkFieldInfo(
        position = 14,
        unitSize = 4,
        arraySize = 4,
        description = "The attitude, represented as Quaternion"
)
public final List<Float> q() {
    return this.q;
}
 
Example #8
Source File: FollowTarget.java    From mavlink with MIT License 5 votes vote down vote up
/**
 * (0 0 0 for unknown) 
 */
@MavlinkFieldInfo(
        position = 9,
        unitSize = 4,
        arraySize = 3,
        description = "(0 0 0 for unknown)"
)
public final List<Float> rates() {
    return this.rates;
}
 
Example #9
Source File: TrajectoryRepresentationWaypoints.java    From mavlink with MIT License 5 votes vote down vote up
/**
 * Z-coordinate of waypoint, set to NaN if not being used 
 */
@MavlinkFieldInfo(
        position = 6,
        unitSize = 4,
        arraySize = 5,
        description = "Z-coordinate of waypoint, set to NaN if not being used"
)
public final List<Float> posZ() {
    return this.posZ;
}
 
Example #10
Source File: BoxedTypesMethodsConstructorStorIOSQLiteGetResolver.java    From storio with Apache License 2.0 5 votes vote down vote up
/**
 * {@inheritDoc}
 */
@Override
@NonNull
public BoxedTypesMethodsConstructor mapFromCursor(@NonNull StorIOSQLite storIOSQLite, @NonNull Cursor cursor) {

    Boolean field1 = null;
    if (!cursor.isNull(cursor.getColumnIndex("field1"))) {
        field1 = cursor.getInt(cursor.getColumnIndex("field1")) == 1;
    }
    Short field2 = null;
    if (!cursor.isNull(cursor.getColumnIndex("field2"))) {
        field2 = cursor.getShort(cursor.getColumnIndex("field2"));
    }
    Integer field3 = null;
    if (!cursor.isNull(cursor.getColumnIndex("field3"))) {
        field3 = cursor.getInt(cursor.getColumnIndex("field3"));
    }
    Long field4 = null;
    if (!cursor.isNull(cursor.getColumnIndex("field4"))) {
        field4 = cursor.getLong(cursor.getColumnIndex("field4"));
    }
    Float field5 = null;
    if (!cursor.isNull(cursor.getColumnIndex("field5"))) {
        field5 = cursor.getFloat(cursor.getColumnIndex("field5"));
    }
    Double field6 = null;
    if (!cursor.isNull(cursor.getColumnIndex("field6"))) {
        field6 = cursor.getDouble(cursor.getColumnIndex("field6"));
    }

    BoxedTypesMethodsConstructor object = new BoxedTypesMethodsConstructor(field1, field2, field3, field4, field5, field6);

    return object;
}
 
Example #11
Source File: BoxedTypesMethodsConstructorIgnoreNullStorIOSQLiteGetResolver.java    From storio with Apache License 2.0 5 votes vote down vote up
/**
 * {@inheritDoc}
 */
@Override
@NonNull
public BoxedTypesMethodsConstructorIgnoreNull mapFromCursor(@NonNull StorIOSQLite storIOSQLite, @NonNull Cursor cursor) {

    Boolean field1 = null;
    if (!cursor.isNull(cursor.getColumnIndex("field1"))) {
        field1 = cursor.getInt(cursor.getColumnIndex("field1")) == 1;
    }
    Short field2 = null;
    if (!cursor.isNull(cursor.getColumnIndex("field2"))) {
        field2 = cursor.getShort(cursor.getColumnIndex("field2"));
    }
    Integer field3 = null;
    if (!cursor.isNull(cursor.getColumnIndex("field3"))) {
        field3 = cursor.getInt(cursor.getColumnIndex("field3"));
    }
    Long field4 = null;
    if (!cursor.isNull(cursor.getColumnIndex("field4"))) {
        field4 = cursor.getLong(cursor.getColumnIndex("field4"));
    }
    Float field5 = null;
    if (!cursor.isNull(cursor.getColumnIndex("field5"))) {
        field5 = cursor.getFloat(cursor.getColumnIndex("field5"));
    }
    Double field6 = null;
    if (!cursor.isNull(cursor.getColumnIndex("field6"))) {
        field6 = cursor.getDouble(cursor.getColumnIndex("field6"));
    }

    BoxedTypesMethodsConstructorIgnoreNull object = new BoxedTypesMethodsConstructorIgnoreNull(field1, field2, field3, field4, field5, field6);

    return object;
}
 
Example #12
Source File: SetActuatorControlTarget.java    From mavlink with MIT License 5 votes vote down vote up
/**
 * Actuator controls. Normed to -1..+1 where 0 is neutral position. Throttle for single rotation 
 * direction motors is 0..1, negative range for reverse direction. Standard mapping for 
 * attitude controls (group 0): (index 0-7): roll, pitch, yaw, throttle, flaps, spoilers, 
 * airbrakes, landing gear. Load a pass-through mixer to repurpose them as generic outputs. 
 */
@MavlinkFieldInfo(
        position = 5,
        unitSize = 4,
        arraySize = 8,
        description = "Actuator controls. Normed to -1..+1 where 0 is neutral position. Throttle for single rotation direction motors is 0..1, negative range for reverse direction. Standard mapping for attitude controls (group 0): (index 0-7): roll, pitch, yaw, throttle, flaps, spoilers, airbrakes, landing gear. Load a pass-through mixer to repurpose them as generic outputs."
)
public final List<Float> controls() {
    return this.controls;
}
 
Example #13
Source File: SetActuatorControlTarget.java    From mavlink with MIT License 5 votes vote down vote up
private SetActuatorControlTarget(BigInteger timeUsec, int groupMlx, int targetSystem,
        int targetComponent, List<Float> controls) {
    this.timeUsec = timeUsec;
    this.groupMlx = groupMlx;
    this.targetSystem = targetSystem;
    this.targetComponent = targetComponent;
    this.controls = controls;
}
 
Example #14
Source File: SetAttitudeTarget.java    From mavlink with MIT License 5 votes vote down vote up
/**
 * Attitude quaternion (w, x, y, z order, zero-rotation is 1, 0, 0, 0) 
 */
@MavlinkFieldInfo(
        position = 5,
        unitSize = 4,
        arraySize = 4,
        description = "Attitude quaternion (w, x, y, z order, zero-rotation is 1, 0, 0, 0)"
)
public final List<Float> q() {
    return this.q;
}
 
Example #15
Source File: SetAttitudeTarget.java    From mavlink with MIT License 5 votes vote down vote up
private SetAttitudeTarget(long timeBootMs, int targetSystem, int targetComponent, int typeMask,
        List<Float> q, float bodyRollRate, float bodyPitchRate, float bodyYawRate,
        float thrust) {
    this.timeBootMs = timeBootMs;
    this.targetSystem = targetSystem;
    this.targetComponent = targetComponent;
    this.typeMask = typeMask;
    this.q = q;
    this.bodyRollRate = bodyRollRate;
    this.bodyPitchRate = bodyPitchRate;
    this.bodyYawRate = bodyYawRate;
    this.thrust = thrust;
}
 
Example #16
Source File: FollowTarget.java    From mavlink with MIT License 5 votes vote down vote up
/**
 * eph epv 
 */
@MavlinkFieldInfo(
        position = 10,
        unitSize = 4,
        arraySize = 3,
        description = "eph epv"
)
public final List<Float> positionCov() {
    return this.positionCov;
}
 
Example #17
Source File: TrajectoryRepresentationBezier.java    From mavlink with MIT License 5 votes vote down vote up
/**
 * Y-coordinate of starting bezier point, set to NaN if not being used 
 */
@MavlinkFieldInfo(
        position = 5,
        unitSize = 4,
        arraySize = 5,
        description = "Y-coordinate of starting bezier point, set to NaN if not being used"
)
public final List<Float> posY() {
    return this.posY;
}
 
Example #18
Source File: MovieParams.java    From SVGAPlayer-Android with Apache License 2.0 5 votes vote down vote up
public MovieParams(Float viewBoxWidth, Float viewBoxHeight, Integer fps, Integer frames, ByteString unknownFields) {
  super(ADAPTER, unknownFields);
  this.viewBoxWidth = viewBoxWidth;
  this.viewBoxHeight = viewBoxHeight;
  this.fps = fps;
  this.frames = frames;
}
 
Example #19
Source File: Odometry.java    From mavlink with MIT License 5 votes vote down vote up
/**
 * Quaternion components, w, x, y, z (1 0 0 0 is the null-rotation) 
 */
@MavlinkFieldInfo(
        position = 7,
        unitSize = 4,
        arraySize = 4,
        description = "Quaternion components, w, x, y, z (1 0 0 0 is the null-rotation)"
)
public final List<Float> q() {
    return this.q;
}
 
Example #20
Source File: DistanceSensor.java    From mavlink with MIT License 5 votes vote down vote up
/**
 * Quaternion of the sensor orientation in vehicle body frame (w, x, y, z order, zero-rotation is 
 * 1, 0, 0, 0). Zero-rotation is along the vehicle body x-axis. This field is required if the 
 * orientation is set to MAV_SENSOR_ROTATION_CUSTOM. Set it to 0 if invalid." 
 */
@MavlinkFieldInfo(
        position = 12,
        unitSize = 4,
        arraySize = 4,
        extension = true,
        description = "Quaternion of the sensor orientation in vehicle body frame (w, x, y, z order, zero-rotation is 1, 0, 0, 0). Zero-rotation is along the vehicle body x-axis. This field is required if the orientation is set to MAV_SENSOR_ROTATION_CUSTOM. Set it to 0 if invalid.\""
)
public final List<Float> quaternion() {
    return this.quaternion;
}
 
Example #21
Source File: GlobalPositionIntCov.java    From mavlink with MIT License 5 votes vote down vote up
/**
 * Row-major representation of a 6x6 position and velocity 6x6 cross-covariance matrix 
 * (states: lat, lon, alt, vx, vy, vz; first six entries are the first ROW, next six entries are the 
 * second row, etc.). If unknown, assign NaN value to first element in the array. 
 */
@MavlinkFieldInfo(
        position = 10,
        unitSize = 4,
        arraySize = 36,
        description = "Row-major representation of a 6x6 position and velocity 6x6 cross-covariance matrix (states: lat, lon, alt, vx, vy, vz; first six entries are the first ROW, next six entries are the second row, etc.). If unknown, assign NaN value to first element in the array."
)
public final List<Float> covariance() {
    return this.covariance;
}
 
Example #22
Source File: LocalPositionNedCov.java    From mavlink with MIT License 5 votes vote down vote up
/**
 * Row-major representation of position, velocity and acceleration 9x9 cross-covariance 
 * matrix upper right triangle (states: x, y, z, vx, vy, vz, ax, ay, az; first nine entries are the 
 * first ROW, next eight entries are the second row, etc.). If unknown, assign NaN value to first 
 * element in the array. 
 */
@MavlinkFieldInfo(
        position = 12,
        unitSize = 4,
        arraySize = 45,
        description = "Row-major representation of position, velocity and acceleration 9x9 cross-covariance matrix upper right triangle (states: x, y, z, vx, vy, vz, ax, ay, az; first nine entries are the first ROW, next eight entries are the second row, etc.). If unknown, assign NaN value to first element in the array."
)
public final List<Float> covariance() {
    return this.covariance;
}
 
Example #23
Source File: ModelWithAllPrivateFieldTypes_.java    From epoxy with Apache License 2.0 5 votes vote down vote up
@Override
public int hashCode() {
  int _result = super.hashCode();
  _result = 31 * _result + (onModelBoundListener_epoxyGeneratedModel != null ? 1 : 0);
  _result = 31 * _result + (onModelUnboundListener_epoxyGeneratedModel != null ? 1 : 0);
  _result = 31 * _result + (onModelVisibilityStateChangedListener_epoxyGeneratedModel != null ? 1 : 0);
  _result = 31 * _result + (onModelVisibilityChangedListener_epoxyGeneratedModel != null ? 1 : 0);
  long temp;
  _result = 31 * _result + getValueInt();
  _result = 31 * _result + (getValueInteger() != null ? getValueInteger().hashCode() : 0);
  _result = 31 * _result + getValueShort();
  _result = 31 * _result + (getValueShortWrapper() != null ? getValueShortWrapper().hashCode() : 0);
  _result = 31 * _result + getValueChar();
  _result = 31 * _result + (getValueCharacter() != null ? getValueCharacter().hashCode() : 0);
  _result = 31 * _result + getValuebByte();
  _result = 31 * _result + (getValueByteWrapper() != null ? getValueByteWrapper().hashCode() : 0);
  _result = 31 * _result + (int) (getValueLong() ^ (getValueLong() >>> 32));
  _result = 31 * _result + (getValueLongWrapper() != null ? getValueLongWrapper().hashCode() : 0);
  temp = Double.doubleToLongBits(getValueDouble());
  _result = 31 * _result + (int) (temp ^ (temp >>> 32));
  _result = 31 * _result + (getValueDoubleWrapper() != null ? getValueDoubleWrapper().hashCode() : 0);
  _result = 31 * _result + (getValueFloat() != +0.0f ? Float.floatToIntBits(getValueFloat()) : 0);
  _result = 31 * _result + (getValueFloatWrapper() != null ? getValueFloatWrapper().hashCode() : 0);
  _result = 31 * _result + (isValueBoolean() ? 1 : 0);
  _result = 31 * _result + (getValueBooleanWrapper() != null ? getValueBooleanWrapper().hashCode() : 0);
  _result = 31 * _result + Arrays.hashCode(getValueIntArray());
  _result = 31 * _result + Arrays.hashCode(getValueObjectArray());
  _result = 31 * _result + (getValueString() != null ? getValueString().hashCode() : 0);
  _result = 31 * _result + (getValueObject() != null ? getValueObject().hashCode() : 0);
  _result = 31 * _result + (getValueList() != null ? getValueList().hashCode() : 0);
  return _result;
}
 
Example #24
Source File: AttitudeQuaternionCov.java    From mavlink with MIT License 5 votes vote down vote up
/**
 * Row-major representation of a 3x3 attitude covariance matrix (states: roll, pitch, yaw; 
 * first three entries are the first ROW, next three entries are the second row, etc.). If unknown, 
 * assign NaN value to first element in the array. 
 */
@MavlinkFieldInfo(
        position = 6,
        unitSize = 4,
        arraySize = 9,
        description = "Row-major representation of a 3x3 attitude covariance matrix (states: roll, pitch, yaw; first three entries are the first ROW, next three entries are the second row, etc.). If unknown, assign NaN value to first element in the array."
)
public final List<Float> covariance() {
    return this.covariance;
}
 
Example #25
Source File: AttitudeQuaternionCov.java    From mavlink with MIT License 5 votes vote down vote up
private AttitudeQuaternionCov(BigInteger timeUsec, List<Float> q, float rollspeed,
        float pitchspeed, float yawspeed, List<Float> covariance) {
    this.timeUsec = timeUsec;
    this.q = q;
    this.rollspeed = rollspeed;
    this.pitchspeed = pitchspeed;
    this.yawspeed = yawspeed;
    this.covariance = covariance;
}
 
Example #26
Source File: GlobalVisionPositionEstimate.java    From mavlink with MIT License 5 votes vote down vote up
/**
 * Row-major representation of pose 6x6 cross-covariance matrix upper right triangle (states: 
 * x_global, y_global, z_global, roll, pitch, yaw; first six entries are the first ROW, next five 
 * entries are the second ROW, etc.). If unknown, assign NaN value to first element in the array. 
 */
@MavlinkFieldInfo(
        position = 9,
        unitSize = 4,
        arraySize = 21,
        extension = true,
        description = "Row-major representation of pose 6x6 cross-covariance matrix upper right triangle (states: x_global, y_global, z_global, roll, pitch, yaw; first six entries are the first ROW, next five entries are the second ROW, etc.). If unknown, assign NaN value to first element in the array."
)
public final List<Float> covariance() {
    return this.covariance;
}
 
Example #27
Source File: GlobalVisionPositionEstimate.java    From mavlink with MIT License 5 votes vote down vote up
private GlobalVisionPositionEstimate(BigInteger usec, float x, float y, float z, float roll,
        float pitch, float yaw, List<Float> covariance, int resetCounter) {
    this.usec = usec;
    this.x = x;
    this.y = y;
    this.z = z;
    this.roll = roll;
    this.pitch = pitch;
    this.yaw = yaw;
    this.covariance = covariance;
    this.resetCounter = resetCounter;
}
 
Example #28
Source File: BoxedTypesPrivateFieldsIgnoreNullStorIOSQLiteGetResolver.java    From storio with Apache License 2.0 5 votes vote down vote up
/**
 * {@inheritDoc}
 */
@Override
@NonNull
public BoxedTypesPrivateFieldsIgnoreNull mapFromCursor(@NonNull StorIOSQLite storIOSQLite, @NonNull Cursor cursor) {

    Boolean field1 = null;
    if (!cursor.isNull(cursor.getColumnIndex("field1"))) {
        field1 = cursor.getInt(cursor.getColumnIndex("field1")) == 1;
    }
    Short field2 = null;
    if (!cursor.isNull(cursor.getColumnIndex("field2"))) {
        field2 = cursor.getShort(cursor.getColumnIndex("field2"));
    }
    Integer field3 = null;
    if (!cursor.isNull(cursor.getColumnIndex("field3"))) {
        field3 = cursor.getInt(cursor.getColumnIndex("field3"));
    }
    Long field4 = null;
    if (!cursor.isNull(cursor.getColumnIndex("field4"))) {
        field4 = cursor.getLong(cursor.getColumnIndex("field4"));
    }
    Float field5 = null;
    if (!cursor.isNull(cursor.getColumnIndex("field5"))) {
        field5 = cursor.getFloat(cursor.getColumnIndex("field5"));
    }
    Double field6 = null;
    if (!cursor.isNull(cursor.getColumnIndex("field6"))) {
        field6 = cursor.getDouble(cursor.getColumnIndex("field6"));
    }

    BoxedTypesPrivateFieldsIgnoreNull object = new BoxedTypesPrivateFieldsIgnoreNull(field1, field2, field3, field4, field5, field6);

    return object;
}
 
Example #29
Source File: TrajectoryRepresentationBezier.java    From mavlink with MIT License 5 votes vote down vote up
/**
 * Z-coordinate of starting bezier point, set to NaN if not being used 
 */
@MavlinkFieldInfo(
        position = 6,
        unitSize = 4,
        arraySize = 5,
        description = "Z-coordinate of starting bezier point, set to NaN if not being used"
)
public final List<Float> posZ() {
    return this.posZ;
}
 
Example #30
Source File: TrajectoryRepresentationWaypoints.java    From mavlink with MIT License 5 votes vote down vote up
/**
 * Y-acceleration of waypoint, set to NaN if not being used 
 */
@MavlinkFieldInfo(
        position = 11,
        unitSize = 4,
        arraySize = 5,
        description = "Y-acceleration of waypoint, set to NaN if not being used"
)
public final List<Float> accY() {
    return this.accY;
}