From 63094984f0f4d2c9aa60eff3789e2ec7ea332040 Mon Sep 17 00:00:00 2001 From: Haoning Huang Date: Sun, 8 Feb 2026 01:27:42 +0000 Subject: [PATCH 01/82] feat: Update to Proto v2.0 Major Changes: - Add trajectory_id field for trajectory identification - Add initial_position field (GNSSPosition) - Add test_points field for teammate positioning algorithms - Add 7 sensor_info fields (accelerometer, gyroscope, etc.) - Add WiFi RTT support (rtt_enabled field) - Add detailed BLE fields (mac_address, name, tx_power, etc.) MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit API Changes: - Rename Proto classes: Pdr_Sample→RelativePosition, GNSS_Sample→GNSSReading, etc. - Use Vector3/Quaternion for IMU data - Nest position data in GNSSReading.position - Update method names: addWifiData→addWifiFingerprints, etc. Dependencies: - Update protobuf-java to 4.29.6 (matches protoc version) Files Modified: - Traj.java (regenerated from proto) - SensorFusion.java (updated API calls) - ServerCommunications.java (updated API calls) - app/build.gradle (protobuf dependency updated) --- Change_by_haoning_0208.md | 78 + app/build.gradle | 2 +- .../com/openpositioning/PositionMe/Traj.java | 22459 +++++++++++----- .../data/remote/ServerCommunications.java | 4 +- .../PositionMe/sensors/SensorFusion.java | 85 +- app/src/main/proto/traj.proto | 230 +- 6 files changed, 15725 insertions(+), 7133 deletions(-) create mode 100644 Change_by_haoning_0208.md diff --git a/Change_by_haoning_0208.md b/Change_by_haoning_0208.md new file mode 100644 index 00000000..1d37f21d --- /dev/null +++ b/Change_by_haoning_0208.md @@ -0,0 +1,78 @@ +**Date**: 2026-02-08 + +### New Fields Added +1. **trajectory_id** (string) - For naming/identifying trajectories +2. **initial_position** (GNSSPosition) - Starting position of trajectory +3. **test_points** (repeated GNSSPosition) - Test points for positioning algorithms +4. **sensor_info** - Information for 7 sensors: + - accelerometer_info + - gyroscope_info + - rotation_vector_info + - magnetometer_info + - barometer_info + - light_sensor_info + - proximity_info +5. **WiFiAPData.rtt_enabled** (bool) - RTT support flag +6. **BleData** enhanced with: + - mac_address, name, tx_power_level + - advertise_flags, service_uuids, manufacturer_data + +--- + +### Breaking Changes - API Updates + +### Class Name Changes + +| Old Name | New Name | +|----------|----------| +| `Pdr_Sample` | `RelativePosition` | +| `GNSS_Sample` | `GNSSReading` | +| `WiFi_Sample` | `Fingerprint` | +| `Mac_Scan` | `RFScan` | +| `Motion_Sample` | `IMUReading` | +| `Position_Sample` | `MagnetometerReading` | +| `Pressure_Sample` | `BarometerReading` | +| `Light_Sample` | `LightReading` | +| `AP_Data` | `WiFiAPData` | + +### Method Name Changes + +| Old Method | New Method | +|------------|------------| +| `addMacScans()` | `addRfScans()` | +| `addWifiData()` | `addWifiFingerprints()` | +| `addPositionData()` | `addMagnetometerData()` | +| `getPositionDataCount()` | `getMagnetometerDataCount()` | +| `getWifiDataCount()` | `getWifiFingerprintsCount()` | + +### Structure Changes + +**IMU Data** - Now uses Vector3/Quaternion: +```java +// OLD +.setAccX(x).setAccY(y).setAccZ(z) + +// NEW +.setAcc(Traj.Vector3.newBuilder().setX(x).setY(y).setZ(z).build()) +``` + +**GNSS Data** - Position nested in GNSSPosition: +```java +// OLD +.setLatitude(lat).setLongitude(lon).setAltitude(alt) + +// NEW +.setPosition(Traj.GNSSPosition.newBuilder() + .setLatitude(lat).setLongitude(lon).setAltitude(alt).build()) +``` + +--- + +### Files Modified + +- `Traj.java` - Regenerated from proto +- `SensorFusion.java` - Updated API calls +- `ServerCommunications.java` - Updated API calls +- `app/build.gradle` - Updated protobuf dependency to 4.29.6 + +--- \ No newline at end of file diff --git a/app/build.gradle b/app/build.gradle index 3e29b13f..49b253ef 100644 --- a/app/build.gradle +++ b/app/build.gradle @@ -73,7 +73,7 @@ dependencies { androidTestImplementation 'androidx.test.espresso:espresso-core:3.6.1' implementation 'com.google.android.material:material:1.12.0' - implementation 'com.google.protobuf:protobuf-java:3.0.0' + implementation 'com.google.protobuf:protobuf-java:4.29.6' implementation 'com.squareup.okhttp3:okhttp:4.10.0' implementation "com.google.protobuf:protobuf-java-util:3.0.0" implementation "com.google.guava:listenablefuture:9999.0-empty-to-avoid-conflict-with-guava" diff --git a/app/src/main/java/com/openpositioning/PositionMe/Traj.java b/app/src/main/java/com/openpositioning/PositionMe/Traj.java index 7925fa55..2c1bf9ec 100644 --- a/app/src/main/java/com/openpositioning/PositionMe/Traj.java +++ b/app/src/main/java/com/openpositioning/PositionMe/Traj.java @@ -1,222 +1,363 @@ -package com.openpositioning.PositionMe;// Generated by the protocol buffer compiler. DO NOT EDIT! -// source: Cloud/app/src/main/proto/traj.proto +// Generated by the protocol buffer compiler. DO NOT EDIT! +// NO CHECKED-IN PROTOBUF GENCODE +// source: traj.proto +// Protobuf Java Version: 4.29.6 + +package com.openpositioning.PositionMe; public final class Traj { private Traj() {} + static { + com.google.protobuf.RuntimeVersion.validateProtobufGencodeVersion( + com.google.protobuf.RuntimeVersion.RuntimeDomain.PUBLIC, + /* major= */ 4, + /* minor= */ 29, + /* patch= */ 6, + /* suffix= */ "", + Traj.class.getName()); + } public static void registerAllExtensions( - com.google.protobuf.ExtensionRegistryLite registry) { + com.google.protobuf.ExtensionRegistryLite registry) { } public static void registerAllExtensions( - com.google.protobuf.ExtensionRegistry registry) { + com.google.protobuf.ExtensionRegistry registry) { registerAllExtensions( - (com.google.protobuf.ExtensionRegistryLite) registry); + (com.google.protobuf.ExtensionRegistryLite) registry); } public interface TrajectoryOrBuilder extends - // @@protoc_insertion_point(interface_extends:Trajectory) - com.google.protobuf.MessageOrBuilder { + // @@protoc_insertion_point(interface_extends:Trajectory) + com.google.protobuf.MessageOrBuilder { + + /** + * string android_version = 1; + * @return The androidVersion. + */ + java.lang.String getAndroidVersion(); + /** + * string android_version = 1; + * @return The bytes for androidVersion. + */ + com.google.protobuf.ByteString + getAndroidVersionBytes(); + + /** + *
+     * version 2.0
+     * 
+ * + * float trajectory_version = 2; + * @return The trajectoryVersion. + */ + float getTrajectoryVersion(); /** - * optional string android_version = 1; + *
+     * trajectory id/name for identification
+     * 
+ * + * string trajectory_id = 3; + * @return The trajectoryId. */ - String getAndroidVersion(); + java.lang.String getTrajectoryId(); /** - * optional string android_version = 1; + *
+     * trajectory id/name for identification
+     * 
+ * + * string trajectory_id = 3; + * @return The bytes for trajectoryId. */ com.google.protobuf.ByteString - getAndroidVersionBytes(); + getTrajectoryIdBytes(); /** - * repeated .Motion_Sample imu_data = 2; + * repeated .IMUReading imu_data = 4; */ - java.util.List - getImuDataList(); + java.util.List + getImuDataList(); /** - * repeated .Motion_Sample imu_data = 2; + * repeated .IMUReading imu_data = 4; */ - Motion_Sample getImuData(int index); + com.openpositioning.PositionMe.Traj.IMUReading getImuData(int index); /** - * repeated .Motion_Sample imu_data = 2; + * repeated .IMUReading imu_data = 4; */ int getImuDataCount(); /** - * repeated .Motion_Sample imu_data = 2; + * repeated .IMUReading imu_data = 4; */ - java.util.List - getImuDataOrBuilderList(); + java.util.List + getImuDataOrBuilderList(); /** - * repeated .Motion_Sample imu_data = 2; + * repeated .IMUReading imu_data = 4; */ - Motion_SampleOrBuilder getImuDataOrBuilder( - int index); + com.openpositioning.PositionMe.Traj.IMUReadingOrBuilder getImuDataOrBuilder( + int index); /** - * repeated .Pdr_Sample pdr_data = 3; + * repeated .RelativePosition pdr_data = 5; */ - java.util.List - getPdrDataList(); + java.util.List + getPdrDataList(); /** - * repeated .Pdr_Sample pdr_data = 3; + * repeated .RelativePosition pdr_data = 5; */ - Pdr_Sample getPdrData(int index); + com.openpositioning.PositionMe.Traj.RelativePosition getPdrData(int index); /** - * repeated .Pdr_Sample pdr_data = 3; + * repeated .RelativePosition pdr_data = 5; */ int getPdrDataCount(); /** - * repeated .Pdr_Sample pdr_data = 3; + * repeated .RelativePosition pdr_data = 5; */ - java.util.List - getPdrDataOrBuilderList(); + java.util.List + getPdrDataOrBuilderList(); /** - * repeated .Pdr_Sample pdr_data = 3; + * repeated .RelativePosition pdr_data = 5; */ - Pdr_SampleOrBuilder getPdrDataOrBuilder( - int index); + com.openpositioning.PositionMe.Traj.RelativePositionOrBuilder getPdrDataOrBuilder( + int index); /** - * repeated .Position_Sample position_data = 4; + * repeated .MagnetometerReading magnetometer_data = 6; */ - java.util.List - getPositionDataList(); + java.util.List + getMagnetometerDataList(); /** - * repeated .Position_Sample position_data = 4; + * repeated .MagnetometerReading magnetometer_data = 6; */ - Position_Sample getPositionData(int index); + com.openpositioning.PositionMe.Traj.MagnetometerReading getMagnetometerData(int index); /** - * repeated .Position_Sample position_data = 4; + * repeated .MagnetometerReading magnetometer_data = 6; */ - int getPositionDataCount(); + int getMagnetometerDataCount(); /** - * repeated .Position_Sample position_data = 4; + * repeated .MagnetometerReading magnetometer_data = 6; */ - java.util.List - getPositionDataOrBuilderList(); + java.util.List + getMagnetometerDataOrBuilderList(); /** - * repeated .Position_Sample position_data = 4; + * repeated .MagnetometerReading magnetometer_data = 6; */ - Position_SampleOrBuilder getPositionDataOrBuilder( - int index); + com.openpositioning.PositionMe.Traj.MagnetometerReadingOrBuilder getMagnetometerDataOrBuilder( + int index); /** - * repeated .Pressure_Sample pressure_data = 5; + * repeated .BarometerReading pressure_data = 7; */ - java.util.List - getPressureDataList(); + java.util.List + getPressureDataList(); /** - * repeated .Pressure_Sample pressure_data = 5; + * repeated .BarometerReading pressure_data = 7; */ - Pressure_Sample getPressureData(int index); + com.openpositioning.PositionMe.Traj.BarometerReading getPressureData(int index); /** - * repeated .Pressure_Sample pressure_data = 5; + * repeated .BarometerReading pressure_data = 7; */ int getPressureDataCount(); /** - * repeated .Pressure_Sample pressure_data = 5; + * repeated .BarometerReading pressure_data = 7; */ - java.util.List - getPressureDataOrBuilderList(); + java.util.List + getPressureDataOrBuilderList(); /** - * repeated .Pressure_Sample pressure_data = 5; + * repeated .BarometerReading pressure_data = 7; */ - Pressure_SampleOrBuilder getPressureDataOrBuilder( - int index); + com.openpositioning.PositionMe.Traj.BarometerReadingOrBuilder getPressureDataOrBuilder( + int index); /** - * repeated .Light_Sample light_data = 6; + * repeated .LightReading light_data = 8; */ - java.util.List - getLightDataList(); + java.util.List + getLightDataList(); /** - * repeated .Light_Sample light_data = 6; + * repeated .LightReading light_data = 8; */ - Light_Sample getLightData(int index); + com.openpositioning.PositionMe.Traj.LightReading getLightData(int index); /** - * repeated .Light_Sample light_data = 6; + * repeated .LightReading light_data = 8; */ int getLightDataCount(); /** - * repeated .Light_Sample light_data = 6; + * repeated .LightReading light_data = 8; + */ + java.util.List + getLightDataOrBuilderList(); + /** + * repeated .LightReading light_data = 8; + */ + com.openpositioning.PositionMe.Traj.LightReadingOrBuilder getLightDataOrBuilder( + int index); + + /** + * repeated .ProximityReading proximity_data = 9; + */ + java.util.List + getProximityDataList(); + /** + * repeated .ProximityReading proximity_data = 9; + */ + com.openpositioning.PositionMe.Traj.ProximityReading getProximityData(int index); + /** + * repeated .ProximityReading proximity_data = 9; + */ + int getProximityDataCount(); + /** + * repeated .ProximityReading proximity_data = 9; */ - java.util.List - getLightDataOrBuilderList(); + java.util.List + getProximityDataOrBuilderList(); /** - * repeated .Light_Sample light_data = 6; + * repeated .ProximityReading proximity_data = 9; */ - Light_SampleOrBuilder getLightDataOrBuilder( - int index); + com.openpositioning.PositionMe.Traj.ProximityReadingOrBuilder getProximityDataOrBuilder( + int index); /** - * repeated .GNSS_Sample gnss_data = 7; + * repeated .GNSSReading gnss_data = 10; */ - java.util.List - getGnssDataList(); + java.util.List + getGnssDataList(); /** - * repeated .GNSS_Sample gnss_data = 7; + * repeated .GNSSReading gnss_data = 10; */ - GNSS_Sample getGnssData(int index); + com.openpositioning.PositionMe.Traj.GNSSReading getGnssData(int index); /** - * repeated .GNSS_Sample gnss_data = 7; + * repeated .GNSSReading gnss_data = 10; */ int getGnssDataCount(); /** - * repeated .GNSS_Sample gnss_data = 7; + * repeated .GNSSReading gnss_data = 10; */ - java.util.List - getGnssDataOrBuilderList(); + java.util.List + getGnssDataOrBuilderList(); /** - * repeated .GNSS_Sample gnss_data = 7; + * repeated .GNSSReading gnss_data = 10; */ - GNSS_SampleOrBuilder getGnssDataOrBuilder( - int index); + com.openpositioning.PositionMe.Traj.GNSSReadingOrBuilder getGnssDataOrBuilder( + int index); /** - * repeated .WiFi_Sample wifi_data = 8; + * repeated .Fingerprint wifi_fingerprints = 11; */ - java.util.List - getWifiDataList(); + java.util.List + getWifiFingerprintsList(); /** - * repeated .WiFi_Sample wifi_data = 8; + * repeated .Fingerprint wifi_fingerprints = 11; */ - WiFi_Sample getWifiData(int index); + com.openpositioning.PositionMe.Traj.Fingerprint getWifiFingerprints(int index); /** - * repeated .WiFi_Sample wifi_data = 8; + * repeated .Fingerprint wifi_fingerprints = 11; */ - int getWifiDataCount(); + int getWifiFingerprintsCount(); /** - * repeated .WiFi_Sample wifi_data = 8; + * repeated .Fingerprint wifi_fingerprints = 11; */ - java.util.List - getWifiDataOrBuilderList(); + java.util.List + getWifiFingerprintsOrBuilderList(); /** - * repeated .WiFi_Sample wifi_data = 8; + * repeated .Fingerprint wifi_fingerprints = 11; */ - WiFi_SampleOrBuilder getWifiDataOrBuilder( - int index); + com.openpositioning.PositionMe.Traj.FingerprintOrBuilder getWifiFingerprintsOrBuilder( + int index); /** - * repeated .AP_Data aps_data = 9; + * repeated .WiFiAPData aps_data = 12; */ - java.util.List - getApsDataList(); + java.util.List + getApsDataList(); /** - * repeated .AP_Data aps_data = 9; + * repeated .WiFiAPData aps_data = 12; */ - AP_Data getApsData(int index); + com.openpositioning.PositionMe.Traj.WiFiAPData getApsData(int index); /** - * repeated .AP_Data aps_data = 9; + * repeated .WiFiAPData aps_data = 12; */ int getApsDataCount(); /** - * repeated .AP_Data aps_data = 9; + * repeated .WiFiAPData aps_data = 12; + */ + java.util.List + getApsDataOrBuilderList(); + /** + * repeated .WiFiAPData aps_data = 12; + */ + com.openpositioning.PositionMe.Traj.WiFiAPDataOrBuilder getApsDataOrBuilder( + int index); + + /** + * repeated .WiFiRTTReading wifi_rtt_data = 13; + */ + java.util.List + getWifiRttDataList(); + /** + * repeated .WiFiRTTReading wifi_rtt_data = 13; + */ + com.openpositioning.PositionMe.Traj.WiFiRTTReading getWifiRttData(int index); + /** + * repeated .WiFiRTTReading wifi_rtt_data = 13; + */ + int getWifiRttDataCount(); + /** + * repeated .WiFiRTTReading wifi_rtt_data = 13; + */ + java.util.List + getWifiRttDataOrBuilderList(); + /** + * repeated .WiFiRTTReading wifi_rtt_data = 13; + */ + com.openpositioning.PositionMe.Traj.WiFiRTTReadingOrBuilder getWifiRttDataOrBuilder( + int index); + + /** + * repeated .Fingerprint ble_fingerprints = 14; + */ + java.util.List + getBleFingerprintsList(); + /** + * repeated .Fingerprint ble_fingerprints = 14; + */ + com.openpositioning.PositionMe.Traj.Fingerprint getBleFingerprints(int index); + /** + * repeated .Fingerprint ble_fingerprints = 14; + */ + int getBleFingerprintsCount(); + /** + * repeated .Fingerprint ble_fingerprints = 14; + */ + java.util.List + getBleFingerprintsOrBuilderList(); + /** + * repeated .Fingerprint ble_fingerprints = 14; + */ + com.openpositioning.PositionMe.Traj.FingerprintOrBuilder getBleFingerprintsOrBuilder( + int index); + + /** + * repeated .BleData ble_data = 15; + */ + java.util.List + getBleDataList(); + /** + * repeated .BleData ble_data = 15; + */ + com.openpositioning.PositionMe.Traj.BleData getBleData(int index); + /** + * repeated .BleData ble_data = 15; + */ + int getBleDataCount(); + /** + * repeated .BleData ble_data = 15; */ - java.util.List - getApsDataOrBuilderList(); + java.util.List + getBleDataOrBuilderList(); /** - * repeated .AP_Data aps_data = 9; + * repeated .BleData ble_data = 15; */ - AP_DataOrBuilder getApsDataOrBuilder( - int index); + com.openpositioning.PositionMe.Traj.BleDataOrBuilder getBleDataOrBuilder( + int index); /** *
@@ -229,390 +370,265 @@ AP_DataOrBuilder getApsDataOrBuilder(
      * relative_timestamp = 3000 (3s)
      * 
* - * optional int64 start_timestamp = 10; + * int64 start_timestamp = 16; + * @return The startTimestamp. */ long getStartTimestamp(); /** - * optional string data_identifier = 11; + * .GNSSPosition initial_position = 17; + * @return Whether the initialPosition field is set. */ - String getDataIdentifier(); + boolean hasInitialPosition(); /** - * optional string data_identifier = 11; + * .GNSSPosition initial_position = 17; + * @return The initialPosition. */ - com.google.protobuf.ByteString - getDataIdentifierBytes(); + com.openpositioning.PositionMe.Traj.GNSSPosition getInitialPosition(); + /** + * .GNSSPosition initial_position = 17; + */ + com.openpositioning.PositionMe.Traj.GNSSPositionOrBuilder getInitialPositionOrBuilder(); + + /** + * repeated .GNSSPosition corrected_positions = 18; + */ + java.util.List + getCorrectedPositionsList(); + /** + * repeated .GNSSPosition corrected_positions = 18; + */ + com.openpositioning.PositionMe.Traj.GNSSPosition getCorrectedPositions(int index); + /** + * repeated .GNSSPosition corrected_positions = 18; + */ + int getCorrectedPositionsCount(); + /** + * repeated .GNSSPosition corrected_positions = 18; + */ + java.util.List + getCorrectedPositionsOrBuilderList(); + /** + * repeated .GNSSPosition corrected_positions = 18; + */ + com.openpositioning.PositionMe.Traj.GNSSPositionOrBuilder getCorrectedPositionsOrBuilder( + int index); /** - * optional .Sensor_Info accelerometer_info = 12; + * .SensorInfo accelerometer_info = 19; + * @return Whether the accelerometerInfo field is set. */ boolean hasAccelerometerInfo(); /** - * optional .Sensor_Info accelerometer_info = 12; + * .SensorInfo accelerometer_info = 19; + * @return The accelerometerInfo. */ - Sensor_Info getAccelerometerInfo(); + com.openpositioning.PositionMe.Traj.SensorInfo getAccelerometerInfo(); /** - * optional .Sensor_Info accelerometer_info = 12; + * .SensorInfo accelerometer_info = 19; */ - Sensor_InfoOrBuilder getAccelerometerInfoOrBuilder(); + com.openpositioning.PositionMe.Traj.SensorInfoOrBuilder getAccelerometerInfoOrBuilder(); /** - * optional .Sensor_Info gyroscope_info = 13; + * .SensorInfo gyroscope_info = 20; + * @return Whether the gyroscopeInfo field is set. */ boolean hasGyroscopeInfo(); /** - * optional .Sensor_Info gyroscope_info = 13; + * .SensorInfo gyroscope_info = 20; + * @return The gyroscopeInfo. */ - Sensor_Info getGyroscopeInfo(); + com.openpositioning.PositionMe.Traj.SensorInfo getGyroscopeInfo(); /** - * optional .Sensor_Info gyroscope_info = 13; + * .SensorInfo gyroscope_info = 20; */ - Sensor_InfoOrBuilder getGyroscopeInfoOrBuilder(); + com.openpositioning.PositionMe.Traj.SensorInfoOrBuilder getGyroscopeInfoOrBuilder(); /** - * optional .Sensor_Info rotation_vector_info = 14; + * .SensorInfo rotation_vector_info = 21; + * @return Whether the rotationVectorInfo field is set. */ boolean hasRotationVectorInfo(); /** - * optional .Sensor_Info rotation_vector_info = 14; + * .SensorInfo rotation_vector_info = 21; + * @return The rotationVectorInfo. */ - Sensor_Info getRotationVectorInfo(); + com.openpositioning.PositionMe.Traj.SensorInfo getRotationVectorInfo(); /** - * optional .Sensor_Info rotation_vector_info = 14; + * .SensorInfo rotation_vector_info = 21; */ - Sensor_InfoOrBuilder getRotationVectorInfoOrBuilder(); + com.openpositioning.PositionMe.Traj.SensorInfoOrBuilder getRotationVectorInfoOrBuilder(); /** - * optional .Sensor_Info magnetometer_info = 15; + * .SensorInfo magnetometer_info = 22; + * @return Whether the magnetometerInfo field is set. */ boolean hasMagnetometerInfo(); /** - * optional .Sensor_Info magnetometer_info = 15; + * .SensorInfo magnetometer_info = 22; + * @return The magnetometerInfo. */ - Sensor_Info getMagnetometerInfo(); + com.openpositioning.PositionMe.Traj.SensorInfo getMagnetometerInfo(); /** - * optional .Sensor_Info magnetometer_info = 15; + * .SensorInfo magnetometer_info = 22; */ - Sensor_InfoOrBuilder getMagnetometerInfoOrBuilder(); + com.openpositioning.PositionMe.Traj.SensorInfoOrBuilder getMagnetometerInfoOrBuilder(); /** - * optional .Sensor_Info barometer_info = 16; + * .SensorInfo barometer_info = 23; + * @return Whether the barometerInfo field is set. */ boolean hasBarometerInfo(); /** - * optional .Sensor_Info barometer_info = 16; + * .SensorInfo barometer_info = 23; + * @return The barometerInfo. */ - Sensor_Info getBarometerInfo(); + com.openpositioning.PositionMe.Traj.SensorInfo getBarometerInfo(); /** - * optional .Sensor_Info barometer_info = 16; + * .SensorInfo barometer_info = 23; */ - Sensor_InfoOrBuilder getBarometerInfoOrBuilder(); + com.openpositioning.PositionMe.Traj.SensorInfoOrBuilder getBarometerInfoOrBuilder(); /** - * optional .Sensor_Info light_sensor_info = 17; + * .SensorInfo light_SensorInfo = 24; + * @return Whether the lightSensorInfo field is set. */ boolean hasLightSensorInfo(); /** - * optional .Sensor_Info light_sensor_info = 17; + * .SensorInfo light_SensorInfo = 24; + * @return The lightSensorInfo. + */ + com.openpositioning.PositionMe.Traj.SensorInfo getLightSensorInfo(); + /** + * .SensorInfo light_SensorInfo = 24; + */ + com.openpositioning.PositionMe.Traj.SensorInfoOrBuilder getLightSensorInfoOrBuilder(); + + /** + * .SensorInfo proximity_info = 25; + * @return Whether the proximityInfo field is set. + */ + boolean hasProximityInfo(); + /** + * .SensorInfo proximity_info = 25; + * @return The proximityInfo. + */ + com.openpositioning.PositionMe.Traj.SensorInfo getProximityInfo(); + /** + * .SensorInfo proximity_info = 25; + */ + com.openpositioning.PositionMe.Traj.SensorInfoOrBuilder getProximityInfoOrBuilder(); + + /** + * repeated .GNSSPosition test_points = 26; + */ + java.util.List + getTestPointsList(); + /** + * repeated .GNSSPosition test_points = 26; + */ + com.openpositioning.PositionMe.Traj.GNSSPosition getTestPoints(int index); + /** + * repeated .GNSSPosition test_points = 26; + */ + int getTestPointsCount(); + /** + * repeated .GNSSPosition test_points = 26; */ - Sensor_Info getLightSensorInfo(); + java.util.List + getTestPointsOrBuilderList(); /** - * optional .Sensor_Info light_sensor_info = 17; + * repeated .GNSSPosition test_points = 26; */ - Sensor_InfoOrBuilder getLightSensorInfoOrBuilder(); + com.openpositioning.PositionMe.Traj.GNSSPositionOrBuilder getTestPointsOrBuilder( + int index); } /** * Protobuf type {@code Trajectory} */ - public static final class Trajectory extends - com.google.protobuf.GeneratedMessageV3 implements - // @@protoc_insertion_point(message_implements:Trajectory) - TrajectoryOrBuilder { + public static final class Trajectory extends + com.google.protobuf.GeneratedMessage implements + // @@protoc_insertion_point(message_implements:Trajectory) + TrajectoryOrBuilder { + private static final long serialVersionUID = 0L; + static { + com.google.protobuf.RuntimeVersion.validateProtobufGencodeVersion( + com.google.protobuf.RuntimeVersion.RuntimeDomain.PUBLIC, + /* major= */ 4, + /* minor= */ 29, + /* patch= */ 6, + /* suffix= */ "", + Trajectory.class.getName()); + } // Use Trajectory.newBuilder() to construct. - private Trajectory(com.google.protobuf.GeneratedMessageV3.Builder builder) { + private Trajectory(com.google.protobuf.GeneratedMessage.Builder builder) { super(builder); } private Trajectory() { androidVersion_ = ""; + trajectoryId_ = ""; imuData_ = java.util.Collections.emptyList(); pdrData_ = java.util.Collections.emptyList(); - positionData_ = java.util.Collections.emptyList(); + magnetometerData_ = java.util.Collections.emptyList(); pressureData_ = java.util.Collections.emptyList(); lightData_ = java.util.Collections.emptyList(); + proximityData_ = java.util.Collections.emptyList(); gnssData_ = java.util.Collections.emptyList(); - wifiData_ = java.util.Collections.emptyList(); + wifiFingerprints_ = java.util.Collections.emptyList(); apsData_ = java.util.Collections.emptyList(); - startTimestamp_ = 0L; - dataIdentifier_ = ""; - } - - @Override - public final com.google.protobuf.UnknownFieldSet - getUnknownFields() { - return com.google.protobuf.UnknownFieldSet.getDefaultInstance(); - } - private Trajectory( - com.google.protobuf.CodedInputStream input, - com.google.protobuf.ExtensionRegistryLite extensionRegistry) - throws com.google.protobuf.InvalidProtocolBufferException { - this(); - int mutable_bitField0_ = 0; - try { - boolean done = false; - while (!done) { - int tag = input.readTag(); - switch (tag) { - case 0: - done = true; - break; - default: { - if (!input.skipField(tag)) { - done = true; - } - break; - } - case 10: { - String s = input.readStringRequireUtf8(); - - androidVersion_ = s; - break; - } - case 18: { - if (!((mutable_bitField0_ & 0x00000002) == 0x00000002)) { - imuData_ = new java.util.ArrayList(); - mutable_bitField0_ |= 0x00000002; - } - imuData_.add( - input.readMessage(Motion_Sample.parser(), extensionRegistry)); - break; - } - case 26: { - if (!((mutable_bitField0_ & 0x00000004) == 0x00000004)) { - pdrData_ = new java.util.ArrayList(); - mutable_bitField0_ |= 0x00000004; - } - pdrData_.add( - input.readMessage(Pdr_Sample.parser(), extensionRegistry)); - break; - } - case 34: { - if (!((mutable_bitField0_ & 0x00000008) == 0x00000008)) { - positionData_ = new java.util.ArrayList(); - mutable_bitField0_ |= 0x00000008; - } - positionData_.add( - input.readMessage(Position_Sample.parser(), extensionRegistry)); - break; - } - case 42: { - if (!((mutable_bitField0_ & 0x00000010) == 0x00000010)) { - pressureData_ = new java.util.ArrayList(); - mutable_bitField0_ |= 0x00000010; - } - pressureData_.add( - input.readMessage(Pressure_Sample.parser(), extensionRegistry)); - break; - } - case 50: { - if (!((mutable_bitField0_ & 0x00000020) == 0x00000020)) { - lightData_ = new java.util.ArrayList(); - mutable_bitField0_ |= 0x00000020; - } - lightData_.add( - input.readMessage(Light_Sample.parser(), extensionRegistry)); - break; - } - case 58: { - if (!((mutable_bitField0_ & 0x00000040) == 0x00000040)) { - gnssData_ = new java.util.ArrayList(); - mutable_bitField0_ |= 0x00000040; - } - gnssData_.add( - input.readMessage(GNSS_Sample.parser(), extensionRegistry)); - break; - } - case 66: { - if (!((mutable_bitField0_ & 0x00000080) == 0x00000080)) { - wifiData_ = new java.util.ArrayList(); - mutable_bitField0_ |= 0x00000080; - } - wifiData_.add( - input.readMessage(WiFi_Sample.parser(), extensionRegistry)); - break; - } - case 74: { - if (!((mutable_bitField0_ & 0x00000100) == 0x00000100)) { - apsData_ = new java.util.ArrayList(); - mutable_bitField0_ |= 0x00000100; - } - apsData_.add( - input.readMessage(AP_Data.parser(), extensionRegistry)); - break; - } - case 80: { - - startTimestamp_ = input.readInt64(); - break; - } - case 90: { - String s = input.readStringRequireUtf8(); - - dataIdentifier_ = s; - break; - } - case 98: { - Sensor_Info.Builder subBuilder = null; - if (accelerometerInfo_ != null) { - subBuilder = accelerometerInfo_.toBuilder(); - } - accelerometerInfo_ = input.readMessage(Sensor_Info.parser(), extensionRegistry); - if (subBuilder != null) { - subBuilder.mergeFrom(accelerometerInfo_); - accelerometerInfo_ = subBuilder.buildPartial(); - } - - break; - } - case 106: { - Sensor_Info.Builder subBuilder = null; - if (gyroscopeInfo_ != null) { - subBuilder = gyroscopeInfo_.toBuilder(); - } - gyroscopeInfo_ = input.readMessage(Sensor_Info.parser(), extensionRegistry); - if (subBuilder != null) { - subBuilder.mergeFrom(gyroscopeInfo_); - gyroscopeInfo_ = subBuilder.buildPartial(); - } - - break; - } - case 114: { - Sensor_Info.Builder subBuilder = null; - if (rotationVectorInfo_ != null) { - subBuilder = rotationVectorInfo_.toBuilder(); - } - rotationVectorInfo_ = input.readMessage(Sensor_Info.parser(), extensionRegistry); - if (subBuilder != null) { - subBuilder.mergeFrom(rotationVectorInfo_); - rotationVectorInfo_ = subBuilder.buildPartial(); - } - - break; - } - case 122: { - Sensor_Info.Builder subBuilder = null; - if (magnetometerInfo_ != null) { - subBuilder = magnetometerInfo_.toBuilder(); - } - magnetometerInfo_ = input.readMessage(Sensor_Info.parser(), extensionRegistry); - if (subBuilder != null) { - subBuilder.mergeFrom(magnetometerInfo_); - magnetometerInfo_ = subBuilder.buildPartial(); - } - - break; - } - case 130: { - Sensor_Info.Builder subBuilder = null; - if (barometerInfo_ != null) { - subBuilder = barometerInfo_.toBuilder(); - } - barometerInfo_ = input.readMessage(Sensor_Info.parser(), extensionRegistry); - if (subBuilder != null) { - subBuilder.mergeFrom(barometerInfo_); - barometerInfo_ = subBuilder.buildPartial(); - } - - break; - } - case 138: { - Sensor_Info.Builder subBuilder = null; - if (lightSensorInfo_ != null) { - subBuilder = lightSensorInfo_.toBuilder(); - } - lightSensorInfo_ = input.readMessage(Sensor_Info.parser(), extensionRegistry); - if (subBuilder != null) { - subBuilder.mergeFrom(lightSensorInfo_); - lightSensorInfo_ = subBuilder.buildPartial(); - } - - break; - } - } - } - } catch (com.google.protobuf.InvalidProtocolBufferException e) { - throw e.setUnfinishedMessage(this); - } catch (java.io.IOException e) { - throw new com.google.protobuf.InvalidProtocolBufferException( - e).setUnfinishedMessage(this); - } finally { - if (((mutable_bitField0_ & 0x00000002) == 0x00000002)) { - imuData_ = java.util.Collections.unmodifiableList(imuData_); - } - if (((mutable_bitField0_ & 0x00000004) == 0x00000004)) { - pdrData_ = java.util.Collections.unmodifiableList(pdrData_); - } - if (((mutable_bitField0_ & 0x00000008) == 0x00000008)) { - positionData_ = java.util.Collections.unmodifiableList(positionData_); - } - if (((mutable_bitField0_ & 0x00000010) == 0x00000010)) { - pressureData_ = java.util.Collections.unmodifiableList(pressureData_); - } - if (((mutable_bitField0_ & 0x00000020) == 0x00000020)) { - lightData_ = java.util.Collections.unmodifiableList(lightData_); - } - if (((mutable_bitField0_ & 0x00000040) == 0x00000040)) { - gnssData_ = java.util.Collections.unmodifiableList(gnssData_); - } - if (((mutable_bitField0_ & 0x00000080) == 0x00000080)) { - wifiData_ = java.util.Collections.unmodifiableList(wifiData_); - } - if (((mutable_bitField0_ & 0x00000100) == 0x00000100)) { - apsData_ = java.util.Collections.unmodifiableList(apsData_); - } - makeExtensionsImmutable(); - } + wifiRttData_ = java.util.Collections.emptyList(); + bleFingerprints_ = java.util.Collections.emptyList(); + bleData_ = java.util.Collections.emptyList(); + correctedPositions_ = java.util.Collections.emptyList(); + testPoints_ = java.util.Collections.emptyList(); } + public static final com.google.protobuf.Descriptors.Descriptor - getDescriptor() { - return Traj.internal_static_Trajectory_descriptor; + getDescriptor() { + return com.openpositioning.PositionMe.Traj.internal_static_Trajectory_descriptor; } - protected com.google.protobuf.GeneratedMessageV3.FieldAccessorTable - internalGetFieldAccessorTable() { - return Traj.internal_static_Trajectory_fieldAccessorTable - .ensureFieldAccessorsInitialized( - Trajectory.class, Builder.class); + @java.lang.Override + protected com.google.protobuf.GeneratedMessage.FieldAccessorTable + internalGetFieldAccessorTable() { + return com.openpositioning.PositionMe.Traj.internal_static_Trajectory_fieldAccessorTable + .ensureFieldAccessorsInitialized( + com.openpositioning.PositionMe.Traj.Trajectory.class, com.openpositioning.PositionMe.Traj.Trajectory.Builder.class); } private int bitField0_; public static final int ANDROID_VERSION_FIELD_NUMBER = 1; - private volatile Object androidVersion_; + @SuppressWarnings("serial") + private volatile java.lang.Object androidVersion_ = ""; /** - * optional string android_version = 1; + * string android_version = 1; + * @return The androidVersion. */ - public String getAndroidVersion() { - Object ref = androidVersion_; - if (ref instanceof String) { - return (String) ref; + @java.lang.Override + public java.lang.String getAndroidVersion() { + java.lang.Object ref = androidVersion_; + if (ref instanceof java.lang.String) { + return (java.lang.String) ref; } else { - com.google.protobuf.ByteString bs = - (com.google.protobuf.ByteString) ref; - String s = bs.toStringUtf8(); + com.google.protobuf.ByteString bs = + (com.google.protobuf.ByteString) ref; + java.lang.String s = bs.toStringUtf8(); androidVersion_ = s; return s; } } /** - * optional string android_version = 1; + * string android_version = 1; + * @return The bytes for androidVersion. */ + @java.lang.Override public com.google.protobuf.ByteString - getAndroidVersionBytes() { - Object ref = androidVersion_; - if (ref instanceof String) { - com.google.protobuf.ByteString b = - com.google.protobuf.ByteString.copyFromUtf8( - (String) ref); + getAndroidVersionBytes() { + java.lang.Object ref = androidVersion_; + if (ref instanceof java.lang.String) { + com.google.protobuf.ByteString b = + com.google.protobuf.ByteString.copyFromUtf8( + (java.lang.String) ref); androidVersion_ = b; return b; } else { @@ -620,288 +636,562 @@ public String getAndroidVersion() { } } - public static final int IMU_DATA_FIELD_NUMBER = 2; - private java.util.List imuData_; + public static final int TRAJECTORY_VERSION_FIELD_NUMBER = 2; + private float trajectoryVersion_ = 0F; + /** + *
+     * version 2.0
+     * 
+ * + * float trajectory_version = 2; + * @return The trajectoryVersion. + */ + @java.lang.Override + public float getTrajectoryVersion() { + return trajectoryVersion_; + } + + public static final int TRAJECTORY_ID_FIELD_NUMBER = 3; + @SuppressWarnings("serial") + private volatile java.lang.Object trajectoryId_ = ""; + /** + *
+     * trajectory id/name for identification
+     * 
+ * + * string trajectory_id = 3; + * @return The trajectoryId. + */ + @java.lang.Override + public java.lang.String getTrajectoryId() { + java.lang.Object ref = trajectoryId_; + if (ref instanceof java.lang.String) { + return (java.lang.String) ref; + } else { + com.google.protobuf.ByteString bs = + (com.google.protobuf.ByteString) ref; + java.lang.String s = bs.toStringUtf8(); + trajectoryId_ = s; + return s; + } + } + /** + *
+     * trajectory id/name for identification
+     * 
+ * + * string trajectory_id = 3; + * @return The bytes for trajectoryId. + */ + @java.lang.Override + public com.google.protobuf.ByteString + getTrajectoryIdBytes() { + java.lang.Object ref = trajectoryId_; + if (ref instanceof java.lang.String) { + com.google.protobuf.ByteString b = + com.google.protobuf.ByteString.copyFromUtf8( + (java.lang.String) ref); + trajectoryId_ = b; + return b; + } else { + return (com.google.protobuf.ByteString) ref; + } + } + + public static final int IMU_DATA_FIELD_NUMBER = 4; + @SuppressWarnings("serial") + private java.util.List imuData_; /** - * repeated .Motion_Sample imu_data = 2; + * repeated .IMUReading imu_data = 4; */ - public java.util.List getImuDataList() { + @java.lang.Override + public java.util.List getImuDataList() { return imuData_; } /** - * repeated .Motion_Sample imu_data = 2; + * repeated .IMUReading imu_data = 4; */ - public java.util.List - getImuDataOrBuilderList() { + @java.lang.Override + public java.util.List + getImuDataOrBuilderList() { return imuData_; } /** - * repeated .Motion_Sample imu_data = 2; + * repeated .IMUReading imu_data = 4; */ + @java.lang.Override public int getImuDataCount() { return imuData_.size(); } /** - * repeated .Motion_Sample imu_data = 2; + * repeated .IMUReading imu_data = 4; */ - public Motion_Sample getImuData(int index) { + @java.lang.Override + public com.openpositioning.PositionMe.Traj.IMUReading getImuData(int index) { return imuData_.get(index); } /** - * repeated .Motion_Sample imu_data = 2; + * repeated .IMUReading imu_data = 4; */ - public Motion_SampleOrBuilder getImuDataOrBuilder( - int index) { + @java.lang.Override + public com.openpositioning.PositionMe.Traj.IMUReadingOrBuilder getImuDataOrBuilder( + int index) { return imuData_.get(index); } - public static final int PDR_DATA_FIELD_NUMBER = 3; - private java.util.List pdrData_; + public static final int PDR_DATA_FIELD_NUMBER = 5; + @SuppressWarnings("serial") + private java.util.List pdrData_; /** - * repeated .Pdr_Sample pdr_data = 3; + * repeated .RelativePosition pdr_data = 5; */ - public java.util.List getPdrDataList() { + @java.lang.Override + public java.util.List getPdrDataList() { return pdrData_; } /** - * repeated .Pdr_Sample pdr_data = 3; + * repeated .RelativePosition pdr_data = 5; */ - public java.util.List - getPdrDataOrBuilderList() { + @java.lang.Override + public java.util.List + getPdrDataOrBuilderList() { return pdrData_; } /** - * repeated .Pdr_Sample pdr_data = 3; + * repeated .RelativePosition pdr_data = 5; */ + @java.lang.Override public int getPdrDataCount() { return pdrData_.size(); } /** - * repeated .Pdr_Sample pdr_data = 3; + * repeated .RelativePosition pdr_data = 5; */ - public Pdr_Sample getPdrData(int index) { + @java.lang.Override + public com.openpositioning.PositionMe.Traj.RelativePosition getPdrData(int index) { return pdrData_.get(index); } /** - * repeated .Pdr_Sample pdr_data = 3; + * repeated .RelativePosition pdr_data = 5; */ - public Pdr_SampleOrBuilder getPdrDataOrBuilder( - int index) { + @java.lang.Override + public com.openpositioning.PositionMe.Traj.RelativePositionOrBuilder getPdrDataOrBuilder( + int index) { return pdrData_.get(index); } - public static final int POSITION_DATA_FIELD_NUMBER = 4; - private java.util.List positionData_; + public static final int MAGNETOMETER_DATA_FIELD_NUMBER = 6; + @SuppressWarnings("serial") + private java.util.List magnetometerData_; /** - * repeated .Position_Sample position_data = 4; + * repeated .MagnetometerReading magnetometer_data = 6; */ - public java.util.List getPositionDataList() { - return positionData_; + @java.lang.Override + public java.util.List getMagnetometerDataList() { + return magnetometerData_; } /** - * repeated .Position_Sample position_data = 4; + * repeated .MagnetometerReading magnetometer_data = 6; */ - public java.util.List - getPositionDataOrBuilderList() { - return positionData_; + @java.lang.Override + public java.util.List + getMagnetometerDataOrBuilderList() { + return magnetometerData_; } /** - * repeated .Position_Sample position_data = 4; + * repeated .MagnetometerReading magnetometer_data = 6; */ - public int getPositionDataCount() { - return positionData_.size(); + @java.lang.Override + public int getMagnetometerDataCount() { + return magnetometerData_.size(); } /** - * repeated .Position_Sample position_data = 4; + * repeated .MagnetometerReading magnetometer_data = 6; */ - public Position_Sample getPositionData(int index) { - return positionData_.get(index); + @java.lang.Override + public com.openpositioning.PositionMe.Traj.MagnetometerReading getMagnetometerData(int index) { + return magnetometerData_.get(index); } /** - * repeated .Position_Sample position_data = 4; + * repeated .MagnetometerReading magnetometer_data = 6; */ - public Position_SampleOrBuilder getPositionDataOrBuilder( - int index) { - return positionData_.get(index); + @java.lang.Override + public com.openpositioning.PositionMe.Traj.MagnetometerReadingOrBuilder getMagnetometerDataOrBuilder( + int index) { + return magnetometerData_.get(index); } - public static final int PRESSURE_DATA_FIELD_NUMBER = 5; - private java.util.List pressureData_; + public static final int PRESSURE_DATA_FIELD_NUMBER = 7; + @SuppressWarnings("serial") + private java.util.List pressureData_; /** - * repeated .Pressure_Sample pressure_data = 5; + * repeated .BarometerReading pressure_data = 7; */ - public java.util.List getPressureDataList() { + @java.lang.Override + public java.util.List getPressureDataList() { return pressureData_; } /** - * repeated .Pressure_Sample pressure_data = 5; + * repeated .BarometerReading pressure_data = 7; */ - public java.util.List - getPressureDataOrBuilderList() { + @java.lang.Override + public java.util.List + getPressureDataOrBuilderList() { return pressureData_; } /** - * repeated .Pressure_Sample pressure_data = 5; + * repeated .BarometerReading pressure_data = 7; */ + @java.lang.Override public int getPressureDataCount() { return pressureData_.size(); } /** - * repeated .Pressure_Sample pressure_data = 5; + * repeated .BarometerReading pressure_data = 7; */ - public Pressure_Sample getPressureData(int index) { + @java.lang.Override + public com.openpositioning.PositionMe.Traj.BarometerReading getPressureData(int index) { return pressureData_.get(index); } /** - * repeated .Pressure_Sample pressure_data = 5; + * repeated .BarometerReading pressure_data = 7; */ - public Pressure_SampleOrBuilder getPressureDataOrBuilder( - int index) { + @java.lang.Override + public com.openpositioning.PositionMe.Traj.BarometerReadingOrBuilder getPressureDataOrBuilder( + int index) { return pressureData_.get(index); } - public static final int LIGHT_DATA_FIELD_NUMBER = 6; - private java.util.List lightData_; + public static final int LIGHT_DATA_FIELD_NUMBER = 8; + @SuppressWarnings("serial") + private java.util.List lightData_; /** - * repeated .Light_Sample light_data = 6; + * repeated .LightReading light_data = 8; */ - public java.util.List getLightDataList() { + @java.lang.Override + public java.util.List getLightDataList() { return lightData_; } /** - * repeated .Light_Sample light_data = 6; + * repeated .LightReading light_data = 8; */ - public java.util.List - getLightDataOrBuilderList() { + @java.lang.Override + public java.util.List + getLightDataOrBuilderList() { return lightData_; } /** - * repeated .Light_Sample light_data = 6; + * repeated .LightReading light_data = 8; */ + @java.lang.Override public int getLightDataCount() { return lightData_.size(); } /** - * repeated .Light_Sample light_data = 6; + * repeated .LightReading light_data = 8; */ - public Light_Sample getLightData(int index) { + @java.lang.Override + public com.openpositioning.PositionMe.Traj.LightReading getLightData(int index) { return lightData_.get(index); } /** - * repeated .Light_Sample light_data = 6; + * repeated .LightReading light_data = 8; */ - public Light_SampleOrBuilder getLightDataOrBuilder( - int index) { + @java.lang.Override + public com.openpositioning.PositionMe.Traj.LightReadingOrBuilder getLightDataOrBuilder( + int index) { return lightData_.get(index); } - public static final int GNSS_DATA_FIELD_NUMBER = 7; - private java.util.List gnssData_; + public static final int PROXIMITY_DATA_FIELD_NUMBER = 9; + @SuppressWarnings("serial") + private java.util.List proximityData_; + /** + * repeated .ProximityReading proximity_data = 9; + */ + @java.lang.Override + public java.util.List getProximityDataList() { + return proximityData_; + } + /** + * repeated .ProximityReading proximity_data = 9; + */ + @java.lang.Override + public java.util.List + getProximityDataOrBuilderList() { + return proximityData_; + } + /** + * repeated .ProximityReading proximity_data = 9; + */ + @java.lang.Override + public int getProximityDataCount() { + return proximityData_.size(); + } + /** + * repeated .ProximityReading proximity_data = 9; + */ + @java.lang.Override + public com.openpositioning.PositionMe.Traj.ProximityReading getProximityData(int index) { + return proximityData_.get(index); + } + /** + * repeated .ProximityReading proximity_data = 9; + */ + @java.lang.Override + public com.openpositioning.PositionMe.Traj.ProximityReadingOrBuilder getProximityDataOrBuilder( + int index) { + return proximityData_.get(index); + } + + public static final int GNSS_DATA_FIELD_NUMBER = 10; + @SuppressWarnings("serial") + private java.util.List gnssData_; /** - * repeated .GNSS_Sample gnss_data = 7; + * repeated .GNSSReading gnss_data = 10; */ - public java.util.List getGnssDataList() { + @java.lang.Override + public java.util.List getGnssDataList() { return gnssData_; } /** - * repeated .GNSS_Sample gnss_data = 7; + * repeated .GNSSReading gnss_data = 10; */ - public java.util.List - getGnssDataOrBuilderList() { + @java.lang.Override + public java.util.List + getGnssDataOrBuilderList() { return gnssData_; } /** - * repeated .GNSS_Sample gnss_data = 7; + * repeated .GNSSReading gnss_data = 10; */ + @java.lang.Override public int getGnssDataCount() { return gnssData_.size(); } /** - * repeated .GNSS_Sample gnss_data = 7; + * repeated .GNSSReading gnss_data = 10; */ - public GNSS_Sample getGnssData(int index) { + @java.lang.Override + public com.openpositioning.PositionMe.Traj.GNSSReading getGnssData(int index) { return gnssData_.get(index); } /** - * repeated .GNSS_Sample gnss_data = 7; + * repeated .GNSSReading gnss_data = 10; */ - public GNSS_SampleOrBuilder getGnssDataOrBuilder( - int index) { + @java.lang.Override + public com.openpositioning.PositionMe.Traj.GNSSReadingOrBuilder getGnssDataOrBuilder( + int index) { return gnssData_.get(index); } - public static final int WIFI_DATA_FIELD_NUMBER = 8; - private java.util.List wifiData_; + public static final int WIFI_FINGERPRINTS_FIELD_NUMBER = 11; + @SuppressWarnings("serial") + private java.util.List wifiFingerprints_; /** - * repeated .WiFi_Sample wifi_data = 8; + * repeated .Fingerprint wifi_fingerprints = 11; */ - public java.util.List getWifiDataList() { - return wifiData_; + @java.lang.Override + public java.util.List getWifiFingerprintsList() { + return wifiFingerprints_; } /** - * repeated .WiFi_Sample wifi_data = 8; + * repeated .Fingerprint wifi_fingerprints = 11; */ - public java.util.List - getWifiDataOrBuilderList() { - return wifiData_; + @java.lang.Override + public java.util.List + getWifiFingerprintsOrBuilderList() { + return wifiFingerprints_; } /** - * repeated .WiFi_Sample wifi_data = 8; + * repeated .Fingerprint wifi_fingerprints = 11; */ - public int getWifiDataCount() { - return wifiData_.size(); + @java.lang.Override + public int getWifiFingerprintsCount() { + return wifiFingerprints_.size(); } /** - * repeated .WiFi_Sample wifi_data = 8; + * repeated .Fingerprint wifi_fingerprints = 11; */ - public WiFi_Sample getWifiData(int index) { - return wifiData_.get(index); + @java.lang.Override + public com.openpositioning.PositionMe.Traj.Fingerprint getWifiFingerprints(int index) { + return wifiFingerprints_.get(index); } /** - * repeated .WiFi_Sample wifi_data = 8; + * repeated .Fingerprint wifi_fingerprints = 11; */ - public WiFi_SampleOrBuilder getWifiDataOrBuilder( - int index) { - return wifiData_.get(index); + @java.lang.Override + public com.openpositioning.PositionMe.Traj.FingerprintOrBuilder getWifiFingerprintsOrBuilder( + int index) { + return wifiFingerprints_.get(index); } - public static final int APS_DATA_FIELD_NUMBER = 9; - private java.util.List apsData_; + public static final int APS_DATA_FIELD_NUMBER = 12; + @SuppressWarnings("serial") + private java.util.List apsData_; /** - * repeated .AP_Data aps_data = 9; + * repeated .WiFiAPData aps_data = 12; */ - public java.util.List getApsDataList() { + @java.lang.Override + public java.util.List getApsDataList() { return apsData_; } /** - * repeated .AP_Data aps_data = 9; + * repeated .WiFiAPData aps_data = 12; */ - public java.util.List - getApsDataOrBuilderList() { + @java.lang.Override + public java.util.List + getApsDataOrBuilderList() { return apsData_; } /** - * repeated .AP_Data aps_data = 9; + * repeated .WiFiAPData aps_data = 12; */ + @java.lang.Override public int getApsDataCount() { return apsData_.size(); } /** - * repeated .AP_Data aps_data = 9; + * repeated .WiFiAPData aps_data = 12; */ - public AP_Data getApsData(int index) { + @java.lang.Override + public com.openpositioning.PositionMe.Traj.WiFiAPData getApsData(int index) { return apsData_.get(index); } /** - * repeated .AP_Data aps_data = 9; + * repeated .WiFiAPData aps_data = 12; */ - public AP_DataOrBuilder getApsDataOrBuilder( - int index) { + @java.lang.Override + public com.openpositioning.PositionMe.Traj.WiFiAPDataOrBuilder getApsDataOrBuilder( + int index) { return apsData_.get(index); } - public static final int START_TIMESTAMP_FIELD_NUMBER = 10; - private long startTimestamp_; + public static final int WIFI_RTT_DATA_FIELD_NUMBER = 13; + @SuppressWarnings("serial") + private java.util.List wifiRttData_; + /** + * repeated .WiFiRTTReading wifi_rtt_data = 13; + */ + @java.lang.Override + public java.util.List getWifiRttDataList() { + return wifiRttData_; + } + /** + * repeated .WiFiRTTReading wifi_rtt_data = 13; + */ + @java.lang.Override + public java.util.List + getWifiRttDataOrBuilderList() { + return wifiRttData_; + } + /** + * repeated .WiFiRTTReading wifi_rtt_data = 13; + */ + @java.lang.Override + public int getWifiRttDataCount() { + return wifiRttData_.size(); + } + /** + * repeated .WiFiRTTReading wifi_rtt_data = 13; + */ + @java.lang.Override + public com.openpositioning.PositionMe.Traj.WiFiRTTReading getWifiRttData(int index) { + return wifiRttData_.get(index); + } + /** + * repeated .WiFiRTTReading wifi_rtt_data = 13; + */ + @java.lang.Override + public com.openpositioning.PositionMe.Traj.WiFiRTTReadingOrBuilder getWifiRttDataOrBuilder( + int index) { + return wifiRttData_.get(index); + } + + public static final int BLE_FINGERPRINTS_FIELD_NUMBER = 14; + @SuppressWarnings("serial") + private java.util.List bleFingerprints_; + /** + * repeated .Fingerprint ble_fingerprints = 14; + */ + @java.lang.Override + public java.util.List getBleFingerprintsList() { + return bleFingerprints_; + } + /** + * repeated .Fingerprint ble_fingerprints = 14; + */ + @java.lang.Override + public java.util.List + getBleFingerprintsOrBuilderList() { + return bleFingerprints_; + } + /** + * repeated .Fingerprint ble_fingerprints = 14; + */ + @java.lang.Override + public int getBleFingerprintsCount() { + return bleFingerprints_.size(); + } + /** + * repeated .Fingerprint ble_fingerprints = 14; + */ + @java.lang.Override + public com.openpositioning.PositionMe.Traj.Fingerprint getBleFingerprints(int index) { + return bleFingerprints_.get(index); + } + /** + * repeated .Fingerprint ble_fingerprints = 14; + */ + @java.lang.Override + public com.openpositioning.PositionMe.Traj.FingerprintOrBuilder getBleFingerprintsOrBuilder( + int index) { + return bleFingerprints_.get(index); + } + + public static final int BLE_DATA_FIELD_NUMBER = 15; + @SuppressWarnings("serial") + private java.util.List bleData_; + /** + * repeated .BleData ble_data = 15; + */ + @java.lang.Override + public java.util.List getBleDataList() { + return bleData_; + } + /** + * repeated .BleData ble_data = 15; + */ + @java.lang.Override + public java.util.List + getBleDataOrBuilderList() { + return bleData_; + } + /** + * repeated .BleData ble_data = 15; + */ + @java.lang.Override + public int getBleDataCount() { + return bleData_.size(); + } + /** + * repeated .BleData ble_data = 15; + */ + @java.lang.Override + public com.openpositioning.PositionMe.Traj.BleData getBleData(int index) { + return bleData_.get(index); + } + /** + * repeated .BleData ble_data = 15; + */ + @java.lang.Override + public com.openpositioning.PositionMe.Traj.BleDataOrBuilder getBleDataOrBuilder( + int index) { + return bleData_.get(index); + } + + public static final int START_TIMESTAMP_FIELD_NUMBER = 16; + private long startTimestamp_ = 0L; /** *
      * UNIX timestamp (in milliseconds) recorded from the start of this
@@ -913,175 +1203,308 @@ public AP_DataOrBuilder getApsDataOrBuilder(
      * relative_timestamp = 3000 (3s)
      * 
* - * optional int64 start_timestamp = 10; + * int64 start_timestamp = 16; + * @return The startTimestamp. */ + @java.lang.Override public long getStartTimestamp() { return startTimestamp_; } - public static final int DATA_IDENTIFIER_FIELD_NUMBER = 11; - private volatile Object dataIdentifier_; + public static final int INITIAL_POSITION_FIELD_NUMBER = 17; + private com.openpositioning.PositionMe.Traj.GNSSPosition initialPosition_; /** - * optional string data_identifier = 11; + * .GNSSPosition initial_position = 17; + * @return Whether the initialPosition field is set. */ - public String getDataIdentifier() { - Object ref = dataIdentifier_; - if (ref instanceof String) { - return (String) ref; - } else { - com.google.protobuf.ByteString bs = - (com.google.protobuf.ByteString) ref; - String s = bs.toStringUtf8(); - dataIdentifier_ = s; - return s; - } + @java.lang.Override + public boolean hasInitialPosition() { + return ((bitField0_ & 0x00000001) != 0); } /** - * optional string data_identifier = 11; + * .GNSSPosition initial_position = 17; + * @return The initialPosition. */ - public com.google.protobuf.ByteString - getDataIdentifierBytes() { - Object ref = dataIdentifier_; - if (ref instanceof String) { - com.google.protobuf.ByteString b = - com.google.protobuf.ByteString.copyFromUtf8( - (String) ref); - dataIdentifier_ = b; - return b; - } else { - return (com.google.protobuf.ByteString) ref; - } + @java.lang.Override + public com.openpositioning.PositionMe.Traj.GNSSPosition getInitialPosition() { + return initialPosition_ == null ? com.openpositioning.PositionMe.Traj.GNSSPosition.getDefaultInstance() : initialPosition_; + } + /** + * .GNSSPosition initial_position = 17; + */ + @java.lang.Override + public com.openpositioning.PositionMe.Traj.GNSSPositionOrBuilder getInitialPositionOrBuilder() { + return initialPosition_ == null ? com.openpositioning.PositionMe.Traj.GNSSPosition.getDefaultInstance() : initialPosition_; + } + + public static final int CORRECTED_POSITIONS_FIELD_NUMBER = 18; + @SuppressWarnings("serial") + private java.util.List correctedPositions_; + /** + * repeated .GNSSPosition corrected_positions = 18; + */ + @java.lang.Override + public java.util.List getCorrectedPositionsList() { + return correctedPositions_; + } + /** + * repeated .GNSSPosition corrected_positions = 18; + */ + @java.lang.Override + public java.util.List + getCorrectedPositionsOrBuilderList() { + return correctedPositions_; + } + /** + * repeated .GNSSPosition corrected_positions = 18; + */ + @java.lang.Override + public int getCorrectedPositionsCount() { + return correctedPositions_.size(); + } + /** + * repeated .GNSSPosition corrected_positions = 18; + */ + @java.lang.Override + public com.openpositioning.PositionMe.Traj.GNSSPosition getCorrectedPositions(int index) { + return correctedPositions_.get(index); + } + /** + * repeated .GNSSPosition corrected_positions = 18; + */ + @java.lang.Override + public com.openpositioning.PositionMe.Traj.GNSSPositionOrBuilder getCorrectedPositionsOrBuilder( + int index) { + return correctedPositions_.get(index); } - public static final int ACCELEROMETER_INFO_FIELD_NUMBER = 12; - private Sensor_Info accelerometerInfo_; + public static final int ACCELEROMETER_INFO_FIELD_NUMBER = 19; + private com.openpositioning.PositionMe.Traj.SensorInfo accelerometerInfo_; /** - * optional .Sensor_Info accelerometer_info = 12; + * .SensorInfo accelerometer_info = 19; + * @return Whether the accelerometerInfo field is set. */ + @java.lang.Override public boolean hasAccelerometerInfo() { - return accelerometerInfo_ != null; + return ((bitField0_ & 0x00000002) != 0); } /** - * optional .Sensor_Info accelerometer_info = 12; + * .SensorInfo accelerometer_info = 19; + * @return The accelerometerInfo. */ - public Sensor_Info getAccelerometerInfo() { - return accelerometerInfo_ == null ? Sensor_Info.getDefaultInstance() : accelerometerInfo_; + @java.lang.Override + public com.openpositioning.PositionMe.Traj.SensorInfo getAccelerometerInfo() { + return accelerometerInfo_ == null ? com.openpositioning.PositionMe.Traj.SensorInfo.getDefaultInstance() : accelerometerInfo_; } /** - * optional .Sensor_Info accelerometer_info = 12; + * .SensorInfo accelerometer_info = 19; */ - public Sensor_InfoOrBuilder getAccelerometerInfoOrBuilder() { - return getAccelerometerInfo(); + @java.lang.Override + public com.openpositioning.PositionMe.Traj.SensorInfoOrBuilder getAccelerometerInfoOrBuilder() { + return accelerometerInfo_ == null ? com.openpositioning.PositionMe.Traj.SensorInfo.getDefaultInstance() : accelerometerInfo_; } - public static final int GYROSCOPE_INFO_FIELD_NUMBER = 13; - private Sensor_Info gyroscopeInfo_; + public static final int GYROSCOPE_INFO_FIELD_NUMBER = 20; + private com.openpositioning.PositionMe.Traj.SensorInfo gyroscopeInfo_; /** - * optional .Sensor_Info gyroscope_info = 13; + * .SensorInfo gyroscope_info = 20; + * @return Whether the gyroscopeInfo field is set. */ + @java.lang.Override public boolean hasGyroscopeInfo() { - return gyroscopeInfo_ != null; + return ((bitField0_ & 0x00000004) != 0); } /** - * optional .Sensor_Info gyroscope_info = 13; + * .SensorInfo gyroscope_info = 20; + * @return The gyroscopeInfo. */ - public Sensor_Info getGyroscopeInfo() { - return gyroscopeInfo_ == null ? Sensor_Info.getDefaultInstance() : gyroscopeInfo_; + @java.lang.Override + public com.openpositioning.PositionMe.Traj.SensorInfo getGyroscopeInfo() { + return gyroscopeInfo_ == null ? com.openpositioning.PositionMe.Traj.SensorInfo.getDefaultInstance() : gyroscopeInfo_; } /** - * optional .Sensor_Info gyroscope_info = 13; + * .SensorInfo gyroscope_info = 20; */ - public Sensor_InfoOrBuilder getGyroscopeInfoOrBuilder() { - return getGyroscopeInfo(); + @java.lang.Override + public com.openpositioning.PositionMe.Traj.SensorInfoOrBuilder getGyroscopeInfoOrBuilder() { + return gyroscopeInfo_ == null ? com.openpositioning.PositionMe.Traj.SensorInfo.getDefaultInstance() : gyroscopeInfo_; } - public static final int ROTATION_VECTOR_INFO_FIELD_NUMBER = 14; - private Sensor_Info rotationVectorInfo_; + public static final int ROTATION_VECTOR_INFO_FIELD_NUMBER = 21; + private com.openpositioning.PositionMe.Traj.SensorInfo rotationVectorInfo_; /** - * optional .Sensor_Info rotation_vector_info = 14; + * .SensorInfo rotation_vector_info = 21; + * @return Whether the rotationVectorInfo field is set. */ + @java.lang.Override public boolean hasRotationVectorInfo() { - return rotationVectorInfo_ != null; + return ((bitField0_ & 0x00000008) != 0); } /** - * optional .Sensor_Info rotation_vector_info = 14; + * .SensorInfo rotation_vector_info = 21; + * @return The rotationVectorInfo. */ - public Sensor_Info getRotationVectorInfo() { - return rotationVectorInfo_ == null ? Sensor_Info.getDefaultInstance() : rotationVectorInfo_; + @java.lang.Override + public com.openpositioning.PositionMe.Traj.SensorInfo getRotationVectorInfo() { + return rotationVectorInfo_ == null ? com.openpositioning.PositionMe.Traj.SensorInfo.getDefaultInstance() : rotationVectorInfo_; } /** - * optional .Sensor_Info rotation_vector_info = 14; + * .SensorInfo rotation_vector_info = 21; */ - public Sensor_InfoOrBuilder getRotationVectorInfoOrBuilder() { - return getRotationVectorInfo(); + @java.lang.Override + public com.openpositioning.PositionMe.Traj.SensorInfoOrBuilder getRotationVectorInfoOrBuilder() { + return rotationVectorInfo_ == null ? com.openpositioning.PositionMe.Traj.SensorInfo.getDefaultInstance() : rotationVectorInfo_; } - public static final int MAGNETOMETER_INFO_FIELD_NUMBER = 15; - private Sensor_Info magnetometerInfo_; + public static final int MAGNETOMETER_INFO_FIELD_NUMBER = 22; + private com.openpositioning.PositionMe.Traj.SensorInfo magnetometerInfo_; /** - * optional .Sensor_Info magnetometer_info = 15; + * .SensorInfo magnetometer_info = 22; + * @return Whether the magnetometerInfo field is set. */ + @java.lang.Override public boolean hasMagnetometerInfo() { - return magnetometerInfo_ != null; + return ((bitField0_ & 0x00000010) != 0); } /** - * optional .Sensor_Info magnetometer_info = 15; + * .SensorInfo magnetometer_info = 22; + * @return The magnetometerInfo. */ - public Sensor_Info getMagnetometerInfo() { - return magnetometerInfo_ == null ? Sensor_Info.getDefaultInstance() : magnetometerInfo_; + @java.lang.Override + public com.openpositioning.PositionMe.Traj.SensorInfo getMagnetometerInfo() { + return magnetometerInfo_ == null ? com.openpositioning.PositionMe.Traj.SensorInfo.getDefaultInstance() : magnetometerInfo_; } /** - * optional .Sensor_Info magnetometer_info = 15; + * .SensorInfo magnetometer_info = 22; */ - public Sensor_InfoOrBuilder getMagnetometerInfoOrBuilder() { - return getMagnetometerInfo(); + @java.lang.Override + public com.openpositioning.PositionMe.Traj.SensorInfoOrBuilder getMagnetometerInfoOrBuilder() { + return magnetometerInfo_ == null ? com.openpositioning.PositionMe.Traj.SensorInfo.getDefaultInstance() : magnetometerInfo_; } - public static final int BAROMETER_INFO_FIELD_NUMBER = 16; - private Sensor_Info barometerInfo_; + public static final int BAROMETER_INFO_FIELD_NUMBER = 23; + private com.openpositioning.PositionMe.Traj.SensorInfo barometerInfo_; /** - * optional .Sensor_Info barometer_info = 16; + * .SensorInfo barometer_info = 23; + * @return Whether the barometerInfo field is set. */ + @java.lang.Override public boolean hasBarometerInfo() { - return barometerInfo_ != null; + return ((bitField0_ & 0x00000020) != 0); } /** - * optional .Sensor_Info barometer_info = 16; + * .SensorInfo barometer_info = 23; + * @return The barometerInfo. */ - public Sensor_Info getBarometerInfo() { - return barometerInfo_ == null ? Sensor_Info.getDefaultInstance() : barometerInfo_; + @java.lang.Override + public com.openpositioning.PositionMe.Traj.SensorInfo getBarometerInfo() { + return barometerInfo_ == null ? com.openpositioning.PositionMe.Traj.SensorInfo.getDefaultInstance() : barometerInfo_; } /** - * optional .Sensor_Info barometer_info = 16; + * .SensorInfo barometer_info = 23; */ - public Sensor_InfoOrBuilder getBarometerInfoOrBuilder() { - return getBarometerInfo(); + @java.lang.Override + public com.openpositioning.PositionMe.Traj.SensorInfoOrBuilder getBarometerInfoOrBuilder() { + return barometerInfo_ == null ? com.openpositioning.PositionMe.Traj.SensorInfo.getDefaultInstance() : barometerInfo_; } - public static final int LIGHT_SENSOR_INFO_FIELD_NUMBER = 17; - private Sensor_Info lightSensorInfo_; + public static final int LIGHT_SensorInfo_FIELD_NUMBER = 24; + private com.openpositioning.PositionMe.Traj.SensorInfo lightSensorInfo_; /** - * optional .Sensor_Info light_sensor_info = 17; + * .SensorInfo light_SensorInfo = 24; + * @return Whether the lightSensorInfo field is set. */ + @java.lang.Override public boolean hasLightSensorInfo() { - return lightSensorInfo_ != null; + return ((bitField0_ & 0x00000040) != 0); } /** - * optional .Sensor_Info light_sensor_info = 17; + * .SensorInfo light_SensorInfo = 24; + * @return The lightSensorInfo. */ - public Sensor_Info getLightSensorInfo() { - return lightSensorInfo_ == null ? Sensor_Info.getDefaultInstance() : lightSensorInfo_; + @java.lang.Override + public com.openpositioning.PositionMe.Traj.SensorInfo getLightSensorInfo() { + return lightSensorInfo_ == null ? com.openpositioning.PositionMe.Traj.SensorInfo.getDefaultInstance() : lightSensorInfo_; } /** - * optional .Sensor_Info light_sensor_info = 17; + * .SensorInfo light_SensorInfo = 24; */ - public Sensor_InfoOrBuilder getLightSensorInfoOrBuilder() { - return getLightSensorInfo(); + @java.lang.Override + public com.openpositioning.PositionMe.Traj.SensorInfoOrBuilder getLightSensorInfoOrBuilder() { + return lightSensorInfo_ == null ? com.openpositioning.PositionMe.Traj.SensorInfo.getDefaultInstance() : lightSensorInfo_; } - private byte memoizedIsInitialized = -1; - public final boolean isInitialized() { - byte isInitialized = memoizedIsInitialized; + public static final int PROXIMITY_INFO_FIELD_NUMBER = 25; + private com.openpositioning.PositionMe.Traj.SensorInfo proximityInfo_; + /** + * .SensorInfo proximity_info = 25; + * @return Whether the proximityInfo field is set. + */ + @java.lang.Override + public boolean hasProximityInfo() { + return ((bitField0_ & 0x00000080) != 0); + } + /** + * .SensorInfo proximity_info = 25; + * @return The proximityInfo. + */ + @java.lang.Override + public com.openpositioning.PositionMe.Traj.SensorInfo getProximityInfo() { + return proximityInfo_ == null ? com.openpositioning.PositionMe.Traj.SensorInfo.getDefaultInstance() : proximityInfo_; + } + /** + * .SensorInfo proximity_info = 25; + */ + @java.lang.Override + public com.openpositioning.PositionMe.Traj.SensorInfoOrBuilder getProximityInfoOrBuilder() { + return proximityInfo_ == null ? com.openpositioning.PositionMe.Traj.SensorInfo.getDefaultInstance() : proximityInfo_; + } + + public static final int TEST_POINTS_FIELD_NUMBER = 26; + @SuppressWarnings("serial") + private java.util.List testPoints_; + /** + * repeated .GNSSPosition test_points = 26; + */ + @java.lang.Override + public java.util.List getTestPointsList() { + return testPoints_; + } + /** + * repeated .GNSSPosition test_points = 26; + */ + @java.lang.Override + public java.util.List + getTestPointsOrBuilderList() { + return testPoints_; + } + /** + * repeated .GNSSPosition test_points = 26; + */ + @java.lang.Override + public int getTestPointsCount() { + return testPoints_.size(); + } + /** + * repeated .GNSSPosition test_points = 26; + */ + @java.lang.Override + public com.openpositioning.PositionMe.Traj.GNSSPosition getTestPoints(int index) { + return testPoints_.get(index); + } + /** + * repeated .GNSSPosition test_points = 26; + */ + @java.lang.Override + public com.openpositioning.PositionMe.Traj.GNSSPositionOrBuilder getTestPointsOrBuilder( + int index) { + return testPoints_.get(index); + } + + private byte memoizedIsInitialized = -1; + @java.lang.Override + public final boolean isInitialized() { + byte isInitialized = memoizedIsInitialized; if (isInitialized == 1) return true; if (isInitialized == 0) return false; @@ -1089,212 +1512,308 @@ public final boolean isInitialized() { return true; } + @java.lang.Override public void writeTo(com.google.protobuf.CodedOutputStream output) - throws java.io.IOException { - if (!getAndroidVersionBytes().isEmpty()) { - com.google.protobuf.GeneratedMessageV3.writeString(output, 1, androidVersion_); + throws java.io.IOException { + if (!com.google.protobuf.GeneratedMessage.isStringEmpty(androidVersion_)) { + com.google.protobuf.GeneratedMessage.writeString(output, 1, androidVersion_); + } + if (java.lang.Float.floatToRawIntBits(trajectoryVersion_) != 0) { + output.writeFloat(2, trajectoryVersion_); + } + if (!com.google.protobuf.GeneratedMessage.isStringEmpty(trajectoryId_)) { + com.google.protobuf.GeneratedMessage.writeString(output, 3, trajectoryId_); } for (int i = 0; i < imuData_.size(); i++) { - output.writeMessage(2, imuData_.get(i)); + output.writeMessage(4, imuData_.get(i)); } for (int i = 0; i < pdrData_.size(); i++) { - output.writeMessage(3, pdrData_.get(i)); + output.writeMessage(5, pdrData_.get(i)); } - for (int i = 0; i < positionData_.size(); i++) { - output.writeMessage(4, positionData_.get(i)); + for (int i = 0; i < magnetometerData_.size(); i++) { + output.writeMessage(6, magnetometerData_.get(i)); } for (int i = 0; i < pressureData_.size(); i++) { - output.writeMessage(5, pressureData_.get(i)); + output.writeMessage(7, pressureData_.get(i)); } for (int i = 0; i < lightData_.size(); i++) { - output.writeMessage(6, lightData_.get(i)); + output.writeMessage(8, lightData_.get(i)); + } + for (int i = 0; i < proximityData_.size(); i++) { + output.writeMessage(9, proximityData_.get(i)); } for (int i = 0; i < gnssData_.size(); i++) { - output.writeMessage(7, gnssData_.get(i)); + output.writeMessage(10, gnssData_.get(i)); } - for (int i = 0; i < wifiData_.size(); i++) { - output.writeMessage(8, wifiData_.get(i)); + for (int i = 0; i < wifiFingerprints_.size(); i++) { + output.writeMessage(11, wifiFingerprints_.get(i)); } for (int i = 0; i < apsData_.size(); i++) { - output.writeMessage(9, apsData_.get(i)); + output.writeMessage(12, apsData_.get(i)); + } + for (int i = 0; i < wifiRttData_.size(); i++) { + output.writeMessage(13, wifiRttData_.get(i)); + } + for (int i = 0; i < bleFingerprints_.size(); i++) { + output.writeMessage(14, bleFingerprints_.get(i)); + } + for (int i = 0; i < bleData_.size(); i++) { + output.writeMessage(15, bleData_.get(i)); } if (startTimestamp_ != 0L) { - output.writeInt64(10, startTimestamp_); + output.writeInt64(16, startTimestamp_); + } + if (((bitField0_ & 0x00000001) != 0)) { + output.writeMessage(17, getInitialPosition()); } - if (!getDataIdentifierBytes().isEmpty()) { - com.google.protobuf.GeneratedMessageV3.writeString(output, 11, dataIdentifier_); + for (int i = 0; i < correctedPositions_.size(); i++) { + output.writeMessage(18, correctedPositions_.get(i)); } - if (accelerometerInfo_ != null) { - output.writeMessage(12, getAccelerometerInfo()); + if (((bitField0_ & 0x00000002) != 0)) { + output.writeMessage(19, getAccelerometerInfo()); } - if (gyroscopeInfo_ != null) { - output.writeMessage(13, getGyroscopeInfo()); + if (((bitField0_ & 0x00000004) != 0)) { + output.writeMessage(20, getGyroscopeInfo()); } - if (rotationVectorInfo_ != null) { - output.writeMessage(14, getRotationVectorInfo()); + if (((bitField0_ & 0x00000008) != 0)) { + output.writeMessage(21, getRotationVectorInfo()); } - if (magnetometerInfo_ != null) { - output.writeMessage(15, getMagnetometerInfo()); + if (((bitField0_ & 0x00000010) != 0)) { + output.writeMessage(22, getMagnetometerInfo()); } - if (barometerInfo_ != null) { - output.writeMessage(16, getBarometerInfo()); + if (((bitField0_ & 0x00000020) != 0)) { + output.writeMessage(23, getBarometerInfo()); } - if (lightSensorInfo_ != null) { - output.writeMessage(17, getLightSensorInfo()); + if (((bitField0_ & 0x00000040) != 0)) { + output.writeMessage(24, getLightSensorInfo()); } + if (((bitField0_ & 0x00000080) != 0)) { + output.writeMessage(25, getProximityInfo()); + } + for (int i = 0; i < testPoints_.size(); i++) { + output.writeMessage(26, testPoints_.get(i)); + } + getUnknownFields().writeTo(output); } + @java.lang.Override public int getSerializedSize() { int size = memoizedSize; if (size != -1) return size; size = 0; - if (!getAndroidVersionBytes().isEmpty()) { - size += com.google.protobuf.GeneratedMessageV3.computeStringSize(1, androidVersion_); + if (!com.google.protobuf.GeneratedMessage.isStringEmpty(androidVersion_)) { + size += com.google.protobuf.GeneratedMessage.computeStringSize(1, androidVersion_); + } + if (java.lang.Float.floatToRawIntBits(trajectoryVersion_) != 0) { + size += com.google.protobuf.CodedOutputStream + .computeFloatSize(2, trajectoryVersion_); + } + if (!com.google.protobuf.GeneratedMessage.isStringEmpty(trajectoryId_)) { + size += com.google.protobuf.GeneratedMessage.computeStringSize(3, trajectoryId_); } for (int i = 0; i < imuData_.size(); i++) { size += com.google.protobuf.CodedOutputStream - .computeMessageSize(2, imuData_.get(i)); + .computeMessageSize(4, imuData_.get(i)); } for (int i = 0; i < pdrData_.size(); i++) { size += com.google.protobuf.CodedOutputStream - .computeMessageSize(3, pdrData_.get(i)); + .computeMessageSize(5, pdrData_.get(i)); } - for (int i = 0; i < positionData_.size(); i++) { + for (int i = 0; i < magnetometerData_.size(); i++) { size += com.google.protobuf.CodedOutputStream - .computeMessageSize(4, positionData_.get(i)); + .computeMessageSize(6, magnetometerData_.get(i)); } for (int i = 0; i < pressureData_.size(); i++) { size += com.google.protobuf.CodedOutputStream - .computeMessageSize(5, pressureData_.get(i)); + .computeMessageSize(7, pressureData_.get(i)); } for (int i = 0; i < lightData_.size(); i++) { size += com.google.protobuf.CodedOutputStream - .computeMessageSize(6, lightData_.get(i)); + .computeMessageSize(8, lightData_.get(i)); + } + for (int i = 0; i < proximityData_.size(); i++) { + size += com.google.protobuf.CodedOutputStream + .computeMessageSize(9, proximityData_.get(i)); } for (int i = 0; i < gnssData_.size(); i++) { size += com.google.protobuf.CodedOutputStream - .computeMessageSize(7, gnssData_.get(i)); + .computeMessageSize(10, gnssData_.get(i)); } - for (int i = 0; i < wifiData_.size(); i++) { + for (int i = 0; i < wifiFingerprints_.size(); i++) { size += com.google.protobuf.CodedOutputStream - .computeMessageSize(8, wifiData_.get(i)); + .computeMessageSize(11, wifiFingerprints_.get(i)); } for (int i = 0; i < apsData_.size(); i++) { size += com.google.protobuf.CodedOutputStream - .computeMessageSize(9, apsData_.get(i)); + .computeMessageSize(12, apsData_.get(i)); + } + for (int i = 0; i < wifiRttData_.size(); i++) { + size += com.google.protobuf.CodedOutputStream + .computeMessageSize(13, wifiRttData_.get(i)); + } + for (int i = 0; i < bleFingerprints_.size(); i++) { + size += com.google.protobuf.CodedOutputStream + .computeMessageSize(14, bleFingerprints_.get(i)); + } + for (int i = 0; i < bleData_.size(); i++) { + size += com.google.protobuf.CodedOutputStream + .computeMessageSize(15, bleData_.get(i)); } if (startTimestamp_ != 0L) { size += com.google.protobuf.CodedOutputStream - .computeInt64Size(10, startTimestamp_); + .computeInt64Size(16, startTimestamp_); + } + if (((bitField0_ & 0x00000001) != 0)) { + size += com.google.protobuf.CodedOutputStream + .computeMessageSize(17, getInitialPosition()); + } + for (int i = 0; i < correctedPositions_.size(); i++) { + size += com.google.protobuf.CodedOutputStream + .computeMessageSize(18, correctedPositions_.get(i)); + } + if (((bitField0_ & 0x00000002) != 0)) { + size += com.google.protobuf.CodedOutputStream + .computeMessageSize(19, getAccelerometerInfo()); } - if (!getDataIdentifierBytes().isEmpty()) { - size += com.google.protobuf.GeneratedMessageV3.computeStringSize(11, dataIdentifier_); + if (((bitField0_ & 0x00000004) != 0)) { + size += com.google.protobuf.CodedOutputStream + .computeMessageSize(20, getGyroscopeInfo()); } - if (accelerometerInfo_ != null) { + if (((bitField0_ & 0x00000008) != 0)) { size += com.google.protobuf.CodedOutputStream - .computeMessageSize(12, getAccelerometerInfo()); + .computeMessageSize(21, getRotationVectorInfo()); } - if (gyroscopeInfo_ != null) { + if (((bitField0_ & 0x00000010) != 0)) { size += com.google.protobuf.CodedOutputStream - .computeMessageSize(13, getGyroscopeInfo()); + .computeMessageSize(22, getMagnetometerInfo()); } - if (rotationVectorInfo_ != null) { + if (((bitField0_ & 0x00000020) != 0)) { size += com.google.protobuf.CodedOutputStream - .computeMessageSize(14, getRotationVectorInfo()); + .computeMessageSize(23, getBarometerInfo()); } - if (magnetometerInfo_ != null) { + if (((bitField0_ & 0x00000040) != 0)) { size += com.google.protobuf.CodedOutputStream - .computeMessageSize(15, getMagnetometerInfo()); + .computeMessageSize(24, getLightSensorInfo()); } - if (barometerInfo_ != null) { + if (((bitField0_ & 0x00000080) != 0)) { size += com.google.protobuf.CodedOutputStream - .computeMessageSize(16, getBarometerInfo()); + .computeMessageSize(25, getProximityInfo()); } - if (lightSensorInfo_ != null) { + for (int i = 0; i < testPoints_.size(); i++) { size += com.google.protobuf.CodedOutputStream - .computeMessageSize(17, getLightSensorInfo()); + .computeMessageSize(26, testPoints_.get(i)); } + size += getUnknownFields().getSerializedSize(); memoizedSize = size; return size; } - private static final long serialVersionUID = 0L; - @Override - public boolean equals(final Object obj) { + @java.lang.Override + public boolean equals(final java.lang.Object obj) { if (obj == this) { - return true; + return true; } - if (!(obj instanceof Trajectory)) { + if (!(obj instanceof com.openpositioning.PositionMe.Traj.Trajectory)) { return super.equals(obj); } - Trajectory other = (Trajectory) obj; - - boolean result = true; - result = result && getAndroidVersion() - .equals(other.getAndroidVersion()); - result = result && getImuDataList() - .equals(other.getImuDataList()); - result = result && getPdrDataList() - .equals(other.getPdrDataList()); - result = result && getPositionDataList() - .equals(other.getPositionDataList()); - result = result && getPressureDataList() - .equals(other.getPressureDataList()); - result = result && getLightDataList() - .equals(other.getLightDataList()); - result = result && getGnssDataList() - .equals(other.getGnssDataList()); - result = result && getWifiDataList() - .equals(other.getWifiDataList()); - result = result && getApsDataList() - .equals(other.getApsDataList()); - result = result && (getStartTimestamp() - == other.getStartTimestamp()); - result = result && getDataIdentifier() - .equals(other.getDataIdentifier()); - result = result && (hasAccelerometerInfo() == other.hasAccelerometerInfo()); + com.openpositioning.PositionMe.Traj.Trajectory other = (com.openpositioning.PositionMe.Traj.Trajectory) obj; + + if (!getAndroidVersion() + .equals(other.getAndroidVersion())) return false; + if (java.lang.Float.floatToIntBits(getTrajectoryVersion()) + != java.lang.Float.floatToIntBits( + other.getTrajectoryVersion())) return false; + if (!getTrajectoryId() + .equals(other.getTrajectoryId())) return false; + if (!getImuDataList() + .equals(other.getImuDataList())) return false; + if (!getPdrDataList() + .equals(other.getPdrDataList())) return false; + if (!getMagnetometerDataList() + .equals(other.getMagnetometerDataList())) return false; + if (!getPressureDataList() + .equals(other.getPressureDataList())) return false; + if (!getLightDataList() + .equals(other.getLightDataList())) return false; + if (!getProximityDataList() + .equals(other.getProximityDataList())) return false; + if (!getGnssDataList() + .equals(other.getGnssDataList())) return false; + if (!getWifiFingerprintsList() + .equals(other.getWifiFingerprintsList())) return false; + if (!getApsDataList() + .equals(other.getApsDataList())) return false; + if (!getWifiRttDataList() + .equals(other.getWifiRttDataList())) return false; + if (!getBleFingerprintsList() + .equals(other.getBleFingerprintsList())) return false; + if (!getBleDataList() + .equals(other.getBleDataList())) return false; + if (getStartTimestamp() + != other.getStartTimestamp()) return false; + if (hasInitialPosition() != other.hasInitialPosition()) return false; + if (hasInitialPosition()) { + if (!getInitialPosition() + .equals(other.getInitialPosition())) return false; + } + if (!getCorrectedPositionsList() + .equals(other.getCorrectedPositionsList())) return false; + if (hasAccelerometerInfo() != other.hasAccelerometerInfo()) return false; if (hasAccelerometerInfo()) { - result = result && getAccelerometerInfo() - .equals(other.getAccelerometerInfo()); + if (!getAccelerometerInfo() + .equals(other.getAccelerometerInfo())) return false; } - result = result && (hasGyroscopeInfo() == other.hasGyroscopeInfo()); + if (hasGyroscopeInfo() != other.hasGyroscopeInfo()) return false; if (hasGyroscopeInfo()) { - result = result && getGyroscopeInfo() - .equals(other.getGyroscopeInfo()); + if (!getGyroscopeInfo() + .equals(other.getGyroscopeInfo())) return false; } - result = result && (hasRotationVectorInfo() == other.hasRotationVectorInfo()); + if (hasRotationVectorInfo() != other.hasRotationVectorInfo()) return false; if (hasRotationVectorInfo()) { - result = result && getRotationVectorInfo() - .equals(other.getRotationVectorInfo()); + if (!getRotationVectorInfo() + .equals(other.getRotationVectorInfo())) return false; } - result = result && (hasMagnetometerInfo() == other.hasMagnetometerInfo()); + if (hasMagnetometerInfo() != other.hasMagnetometerInfo()) return false; if (hasMagnetometerInfo()) { - result = result && getMagnetometerInfo() - .equals(other.getMagnetometerInfo()); + if (!getMagnetometerInfo() + .equals(other.getMagnetometerInfo())) return false; } - result = result && (hasBarometerInfo() == other.hasBarometerInfo()); + if (hasBarometerInfo() != other.hasBarometerInfo()) return false; if (hasBarometerInfo()) { - result = result && getBarometerInfo() - .equals(other.getBarometerInfo()); + if (!getBarometerInfo() + .equals(other.getBarometerInfo())) return false; } - result = result && (hasLightSensorInfo() == other.hasLightSensorInfo()); + if (hasLightSensorInfo() != other.hasLightSensorInfo()) return false; if (hasLightSensorInfo()) { - result = result && getLightSensorInfo() - .equals(other.getLightSensorInfo()); + if (!getLightSensorInfo() + .equals(other.getLightSensorInfo())) return false; } - return result; + if (hasProximityInfo() != other.hasProximityInfo()) return false; + if (hasProximityInfo()) { + if (!getProximityInfo() + .equals(other.getProximityInfo())) return false; + } + if (!getTestPointsList() + .equals(other.getTestPointsList())) return false; + if (!getUnknownFields().equals(other.getUnknownFields())) return false; + return true; } - @Override + @java.lang.Override public int hashCode() { if (memoizedHashCode != 0) { return memoizedHashCode; } int hash = 41; - hash = (19 * hash) + getDescriptorForType().hashCode(); + hash = (19 * hash) + getDescriptor().hashCode(); hash = (37 * hash) + ANDROID_VERSION_FIELD_NUMBER; hash = (53 * hash) + getAndroidVersion().hashCode(); + hash = (37 * hash) + TRAJECTORY_VERSION_FIELD_NUMBER; + hash = (53 * hash) + java.lang.Float.floatToIntBits( + getTrajectoryVersion()); + hash = (37 * hash) + TRAJECTORY_ID_FIELD_NUMBER; + hash = (53 * hash) + getTrajectoryId().hashCode(); if (getImuDataCount() > 0) { hash = (37 * hash) + IMU_DATA_FIELD_NUMBER; hash = (53 * hash) + getImuDataList().hashCode(); @@ -1303,9 +1822,9 @@ public int hashCode() { hash = (37 * hash) + PDR_DATA_FIELD_NUMBER; hash = (53 * hash) + getPdrDataList().hashCode(); } - if (getPositionDataCount() > 0) { - hash = (37 * hash) + POSITION_DATA_FIELD_NUMBER; - hash = (53 * hash) + getPositionDataList().hashCode(); + if (getMagnetometerDataCount() > 0) { + hash = (37 * hash) + MAGNETOMETER_DATA_FIELD_NUMBER; + hash = (53 * hash) + getMagnetometerDataList().hashCode(); } if (getPressureDataCount() > 0) { hash = (37 * hash) + PRESSURE_DATA_FIELD_NUMBER; @@ -1315,23 +1834,45 @@ public int hashCode() { hash = (37 * hash) + LIGHT_DATA_FIELD_NUMBER; hash = (53 * hash) + getLightDataList().hashCode(); } + if (getProximityDataCount() > 0) { + hash = (37 * hash) + PROXIMITY_DATA_FIELD_NUMBER; + hash = (53 * hash) + getProximityDataList().hashCode(); + } if (getGnssDataCount() > 0) { hash = (37 * hash) + GNSS_DATA_FIELD_NUMBER; hash = (53 * hash) + getGnssDataList().hashCode(); } - if (getWifiDataCount() > 0) { - hash = (37 * hash) + WIFI_DATA_FIELD_NUMBER; - hash = (53 * hash) + getWifiDataList().hashCode(); + if (getWifiFingerprintsCount() > 0) { + hash = (37 * hash) + WIFI_FINGERPRINTS_FIELD_NUMBER; + hash = (53 * hash) + getWifiFingerprintsList().hashCode(); } if (getApsDataCount() > 0) { hash = (37 * hash) + APS_DATA_FIELD_NUMBER; hash = (53 * hash) + getApsDataList().hashCode(); } + if (getWifiRttDataCount() > 0) { + hash = (37 * hash) + WIFI_RTT_DATA_FIELD_NUMBER; + hash = (53 * hash) + getWifiRttDataList().hashCode(); + } + if (getBleFingerprintsCount() > 0) { + hash = (37 * hash) + BLE_FINGERPRINTS_FIELD_NUMBER; + hash = (53 * hash) + getBleFingerprintsList().hashCode(); + } + if (getBleDataCount() > 0) { + hash = (37 * hash) + BLE_DATA_FIELD_NUMBER; + hash = (53 * hash) + getBleDataList().hashCode(); + } hash = (37 * hash) + START_TIMESTAMP_FIELD_NUMBER; hash = (53 * hash) + com.google.protobuf.Internal.hashLong( - getStartTimestamp()); - hash = (37 * hash) + DATA_IDENTIFIER_FIELD_NUMBER; - hash = (53 * hash) + getDataIdentifier().hashCode(); + getStartTimestamp()); + if (hasInitialPosition()) { + hash = (37 * hash) + INITIAL_POSITION_FIELD_NUMBER; + hash = (53 * hash) + getInitialPosition().hashCode(); + } + if (getCorrectedPositionsCount() > 0) { + hash = (37 * hash) + CORRECTED_POSITIONS_FIELD_NUMBER; + hash = (53 * hash) + getCorrectedPositionsList().hashCode(); + } if (hasAccelerometerInfo()) { hash = (37 * hash) + ACCELEROMETER_INFO_FIELD_NUMBER; hash = (53 * hash) + getAccelerometerInfo().hashCode(); @@ -1353,88 +1894,111 @@ public int hashCode() { hash = (53 * hash) + getBarometerInfo().hashCode(); } if (hasLightSensorInfo()) { - hash = (37 * hash) + LIGHT_SENSOR_INFO_FIELD_NUMBER; + hash = (37 * hash) + LIGHT_SensorInfo_FIELD_NUMBER; hash = (53 * hash) + getLightSensorInfo().hashCode(); } - hash = (29 * hash) + unknownFields.hashCode(); + if (hasProximityInfo()) { + hash = (37 * hash) + PROXIMITY_INFO_FIELD_NUMBER; + hash = (53 * hash) + getProximityInfo().hashCode(); + } + if (getTestPointsCount() > 0) { + hash = (37 * hash) + TEST_POINTS_FIELD_NUMBER; + hash = (53 * hash) + getTestPointsList().hashCode(); + } + hash = (29 * hash) + getUnknownFields().hashCode(); memoizedHashCode = hash; return hash; } - public static Trajectory parseFrom( - com.google.protobuf.ByteString data) - throws com.google.protobuf.InvalidProtocolBufferException { + public static com.openpositioning.PositionMe.Traj.Trajectory parseFrom( + java.nio.ByteBuffer data) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + public static com.openpositioning.PositionMe.Traj.Trajectory parseFrom( + java.nio.ByteBuffer data, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data, extensionRegistry); + } + public static com.openpositioning.PositionMe.Traj.Trajectory parseFrom( + com.google.protobuf.ByteString data) + throws com.google.protobuf.InvalidProtocolBufferException { return PARSER.parseFrom(data); } - public static Trajectory parseFrom( - com.google.protobuf.ByteString data, - com.google.protobuf.ExtensionRegistryLite extensionRegistry) - throws com.google.protobuf.InvalidProtocolBufferException { + public static com.openpositioning.PositionMe.Traj.Trajectory parseFrom( + com.google.protobuf.ByteString data, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { return PARSER.parseFrom(data, extensionRegistry); } - public static Trajectory parseFrom(byte[] data) - throws com.google.protobuf.InvalidProtocolBufferException { + public static com.openpositioning.PositionMe.Traj.Trajectory parseFrom(byte[] data) + throws com.google.protobuf.InvalidProtocolBufferException { return PARSER.parseFrom(data); } - public static Trajectory parseFrom( - byte[] data, - com.google.protobuf.ExtensionRegistryLite extensionRegistry) - throws com.google.protobuf.InvalidProtocolBufferException { + public static com.openpositioning.PositionMe.Traj.Trajectory parseFrom( + byte[] data, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { return PARSER.parseFrom(data, extensionRegistry); } - public static Trajectory parseFrom(java.io.InputStream input) - throws java.io.IOException { - return com.google.protobuf.GeneratedMessageV3 - .parseWithIOException(PARSER, input); - } - public static Trajectory parseFrom( - java.io.InputStream input, - com.google.protobuf.ExtensionRegistryLite extensionRegistry) - throws java.io.IOException { - return com.google.protobuf.GeneratedMessageV3 - .parseWithIOException(PARSER, input, extensionRegistry); - } - public static Trajectory parseDelimitedFrom(java.io.InputStream input) - throws java.io.IOException { - return com.google.protobuf.GeneratedMessageV3 - .parseDelimitedWithIOException(PARSER, input); - } - public static Trajectory parseDelimitedFrom( - java.io.InputStream input, - com.google.protobuf.ExtensionRegistryLite extensionRegistry) - throws java.io.IOException { - return com.google.protobuf.GeneratedMessageV3 - .parseDelimitedWithIOException(PARSER, input, extensionRegistry); - } - public static Trajectory parseFrom( - com.google.protobuf.CodedInputStream input) - throws java.io.IOException { - return com.google.protobuf.GeneratedMessageV3 - .parseWithIOException(PARSER, input); - } - public static Trajectory parseFrom( - com.google.protobuf.CodedInputStream input, - com.google.protobuf.ExtensionRegistryLite extensionRegistry) - throws java.io.IOException { - return com.google.protobuf.GeneratedMessageV3 - .parseWithIOException(PARSER, input, extensionRegistry); + public static com.openpositioning.PositionMe.Traj.Trajectory parseFrom(java.io.InputStream input) + throws java.io.IOException { + return com.google.protobuf.GeneratedMessage + .parseWithIOException(PARSER, input); + } + public static com.openpositioning.PositionMe.Traj.Trajectory parseFrom( + java.io.InputStream input, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws java.io.IOException { + return com.google.protobuf.GeneratedMessage + .parseWithIOException(PARSER, input, extensionRegistry); + } + + public static com.openpositioning.PositionMe.Traj.Trajectory parseDelimitedFrom(java.io.InputStream input) + throws java.io.IOException { + return com.google.protobuf.GeneratedMessage + .parseDelimitedWithIOException(PARSER, input); + } + + public static com.openpositioning.PositionMe.Traj.Trajectory parseDelimitedFrom( + java.io.InputStream input, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws java.io.IOException { + return com.google.protobuf.GeneratedMessage + .parseDelimitedWithIOException(PARSER, input, extensionRegistry); + } + public static com.openpositioning.PositionMe.Traj.Trajectory parseFrom( + com.google.protobuf.CodedInputStream input) + throws java.io.IOException { + return com.google.protobuf.GeneratedMessage + .parseWithIOException(PARSER, input); + } + public static com.openpositioning.PositionMe.Traj.Trajectory parseFrom( + com.google.protobuf.CodedInputStream input, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws java.io.IOException { + return com.google.protobuf.GeneratedMessage + .parseWithIOException(PARSER, input, extensionRegistry); } + @java.lang.Override public Builder newBuilderForType() { return newBuilder(); } public static Builder newBuilder() { return DEFAULT_INSTANCE.toBuilder(); } - public static Builder newBuilder(Trajectory prototype) { + public static Builder newBuilder(com.openpositioning.PositionMe.Traj.Trajectory prototype) { return DEFAULT_INSTANCE.toBuilder().mergeFrom(prototype); } + @java.lang.Override public Builder toBuilder() { return this == DEFAULT_INSTANCE - ? new Builder() : new Builder().mergeFrom(this); + ? new Builder() : new Builder().mergeFrom(this); } - @Override + @java.lang.Override protected Builder newBuilderForType( - com.google.protobuf.GeneratedMessageV3.BuilderParent parent) { + com.google.protobuf.GeneratedMessage.BuilderParent parent) { Builder builder = new Builder(parent); return builder; } @@ -1442,316 +2006,462 @@ protected Builder newBuilderForType( * Protobuf type {@code Trajectory} */ public static final class Builder extends - com.google.protobuf.GeneratedMessageV3.Builder implements - // @@protoc_insertion_point(builder_implements:Trajectory) - TrajectoryOrBuilder { + com.google.protobuf.GeneratedMessage.Builder implements + // @@protoc_insertion_point(builder_implements:Trajectory) + com.openpositioning.PositionMe.Traj.TrajectoryOrBuilder { public static final com.google.protobuf.Descriptors.Descriptor - getDescriptor() { - return Traj.internal_static_Trajectory_descriptor; + getDescriptor() { + return com.openpositioning.PositionMe.Traj.internal_static_Trajectory_descriptor; } - protected com.google.protobuf.GeneratedMessageV3.FieldAccessorTable - internalGetFieldAccessorTable() { - return Traj.internal_static_Trajectory_fieldAccessorTable - .ensureFieldAccessorsInitialized( - Trajectory.class, Builder.class); + @java.lang.Override + protected com.google.protobuf.GeneratedMessage.FieldAccessorTable + internalGetFieldAccessorTable() { + return com.openpositioning.PositionMe.Traj.internal_static_Trajectory_fieldAccessorTable + .ensureFieldAccessorsInitialized( + com.openpositioning.PositionMe.Traj.Trajectory.class, com.openpositioning.PositionMe.Traj.Trajectory.Builder.class); } - // Construct using Traj.Trajectory.newBuilder() + // Construct using com.openpositioning.PositionMe.Traj.Trajectory.newBuilder() private Builder() { maybeForceBuilderInitialization(); } private Builder( - com.google.protobuf.GeneratedMessageV3.BuilderParent parent) { + com.google.protobuf.GeneratedMessage.BuilderParent parent) { super(parent); maybeForceBuilderInitialization(); } private void maybeForceBuilderInitialization() { - if (com.google.protobuf.GeneratedMessageV3 + if (com.google.protobuf.GeneratedMessage .alwaysUseFieldBuilders) { getImuDataFieldBuilder(); getPdrDataFieldBuilder(); - getPositionDataFieldBuilder(); + getMagnetometerDataFieldBuilder(); getPressureDataFieldBuilder(); getLightDataFieldBuilder(); + getProximityDataFieldBuilder(); getGnssDataFieldBuilder(); - getWifiDataFieldBuilder(); + getWifiFingerprintsFieldBuilder(); getApsDataFieldBuilder(); - } - } + getWifiRttDataFieldBuilder(); + getBleFingerprintsFieldBuilder(); + getBleDataFieldBuilder(); + getInitialPositionFieldBuilder(); + getCorrectedPositionsFieldBuilder(); + getAccelerometerInfoFieldBuilder(); + getGyroscopeInfoFieldBuilder(); + getRotationVectorInfoFieldBuilder(); + getMagnetometerInfoFieldBuilder(); + getBarometerInfoFieldBuilder(); + getLightSensorInfoFieldBuilder(); + getProximityInfoFieldBuilder(); + getTestPointsFieldBuilder(); + } + } + @java.lang.Override public Builder clear() { super.clear(); + bitField0_ = 0; androidVersion_ = ""; - + trajectoryVersion_ = 0F; + trajectoryId_ = ""; if (imuDataBuilder_ == null) { imuData_ = java.util.Collections.emptyList(); - bitField0_ = (bitField0_ & ~0x00000002); } else { + imuData_ = null; imuDataBuilder_.clear(); } + bitField0_ = (bitField0_ & ~0x00000008); if (pdrDataBuilder_ == null) { pdrData_ = java.util.Collections.emptyList(); - bitField0_ = (bitField0_ & ~0x00000004); } else { + pdrData_ = null; pdrDataBuilder_.clear(); } - if (positionDataBuilder_ == null) { - positionData_ = java.util.Collections.emptyList(); - bitField0_ = (bitField0_ & ~0x00000008); + bitField0_ = (bitField0_ & ~0x00000010); + if (magnetometerDataBuilder_ == null) { + magnetometerData_ = java.util.Collections.emptyList(); } else { - positionDataBuilder_.clear(); + magnetometerData_ = null; + magnetometerDataBuilder_.clear(); } + bitField0_ = (bitField0_ & ~0x00000020); if (pressureDataBuilder_ == null) { pressureData_ = java.util.Collections.emptyList(); - bitField0_ = (bitField0_ & ~0x00000010); } else { + pressureData_ = null; pressureDataBuilder_.clear(); } + bitField0_ = (bitField0_ & ~0x00000040); if (lightDataBuilder_ == null) { lightData_ = java.util.Collections.emptyList(); - bitField0_ = (bitField0_ & ~0x00000020); } else { + lightData_ = null; lightDataBuilder_.clear(); } + bitField0_ = (bitField0_ & ~0x00000080); + if (proximityDataBuilder_ == null) { + proximityData_ = java.util.Collections.emptyList(); + } else { + proximityData_ = null; + proximityDataBuilder_.clear(); + } + bitField0_ = (bitField0_ & ~0x00000100); if (gnssDataBuilder_ == null) { gnssData_ = java.util.Collections.emptyList(); - bitField0_ = (bitField0_ & ~0x00000040); } else { + gnssData_ = null; gnssDataBuilder_.clear(); } - if (wifiDataBuilder_ == null) { - wifiData_ = java.util.Collections.emptyList(); - bitField0_ = (bitField0_ & ~0x00000080); + bitField0_ = (bitField0_ & ~0x00000200); + if (wifiFingerprintsBuilder_ == null) { + wifiFingerprints_ = java.util.Collections.emptyList(); } else { - wifiDataBuilder_.clear(); + wifiFingerprints_ = null; + wifiFingerprintsBuilder_.clear(); } + bitField0_ = (bitField0_ & ~0x00000400); if (apsDataBuilder_ == null) { apsData_ = java.util.Collections.emptyList(); - bitField0_ = (bitField0_ & ~0x00000100); } else { + apsData_ = null; apsDataBuilder_.clear(); } + bitField0_ = (bitField0_ & ~0x00000800); + if (wifiRttDataBuilder_ == null) { + wifiRttData_ = java.util.Collections.emptyList(); + } else { + wifiRttData_ = null; + wifiRttDataBuilder_.clear(); + } + bitField0_ = (bitField0_ & ~0x00001000); + if (bleFingerprintsBuilder_ == null) { + bleFingerprints_ = java.util.Collections.emptyList(); + } else { + bleFingerprints_ = null; + bleFingerprintsBuilder_.clear(); + } + bitField0_ = (bitField0_ & ~0x00002000); + if (bleDataBuilder_ == null) { + bleData_ = java.util.Collections.emptyList(); + } else { + bleData_ = null; + bleDataBuilder_.clear(); + } + bitField0_ = (bitField0_ & ~0x00004000); startTimestamp_ = 0L; - - dataIdentifier_ = ""; - - if (accelerometerInfoBuilder_ == null) { - accelerometerInfo_ = null; + initialPosition_ = null; + if (initialPositionBuilder_ != null) { + initialPositionBuilder_.dispose(); + initialPositionBuilder_ = null; + } + if (correctedPositionsBuilder_ == null) { + correctedPositions_ = java.util.Collections.emptyList(); } else { - accelerometerInfo_ = null; + correctedPositions_ = null; + correctedPositionsBuilder_.clear(); + } + bitField0_ = (bitField0_ & ~0x00020000); + accelerometerInfo_ = null; + if (accelerometerInfoBuilder_ != null) { + accelerometerInfoBuilder_.dispose(); accelerometerInfoBuilder_ = null; } - if (gyroscopeInfoBuilder_ == null) { - gyroscopeInfo_ = null; - } else { - gyroscopeInfo_ = null; + gyroscopeInfo_ = null; + if (gyroscopeInfoBuilder_ != null) { + gyroscopeInfoBuilder_.dispose(); gyroscopeInfoBuilder_ = null; } - if (rotationVectorInfoBuilder_ == null) { - rotationVectorInfo_ = null; - } else { - rotationVectorInfo_ = null; + rotationVectorInfo_ = null; + if (rotationVectorInfoBuilder_ != null) { + rotationVectorInfoBuilder_.dispose(); rotationVectorInfoBuilder_ = null; } - if (magnetometerInfoBuilder_ == null) { - magnetometerInfo_ = null; - } else { - magnetometerInfo_ = null; + magnetometerInfo_ = null; + if (magnetometerInfoBuilder_ != null) { + magnetometerInfoBuilder_.dispose(); magnetometerInfoBuilder_ = null; } - if (barometerInfoBuilder_ == null) { - barometerInfo_ = null; - } else { - barometerInfo_ = null; + barometerInfo_ = null; + if (barometerInfoBuilder_ != null) { + barometerInfoBuilder_.dispose(); barometerInfoBuilder_ = null; } - if (lightSensorInfoBuilder_ == null) { - lightSensorInfo_ = null; - } else { - lightSensorInfo_ = null; + lightSensorInfo_ = null; + if (lightSensorInfoBuilder_ != null) { + lightSensorInfoBuilder_.dispose(); lightSensorInfoBuilder_ = null; } + proximityInfo_ = null; + if (proximityInfoBuilder_ != null) { + proximityInfoBuilder_.dispose(); + proximityInfoBuilder_ = null; + } + if (testPointsBuilder_ == null) { + testPoints_ = java.util.Collections.emptyList(); + } else { + testPoints_ = null; + testPointsBuilder_.clear(); + } + bitField0_ = (bitField0_ & ~0x02000000); return this; } + @java.lang.Override public com.google.protobuf.Descriptors.Descriptor - getDescriptorForType() { - return Traj.internal_static_Trajectory_descriptor; + getDescriptorForType() { + return com.openpositioning.PositionMe.Traj.internal_static_Trajectory_descriptor; } - public Trajectory getDefaultInstanceForType() { - return Trajectory.getDefaultInstance(); + @java.lang.Override + public com.openpositioning.PositionMe.Traj.Trajectory getDefaultInstanceForType() { + return com.openpositioning.PositionMe.Traj.Trajectory.getDefaultInstance(); } - public Trajectory build() { - Trajectory result = buildPartial(); + @java.lang.Override + public com.openpositioning.PositionMe.Traj.Trajectory build() { + com.openpositioning.PositionMe.Traj.Trajectory result = buildPartial(); if (!result.isInitialized()) { throw newUninitializedMessageException(result); } return result; } - public Trajectory buildPartial() { - Trajectory result = new Trajectory(this); - int from_bitField0_ = bitField0_; - int to_bitField0_ = 0; - result.androidVersion_ = androidVersion_; + @java.lang.Override + public com.openpositioning.PositionMe.Traj.Trajectory buildPartial() { + com.openpositioning.PositionMe.Traj.Trajectory result = new com.openpositioning.PositionMe.Traj.Trajectory(this); + buildPartialRepeatedFields(result); + if (bitField0_ != 0) { buildPartial0(result); } + onBuilt(); + return result; + } + + private void buildPartialRepeatedFields(com.openpositioning.PositionMe.Traj.Trajectory result) { if (imuDataBuilder_ == null) { - if (((bitField0_ & 0x00000002) == 0x00000002)) { + if (((bitField0_ & 0x00000008) != 0)) { imuData_ = java.util.Collections.unmodifiableList(imuData_); - bitField0_ = (bitField0_ & ~0x00000002); + bitField0_ = (bitField0_ & ~0x00000008); } result.imuData_ = imuData_; } else { result.imuData_ = imuDataBuilder_.build(); } if (pdrDataBuilder_ == null) { - if (((bitField0_ & 0x00000004) == 0x00000004)) { + if (((bitField0_ & 0x00000010) != 0)) { pdrData_ = java.util.Collections.unmodifiableList(pdrData_); - bitField0_ = (bitField0_ & ~0x00000004); + bitField0_ = (bitField0_ & ~0x00000010); } result.pdrData_ = pdrData_; } else { result.pdrData_ = pdrDataBuilder_.build(); } - if (positionDataBuilder_ == null) { - if (((bitField0_ & 0x00000008) == 0x00000008)) { - positionData_ = java.util.Collections.unmodifiableList(positionData_); - bitField0_ = (bitField0_ & ~0x00000008); + if (magnetometerDataBuilder_ == null) { + if (((bitField0_ & 0x00000020) != 0)) { + magnetometerData_ = java.util.Collections.unmodifiableList(magnetometerData_); + bitField0_ = (bitField0_ & ~0x00000020); } - result.positionData_ = positionData_; + result.magnetometerData_ = magnetometerData_; } else { - result.positionData_ = positionDataBuilder_.build(); + result.magnetometerData_ = magnetometerDataBuilder_.build(); } if (pressureDataBuilder_ == null) { - if (((bitField0_ & 0x00000010) == 0x00000010)) { + if (((bitField0_ & 0x00000040) != 0)) { pressureData_ = java.util.Collections.unmodifiableList(pressureData_); - bitField0_ = (bitField0_ & ~0x00000010); + bitField0_ = (bitField0_ & ~0x00000040); } result.pressureData_ = pressureData_; } else { result.pressureData_ = pressureDataBuilder_.build(); } if (lightDataBuilder_ == null) { - if (((bitField0_ & 0x00000020) == 0x00000020)) { + if (((bitField0_ & 0x00000080) != 0)) { lightData_ = java.util.Collections.unmodifiableList(lightData_); - bitField0_ = (bitField0_ & ~0x00000020); + bitField0_ = (bitField0_ & ~0x00000080); } result.lightData_ = lightData_; } else { result.lightData_ = lightDataBuilder_.build(); } + if (proximityDataBuilder_ == null) { + if (((bitField0_ & 0x00000100) != 0)) { + proximityData_ = java.util.Collections.unmodifiableList(proximityData_); + bitField0_ = (bitField0_ & ~0x00000100); + } + result.proximityData_ = proximityData_; + } else { + result.proximityData_ = proximityDataBuilder_.build(); + } if (gnssDataBuilder_ == null) { - if (((bitField0_ & 0x00000040) == 0x00000040)) { + if (((bitField0_ & 0x00000200) != 0)) { gnssData_ = java.util.Collections.unmodifiableList(gnssData_); - bitField0_ = (bitField0_ & ~0x00000040); + bitField0_ = (bitField0_ & ~0x00000200); } result.gnssData_ = gnssData_; } else { result.gnssData_ = gnssDataBuilder_.build(); } - if (wifiDataBuilder_ == null) { - if (((bitField0_ & 0x00000080) == 0x00000080)) { - wifiData_ = java.util.Collections.unmodifiableList(wifiData_); - bitField0_ = (bitField0_ & ~0x00000080); + if (wifiFingerprintsBuilder_ == null) { + if (((bitField0_ & 0x00000400) != 0)) { + wifiFingerprints_ = java.util.Collections.unmodifiableList(wifiFingerprints_); + bitField0_ = (bitField0_ & ~0x00000400); } - result.wifiData_ = wifiData_; + result.wifiFingerprints_ = wifiFingerprints_; } else { - result.wifiData_ = wifiDataBuilder_.build(); + result.wifiFingerprints_ = wifiFingerprintsBuilder_.build(); } if (apsDataBuilder_ == null) { - if (((bitField0_ & 0x00000100) == 0x00000100)) { + if (((bitField0_ & 0x00000800) != 0)) { apsData_ = java.util.Collections.unmodifiableList(apsData_); - bitField0_ = (bitField0_ & ~0x00000100); + bitField0_ = (bitField0_ & ~0x00000800); } result.apsData_ = apsData_; } else { result.apsData_ = apsDataBuilder_.build(); } - result.startTimestamp_ = startTimestamp_; - result.dataIdentifier_ = dataIdentifier_; - if (accelerometerInfoBuilder_ == null) { - result.accelerometerInfo_ = accelerometerInfo_; - } else { - result.accelerometerInfo_ = accelerometerInfoBuilder_.build(); - } - if (gyroscopeInfoBuilder_ == null) { - result.gyroscopeInfo_ = gyroscopeInfo_; + if (wifiRttDataBuilder_ == null) { + if (((bitField0_ & 0x00001000) != 0)) { + wifiRttData_ = java.util.Collections.unmodifiableList(wifiRttData_); + bitField0_ = (bitField0_ & ~0x00001000); + } + result.wifiRttData_ = wifiRttData_; } else { - result.gyroscopeInfo_ = gyroscopeInfoBuilder_.build(); + result.wifiRttData_ = wifiRttDataBuilder_.build(); } - if (rotationVectorInfoBuilder_ == null) { - result.rotationVectorInfo_ = rotationVectorInfo_; + if (bleFingerprintsBuilder_ == null) { + if (((bitField0_ & 0x00002000) != 0)) { + bleFingerprints_ = java.util.Collections.unmodifiableList(bleFingerprints_); + bitField0_ = (bitField0_ & ~0x00002000); + } + result.bleFingerprints_ = bleFingerprints_; } else { - result.rotationVectorInfo_ = rotationVectorInfoBuilder_.build(); + result.bleFingerprints_ = bleFingerprintsBuilder_.build(); } - if (magnetometerInfoBuilder_ == null) { - result.magnetometerInfo_ = magnetometerInfo_; + if (bleDataBuilder_ == null) { + if (((bitField0_ & 0x00004000) != 0)) { + bleData_ = java.util.Collections.unmodifiableList(bleData_); + bitField0_ = (bitField0_ & ~0x00004000); + } + result.bleData_ = bleData_; } else { - result.magnetometerInfo_ = magnetometerInfoBuilder_.build(); + result.bleData_ = bleDataBuilder_.build(); } - if (barometerInfoBuilder_ == null) { - result.barometerInfo_ = barometerInfo_; + if (correctedPositionsBuilder_ == null) { + if (((bitField0_ & 0x00020000) != 0)) { + correctedPositions_ = java.util.Collections.unmodifiableList(correctedPositions_); + bitField0_ = (bitField0_ & ~0x00020000); + } + result.correctedPositions_ = correctedPositions_; } else { - result.barometerInfo_ = barometerInfoBuilder_.build(); + result.correctedPositions_ = correctedPositionsBuilder_.build(); } - if (lightSensorInfoBuilder_ == null) { - result.lightSensorInfo_ = lightSensorInfo_; + if (testPointsBuilder_ == null) { + if (((bitField0_ & 0x02000000) != 0)) { + testPoints_ = java.util.Collections.unmodifiableList(testPoints_); + bitField0_ = (bitField0_ & ~0x02000000); + } + result.testPoints_ = testPoints_; } else { - result.lightSensorInfo_ = lightSensorInfoBuilder_.build(); + result.testPoints_ = testPointsBuilder_.build(); } - result.bitField0_ = to_bitField0_; - onBuilt(); - return result; } - public Builder clone() { - return (Builder) super.clone(); - } - public Builder setField( - com.google.protobuf.Descriptors.FieldDescriptor field, - Object value) { - return (Builder) super.setField(field, value); - } - public Builder clearField( - com.google.protobuf.Descriptors.FieldDescriptor field) { - return (Builder) super.clearField(field); - } - public Builder clearOneof( - com.google.protobuf.Descriptors.OneofDescriptor oneof) { - return (Builder) super.clearOneof(oneof); - } - public Builder setRepeatedField( - com.google.protobuf.Descriptors.FieldDescriptor field, - int index, Object value) { - return (Builder) super.setRepeatedField(field, index, value); - } - public Builder addRepeatedField( - com.google.protobuf.Descriptors.FieldDescriptor field, - Object value) { - return (Builder) super.addRepeatedField(field, value); - } + private void buildPartial0(com.openpositioning.PositionMe.Traj.Trajectory result) { + int from_bitField0_ = bitField0_; + if (((from_bitField0_ & 0x00000001) != 0)) { + result.androidVersion_ = androidVersion_; + } + if (((from_bitField0_ & 0x00000002) != 0)) { + result.trajectoryVersion_ = trajectoryVersion_; + } + if (((from_bitField0_ & 0x00000004) != 0)) { + result.trajectoryId_ = trajectoryId_; + } + if (((from_bitField0_ & 0x00008000) != 0)) { + result.startTimestamp_ = startTimestamp_; + } + int to_bitField0_ = 0; + if (((from_bitField0_ & 0x00010000) != 0)) { + result.initialPosition_ = initialPositionBuilder_ == null + ? initialPosition_ + : initialPositionBuilder_.build(); + to_bitField0_ |= 0x00000001; + } + if (((from_bitField0_ & 0x00040000) != 0)) { + result.accelerometerInfo_ = accelerometerInfoBuilder_ == null + ? accelerometerInfo_ + : accelerometerInfoBuilder_.build(); + to_bitField0_ |= 0x00000002; + } + if (((from_bitField0_ & 0x00080000) != 0)) { + result.gyroscopeInfo_ = gyroscopeInfoBuilder_ == null + ? gyroscopeInfo_ + : gyroscopeInfoBuilder_.build(); + to_bitField0_ |= 0x00000004; + } + if (((from_bitField0_ & 0x00100000) != 0)) { + result.rotationVectorInfo_ = rotationVectorInfoBuilder_ == null + ? rotationVectorInfo_ + : rotationVectorInfoBuilder_.build(); + to_bitField0_ |= 0x00000008; + } + if (((from_bitField0_ & 0x00200000) != 0)) { + result.magnetometerInfo_ = magnetometerInfoBuilder_ == null + ? magnetometerInfo_ + : magnetometerInfoBuilder_.build(); + to_bitField0_ |= 0x00000010; + } + if (((from_bitField0_ & 0x00400000) != 0)) { + result.barometerInfo_ = barometerInfoBuilder_ == null + ? barometerInfo_ + : barometerInfoBuilder_.build(); + to_bitField0_ |= 0x00000020; + } + if (((from_bitField0_ & 0x00800000) != 0)) { + result.lightSensorInfo_ = lightSensorInfoBuilder_ == null + ? lightSensorInfo_ + : lightSensorInfoBuilder_.build(); + to_bitField0_ |= 0x00000040; + } + if (((from_bitField0_ & 0x01000000) != 0)) { + result.proximityInfo_ = proximityInfoBuilder_ == null + ? proximityInfo_ + : proximityInfoBuilder_.build(); + to_bitField0_ |= 0x00000080; + } + result.bitField0_ |= to_bitField0_; + } + + @java.lang.Override public Builder mergeFrom(com.google.protobuf.Message other) { - if (other instanceof Trajectory) { - return mergeFrom((Trajectory)other); + if (other instanceof com.openpositioning.PositionMe.Traj.Trajectory) { + return mergeFrom((com.openpositioning.PositionMe.Traj.Trajectory)other); } else { super.mergeFrom(other); return this; } } - public Builder mergeFrom(Trajectory other) { - if (other == Trajectory.getDefaultInstance()) return this; + public Builder mergeFrom(com.openpositioning.PositionMe.Traj.Trajectory other) { + if (other == com.openpositioning.PositionMe.Traj.Trajectory.getDefaultInstance()) return this; if (!other.getAndroidVersion().isEmpty()) { androidVersion_ = other.androidVersion_; + bitField0_ |= 0x00000001; + onChanged(); + } + if (other.getTrajectoryVersion() != 0F) { + setTrajectoryVersion(other.getTrajectoryVersion()); + } + if (!other.getTrajectoryId().isEmpty()) { + trajectoryId_ = other.trajectoryId_; + bitField0_ |= 0x00000004; onChanged(); } if (imuDataBuilder_ == null) { if (!other.imuData_.isEmpty()) { if (imuData_.isEmpty()) { imuData_ = other.imuData_; - bitField0_ = (bitField0_ & ~0x00000002); + bitField0_ = (bitField0_ & ~0x00000008); } else { ensureImuDataIsMutable(); imuData_.addAll(other.imuData_); @@ -1764,10 +2474,10 @@ public Builder mergeFrom(Trajectory other) { imuDataBuilder_.dispose(); imuDataBuilder_ = null; imuData_ = other.imuData_; - bitField0_ = (bitField0_ & ~0x00000002); - imuDataBuilder_ = - com.google.protobuf.GeneratedMessageV3.alwaysUseFieldBuilders ? - getImuDataFieldBuilder() : null; + bitField0_ = (bitField0_ & ~0x00000008); + imuDataBuilder_ = + com.google.protobuf.GeneratedMessage.alwaysUseFieldBuilders ? + getImuDataFieldBuilder() : null; } else { imuDataBuilder_.addAllMessages(other.imuData_); } @@ -1777,7 +2487,7 @@ public Builder mergeFrom(Trajectory other) { if (!other.pdrData_.isEmpty()) { if (pdrData_.isEmpty()) { pdrData_ = other.pdrData_; - bitField0_ = (bitField0_ & ~0x00000004); + bitField0_ = (bitField0_ & ~0x00000010); } else { ensurePdrDataIsMutable(); pdrData_.addAll(other.pdrData_); @@ -1790,38 +2500,38 @@ public Builder mergeFrom(Trajectory other) { pdrDataBuilder_.dispose(); pdrDataBuilder_ = null; pdrData_ = other.pdrData_; - bitField0_ = (bitField0_ & ~0x00000004); - pdrDataBuilder_ = - com.google.protobuf.GeneratedMessageV3.alwaysUseFieldBuilders ? - getPdrDataFieldBuilder() : null; + bitField0_ = (bitField0_ & ~0x00000010); + pdrDataBuilder_ = + com.google.protobuf.GeneratedMessage.alwaysUseFieldBuilders ? + getPdrDataFieldBuilder() : null; } else { pdrDataBuilder_.addAllMessages(other.pdrData_); } } } - if (positionDataBuilder_ == null) { - if (!other.positionData_.isEmpty()) { - if (positionData_.isEmpty()) { - positionData_ = other.positionData_; - bitField0_ = (bitField0_ & ~0x00000008); + if (magnetometerDataBuilder_ == null) { + if (!other.magnetometerData_.isEmpty()) { + if (magnetometerData_.isEmpty()) { + magnetometerData_ = other.magnetometerData_; + bitField0_ = (bitField0_ & ~0x00000020); } else { - ensurePositionDataIsMutable(); - positionData_.addAll(other.positionData_); + ensureMagnetometerDataIsMutable(); + magnetometerData_.addAll(other.magnetometerData_); } onChanged(); } } else { - if (!other.positionData_.isEmpty()) { - if (positionDataBuilder_.isEmpty()) { - positionDataBuilder_.dispose(); - positionDataBuilder_ = null; - positionData_ = other.positionData_; - bitField0_ = (bitField0_ & ~0x00000008); - positionDataBuilder_ = - com.google.protobuf.GeneratedMessageV3.alwaysUseFieldBuilders ? - getPositionDataFieldBuilder() : null; + if (!other.magnetometerData_.isEmpty()) { + if (magnetometerDataBuilder_.isEmpty()) { + magnetometerDataBuilder_.dispose(); + magnetometerDataBuilder_ = null; + magnetometerData_ = other.magnetometerData_; + bitField0_ = (bitField0_ & ~0x00000020); + magnetometerDataBuilder_ = + com.google.protobuf.GeneratedMessage.alwaysUseFieldBuilders ? + getMagnetometerDataFieldBuilder() : null; } else { - positionDataBuilder_.addAllMessages(other.positionData_); + magnetometerDataBuilder_.addAllMessages(other.magnetometerData_); } } } @@ -1829,7 +2539,7 @@ public Builder mergeFrom(Trajectory other) { if (!other.pressureData_.isEmpty()) { if (pressureData_.isEmpty()) { pressureData_ = other.pressureData_; - bitField0_ = (bitField0_ & ~0x00000010); + bitField0_ = (bitField0_ & ~0x00000040); } else { ensurePressureDataIsMutable(); pressureData_.addAll(other.pressureData_); @@ -1842,10 +2552,10 @@ public Builder mergeFrom(Trajectory other) { pressureDataBuilder_.dispose(); pressureDataBuilder_ = null; pressureData_ = other.pressureData_; - bitField0_ = (bitField0_ & ~0x00000010); - pressureDataBuilder_ = - com.google.protobuf.GeneratedMessageV3.alwaysUseFieldBuilders ? - getPressureDataFieldBuilder() : null; + bitField0_ = (bitField0_ & ~0x00000040); + pressureDataBuilder_ = + com.google.protobuf.GeneratedMessage.alwaysUseFieldBuilders ? + getPressureDataFieldBuilder() : null; } else { pressureDataBuilder_.addAllMessages(other.pressureData_); } @@ -1855,7 +2565,7 @@ public Builder mergeFrom(Trajectory other) { if (!other.lightData_.isEmpty()) { if (lightData_.isEmpty()) { lightData_ = other.lightData_; - bitField0_ = (bitField0_ & ~0x00000020); + bitField0_ = (bitField0_ & ~0x00000080); } else { ensureLightDataIsMutable(); lightData_.addAll(other.lightData_); @@ -1868,20 +2578,46 @@ public Builder mergeFrom(Trajectory other) { lightDataBuilder_.dispose(); lightDataBuilder_ = null; lightData_ = other.lightData_; - bitField0_ = (bitField0_ & ~0x00000020); - lightDataBuilder_ = - com.google.protobuf.GeneratedMessageV3.alwaysUseFieldBuilders ? - getLightDataFieldBuilder() : null; + bitField0_ = (bitField0_ & ~0x00000080); + lightDataBuilder_ = + com.google.protobuf.GeneratedMessage.alwaysUseFieldBuilders ? + getLightDataFieldBuilder() : null; } else { lightDataBuilder_.addAllMessages(other.lightData_); } } } + if (proximityDataBuilder_ == null) { + if (!other.proximityData_.isEmpty()) { + if (proximityData_.isEmpty()) { + proximityData_ = other.proximityData_; + bitField0_ = (bitField0_ & ~0x00000100); + } else { + ensureProximityDataIsMutable(); + proximityData_.addAll(other.proximityData_); + } + onChanged(); + } + } else { + if (!other.proximityData_.isEmpty()) { + if (proximityDataBuilder_.isEmpty()) { + proximityDataBuilder_.dispose(); + proximityDataBuilder_ = null; + proximityData_ = other.proximityData_; + bitField0_ = (bitField0_ & ~0x00000100); + proximityDataBuilder_ = + com.google.protobuf.GeneratedMessage.alwaysUseFieldBuilders ? + getProximityDataFieldBuilder() : null; + } else { + proximityDataBuilder_.addAllMessages(other.proximityData_); + } + } + } if (gnssDataBuilder_ == null) { if (!other.gnssData_.isEmpty()) { if (gnssData_.isEmpty()) { gnssData_ = other.gnssData_; - bitField0_ = (bitField0_ & ~0x00000040); + bitField0_ = (bitField0_ & ~0x00000200); } else { ensureGnssDataIsMutable(); gnssData_.addAll(other.gnssData_); @@ -1894,38 +2630,38 @@ public Builder mergeFrom(Trajectory other) { gnssDataBuilder_.dispose(); gnssDataBuilder_ = null; gnssData_ = other.gnssData_; - bitField0_ = (bitField0_ & ~0x00000040); - gnssDataBuilder_ = - com.google.protobuf.GeneratedMessageV3.alwaysUseFieldBuilders ? - getGnssDataFieldBuilder() : null; + bitField0_ = (bitField0_ & ~0x00000200); + gnssDataBuilder_ = + com.google.protobuf.GeneratedMessage.alwaysUseFieldBuilders ? + getGnssDataFieldBuilder() : null; } else { gnssDataBuilder_.addAllMessages(other.gnssData_); } } } - if (wifiDataBuilder_ == null) { - if (!other.wifiData_.isEmpty()) { - if (wifiData_.isEmpty()) { - wifiData_ = other.wifiData_; - bitField0_ = (bitField0_ & ~0x00000080); + if (wifiFingerprintsBuilder_ == null) { + if (!other.wifiFingerprints_.isEmpty()) { + if (wifiFingerprints_.isEmpty()) { + wifiFingerprints_ = other.wifiFingerprints_; + bitField0_ = (bitField0_ & ~0x00000400); } else { - ensureWifiDataIsMutable(); - wifiData_.addAll(other.wifiData_); + ensureWifiFingerprintsIsMutable(); + wifiFingerprints_.addAll(other.wifiFingerprints_); } onChanged(); } } else { - if (!other.wifiData_.isEmpty()) { - if (wifiDataBuilder_.isEmpty()) { - wifiDataBuilder_.dispose(); - wifiDataBuilder_ = null; - wifiData_ = other.wifiData_; - bitField0_ = (bitField0_ & ~0x00000080); - wifiDataBuilder_ = - com.google.protobuf.GeneratedMessageV3.alwaysUseFieldBuilders ? - getWifiDataFieldBuilder() : null; + if (!other.wifiFingerprints_.isEmpty()) { + if (wifiFingerprintsBuilder_.isEmpty()) { + wifiFingerprintsBuilder_.dispose(); + wifiFingerprintsBuilder_ = null; + wifiFingerprints_ = other.wifiFingerprints_; + bitField0_ = (bitField0_ & ~0x00000400); + wifiFingerprintsBuilder_ = + com.google.protobuf.GeneratedMessage.alwaysUseFieldBuilders ? + getWifiFingerprintsFieldBuilder() : null; } else { - wifiDataBuilder_.addAllMessages(other.wifiData_); + wifiFingerprintsBuilder_.addAllMessages(other.wifiFingerprints_); } } } @@ -1933,7 +2669,7 @@ public Builder mergeFrom(Trajectory other) { if (!other.apsData_.isEmpty()) { if (apsData_.isEmpty()) { apsData_ = other.apsData_; - bitField0_ = (bitField0_ & ~0x00000100); + bitField0_ = (bitField0_ & ~0x00000800); } else { ensureApsDataIsMutable(); apsData_.addAll(other.apsData_); @@ -1946,21 +2682,124 @@ public Builder mergeFrom(Trajectory other) { apsDataBuilder_.dispose(); apsDataBuilder_ = null; apsData_ = other.apsData_; - bitField0_ = (bitField0_ & ~0x00000100); - apsDataBuilder_ = - com.google.protobuf.GeneratedMessageV3.alwaysUseFieldBuilders ? - getApsDataFieldBuilder() : null; + bitField0_ = (bitField0_ & ~0x00000800); + apsDataBuilder_ = + com.google.protobuf.GeneratedMessage.alwaysUseFieldBuilders ? + getApsDataFieldBuilder() : null; } else { apsDataBuilder_.addAllMessages(other.apsData_); } } } + if (wifiRttDataBuilder_ == null) { + if (!other.wifiRttData_.isEmpty()) { + if (wifiRttData_.isEmpty()) { + wifiRttData_ = other.wifiRttData_; + bitField0_ = (bitField0_ & ~0x00001000); + } else { + ensureWifiRttDataIsMutable(); + wifiRttData_.addAll(other.wifiRttData_); + } + onChanged(); + } + } else { + if (!other.wifiRttData_.isEmpty()) { + if (wifiRttDataBuilder_.isEmpty()) { + wifiRttDataBuilder_.dispose(); + wifiRttDataBuilder_ = null; + wifiRttData_ = other.wifiRttData_; + bitField0_ = (bitField0_ & ~0x00001000); + wifiRttDataBuilder_ = + com.google.protobuf.GeneratedMessage.alwaysUseFieldBuilders ? + getWifiRttDataFieldBuilder() : null; + } else { + wifiRttDataBuilder_.addAllMessages(other.wifiRttData_); + } + } + } + if (bleFingerprintsBuilder_ == null) { + if (!other.bleFingerprints_.isEmpty()) { + if (bleFingerprints_.isEmpty()) { + bleFingerprints_ = other.bleFingerprints_; + bitField0_ = (bitField0_ & ~0x00002000); + } else { + ensureBleFingerprintsIsMutable(); + bleFingerprints_.addAll(other.bleFingerprints_); + } + onChanged(); + } + } else { + if (!other.bleFingerprints_.isEmpty()) { + if (bleFingerprintsBuilder_.isEmpty()) { + bleFingerprintsBuilder_.dispose(); + bleFingerprintsBuilder_ = null; + bleFingerprints_ = other.bleFingerprints_; + bitField0_ = (bitField0_ & ~0x00002000); + bleFingerprintsBuilder_ = + com.google.protobuf.GeneratedMessage.alwaysUseFieldBuilders ? + getBleFingerprintsFieldBuilder() : null; + } else { + bleFingerprintsBuilder_.addAllMessages(other.bleFingerprints_); + } + } + } + if (bleDataBuilder_ == null) { + if (!other.bleData_.isEmpty()) { + if (bleData_.isEmpty()) { + bleData_ = other.bleData_; + bitField0_ = (bitField0_ & ~0x00004000); + } else { + ensureBleDataIsMutable(); + bleData_.addAll(other.bleData_); + } + onChanged(); + } + } else { + if (!other.bleData_.isEmpty()) { + if (bleDataBuilder_.isEmpty()) { + bleDataBuilder_.dispose(); + bleDataBuilder_ = null; + bleData_ = other.bleData_; + bitField0_ = (bitField0_ & ~0x00004000); + bleDataBuilder_ = + com.google.protobuf.GeneratedMessage.alwaysUseFieldBuilders ? + getBleDataFieldBuilder() : null; + } else { + bleDataBuilder_.addAllMessages(other.bleData_); + } + } + } if (other.getStartTimestamp() != 0L) { setStartTimestamp(other.getStartTimestamp()); } - if (!other.getDataIdentifier().isEmpty()) { - dataIdentifier_ = other.dataIdentifier_; - onChanged(); + if (other.hasInitialPosition()) { + mergeInitialPosition(other.getInitialPosition()); + } + if (correctedPositionsBuilder_ == null) { + if (!other.correctedPositions_.isEmpty()) { + if (correctedPositions_.isEmpty()) { + correctedPositions_ = other.correctedPositions_; + bitField0_ = (bitField0_ & ~0x00020000); + } else { + ensureCorrectedPositionsIsMutable(); + correctedPositions_.addAll(other.correctedPositions_); + } + onChanged(); + } + } else { + if (!other.correctedPositions_.isEmpty()) { + if (correctedPositionsBuilder_.isEmpty()) { + correctedPositionsBuilder_.dispose(); + correctedPositionsBuilder_ = null; + correctedPositions_ = other.correctedPositions_; + bitField0_ = (bitField0_ & ~0x00020000); + correctedPositionsBuilder_ = + com.google.protobuf.GeneratedMessage.alwaysUseFieldBuilders ? + getCorrectedPositionsFieldBuilder() : null; + } else { + correctedPositionsBuilder_.addAllMessages(other.correctedPositions_); + } + } } if (other.hasAccelerometerInfo()) { mergeAccelerometerInfo(other.getAccelerometerInfo()); @@ -1980,59 +2819,364 @@ public Builder mergeFrom(Trajectory other) { if (other.hasLightSensorInfo()) { mergeLightSensorInfo(other.getLightSensorInfo()); } + if (other.hasProximityInfo()) { + mergeProximityInfo(other.getProximityInfo()); + } + if (testPointsBuilder_ == null) { + if (!other.testPoints_.isEmpty()) { + if (testPoints_.isEmpty()) { + testPoints_ = other.testPoints_; + bitField0_ = (bitField0_ & ~0x02000000); + } else { + ensureTestPointsIsMutable(); + testPoints_.addAll(other.testPoints_); + } + onChanged(); + } + } else { + if (!other.testPoints_.isEmpty()) { + if (testPointsBuilder_.isEmpty()) { + testPointsBuilder_.dispose(); + testPointsBuilder_ = null; + testPoints_ = other.testPoints_; + bitField0_ = (bitField0_ & ~0x02000000); + testPointsBuilder_ = + com.google.protobuf.GeneratedMessage.alwaysUseFieldBuilders ? + getTestPointsFieldBuilder() : null; + } else { + testPointsBuilder_.addAllMessages(other.testPoints_); + } + } + } + this.mergeUnknownFields(other.getUnknownFields()); onChanged(); return this; } + @java.lang.Override public final boolean isInitialized() { return true; } + @java.lang.Override public Builder mergeFrom( - com.google.protobuf.CodedInputStream input, - com.google.protobuf.ExtensionRegistryLite extensionRegistry) - throws java.io.IOException { - Trajectory parsedMessage = null; + com.google.protobuf.CodedInputStream input, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws java.io.IOException { + if (extensionRegistry == null) { + throw new java.lang.NullPointerException(); + } try { - parsedMessage = PARSER.parsePartialFrom(input, extensionRegistry); + boolean done = false; + while (!done) { + int tag = input.readTag(); + switch (tag) { + case 0: + done = true; + break; + case 10: { + androidVersion_ = input.readStringRequireUtf8(); + bitField0_ |= 0x00000001; + break; + } // case 10 + case 21: { + trajectoryVersion_ = input.readFloat(); + bitField0_ |= 0x00000002; + break; + } // case 21 + case 26: { + trajectoryId_ = input.readStringRequireUtf8(); + bitField0_ |= 0x00000004; + break; + } // case 26 + case 34: { + com.openpositioning.PositionMe.Traj.IMUReading m = + input.readMessage( + com.openpositioning.PositionMe.Traj.IMUReading.parser(), + extensionRegistry); + if (imuDataBuilder_ == null) { + ensureImuDataIsMutable(); + imuData_.add(m); + } else { + imuDataBuilder_.addMessage(m); + } + break; + } // case 34 + case 42: { + com.openpositioning.PositionMe.Traj.RelativePosition m = + input.readMessage( + com.openpositioning.PositionMe.Traj.RelativePosition.parser(), + extensionRegistry); + if (pdrDataBuilder_ == null) { + ensurePdrDataIsMutable(); + pdrData_.add(m); + } else { + pdrDataBuilder_.addMessage(m); + } + break; + } // case 42 + case 50: { + com.openpositioning.PositionMe.Traj.MagnetometerReading m = + input.readMessage( + com.openpositioning.PositionMe.Traj.MagnetometerReading.parser(), + extensionRegistry); + if (magnetometerDataBuilder_ == null) { + ensureMagnetometerDataIsMutable(); + magnetometerData_.add(m); + } else { + magnetometerDataBuilder_.addMessage(m); + } + break; + } // case 50 + case 58: { + com.openpositioning.PositionMe.Traj.BarometerReading m = + input.readMessage( + com.openpositioning.PositionMe.Traj.BarometerReading.parser(), + extensionRegistry); + if (pressureDataBuilder_ == null) { + ensurePressureDataIsMutable(); + pressureData_.add(m); + } else { + pressureDataBuilder_.addMessage(m); + } + break; + } // case 58 + case 66: { + com.openpositioning.PositionMe.Traj.LightReading m = + input.readMessage( + com.openpositioning.PositionMe.Traj.LightReading.parser(), + extensionRegistry); + if (lightDataBuilder_ == null) { + ensureLightDataIsMutable(); + lightData_.add(m); + } else { + lightDataBuilder_.addMessage(m); + } + break; + } // case 66 + case 74: { + com.openpositioning.PositionMe.Traj.ProximityReading m = + input.readMessage( + com.openpositioning.PositionMe.Traj.ProximityReading.parser(), + extensionRegistry); + if (proximityDataBuilder_ == null) { + ensureProximityDataIsMutable(); + proximityData_.add(m); + } else { + proximityDataBuilder_.addMessage(m); + } + break; + } // case 74 + case 82: { + com.openpositioning.PositionMe.Traj.GNSSReading m = + input.readMessage( + com.openpositioning.PositionMe.Traj.GNSSReading.parser(), + extensionRegistry); + if (gnssDataBuilder_ == null) { + ensureGnssDataIsMutable(); + gnssData_.add(m); + } else { + gnssDataBuilder_.addMessage(m); + } + break; + } // case 82 + case 90: { + com.openpositioning.PositionMe.Traj.Fingerprint m = + input.readMessage( + com.openpositioning.PositionMe.Traj.Fingerprint.parser(), + extensionRegistry); + if (wifiFingerprintsBuilder_ == null) { + ensureWifiFingerprintsIsMutable(); + wifiFingerprints_.add(m); + } else { + wifiFingerprintsBuilder_.addMessage(m); + } + break; + } // case 90 + case 98: { + com.openpositioning.PositionMe.Traj.WiFiAPData m = + input.readMessage( + com.openpositioning.PositionMe.Traj.WiFiAPData.parser(), + extensionRegistry); + if (apsDataBuilder_ == null) { + ensureApsDataIsMutable(); + apsData_.add(m); + } else { + apsDataBuilder_.addMessage(m); + } + break; + } // case 98 + case 106: { + com.openpositioning.PositionMe.Traj.WiFiRTTReading m = + input.readMessage( + com.openpositioning.PositionMe.Traj.WiFiRTTReading.parser(), + extensionRegistry); + if (wifiRttDataBuilder_ == null) { + ensureWifiRttDataIsMutable(); + wifiRttData_.add(m); + } else { + wifiRttDataBuilder_.addMessage(m); + } + break; + } // case 106 + case 114: { + com.openpositioning.PositionMe.Traj.Fingerprint m = + input.readMessage( + com.openpositioning.PositionMe.Traj.Fingerprint.parser(), + extensionRegistry); + if (bleFingerprintsBuilder_ == null) { + ensureBleFingerprintsIsMutable(); + bleFingerprints_.add(m); + } else { + bleFingerprintsBuilder_.addMessage(m); + } + break; + } // case 114 + case 122: { + com.openpositioning.PositionMe.Traj.BleData m = + input.readMessage( + com.openpositioning.PositionMe.Traj.BleData.parser(), + extensionRegistry); + if (bleDataBuilder_ == null) { + ensureBleDataIsMutable(); + bleData_.add(m); + } else { + bleDataBuilder_.addMessage(m); + } + break; + } // case 122 + case 128: { + startTimestamp_ = input.readInt64(); + bitField0_ |= 0x00008000; + break; + } // case 128 + case 138: { + input.readMessage( + getInitialPositionFieldBuilder().getBuilder(), + extensionRegistry); + bitField0_ |= 0x00010000; + break; + } // case 138 + case 146: { + com.openpositioning.PositionMe.Traj.GNSSPosition m = + input.readMessage( + com.openpositioning.PositionMe.Traj.GNSSPosition.parser(), + extensionRegistry); + if (correctedPositionsBuilder_ == null) { + ensureCorrectedPositionsIsMutable(); + correctedPositions_.add(m); + } else { + correctedPositionsBuilder_.addMessage(m); + } + break; + } // case 146 + case 154: { + input.readMessage( + getAccelerometerInfoFieldBuilder().getBuilder(), + extensionRegistry); + bitField0_ |= 0x00040000; + break; + } // case 154 + case 162: { + input.readMessage( + getGyroscopeInfoFieldBuilder().getBuilder(), + extensionRegistry); + bitField0_ |= 0x00080000; + break; + } // case 162 + case 170: { + input.readMessage( + getRotationVectorInfoFieldBuilder().getBuilder(), + extensionRegistry); + bitField0_ |= 0x00100000; + break; + } // case 170 + case 178: { + input.readMessage( + getMagnetometerInfoFieldBuilder().getBuilder(), + extensionRegistry); + bitField0_ |= 0x00200000; + break; + } // case 178 + case 186: { + input.readMessage( + getBarometerInfoFieldBuilder().getBuilder(), + extensionRegistry); + bitField0_ |= 0x00400000; + break; + } // case 186 + case 194: { + input.readMessage( + getLightSensorInfoFieldBuilder().getBuilder(), + extensionRegistry); + bitField0_ |= 0x00800000; + break; + } // case 194 + case 202: { + input.readMessage( + getProximityInfoFieldBuilder().getBuilder(), + extensionRegistry); + bitField0_ |= 0x01000000; + break; + } // case 202 + case 210: { + com.openpositioning.PositionMe.Traj.GNSSPosition m = + input.readMessage( + com.openpositioning.PositionMe.Traj.GNSSPosition.parser(), + extensionRegistry); + if (testPointsBuilder_ == null) { + ensureTestPointsIsMutable(); + testPoints_.add(m); + } else { + testPointsBuilder_.addMessage(m); + } + break; + } // case 210 + default: { + if (!super.parseUnknownField(input, extensionRegistry, tag)) { + done = true; // was an endgroup tag + } + break; + } // default: + } // switch (tag) + } // while (!done) } catch (com.google.protobuf.InvalidProtocolBufferException e) { - parsedMessage = (Trajectory) e.getUnfinishedMessage(); throw e.unwrapIOException(); } finally { - if (parsedMessage != null) { - mergeFrom(parsedMessage); - } - } + onChanged(); + } // finally return this; } private int bitField0_; - private Object androidVersion_ = ""; + private java.lang.Object androidVersion_ = ""; /** - * optional string android_version = 1; + * string android_version = 1; + * @return The androidVersion. */ - public String getAndroidVersion() { - Object ref = androidVersion_; - if (!(ref instanceof String)) { + public java.lang.String getAndroidVersion() { + java.lang.Object ref = androidVersion_; + if (!(ref instanceof java.lang.String)) { com.google.protobuf.ByteString bs = - (com.google.protobuf.ByteString) ref; - String s = bs.toStringUtf8(); + (com.google.protobuf.ByteString) ref; + java.lang.String s = bs.toStringUtf8(); androidVersion_ = s; return s; } else { - return (String) ref; + return (java.lang.String) ref; } } /** - * optional string android_version = 1; + * string android_version = 1; + * @return The bytes for androidVersion. */ public com.google.protobuf.ByteString - getAndroidVersionBytes() { - Object ref = androidVersion_; + getAndroidVersionBytes() { + java.lang.Object ref = androidVersion_; if (ref instanceof String) { - com.google.protobuf.ByteString b = - com.google.protobuf.ByteString.copyFromUtf8( - (String) ref); + com.google.protobuf.ByteString b = + com.google.protobuf.ByteString.copyFromUtf8( + (java.lang.String) ref); androidVersion_ = b; return b; } else { @@ -2040,58 +3184,195 @@ public String getAndroidVersion() { } } /** - * optional string android_version = 1; + * string android_version = 1; + * @param value The androidVersion to set. + * @return This builder for chaining. */ public Builder setAndroidVersion( - String value) { - if (value == null) { - throw new NullPointerException(); - } - + java.lang.String value) { + if (value == null) { throw new NullPointerException(); } androidVersion_ = value; + bitField0_ |= 0x00000001; onChanged(); return this; } /** - * optional string android_version = 1; + * string android_version = 1; + * @return This builder for chaining. */ public Builder clearAndroidVersion() { - androidVersion_ = getDefaultInstance().getAndroidVersion(); + bitField0_ = (bitField0_ & ~0x00000001); onChanged(); return this; } /** - * optional string android_version = 1; + * string android_version = 1; + * @param value The bytes for androidVersion to set. + * @return This builder for chaining. */ public Builder setAndroidVersionBytes( - com.google.protobuf.ByteString value) { - if (value == null) { - throw new NullPointerException(); - } - checkByteStringIsUtf8(value); - + com.google.protobuf.ByteString value) { + if (value == null) { throw new NullPointerException(); } + checkByteStringIsUtf8(value); androidVersion_ = value; + bitField0_ |= 0x00000001; + onChanged(); + return this; + } + + private float trajectoryVersion_ ; + /** + *
+       * version 2.0
+       * 
+ * + * float trajectory_version = 2; + * @return The trajectoryVersion. + */ + @java.lang.Override + public float getTrajectoryVersion() { + return trajectoryVersion_; + } + /** + *
+       * version 2.0
+       * 
+ * + * float trajectory_version = 2; + * @param value The trajectoryVersion to set. + * @return This builder for chaining. + */ + public Builder setTrajectoryVersion(float value) { + + trajectoryVersion_ = value; + bitField0_ |= 0x00000002; + onChanged(); + return this; + } + /** + *
+       * version 2.0
+       * 
+ * + * float trajectory_version = 2; + * @return This builder for chaining. + */ + public Builder clearTrajectoryVersion() { + bitField0_ = (bitField0_ & ~0x00000002); + trajectoryVersion_ = 0F; + onChanged(); + return this; + } + + private java.lang.Object trajectoryId_ = ""; + /** + *
+       * trajectory id/name for identification
+       * 
+ * + * string trajectory_id = 3; + * @return The trajectoryId. + */ + public java.lang.String getTrajectoryId() { + java.lang.Object ref = trajectoryId_; + if (!(ref instanceof java.lang.String)) { + com.google.protobuf.ByteString bs = + (com.google.protobuf.ByteString) ref; + java.lang.String s = bs.toStringUtf8(); + trajectoryId_ = s; + return s; + } else { + return (java.lang.String) ref; + } + } + /** + *
+       * trajectory id/name for identification
+       * 
+ * + * string trajectory_id = 3; + * @return The bytes for trajectoryId. + */ + public com.google.protobuf.ByteString + getTrajectoryIdBytes() { + java.lang.Object ref = trajectoryId_; + if (ref instanceof String) { + com.google.protobuf.ByteString b = + com.google.protobuf.ByteString.copyFromUtf8( + (java.lang.String) ref); + trajectoryId_ = b; + return b; + } else { + return (com.google.protobuf.ByteString) ref; + } + } + /** + *
+       * trajectory id/name for identification
+       * 
+ * + * string trajectory_id = 3; + * @param value The trajectoryId to set. + * @return This builder for chaining. + */ + public Builder setTrajectoryId( + java.lang.String value) { + if (value == null) { throw new NullPointerException(); } + trajectoryId_ = value; + bitField0_ |= 0x00000004; + onChanged(); + return this; + } + /** + *
+       * trajectory id/name for identification
+       * 
+ * + * string trajectory_id = 3; + * @return This builder for chaining. + */ + public Builder clearTrajectoryId() { + trajectoryId_ = getDefaultInstance().getTrajectoryId(); + bitField0_ = (bitField0_ & ~0x00000004); + onChanged(); + return this; + } + /** + *
+       * trajectory id/name for identification
+       * 
+ * + * string trajectory_id = 3; + * @param value The bytes for trajectoryId to set. + * @return This builder for chaining. + */ + public Builder setTrajectoryIdBytes( + com.google.protobuf.ByteString value) { + if (value == null) { throw new NullPointerException(); } + checkByteStringIsUtf8(value); + trajectoryId_ = value; + bitField0_ |= 0x00000004; onChanged(); return this; } - private java.util.List imuData_ = - java.util.Collections.emptyList(); + private java.util.List imuData_ = + java.util.Collections.emptyList(); private void ensureImuDataIsMutable() { - if (!((bitField0_ & 0x00000002) == 0x00000002)) { - imuData_ = new java.util.ArrayList(imuData_); - bitField0_ |= 0x00000002; - } + if (!((bitField0_ & 0x00000008) != 0)) { + imuData_ = new java.util.ArrayList(imuData_); + bitField0_ |= 0x00000008; + } } - private com.google.protobuf.RepeatedFieldBuilderV3< - Motion_Sample, Motion_Sample.Builder, Motion_SampleOrBuilder> imuDataBuilder_; + private com.google.protobuf.RepeatedFieldBuilder< + com.openpositioning.PositionMe.Traj.IMUReading, com.openpositioning.PositionMe.Traj.IMUReading.Builder, com.openpositioning.PositionMe.Traj.IMUReadingOrBuilder> imuDataBuilder_; /** - * repeated .Motion_Sample imu_data = 2; + * repeated .IMUReading imu_data = 4; */ - public java.util.List getImuDataList() { + public java.util.List getImuDataList() { if (imuDataBuilder_ == null) { return java.util.Collections.unmodifiableList(imuData_); } else { @@ -2099,7 +3380,7 @@ public java.util.List getImuDataList() { } } /** - * repeated .Motion_Sample imu_data = 2; + * repeated .IMUReading imu_data = 4; */ public int getImuDataCount() { if (imuDataBuilder_ == null) { @@ -2109,9 +3390,9 @@ public int getImuDataCount() { } } /** - * repeated .Motion_Sample imu_data = 2; + * repeated .IMUReading imu_data = 4; */ - public Motion_Sample getImuData(int index) { + public com.openpositioning.PositionMe.Traj.IMUReading getImuData(int index) { if (imuDataBuilder_ == null) { return imuData_.get(index); } else { @@ -2119,10 +3400,10 @@ public Motion_Sample getImuData(int index) { } } /** - * repeated .Motion_Sample imu_data = 2; + * repeated .IMUReading imu_data = 4; */ public Builder setImuData( - int index, Motion_Sample value) { + int index, com.openpositioning.PositionMe.Traj.IMUReading value) { if (imuDataBuilder_ == null) { if (value == null) { throw new NullPointerException(); @@ -2136,10 +3417,10 @@ public Builder setImuData( return this; } /** - * repeated .Motion_Sample imu_data = 2; + * repeated .IMUReading imu_data = 4; */ public Builder setImuData( - int index, Motion_Sample.Builder builderForValue) { + int index, com.openpositioning.PositionMe.Traj.IMUReading.Builder builderForValue) { if (imuDataBuilder_ == null) { ensureImuDataIsMutable(); imuData_.set(index, builderForValue.build()); @@ -2150,9 +3431,9 @@ public Builder setImuData( return this; } /** - * repeated .Motion_Sample imu_data = 2; + * repeated .IMUReading imu_data = 4; */ - public Builder addImuData(Motion_Sample value) { + public Builder addImuData(com.openpositioning.PositionMe.Traj.IMUReading value) { if (imuDataBuilder_ == null) { if (value == null) { throw new NullPointerException(); @@ -2166,10 +3447,10 @@ public Builder addImuData(Motion_Sample value) { return this; } /** - * repeated .Motion_Sample imu_data = 2; + * repeated .IMUReading imu_data = 4; */ public Builder addImuData( - int index, Motion_Sample value) { + int index, com.openpositioning.PositionMe.Traj.IMUReading value) { if (imuDataBuilder_ == null) { if (value == null) { throw new NullPointerException(); @@ -2183,10 +3464,10 @@ public Builder addImuData( return this; } /** - * repeated .Motion_Sample imu_data = 2; + * repeated .IMUReading imu_data = 4; */ public Builder addImuData( - Motion_Sample.Builder builderForValue) { + com.openpositioning.PositionMe.Traj.IMUReading.Builder builderForValue) { if (imuDataBuilder_ == null) { ensureImuDataIsMutable(); imuData_.add(builderForValue.build()); @@ -2197,10 +3478,10 @@ public Builder addImuData( return this; } /** - * repeated .Motion_Sample imu_data = 2; + * repeated .IMUReading imu_data = 4; */ public Builder addImuData( - int index, Motion_Sample.Builder builderForValue) { + int index, com.openpositioning.PositionMe.Traj.IMUReading.Builder builderForValue) { if (imuDataBuilder_ == null) { ensureImuDataIsMutable(); imuData_.add(index, builderForValue.build()); @@ -2211,14 +3492,14 @@ public Builder addImuData( return this; } /** - * repeated .Motion_Sample imu_data = 2; + * repeated .IMUReading imu_data = 4; */ public Builder addAllImuData( - Iterable values) { + java.lang.Iterable values) { if (imuDataBuilder_ == null) { ensureImuDataIsMutable(); com.google.protobuf.AbstractMessageLite.Builder.addAll( - values, imuData_); + values, imuData_); onChanged(); } else { imuDataBuilder_.addAllMessages(values); @@ -2226,12 +3507,12 @@ public Builder addAllImuData( return this; } /** - * repeated .Motion_Sample imu_data = 2; + * repeated .IMUReading imu_data = 4; */ public Builder clearImuData() { if (imuDataBuilder_ == null) { imuData_ = java.util.Collections.emptyList(); - bitField0_ = (bitField0_ & ~0x00000002); + bitField0_ = (bitField0_ & ~0x00000008); onChanged(); } else { imuDataBuilder_.clear(); @@ -2239,7 +3520,7 @@ public Builder clearImuData() { return this; } /** - * repeated .Motion_Sample imu_data = 2; + * repeated .IMUReading imu_data = 4; */ public Builder removeImuData(int index) { if (imuDataBuilder_ == null) { @@ -2252,27 +3533,27 @@ public Builder removeImuData(int index) { return this; } /** - * repeated .Motion_Sample imu_data = 2; + * repeated .IMUReading imu_data = 4; */ - public Motion_Sample.Builder getImuDataBuilder( - int index) { + public com.openpositioning.PositionMe.Traj.IMUReading.Builder getImuDataBuilder( + int index) { return getImuDataFieldBuilder().getBuilder(index); } /** - * repeated .Motion_Sample imu_data = 2; + * repeated .IMUReading imu_data = 4; */ - public Motion_SampleOrBuilder getImuDataOrBuilder( - int index) { + public com.openpositioning.PositionMe.Traj.IMUReadingOrBuilder getImuDataOrBuilder( + int index) { if (imuDataBuilder_ == null) { return imuData_.get(index); } else { return imuDataBuilder_.getMessageOrBuilder(index); } } /** - * repeated .Motion_Sample imu_data = 2; + * repeated .IMUReading imu_data = 4; */ - public java.util.List - getImuDataOrBuilderList() { + public java.util.List + getImuDataOrBuilderList() { if (imuDataBuilder_ != null) { return imuDataBuilder_.getMessageOrBuilderList(); } else { @@ -2280,35 +3561,35 @@ public Motion_SampleOrBuilder getImuDataOrBuilder( } } /** - * repeated .Motion_Sample imu_data = 2; + * repeated .IMUReading imu_data = 4; */ - public Motion_Sample.Builder addImuDataBuilder() { + public com.openpositioning.PositionMe.Traj.IMUReading.Builder addImuDataBuilder() { return getImuDataFieldBuilder().addBuilder( - Motion_Sample.getDefaultInstance()); + com.openpositioning.PositionMe.Traj.IMUReading.getDefaultInstance()); } /** - * repeated .Motion_Sample imu_data = 2; + * repeated .IMUReading imu_data = 4; */ - public Motion_Sample.Builder addImuDataBuilder( - int index) { + public com.openpositioning.PositionMe.Traj.IMUReading.Builder addImuDataBuilder( + int index) { return getImuDataFieldBuilder().addBuilder( - index, Motion_Sample.getDefaultInstance()); + index, com.openpositioning.PositionMe.Traj.IMUReading.getDefaultInstance()); } /** - * repeated .Motion_Sample imu_data = 2; + * repeated .IMUReading imu_data = 4; */ - public java.util.List - getImuDataBuilderList() { + public java.util.List + getImuDataBuilderList() { return getImuDataFieldBuilder().getBuilderList(); } - private com.google.protobuf.RepeatedFieldBuilderV3< - Motion_Sample, Motion_Sample.Builder, Motion_SampleOrBuilder> - getImuDataFieldBuilder() { + private com.google.protobuf.RepeatedFieldBuilder< + com.openpositioning.PositionMe.Traj.IMUReading, com.openpositioning.PositionMe.Traj.IMUReading.Builder, com.openpositioning.PositionMe.Traj.IMUReadingOrBuilder> + getImuDataFieldBuilder() { if (imuDataBuilder_ == null) { - imuDataBuilder_ = new com.google.protobuf.RepeatedFieldBuilderV3< - Motion_Sample, Motion_Sample.Builder, Motion_SampleOrBuilder>( + imuDataBuilder_ = new com.google.protobuf.RepeatedFieldBuilder< + com.openpositioning.PositionMe.Traj.IMUReading, com.openpositioning.PositionMe.Traj.IMUReading.Builder, com.openpositioning.PositionMe.Traj.IMUReadingOrBuilder>( imuData_, - ((bitField0_ & 0x00000002) == 0x00000002), + ((bitField0_ & 0x00000008) != 0), getParentForChildren(), isClean()); imuData_ = null; @@ -2316,22 +3597,22 @@ public Motion_Sample.Builder addImuDataBuilder( return imuDataBuilder_; } - private java.util.List pdrData_ = - java.util.Collections.emptyList(); + private java.util.List pdrData_ = + java.util.Collections.emptyList(); private void ensurePdrDataIsMutable() { - if (!((bitField0_ & 0x00000004) == 0x00000004)) { - pdrData_ = new java.util.ArrayList(pdrData_); - bitField0_ |= 0x00000004; - } + if (!((bitField0_ & 0x00000010) != 0)) { + pdrData_ = new java.util.ArrayList(pdrData_); + bitField0_ |= 0x00000010; + } } - private com.google.protobuf.RepeatedFieldBuilderV3< - Pdr_Sample, Pdr_Sample.Builder, Pdr_SampleOrBuilder> pdrDataBuilder_; + private com.google.protobuf.RepeatedFieldBuilder< + com.openpositioning.PositionMe.Traj.RelativePosition, com.openpositioning.PositionMe.Traj.RelativePosition.Builder, com.openpositioning.PositionMe.Traj.RelativePositionOrBuilder> pdrDataBuilder_; /** - * repeated .Pdr_Sample pdr_data = 3; + * repeated .RelativePosition pdr_data = 5; */ - public java.util.List getPdrDataList() { + public java.util.List getPdrDataList() { if (pdrDataBuilder_ == null) { return java.util.Collections.unmodifiableList(pdrData_); } else { @@ -2339,7 +3620,7 @@ public java.util.List getPdrDataList() { } } /** - * repeated .Pdr_Sample pdr_data = 3; + * repeated .RelativePosition pdr_data = 5; */ public int getPdrDataCount() { if (pdrDataBuilder_ == null) { @@ -2349,9 +3630,9 @@ public int getPdrDataCount() { } } /** - * repeated .Pdr_Sample pdr_data = 3; + * repeated .RelativePosition pdr_data = 5; */ - public Pdr_Sample getPdrData(int index) { + public com.openpositioning.PositionMe.Traj.RelativePosition getPdrData(int index) { if (pdrDataBuilder_ == null) { return pdrData_.get(index); } else { @@ -2359,10 +3640,10 @@ public Pdr_Sample getPdrData(int index) { } } /** - * repeated .Pdr_Sample pdr_data = 3; + * repeated .RelativePosition pdr_data = 5; */ public Builder setPdrData( - int index, Pdr_Sample value) { + int index, com.openpositioning.PositionMe.Traj.RelativePosition value) { if (pdrDataBuilder_ == null) { if (value == null) { throw new NullPointerException(); @@ -2376,10 +3657,10 @@ public Builder setPdrData( return this; } /** - * repeated .Pdr_Sample pdr_data = 3; + * repeated .RelativePosition pdr_data = 5; */ public Builder setPdrData( - int index, Pdr_Sample.Builder builderForValue) { + int index, com.openpositioning.PositionMe.Traj.RelativePosition.Builder builderForValue) { if (pdrDataBuilder_ == null) { ensurePdrDataIsMutable(); pdrData_.set(index, builderForValue.build()); @@ -2390,9 +3671,9 @@ public Builder setPdrData( return this; } /** - * repeated .Pdr_Sample pdr_data = 3; + * repeated .RelativePosition pdr_data = 5; */ - public Builder addPdrData(Pdr_Sample value) { + public Builder addPdrData(com.openpositioning.PositionMe.Traj.RelativePosition value) { if (pdrDataBuilder_ == null) { if (value == null) { throw new NullPointerException(); @@ -2406,10 +3687,10 @@ public Builder addPdrData(Pdr_Sample value) { return this; } /** - * repeated .Pdr_Sample pdr_data = 3; + * repeated .RelativePosition pdr_data = 5; */ public Builder addPdrData( - int index, Pdr_Sample value) { + int index, com.openpositioning.PositionMe.Traj.RelativePosition value) { if (pdrDataBuilder_ == null) { if (value == null) { throw new NullPointerException(); @@ -2423,10 +3704,10 @@ public Builder addPdrData( return this; } /** - * repeated .Pdr_Sample pdr_data = 3; + * repeated .RelativePosition pdr_data = 5; */ public Builder addPdrData( - Pdr_Sample.Builder builderForValue) { + com.openpositioning.PositionMe.Traj.RelativePosition.Builder builderForValue) { if (pdrDataBuilder_ == null) { ensurePdrDataIsMutable(); pdrData_.add(builderForValue.build()); @@ -2437,10 +3718,10 @@ public Builder addPdrData( return this; } /** - * repeated .Pdr_Sample pdr_data = 3; + * repeated .RelativePosition pdr_data = 5; */ public Builder addPdrData( - int index, Pdr_Sample.Builder builderForValue) { + int index, com.openpositioning.PositionMe.Traj.RelativePosition.Builder builderForValue) { if (pdrDataBuilder_ == null) { ensurePdrDataIsMutable(); pdrData_.add(index, builderForValue.build()); @@ -2451,14 +3732,14 @@ public Builder addPdrData( return this; } /** - * repeated .Pdr_Sample pdr_data = 3; + * repeated .RelativePosition pdr_data = 5; */ public Builder addAllPdrData( - Iterable values) { + java.lang.Iterable values) { if (pdrDataBuilder_ == null) { ensurePdrDataIsMutable(); com.google.protobuf.AbstractMessageLite.Builder.addAll( - values, pdrData_); + values, pdrData_); onChanged(); } else { pdrDataBuilder_.addAllMessages(values); @@ -2466,12 +3747,12 @@ public Builder addAllPdrData( return this; } /** - * repeated .Pdr_Sample pdr_data = 3; + * repeated .RelativePosition pdr_data = 5; */ public Builder clearPdrData() { if (pdrDataBuilder_ == null) { pdrData_ = java.util.Collections.emptyList(); - bitField0_ = (bitField0_ & ~0x00000004); + bitField0_ = (bitField0_ & ~0x00000010); onChanged(); } else { pdrDataBuilder_.clear(); @@ -2479,7 +3760,7 @@ public Builder clearPdrData() { return this; } /** - * repeated .Pdr_Sample pdr_data = 3; + * repeated .RelativePosition pdr_data = 5; */ public Builder removePdrData(int index) { if (pdrDataBuilder_ == null) { @@ -2492,27 +3773,27 @@ public Builder removePdrData(int index) { return this; } /** - * repeated .Pdr_Sample pdr_data = 3; + * repeated .RelativePosition pdr_data = 5; */ - public Pdr_Sample.Builder getPdrDataBuilder( - int index) { + public com.openpositioning.PositionMe.Traj.RelativePosition.Builder getPdrDataBuilder( + int index) { return getPdrDataFieldBuilder().getBuilder(index); } /** - * repeated .Pdr_Sample pdr_data = 3; + * repeated .RelativePosition pdr_data = 5; */ - public Pdr_SampleOrBuilder getPdrDataOrBuilder( - int index) { + public com.openpositioning.PositionMe.Traj.RelativePositionOrBuilder getPdrDataOrBuilder( + int index) { if (pdrDataBuilder_ == null) { return pdrData_.get(index); } else { return pdrDataBuilder_.getMessageOrBuilder(index); } } /** - * repeated .Pdr_Sample pdr_data = 3; + * repeated .RelativePosition pdr_data = 5; */ - public java.util.List - getPdrDataOrBuilderList() { + public java.util.List + getPdrDataOrBuilderList() { if (pdrDataBuilder_ != null) { return pdrDataBuilder_.getMessageOrBuilderList(); } else { @@ -2520,35 +3801,35 @@ public Pdr_SampleOrBuilder getPdrDataOrBuilder( } } /** - * repeated .Pdr_Sample pdr_data = 3; + * repeated .RelativePosition pdr_data = 5; */ - public Pdr_Sample.Builder addPdrDataBuilder() { + public com.openpositioning.PositionMe.Traj.RelativePosition.Builder addPdrDataBuilder() { return getPdrDataFieldBuilder().addBuilder( - Pdr_Sample.getDefaultInstance()); + com.openpositioning.PositionMe.Traj.RelativePosition.getDefaultInstance()); } /** - * repeated .Pdr_Sample pdr_data = 3; + * repeated .RelativePosition pdr_data = 5; */ - public Pdr_Sample.Builder addPdrDataBuilder( - int index) { + public com.openpositioning.PositionMe.Traj.RelativePosition.Builder addPdrDataBuilder( + int index) { return getPdrDataFieldBuilder().addBuilder( - index, Pdr_Sample.getDefaultInstance()); + index, com.openpositioning.PositionMe.Traj.RelativePosition.getDefaultInstance()); } /** - * repeated .Pdr_Sample pdr_data = 3; + * repeated .RelativePosition pdr_data = 5; */ - public java.util.List - getPdrDataBuilderList() { + public java.util.List + getPdrDataBuilderList() { return getPdrDataFieldBuilder().getBuilderList(); } - private com.google.protobuf.RepeatedFieldBuilderV3< - Pdr_Sample, Pdr_Sample.Builder, Pdr_SampleOrBuilder> - getPdrDataFieldBuilder() { + private com.google.protobuf.RepeatedFieldBuilder< + com.openpositioning.PositionMe.Traj.RelativePosition, com.openpositioning.PositionMe.Traj.RelativePosition.Builder, com.openpositioning.PositionMe.Traj.RelativePositionOrBuilder> + getPdrDataFieldBuilder() { if (pdrDataBuilder_ == null) { - pdrDataBuilder_ = new com.google.protobuf.RepeatedFieldBuilderV3< - Pdr_Sample, Pdr_Sample.Builder, Pdr_SampleOrBuilder>( + pdrDataBuilder_ = new com.google.protobuf.RepeatedFieldBuilder< + com.openpositioning.PositionMe.Traj.RelativePosition, com.openpositioning.PositionMe.Traj.RelativePosition.Builder, com.openpositioning.PositionMe.Traj.RelativePositionOrBuilder>( pdrData_, - ((bitField0_ & 0x00000004) == 0x00000004), + ((bitField0_ & 0x00000010) != 0), getParentForChildren(), isClean()); pdrData_ = null; @@ -2556,262 +3837,262 @@ public Pdr_Sample.Builder addPdrDataBuilder( return pdrDataBuilder_; } - private java.util.List positionData_ = - java.util.Collections.emptyList(); - private void ensurePositionDataIsMutable() { - if (!((bitField0_ & 0x00000008) == 0x00000008)) { - positionData_ = new java.util.ArrayList(positionData_); - bitField0_ |= 0x00000008; - } + private java.util.List magnetometerData_ = + java.util.Collections.emptyList(); + private void ensureMagnetometerDataIsMutable() { + if (!((bitField0_ & 0x00000020) != 0)) { + magnetometerData_ = new java.util.ArrayList(magnetometerData_); + bitField0_ |= 0x00000020; + } } - private com.google.protobuf.RepeatedFieldBuilderV3< - Position_Sample, Position_Sample.Builder, Position_SampleOrBuilder> positionDataBuilder_; + private com.google.protobuf.RepeatedFieldBuilder< + com.openpositioning.PositionMe.Traj.MagnetometerReading, com.openpositioning.PositionMe.Traj.MagnetometerReading.Builder, com.openpositioning.PositionMe.Traj.MagnetometerReadingOrBuilder> magnetometerDataBuilder_; /** - * repeated .Position_Sample position_data = 4; + * repeated .MagnetometerReading magnetometer_data = 6; */ - public java.util.List getPositionDataList() { - if (positionDataBuilder_ == null) { - return java.util.Collections.unmodifiableList(positionData_); + public java.util.List getMagnetometerDataList() { + if (magnetometerDataBuilder_ == null) { + return java.util.Collections.unmodifiableList(magnetometerData_); } else { - return positionDataBuilder_.getMessageList(); + return magnetometerDataBuilder_.getMessageList(); } } /** - * repeated .Position_Sample position_data = 4; + * repeated .MagnetometerReading magnetometer_data = 6; */ - public int getPositionDataCount() { - if (positionDataBuilder_ == null) { - return positionData_.size(); + public int getMagnetometerDataCount() { + if (magnetometerDataBuilder_ == null) { + return magnetometerData_.size(); } else { - return positionDataBuilder_.getCount(); + return magnetometerDataBuilder_.getCount(); } } /** - * repeated .Position_Sample position_data = 4; + * repeated .MagnetometerReading magnetometer_data = 6; */ - public Position_Sample getPositionData(int index) { - if (positionDataBuilder_ == null) { - return positionData_.get(index); + public com.openpositioning.PositionMe.Traj.MagnetometerReading getMagnetometerData(int index) { + if (magnetometerDataBuilder_ == null) { + return magnetometerData_.get(index); } else { - return positionDataBuilder_.getMessage(index); + return magnetometerDataBuilder_.getMessage(index); } } /** - * repeated .Position_Sample position_data = 4; + * repeated .MagnetometerReading magnetometer_data = 6; */ - public Builder setPositionData( - int index, Position_Sample value) { - if (positionDataBuilder_ == null) { + public Builder setMagnetometerData( + int index, com.openpositioning.PositionMe.Traj.MagnetometerReading value) { + if (magnetometerDataBuilder_ == null) { if (value == null) { throw new NullPointerException(); } - ensurePositionDataIsMutable(); - positionData_.set(index, value); + ensureMagnetometerDataIsMutable(); + magnetometerData_.set(index, value); onChanged(); } else { - positionDataBuilder_.setMessage(index, value); + magnetometerDataBuilder_.setMessage(index, value); } return this; } /** - * repeated .Position_Sample position_data = 4; + * repeated .MagnetometerReading magnetometer_data = 6; */ - public Builder setPositionData( - int index, Position_Sample.Builder builderForValue) { - if (positionDataBuilder_ == null) { - ensurePositionDataIsMutable(); - positionData_.set(index, builderForValue.build()); + public Builder setMagnetometerData( + int index, com.openpositioning.PositionMe.Traj.MagnetometerReading.Builder builderForValue) { + if (magnetometerDataBuilder_ == null) { + ensureMagnetometerDataIsMutable(); + magnetometerData_.set(index, builderForValue.build()); onChanged(); } else { - positionDataBuilder_.setMessage(index, builderForValue.build()); + magnetometerDataBuilder_.setMessage(index, builderForValue.build()); } return this; } /** - * repeated .Position_Sample position_data = 4; + * repeated .MagnetometerReading magnetometer_data = 6; */ - public Builder addPositionData(Position_Sample value) { - if (positionDataBuilder_ == null) { + public Builder addMagnetometerData(com.openpositioning.PositionMe.Traj.MagnetometerReading value) { + if (magnetometerDataBuilder_ == null) { if (value == null) { throw new NullPointerException(); } - ensurePositionDataIsMutable(); - positionData_.add(value); + ensureMagnetometerDataIsMutable(); + magnetometerData_.add(value); onChanged(); } else { - positionDataBuilder_.addMessage(value); + magnetometerDataBuilder_.addMessage(value); } return this; } /** - * repeated .Position_Sample position_data = 4; + * repeated .MagnetometerReading magnetometer_data = 6; */ - public Builder addPositionData( - int index, Position_Sample value) { - if (positionDataBuilder_ == null) { + public Builder addMagnetometerData( + int index, com.openpositioning.PositionMe.Traj.MagnetometerReading value) { + if (magnetometerDataBuilder_ == null) { if (value == null) { throw new NullPointerException(); } - ensurePositionDataIsMutable(); - positionData_.add(index, value); + ensureMagnetometerDataIsMutable(); + magnetometerData_.add(index, value); onChanged(); } else { - positionDataBuilder_.addMessage(index, value); + magnetometerDataBuilder_.addMessage(index, value); } return this; } /** - * repeated .Position_Sample position_data = 4; + * repeated .MagnetometerReading magnetometer_data = 6; */ - public Builder addPositionData( - Position_Sample.Builder builderForValue) { - if (positionDataBuilder_ == null) { - ensurePositionDataIsMutable(); - positionData_.add(builderForValue.build()); + public Builder addMagnetometerData( + com.openpositioning.PositionMe.Traj.MagnetometerReading.Builder builderForValue) { + if (magnetometerDataBuilder_ == null) { + ensureMagnetometerDataIsMutable(); + magnetometerData_.add(builderForValue.build()); onChanged(); } else { - positionDataBuilder_.addMessage(builderForValue.build()); + magnetometerDataBuilder_.addMessage(builderForValue.build()); } return this; } /** - * repeated .Position_Sample position_data = 4; + * repeated .MagnetometerReading magnetometer_data = 6; */ - public Builder addPositionData( - int index, Position_Sample.Builder builderForValue) { - if (positionDataBuilder_ == null) { - ensurePositionDataIsMutable(); - positionData_.add(index, builderForValue.build()); + public Builder addMagnetometerData( + int index, com.openpositioning.PositionMe.Traj.MagnetometerReading.Builder builderForValue) { + if (magnetometerDataBuilder_ == null) { + ensureMagnetometerDataIsMutable(); + magnetometerData_.add(index, builderForValue.build()); onChanged(); } else { - positionDataBuilder_.addMessage(index, builderForValue.build()); + magnetometerDataBuilder_.addMessage(index, builderForValue.build()); } return this; } /** - * repeated .Position_Sample position_data = 4; + * repeated .MagnetometerReading magnetometer_data = 6; */ - public Builder addAllPositionData( - Iterable values) { - if (positionDataBuilder_ == null) { - ensurePositionDataIsMutable(); + public Builder addAllMagnetometerData( + java.lang.Iterable values) { + if (magnetometerDataBuilder_ == null) { + ensureMagnetometerDataIsMutable(); com.google.protobuf.AbstractMessageLite.Builder.addAll( - values, positionData_); + values, magnetometerData_); onChanged(); } else { - positionDataBuilder_.addAllMessages(values); + magnetometerDataBuilder_.addAllMessages(values); } return this; } /** - * repeated .Position_Sample position_data = 4; + * repeated .MagnetometerReading magnetometer_data = 6; */ - public Builder clearPositionData() { - if (positionDataBuilder_ == null) { - positionData_ = java.util.Collections.emptyList(); - bitField0_ = (bitField0_ & ~0x00000008); + public Builder clearMagnetometerData() { + if (magnetometerDataBuilder_ == null) { + magnetometerData_ = java.util.Collections.emptyList(); + bitField0_ = (bitField0_ & ~0x00000020); onChanged(); } else { - positionDataBuilder_.clear(); + magnetometerDataBuilder_.clear(); } return this; } /** - * repeated .Position_Sample position_data = 4; + * repeated .MagnetometerReading magnetometer_data = 6; */ - public Builder removePositionData(int index) { - if (positionDataBuilder_ == null) { - ensurePositionDataIsMutable(); - positionData_.remove(index); + public Builder removeMagnetometerData(int index) { + if (magnetometerDataBuilder_ == null) { + ensureMagnetometerDataIsMutable(); + magnetometerData_.remove(index); onChanged(); } else { - positionDataBuilder_.remove(index); + magnetometerDataBuilder_.remove(index); } return this; } /** - * repeated .Position_Sample position_data = 4; + * repeated .MagnetometerReading magnetometer_data = 6; */ - public Position_Sample.Builder getPositionDataBuilder( - int index) { - return getPositionDataFieldBuilder().getBuilder(index); + public com.openpositioning.PositionMe.Traj.MagnetometerReading.Builder getMagnetometerDataBuilder( + int index) { + return getMagnetometerDataFieldBuilder().getBuilder(index); } /** - * repeated .Position_Sample position_data = 4; + * repeated .MagnetometerReading magnetometer_data = 6; */ - public Position_SampleOrBuilder getPositionDataOrBuilder( - int index) { - if (positionDataBuilder_ == null) { - return positionData_.get(index); } else { - return positionDataBuilder_.getMessageOrBuilder(index); + public com.openpositioning.PositionMe.Traj.MagnetometerReadingOrBuilder getMagnetometerDataOrBuilder( + int index) { + if (magnetometerDataBuilder_ == null) { + return magnetometerData_.get(index); } else { + return magnetometerDataBuilder_.getMessageOrBuilder(index); } } /** - * repeated .Position_Sample position_data = 4; + * repeated .MagnetometerReading magnetometer_data = 6; */ - public java.util.List - getPositionDataOrBuilderList() { - if (positionDataBuilder_ != null) { - return positionDataBuilder_.getMessageOrBuilderList(); + public java.util.List + getMagnetometerDataOrBuilderList() { + if (magnetometerDataBuilder_ != null) { + return magnetometerDataBuilder_.getMessageOrBuilderList(); } else { - return java.util.Collections.unmodifiableList(positionData_); + return java.util.Collections.unmodifiableList(magnetometerData_); } } /** - * repeated .Position_Sample position_data = 4; + * repeated .MagnetometerReading magnetometer_data = 6; */ - public Position_Sample.Builder addPositionDataBuilder() { - return getPositionDataFieldBuilder().addBuilder( - Position_Sample.getDefaultInstance()); + public com.openpositioning.PositionMe.Traj.MagnetometerReading.Builder addMagnetometerDataBuilder() { + return getMagnetometerDataFieldBuilder().addBuilder( + com.openpositioning.PositionMe.Traj.MagnetometerReading.getDefaultInstance()); } /** - * repeated .Position_Sample position_data = 4; + * repeated .MagnetometerReading magnetometer_data = 6; */ - public Position_Sample.Builder addPositionDataBuilder( - int index) { - return getPositionDataFieldBuilder().addBuilder( - index, Position_Sample.getDefaultInstance()); + public com.openpositioning.PositionMe.Traj.MagnetometerReading.Builder addMagnetometerDataBuilder( + int index) { + return getMagnetometerDataFieldBuilder().addBuilder( + index, com.openpositioning.PositionMe.Traj.MagnetometerReading.getDefaultInstance()); } /** - * repeated .Position_Sample position_data = 4; + * repeated .MagnetometerReading magnetometer_data = 6; */ - public java.util.List - getPositionDataBuilderList() { - return getPositionDataFieldBuilder().getBuilderList(); + public java.util.List + getMagnetometerDataBuilderList() { + return getMagnetometerDataFieldBuilder().getBuilderList(); } - private com.google.protobuf.RepeatedFieldBuilderV3< - Position_Sample, Position_Sample.Builder, Position_SampleOrBuilder> - getPositionDataFieldBuilder() { - if (positionDataBuilder_ == null) { - positionDataBuilder_ = new com.google.protobuf.RepeatedFieldBuilderV3< - Position_Sample, Position_Sample.Builder, Position_SampleOrBuilder>( - positionData_, - ((bitField0_ & 0x00000008) == 0x00000008), + private com.google.protobuf.RepeatedFieldBuilder< + com.openpositioning.PositionMe.Traj.MagnetometerReading, com.openpositioning.PositionMe.Traj.MagnetometerReading.Builder, com.openpositioning.PositionMe.Traj.MagnetometerReadingOrBuilder> + getMagnetometerDataFieldBuilder() { + if (magnetometerDataBuilder_ == null) { + magnetometerDataBuilder_ = new com.google.protobuf.RepeatedFieldBuilder< + com.openpositioning.PositionMe.Traj.MagnetometerReading, com.openpositioning.PositionMe.Traj.MagnetometerReading.Builder, com.openpositioning.PositionMe.Traj.MagnetometerReadingOrBuilder>( + magnetometerData_, + ((bitField0_ & 0x00000020) != 0), getParentForChildren(), isClean()); - positionData_ = null; + magnetometerData_ = null; } - return positionDataBuilder_; + return magnetometerDataBuilder_; } - private java.util.List pressureData_ = - java.util.Collections.emptyList(); + private java.util.List pressureData_ = + java.util.Collections.emptyList(); private void ensurePressureDataIsMutable() { - if (!((bitField0_ & 0x00000010) == 0x00000010)) { - pressureData_ = new java.util.ArrayList(pressureData_); - bitField0_ |= 0x00000010; - } + if (!((bitField0_ & 0x00000040) != 0)) { + pressureData_ = new java.util.ArrayList(pressureData_); + bitField0_ |= 0x00000040; + } } - private com.google.protobuf.RepeatedFieldBuilderV3< - Pressure_Sample, Pressure_Sample.Builder, Pressure_SampleOrBuilder> pressureDataBuilder_; + private com.google.protobuf.RepeatedFieldBuilder< + com.openpositioning.PositionMe.Traj.BarometerReading, com.openpositioning.PositionMe.Traj.BarometerReading.Builder, com.openpositioning.PositionMe.Traj.BarometerReadingOrBuilder> pressureDataBuilder_; /** - * repeated .Pressure_Sample pressure_data = 5; + * repeated .BarometerReading pressure_data = 7; */ - public java.util.List getPressureDataList() { + public java.util.List getPressureDataList() { if (pressureDataBuilder_ == null) { return java.util.Collections.unmodifiableList(pressureData_); } else { @@ -2819,7 +4100,7 @@ public java.util.List getPressureDataList() { } } /** - * repeated .Pressure_Sample pressure_data = 5; + * repeated .BarometerReading pressure_data = 7; */ public int getPressureDataCount() { if (pressureDataBuilder_ == null) { @@ -2829,9 +4110,9 @@ public int getPressureDataCount() { } } /** - * repeated .Pressure_Sample pressure_data = 5; + * repeated .BarometerReading pressure_data = 7; */ - public Pressure_Sample getPressureData(int index) { + public com.openpositioning.PositionMe.Traj.BarometerReading getPressureData(int index) { if (pressureDataBuilder_ == null) { return pressureData_.get(index); } else { @@ -2839,10 +4120,10 @@ public Pressure_Sample getPressureData(int index) { } } /** - * repeated .Pressure_Sample pressure_data = 5; + * repeated .BarometerReading pressure_data = 7; */ public Builder setPressureData( - int index, Pressure_Sample value) { + int index, com.openpositioning.PositionMe.Traj.BarometerReading value) { if (pressureDataBuilder_ == null) { if (value == null) { throw new NullPointerException(); @@ -2856,10 +4137,10 @@ public Builder setPressureData( return this; } /** - * repeated .Pressure_Sample pressure_data = 5; + * repeated .BarometerReading pressure_data = 7; */ public Builder setPressureData( - int index, Pressure_Sample.Builder builderForValue) { + int index, com.openpositioning.PositionMe.Traj.BarometerReading.Builder builderForValue) { if (pressureDataBuilder_ == null) { ensurePressureDataIsMutable(); pressureData_.set(index, builderForValue.build()); @@ -2870,9 +4151,9 @@ public Builder setPressureData( return this; } /** - * repeated .Pressure_Sample pressure_data = 5; + * repeated .BarometerReading pressure_data = 7; */ - public Builder addPressureData(Pressure_Sample value) { + public Builder addPressureData(com.openpositioning.PositionMe.Traj.BarometerReading value) { if (pressureDataBuilder_ == null) { if (value == null) { throw new NullPointerException(); @@ -2886,10 +4167,10 @@ public Builder addPressureData(Pressure_Sample value) { return this; } /** - * repeated .Pressure_Sample pressure_data = 5; + * repeated .BarometerReading pressure_data = 7; */ public Builder addPressureData( - int index, Pressure_Sample value) { + int index, com.openpositioning.PositionMe.Traj.BarometerReading value) { if (pressureDataBuilder_ == null) { if (value == null) { throw new NullPointerException(); @@ -2903,10 +4184,10 @@ public Builder addPressureData( return this; } /** - * repeated .Pressure_Sample pressure_data = 5; + * repeated .BarometerReading pressure_data = 7; */ public Builder addPressureData( - Pressure_Sample.Builder builderForValue) { + com.openpositioning.PositionMe.Traj.BarometerReading.Builder builderForValue) { if (pressureDataBuilder_ == null) { ensurePressureDataIsMutable(); pressureData_.add(builderForValue.build()); @@ -2917,10 +4198,10 @@ public Builder addPressureData( return this; } /** - * repeated .Pressure_Sample pressure_data = 5; + * repeated .BarometerReading pressure_data = 7; */ public Builder addPressureData( - int index, Pressure_Sample.Builder builderForValue) { + int index, com.openpositioning.PositionMe.Traj.BarometerReading.Builder builderForValue) { if (pressureDataBuilder_ == null) { ensurePressureDataIsMutable(); pressureData_.add(index, builderForValue.build()); @@ -2931,14 +4212,14 @@ public Builder addPressureData( return this; } /** - * repeated .Pressure_Sample pressure_data = 5; + * repeated .BarometerReading pressure_data = 7; */ public Builder addAllPressureData( - Iterable values) { + java.lang.Iterable values) { if (pressureDataBuilder_ == null) { ensurePressureDataIsMutable(); com.google.protobuf.AbstractMessageLite.Builder.addAll( - values, pressureData_); + values, pressureData_); onChanged(); } else { pressureDataBuilder_.addAllMessages(values); @@ -2946,12 +4227,12 @@ public Builder addAllPressureData( return this; } /** - * repeated .Pressure_Sample pressure_data = 5; + * repeated .BarometerReading pressure_data = 7; */ public Builder clearPressureData() { if (pressureDataBuilder_ == null) { pressureData_ = java.util.Collections.emptyList(); - bitField0_ = (bitField0_ & ~0x00000010); + bitField0_ = (bitField0_ & ~0x00000040); onChanged(); } else { pressureDataBuilder_.clear(); @@ -2959,7 +4240,7 @@ public Builder clearPressureData() { return this; } /** - * repeated .Pressure_Sample pressure_data = 5; + * repeated .BarometerReading pressure_data = 7; */ public Builder removePressureData(int index) { if (pressureDataBuilder_ == null) { @@ -2972,27 +4253,27 @@ public Builder removePressureData(int index) { return this; } /** - * repeated .Pressure_Sample pressure_data = 5; + * repeated .BarometerReading pressure_data = 7; */ - public Pressure_Sample.Builder getPressureDataBuilder( - int index) { + public com.openpositioning.PositionMe.Traj.BarometerReading.Builder getPressureDataBuilder( + int index) { return getPressureDataFieldBuilder().getBuilder(index); } /** - * repeated .Pressure_Sample pressure_data = 5; + * repeated .BarometerReading pressure_data = 7; */ - public Pressure_SampleOrBuilder getPressureDataOrBuilder( - int index) { + public com.openpositioning.PositionMe.Traj.BarometerReadingOrBuilder getPressureDataOrBuilder( + int index) { if (pressureDataBuilder_ == null) { return pressureData_.get(index); } else { return pressureDataBuilder_.getMessageOrBuilder(index); } } /** - * repeated .Pressure_Sample pressure_data = 5; + * repeated .BarometerReading pressure_data = 7; */ - public java.util.List - getPressureDataOrBuilderList() { + public java.util.List + getPressureDataOrBuilderList() { if (pressureDataBuilder_ != null) { return pressureDataBuilder_.getMessageOrBuilderList(); } else { @@ -3000,35 +4281,35 @@ public Pressure_SampleOrBuilder getPressureDataOrBuilder( } } /** - * repeated .Pressure_Sample pressure_data = 5; + * repeated .BarometerReading pressure_data = 7; */ - public Pressure_Sample.Builder addPressureDataBuilder() { + public com.openpositioning.PositionMe.Traj.BarometerReading.Builder addPressureDataBuilder() { return getPressureDataFieldBuilder().addBuilder( - Pressure_Sample.getDefaultInstance()); + com.openpositioning.PositionMe.Traj.BarometerReading.getDefaultInstance()); } /** - * repeated .Pressure_Sample pressure_data = 5; + * repeated .BarometerReading pressure_data = 7; */ - public Pressure_Sample.Builder addPressureDataBuilder( - int index) { + public com.openpositioning.PositionMe.Traj.BarometerReading.Builder addPressureDataBuilder( + int index) { return getPressureDataFieldBuilder().addBuilder( - index, Pressure_Sample.getDefaultInstance()); + index, com.openpositioning.PositionMe.Traj.BarometerReading.getDefaultInstance()); } /** - * repeated .Pressure_Sample pressure_data = 5; + * repeated .BarometerReading pressure_data = 7; */ - public java.util.List - getPressureDataBuilderList() { + public java.util.List + getPressureDataBuilderList() { return getPressureDataFieldBuilder().getBuilderList(); } - private com.google.protobuf.RepeatedFieldBuilderV3< - Pressure_Sample, Pressure_Sample.Builder, Pressure_SampleOrBuilder> - getPressureDataFieldBuilder() { + private com.google.protobuf.RepeatedFieldBuilder< + com.openpositioning.PositionMe.Traj.BarometerReading, com.openpositioning.PositionMe.Traj.BarometerReading.Builder, com.openpositioning.PositionMe.Traj.BarometerReadingOrBuilder> + getPressureDataFieldBuilder() { if (pressureDataBuilder_ == null) { - pressureDataBuilder_ = new com.google.protobuf.RepeatedFieldBuilderV3< - Pressure_Sample, Pressure_Sample.Builder, Pressure_SampleOrBuilder>( + pressureDataBuilder_ = new com.google.protobuf.RepeatedFieldBuilder< + com.openpositioning.PositionMe.Traj.BarometerReading, com.openpositioning.PositionMe.Traj.BarometerReading.Builder, com.openpositioning.PositionMe.Traj.BarometerReadingOrBuilder>( pressureData_, - ((bitField0_ & 0x00000010) == 0x00000010), + ((bitField0_ & 0x00000040) != 0), getParentForChildren(), isClean()); pressureData_ = null; @@ -3036,22 +4317,22 @@ public Pressure_Sample.Builder addPressureDataBuilder( return pressureDataBuilder_; } - private java.util.List lightData_ = - java.util.Collections.emptyList(); + private java.util.List lightData_ = + java.util.Collections.emptyList(); private void ensureLightDataIsMutable() { - if (!((bitField0_ & 0x00000020) == 0x00000020)) { - lightData_ = new java.util.ArrayList(lightData_); - bitField0_ |= 0x00000020; - } + if (!((bitField0_ & 0x00000080) != 0)) { + lightData_ = new java.util.ArrayList(lightData_); + bitField0_ |= 0x00000080; + } } - private com.google.protobuf.RepeatedFieldBuilderV3< - Light_Sample, Light_Sample.Builder, Light_SampleOrBuilder> lightDataBuilder_; + private com.google.protobuf.RepeatedFieldBuilder< + com.openpositioning.PositionMe.Traj.LightReading, com.openpositioning.PositionMe.Traj.LightReading.Builder, com.openpositioning.PositionMe.Traj.LightReadingOrBuilder> lightDataBuilder_; /** - * repeated .Light_Sample light_data = 6; + * repeated .LightReading light_data = 8; */ - public java.util.List getLightDataList() { + public java.util.List getLightDataList() { if (lightDataBuilder_ == null) { return java.util.Collections.unmodifiableList(lightData_); } else { @@ -3059,7 +4340,7 @@ public java.util.List getLightDataList() { } } /** - * repeated .Light_Sample light_data = 6; + * repeated .LightReading light_data = 8; */ public int getLightDataCount() { if (lightDataBuilder_ == null) { @@ -3069,9 +4350,9 @@ public int getLightDataCount() { } } /** - * repeated .Light_Sample light_data = 6; + * repeated .LightReading light_data = 8; */ - public Light_Sample getLightData(int index) { + public com.openpositioning.PositionMe.Traj.LightReading getLightData(int index) { if (lightDataBuilder_ == null) { return lightData_.get(index); } else { @@ -3079,10 +4360,10 @@ public Light_Sample getLightData(int index) { } } /** - * repeated .Light_Sample light_data = 6; + * repeated .LightReading light_data = 8; */ public Builder setLightData( - int index, Light_Sample value) { + int index, com.openpositioning.PositionMe.Traj.LightReading value) { if (lightDataBuilder_ == null) { if (value == null) { throw new NullPointerException(); @@ -3096,10 +4377,10 @@ public Builder setLightData( return this; } /** - * repeated .Light_Sample light_data = 6; + * repeated .LightReading light_data = 8; */ public Builder setLightData( - int index, Light_Sample.Builder builderForValue) { + int index, com.openpositioning.PositionMe.Traj.LightReading.Builder builderForValue) { if (lightDataBuilder_ == null) { ensureLightDataIsMutable(); lightData_.set(index, builderForValue.build()); @@ -3110,9 +4391,9 @@ public Builder setLightData( return this; } /** - * repeated .Light_Sample light_data = 6; + * repeated .LightReading light_data = 8; */ - public Builder addLightData(Light_Sample value) { + public Builder addLightData(com.openpositioning.PositionMe.Traj.LightReading value) { if (lightDataBuilder_ == null) { if (value == null) { throw new NullPointerException(); @@ -3126,10 +4407,10 @@ public Builder addLightData(Light_Sample value) { return this; } /** - * repeated .Light_Sample light_data = 6; + * repeated .LightReading light_data = 8; */ public Builder addLightData( - int index, Light_Sample value) { + int index, com.openpositioning.PositionMe.Traj.LightReading value) { if (lightDataBuilder_ == null) { if (value == null) { throw new NullPointerException(); @@ -3143,10 +4424,10 @@ public Builder addLightData( return this; } /** - * repeated .Light_Sample light_data = 6; + * repeated .LightReading light_data = 8; */ public Builder addLightData( - Light_Sample.Builder builderForValue) { + com.openpositioning.PositionMe.Traj.LightReading.Builder builderForValue) { if (lightDataBuilder_ == null) { ensureLightDataIsMutable(); lightData_.add(builderForValue.build()); @@ -3157,10 +4438,10 @@ public Builder addLightData( return this; } /** - * repeated .Light_Sample light_data = 6; + * repeated .LightReading light_data = 8; */ public Builder addLightData( - int index, Light_Sample.Builder builderForValue) { + int index, com.openpositioning.PositionMe.Traj.LightReading.Builder builderForValue) { if (lightDataBuilder_ == null) { ensureLightDataIsMutable(); lightData_.add(index, builderForValue.build()); @@ -3171,14 +4452,14 @@ public Builder addLightData( return this; } /** - * repeated .Light_Sample light_data = 6; + * repeated .LightReading light_data = 8; */ public Builder addAllLightData( - Iterable values) { + java.lang.Iterable values) { if (lightDataBuilder_ == null) { ensureLightDataIsMutable(); com.google.protobuf.AbstractMessageLite.Builder.addAll( - values, lightData_); + values, lightData_); onChanged(); } else { lightDataBuilder_.addAllMessages(values); @@ -3186,12 +4467,12 @@ public Builder addAllLightData( return this; } /** - * repeated .Light_Sample light_data = 6; + * repeated .LightReading light_data = 8; */ public Builder clearLightData() { if (lightDataBuilder_ == null) { lightData_ = java.util.Collections.emptyList(); - bitField0_ = (bitField0_ & ~0x00000020); + bitField0_ = (bitField0_ & ~0x00000080); onChanged(); } else { lightDataBuilder_.clear(); @@ -3199,7 +4480,7 @@ public Builder clearLightData() { return this; } /** - * repeated .Light_Sample light_data = 6; + * repeated .LightReading light_data = 8; */ public Builder removeLightData(int index) { if (lightDataBuilder_ == null) { @@ -3212,27 +4493,27 @@ public Builder removeLightData(int index) { return this; } /** - * repeated .Light_Sample light_data = 6; + * repeated .LightReading light_data = 8; */ - public Light_Sample.Builder getLightDataBuilder( - int index) { + public com.openpositioning.PositionMe.Traj.LightReading.Builder getLightDataBuilder( + int index) { return getLightDataFieldBuilder().getBuilder(index); } /** - * repeated .Light_Sample light_data = 6; + * repeated .LightReading light_data = 8; */ - public Light_SampleOrBuilder getLightDataOrBuilder( - int index) { + public com.openpositioning.PositionMe.Traj.LightReadingOrBuilder getLightDataOrBuilder( + int index) { if (lightDataBuilder_ == null) { return lightData_.get(index); } else { return lightDataBuilder_.getMessageOrBuilder(index); } } /** - * repeated .Light_Sample light_data = 6; + * repeated .LightReading light_data = 8; */ - public java.util.List - getLightDataOrBuilderList() { + public java.util.List + getLightDataOrBuilderList() { if (lightDataBuilder_ != null) { return lightDataBuilder_.getMessageOrBuilderList(); } else { @@ -3240,35 +4521,35 @@ public Light_SampleOrBuilder getLightDataOrBuilder( } } /** - * repeated .Light_Sample light_data = 6; + * repeated .LightReading light_data = 8; */ - public Light_Sample.Builder addLightDataBuilder() { + public com.openpositioning.PositionMe.Traj.LightReading.Builder addLightDataBuilder() { return getLightDataFieldBuilder().addBuilder( - Light_Sample.getDefaultInstance()); + com.openpositioning.PositionMe.Traj.LightReading.getDefaultInstance()); } /** - * repeated .Light_Sample light_data = 6; + * repeated .LightReading light_data = 8; */ - public Light_Sample.Builder addLightDataBuilder( - int index) { + public com.openpositioning.PositionMe.Traj.LightReading.Builder addLightDataBuilder( + int index) { return getLightDataFieldBuilder().addBuilder( - index, Light_Sample.getDefaultInstance()); + index, com.openpositioning.PositionMe.Traj.LightReading.getDefaultInstance()); } /** - * repeated .Light_Sample light_data = 6; + * repeated .LightReading light_data = 8; */ - public java.util.List - getLightDataBuilderList() { + public java.util.List + getLightDataBuilderList() { return getLightDataFieldBuilder().getBuilderList(); } - private com.google.protobuf.RepeatedFieldBuilderV3< - Light_Sample, Light_Sample.Builder, Light_SampleOrBuilder> - getLightDataFieldBuilder() { + private com.google.protobuf.RepeatedFieldBuilder< + com.openpositioning.PositionMe.Traj.LightReading, com.openpositioning.PositionMe.Traj.LightReading.Builder, com.openpositioning.PositionMe.Traj.LightReadingOrBuilder> + getLightDataFieldBuilder() { if (lightDataBuilder_ == null) { - lightDataBuilder_ = new com.google.protobuf.RepeatedFieldBuilderV3< - Light_Sample, Light_Sample.Builder, Light_SampleOrBuilder>( + lightDataBuilder_ = new com.google.protobuf.RepeatedFieldBuilder< + com.openpositioning.PositionMe.Traj.LightReading, com.openpositioning.PositionMe.Traj.LightReading.Builder, com.openpositioning.PositionMe.Traj.LightReadingOrBuilder>( lightData_, - ((bitField0_ & 0x00000020) == 0x00000020), + ((bitField0_ & 0x00000080) != 0), getParentForChildren(), isClean()); lightData_ = null; @@ -3276,22 +4557,262 @@ public Light_Sample.Builder addLightDataBuilder( return lightDataBuilder_; } - private java.util.List gnssData_ = - java.util.Collections.emptyList(); + private java.util.List proximityData_ = + java.util.Collections.emptyList(); + private void ensureProximityDataIsMutable() { + if (!((bitField0_ & 0x00000100) != 0)) { + proximityData_ = new java.util.ArrayList(proximityData_); + bitField0_ |= 0x00000100; + } + } + + private com.google.protobuf.RepeatedFieldBuilder< + com.openpositioning.PositionMe.Traj.ProximityReading, com.openpositioning.PositionMe.Traj.ProximityReading.Builder, com.openpositioning.PositionMe.Traj.ProximityReadingOrBuilder> proximityDataBuilder_; + + /** + * repeated .ProximityReading proximity_data = 9; + */ + public java.util.List getProximityDataList() { + if (proximityDataBuilder_ == null) { + return java.util.Collections.unmodifiableList(proximityData_); + } else { + return proximityDataBuilder_.getMessageList(); + } + } + /** + * repeated .ProximityReading proximity_data = 9; + */ + public int getProximityDataCount() { + if (proximityDataBuilder_ == null) { + return proximityData_.size(); + } else { + return proximityDataBuilder_.getCount(); + } + } + /** + * repeated .ProximityReading proximity_data = 9; + */ + public com.openpositioning.PositionMe.Traj.ProximityReading getProximityData(int index) { + if (proximityDataBuilder_ == null) { + return proximityData_.get(index); + } else { + return proximityDataBuilder_.getMessage(index); + } + } + /** + * repeated .ProximityReading proximity_data = 9; + */ + public Builder setProximityData( + int index, com.openpositioning.PositionMe.Traj.ProximityReading value) { + if (proximityDataBuilder_ == null) { + if (value == null) { + throw new NullPointerException(); + } + ensureProximityDataIsMutable(); + proximityData_.set(index, value); + onChanged(); + } else { + proximityDataBuilder_.setMessage(index, value); + } + return this; + } + /** + * repeated .ProximityReading proximity_data = 9; + */ + public Builder setProximityData( + int index, com.openpositioning.PositionMe.Traj.ProximityReading.Builder builderForValue) { + if (proximityDataBuilder_ == null) { + ensureProximityDataIsMutable(); + proximityData_.set(index, builderForValue.build()); + onChanged(); + } else { + proximityDataBuilder_.setMessage(index, builderForValue.build()); + } + return this; + } + /** + * repeated .ProximityReading proximity_data = 9; + */ + public Builder addProximityData(com.openpositioning.PositionMe.Traj.ProximityReading value) { + if (proximityDataBuilder_ == null) { + if (value == null) { + throw new NullPointerException(); + } + ensureProximityDataIsMutable(); + proximityData_.add(value); + onChanged(); + } else { + proximityDataBuilder_.addMessage(value); + } + return this; + } + /** + * repeated .ProximityReading proximity_data = 9; + */ + public Builder addProximityData( + int index, com.openpositioning.PositionMe.Traj.ProximityReading value) { + if (proximityDataBuilder_ == null) { + if (value == null) { + throw new NullPointerException(); + } + ensureProximityDataIsMutable(); + proximityData_.add(index, value); + onChanged(); + } else { + proximityDataBuilder_.addMessage(index, value); + } + return this; + } + /** + * repeated .ProximityReading proximity_data = 9; + */ + public Builder addProximityData( + com.openpositioning.PositionMe.Traj.ProximityReading.Builder builderForValue) { + if (proximityDataBuilder_ == null) { + ensureProximityDataIsMutable(); + proximityData_.add(builderForValue.build()); + onChanged(); + } else { + proximityDataBuilder_.addMessage(builderForValue.build()); + } + return this; + } + /** + * repeated .ProximityReading proximity_data = 9; + */ + public Builder addProximityData( + int index, com.openpositioning.PositionMe.Traj.ProximityReading.Builder builderForValue) { + if (proximityDataBuilder_ == null) { + ensureProximityDataIsMutable(); + proximityData_.add(index, builderForValue.build()); + onChanged(); + } else { + proximityDataBuilder_.addMessage(index, builderForValue.build()); + } + return this; + } + /** + * repeated .ProximityReading proximity_data = 9; + */ + public Builder addAllProximityData( + java.lang.Iterable values) { + if (proximityDataBuilder_ == null) { + ensureProximityDataIsMutable(); + com.google.protobuf.AbstractMessageLite.Builder.addAll( + values, proximityData_); + onChanged(); + } else { + proximityDataBuilder_.addAllMessages(values); + } + return this; + } + /** + * repeated .ProximityReading proximity_data = 9; + */ + public Builder clearProximityData() { + if (proximityDataBuilder_ == null) { + proximityData_ = java.util.Collections.emptyList(); + bitField0_ = (bitField0_ & ~0x00000100); + onChanged(); + } else { + proximityDataBuilder_.clear(); + } + return this; + } + /** + * repeated .ProximityReading proximity_data = 9; + */ + public Builder removeProximityData(int index) { + if (proximityDataBuilder_ == null) { + ensureProximityDataIsMutable(); + proximityData_.remove(index); + onChanged(); + } else { + proximityDataBuilder_.remove(index); + } + return this; + } + /** + * repeated .ProximityReading proximity_data = 9; + */ + public com.openpositioning.PositionMe.Traj.ProximityReading.Builder getProximityDataBuilder( + int index) { + return getProximityDataFieldBuilder().getBuilder(index); + } + /** + * repeated .ProximityReading proximity_data = 9; + */ + public com.openpositioning.PositionMe.Traj.ProximityReadingOrBuilder getProximityDataOrBuilder( + int index) { + if (proximityDataBuilder_ == null) { + return proximityData_.get(index); } else { + return proximityDataBuilder_.getMessageOrBuilder(index); + } + } + /** + * repeated .ProximityReading proximity_data = 9; + */ + public java.util.List + getProximityDataOrBuilderList() { + if (proximityDataBuilder_ != null) { + return proximityDataBuilder_.getMessageOrBuilderList(); + } else { + return java.util.Collections.unmodifiableList(proximityData_); + } + } + /** + * repeated .ProximityReading proximity_data = 9; + */ + public com.openpositioning.PositionMe.Traj.ProximityReading.Builder addProximityDataBuilder() { + return getProximityDataFieldBuilder().addBuilder( + com.openpositioning.PositionMe.Traj.ProximityReading.getDefaultInstance()); + } + /** + * repeated .ProximityReading proximity_data = 9; + */ + public com.openpositioning.PositionMe.Traj.ProximityReading.Builder addProximityDataBuilder( + int index) { + return getProximityDataFieldBuilder().addBuilder( + index, com.openpositioning.PositionMe.Traj.ProximityReading.getDefaultInstance()); + } + /** + * repeated .ProximityReading proximity_data = 9; + */ + public java.util.List + getProximityDataBuilderList() { + return getProximityDataFieldBuilder().getBuilderList(); + } + private com.google.protobuf.RepeatedFieldBuilder< + com.openpositioning.PositionMe.Traj.ProximityReading, com.openpositioning.PositionMe.Traj.ProximityReading.Builder, com.openpositioning.PositionMe.Traj.ProximityReadingOrBuilder> + getProximityDataFieldBuilder() { + if (proximityDataBuilder_ == null) { + proximityDataBuilder_ = new com.google.protobuf.RepeatedFieldBuilder< + com.openpositioning.PositionMe.Traj.ProximityReading, com.openpositioning.PositionMe.Traj.ProximityReading.Builder, com.openpositioning.PositionMe.Traj.ProximityReadingOrBuilder>( + proximityData_, + ((bitField0_ & 0x00000100) != 0), + getParentForChildren(), + isClean()); + proximityData_ = null; + } + return proximityDataBuilder_; + } + + private java.util.List gnssData_ = + java.util.Collections.emptyList(); private void ensureGnssDataIsMutable() { - if (!((bitField0_ & 0x00000040) == 0x00000040)) { - gnssData_ = new java.util.ArrayList(gnssData_); - bitField0_ |= 0x00000040; - } + if (!((bitField0_ & 0x00000200) != 0)) { + gnssData_ = new java.util.ArrayList(gnssData_); + bitField0_ |= 0x00000200; + } } - private com.google.protobuf.RepeatedFieldBuilderV3< - GNSS_Sample, GNSS_Sample.Builder, GNSS_SampleOrBuilder> gnssDataBuilder_; + private com.google.protobuf.RepeatedFieldBuilder< + com.openpositioning.PositionMe.Traj.GNSSReading, com.openpositioning.PositionMe.Traj.GNSSReading.Builder, com.openpositioning.PositionMe.Traj.GNSSReadingOrBuilder> gnssDataBuilder_; /** - * repeated .GNSS_Sample gnss_data = 7; + * repeated .GNSSReading gnss_data = 10; */ - public java.util.List getGnssDataList() { + public java.util.List getGnssDataList() { if (gnssDataBuilder_ == null) { return java.util.Collections.unmodifiableList(gnssData_); } else { @@ -3299,7 +4820,7 @@ public java.util.List getGnssDataList() { } } /** - * repeated .GNSS_Sample gnss_data = 7; + * repeated .GNSSReading gnss_data = 10; */ public int getGnssDataCount() { if (gnssDataBuilder_ == null) { @@ -3309,9 +4830,9 @@ public int getGnssDataCount() { } } /** - * repeated .GNSS_Sample gnss_data = 7; + * repeated .GNSSReading gnss_data = 10; */ - public GNSS_Sample getGnssData(int index) { + public com.openpositioning.PositionMe.Traj.GNSSReading getGnssData(int index) { if (gnssDataBuilder_ == null) { return gnssData_.get(index); } else { @@ -3319,10 +4840,10 @@ public GNSS_Sample getGnssData(int index) { } } /** - * repeated .GNSS_Sample gnss_data = 7; + * repeated .GNSSReading gnss_data = 10; */ public Builder setGnssData( - int index, GNSS_Sample value) { + int index, com.openpositioning.PositionMe.Traj.GNSSReading value) { if (gnssDataBuilder_ == null) { if (value == null) { throw new NullPointerException(); @@ -3336,10 +4857,10 @@ public Builder setGnssData( return this; } /** - * repeated .GNSS_Sample gnss_data = 7; + * repeated .GNSSReading gnss_data = 10; */ public Builder setGnssData( - int index, GNSS_Sample.Builder builderForValue) { + int index, com.openpositioning.PositionMe.Traj.GNSSReading.Builder builderForValue) { if (gnssDataBuilder_ == null) { ensureGnssDataIsMutable(); gnssData_.set(index, builderForValue.build()); @@ -3350,9 +4871,9 @@ public Builder setGnssData( return this; } /** - * repeated .GNSS_Sample gnss_data = 7; + * repeated .GNSSReading gnss_data = 10; */ - public Builder addGnssData(GNSS_Sample value) { + public Builder addGnssData(com.openpositioning.PositionMe.Traj.GNSSReading value) { if (gnssDataBuilder_ == null) { if (value == null) { throw new NullPointerException(); @@ -3366,10 +4887,10 @@ public Builder addGnssData(GNSS_Sample value) { return this; } /** - * repeated .GNSS_Sample gnss_data = 7; + * repeated .GNSSReading gnss_data = 10; */ public Builder addGnssData( - int index, GNSS_Sample value) { + int index, com.openpositioning.PositionMe.Traj.GNSSReading value) { if (gnssDataBuilder_ == null) { if (value == null) { throw new NullPointerException(); @@ -3383,10 +4904,10 @@ public Builder addGnssData( return this; } /** - * repeated .GNSS_Sample gnss_data = 7; + * repeated .GNSSReading gnss_data = 10; */ public Builder addGnssData( - GNSS_Sample.Builder builderForValue) { + com.openpositioning.PositionMe.Traj.GNSSReading.Builder builderForValue) { if (gnssDataBuilder_ == null) { ensureGnssDataIsMutable(); gnssData_.add(builderForValue.build()); @@ -3397,10 +4918,10 @@ public Builder addGnssData( return this; } /** - * repeated .GNSS_Sample gnss_data = 7; + * repeated .GNSSReading gnss_data = 10; */ public Builder addGnssData( - int index, GNSS_Sample.Builder builderForValue) { + int index, com.openpositioning.PositionMe.Traj.GNSSReading.Builder builderForValue) { if (gnssDataBuilder_ == null) { ensureGnssDataIsMutable(); gnssData_.add(index, builderForValue.build()); @@ -3411,14 +4932,14 @@ public Builder addGnssData( return this; } /** - * repeated .GNSS_Sample gnss_data = 7; + * repeated .GNSSReading gnss_data = 10; */ public Builder addAllGnssData( - Iterable values) { + java.lang.Iterable values) { if (gnssDataBuilder_ == null) { ensureGnssDataIsMutable(); com.google.protobuf.AbstractMessageLite.Builder.addAll( - values, gnssData_); + values, gnssData_); onChanged(); } else { gnssDataBuilder_.addAllMessages(values); @@ -3426,12 +4947,12 @@ public Builder addAllGnssData( return this; } /** - * repeated .GNSS_Sample gnss_data = 7; + * repeated .GNSSReading gnss_data = 10; */ public Builder clearGnssData() { if (gnssDataBuilder_ == null) { gnssData_ = java.util.Collections.emptyList(); - bitField0_ = (bitField0_ & ~0x00000040); + bitField0_ = (bitField0_ & ~0x00000200); onChanged(); } else { gnssDataBuilder_.clear(); @@ -3439,7 +4960,7 @@ public Builder clearGnssData() { return this; } /** - * repeated .GNSS_Sample gnss_data = 7; + * repeated .GNSSReading gnss_data = 10; */ public Builder removeGnssData(int index) { if (gnssDataBuilder_ == null) { @@ -3452,27 +4973,27 @@ public Builder removeGnssData(int index) { return this; } /** - * repeated .GNSS_Sample gnss_data = 7; + * repeated .GNSSReading gnss_data = 10; */ - public GNSS_Sample.Builder getGnssDataBuilder( - int index) { + public com.openpositioning.PositionMe.Traj.GNSSReading.Builder getGnssDataBuilder( + int index) { return getGnssDataFieldBuilder().getBuilder(index); } /** - * repeated .GNSS_Sample gnss_data = 7; + * repeated .GNSSReading gnss_data = 10; */ - public GNSS_SampleOrBuilder getGnssDataOrBuilder( - int index) { + public com.openpositioning.PositionMe.Traj.GNSSReadingOrBuilder getGnssDataOrBuilder( + int index) { if (gnssDataBuilder_ == null) { return gnssData_.get(index); } else { return gnssDataBuilder_.getMessageOrBuilder(index); } } /** - * repeated .GNSS_Sample gnss_data = 7; + * repeated .GNSSReading gnss_data = 10; */ - public java.util.List - getGnssDataOrBuilderList() { + public java.util.List + getGnssDataOrBuilderList() { if (gnssDataBuilder_ != null) { return gnssDataBuilder_.getMessageOrBuilderList(); } else { @@ -3480,35 +5001,35 @@ public GNSS_SampleOrBuilder getGnssDataOrBuilder( } } /** - * repeated .GNSS_Sample gnss_data = 7; + * repeated .GNSSReading gnss_data = 10; */ - public GNSS_Sample.Builder addGnssDataBuilder() { + public com.openpositioning.PositionMe.Traj.GNSSReading.Builder addGnssDataBuilder() { return getGnssDataFieldBuilder().addBuilder( - GNSS_Sample.getDefaultInstance()); + com.openpositioning.PositionMe.Traj.GNSSReading.getDefaultInstance()); } /** - * repeated .GNSS_Sample gnss_data = 7; + * repeated .GNSSReading gnss_data = 10; */ - public GNSS_Sample.Builder addGnssDataBuilder( - int index) { + public com.openpositioning.PositionMe.Traj.GNSSReading.Builder addGnssDataBuilder( + int index) { return getGnssDataFieldBuilder().addBuilder( - index, GNSS_Sample.getDefaultInstance()); + index, com.openpositioning.PositionMe.Traj.GNSSReading.getDefaultInstance()); } /** - * repeated .GNSS_Sample gnss_data = 7; + * repeated .GNSSReading gnss_data = 10; */ - public java.util.List - getGnssDataBuilderList() { + public java.util.List + getGnssDataBuilderList() { return getGnssDataFieldBuilder().getBuilderList(); } - private com.google.protobuf.RepeatedFieldBuilderV3< - GNSS_Sample, GNSS_Sample.Builder, GNSS_SampleOrBuilder> - getGnssDataFieldBuilder() { + private com.google.protobuf.RepeatedFieldBuilder< + com.openpositioning.PositionMe.Traj.GNSSReading, com.openpositioning.PositionMe.Traj.GNSSReading.Builder, com.openpositioning.PositionMe.Traj.GNSSReadingOrBuilder> + getGnssDataFieldBuilder() { if (gnssDataBuilder_ == null) { - gnssDataBuilder_ = new com.google.protobuf.RepeatedFieldBuilderV3< - GNSS_Sample, GNSS_Sample.Builder, GNSS_SampleOrBuilder>( + gnssDataBuilder_ = new com.google.protobuf.RepeatedFieldBuilder< + com.openpositioning.PositionMe.Traj.GNSSReading, com.openpositioning.PositionMe.Traj.GNSSReading.Builder, com.openpositioning.PositionMe.Traj.GNSSReadingOrBuilder>( gnssData_, - ((bitField0_ & 0x00000040) == 0x00000040), + ((bitField0_ & 0x00000200) != 0), getParentForChildren(), isClean()); gnssData_ = null; @@ -3516,262 +5037,262 @@ public GNSS_Sample.Builder addGnssDataBuilder( return gnssDataBuilder_; } - private java.util.List wifiData_ = - java.util.Collections.emptyList(); - private void ensureWifiDataIsMutable() { - if (!((bitField0_ & 0x00000080) == 0x00000080)) { - wifiData_ = new java.util.ArrayList(wifiData_); - bitField0_ |= 0x00000080; - } + private java.util.List wifiFingerprints_ = + java.util.Collections.emptyList(); + private void ensureWifiFingerprintsIsMutable() { + if (!((bitField0_ & 0x00000400) != 0)) { + wifiFingerprints_ = new java.util.ArrayList(wifiFingerprints_); + bitField0_ |= 0x00000400; + } } - private com.google.protobuf.RepeatedFieldBuilderV3< - WiFi_Sample, WiFi_Sample.Builder, WiFi_SampleOrBuilder> wifiDataBuilder_; + private com.google.protobuf.RepeatedFieldBuilder< + com.openpositioning.PositionMe.Traj.Fingerprint, com.openpositioning.PositionMe.Traj.Fingerprint.Builder, com.openpositioning.PositionMe.Traj.FingerprintOrBuilder> wifiFingerprintsBuilder_; /** - * repeated .WiFi_Sample wifi_data = 8; + * repeated .Fingerprint wifi_fingerprints = 11; */ - public java.util.List getWifiDataList() { - if (wifiDataBuilder_ == null) { - return java.util.Collections.unmodifiableList(wifiData_); + public java.util.List getWifiFingerprintsList() { + if (wifiFingerprintsBuilder_ == null) { + return java.util.Collections.unmodifiableList(wifiFingerprints_); } else { - return wifiDataBuilder_.getMessageList(); + return wifiFingerprintsBuilder_.getMessageList(); } } /** - * repeated .WiFi_Sample wifi_data = 8; + * repeated .Fingerprint wifi_fingerprints = 11; */ - public int getWifiDataCount() { - if (wifiDataBuilder_ == null) { - return wifiData_.size(); + public int getWifiFingerprintsCount() { + if (wifiFingerprintsBuilder_ == null) { + return wifiFingerprints_.size(); } else { - return wifiDataBuilder_.getCount(); + return wifiFingerprintsBuilder_.getCount(); } } /** - * repeated .WiFi_Sample wifi_data = 8; + * repeated .Fingerprint wifi_fingerprints = 11; */ - public WiFi_Sample getWifiData(int index) { - if (wifiDataBuilder_ == null) { - return wifiData_.get(index); + public com.openpositioning.PositionMe.Traj.Fingerprint getWifiFingerprints(int index) { + if (wifiFingerprintsBuilder_ == null) { + return wifiFingerprints_.get(index); } else { - return wifiDataBuilder_.getMessage(index); + return wifiFingerprintsBuilder_.getMessage(index); } } /** - * repeated .WiFi_Sample wifi_data = 8; + * repeated .Fingerprint wifi_fingerprints = 11; */ - public Builder setWifiData( - int index, WiFi_Sample value) { - if (wifiDataBuilder_ == null) { + public Builder setWifiFingerprints( + int index, com.openpositioning.PositionMe.Traj.Fingerprint value) { + if (wifiFingerprintsBuilder_ == null) { if (value == null) { throw new NullPointerException(); } - ensureWifiDataIsMutable(); - wifiData_.set(index, value); + ensureWifiFingerprintsIsMutable(); + wifiFingerprints_.set(index, value); onChanged(); } else { - wifiDataBuilder_.setMessage(index, value); + wifiFingerprintsBuilder_.setMessage(index, value); } return this; } /** - * repeated .WiFi_Sample wifi_data = 8; + * repeated .Fingerprint wifi_fingerprints = 11; */ - public Builder setWifiData( - int index, WiFi_Sample.Builder builderForValue) { - if (wifiDataBuilder_ == null) { - ensureWifiDataIsMutable(); - wifiData_.set(index, builderForValue.build()); + public Builder setWifiFingerprints( + int index, com.openpositioning.PositionMe.Traj.Fingerprint.Builder builderForValue) { + if (wifiFingerprintsBuilder_ == null) { + ensureWifiFingerprintsIsMutable(); + wifiFingerprints_.set(index, builderForValue.build()); onChanged(); } else { - wifiDataBuilder_.setMessage(index, builderForValue.build()); + wifiFingerprintsBuilder_.setMessage(index, builderForValue.build()); } return this; } /** - * repeated .WiFi_Sample wifi_data = 8; + * repeated .Fingerprint wifi_fingerprints = 11; */ - public Builder addWifiData(WiFi_Sample value) { - if (wifiDataBuilder_ == null) { + public Builder addWifiFingerprints(com.openpositioning.PositionMe.Traj.Fingerprint value) { + if (wifiFingerprintsBuilder_ == null) { if (value == null) { throw new NullPointerException(); } - ensureWifiDataIsMutable(); - wifiData_.add(value); + ensureWifiFingerprintsIsMutable(); + wifiFingerprints_.add(value); onChanged(); } else { - wifiDataBuilder_.addMessage(value); + wifiFingerprintsBuilder_.addMessage(value); } return this; } /** - * repeated .WiFi_Sample wifi_data = 8; + * repeated .Fingerprint wifi_fingerprints = 11; */ - public Builder addWifiData( - int index, WiFi_Sample value) { - if (wifiDataBuilder_ == null) { + public Builder addWifiFingerprints( + int index, com.openpositioning.PositionMe.Traj.Fingerprint value) { + if (wifiFingerprintsBuilder_ == null) { if (value == null) { throw new NullPointerException(); } - ensureWifiDataIsMutable(); - wifiData_.add(index, value); + ensureWifiFingerprintsIsMutable(); + wifiFingerprints_.add(index, value); onChanged(); } else { - wifiDataBuilder_.addMessage(index, value); + wifiFingerprintsBuilder_.addMessage(index, value); } return this; } /** - * repeated .WiFi_Sample wifi_data = 8; + * repeated .Fingerprint wifi_fingerprints = 11; */ - public Builder addWifiData( - WiFi_Sample.Builder builderForValue) { - if (wifiDataBuilder_ == null) { - ensureWifiDataIsMutable(); - wifiData_.add(builderForValue.build()); + public Builder addWifiFingerprints( + com.openpositioning.PositionMe.Traj.Fingerprint.Builder builderForValue) { + if (wifiFingerprintsBuilder_ == null) { + ensureWifiFingerprintsIsMutable(); + wifiFingerprints_.add(builderForValue.build()); onChanged(); } else { - wifiDataBuilder_.addMessage(builderForValue.build()); + wifiFingerprintsBuilder_.addMessage(builderForValue.build()); } return this; } /** - * repeated .WiFi_Sample wifi_data = 8; + * repeated .Fingerprint wifi_fingerprints = 11; */ - public Builder addWifiData( - int index, WiFi_Sample.Builder builderForValue) { - if (wifiDataBuilder_ == null) { - ensureWifiDataIsMutable(); - wifiData_.add(index, builderForValue.build()); + public Builder addWifiFingerprints( + int index, com.openpositioning.PositionMe.Traj.Fingerprint.Builder builderForValue) { + if (wifiFingerprintsBuilder_ == null) { + ensureWifiFingerprintsIsMutable(); + wifiFingerprints_.add(index, builderForValue.build()); onChanged(); } else { - wifiDataBuilder_.addMessage(index, builderForValue.build()); + wifiFingerprintsBuilder_.addMessage(index, builderForValue.build()); } return this; } /** - * repeated .WiFi_Sample wifi_data = 8; + * repeated .Fingerprint wifi_fingerprints = 11; */ - public Builder addAllWifiData( - Iterable values) { - if (wifiDataBuilder_ == null) { - ensureWifiDataIsMutable(); + public Builder addAllWifiFingerprints( + java.lang.Iterable values) { + if (wifiFingerprintsBuilder_ == null) { + ensureWifiFingerprintsIsMutable(); com.google.protobuf.AbstractMessageLite.Builder.addAll( - values, wifiData_); + values, wifiFingerprints_); onChanged(); } else { - wifiDataBuilder_.addAllMessages(values); + wifiFingerprintsBuilder_.addAllMessages(values); } return this; } /** - * repeated .WiFi_Sample wifi_data = 8; + * repeated .Fingerprint wifi_fingerprints = 11; */ - public Builder clearWifiData() { - if (wifiDataBuilder_ == null) { - wifiData_ = java.util.Collections.emptyList(); - bitField0_ = (bitField0_ & ~0x00000080); + public Builder clearWifiFingerprints() { + if (wifiFingerprintsBuilder_ == null) { + wifiFingerprints_ = java.util.Collections.emptyList(); + bitField0_ = (bitField0_ & ~0x00000400); onChanged(); } else { - wifiDataBuilder_.clear(); + wifiFingerprintsBuilder_.clear(); } return this; } /** - * repeated .WiFi_Sample wifi_data = 8; + * repeated .Fingerprint wifi_fingerprints = 11; */ - public Builder removeWifiData(int index) { - if (wifiDataBuilder_ == null) { - ensureWifiDataIsMutable(); - wifiData_.remove(index); + public Builder removeWifiFingerprints(int index) { + if (wifiFingerprintsBuilder_ == null) { + ensureWifiFingerprintsIsMutable(); + wifiFingerprints_.remove(index); onChanged(); } else { - wifiDataBuilder_.remove(index); + wifiFingerprintsBuilder_.remove(index); } return this; } /** - * repeated .WiFi_Sample wifi_data = 8; + * repeated .Fingerprint wifi_fingerprints = 11; */ - public WiFi_Sample.Builder getWifiDataBuilder( - int index) { - return getWifiDataFieldBuilder().getBuilder(index); + public com.openpositioning.PositionMe.Traj.Fingerprint.Builder getWifiFingerprintsBuilder( + int index) { + return getWifiFingerprintsFieldBuilder().getBuilder(index); } /** - * repeated .WiFi_Sample wifi_data = 8; + * repeated .Fingerprint wifi_fingerprints = 11; */ - public WiFi_SampleOrBuilder getWifiDataOrBuilder( - int index) { - if (wifiDataBuilder_ == null) { - return wifiData_.get(index); } else { - return wifiDataBuilder_.getMessageOrBuilder(index); + public com.openpositioning.PositionMe.Traj.FingerprintOrBuilder getWifiFingerprintsOrBuilder( + int index) { + if (wifiFingerprintsBuilder_ == null) { + return wifiFingerprints_.get(index); } else { + return wifiFingerprintsBuilder_.getMessageOrBuilder(index); } } /** - * repeated .WiFi_Sample wifi_data = 8; + * repeated .Fingerprint wifi_fingerprints = 11; */ - public java.util.List - getWifiDataOrBuilderList() { - if (wifiDataBuilder_ != null) { - return wifiDataBuilder_.getMessageOrBuilderList(); + public java.util.List + getWifiFingerprintsOrBuilderList() { + if (wifiFingerprintsBuilder_ != null) { + return wifiFingerprintsBuilder_.getMessageOrBuilderList(); } else { - return java.util.Collections.unmodifiableList(wifiData_); + return java.util.Collections.unmodifiableList(wifiFingerprints_); } } /** - * repeated .WiFi_Sample wifi_data = 8; + * repeated .Fingerprint wifi_fingerprints = 11; */ - public WiFi_Sample.Builder addWifiDataBuilder() { - return getWifiDataFieldBuilder().addBuilder( - WiFi_Sample.getDefaultInstance()); + public com.openpositioning.PositionMe.Traj.Fingerprint.Builder addWifiFingerprintsBuilder() { + return getWifiFingerprintsFieldBuilder().addBuilder( + com.openpositioning.PositionMe.Traj.Fingerprint.getDefaultInstance()); } /** - * repeated .WiFi_Sample wifi_data = 8; + * repeated .Fingerprint wifi_fingerprints = 11; */ - public WiFi_Sample.Builder addWifiDataBuilder( - int index) { - return getWifiDataFieldBuilder().addBuilder( - index, WiFi_Sample.getDefaultInstance()); + public com.openpositioning.PositionMe.Traj.Fingerprint.Builder addWifiFingerprintsBuilder( + int index) { + return getWifiFingerprintsFieldBuilder().addBuilder( + index, com.openpositioning.PositionMe.Traj.Fingerprint.getDefaultInstance()); } /** - * repeated .WiFi_Sample wifi_data = 8; + * repeated .Fingerprint wifi_fingerprints = 11; */ - public java.util.List - getWifiDataBuilderList() { - return getWifiDataFieldBuilder().getBuilderList(); + public java.util.List + getWifiFingerprintsBuilderList() { + return getWifiFingerprintsFieldBuilder().getBuilderList(); } - private com.google.protobuf.RepeatedFieldBuilderV3< - WiFi_Sample, WiFi_Sample.Builder, WiFi_SampleOrBuilder> - getWifiDataFieldBuilder() { - if (wifiDataBuilder_ == null) { - wifiDataBuilder_ = new com.google.protobuf.RepeatedFieldBuilderV3< - WiFi_Sample, WiFi_Sample.Builder, WiFi_SampleOrBuilder>( - wifiData_, - ((bitField0_ & 0x00000080) == 0x00000080), + private com.google.protobuf.RepeatedFieldBuilder< + com.openpositioning.PositionMe.Traj.Fingerprint, com.openpositioning.PositionMe.Traj.Fingerprint.Builder, com.openpositioning.PositionMe.Traj.FingerprintOrBuilder> + getWifiFingerprintsFieldBuilder() { + if (wifiFingerprintsBuilder_ == null) { + wifiFingerprintsBuilder_ = new com.google.protobuf.RepeatedFieldBuilder< + com.openpositioning.PositionMe.Traj.Fingerprint, com.openpositioning.PositionMe.Traj.Fingerprint.Builder, com.openpositioning.PositionMe.Traj.FingerprintOrBuilder>( + wifiFingerprints_, + ((bitField0_ & 0x00000400) != 0), getParentForChildren(), isClean()); - wifiData_ = null; + wifiFingerprints_ = null; } - return wifiDataBuilder_; + return wifiFingerprintsBuilder_; } - private java.util.List apsData_ = - java.util.Collections.emptyList(); + private java.util.List apsData_ = + java.util.Collections.emptyList(); private void ensureApsDataIsMutable() { - if (!((bitField0_ & 0x00000100) == 0x00000100)) { - apsData_ = new java.util.ArrayList(apsData_); - bitField0_ |= 0x00000100; - } + if (!((bitField0_ & 0x00000800) != 0)) { + apsData_ = new java.util.ArrayList(apsData_); + bitField0_ |= 0x00000800; + } } - private com.google.protobuf.RepeatedFieldBuilderV3< - AP_Data, AP_Data.Builder, AP_DataOrBuilder> apsDataBuilder_; + private com.google.protobuf.RepeatedFieldBuilder< + com.openpositioning.PositionMe.Traj.WiFiAPData, com.openpositioning.PositionMe.Traj.WiFiAPData.Builder, com.openpositioning.PositionMe.Traj.WiFiAPDataOrBuilder> apsDataBuilder_; /** - * repeated .AP_Data aps_data = 9; + * repeated .WiFiAPData aps_data = 12; */ - public java.util.List getApsDataList() { + public java.util.List getApsDataList() { if (apsDataBuilder_ == null) { return java.util.Collections.unmodifiableList(apsData_); } else { @@ -3779,7 +5300,7 @@ public java.util.List getApsDataList() { } } /** - * repeated .AP_Data aps_data = 9; + * repeated .WiFiAPData aps_data = 12; */ public int getApsDataCount() { if (apsDataBuilder_ == null) { @@ -3789,9 +5310,9 @@ public int getApsDataCount() { } } /** - * repeated .AP_Data aps_data = 9; + * repeated .WiFiAPData aps_data = 12; */ - public AP_Data getApsData(int index) { + public com.openpositioning.PositionMe.Traj.WiFiAPData getApsData(int index) { if (apsDataBuilder_ == null) { return apsData_.get(index); } else { @@ -3799,10 +5320,10 @@ public AP_Data getApsData(int index) { } } /** - * repeated .AP_Data aps_data = 9; + * repeated .WiFiAPData aps_data = 12; */ public Builder setApsData( - int index, AP_Data value) { + int index, com.openpositioning.PositionMe.Traj.WiFiAPData value) { if (apsDataBuilder_ == null) { if (value == null) { throw new NullPointerException(); @@ -3816,10 +5337,10 @@ public Builder setApsData( return this; } /** - * repeated .AP_Data aps_data = 9; + * repeated .WiFiAPData aps_data = 12; */ public Builder setApsData( - int index, AP_Data.Builder builderForValue) { + int index, com.openpositioning.PositionMe.Traj.WiFiAPData.Builder builderForValue) { if (apsDataBuilder_ == null) { ensureApsDataIsMutable(); apsData_.set(index, builderForValue.build()); @@ -3830,9 +5351,9 @@ public Builder setApsData( return this; } /** - * repeated .AP_Data aps_data = 9; + * repeated .WiFiAPData aps_data = 12; */ - public Builder addApsData(AP_Data value) { + public Builder addApsData(com.openpositioning.PositionMe.Traj.WiFiAPData value) { if (apsDataBuilder_ == null) { if (value == null) { throw new NullPointerException(); @@ -3846,10 +5367,10 @@ public Builder addApsData(AP_Data value) { return this; } /** - * repeated .AP_Data aps_data = 9; + * repeated .WiFiAPData aps_data = 12; */ public Builder addApsData( - int index, AP_Data value) { + int index, com.openpositioning.PositionMe.Traj.WiFiAPData value) { if (apsDataBuilder_ == null) { if (value == null) { throw new NullPointerException(); @@ -3863,10 +5384,10 @@ public Builder addApsData( return this; } /** - * repeated .AP_Data aps_data = 9; + * repeated .WiFiAPData aps_data = 12; */ public Builder addApsData( - AP_Data.Builder builderForValue) { + com.openpositioning.PositionMe.Traj.WiFiAPData.Builder builderForValue) { if (apsDataBuilder_ == null) { ensureApsDataIsMutable(); apsData_.add(builderForValue.build()); @@ -3877,10 +5398,10 @@ public Builder addApsData( return this; } /** - * repeated .AP_Data aps_data = 9; + * repeated .WiFiAPData aps_data = 12; */ public Builder addApsData( - int index, AP_Data.Builder builderForValue) { + int index, com.openpositioning.PositionMe.Traj.WiFiAPData.Builder builderForValue) { if (apsDataBuilder_ == null) { ensureApsDataIsMutable(); apsData_.add(index, builderForValue.build()); @@ -3891,14 +5412,14 @@ public Builder addApsData( return this; } /** - * repeated .AP_Data aps_data = 9; + * repeated .WiFiAPData aps_data = 12; */ public Builder addAllApsData( - Iterable values) { + java.lang.Iterable values) { if (apsDataBuilder_ == null) { ensureApsDataIsMutable(); com.google.protobuf.AbstractMessageLite.Builder.addAll( - values, apsData_); + values, apsData_); onChanged(); } else { apsDataBuilder_.addAllMessages(values); @@ -3906,12 +5427,12 @@ public Builder addAllApsData( return this; } /** - * repeated .AP_Data aps_data = 9; + * repeated .WiFiAPData aps_data = 12; */ public Builder clearApsData() { if (apsDataBuilder_ == null) { apsData_ = java.util.Collections.emptyList(); - bitField0_ = (bitField0_ & ~0x00000100); + bitField0_ = (bitField0_ & ~0x00000800); onChanged(); } else { apsDataBuilder_.clear(); @@ -3919,7 +5440,7 @@ public Builder clearApsData() { return this; } /** - * repeated .AP_Data aps_data = 9; + * repeated .WiFiAPData aps_data = 12; */ public Builder removeApsData(int index) { if (apsDataBuilder_ == null) { @@ -3932,27 +5453,27 @@ public Builder removeApsData(int index) { return this; } /** - * repeated .AP_Data aps_data = 9; + * repeated .WiFiAPData aps_data = 12; */ - public AP_Data.Builder getApsDataBuilder( - int index) { + public com.openpositioning.PositionMe.Traj.WiFiAPData.Builder getApsDataBuilder( + int index) { return getApsDataFieldBuilder().getBuilder(index); } /** - * repeated .AP_Data aps_data = 9; + * repeated .WiFiAPData aps_data = 12; */ - public AP_DataOrBuilder getApsDataOrBuilder( - int index) { + public com.openpositioning.PositionMe.Traj.WiFiAPDataOrBuilder getApsDataOrBuilder( + int index) { if (apsDataBuilder_ == null) { return apsData_.get(index); } else { return apsDataBuilder_.getMessageOrBuilder(index); } } /** - * repeated .AP_Data aps_data = 9; + * repeated .WiFiAPData aps_data = 12; */ - public java.util.List - getApsDataOrBuilderList() { + public java.util.List + getApsDataOrBuilderList() { if (apsDataBuilder_ != null) { return apsDataBuilder_.getMessageOrBuilderList(); } else { @@ -3960,35 +5481,35 @@ public AP_DataOrBuilder getApsDataOrBuilder( } } /** - * repeated .AP_Data aps_data = 9; + * repeated .WiFiAPData aps_data = 12; */ - public AP_Data.Builder addApsDataBuilder() { + public com.openpositioning.PositionMe.Traj.WiFiAPData.Builder addApsDataBuilder() { return getApsDataFieldBuilder().addBuilder( - AP_Data.getDefaultInstance()); + com.openpositioning.PositionMe.Traj.WiFiAPData.getDefaultInstance()); } /** - * repeated .AP_Data aps_data = 9; + * repeated .WiFiAPData aps_data = 12; */ - public AP_Data.Builder addApsDataBuilder( - int index) { + public com.openpositioning.PositionMe.Traj.WiFiAPData.Builder addApsDataBuilder( + int index) { return getApsDataFieldBuilder().addBuilder( - index, AP_Data.getDefaultInstance()); + index, com.openpositioning.PositionMe.Traj.WiFiAPData.getDefaultInstance()); } /** - * repeated .AP_Data aps_data = 9; + * repeated .WiFiAPData aps_data = 12; */ - public java.util.List - getApsDataBuilderList() { + public java.util.List + getApsDataBuilderList() { return getApsDataFieldBuilder().getBuilderList(); } - private com.google.protobuf.RepeatedFieldBuilderV3< - AP_Data, AP_Data.Builder, AP_DataOrBuilder> - getApsDataFieldBuilder() { + private com.google.protobuf.RepeatedFieldBuilder< + com.openpositioning.PositionMe.Traj.WiFiAPData, com.openpositioning.PositionMe.Traj.WiFiAPData.Builder, com.openpositioning.PositionMe.Traj.WiFiAPDataOrBuilder> + getApsDataFieldBuilder() { if (apsDataBuilder_ == null) { - apsDataBuilder_ = new com.google.protobuf.RepeatedFieldBuilderV3< - AP_Data, AP_Data.Builder, AP_DataOrBuilder>( + apsDataBuilder_ = new com.google.protobuf.RepeatedFieldBuilder< + com.openpositioning.PositionMe.Traj.WiFiAPData, com.openpositioning.PositionMe.Traj.WiFiAPData.Builder, com.openpositioning.PositionMe.Traj.WiFiAPDataOrBuilder>( apsData_, - ((bitField0_ & 0x00000100) == 0x00000100), + ((bitField0_ & 0x00000800) != 0), getParentForChildren(), isClean()); apsData_ = null; @@ -3996,1028 +5517,6772 @@ public AP_Data.Builder addApsDataBuilder( return apsDataBuilder_; } - private long startTimestamp_ ; + private java.util.List wifiRttData_ = + java.util.Collections.emptyList(); + private void ensureWifiRttDataIsMutable() { + if (!((bitField0_ & 0x00001000) != 0)) { + wifiRttData_ = new java.util.ArrayList(wifiRttData_); + bitField0_ |= 0x00001000; + } + } + + private com.google.protobuf.RepeatedFieldBuilder< + com.openpositioning.PositionMe.Traj.WiFiRTTReading, com.openpositioning.PositionMe.Traj.WiFiRTTReading.Builder, com.openpositioning.PositionMe.Traj.WiFiRTTReadingOrBuilder> wifiRttDataBuilder_; + /** - *
-       * UNIX timestamp (in milliseconds) recorded from the start of this
-       * trajectory data collection event. All future
-       * timestamps in sub classes are to be RELATIVE timestamps
-       * (in milliseconds) to this start time.
-       * E.g.
-       * start_timestamp = 1674819807315 (UTC 27 Jan 2023 in the morning)
-       * relative_timestamp = 3000 (3s)
-       * 
- * - * optional int64 start_timestamp = 10; - */ - public long getStartTimestamp() { - return startTimestamp_; - } - /** - *
-       * UNIX timestamp (in milliseconds) recorded from the start of this
-       * trajectory data collection event. All future
-       * timestamps in sub classes are to be RELATIVE timestamps
-       * (in milliseconds) to this start time.
-       * E.g.
-       * start_timestamp = 1674819807315 (UTC 27 Jan 2023 in the morning)
-       * relative_timestamp = 3000 (3s)
-       * 
- * - * optional int64 start_timestamp = 10; - */ - public Builder setStartTimestamp(long value) { - - startTimestamp_ = value; - onChanged(); - return this; - } - /** - *
-       * UNIX timestamp (in milliseconds) recorded from the start of this
-       * trajectory data collection event. All future
-       * timestamps in sub classes are to be RELATIVE timestamps
-       * (in milliseconds) to this start time.
-       * E.g.
-       * start_timestamp = 1674819807315 (UTC 27 Jan 2023 in the morning)
-       * relative_timestamp = 3000 (3s)
-       * 
- * - * optional int64 start_timestamp = 10; + * repeated .WiFiRTTReading wifi_rtt_data = 13; */ - public Builder clearStartTimestamp() { - - startTimestamp_ = 0L; - onChanged(); - return this; + public java.util.List getWifiRttDataList() { + if (wifiRttDataBuilder_ == null) { + return java.util.Collections.unmodifiableList(wifiRttData_); + } else { + return wifiRttDataBuilder_.getMessageList(); + } } - - private Object dataIdentifier_ = ""; /** - * optional string data_identifier = 11; + * repeated .WiFiRTTReading wifi_rtt_data = 13; */ - public String getDataIdentifier() { - Object ref = dataIdentifier_; - if (!(ref instanceof String)) { - com.google.protobuf.ByteString bs = - (com.google.protobuf.ByteString) ref; - String s = bs.toStringUtf8(); - dataIdentifier_ = s; - return s; + public int getWifiRttDataCount() { + if (wifiRttDataBuilder_ == null) { + return wifiRttData_.size(); } else { - return (String) ref; + return wifiRttDataBuilder_.getCount(); } } /** - * optional string data_identifier = 11; + * repeated .WiFiRTTReading wifi_rtt_data = 13; */ - public com.google.protobuf.ByteString - getDataIdentifierBytes() { - Object ref = dataIdentifier_; - if (ref instanceof String) { - com.google.protobuf.ByteString b = - com.google.protobuf.ByteString.copyFromUtf8( - (String) ref); - dataIdentifier_ = b; - return b; + public com.openpositioning.PositionMe.Traj.WiFiRTTReading getWifiRttData(int index) { + if (wifiRttDataBuilder_ == null) { + return wifiRttData_.get(index); } else { - return (com.google.protobuf.ByteString) ref; + return wifiRttDataBuilder_.getMessage(index); } } /** - * optional string data_identifier = 11; + * repeated .WiFiRTTReading wifi_rtt_data = 13; */ - public Builder setDataIdentifier( - String value) { - if (value == null) { - throw new NullPointerException(); - } - - dataIdentifier_ = value; - onChanged(); + public Builder setWifiRttData( + int index, com.openpositioning.PositionMe.Traj.WiFiRTTReading value) { + if (wifiRttDataBuilder_ == null) { + if (value == null) { + throw new NullPointerException(); + } + ensureWifiRttDataIsMutable(); + wifiRttData_.set(index, value); + onChanged(); + } else { + wifiRttDataBuilder_.setMessage(index, value); + } return this; } /** - * optional string data_identifier = 11; + * repeated .WiFiRTTReading wifi_rtt_data = 13; */ - public Builder clearDataIdentifier() { - - dataIdentifier_ = getDefaultInstance().getDataIdentifier(); - onChanged(); + public Builder setWifiRttData( + int index, com.openpositioning.PositionMe.Traj.WiFiRTTReading.Builder builderForValue) { + if (wifiRttDataBuilder_ == null) { + ensureWifiRttDataIsMutable(); + wifiRttData_.set(index, builderForValue.build()); + onChanged(); + } else { + wifiRttDataBuilder_.setMessage(index, builderForValue.build()); + } return this; } /** - * optional string data_identifier = 11; + * repeated .WiFiRTTReading wifi_rtt_data = 13; */ - public Builder setDataIdentifierBytes( - com.google.protobuf.ByteString value) { - if (value == null) { - throw new NullPointerException(); - } - checkByteStringIsUtf8(value); - - dataIdentifier_ = value; - onChanged(); + public Builder addWifiRttData(com.openpositioning.PositionMe.Traj.WiFiRTTReading value) { + if (wifiRttDataBuilder_ == null) { + if (value == null) { + throw new NullPointerException(); + } + ensureWifiRttDataIsMutable(); + wifiRttData_.add(value); + onChanged(); + } else { + wifiRttDataBuilder_.addMessage(value); + } return this; } - - private Sensor_Info accelerometerInfo_ = null; - private com.google.protobuf.SingleFieldBuilderV3< - Sensor_Info, Sensor_Info.Builder, Sensor_InfoOrBuilder> accelerometerInfoBuilder_; /** - * optional .Sensor_Info accelerometer_info = 12; + * repeated .WiFiRTTReading wifi_rtt_data = 13; */ - public boolean hasAccelerometerInfo() { - return accelerometerInfoBuilder_ != null || accelerometerInfo_ != null; + public Builder addWifiRttData( + int index, com.openpositioning.PositionMe.Traj.WiFiRTTReading value) { + if (wifiRttDataBuilder_ == null) { + if (value == null) { + throw new NullPointerException(); + } + ensureWifiRttDataIsMutable(); + wifiRttData_.add(index, value); + onChanged(); + } else { + wifiRttDataBuilder_.addMessage(index, value); + } + return this; } /** - * optional .Sensor_Info accelerometer_info = 12; + * repeated .WiFiRTTReading wifi_rtt_data = 13; */ - public Sensor_Info getAccelerometerInfo() { - if (accelerometerInfoBuilder_ == null) { - return accelerometerInfo_ == null ? Sensor_Info.getDefaultInstance() : accelerometerInfo_; + public Builder addWifiRttData( + com.openpositioning.PositionMe.Traj.WiFiRTTReading.Builder builderForValue) { + if (wifiRttDataBuilder_ == null) { + ensureWifiRttDataIsMutable(); + wifiRttData_.add(builderForValue.build()); + onChanged(); } else { - return accelerometerInfoBuilder_.getMessage(); + wifiRttDataBuilder_.addMessage(builderForValue.build()); } + return this; } /** - * optional .Sensor_Info accelerometer_info = 12; + * repeated .WiFiRTTReading wifi_rtt_data = 13; */ - public Builder setAccelerometerInfo(Sensor_Info value) { - if (accelerometerInfoBuilder_ == null) { - if (value == null) { - throw new NullPointerException(); - } - accelerometerInfo_ = value; + public Builder addWifiRttData( + int index, com.openpositioning.PositionMe.Traj.WiFiRTTReading.Builder builderForValue) { + if (wifiRttDataBuilder_ == null) { + ensureWifiRttDataIsMutable(); + wifiRttData_.add(index, builderForValue.build()); onChanged(); } else { - accelerometerInfoBuilder_.setMessage(value); + wifiRttDataBuilder_.addMessage(index, builderForValue.build()); } - return this; } /** - * optional .Sensor_Info accelerometer_info = 12; + * repeated .WiFiRTTReading wifi_rtt_data = 13; */ - public Builder setAccelerometerInfo( - Sensor_Info.Builder builderForValue) { - if (accelerometerInfoBuilder_ == null) { - accelerometerInfo_ = builderForValue.build(); + public Builder addAllWifiRttData( + java.lang.Iterable values) { + if (wifiRttDataBuilder_ == null) { + ensureWifiRttDataIsMutable(); + com.google.protobuf.AbstractMessageLite.Builder.addAll( + values, wifiRttData_); onChanged(); } else { - accelerometerInfoBuilder_.setMessage(builderForValue.build()); + wifiRttDataBuilder_.addAllMessages(values); } - return this; } /** - * optional .Sensor_Info accelerometer_info = 12; + * repeated .WiFiRTTReading wifi_rtt_data = 13; */ - public Builder mergeAccelerometerInfo(Sensor_Info value) { - if (accelerometerInfoBuilder_ == null) { - if (accelerometerInfo_ != null) { - accelerometerInfo_ = - Sensor_Info.newBuilder(accelerometerInfo_).mergeFrom(value).buildPartial(); - } else { - accelerometerInfo_ = value; - } + public Builder clearWifiRttData() { + if (wifiRttDataBuilder_ == null) { + wifiRttData_ = java.util.Collections.emptyList(); + bitField0_ = (bitField0_ & ~0x00001000); onChanged(); } else { - accelerometerInfoBuilder_.mergeFrom(value); + wifiRttDataBuilder_.clear(); } - return this; } /** - * optional .Sensor_Info accelerometer_info = 12; + * repeated .WiFiRTTReading wifi_rtt_data = 13; */ - public Builder clearAccelerometerInfo() { - if (accelerometerInfoBuilder_ == null) { - accelerometerInfo_ = null; + public Builder removeWifiRttData(int index) { + if (wifiRttDataBuilder_ == null) { + ensureWifiRttDataIsMutable(); + wifiRttData_.remove(index); onChanged(); } else { - accelerometerInfo_ = null; - accelerometerInfoBuilder_ = null; + wifiRttDataBuilder_.remove(index); } - return this; } /** - * optional .Sensor_Info accelerometer_info = 12; + * repeated .WiFiRTTReading wifi_rtt_data = 13; */ - public Sensor_Info.Builder getAccelerometerInfoBuilder() { - - onChanged(); - return getAccelerometerInfoFieldBuilder().getBuilder(); + public com.openpositioning.PositionMe.Traj.WiFiRTTReading.Builder getWifiRttDataBuilder( + int index) { + return getWifiRttDataFieldBuilder().getBuilder(index); } /** - * optional .Sensor_Info accelerometer_info = 12; + * repeated .WiFiRTTReading wifi_rtt_data = 13; */ - public Sensor_InfoOrBuilder getAccelerometerInfoOrBuilder() { - if (accelerometerInfoBuilder_ != null) { - return accelerometerInfoBuilder_.getMessageOrBuilder(); + public com.openpositioning.PositionMe.Traj.WiFiRTTReadingOrBuilder getWifiRttDataOrBuilder( + int index) { + if (wifiRttDataBuilder_ == null) { + return wifiRttData_.get(index); } else { + return wifiRttDataBuilder_.getMessageOrBuilder(index); + } + } + /** + * repeated .WiFiRTTReading wifi_rtt_data = 13; + */ + public java.util.List + getWifiRttDataOrBuilderList() { + if (wifiRttDataBuilder_ != null) { + return wifiRttDataBuilder_.getMessageOrBuilderList(); } else { - return accelerometerInfo_ == null ? - Sensor_Info.getDefaultInstance() : accelerometerInfo_; + return java.util.Collections.unmodifiableList(wifiRttData_); } } /** - * optional .Sensor_Info accelerometer_info = 12; + * repeated .WiFiRTTReading wifi_rtt_data = 13; */ - private com.google.protobuf.SingleFieldBuilderV3< - Sensor_Info, Sensor_Info.Builder, Sensor_InfoOrBuilder> - getAccelerometerInfoFieldBuilder() { - if (accelerometerInfoBuilder_ == null) { - accelerometerInfoBuilder_ = new com.google.protobuf.SingleFieldBuilderV3< - Sensor_Info, Sensor_Info.Builder, Sensor_InfoOrBuilder>( - getAccelerometerInfo(), + public com.openpositioning.PositionMe.Traj.WiFiRTTReading.Builder addWifiRttDataBuilder() { + return getWifiRttDataFieldBuilder().addBuilder( + com.openpositioning.PositionMe.Traj.WiFiRTTReading.getDefaultInstance()); + } + /** + * repeated .WiFiRTTReading wifi_rtt_data = 13; + */ + public com.openpositioning.PositionMe.Traj.WiFiRTTReading.Builder addWifiRttDataBuilder( + int index) { + return getWifiRttDataFieldBuilder().addBuilder( + index, com.openpositioning.PositionMe.Traj.WiFiRTTReading.getDefaultInstance()); + } + /** + * repeated .WiFiRTTReading wifi_rtt_data = 13; + */ + public java.util.List + getWifiRttDataBuilderList() { + return getWifiRttDataFieldBuilder().getBuilderList(); + } + private com.google.protobuf.RepeatedFieldBuilder< + com.openpositioning.PositionMe.Traj.WiFiRTTReading, com.openpositioning.PositionMe.Traj.WiFiRTTReading.Builder, com.openpositioning.PositionMe.Traj.WiFiRTTReadingOrBuilder> + getWifiRttDataFieldBuilder() { + if (wifiRttDataBuilder_ == null) { + wifiRttDataBuilder_ = new com.google.protobuf.RepeatedFieldBuilder< + com.openpositioning.PositionMe.Traj.WiFiRTTReading, com.openpositioning.PositionMe.Traj.WiFiRTTReading.Builder, com.openpositioning.PositionMe.Traj.WiFiRTTReadingOrBuilder>( + wifiRttData_, + ((bitField0_ & 0x00001000) != 0), getParentForChildren(), isClean()); - accelerometerInfo_ = null; + wifiRttData_ = null; + } + return wifiRttDataBuilder_; + } + + private java.util.List bleFingerprints_ = + java.util.Collections.emptyList(); + private void ensureBleFingerprintsIsMutable() { + if (!((bitField0_ & 0x00002000) != 0)) { + bleFingerprints_ = new java.util.ArrayList(bleFingerprints_); + bitField0_ |= 0x00002000; } - return accelerometerInfoBuilder_; } - private Sensor_Info gyroscopeInfo_ = null; - private com.google.protobuf.SingleFieldBuilderV3< - Sensor_Info, Sensor_Info.Builder, Sensor_InfoOrBuilder> gyroscopeInfoBuilder_; + private com.google.protobuf.RepeatedFieldBuilder< + com.openpositioning.PositionMe.Traj.Fingerprint, com.openpositioning.PositionMe.Traj.Fingerprint.Builder, com.openpositioning.PositionMe.Traj.FingerprintOrBuilder> bleFingerprintsBuilder_; + /** - * optional .Sensor_Info gyroscope_info = 13; + * repeated .Fingerprint ble_fingerprints = 14; */ - public boolean hasGyroscopeInfo() { - return gyroscopeInfoBuilder_ != null || gyroscopeInfo_ != null; + public java.util.List getBleFingerprintsList() { + if (bleFingerprintsBuilder_ == null) { + return java.util.Collections.unmodifiableList(bleFingerprints_); + } else { + return bleFingerprintsBuilder_.getMessageList(); + } } /** - * optional .Sensor_Info gyroscope_info = 13; + * repeated .Fingerprint ble_fingerprints = 14; */ - public Sensor_Info getGyroscopeInfo() { - if (gyroscopeInfoBuilder_ == null) { - return gyroscopeInfo_ == null ? Sensor_Info.getDefaultInstance() : gyroscopeInfo_; + public int getBleFingerprintsCount() { + if (bleFingerprintsBuilder_ == null) { + return bleFingerprints_.size(); } else { - return gyroscopeInfoBuilder_.getMessage(); + return bleFingerprintsBuilder_.getCount(); } } /** - * optional .Sensor_Info gyroscope_info = 13; + * repeated .Fingerprint ble_fingerprints = 14; */ - public Builder setGyroscopeInfo(Sensor_Info value) { - if (gyroscopeInfoBuilder_ == null) { + public com.openpositioning.PositionMe.Traj.Fingerprint getBleFingerprints(int index) { + if (bleFingerprintsBuilder_ == null) { + return bleFingerprints_.get(index); + } else { + return bleFingerprintsBuilder_.getMessage(index); + } + } + /** + * repeated .Fingerprint ble_fingerprints = 14; + */ + public Builder setBleFingerprints( + int index, com.openpositioning.PositionMe.Traj.Fingerprint value) { + if (bleFingerprintsBuilder_ == null) { if (value == null) { throw new NullPointerException(); } - gyroscopeInfo_ = value; + ensureBleFingerprintsIsMutable(); + bleFingerprints_.set(index, value); onChanged(); } else { - gyroscopeInfoBuilder_.setMessage(value); + bleFingerprintsBuilder_.setMessage(index, value); } - return this; } /** - * optional .Sensor_Info gyroscope_info = 13; + * repeated .Fingerprint ble_fingerprints = 14; */ - public Builder setGyroscopeInfo( - Sensor_Info.Builder builderForValue) { - if (gyroscopeInfoBuilder_ == null) { - gyroscopeInfo_ = builderForValue.build(); + public Builder setBleFingerprints( + int index, com.openpositioning.PositionMe.Traj.Fingerprint.Builder builderForValue) { + if (bleFingerprintsBuilder_ == null) { + ensureBleFingerprintsIsMutable(); + bleFingerprints_.set(index, builderForValue.build()); onChanged(); } else { - gyroscopeInfoBuilder_.setMessage(builderForValue.build()); + bleFingerprintsBuilder_.setMessage(index, builderForValue.build()); } - return this; } /** - * optional .Sensor_Info gyroscope_info = 13; + * repeated .Fingerprint ble_fingerprints = 14; */ - public Builder mergeGyroscopeInfo(Sensor_Info value) { - if (gyroscopeInfoBuilder_ == null) { - if (gyroscopeInfo_ != null) { - gyroscopeInfo_ = - Sensor_Info.newBuilder(gyroscopeInfo_).mergeFrom(value).buildPartial(); - } else { - gyroscopeInfo_ = value; + public Builder addBleFingerprints(com.openpositioning.PositionMe.Traj.Fingerprint value) { + if (bleFingerprintsBuilder_ == null) { + if (value == null) { + throw new NullPointerException(); } + ensureBleFingerprintsIsMutable(); + bleFingerprints_.add(value); onChanged(); } else { - gyroscopeInfoBuilder_.mergeFrom(value); + bleFingerprintsBuilder_.addMessage(value); } - return this; } /** - * optional .Sensor_Info gyroscope_info = 13; + * repeated .Fingerprint ble_fingerprints = 14; */ - public Builder clearGyroscopeInfo() { - if (gyroscopeInfoBuilder_ == null) { - gyroscopeInfo_ = null; + public Builder addBleFingerprints( + int index, com.openpositioning.PositionMe.Traj.Fingerprint value) { + if (bleFingerprintsBuilder_ == null) { + if (value == null) { + throw new NullPointerException(); + } + ensureBleFingerprintsIsMutable(); + bleFingerprints_.add(index, value); onChanged(); } else { - gyroscopeInfo_ = null; - gyroscopeInfoBuilder_ = null; + bleFingerprintsBuilder_.addMessage(index, value); } - return this; } /** - * optional .Sensor_Info gyroscope_info = 13; - */ - public Sensor_Info.Builder getGyroscopeInfoBuilder() { - - onChanged(); - return getGyroscopeInfoFieldBuilder().getBuilder(); - } - /** - * optional .Sensor_Info gyroscope_info = 13; + * repeated .Fingerprint ble_fingerprints = 14; */ - public Sensor_InfoOrBuilder getGyroscopeInfoOrBuilder() { - if (gyroscopeInfoBuilder_ != null) { - return gyroscopeInfoBuilder_.getMessageOrBuilder(); + public Builder addBleFingerprints( + com.openpositioning.PositionMe.Traj.Fingerprint.Builder builderForValue) { + if (bleFingerprintsBuilder_ == null) { + ensureBleFingerprintsIsMutable(); + bleFingerprints_.add(builderForValue.build()); + onChanged(); } else { - return gyroscopeInfo_ == null ? - Sensor_Info.getDefaultInstance() : gyroscopeInfo_; + bleFingerprintsBuilder_.addMessage(builderForValue.build()); } + return this; } /** - * optional .Sensor_Info gyroscope_info = 13; + * repeated .Fingerprint ble_fingerprints = 14; */ - private com.google.protobuf.SingleFieldBuilderV3< - Sensor_Info, Sensor_Info.Builder, Sensor_InfoOrBuilder> - getGyroscopeInfoFieldBuilder() { - if (gyroscopeInfoBuilder_ == null) { - gyroscopeInfoBuilder_ = new com.google.protobuf.SingleFieldBuilderV3< - Sensor_Info, Sensor_Info.Builder, Sensor_InfoOrBuilder>( - getGyroscopeInfo(), - getParentForChildren(), - isClean()); - gyroscopeInfo_ = null; + public Builder addBleFingerprints( + int index, com.openpositioning.PositionMe.Traj.Fingerprint.Builder builderForValue) { + if (bleFingerprintsBuilder_ == null) { + ensureBleFingerprintsIsMutable(); + bleFingerprints_.add(index, builderForValue.build()); + onChanged(); + } else { + bleFingerprintsBuilder_.addMessage(index, builderForValue.build()); } - return gyroscopeInfoBuilder_; - } - - private Sensor_Info rotationVectorInfo_ = null; - private com.google.protobuf.SingleFieldBuilderV3< - Sensor_Info, Sensor_Info.Builder, Sensor_InfoOrBuilder> rotationVectorInfoBuilder_; - /** - * optional .Sensor_Info rotation_vector_info = 14; - */ - public boolean hasRotationVectorInfo() { - return rotationVectorInfoBuilder_ != null || rotationVectorInfo_ != null; + return this; } /** - * optional .Sensor_Info rotation_vector_info = 14; + * repeated .Fingerprint ble_fingerprints = 14; */ - public Sensor_Info getRotationVectorInfo() { - if (rotationVectorInfoBuilder_ == null) { - return rotationVectorInfo_ == null ? Sensor_Info.getDefaultInstance() : rotationVectorInfo_; + public Builder addAllBleFingerprints( + java.lang.Iterable values) { + if (bleFingerprintsBuilder_ == null) { + ensureBleFingerprintsIsMutable(); + com.google.protobuf.AbstractMessageLite.Builder.addAll( + values, bleFingerprints_); + onChanged(); } else { - return rotationVectorInfoBuilder_.getMessage(); + bleFingerprintsBuilder_.addAllMessages(values); } + return this; } /** - * optional .Sensor_Info rotation_vector_info = 14; + * repeated .Fingerprint ble_fingerprints = 14; */ - public Builder setRotationVectorInfo(Sensor_Info value) { - if (rotationVectorInfoBuilder_ == null) { - if (value == null) { - throw new NullPointerException(); - } - rotationVectorInfo_ = value; + public Builder clearBleFingerprints() { + if (bleFingerprintsBuilder_ == null) { + bleFingerprints_ = java.util.Collections.emptyList(); + bitField0_ = (bitField0_ & ~0x00002000); onChanged(); } else { - rotationVectorInfoBuilder_.setMessage(value); + bleFingerprintsBuilder_.clear(); } - return this; } /** - * optional .Sensor_Info rotation_vector_info = 14; + * repeated .Fingerprint ble_fingerprints = 14; */ - public Builder setRotationVectorInfo( - Sensor_Info.Builder builderForValue) { - if (rotationVectorInfoBuilder_ == null) { - rotationVectorInfo_ = builderForValue.build(); + public Builder removeBleFingerprints(int index) { + if (bleFingerprintsBuilder_ == null) { + ensureBleFingerprintsIsMutable(); + bleFingerprints_.remove(index); onChanged(); } else { - rotationVectorInfoBuilder_.setMessage(builderForValue.build()); + bleFingerprintsBuilder_.remove(index); } - return this; } /** - * optional .Sensor_Info rotation_vector_info = 14; + * repeated .Fingerprint ble_fingerprints = 14; */ - public Builder mergeRotationVectorInfo(Sensor_Info value) { - if (rotationVectorInfoBuilder_ == null) { - if (rotationVectorInfo_ != null) { - rotationVectorInfo_ = - Sensor_Info.newBuilder(rotationVectorInfo_).mergeFrom(value).buildPartial(); - } else { - rotationVectorInfo_ = value; - } - onChanged(); - } else { - rotationVectorInfoBuilder_.mergeFrom(value); + public com.openpositioning.PositionMe.Traj.Fingerprint.Builder getBleFingerprintsBuilder( + int index) { + return getBleFingerprintsFieldBuilder().getBuilder(index); + } + /** + * repeated .Fingerprint ble_fingerprints = 14; + */ + public com.openpositioning.PositionMe.Traj.FingerprintOrBuilder getBleFingerprintsOrBuilder( + int index) { + if (bleFingerprintsBuilder_ == null) { + return bleFingerprints_.get(index); } else { + return bleFingerprintsBuilder_.getMessageOrBuilder(index); } - - return this; } /** - * optional .Sensor_Info rotation_vector_info = 14; + * repeated .Fingerprint ble_fingerprints = 14; */ - public Builder clearRotationVectorInfo() { - if (rotationVectorInfoBuilder_ == null) { - rotationVectorInfo_ = null; - onChanged(); + public java.util.List + getBleFingerprintsOrBuilderList() { + if (bleFingerprintsBuilder_ != null) { + return bleFingerprintsBuilder_.getMessageOrBuilderList(); } else { - rotationVectorInfo_ = null; - rotationVectorInfoBuilder_ = null; + return java.util.Collections.unmodifiableList(bleFingerprints_); } - - return this; } /** - * optional .Sensor_Info rotation_vector_info = 14; + * repeated .Fingerprint ble_fingerprints = 14; */ - public Sensor_Info.Builder getRotationVectorInfoBuilder() { - - onChanged(); - return getRotationVectorInfoFieldBuilder().getBuilder(); + public com.openpositioning.PositionMe.Traj.Fingerprint.Builder addBleFingerprintsBuilder() { + return getBleFingerprintsFieldBuilder().addBuilder( + com.openpositioning.PositionMe.Traj.Fingerprint.getDefaultInstance()); } /** - * optional .Sensor_Info rotation_vector_info = 14; + * repeated .Fingerprint ble_fingerprints = 14; */ - public Sensor_InfoOrBuilder getRotationVectorInfoOrBuilder() { - if (rotationVectorInfoBuilder_ != null) { - return rotationVectorInfoBuilder_.getMessageOrBuilder(); - } else { - return rotationVectorInfo_ == null ? - Sensor_Info.getDefaultInstance() : rotationVectorInfo_; - } + public com.openpositioning.PositionMe.Traj.Fingerprint.Builder addBleFingerprintsBuilder( + int index) { + return getBleFingerprintsFieldBuilder().addBuilder( + index, com.openpositioning.PositionMe.Traj.Fingerprint.getDefaultInstance()); } /** - * optional .Sensor_Info rotation_vector_info = 14; + * repeated .Fingerprint ble_fingerprints = 14; */ - private com.google.protobuf.SingleFieldBuilderV3< - Sensor_Info, Sensor_Info.Builder, Sensor_InfoOrBuilder> - getRotationVectorInfoFieldBuilder() { - if (rotationVectorInfoBuilder_ == null) { - rotationVectorInfoBuilder_ = new com.google.protobuf.SingleFieldBuilderV3< - Sensor_Info, Sensor_Info.Builder, Sensor_InfoOrBuilder>( - getRotationVectorInfo(), + public java.util.List + getBleFingerprintsBuilderList() { + return getBleFingerprintsFieldBuilder().getBuilderList(); + } + private com.google.protobuf.RepeatedFieldBuilder< + com.openpositioning.PositionMe.Traj.Fingerprint, com.openpositioning.PositionMe.Traj.Fingerprint.Builder, com.openpositioning.PositionMe.Traj.FingerprintOrBuilder> + getBleFingerprintsFieldBuilder() { + if (bleFingerprintsBuilder_ == null) { + bleFingerprintsBuilder_ = new com.google.protobuf.RepeatedFieldBuilder< + com.openpositioning.PositionMe.Traj.Fingerprint, com.openpositioning.PositionMe.Traj.Fingerprint.Builder, com.openpositioning.PositionMe.Traj.FingerprintOrBuilder>( + bleFingerprints_, + ((bitField0_ & 0x00002000) != 0), getParentForChildren(), isClean()); - rotationVectorInfo_ = null; + bleFingerprints_ = null; + } + return bleFingerprintsBuilder_; + } + + private java.util.List bleData_ = + java.util.Collections.emptyList(); + private void ensureBleDataIsMutable() { + if (!((bitField0_ & 0x00004000) != 0)) { + bleData_ = new java.util.ArrayList(bleData_); + bitField0_ |= 0x00004000; } - return rotationVectorInfoBuilder_; } - private Sensor_Info magnetometerInfo_ = null; - private com.google.protobuf.SingleFieldBuilderV3< - Sensor_Info, Sensor_Info.Builder, Sensor_InfoOrBuilder> magnetometerInfoBuilder_; + private com.google.protobuf.RepeatedFieldBuilder< + com.openpositioning.PositionMe.Traj.BleData, com.openpositioning.PositionMe.Traj.BleData.Builder, com.openpositioning.PositionMe.Traj.BleDataOrBuilder> bleDataBuilder_; + /** - * optional .Sensor_Info magnetometer_info = 15; + * repeated .BleData ble_data = 15; */ - public boolean hasMagnetometerInfo() { - return magnetometerInfoBuilder_ != null || magnetometerInfo_ != null; + public java.util.List getBleDataList() { + if (bleDataBuilder_ == null) { + return java.util.Collections.unmodifiableList(bleData_); + } else { + return bleDataBuilder_.getMessageList(); + } } /** - * optional .Sensor_Info magnetometer_info = 15; + * repeated .BleData ble_data = 15; */ - public Sensor_Info getMagnetometerInfo() { - if (magnetometerInfoBuilder_ == null) { - return magnetometerInfo_ == null ? Sensor_Info.getDefaultInstance() : magnetometerInfo_; + public int getBleDataCount() { + if (bleDataBuilder_ == null) { + return bleData_.size(); } else { - return magnetometerInfoBuilder_.getMessage(); + return bleDataBuilder_.getCount(); } } /** - * optional .Sensor_Info magnetometer_info = 15; + * repeated .BleData ble_data = 15; */ - public Builder setMagnetometerInfo(Sensor_Info value) { - if (magnetometerInfoBuilder_ == null) { - if (value == null) { - throw new NullPointerException(); - } - magnetometerInfo_ = value; + public com.openpositioning.PositionMe.Traj.BleData getBleData(int index) { + if (bleDataBuilder_ == null) { + return bleData_.get(index); + } else { + return bleDataBuilder_.getMessage(index); + } + } + /** + * repeated .BleData ble_data = 15; + */ + public Builder setBleData( + int index, com.openpositioning.PositionMe.Traj.BleData value) { + if (bleDataBuilder_ == null) { + if (value == null) { + throw new NullPointerException(); + } + ensureBleDataIsMutable(); + bleData_.set(index, value); onChanged(); } else { - magnetometerInfoBuilder_.setMessage(value); + bleDataBuilder_.setMessage(index, value); } - return this; } /** - * optional .Sensor_Info magnetometer_info = 15; + * repeated .BleData ble_data = 15; */ - public Builder setMagnetometerInfo( - Sensor_Info.Builder builderForValue) { - if (magnetometerInfoBuilder_ == null) { - magnetometerInfo_ = builderForValue.build(); + public Builder setBleData( + int index, com.openpositioning.PositionMe.Traj.BleData.Builder builderForValue) { + if (bleDataBuilder_ == null) { + ensureBleDataIsMutable(); + bleData_.set(index, builderForValue.build()); onChanged(); } else { - magnetometerInfoBuilder_.setMessage(builderForValue.build()); + bleDataBuilder_.setMessage(index, builderForValue.build()); } - return this; } /** - * optional .Sensor_Info magnetometer_info = 15; + * repeated .BleData ble_data = 15; */ - public Builder mergeMagnetometerInfo(Sensor_Info value) { - if (magnetometerInfoBuilder_ == null) { - if (magnetometerInfo_ != null) { - magnetometerInfo_ = - Sensor_Info.newBuilder(magnetometerInfo_).mergeFrom(value).buildPartial(); - } else { - magnetometerInfo_ = value; + public Builder addBleData(com.openpositioning.PositionMe.Traj.BleData value) { + if (bleDataBuilder_ == null) { + if (value == null) { + throw new NullPointerException(); } + ensureBleDataIsMutable(); + bleData_.add(value); onChanged(); } else { - magnetometerInfoBuilder_.mergeFrom(value); + bleDataBuilder_.addMessage(value); } - return this; } /** - * optional .Sensor_Info magnetometer_info = 15; + * repeated .BleData ble_data = 15; */ - public Builder clearMagnetometerInfo() { - if (magnetometerInfoBuilder_ == null) { - magnetometerInfo_ = null; + public Builder addBleData( + int index, com.openpositioning.PositionMe.Traj.BleData value) { + if (bleDataBuilder_ == null) { + if (value == null) { + throw new NullPointerException(); + } + ensureBleDataIsMutable(); + bleData_.add(index, value); onChanged(); } else { - magnetometerInfo_ = null; - magnetometerInfoBuilder_ = null; + bleDataBuilder_.addMessage(index, value); } - return this; } /** - * optional .Sensor_Info magnetometer_info = 15; + * repeated .BleData ble_data = 15; */ - public Sensor_Info.Builder getMagnetometerInfoBuilder() { - - onChanged(); - return getMagnetometerInfoFieldBuilder().getBuilder(); + public Builder addBleData( + com.openpositioning.PositionMe.Traj.BleData.Builder builderForValue) { + if (bleDataBuilder_ == null) { + ensureBleDataIsMutable(); + bleData_.add(builderForValue.build()); + onChanged(); + } else { + bleDataBuilder_.addMessage(builderForValue.build()); + } + return this; } /** - * optional .Sensor_Info magnetometer_info = 15; + * repeated .BleData ble_data = 15; */ - public Sensor_InfoOrBuilder getMagnetometerInfoOrBuilder() { - if (magnetometerInfoBuilder_ != null) { - return magnetometerInfoBuilder_.getMessageOrBuilder(); + public Builder addBleData( + int index, com.openpositioning.PositionMe.Traj.BleData.Builder builderForValue) { + if (bleDataBuilder_ == null) { + ensureBleDataIsMutable(); + bleData_.add(index, builderForValue.build()); + onChanged(); } else { - return magnetometerInfo_ == null ? - Sensor_Info.getDefaultInstance() : magnetometerInfo_; + bleDataBuilder_.addMessage(index, builderForValue.build()); } + return this; } /** - * optional .Sensor_Info magnetometer_info = 15; + * repeated .BleData ble_data = 15; */ - private com.google.protobuf.SingleFieldBuilderV3< - Sensor_Info, Sensor_Info.Builder, Sensor_InfoOrBuilder> - getMagnetometerInfoFieldBuilder() { - if (magnetometerInfoBuilder_ == null) { - magnetometerInfoBuilder_ = new com.google.protobuf.SingleFieldBuilderV3< - Sensor_Info, Sensor_Info.Builder, Sensor_InfoOrBuilder>( - getMagnetometerInfo(), + public Builder addAllBleData( + java.lang.Iterable values) { + if (bleDataBuilder_ == null) { + ensureBleDataIsMutable(); + com.google.protobuf.AbstractMessageLite.Builder.addAll( + values, bleData_); + onChanged(); + } else { + bleDataBuilder_.addAllMessages(values); + } + return this; + } + /** + * repeated .BleData ble_data = 15; + */ + public Builder clearBleData() { + if (bleDataBuilder_ == null) { + bleData_ = java.util.Collections.emptyList(); + bitField0_ = (bitField0_ & ~0x00004000); + onChanged(); + } else { + bleDataBuilder_.clear(); + } + return this; + } + /** + * repeated .BleData ble_data = 15; + */ + public Builder removeBleData(int index) { + if (bleDataBuilder_ == null) { + ensureBleDataIsMutable(); + bleData_.remove(index); + onChanged(); + } else { + bleDataBuilder_.remove(index); + } + return this; + } + /** + * repeated .BleData ble_data = 15; + */ + public com.openpositioning.PositionMe.Traj.BleData.Builder getBleDataBuilder( + int index) { + return getBleDataFieldBuilder().getBuilder(index); + } + /** + * repeated .BleData ble_data = 15; + */ + public com.openpositioning.PositionMe.Traj.BleDataOrBuilder getBleDataOrBuilder( + int index) { + if (bleDataBuilder_ == null) { + return bleData_.get(index); } else { + return bleDataBuilder_.getMessageOrBuilder(index); + } + } + /** + * repeated .BleData ble_data = 15; + */ + public java.util.List + getBleDataOrBuilderList() { + if (bleDataBuilder_ != null) { + return bleDataBuilder_.getMessageOrBuilderList(); + } else { + return java.util.Collections.unmodifiableList(bleData_); + } + } + /** + * repeated .BleData ble_data = 15; + */ + public com.openpositioning.PositionMe.Traj.BleData.Builder addBleDataBuilder() { + return getBleDataFieldBuilder().addBuilder( + com.openpositioning.PositionMe.Traj.BleData.getDefaultInstance()); + } + /** + * repeated .BleData ble_data = 15; + */ + public com.openpositioning.PositionMe.Traj.BleData.Builder addBleDataBuilder( + int index) { + return getBleDataFieldBuilder().addBuilder( + index, com.openpositioning.PositionMe.Traj.BleData.getDefaultInstance()); + } + /** + * repeated .BleData ble_data = 15; + */ + public java.util.List + getBleDataBuilderList() { + return getBleDataFieldBuilder().getBuilderList(); + } + private com.google.protobuf.RepeatedFieldBuilder< + com.openpositioning.PositionMe.Traj.BleData, com.openpositioning.PositionMe.Traj.BleData.Builder, com.openpositioning.PositionMe.Traj.BleDataOrBuilder> + getBleDataFieldBuilder() { + if (bleDataBuilder_ == null) { + bleDataBuilder_ = new com.google.protobuf.RepeatedFieldBuilder< + com.openpositioning.PositionMe.Traj.BleData, com.openpositioning.PositionMe.Traj.BleData.Builder, com.openpositioning.PositionMe.Traj.BleDataOrBuilder>( + bleData_, + ((bitField0_ & 0x00004000) != 0), getParentForChildren(), isClean()); - magnetometerInfo_ = null; + bleData_ = null; } - return magnetometerInfoBuilder_; + return bleDataBuilder_; } - private Sensor_Info barometerInfo_ = null; - private com.google.protobuf.SingleFieldBuilderV3< - Sensor_Info, Sensor_Info.Builder, Sensor_InfoOrBuilder> barometerInfoBuilder_; + private long startTimestamp_ ; /** - * optional .Sensor_Info barometer_info = 16; + *
+       * UNIX timestamp (in milliseconds) recorded from the start of this
+       * trajectory data collection event. All future
+       * timestamps in sub classes are to be RELATIVE timestamps
+       * (in milliseconds) to this start time.
+       * E.g.
+       * start_timestamp = 1674819807315 (UTC 27 Jan 2023 in the morning)
+       * relative_timestamp = 3000 (3s)
+       * 
+ * + * int64 start_timestamp = 16; + * @return The startTimestamp. */ - public boolean hasBarometerInfo() { - return barometerInfoBuilder_ != null || barometerInfo_ != null; + @java.lang.Override + public long getStartTimestamp() { + return startTimestamp_; } /** - * optional .Sensor_Info barometer_info = 16; + *
+       * UNIX timestamp (in milliseconds) recorded from the start of this
+       * trajectory data collection event. All future
+       * timestamps in sub classes are to be RELATIVE timestamps
+       * (in milliseconds) to this start time.
+       * E.g.
+       * start_timestamp = 1674819807315 (UTC 27 Jan 2023 in the morning)
+       * relative_timestamp = 3000 (3s)
+       * 
+ * + * int64 start_timestamp = 16; + * @param value The startTimestamp to set. + * @return This builder for chaining. */ - public Sensor_Info getBarometerInfo() { - if (barometerInfoBuilder_ == null) { - return barometerInfo_ == null ? Sensor_Info.getDefaultInstance() : barometerInfo_; + public Builder setStartTimestamp(long value) { + + startTimestamp_ = value; + bitField0_ |= 0x00008000; + onChanged(); + return this; + } + /** + *
+       * UNIX timestamp (in milliseconds) recorded from the start of this
+       * trajectory data collection event. All future
+       * timestamps in sub classes are to be RELATIVE timestamps
+       * (in milliseconds) to this start time.
+       * E.g.
+       * start_timestamp = 1674819807315 (UTC 27 Jan 2023 in the morning)
+       * relative_timestamp = 3000 (3s)
+       * 
+ * + * int64 start_timestamp = 16; + * @return This builder for chaining. + */ + public Builder clearStartTimestamp() { + bitField0_ = (bitField0_ & ~0x00008000); + startTimestamp_ = 0L; + onChanged(); + return this; + } + + private com.openpositioning.PositionMe.Traj.GNSSPosition initialPosition_; + private com.google.protobuf.SingleFieldBuilder< + com.openpositioning.PositionMe.Traj.GNSSPosition, com.openpositioning.PositionMe.Traj.GNSSPosition.Builder, com.openpositioning.PositionMe.Traj.GNSSPositionOrBuilder> initialPositionBuilder_; + /** + * .GNSSPosition initial_position = 17; + * @return Whether the initialPosition field is set. + */ + public boolean hasInitialPosition() { + return ((bitField0_ & 0x00010000) != 0); + } + /** + * .GNSSPosition initial_position = 17; + * @return The initialPosition. + */ + public com.openpositioning.PositionMe.Traj.GNSSPosition getInitialPosition() { + if (initialPositionBuilder_ == null) { + return initialPosition_ == null ? com.openpositioning.PositionMe.Traj.GNSSPosition.getDefaultInstance() : initialPosition_; } else { - return barometerInfoBuilder_.getMessage(); + return initialPositionBuilder_.getMessage(); } } /** - * optional .Sensor_Info barometer_info = 16; + * .GNSSPosition initial_position = 17; */ - public Builder setBarometerInfo(Sensor_Info value) { - if (barometerInfoBuilder_ == null) { + public Builder setInitialPosition(com.openpositioning.PositionMe.Traj.GNSSPosition value) { + if (initialPositionBuilder_ == null) { if (value == null) { throw new NullPointerException(); } - barometerInfo_ = value; - onChanged(); + initialPosition_ = value; } else { - barometerInfoBuilder_.setMessage(value); + initialPositionBuilder_.setMessage(value); } - + bitField0_ |= 0x00010000; + onChanged(); return this; } /** - * optional .Sensor_Info barometer_info = 16; + * .GNSSPosition initial_position = 17; */ - public Builder setBarometerInfo( - Sensor_Info.Builder builderForValue) { - if (barometerInfoBuilder_ == null) { - barometerInfo_ = builderForValue.build(); - onChanged(); + public Builder setInitialPosition( + com.openpositioning.PositionMe.Traj.GNSSPosition.Builder builderForValue) { + if (initialPositionBuilder_ == null) { + initialPosition_ = builderForValue.build(); } else { - barometerInfoBuilder_.setMessage(builderForValue.build()); + initialPositionBuilder_.setMessage(builderForValue.build()); } - + bitField0_ |= 0x00010000; + onChanged(); return this; } /** - * optional .Sensor_Info barometer_info = 16; + * .GNSSPosition initial_position = 17; */ - public Builder mergeBarometerInfo(Sensor_Info value) { - if (barometerInfoBuilder_ == null) { - if (barometerInfo_ != null) { - barometerInfo_ = - Sensor_Info.newBuilder(barometerInfo_).mergeFrom(value).buildPartial(); + public Builder mergeInitialPosition(com.openpositioning.PositionMe.Traj.GNSSPosition value) { + if (initialPositionBuilder_ == null) { + if (((bitField0_ & 0x00010000) != 0) && + initialPosition_ != null && + initialPosition_ != com.openpositioning.PositionMe.Traj.GNSSPosition.getDefaultInstance()) { + getInitialPositionBuilder().mergeFrom(value); } else { - barometerInfo_ = value; + initialPosition_ = value; } - onChanged(); } else { - barometerInfoBuilder_.mergeFrom(value); + initialPositionBuilder_.mergeFrom(value); + } + if (initialPosition_ != null) { + bitField0_ |= 0x00010000; + onChanged(); } - return this; } /** - * optional .Sensor_Info barometer_info = 16; + * .GNSSPosition initial_position = 17; */ - public Builder clearBarometerInfo() { - if (barometerInfoBuilder_ == null) { - barometerInfo_ = null; - onChanged(); - } else { - barometerInfo_ = null; - barometerInfoBuilder_ = null; + public Builder clearInitialPosition() { + bitField0_ = (bitField0_ & ~0x00010000); + initialPosition_ = null; + if (initialPositionBuilder_ != null) { + initialPositionBuilder_.dispose(); + initialPositionBuilder_ = null; } - + onChanged(); return this; } /** - * optional .Sensor_Info barometer_info = 16; + * .GNSSPosition initial_position = 17; */ - public Sensor_Info.Builder getBarometerInfoBuilder() { - + public com.openpositioning.PositionMe.Traj.GNSSPosition.Builder getInitialPositionBuilder() { + bitField0_ |= 0x00010000; onChanged(); - return getBarometerInfoFieldBuilder().getBuilder(); + return getInitialPositionFieldBuilder().getBuilder(); } /** - * optional .Sensor_Info barometer_info = 16; + * .GNSSPosition initial_position = 17; */ - public Sensor_InfoOrBuilder getBarometerInfoOrBuilder() { - if (barometerInfoBuilder_ != null) { - return barometerInfoBuilder_.getMessageOrBuilder(); + public com.openpositioning.PositionMe.Traj.GNSSPositionOrBuilder getInitialPositionOrBuilder() { + if (initialPositionBuilder_ != null) { + return initialPositionBuilder_.getMessageOrBuilder(); } else { - return barometerInfo_ == null ? - Sensor_Info.getDefaultInstance() : barometerInfo_; + return initialPosition_ == null ? + com.openpositioning.PositionMe.Traj.GNSSPosition.getDefaultInstance() : initialPosition_; } } /** - * optional .Sensor_Info barometer_info = 16; + * .GNSSPosition initial_position = 17; */ - private com.google.protobuf.SingleFieldBuilderV3< - Sensor_Info, Sensor_Info.Builder, Sensor_InfoOrBuilder> - getBarometerInfoFieldBuilder() { - if (barometerInfoBuilder_ == null) { - barometerInfoBuilder_ = new com.google.protobuf.SingleFieldBuilderV3< - Sensor_Info, Sensor_Info.Builder, Sensor_InfoOrBuilder>( - getBarometerInfo(), + private com.google.protobuf.SingleFieldBuilder< + com.openpositioning.PositionMe.Traj.GNSSPosition, com.openpositioning.PositionMe.Traj.GNSSPosition.Builder, com.openpositioning.PositionMe.Traj.GNSSPositionOrBuilder> + getInitialPositionFieldBuilder() { + if (initialPositionBuilder_ == null) { + initialPositionBuilder_ = new com.google.protobuf.SingleFieldBuilder< + com.openpositioning.PositionMe.Traj.GNSSPosition, com.openpositioning.PositionMe.Traj.GNSSPosition.Builder, com.openpositioning.PositionMe.Traj.GNSSPositionOrBuilder>( + getInitialPosition(), getParentForChildren(), isClean()); - barometerInfo_ = null; + initialPosition_ = null; + } + return initialPositionBuilder_; + } + + private java.util.List correctedPositions_ = + java.util.Collections.emptyList(); + private void ensureCorrectedPositionsIsMutable() { + if (!((bitField0_ & 0x00020000) != 0)) { + correctedPositions_ = new java.util.ArrayList(correctedPositions_); + bitField0_ |= 0x00020000; } - return barometerInfoBuilder_; } - private Sensor_Info lightSensorInfo_ = null; - private com.google.protobuf.SingleFieldBuilderV3< - Sensor_Info, Sensor_Info.Builder, Sensor_InfoOrBuilder> lightSensorInfoBuilder_; + private com.google.protobuf.RepeatedFieldBuilder< + com.openpositioning.PositionMe.Traj.GNSSPosition, com.openpositioning.PositionMe.Traj.GNSSPosition.Builder, com.openpositioning.PositionMe.Traj.GNSSPositionOrBuilder> correctedPositionsBuilder_; + /** - * optional .Sensor_Info light_sensor_info = 17; + * repeated .GNSSPosition corrected_positions = 18; */ - public boolean hasLightSensorInfo() { - return lightSensorInfoBuilder_ != null || lightSensorInfo_ != null; + public java.util.List getCorrectedPositionsList() { + if (correctedPositionsBuilder_ == null) { + return java.util.Collections.unmodifiableList(correctedPositions_); + } else { + return correctedPositionsBuilder_.getMessageList(); + } } /** - * optional .Sensor_Info light_sensor_info = 17; + * repeated .GNSSPosition corrected_positions = 18; */ - public Sensor_Info getLightSensorInfo() { - if (lightSensorInfoBuilder_ == null) { - return lightSensorInfo_ == null ? Sensor_Info.getDefaultInstance() : lightSensorInfo_; + public int getCorrectedPositionsCount() { + if (correctedPositionsBuilder_ == null) { + return correctedPositions_.size(); } else { - return lightSensorInfoBuilder_.getMessage(); + return correctedPositionsBuilder_.getCount(); } } /** - * optional .Sensor_Info light_sensor_info = 17; + * repeated .GNSSPosition corrected_positions = 18; */ - public Builder setLightSensorInfo(Sensor_Info value) { - if (lightSensorInfoBuilder_ == null) { + public com.openpositioning.PositionMe.Traj.GNSSPosition getCorrectedPositions(int index) { + if (correctedPositionsBuilder_ == null) { + return correctedPositions_.get(index); + } else { + return correctedPositionsBuilder_.getMessage(index); + } + } + /** + * repeated .GNSSPosition corrected_positions = 18; + */ + public Builder setCorrectedPositions( + int index, com.openpositioning.PositionMe.Traj.GNSSPosition value) { + if (correctedPositionsBuilder_ == null) { if (value == null) { throw new NullPointerException(); } - lightSensorInfo_ = value; + ensureCorrectedPositionsIsMutable(); + correctedPositions_.set(index, value); onChanged(); } else { - lightSensorInfoBuilder_.setMessage(value); + correctedPositionsBuilder_.setMessage(index, value); } - return this; } /** - * optional .Sensor_Info light_sensor_info = 17; + * repeated .GNSSPosition corrected_positions = 18; */ - public Builder setLightSensorInfo( - Sensor_Info.Builder builderForValue) { - if (lightSensorInfoBuilder_ == null) { - lightSensorInfo_ = builderForValue.build(); + public Builder setCorrectedPositions( + int index, com.openpositioning.PositionMe.Traj.GNSSPosition.Builder builderForValue) { + if (correctedPositionsBuilder_ == null) { + ensureCorrectedPositionsIsMutable(); + correctedPositions_.set(index, builderForValue.build()); onChanged(); } else { - lightSensorInfoBuilder_.setMessage(builderForValue.build()); + correctedPositionsBuilder_.setMessage(index, builderForValue.build()); } - return this; } /** - * optional .Sensor_Info light_sensor_info = 17; + * repeated .GNSSPosition corrected_positions = 18; */ - public Builder mergeLightSensorInfo(Sensor_Info value) { - if (lightSensorInfoBuilder_ == null) { - if (lightSensorInfo_ != null) { - lightSensorInfo_ = - Sensor_Info.newBuilder(lightSensorInfo_).mergeFrom(value).buildPartial(); - } else { - lightSensorInfo_ = value; + public Builder addCorrectedPositions(com.openpositioning.PositionMe.Traj.GNSSPosition value) { + if (correctedPositionsBuilder_ == null) { + if (value == null) { + throw new NullPointerException(); } + ensureCorrectedPositionsIsMutable(); + correctedPositions_.add(value); onChanged(); } else { - lightSensorInfoBuilder_.mergeFrom(value); + correctedPositionsBuilder_.addMessage(value); } - return this; } /** - * optional .Sensor_Info light_sensor_info = 17; + * repeated .GNSSPosition corrected_positions = 18; */ - public Builder clearLightSensorInfo() { - if (lightSensorInfoBuilder_ == null) { - lightSensorInfo_ = null; + public Builder addCorrectedPositions( + int index, com.openpositioning.PositionMe.Traj.GNSSPosition value) { + if (correctedPositionsBuilder_ == null) { + if (value == null) { + throw new NullPointerException(); + } + ensureCorrectedPositionsIsMutable(); + correctedPositions_.add(index, value); onChanged(); } else { - lightSensorInfo_ = null; - lightSensorInfoBuilder_ = null; + correctedPositionsBuilder_.addMessage(index, value); } - return this; } /** - * optional .Sensor_Info light_sensor_info = 17; + * repeated .GNSSPosition corrected_positions = 18; */ - public Sensor_Info.Builder getLightSensorInfoBuilder() { - - onChanged(); - return getLightSensorInfoFieldBuilder().getBuilder(); + public Builder addCorrectedPositions( + com.openpositioning.PositionMe.Traj.GNSSPosition.Builder builderForValue) { + if (correctedPositionsBuilder_ == null) { + ensureCorrectedPositionsIsMutable(); + correctedPositions_.add(builderForValue.build()); + onChanged(); + } else { + correctedPositionsBuilder_.addMessage(builderForValue.build()); + } + return this; } /** - * optional .Sensor_Info light_sensor_info = 17; + * repeated .GNSSPosition corrected_positions = 18; */ - public Sensor_InfoOrBuilder getLightSensorInfoOrBuilder() { - if (lightSensorInfoBuilder_ != null) { - return lightSensorInfoBuilder_.getMessageOrBuilder(); + public Builder addCorrectedPositions( + int index, com.openpositioning.PositionMe.Traj.GNSSPosition.Builder builderForValue) { + if (correctedPositionsBuilder_ == null) { + ensureCorrectedPositionsIsMutable(); + correctedPositions_.add(index, builderForValue.build()); + onChanged(); } else { - return lightSensorInfo_ == null ? - Sensor_Info.getDefaultInstance() : lightSensorInfo_; + correctedPositionsBuilder_.addMessage(index, builderForValue.build()); } + return this; } /** - * optional .Sensor_Info light_sensor_info = 17; + * repeated .GNSSPosition corrected_positions = 18; */ - private com.google.protobuf.SingleFieldBuilderV3< - Sensor_Info, Sensor_Info.Builder, Sensor_InfoOrBuilder> - getLightSensorInfoFieldBuilder() { - if (lightSensorInfoBuilder_ == null) { - lightSensorInfoBuilder_ = new com.google.protobuf.SingleFieldBuilderV3< - Sensor_Info, Sensor_Info.Builder, Sensor_InfoOrBuilder>( - getLightSensorInfo(), - getParentForChildren(), - isClean()); - lightSensorInfo_ = null; + public Builder addAllCorrectedPositions( + java.lang.Iterable values) { + if (correctedPositionsBuilder_ == null) { + ensureCorrectedPositionsIsMutable(); + com.google.protobuf.AbstractMessageLite.Builder.addAll( + values, correctedPositions_); + onChanged(); + } else { + correctedPositionsBuilder_.addAllMessages(values); } - return lightSensorInfoBuilder_; + return this; } - public final Builder setUnknownFields( - final com.google.protobuf.UnknownFieldSet unknownFields) { + /** + * repeated .GNSSPosition corrected_positions = 18; + */ + public Builder clearCorrectedPositions() { + if (correctedPositionsBuilder_ == null) { + correctedPositions_ = java.util.Collections.emptyList(); + bitField0_ = (bitField0_ & ~0x00020000); + onChanged(); + } else { + correctedPositionsBuilder_.clear(); + } return this; } - - public final Builder mergeUnknownFields( - final com.google.protobuf.UnknownFieldSet unknownFields) { + /** + * repeated .GNSSPosition corrected_positions = 18; + */ + public Builder removeCorrectedPositions(int index) { + if (correctedPositionsBuilder_ == null) { + ensureCorrectedPositionsIsMutable(); + correctedPositions_.remove(index); + onChanged(); + } else { + correctedPositionsBuilder_.remove(index); + } return this; } - - - // @@protoc_insertion_point(builder_scope:Trajectory) - } - - // @@protoc_insertion_point(class_scope:Trajectory) - private static final Trajectory DEFAULT_INSTANCE; + /** + * repeated .GNSSPosition corrected_positions = 18; + */ + public com.openpositioning.PositionMe.Traj.GNSSPosition.Builder getCorrectedPositionsBuilder( + int index) { + return getCorrectedPositionsFieldBuilder().getBuilder(index); + } + /** + * repeated .GNSSPosition corrected_positions = 18; + */ + public com.openpositioning.PositionMe.Traj.GNSSPositionOrBuilder getCorrectedPositionsOrBuilder( + int index) { + if (correctedPositionsBuilder_ == null) { + return correctedPositions_.get(index); } else { + return correctedPositionsBuilder_.getMessageOrBuilder(index); + } + } + /** + * repeated .GNSSPosition corrected_positions = 18; + */ + public java.util.List + getCorrectedPositionsOrBuilderList() { + if (correctedPositionsBuilder_ != null) { + return correctedPositionsBuilder_.getMessageOrBuilderList(); + } else { + return java.util.Collections.unmodifiableList(correctedPositions_); + } + } + /** + * repeated .GNSSPosition corrected_positions = 18; + */ + public com.openpositioning.PositionMe.Traj.GNSSPosition.Builder addCorrectedPositionsBuilder() { + return getCorrectedPositionsFieldBuilder().addBuilder( + com.openpositioning.PositionMe.Traj.GNSSPosition.getDefaultInstance()); + } + /** + * repeated .GNSSPosition corrected_positions = 18; + */ + public com.openpositioning.PositionMe.Traj.GNSSPosition.Builder addCorrectedPositionsBuilder( + int index) { + return getCorrectedPositionsFieldBuilder().addBuilder( + index, com.openpositioning.PositionMe.Traj.GNSSPosition.getDefaultInstance()); + } + /** + * repeated .GNSSPosition corrected_positions = 18; + */ + public java.util.List + getCorrectedPositionsBuilderList() { + return getCorrectedPositionsFieldBuilder().getBuilderList(); + } + private com.google.protobuf.RepeatedFieldBuilder< + com.openpositioning.PositionMe.Traj.GNSSPosition, com.openpositioning.PositionMe.Traj.GNSSPosition.Builder, com.openpositioning.PositionMe.Traj.GNSSPositionOrBuilder> + getCorrectedPositionsFieldBuilder() { + if (correctedPositionsBuilder_ == null) { + correctedPositionsBuilder_ = new com.google.protobuf.RepeatedFieldBuilder< + com.openpositioning.PositionMe.Traj.GNSSPosition, com.openpositioning.PositionMe.Traj.GNSSPosition.Builder, com.openpositioning.PositionMe.Traj.GNSSPositionOrBuilder>( + correctedPositions_, + ((bitField0_ & 0x00020000) != 0), + getParentForChildren(), + isClean()); + correctedPositions_ = null; + } + return correctedPositionsBuilder_; + } + + private com.openpositioning.PositionMe.Traj.SensorInfo accelerometerInfo_; + private com.google.protobuf.SingleFieldBuilder< + com.openpositioning.PositionMe.Traj.SensorInfo, com.openpositioning.PositionMe.Traj.SensorInfo.Builder, com.openpositioning.PositionMe.Traj.SensorInfoOrBuilder> accelerometerInfoBuilder_; + /** + * .SensorInfo accelerometer_info = 19; + * @return Whether the accelerometerInfo field is set. + */ + public boolean hasAccelerometerInfo() { + return ((bitField0_ & 0x00040000) != 0); + } + /** + * .SensorInfo accelerometer_info = 19; + * @return The accelerometerInfo. + */ + public com.openpositioning.PositionMe.Traj.SensorInfo getAccelerometerInfo() { + if (accelerometerInfoBuilder_ == null) { + return accelerometerInfo_ == null ? com.openpositioning.PositionMe.Traj.SensorInfo.getDefaultInstance() : accelerometerInfo_; + } else { + return accelerometerInfoBuilder_.getMessage(); + } + } + /** + * .SensorInfo accelerometer_info = 19; + */ + public Builder setAccelerometerInfo(com.openpositioning.PositionMe.Traj.SensorInfo value) { + if (accelerometerInfoBuilder_ == null) { + if (value == null) { + throw new NullPointerException(); + } + accelerometerInfo_ = value; + } else { + accelerometerInfoBuilder_.setMessage(value); + } + bitField0_ |= 0x00040000; + onChanged(); + return this; + } + /** + * .SensorInfo accelerometer_info = 19; + */ + public Builder setAccelerometerInfo( + com.openpositioning.PositionMe.Traj.SensorInfo.Builder builderForValue) { + if (accelerometerInfoBuilder_ == null) { + accelerometerInfo_ = builderForValue.build(); + } else { + accelerometerInfoBuilder_.setMessage(builderForValue.build()); + } + bitField0_ |= 0x00040000; + onChanged(); + return this; + } + /** + * .SensorInfo accelerometer_info = 19; + */ + public Builder mergeAccelerometerInfo(com.openpositioning.PositionMe.Traj.SensorInfo value) { + if (accelerometerInfoBuilder_ == null) { + if (((bitField0_ & 0x00040000) != 0) && + accelerometerInfo_ != null && + accelerometerInfo_ != com.openpositioning.PositionMe.Traj.SensorInfo.getDefaultInstance()) { + getAccelerometerInfoBuilder().mergeFrom(value); + } else { + accelerometerInfo_ = value; + } + } else { + accelerometerInfoBuilder_.mergeFrom(value); + } + if (accelerometerInfo_ != null) { + bitField0_ |= 0x00040000; + onChanged(); + } + return this; + } + /** + * .SensorInfo accelerometer_info = 19; + */ + public Builder clearAccelerometerInfo() { + bitField0_ = (bitField0_ & ~0x00040000); + accelerometerInfo_ = null; + if (accelerometerInfoBuilder_ != null) { + accelerometerInfoBuilder_.dispose(); + accelerometerInfoBuilder_ = null; + } + onChanged(); + return this; + } + /** + * .SensorInfo accelerometer_info = 19; + */ + public com.openpositioning.PositionMe.Traj.SensorInfo.Builder getAccelerometerInfoBuilder() { + bitField0_ |= 0x00040000; + onChanged(); + return getAccelerometerInfoFieldBuilder().getBuilder(); + } + /** + * .SensorInfo accelerometer_info = 19; + */ + public com.openpositioning.PositionMe.Traj.SensorInfoOrBuilder getAccelerometerInfoOrBuilder() { + if (accelerometerInfoBuilder_ != null) { + return accelerometerInfoBuilder_.getMessageOrBuilder(); + } else { + return accelerometerInfo_ == null ? + com.openpositioning.PositionMe.Traj.SensorInfo.getDefaultInstance() : accelerometerInfo_; + } + } + /** + * .SensorInfo accelerometer_info = 19; + */ + private com.google.protobuf.SingleFieldBuilder< + com.openpositioning.PositionMe.Traj.SensorInfo, com.openpositioning.PositionMe.Traj.SensorInfo.Builder, com.openpositioning.PositionMe.Traj.SensorInfoOrBuilder> + getAccelerometerInfoFieldBuilder() { + if (accelerometerInfoBuilder_ == null) { + accelerometerInfoBuilder_ = new com.google.protobuf.SingleFieldBuilder< + com.openpositioning.PositionMe.Traj.SensorInfo, com.openpositioning.PositionMe.Traj.SensorInfo.Builder, com.openpositioning.PositionMe.Traj.SensorInfoOrBuilder>( + getAccelerometerInfo(), + getParentForChildren(), + isClean()); + accelerometerInfo_ = null; + } + return accelerometerInfoBuilder_; + } + + private com.openpositioning.PositionMe.Traj.SensorInfo gyroscopeInfo_; + private com.google.protobuf.SingleFieldBuilder< + com.openpositioning.PositionMe.Traj.SensorInfo, com.openpositioning.PositionMe.Traj.SensorInfo.Builder, com.openpositioning.PositionMe.Traj.SensorInfoOrBuilder> gyroscopeInfoBuilder_; + /** + * .SensorInfo gyroscope_info = 20; + * @return Whether the gyroscopeInfo field is set. + */ + public boolean hasGyroscopeInfo() { + return ((bitField0_ & 0x00080000) != 0); + } + /** + * .SensorInfo gyroscope_info = 20; + * @return The gyroscopeInfo. + */ + public com.openpositioning.PositionMe.Traj.SensorInfo getGyroscopeInfo() { + if (gyroscopeInfoBuilder_ == null) { + return gyroscopeInfo_ == null ? com.openpositioning.PositionMe.Traj.SensorInfo.getDefaultInstance() : gyroscopeInfo_; + } else { + return gyroscopeInfoBuilder_.getMessage(); + } + } + /** + * .SensorInfo gyroscope_info = 20; + */ + public Builder setGyroscopeInfo(com.openpositioning.PositionMe.Traj.SensorInfo value) { + if (gyroscopeInfoBuilder_ == null) { + if (value == null) { + throw new NullPointerException(); + } + gyroscopeInfo_ = value; + } else { + gyroscopeInfoBuilder_.setMessage(value); + } + bitField0_ |= 0x00080000; + onChanged(); + return this; + } + /** + * .SensorInfo gyroscope_info = 20; + */ + public Builder setGyroscopeInfo( + com.openpositioning.PositionMe.Traj.SensorInfo.Builder builderForValue) { + if (gyroscopeInfoBuilder_ == null) { + gyroscopeInfo_ = builderForValue.build(); + } else { + gyroscopeInfoBuilder_.setMessage(builderForValue.build()); + } + bitField0_ |= 0x00080000; + onChanged(); + return this; + } + /** + * .SensorInfo gyroscope_info = 20; + */ + public Builder mergeGyroscopeInfo(com.openpositioning.PositionMe.Traj.SensorInfo value) { + if (gyroscopeInfoBuilder_ == null) { + if (((bitField0_ & 0x00080000) != 0) && + gyroscopeInfo_ != null && + gyroscopeInfo_ != com.openpositioning.PositionMe.Traj.SensorInfo.getDefaultInstance()) { + getGyroscopeInfoBuilder().mergeFrom(value); + } else { + gyroscopeInfo_ = value; + } + } else { + gyroscopeInfoBuilder_.mergeFrom(value); + } + if (gyroscopeInfo_ != null) { + bitField0_ |= 0x00080000; + onChanged(); + } + return this; + } + /** + * .SensorInfo gyroscope_info = 20; + */ + public Builder clearGyroscopeInfo() { + bitField0_ = (bitField0_ & ~0x00080000); + gyroscopeInfo_ = null; + if (gyroscopeInfoBuilder_ != null) { + gyroscopeInfoBuilder_.dispose(); + gyroscopeInfoBuilder_ = null; + } + onChanged(); + return this; + } + /** + * .SensorInfo gyroscope_info = 20; + */ + public com.openpositioning.PositionMe.Traj.SensorInfo.Builder getGyroscopeInfoBuilder() { + bitField0_ |= 0x00080000; + onChanged(); + return getGyroscopeInfoFieldBuilder().getBuilder(); + } + /** + * .SensorInfo gyroscope_info = 20; + */ + public com.openpositioning.PositionMe.Traj.SensorInfoOrBuilder getGyroscopeInfoOrBuilder() { + if (gyroscopeInfoBuilder_ != null) { + return gyroscopeInfoBuilder_.getMessageOrBuilder(); + } else { + return gyroscopeInfo_ == null ? + com.openpositioning.PositionMe.Traj.SensorInfo.getDefaultInstance() : gyroscopeInfo_; + } + } + /** + * .SensorInfo gyroscope_info = 20; + */ + private com.google.protobuf.SingleFieldBuilder< + com.openpositioning.PositionMe.Traj.SensorInfo, com.openpositioning.PositionMe.Traj.SensorInfo.Builder, com.openpositioning.PositionMe.Traj.SensorInfoOrBuilder> + getGyroscopeInfoFieldBuilder() { + if (gyroscopeInfoBuilder_ == null) { + gyroscopeInfoBuilder_ = new com.google.protobuf.SingleFieldBuilder< + com.openpositioning.PositionMe.Traj.SensorInfo, com.openpositioning.PositionMe.Traj.SensorInfo.Builder, com.openpositioning.PositionMe.Traj.SensorInfoOrBuilder>( + getGyroscopeInfo(), + getParentForChildren(), + isClean()); + gyroscopeInfo_ = null; + } + return gyroscopeInfoBuilder_; + } + + private com.openpositioning.PositionMe.Traj.SensorInfo rotationVectorInfo_; + private com.google.protobuf.SingleFieldBuilder< + com.openpositioning.PositionMe.Traj.SensorInfo, com.openpositioning.PositionMe.Traj.SensorInfo.Builder, com.openpositioning.PositionMe.Traj.SensorInfoOrBuilder> rotationVectorInfoBuilder_; + /** + * .SensorInfo rotation_vector_info = 21; + * @return Whether the rotationVectorInfo field is set. + */ + public boolean hasRotationVectorInfo() { + return ((bitField0_ & 0x00100000) != 0); + } + /** + * .SensorInfo rotation_vector_info = 21; + * @return The rotationVectorInfo. + */ + public com.openpositioning.PositionMe.Traj.SensorInfo getRotationVectorInfo() { + if (rotationVectorInfoBuilder_ == null) { + return rotationVectorInfo_ == null ? com.openpositioning.PositionMe.Traj.SensorInfo.getDefaultInstance() : rotationVectorInfo_; + } else { + return rotationVectorInfoBuilder_.getMessage(); + } + } + /** + * .SensorInfo rotation_vector_info = 21; + */ + public Builder setRotationVectorInfo(com.openpositioning.PositionMe.Traj.SensorInfo value) { + if (rotationVectorInfoBuilder_ == null) { + if (value == null) { + throw new NullPointerException(); + } + rotationVectorInfo_ = value; + } else { + rotationVectorInfoBuilder_.setMessage(value); + } + bitField0_ |= 0x00100000; + onChanged(); + return this; + } + /** + * .SensorInfo rotation_vector_info = 21; + */ + public Builder setRotationVectorInfo( + com.openpositioning.PositionMe.Traj.SensorInfo.Builder builderForValue) { + if (rotationVectorInfoBuilder_ == null) { + rotationVectorInfo_ = builderForValue.build(); + } else { + rotationVectorInfoBuilder_.setMessage(builderForValue.build()); + } + bitField0_ |= 0x00100000; + onChanged(); + return this; + } + /** + * .SensorInfo rotation_vector_info = 21; + */ + public Builder mergeRotationVectorInfo(com.openpositioning.PositionMe.Traj.SensorInfo value) { + if (rotationVectorInfoBuilder_ == null) { + if (((bitField0_ & 0x00100000) != 0) && + rotationVectorInfo_ != null && + rotationVectorInfo_ != com.openpositioning.PositionMe.Traj.SensorInfo.getDefaultInstance()) { + getRotationVectorInfoBuilder().mergeFrom(value); + } else { + rotationVectorInfo_ = value; + } + } else { + rotationVectorInfoBuilder_.mergeFrom(value); + } + if (rotationVectorInfo_ != null) { + bitField0_ |= 0x00100000; + onChanged(); + } + return this; + } + /** + * .SensorInfo rotation_vector_info = 21; + */ + public Builder clearRotationVectorInfo() { + bitField0_ = (bitField0_ & ~0x00100000); + rotationVectorInfo_ = null; + if (rotationVectorInfoBuilder_ != null) { + rotationVectorInfoBuilder_.dispose(); + rotationVectorInfoBuilder_ = null; + } + onChanged(); + return this; + } + /** + * .SensorInfo rotation_vector_info = 21; + */ + public com.openpositioning.PositionMe.Traj.SensorInfo.Builder getRotationVectorInfoBuilder() { + bitField0_ |= 0x00100000; + onChanged(); + return getRotationVectorInfoFieldBuilder().getBuilder(); + } + /** + * .SensorInfo rotation_vector_info = 21; + */ + public com.openpositioning.PositionMe.Traj.SensorInfoOrBuilder getRotationVectorInfoOrBuilder() { + if (rotationVectorInfoBuilder_ != null) { + return rotationVectorInfoBuilder_.getMessageOrBuilder(); + } else { + return rotationVectorInfo_ == null ? + com.openpositioning.PositionMe.Traj.SensorInfo.getDefaultInstance() : rotationVectorInfo_; + } + } + /** + * .SensorInfo rotation_vector_info = 21; + */ + private com.google.protobuf.SingleFieldBuilder< + com.openpositioning.PositionMe.Traj.SensorInfo, com.openpositioning.PositionMe.Traj.SensorInfo.Builder, com.openpositioning.PositionMe.Traj.SensorInfoOrBuilder> + getRotationVectorInfoFieldBuilder() { + if (rotationVectorInfoBuilder_ == null) { + rotationVectorInfoBuilder_ = new com.google.protobuf.SingleFieldBuilder< + com.openpositioning.PositionMe.Traj.SensorInfo, com.openpositioning.PositionMe.Traj.SensorInfo.Builder, com.openpositioning.PositionMe.Traj.SensorInfoOrBuilder>( + getRotationVectorInfo(), + getParentForChildren(), + isClean()); + rotationVectorInfo_ = null; + } + return rotationVectorInfoBuilder_; + } + + private com.openpositioning.PositionMe.Traj.SensorInfo magnetometerInfo_; + private com.google.protobuf.SingleFieldBuilder< + com.openpositioning.PositionMe.Traj.SensorInfo, com.openpositioning.PositionMe.Traj.SensorInfo.Builder, com.openpositioning.PositionMe.Traj.SensorInfoOrBuilder> magnetometerInfoBuilder_; + /** + * .SensorInfo magnetometer_info = 22; + * @return Whether the magnetometerInfo field is set. + */ + public boolean hasMagnetometerInfo() { + return ((bitField0_ & 0x00200000) != 0); + } + /** + * .SensorInfo magnetometer_info = 22; + * @return The magnetometerInfo. + */ + public com.openpositioning.PositionMe.Traj.SensorInfo getMagnetometerInfo() { + if (magnetometerInfoBuilder_ == null) { + return magnetometerInfo_ == null ? com.openpositioning.PositionMe.Traj.SensorInfo.getDefaultInstance() : magnetometerInfo_; + } else { + return magnetometerInfoBuilder_.getMessage(); + } + } + /** + * .SensorInfo magnetometer_info = 22; + */ + public Builder setMagnetometerInfo(com.openpositioning.PositionMe.Traj.SensorInfo value) { + if (magnetometerInfoBuilder_ == null) { + if (value == null) { + throw new NullPointerException(); + } + magnetometerInfo_ = value; + } else { + magnetometerInfoBuilder_.setMessage(value); + } + bitField0_ |= 0x00200000; + onChanged(); + return this; + } + /** + * .SensorInfo magnetometer_info = 22; + */ + public Builder setMagnetometerInfo( + com.openpositioning.PositionMe.Traj.SensorInfo.Builder builderForValue) { + if (magnetometerInfoBuilder_ == null) { + magnetometerInfo_ = builderForValue.build(); + } else { + magnetometerInfoBuilder_.setMessage(builderForValue.build()); + } + bitField0_ |= 0x00200000; + onChanged(); + return this; + } + /** + * .SensorInfo magnetometer_info = 22; + */ + public Builder mergeMagnetometerInfo(com.openpositioning.PositionMe.Traj.SensorInfo value) { + if (magnetometerInfoBuilder_ == null) { + if (((bitField0_ & 0x00200000) != 0) && + magnetometerInfo_ != null && + magnetometerInfo_ != com.openpositioning.PositionMe.Traj.SensorInfo.getDefaultInstance()) { + getMagnetometerInfoBuilder().mergeFrom(value); + } else { + magnetometerInfo_ = value; + } + } else { + magnetometerInfoBuilder_.mergeFrom(value); + } + if (magnetometerInfo_ != null) { + bitField0_ |= 0x00200000; + onChanged(); + } + return this; + } + /** + * .SensorInfo magnetometer_info = 22; + */ + public Builder clearMagnetometerInfo() { + bitField0_ = (bitField0_ & ~0x00200000); + magnetometerInfo_ = null; + if (magnetometerInfoBuilder_ != null) { + magnetometerInfoBuilder_.dispose(); + magnetometerInfoBuilder_ = null; + } + onChanged(); + return this; + } + /** + * .SensorInfo magnetometer_info = 22; + */ + public com.openpositioning.PositionMe.Traj.SensorInfo.Builder getMagnetometerInfoBuilder() { + bitField0_ |= 0x00200000; + onChanged(); + return getMagnetometerInfoFieldBuilder().getBuilder(); + } + /** + * .SensorInfo magnetometer_info = 22; + */ + public com.openpositioning.PositionMe.Traj.SensorInfoOrBuilder getMagnetometerInfoOrBuilder() { + if (magnetometerInfoBuilder_ != null) { + return magnetometerInfoBuilder_.getMessageOrBuilder(); + } else { + return magnetometerInfo_ == null ? + com.openpositioning.PositionMe.Traj.SensorInfo.getDefaultInstance() : magnetometerInfo_; + } + } + /** + * .SensorInfo magnetometer_info = 22; + */ + private com.google.protobuf.SingleFieldBuilder< + com.openpositioning.PositionMe.Traj.SensorInfo, com.openpositioning.PositionMe.Traj.SensorInfo.Builder, com.openpositioning.PositionMe.Traj.SensorInfoOrBuilder> + getMagnetometerInfoFieldBuilder() { + if (magnetometerInfoBuilder_ == null) { + magnetometerInfoBuilder_ = new com.google.protobuf.SingleFieldBuilder< + com.openpositioning.PositionMe.Traj.SensorInfo, com.openpositioning.PositionMe.Traj.SensorInfo.Builder, com.openpositioning.PositionMe.Traj.SensorInfoOrBuilder>( + getMagnetometerInfo(), + getParentForChildren(), + isClean()); + magnetometerInfo_ = null; + } + return magnetometerInfoBuilder_; + } + + private com.openpositioning.PositionMe.Traj.SensorInfo barometerInfo_; + private com.google.protobuf.SingleFieldBuilder< + com.openpositioning.PositionMe.Traj.SensorInfo, com.openpositioning.PositionMe.Traj.SensorInfo.Builder, com.openpositioning.PositionMe.Traj.SensorInfoOrBuilder> barometerInfoBuilder_; + /** + * .SensorInfo barometer_info = 23; + * @return Whether the barometerInfo field is set. + */ + public boolean hasBarometerInfo() { + return ((bitField0_ & 0x00400000) != 0); + } + /** + * .SensorInfo barometer_info = 23; + * @return The barometerInfo. + */ + public com.openpositioning.PositionMe.Traj.SensorInfo getBarometerInfo() { + if (barometerInfoBuilder_ == null) { + return barometerInfo_ == null ? com.openpositioning.PositionMe.Traj.SensorInfo.getDefaultInstance() : barometerInfo_; + } else { + return barometerInfoBuilder_.getMessage(); + } + } + /** + * .SensorInfo barometer_info = 23; + */ + public Builder setBarometerInfo(com.openpositioning.PositionMe.Traj.SensorInfo value) { + if (barometerInfoBuilder_ == null) { + if (value == null) { + throw new NullPointerException(); + } + barometerInfo_ = value; + } else { + barometerInfoBuilder_.setMessage(value); + } + bitField0_ |= 0x00400000; + onChanged(); + return this; + } + /** + * .SensorInfo barometer_info = 23; + */ + public Builder setBarometerInfo( + com.openpositioning.PositionMe.Traj.SensorInfo.Builder builderForValue) { + if (barometerInfoBuilder_ == null) { + barometerInfo_ = builderForValue.build(); + } else { + barometerInfoBuilder_.setMessage(builderForValue.build()); + } + bitField0_ |= 0x00400000; + onChanged(); + return this; + } + /** + * .SensorInfo barometer_info = 23; + */ + public Builder mergeBarometerInfo(com.openpositioning.PositionMe.Traj.SensorInfo value) { + if (barometerInfoBuilder_ == null) { + if (((bitField0_ & 0x00400000) != 0) && + barometerInfo_ != null && + barometerInfo_ != com.openpositioning.PositionMe.Traj.SensorInfo.getDefaultInstance()) { + getBarometerInfoBuilder().mergeFrom(value); + } else { + barometerInfo_ = value; + } + } else { + barometerInfoBuilder_.mergeFrom(value); + } + if (barometerInfo_ != null) { + bitField0_ |= 0x00400000; + onChanged(); + } + return this; + } + /** + * .SensorInfo barometer_info = 23; + */ + public Builder clearBarometerInfo() { + bitField0_ = (bitField0_ & ~0x00400000); + barometerInfo_ = null; + if (barometerInfoBuilder_ != null) { + barometerInfoBuilder_.dispose(); + barometerInfoBuilder_ = null; + } + onChanged(); + return this; + } + /** + * .SensorInfo barometer_info = 23; + */ + public com.openpositioning.PositionMe.Traj.SensorInfo.Builder getBarometerInfoBuilder() { + bitField0_ |= 0x00400000; + onChanged(); + return getBarometerInfoFieldBuilder().getBuilder(); + } + /** + * .SensorInfo barometer_info = 23; + */ + public com.openpositioning.PositionMe.Traj.SensorInfoOrBuilder getBarometerInfoOrBuilder() { + if (barometerInfoBuilder_ != null) { + return barometerInfoBuilder_.getMessageOrBuilder(); + } else { + return barometerInfo_ == null ? + com.openpositioning.PositionMe.Traj.SensorInfo.getDefaultInstance() : barometerInfo_; + } + } + /** + * .SensorInfo barometer_info = 23; + */ + private com.google.protobuf.SingleFieldBuilder< + com.openpositioning.PositionMe.Traj.SensorInfo, com.openpositioning.PositionMe.Traj.SensorInfo.Builder, com.openpositioning.PositionMe.Traj.SensorInfoOrBuilder> + getBarometerInfoFieldBuilder() { + if (barometerInfoBuilder_ == null) { + barometerInfoBuilder_ = new com.google.protobuf.SingleFieldBuilder< + com.openpositioning.PositionMe.Traj.SensorInfo, com.openpositioning.PositionMe.Traj.SensorInfo.Builder, com.openpositioning.PositionMe.Traj.SensorInfoOrBuilder>( + getBarometerInfo(), + getParentForChildren(), + isClean()); + barometerInfo_ = null; + } + return barometerInfoBuilder_; + } + + private com.openpositioning.PositionMe.Traj.SensorInfo lightSensorInfo_; + private com.google.protobuf.SingleFieldBuilder< + com.openpositioning.PositionMe.Traj.SensorInfo, com.openpositioning.PositionMe.Traj.SensorInfo.Builder, com.openpositioning.PositionMe.Traj.SensorInfoOrBuilder> lightSensorInfoBuilder_; + /** + * .SensorInfo light_SensorInfo = 24; + * @return Whether the lightSensorInfo field is set. + */ + public boolean hasLightSensorInfo() { + return ((bitField0_ & 0x00800000) != 0); + } + /** + * .SensorInfo light_SensorInfo = 24; + * @return The lightSensorInfo. + */ + public com.openpositioning.PositionMe.Traj.SensorInfo getLightSensorInfo() { + if (lightSensorInfoBuilder_ == null) { + return lightSensorInfo_ == null ? com.openpositioning.PositionMe.Traj.SensorInfo.getDefaultInstance() : lightSensorInfo_; + } else { + return lightSensorInfoBuilder_.getMessage(); + } + } + /** + * .SensorInfo light_SensorInfo = 24; + */ + public Builder setLightSensorInfo(com.openpositioning.PositionMe.Traj.SensorInfo value) { + if (lightSensorInfoBuilder_ == null) { + if (value == null) { + throw new NullPointerException(); + } + lightSensorInfo_ = value; + } else { + lightSensorInfoBuilder_.setMessage(value); + } + bitField0_ |= 0x00800000; + onChanged(); + return this; + } + /** + * .SensorInfo light_SensorInfo = 24; + */ + public Builder setLightSensorInfo( + com.openpositioning.PositionMe.Traj.SensorInfo.Builder builderForValue) { + if (lightSensorInfoBuilder_ == null) { + lightSensorInfo_ = builderForValue.build(); + } else { + lightSensorInfoBuilder_.setMessage(builderForValue.build()); + } + bitField0_ |= 0x00800000; + onChanged(); + return this; + } + /** + * .SensorInfo light_SensorInfo = 24; + */ + public Builder mergeLightSensorInfo(com.openpositioning.PositionMe.Traj.SensorInfo value) { + if (lightSensorInfoBuilder_ == null) { + if (((bitField0_ & 0x00800000) != 0) && + lightSensorInfo_ != null && + lightSensorInfo_ != com.openpositioning.PositionMe.Traj.SensorInfo.getDefaultInstance()) { + getLightSensorInfoBuilder().mergeFrom(value); + } else { + lightSensorInfo_ = value; + } + } else { + lightSensorInfoBuilder_.mergeFrom(value); + } + if (lightSensorInfo_ != null) { + bitField0_ |= 0x00800000; + onChanged(); + } + return this; + } + /** + * .SensorInfo light_SensorInfo = 24; + */ + public Builder clearLightSensorInfo() { + bitField0_ = (bitField0_ & ~0x00800000); + lightSensorInfo_ = null; + if (lightSensorInfoBuilder_ != null) { + lightSensorInfoBuilder_.dispose(); + lightSensorInfoBuilder_ = null; + } + onChanged(); + return this; + } + /** + * .SensorInfo light_SensorInfo = 24; + */ + public com.openpositioning.PositionMe.Traj.SensorInfo.Builder getLightSensorInfoBuilder() { + bitField0_ |= 0x00800000; + onChanged(); + return getLightSensorInfoFieldBuilder().getBuilder(); + } + /** + * .SensorInfo light_SensorInfo = 24; + */ + public com.openpositioning.PositionMe.Traj.SensorInfoOrBuilder getLightSensorInfoOrBuilder() { + if (lightSensorInfoBuilder_ != null) { + return lightSensorInfoBuilder_.getMessageOrBuilder(); + } else { + return lightSensorInfo_ == null ? + com.openpositioning.PositionMe.Traj.SensorInfo.getDefaultInstance() : lightSensorInfo_; + } + } + /** + * .SensorInfo light_SensorInfo = 24; + */ + private com.google.protobuf.SingleFieldBuilder< + com.openpositioning.PositionMe.Traj.SensorInfo, com.openpositioning.PositionMe.Traj.SensorInfo.Builder, com.openpositioning.PositionMe.Traj.SensorInfoOrBuilder> + getLightSensorInfoFieldBuilder() { + if (lightSensorInfoBuilder_ == null) { + lightSensorInfoBuilder_ = new com.google.protobuf.SingleFieldBuilder< + com.openpositioning.PositionMe.Traj.SensorInfo, com.openpositioning.PositionMe.Traj.SensorInfo.Builder, com.openpositioning.PositionMe.Traj.SensorInfoOrBuilder>( + getLightSensorInfo(), + getParentForChildren(), + isClean()); + lightSensorInfo_ = null; + } + return lightSensorInfoBuilder_; + } + + private com.openpositioning.PositionMe.Traj.SensorInfo proximityInfo_; + private com.google.protobuf.SingleFieldBuilder< + com.openpositioning.PositionMe.Traj.SensorInfo, com.openpositioning.PositionMe.Traj.SensorInfo.Builder, com.openpositioning.PositionMe.Traj.SensorInfoOrBuilder> proximityInfoBuilder_; + /** + * .SensorInfo proximity_info = 25; + * @return Whether the proximityInfo field is set. + */ + public boolean hasProximityInfo() { + return ((bitField0_ & 0x01000000) != 0); + } + /** + * .SensorInfo proximity_info = 25; + * @return The proximityInfo. + */ + public com.openpositioning.PositionMe.Traj.SensorInfo getProximityInfo() { + if (proximityInfoBuilder_ == null) { + return proximityInfo_ == null ? com.openpositioning.PositionMe.Traj.SensorInfo.getDefaultInstance() : proximityInfo_; + } else { + return proximityInfoBuilder_.getMessage(); + } + } + /** + * .SensorInfo proximity_info = 25; + */ + public Builder setProximityInfo(com.openpositioning.PositionMe.Traj.SensorInfo value) { + if (proximityInfoBuilder_ == null) { + if (value == null) { + throw new NullPointerException(); + } + proximityInfo_ = value; + } else { + proximityInfoBuilder_.setMessage(value); + } + bitField0_ |= 0x01000000; + onChanged(); + return this; + } + /** + * .SensorInfo proximity_info = 25; + */ + public Builder setProximityInfo( + com.openpositioning.PositionMe.Traj.SensorInfo.Builder builderForValue) { + if (proximityInfoBuilder_ == null) { + proximityInfo_ = builderForValue.build(); + } else { + proximityInfoBuilder_.setMessage(builderForValue.build()); + } + bitField0_ |= 0x01000000; + onChanged(); + return this; + } + /** + * .SensorInfo proximity_info = 25; + */ + public Builder mergeProximityInfo(com.openpositioning.PositionMe.Traj.SensorInfo value) { + if (proximityInfoBuilder_ == null) { + if (((bitField0_ & 0x01000000) != 0) && + proximityInfo_ != null && + proximityInfo_ != com.openpositioning.PositionMe.Traj.SensorInfo.getDefaultInstance()) { + getProximityInfoBuilder().mergeFrom(value); + } else { + proximityInfo_ = value; + } + } else { + proximityInfoBuilder_.mergeFrom(value); + } + if (proximityInfo_ != null) { + bitField0_ |= 0x01000000; + onChanged(); + } + return this; + } + /** + * .SensorInfo proximity_info = 25; + */ + public Builder clearProximityInfo() { + bitField0_ = (bitField0_ & ~0x01000000); + proximityInfo_ = null; + if (proximityInfoBuilder_ != null) { + proximityInfoBuilder_.dispose(); + proximityInfoBuilder_ = null; + } + onChanged(); + return this; + } + /** + * .SensorInfo proximity_info = 25; + */ + public com.openpositioning.PositionMe.Traj.SensorInfo.Builder getProximityInfoBuilder() { + bitField0_ |= 0x01000000; + onChanged(); + return getProximityInfoFieldBuilder().getBuilder(); + } + /** + * .SensorInfo proximity_info = 25; + */ + public com.openpositioning.PositionMe.Traj.SensorInfoOrBuilder getProximityInfoOrBuilder() { + if (proximityInfoBuilder_ != null) { + return proximityInfoBuilder_.getMessageOrBuilder(); + } else { + return proximityInfo_ == null ? + com.openpositioning.PositionMe.Traj.SensorInfo.getDefaultInstance() : proximityInfo_; + } + } + /** + * .SensorInfo proximity_info = 25; + */ + private com.google.protobuf.SingleFieldBuilder< + com.openpositioning.PositionMe.Traj.SensorInfo, com.openpositioning.PositionMe.Traj.SensorInfo.Builder, com.openpositioning.PositionMe.Traj.SensorInfoOrBuilder> + getProximityInfoFieldBuilder() { + if (proximityInfoBuilder_ == null) { + proximityInfoBuilder_ = new com.google.protobuf.SingleFieldBuilder< + com.openpositioning.PositionMe.Traj.SensorInfo, com.openpositioning.PositionMe.Traj.SensorInfo.Builder, com.openpositioning.PositionMe.Traj.SensorInfoOrBuilder>( + getProximityInfo(), + getParentForChildren(), + isClean()); + proximityInfo_ = null; + } + return proximityInfoBuilder_; + } + + private java.util.List testPoints_ = + java.util.Collections.emptyList(); + private void ensureTestPointsIsMutable() { + if (!((bitField0_ & 0x02000000) != 0)) { + testPoints_ = new java.util.ArrayList(testPoints_); + bitField0_ |= 0x02000000; + } + } + + private com.google.protobuf.RepeatedFieldBuilder< + com.openpositioning.PositionMe.Traj.GNSSPosition, com.openpositioning.PositionMe.Traj.GNSSPosition.Builder, com.openpositioning.PositionMe.Traj.GNSSPositionOrBuilder> testPointsBuilder_; + + /** + * repeated .GNSSPosition test_points = 26; + */ + public java.util.List getTestPointsList() { + if (testPointsBuilder_ == null) { + return java.util.Collections.unmodifiableList(testPoints_); + } else { + return testPointsBuilder_.getMessageList(); + } + } + /** + * repeated .GNSSPosition test_points = 26; + */ + public int getTestPointsCount() { + if (testPointsBuilder_ == null) { + return testPoints_.size(); + } else { + return testPointsBuilder_.getCount(); + } + } + /** + * repeated .GNSSPosition test_points = 26; + */ + public com.openpositioning.PositionMe.Traj.GNSSPosition getTestPoints(int index) { + if (testPointsBuilder_ == null) { + return testPoints_.get(index); + } else { + return testPointsBuilder_.getMessage(index); + } + } + /** + * repeated .GNSSPosition test_points = 26; + */ + public Builder setTestPoints( + int index, com.openpositioning.PositionMe.Traj.GNSSPosition value) { + if (testPointsBuilder_ == null) { + if (value == null) { + throw new NullPointerException(); + } + ensureTestPointsIsMutable(); + testPoints_.set(index, value); + onChanged(); + } else { + testPointsBuilder_.setMessage(index, value); + } + return this; + } + /** + * repeated .GNSSPosition test_points = 26; + */ + public Builder setTestPoints( + int index, com.openpositioning.PositionMe.Traj.GNSSPosition.Builder builderForValue) { + if (testPointsBuilder_ == null) { + ensureTestPointsIsMutable(); + testPoints_.set(index, builderForValue.build()); + onChanged(); + } else { + testPointsBuilder_.setMessage(index, builderForValue.build()); + } + return this; + } + /** + * repeated .GNSSPosition test_points = 26; + */ + public Builder addTestPoints(com.openpositioning.PositionMe.Traj.GNSSPosition value) { + if (testPointsBuilder_ == null) { + if (value == null) { + throw new NullPointerException(); + } + ensureTestPointsIsMutable(); + testPoints_.add(value); + onChanged(); + } else { + testPointsBuilder_.addMessage(value); + } + return this; + } + /** + * repeated .GNSSPosition test_points = 26; + */ + public Builder addTestPoints( + int index, com.openpositioning.PositionMe.Traj.GNSSPosition value) { + if (testPointsBuilder_ == null) { + if (value == null) { + throw new NullPointerException(); + } + ensureTestPointsIsMutable(); + testPoints_.add(index, value); + onChanged(); + } else { + testPointsBuilder_.addMessage(index, value); + } + return this; + } + /** + * repeated .GNSSPosition test_points = 26; + */ + public Builder addTestPoints( + com.openpositioning.PositionMe.Traj.GNSSPosition.Builder builderForValue) { + if (testPointsBuilder_ == null) { + ensureTestPointsIsMutable(); + testPoints_.add(builderForValue.build()); + onChanged(); + } else { + testPointsBuilder_.addMessage(builderForValue.build()); + } + return this; + } + /** + * repeated .GNSSPosition test_points = 26; + */ + public Builder addTestPoints( + int index, com.openpositioning.PositionMe.Traj.GNSSPosition.Builder builderForValue) { + if (testPointsBuilder_ == null) { + ensureTestPointsIsMutable(); + testPoints_.add(index, builderForValue.build()); + onChanged(); + } else { + testPointsBuilder_.addMessage(index, builderForValue.build()); + } + return this; + } + /** + * repeated .GNSSPosition test_points = 26; + */ + public Builder addAllTestPoints( + java.lang.Iterable values) { + if (testPointsBuilder_ == null) { + ensureTestPointsIsMutable(); + com.google.protobuf.AbstractMessageLite.Builder.addAll( + values, testPoints_); + onChanged(); + } else { + testPointsBuilder_.addAllMessages(values); + } + return this; + } + /** + * repeated .GNSSPosition test_points = 26; + */ + public Builder clearTestPoints() { + if (testPointsBuilder_ == null) { + testPoints_ = java.util.Collections.emptyList(); + bitField0_ = (bitField0_ & ~0x02000000); + onChanged(); + } else { + testPointsBuilder_.clear(); + } + return this; + } + /** + * repeated .GNSSPosition test_points = 26; + */ + public Builder removeTestPoints(int index) { + if (testPointsBuilder_ == null) { + ensureTestPointsIsMutable(); + testPoints_.remove(index); + onChanged(); + } else { + testPointsBuilder_.remove(index); + } + return this; + } + /** + * repeated .GNSSPosition test_points = 26; + */ + public com.openpositioning.PositionMe.Traj.GNSSPosition.Builder getTestPointsBuilder( + int index) { + return getTestPointsFieldBuilder().getBuilder(index); + } + /** + * repeated .GNSSPosition test_points = 26; + */ + public com.openpositioning.PositionMe.Traj.GNSSPositionOrBuilder getTestPointsOrBuilder( + int index) { + if (testPointsBuilder_ == null) { + return testPoints_.get(index); } else { + return testPointsBuilder_.getMessageOrBuilder(index); + } + } + /** + * repeated .GNSSPosition test_points = 26; + */ + public java.util.List + getTestPointsOrBuilderList() { + if (testPointsBuilder_ != null) { + return testPointsBuilder_.getMessageOrBuilderList(); + } else { + return java.util.Collections.unmodifiableList(testPoints_); + } + } + /** + * repeated .GNSSPosition test_points = 26; + */ + public com.openpositioning.PositionMe.Traj.GNSSPosition.Builder addTestPointsBuilder() { + return getTestPointsFieldBuilder().addBuilder( + com.openpositioning.PositionMe.Traj.GNSSPosition.getDefaultInstance()); + } + /** + * repeated .GNSSPosition test_points = 26; + */ + public com.openpositioning.PositionMe.Traj.GNSSPosition.Builder addTestPointsBuilder( + int index) { + return getTestPointsFieldBuilder().addBuilder( + index, com.openpositioning.PositionMe.Traj.GNSSPosition.getDefaultInstance()); + } + /** + * repeated .GNSSPosition test_points = 26; + */ + public java.util.List + getTestPointsBuilderList() { + return getTestPointsFieldBuilder().getBuilderList(); + } + private com.google.protobuf.RepeatedFieldBuilder< + com.openpositioning.PositionMe.Traj.GNSSPosition, com.openpositioning.PositionMe.Traj.GNSSPosition.Builder, com.openpositioning.PositionMe.Traj.GNSSPositionOrBuilder> + getTestPointsFieldBuilder() { + if (testPointsBuilder_ == null) { + testPointsBuilder_ = new com.google.protobuf.RepeatedFieldBuilder< + com.openpositioning.PositionMe.Traj.GNSSPosition, com.openpositioning.PositionMe.Traj.GNSSPosition.Builder, com.openpositioning.PositionMe.Traj.GNSSPositionOrBuilder>( + testPoints_, + ((bitField0_ & 0x02000000) != 0), + getParentForChildren(), + isClean()); + testPoints_ = null; + } + return testPointsBuilder_; + } + + // @@protoc_insertion_point(builder_scope:Trajectory) + } + + // @@protoc_insertion_point(class_scope:Trajectory) + private static final com.openpositioning.PositionMe.Traj.Trajectory DEFAULT_INSTANCE; + static { + DEFAULT_INSTANCE = new com.openpositioning.PositionMe.Traj.Trajectory(); + } + + public static com.openpositioning.PositionMe.Traj.Trajectory getDefaultInstance() { + return DEFAULT_INSTANCE; + } + + private static final com.google.protobuf.Parser + PARSER = new com.google.protobuf.AbstractParser() { + @java.lang.Override + public Trajectory parsePartialFrom( + com.google.protobuf.CodedInputStream input, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + Builder builder = newBuilder(); + try { + builder.mergeFrom(input, extensionRegistry); + } catch (com.google.protobuf.InvalidProtocolBufferException e) { + throw e.setUnfinishedMessage(builder.buildPartial()); + } catch (com.google.protobuf.UninitializedMessageException e) { + throw e.asInvalidProtocolBufferException().setUnfinishedMessage(builder.buildPartial()); + } catch (java.io.IOException e) { + throw new com.google.protobuf.InvalidProtocolBufferException(e) + .setUnfinishedMessage(builder.buildPartial()); + } + return builder.buildPartial(); + } + }; + + public static com.google.protobuf.Parser parser() { + return PARSER; + } + + @java.lang.Override + public com.google.protobuf.Parser getParserForType() { + return PARSER; + } + + @java.lang.Override + public com.openpositioning.PositionMe.Traj.Trajectory getDefaultInstanceForType() { + return DEFAULT_INSTANCE; + } + + } + + public interface RelativePositionOrBuilder extends + // @@protoc_insertion_point(interface_extends:RelativePosition) + com.google.protobuf.MessageOrBuilder { + + /** + *
+     * milliseconds from the start_timestamp
+     * 
+ * + * int64 relative_timestamp = 1; + * @return The relativeTimestamp. + */ + long getRelativeTimestamp(); + + /** + *
+     * Both in metres. You should implement an algorithm to estimate
+     * these values. The values are always relative to your start point
+     * so the first entry should always be x = 0.0, y = 0.0
+     * 
+ * + * float x = 2; + * @return The x. + */ + float getX(); + + /** + * float y = 3; + * @return The y. + */ + float getY(); + } + /** + * Protobuf type {@code RelativePosition} + */ + public static final class RelativePosition extends + com.google.protobuf.GeneratedMessage implements + // @@protoc_insertion_point(message_implements:RelativePosition) + RelativePositionOrBuilder { + private static final long serialVersionUID = 0L; + static { + com.google.protobuf.RuntimeVersion.validateProtobufGencodeVersion( + com.google.protobuf.RuntimeVersion.RuntimeDomain.PUBLIC, + /* major= */ 4, + /* minor= */ 29, + /* patch= */ 6, + /* suffix= */ "", + RelativePosition.class.getName()); + } + // Use RelativePosition.newBuilder() to construct. + private RelativePosition(com.google.protobuf.GeneratedMessage.Builder builder) { + super(builder); + } + private RelativePosition() { + } + + public static final com.google.protobuf.Descriptors.Descriptor + getDescriptor() { + return com.openpositioning.PositionMe.Traj.internal_static_RelativePosition_descriptor; + } + + @java.lang.Override + protected com.google.protobuf.GeneratedMessage.FieldAccessorTable + internalGetFieldAccessorTable() { + return com.openpositioning.PositionMe.Traj.internal_static_RelativePosition_fieldAccessorTable + .ensureFieldAccessorsInitialized( + com.openpositioning.PositionMe.Traj.RelativePosition.class, com.openpositioning.PositionMe.Traj.RelativePosition.Builder.class); + } + + public static final int RELATIVE_TIMESTAMP_FIELD_NUMBER = 1; + private long relativeTimestamp_ = 0L; + /** + *
+     * milliseconds from the start_timestamp
+     * 
+ * + * int64 relative_timestamp = 1; + * @return The relativeTimestamp. + */ + @java.lang.Override + public long getRelativeTimestamp() { + return relativeTimestamp_; + } + + public static final int X_FIELD_NUMBER = 2; + private float x_ = 0F; + /** + *
+     * Both in metres. You should implement an algorithm to estimate
+     * these values. The values are always relative to your start point
+     * so the first entry should always be x = 0.0, y = 0.0
+     * 
+ * + * float x = 2; + * @return The x. + */ + @java.lang.Override + public float getX() { + return x_; + } + + public static final int Y_FIELD_NUMBER = 3; + private float y_ = 0F; + /** + * float y = 3; + * @return The y. + */ + @java.lang.Override + public float getY() { + return y_; + } + + private byte memoizedIsInitialized = -1; + @java.lang.Override + public final boolean isInitialized() { + byte isInitialized = memoizedIsInitialized; + if (isInitialized == 1) return true; + if (isInitialized == 0) return false; + + memoizedIsInitialized = 1; + return true; + } + + @java.lang.Override + public void writeTo(com.google.protobuf.CodedOutputStream output) + throws java.io.IOException { + if (relativeTimestamp_ != 0L) { + output.writeInt64(1, relativeTimestamp_); + } + if (java.lang.Float.floatToRawIntBits(x_) != 0) { + output.writeFloat(2, x_); + } + if (java.lang.Float.floatToRawIntBits(y_) != 0) { + output.writeFloat(3, y_); + } + getUnknownFields().writeTo(output); + } + + @java.lang.Override + public int getSerializedSize() { + int size = memoizedSize; + if (size != -1) return size; + + size = 0; + if (relativeTimestamp_ != 0L) { + size += com.google.protobuf.CodedOutputStream + .computeInt64Size(1, relativeTimestamp_); + } + if (java.lang.Float.floatToRawIntBits(x_) != 0) { + size += com.google.protobuf.CodedOutputStream + .computeFloatSize(2, x_); + } + if (java.lang.Float.floatToRawIntBits(y_) != 0) { + size += com.google.protobuf.CodedOutputStream + .computeFloatSize(3, y_); + } + size += getUnknownFields().getSerializedSize(); + memoizedSize = size; + return size; + } + + @java.lang.Override + public boolean equals(final java.lang.Object obj) { + if (obj == this) { + return true; + } + if (!(obj instanceof com.openpositioning.PositionMe.Traj.RelativePosition)) { + return super.equals(obj); + } + com.openpositioning.PositionMe.Traj.RelativePosition other = (com.openpositioning.PositionMe.Traj.RelativePosition) obj; + + if (getRelativeTimestamp() + != other.getRelativeTimestamp()) return false; + if (java.lang.Float.floatToIntBits(getX()) + != java.lang.Float.floatToIntBits( + other.getX())) return false; + if (java.lang.Float.floatToIntBits(getY()) + != java.lang.Float.floatToIntBits( + other.getY())) return false; + if (!getUnknownFields().equals(other.getUnknownFields())) return false; + return true; + } + + @java.lang.Override + public int hashCode() { + if (memoizedHashCode != 0) { + return memoizedHashCode; + } + int hash = 41; + hash = (19 * hash) + getDescriptor().hashCode(); + hash = (37 * hash) + RELATIVE_TIMESTAMP_FIELD_NUMBER; + hash = (53 * hash) + com.google.protobuf.Internal.hashLong( + getRelativeTimestamp()); + hash = (37 * hash) + X_FIELD_NUMBER; + hash = (53 * hash) + java.lang.Float.floatToIntBits( + getX()); + hash = (37 * hash) + Y_FIELD_NUMBER; + hash = (53 * hash) + java.lang.Float.floatToIntBits( + getY()); + hash = (29 * hash) + getUnknownFields().hashCode(); + memoizedHashCode = hash; + return hash; + } + + public static com.openpositioning.PositionMe.Traj.RelativePosition parseFrom( + java.nio.ByteBuffer data) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + public static com.openpositioning.PositionMe.Traj.RelativePosition parseFrom( + java.nio.ByteBuffer data, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data, extensionRegistry); + } + public static com.openpositioning.PositionMe.Traj.RelativePosition parseFrom( + com.google.protobuf.ByteString data) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + public static com.openpositioning.PositionMe.Traj.RelativePosition parseFrom( + com.google.protobuf.ByteString data, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data, extensionRegistry); + } + public static com.openpositioning.PositionMe.Traj.RelativePosition parseFrom(byte[] data) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + public static com.openpositioning.PositionMe.Traj.RelativePosition parseFrom( + byte[] data, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data, extensionRegistry); + } + public static com.openpositioning.PositionMe.Traj.RelativePosition parseFrom(java.io.InputStream input) + throws java.io.IOException { + return com.google.protobuf.GeneratedMessage + .parseWithIOException(PARSER, input); + } + public static com.openpositioning.PositionMe.Traj.RelativePosition parseFrom( + java.io.InputStream input, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws java.io.IOException { + return com.google.protobuf.GeneratedMessage + .parseWithIOException(PARSER, input, extensionRegistry); + } + + public static com.openpositioning.PositionMe.Traj.RelativePosition parseDelimitedFrom(java.io.InputStream input) + throws java.io.IOException { + return com.google.protobuf.GeneratedMessage + .parseDelimitedWithIOException(PARSER, input); + } + + public static com.openpositioning.PositionMe.Traj.RelativePosition parseDelimitedFrom( + java.io.InputStream input, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws java.io.IOException { + return com.google.protobuf.GeneratedMessage + .parseDelimitedWithIOException(PARSER, input, extensionRegistry); + } + public static com.openpositioning.PositionMe.Traj.RelativePosition parseFrom( + com.google.protobuf.CodedInputStream input) + throws java.io.IOException { + return com.google.protobuf.GeneratedMessage + .parseWithIOException(PARSER, input); + } + public static com.openpositioning.PositionMe.Traj.RelativePosition parseFrom( + com.google.protobuf.CodedInputStream input, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws java.io.IOException { + return com.google.protobuf.GeneratedMessage + .parseWithIOException(PARSER, input, extensionRegistry); + } + + @java.lang.Override + public Builder newBuilderForType() { return newBuilder(); } + public static Builder newBuilder() { + return DEFAULT_INSTANCE.toBuilder(); + } + public static Builder newBuilder(com.openpositioning.PositionMe.Traj.RelativePosition prototype) { + return DEFAULT_INSTANCE.toBuilder().mergeFrom(prototype); + } + @java.lang.Override + public Builder toBuilder() { + return this == DEFAULT_INSTANCE + ? new Builder() : new Builder().mergeFrom(this); + } + + @java.lang.Override + protected Builder newBuilderForType( + com.google.protobuf.GeneratedMessage.BuilderParent parent) { + Builder builder = new Builder(parent); + return builder; + } + /** + * Protobuf type {@code RelativePosition} + */ + public static final class Builder extends + com.google.protobuf.GeneratedMessage.Builder implements + // @@protoc_insertion_point(builder_implements:RelativePosition) + com.openpositioning.PositionMe.Traj.RelativePositionOrBuilder { + public static final com.google.protobuf.Descriptors.Descriptor + getDescriptor() { + return com.openpositioning.PositionMe.Traj.internal_static_RelativePosition_descriptor; + } + + @java.lang.Override + protected com.google.protobuf.GeneratedMessage.FieldAccessorTable + internalGetFieldAccessorTable() { + return com.openpositioning.PositionMe.Traj.internal_static_RelativePosition_fieldAccessorTable + .ensureFieldAccessorsInitialized( + com.openpositioning.PositionMe.Traj.RelativePosition.class, com.openpositioning.PositionMe.Traj.RelativePosition.Builder.class); + } + + // Construct using com.openpositioning.PositionMe.Traj.RelativePosition.newBuilder() + private Builder() { + + } + + private Builder( + com.google.protobuf.GeneratedMessage.BuilderParent parent) { + super(parent); + + } + @java.lang.Override + public Builder clear() { + super.clear(); + bitField0_ = 0; + relativeTimestamp_ = 0L; + x_ = 0F; + y_ = 0F; + return this; + } + + @java.lang.Override + public com.google.protobuf.Descriptors.Descriptor + getDescriptorForType() { + return com.openpositioning.PositionMe.Traj.internal_static_RelativePosition_descriptor; + } + + @java.lang.Override + public com.openpositioning.PositionMe.Traj.RelativePosition getDefaultInstanceForType() { + return com.openpositioning.PositionMe.Traj.RelativePosition.getDefaultInstance(); + } + + @java.lang.Override + public com.openpositioning.PositionMe.Traj.RelativePosition build() { + com.openpositioning.PositionMe.Traj.RelativePosition result = buildPartial(); + if (!result.isInitialized()) { + throw newUninitializedMessageException(result); + } + return result; + } + + @java.lang.Override + public com.openpositioning.PositionMe.Traj.RelativePosition buildPartial() { + com.openpositioning.PositionMe.Traj.RelativePosition result = new com.openpositioning.PositionMe.Traj.RelativePosition(this); + if (bitField0_ != 0) { buildPartial0(result); } + onBuilt(); + return result; + } + + private void buildPartial0(com.openpositioning.PositionMe.Traj.RelativePosition result) { + int from_bitField0_ = bitField0_; + if (((from_bitField0_ & 0x00000001) != 0)) { + result.relativeTimestamp_ = relativeTimestamp_; + } + if (((from_bitField0_ & 0x00000002) != 0)) { + result.x_ = x_; + } + if (((from_bitField0_ & 0x00000004) != 0)) { + result.y_ = y_; + } + } + + @java.lang.Override + public Builder mergeFrom(com.google.protobuf.Message other) { + if (other instanceof com.openpositioning.PositionMe.Traj.RelativePosition) { + return mergeFrom((com.openpositioning.PositionMe.Traj.RelativePosition)other); + } else { + super.mergeFrom(other); + return this; + } + } + + public Builder mergeFrom(com.openpositioning.PositionMe.Traj.RelativePosition other) { + if (other == com.openpositioning.PositionMe.Traj.RelativePosition.getDefaultInstance()) return this; + if (other.getRelativeTimestamp() != 0L) { + setRelativeTimestamp(other.getRelativeTimestamp()); + } + if (other.getX() != 0F) { + setX(other.getX()); + } + if (other.getY() != 0F) { + setY(other.getY()); + } + this.mergeUnknownFields(other.getUnknownFields()); + onChanged(); + return this; + } + + @java.lang.Override + public final boolean isInitialized() { + return true; + } + + @java.lang.Override + public Builder mergeFrom( + com.google.protobuf.CodedInputStream input, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws java.io.IOException { + if (extensionRegistry == null) { + throw new java.lang.NullPointerException(); + } + try { + boolean done = false; + while (!done) { + int tag = input.readTag(); + switch (tag) { + case 0: + done = true; + break; + case 8: { + relativeTimestamp_ = input.readInt64(); + bitField0_ |= 0x00000001; + break; + } // case 8 + case 21: { + x_ = input.readFloat(); + bitField0_ |= 0x00000002; + break; + } // case 21 + case 29: { + y_ = input.readFloat(); + bitField0_ |= 0x00000004; + break; + } // case 29 + default: { + if (!super.parseUnknownField(input, extensionRegistry, tag)) { + done = true; // was an endgroup tag + } + break; + } // default: + } // switch (tag) + } // while (!done) + } catch (com.google.protobuf.InvalidProtocolBufferException e) { + throw e.unwrapIOException(); + } finally { + onChanged(); + } // finally + return this; + } + private int bitField0_; + + private long relativeTimestamp_ ; + /** + *
+       * milliseconds from the start_timestamp
+       * 
+ * + * int64 relative_timestamp = 1; + * @return The relativeTimestamp. + */ + @java.lang.Override + public long getRelativeTimestamp() { + return relativeTimestamp_; + } + /** + *
+       * milliseconds from the start_timestamp
+       * 
+ * + * int64 relative_timestamp = 1; + * @param value The relativeTimestamp to set. + * @return This builder for chaining. + */ + public Builder setRelativeTimestamp(long value) { + + relativeTimestamp_ = value; + bitField0_ |= 0x00000001; + onChanged(); + return this; + } + /** + *
+       * milliseconds from the start_timestamp
+       * 
+ * + * int64 relative_timestamp = 1; + * @return This builder for chaining. + */ + public Builder clearRelativeTimestamp() { + bitField0_ = (bitField0_ & ~0x00000001); + relativeTimestamp_ = 0L; + onChanged(); + return this; + } + + private float x_ ; + /** + *
+       * Both in metres. You should implement an algorithm to estimate
+       * these values. The values are always relative to your start point
+       * so the first entry should always be x = 0.0, y = 0.0
+       * 
+ * + * float x = 2; + * @return The x. + */ + @java.lang.Override + public float getX() { + return x_; + } + /** + *
+       * Both in metres. You should implement an algorithm to estimate
+       * these values. The values are always relative to your start point
+       * so the first entry should always be x = 0.0, y = 0.0
+       * 
+ * + * float x = 2; + * @param value The x to set. + * @return This builder for chaining. + */ + public Builder setX(float value) { + + x_ = value; + bitField0_ |= 0x00000002; + onChanged(); + return this; + } + /** + *
+       * Both in metres. You should implement an algorithm to estimate
+       * these values. The values are always relative to your start point
+       * so the first entry should always be x = 0.0, y = 0.0
+       * 
+ * + * float x = 2; + * @return This builder for chaining. + */ + public Builder clearX() { + bitField0_ = (bitField0_ & ~0x00000002); + x_ = 0F; + onChanged(); + return this; + } + + private float y_ ; + /** + * float y = 3; + * @return The y. + */ + @java.lang.Override + public float getY() { + return y_; + } + /** + * float y = 3; + * @param value The y to set. + * @return This builder for chaining. + */ + public Builder setY(float value) { + + y_ = value; + bitField0_ |= 0x00000004; + onChanged(); + return this; + } + /** + * float y = 3; + * @return This builder for chaining. + */ + public Builder clearY() { + bitField0_ = (bitField0_ & ~0x00000004); + y_ = 0F; + onChanged(); + return this; + } + + // @@protoc_insertion_point(builder_scope:RelativePosition) + } + + // @@protoc_insertion_point(class_scope:RelativePosition) + private static final com.openpositioning.PositionMe.Traj.RelativePosition DEFAULT_INSTANCE; + static { + DEFAULT_INSTANCE = new com.openpositioning.PositionMe.Traj.RelativePosition(); + } + + public static com.openpositioning.PositionMe.Traj.RelativePosition getDefaultInstance() { + return DEFAULT_INSTANCE; + } + + private static final com.google.protobuf.Parser + PARSER = new com.google.protobuf.AbstractParser() { + @java.lang.Override + public RelativePosition parsePartialFrom( + com.google.protobuf.CodedInputStream input, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + Builder builder = newBuilder(); + try { + builder.mergeFrom(input, extensionRegistry); + } catch (com.google.protobuf.InvalidProtocolBufferException e) { + throw e.setUnfinishedMessage(builder.buildPartial()); + } catch (com.google.protobuf.UninitializedMessageException e) { + throw e.asInvalidProtocolBufferException().setUnfinishedMessage(builder.buildPartial()); + } catch (java.io.IOException e) { + throw new com.google.protobuf.InvalidProtocolBufferException(e) + .setUnfinishedMessage(builder.buildPartial()); + } + return builder.buildPartial(); + } + }; + + public static com.google.protobuf.Parser parser() { + return PARSER; + } + + @java.lang.Override + public com.google.protobuf.Parser getParserForType() { + return PARSER; + } + + @java.lang.Override + public com.openpositioning.PositionMe.Traj.RelativePosition getDefaultInstanceForType() { + return DEFAULT_INSTANCE; + } + + } + + public interface IMUReadingOrBuilder extends + // @@protoc_insertion_point(interface_extends:IMUReading) + com.google.protobuf.MessageOrBuilder { + + /** + *
+     * milliseconds
+     * 
+ * + * int64 relative_timestamp = 1; + * @return The relativeTimestamp. + */ + long getRelativeTimestamp(); + + /** + *
+     * Accelerometer [m/s^2]
+     * 
+ * + * .Vector3 acc = 2; + * @return Whether the acc field is set. + */ + boolean hasAcc(); + /** + *
+     * Accelerometer [m/s^2]
+     * 
+ * + * .Vector3 acc = 2; + * @return The acc. + */ + com.openpositioning.PositionMe.Traj.Vector3 getAcc(); + /** + *
+     * Accelerometer [m/s^2]
+     * 
+ * + * .Vector3 acc = 2; + */ + com.openpositioning.PositionMe.Traj.Vector3OrBuilder getAccOrBuilder(); + + /** + *
+     * Gyroscope [radians/s]
+     * 
+ * + * .Vector3 gyr = 3; + * @return Whether the gyr field is set. + */ + boolean hasGyr(); + /** + *
+     * Gyroscope [radians/s]
+     * 
+ * + * .Vector3 gyr = 3; + * @return The gyr. + */ + com.openpositioning.PositionMe.Traj.Vector3 getGyr(); + /** + *
+     * Gyroscope [radians/s]
+     * 
+ * + * .Vector3 gyr = 3; + */ + com.openpositioning.PositionMe.Traj.Vector3OrBuilder getGyrOrBuilder(); + + /** + *
+     * Orientation [unitless], 4 components should square sum to ~1
+     * 
+ * + * .Quaternion rotation_vector = 4; + * @return Whether the rotationVector field is set. + */ + boolean hasRotationVector(); + /** + *
+     * Orientation [unitless], 4 components should square sum to ~1
+     * 
+ * + * .Quaternion rotation_vector = 4; + * @return The rotationVector. + */ + com.openpositioning.PositionMe.Traj.Quaternion getRotationVector(); + /** + *
+     * Orientation [unitless], 4 components should square sum to ~1
+     * 
+ * + * .Quaternion rotation_vector = 4; + */ + com.openpositioning.PositionMe.Traj.QuaternionOrBuilder getRotationVectorOrBuilder(); + + /** + *
+     * Number of steps so far
+     * 
+ * + * int32 step_count = 5; + * @return The stepCount. + */ + int getStepCount(); + } + /** + * Protobuf type {@code IMUReading} + */ + public static final class IMUReading extends + com.google.protobuf.GeneratedMessage implements + // @@protoc_insertion_point(message_implements:IMUReading) + IMUReadingOrBuilder { + private static final long serialVersionUID = 0L; + static { + com.google.protobuf.RuntimeVersion.validateProtobufGencodeVersion( + com.google.protobuf.RuntimeVersion.RuntimeDomain.PUBLIC, + /* major= */ 4, + /* minor= */ 29, + /* patch= */ 6, + /* suffix= */ "", + IMUReading.class.getName()); + } + // Use IMUReading.newBuilder() to construct. + private IMUReading(com.google.protobuf.GeneratedMessage.Builder builder) { + super(builder); + } + private IMUReading() { + } + + public static final com.google.protobuf.Descriptors.Descriptor + getDescriptor() { + return com.openpositioning.PositionMe.Traj.internal_static_IMUReading_descriptor; + } + + @java.lang.Override + protected com.google.protobuf.GeneratedMessage.FieldAccessorTable + internalGetFieldAccessorTable() { + return com.openpositioning.PositionMe.Traj.internal_static_IMUReading_fieldAccessorTable + .ensureFieldAccessorsInitialized( + com.openpositioning.PositionMe.Traj.IMUReading.class, com.openpositioning.PositionMe.Traj.IMUReading.Builder.class); + } + + private int bitField0_; + public static final int RELATIVE_TIMESTAMP_FIELD_NUMBER = 1; + private long relativeTimestamp_ = 0L; + /** + *
+     * milliseconds
+     * 
+ * + * int64 relative_timestamp = 1; + * @return The relativeTimestamp. + */ + @java.lang.Override + public long getRelativeTimestamp() { + return relativeTimestamp_; + } + + public static final int ACC_FIELD_NUMBER = 2; + private com.openpositioning.PositionMe.Traj.Vector3 acc_; + /** + *
+     * Accelerometer [m/s^2]
+     * 
+ * + * .Vector3 acc = 2; + * @return Whether the acc field is set. + */ + @java.lang.Override + public boolean hasAcc() { + return ((bitField0_ & 0x00000001) != 0); + } + /** + *
+     * Accelerometer [m/s^2]
+     * 
+ * + * .Vector3 acc = 2; + * @return The acc. + */ + @java.lang.Override + public com.openpositioning.PositionMe.Traj.Vector3 getAcc() { + return acc_ == null ? com.openpositioning.PositionMe.Traj.Vector3.getDefaultInstance() : acc_; + } + /** + *
+     * Accelerometer [m/s^2]
+     * 
+ * + * .Vector3 acc = 2; + */ + @java.lang.Override + public com.openpositioning.PositionMe.Traj.Vector3OrBuilder getAccOrBuilder() { + return acc_ == null ? com.openpositioning.PositionMe.Traj.Vector3.getDefaultInstance() : acc_; + } + + public static final int GYR_FIELD_NUMBER = 3; + private com.openpositioning.PositionMe.Traj.Vector3 gyr_; + /** + *
+     * Gyroscope [radians/s]
+     * 
+ * + * .Vector3 gyr = 3; + * @return Whether the gyr field is set. + */ + @java.lang.Override + public boolean hasGyr() { + return ((bitField0_ & 0x00000002) != 0); + } + /** + *
+     * Gyroscope [radians/s]
+     * 
+ * + * .Vector3 gyr = 3; + * @return The gyr. + */ + @java.lang.Override + public com.openpositioning.PositionMe.Traj.Vector3 getGyr() { + return gyr_ == null ? com.openpositioning.PositionMe.Traj.Vector3.getDefaultInstance() : gyr_; + } + /** + *
+     * Gyroscope [radians/s]
+     * 
+ * + * .Vector3 gyr = 3; + */ + @java.lang.Override + public com.openpositioning.PositionMe.Traj.Vector3OrBuilder getGyrOrBuilder() { + return gyr_ == null ? com.openpositioning.PositionMe.Traj.Vector3.getDefaultInstance() : gyr_; + } + + public static final int ROTATION_VECTOR_FIELD_NUMBER = 4; + private com.openpositioning.PositionMe.Traj.Quaternion rotationVector_; + /** + *
+     * Orientation [unitless], 4 components should square sum to ~1
+     * 
+ * + * .Quaternion rotation_vector = 4; + * @return Whether the rotationVector field is set. + */ + @java.lang.Override + public boolean hasRotationVector() { + return ((bitField0_ & 0x00000004) != 0); + } + /** + *
+     * Orientation [unitless], 4 components should square sum to ~1
+     * 
+ * + * .Quaternion rotation_vector = 4; + * @return The rotationVector. + */ + @java.lang.Override + public com.openpositioning.PositionMe.Traj.Quaternion getRotationVector() { + return rotationVector_ == null ? com.openpositioning.PositionMe.Traj.Quaternion.getDefaultInstance() : rotationVector_; + } + /** + *
+     * Orientation [unitless], 4 components should square sum to ~1
+     * 
+ * + * .Quaternion rotation_vector = 4; + */ + @java.lang.Override + public com.openpositioning.PositionMe.Traj.QuaternionOrBuilder getRotationVectorOrBuilder() { + return rotationVector_ == null ? com.openpositioning.PositionMe.Traj.Quaternion.getDefaultInstance() : rotationVector_; + } + + public static final int STEP_COUNT_FIELD_NUMBER = 5; + private int stepCount_ = 0; + /** + *
+     * Number of steps so far
+     * 
+ * + * int32 step_count = 5; + * @return The stepCount. + */ + @java.lang.Override + public int getStepCount() { + return stepCount_; + } + + private byte memoizedIsInitialized = -1; + @java.lang.Override + public final boolean isInitialized() { + byte isInitialized = memoizedIsInitialized; + if (isInitialized == 1) return true; + if (isInitialized == 0) return false; + + memoizedIsInitialized = 1; + return true; + } + + @java.lang.Override + public void writeTo(com.google.protobuf.CodedOutputStream output) + throws java.io.IOException { + if (relativeTimestamp_ != 0L) { + output.writeInt64(1, relativeTimestamp_); + } + if (((bitField0_ & 0x00000001) != 0)) { + output.writeMessage(2, getAcc()); + } + if (((bitField0_ & 0x00000002) != 0)) { + output.writeMessage(3, getGyr()); + } + if (((bitField0_ & 0x00000004) != 0)) { + output.writeMessage(4, getRotationVector()); + } + if (stepCount_ != 0) { + output.writeInt32(5, stepCount_); + } + getUnknownFields().writeTo(output); + } + + @java.lang.Override + public int getSerializedSize() { + int size = memoizedSize; + if (size != -1) return size; + + size = 0; + if (relativeTimestamp_ != 0L) { + size += com.google.protobuf.CodedOutputStream + .computeInt64Size(1, relativeTimestamp_); + } + if (((bitField0_ & 0x00000001) != 0)) { + size += com.google.protobuf.CodedOutputStream + .computeMessageSize(2, getAcc()); + } + if (((bitField0_ & 0x00000002) != 0)) { + size += com.google.protobuf.CodedOutputStream + .computeMessageSize(3, getGyr()); + } + if (((bitField0_ & 0x00000004) != 0)) { + size += com.google.protobuf.CodedOutputStream + .computeMessageSize(4, getRotationVector()); + } + if (stepCount_ != 0) { + size += com.google.protobuf.CodedOutputStream + .computeInt32Size(5, stepCount_); + } + size += getUnknownFields().getSerializedSize(); + memoizedSize = size; + return size; + } + + @java.lang.Override + public boolean equals(final java.lang.Object obj) { + if (obj == this) { + return true; + } + if (!(obj instanceof com.openpositioning.PositionMe.Traj.IMUReading)) { + return super.equals(obj); + } + com.openpositioning.PositionMe.Traj.IMUReading other = (com.openpositioning.PositionMe.Traj.IMUReading) obj; + + if (getRelativeTimestamp() + != other.getRelativeTimestamp()) return false; + if (hasAcc() != other.hasAcc()) return false; + if (hasAcc()) { + if (!getAcc() + .equals(other.getAcc())) return false; + } + if (hasGyr() != other.hasGyr()) return false; + if (hasGyr()) { + if (!getGyr() + .equals(other.getGyr())) return false; + } + if (hasRotationVector() != other.hasRotationVector()) return false; + if (hasRotationVector()) { + if (!getRotationVector() + .equals(other.getRotationVector())) return false; + } + if (getStepCount() + != other.getStepCount()) return false; + if (!getUnknownFields().equals(other.getUnknownFields())) return false; + return true; + } + + @java.lang.Override + public int hashCode() { + if (memoizedHashCode != 0) { + return memoizedHashCode; + } + int hash = 41; + hash = (19 * hash) + getDescriptor().hashCode(); + hash = (37 * hash) + RELATIVE_TIMESTAMP_FIELD_NUMBER; + hash = (53 * hash) + com.google.protobuf.Internal.hashLong( + getRelativeTimestamp()); + if (hasAcc()) { + hash = (37 * hash) + ACC_FIELD_NUMBER; + hash = (53 * hash) + getAcc().hashCode(); + } + if (hasGyr()) { + hash = (37 * hash) + GYR_FIELD_NUMBER; + hash = (53 * hash) + getGyr().hashCode(); + } + if (hasRotationVector()) { + hash = (37 * hash) + ROTATION_VECTOR_FIELD_NUMBER; + hash = (53 * hash) + getRotationVector().hashCode(); + } + hash = (37 * hash) + STEP_COUNT_FIELD_NUMBER; + hash = (53 * hash) + getStepCount(); + hash = (29 * hash) + getUnknownFields().hashCode(); + memoizedHashCode = hash; + return hash; + } + + public static com.openpositioning.PositionMe.Traj.IMUReading parseFrom( + java.nio.ByteBuffer data) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + public static com.openpositioning.PositionMe.Traj.IMUReading parseFrom( + java.nio.ByteBuffer data, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data, extensionRegistry); + } + public static com.openpositioning.PositionMe.Traj.IMUReading parseFrom( + com.google.protobuf.ByteString data) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + public static com.openpositioning.PositionMe.Traj.IMUReading parseFrom( + com.google.protobuf.ByteString data, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data, extensionRegistry); + } + public static com.openpositioning.PositionMe.Traj.IMUReading parseFrom(byte[] data) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + public static com.openpositioning.PositionMe.Traj.IMUReading parseFrom( + byte[] data, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data, extensionRegistry); + } + public static com.openpositioning.PositionMe.Traj.IMUReading parseFrom(java.io.InputStream input) + throws java.io.IOException { + return com.google.protobuf.GeneratedMessage + .parseWithIOException(PARSER, input); + } + public static com.openpositioning.PositionMe.Traj.IMUReading parseFrom( + java.io.InputStream input, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws java.io.IOException { + return com.google.protobuf.GeneratedMessage + .parseWithIOException(PARSER, input, extensionRegistry); + } + + public static com.openpositioning.PositionMe.Traj.IMUReading parseDelimitedFrom(java.io.InputStream input) + throws java.io.IOException { + return com.google.protobuf.GeneratedMessage + .parseDelimitedWithIOException(PARSER, input); + } + + public static com.openpositioning.PositionMe.Traj.IMUReading parseDelimitedFrom( + java.io.InputStream input, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws java.io.IOException { + return com.google.protobuf.GeneratedMessage + .parseDelimitedWithIOException(PARSER, input, extensionRegistry); + } + public static com.openpositioning.PositionMe.Traj.IMUReading parseFrom( + com.google.protobuf.CodedInputStream input) + throws java.io.IOException { + return com.google.protobuf.GeneratedMessage + .parseWithIOException(PARSER, input); + } + public static com.openpositioning.PositionMe.Traj.IMUReading parseFrom( + com.google.protobuf.CodedInputStream input, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws java.io.IOException { + return com.google.protobuf.GeneratedMessage + .parseWithIOException(PARSER, input, extensionRegistry); + } + + @java.lang.Override + public Builder newBuilderForType() { return newBuilder(); } + public static Builder newBuilder() { + return DEFAULT_INSTANCE.toBuilder(); + } + public static Builder newBuilder(com.openpositioning.PositionMe.Traj.IMUReading prototype) { + return DEFAULT_INSTANCE.toBuilder().mergeFrom(prototype); + } + @java.lang.Override + public Builder toBuilder() { + return this == DEFAULT_INSTANCE + ? new Builder() : new Builder().mergeFrom(this); + } + + @java.lang.Override + protected Builder newBuilderForType( + com.google.protobuf.GeneratedMessage.BuilderParent parent) { + Builder builder = new Builder(parent); + return builder; + } + /** + * Protobuf type {@code IMUReading} + */ + public static final class Builder extends + com.google.protobuf.GeneratedMessage.Builder implements + // @@protoc_insertion_point(builder_implements:IMUReading) + com.openpositioning.PositionMe.Traj.IMUReadingOrBuilder { + public static final com.google.protobuf.Descriptors.Descriptor + getDescriptor() { + return com.openpositioning.PositionMe.Traj.internal_static_IMUReading_descriptor; + } + + @java.lang.Override + protected com.google.protobuf.GeneratedMessage.FieldAccessorTable + internalGetFieldAccessorTable() { + return com.openpositioning.PositionMe.Traj.internal_static_IMUReading_fieldAccessorTable + .ensureFieldAccessorsInitialized( + com.openpositioning.PositionMe.Traj.IMUReading.class, com.openpositioning.PositionMe.Traj.IMUReading.Builder.class); + } + + // Construct using com.openpositioning.PositionMe.Traj.IMUReading.newBuilder() + private Builder() { + maybeForceBuilderInitialization(); + } + + private Builder( + com.google.protobuf.GeneratedMessage.BuilderParent parent) { + super(parent); + maybeForceBuilderInitialization(); + } + private void maybeForceBuilderInitialization() { + if (com.google.protobuf.GeneratedMessage + .alwaysUseFieldBuilders) { + getAccFieldBuilder(); + getGyrFieldBuilder(); + getRotationVectorFieldBuilder(); + } + } + @java.lang.Override + public Builder clear() { + super.clear(); + bitField0_ = 0; + relativeTimestamp_ = 0L; + acc_ = null; + if (accBuilder_ != null) { + accBuilder_.dispose(); + accBuilder_ = null; + } + gyr_ = null; + if (gyrBuilder_ != null) { + gyrBuilder_.dispose(); + gyrBuilder_ = null; + } + rotationVector_ = null; + if (rotationVectorBuilder_ != null) { + rotationVectorBuilder_.dispose(); + rotationVectorBuilder_ = null; + } + stepCount_ = 0; + return this; + } + + @java.lang.Override + public com.google.protobuf.Descriptors.Descriptor + getDescriptorForType() { + return com.openpositioning.PositionMe.Traj.internal_static_IMUReading_descriptor; + } + + @java.lang.Override + public com.openpositioning.PositionMe.Traj.IMUReading getDefaultInstanceForType() { + return com.openpositioning.PositionMe.Traj.IMUReading.getDefaultInstance(); + } + + @java.lang.Override + public com.openpositioning.PositionMe.Traj.IMUReading build() { + com.openpositioning.PositionMe.Traj.IMUReading result = buildPartial(); + if (!result.isInitialized()) { + throw newUninitializedMessageException(result); + } + return result; + } + + @java.lang.Override + public com.openpositioning.PositionMe.Traj.IMUReading buildPartial() { + com.openpositioning.PositionMe.Traj.IMUReading result = new com.openpositioning.PositionMe.Traj.IMUReading(this); + if (bitField0_ != 0) { buildPartial0(result); } + onBuilt(); + return result; + } + + private void buildPartial0(com.openpositioning.PositionMe.Traj.IMUReading result) { + int from_bitField0_ = bitField0_; + if (((from_bitField0_ & 0x00000001) != 0)) { + result.relativeTimestamp_ = relativeTimestamp_; + } + int to_bitField0_ = 0; + if (((from_bitField0_ & 0x00000002) != 0)) { + result.acc_ = accBuilder_ == null + ? acc_ + : accBuilder_.build(); + to_bitField0_ |= 0x00000001; + } + if (((from_bitField0_ & 0x00000004) != 0)) { + result.gyr_ = gyrBuilder_ == null + ? gyr_ + : gyrBuilder_.build(); + to_bitField0_ |= 0x00000002; + } + if (((from_bitField0_ & 0x00000008) != 0)) { + result.rotationVector_ = rotationVectorBuilder_ == null + ? rotationVector_ + : rotationVectorBuilder_.build(); + to_bitField0_ |= 0x00000004; + } + if (((from_bitField0_ & 0x00000010) != 0)) { + result.stepCount_ = stepCount_; + } + result.bitField0_ |= to_bitField0_; + } + + @java.lang.Override + public Builder mergeFrom(com.google.protobuf.Message other) { + if (other instanceof com.openpositioning.PositionMe.Traj.IMUReading) { + return mergeFrom((com.openpositioning.PositionMe.Traj.IMUReading)other); + } else { + super.mergeFrom(other); + return this; + } + } + + public Builder mergeFrom(com.openpositioning.PositionMe.Traj.IMUReading other) { + if (other == com.openpositioning.PositionMe.Traj.IMUReading.getDefaultInstance()) return this; + if (other.getRelativeTimestamp() != 0L) { + setRelativeTimestamp(other.getRelativeTimestamp()); + } + if (other.hasAcc()) { + mergeAcc(other.getAcc()); + } + if (other.hasGyr()) { + mergeGyr(other.getGyr()); + } + if (other.hasRotationVector()) { + mergeRotationVector(other.getRotationVector()); + } + if (other.getStepCount() != 0) { + setStepCount(other.getStepCount()); + } + this.mergeUnknownFields(other.getUnknownFields()); + onChanged(); + return this; + } + + @java.lang.Override + public final boolean isInitialized() { + return true; + } + + @java.lang.Override + public Builder mergeFrom( + com.google.protobuf.CodedInputStream input, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws java.io.IOException { + if (extensionRegistry == null) { + throw new java.lang.NullPointerException(); + } + try { + boolean done = false; + while (!done) { + int tag = input.readTag(); + switch (tag) { + case 0: + done = true; + break; + case 8: { + relativeTimestamp_ = input.readInt64(); + bitField0_ |= 0x00000001; + break; + } // case 8 + case 18: { + input.readMessage( + getAccFieldBuilder().getBuilder(), + extensionRegistry); + bitField0_ |= 0x00000002; + break; + } // case 18 + case 26: { + input.readMessage( + getGyrFieldBuilder().getBuilder(), + extensionRegistry); + bitField0_ |= 0x00000004; + break; + } // case 26 + case 34: { + input.readMessage( + getRotationVectorFieldBuilder().getBuilder(), + extensionRegistry); + bitField0_ |= 0x00000008; + break; + } // case 34 + case 40: { + stepCount_ = input.readInt32(); + bitField0_ |= 0x00000010; + break; + } // case 40 + default: { + if (!super.parseUnknownField(input, extensionRegistry, tag)) { + done = true; // was an endgroup tag + } + break; + } // default: + } // switch (tag) + } // while (!done) + } catch (com.google.protobuf.InvalidProtocolBufferException e) { + throw e.unwrapIOException(); + } finally { + onChanged(); + } // finally + return this; + } + private int bitField0_; + + private long relativeTimestamp_ ; + /** + *
+       * milliseconds
+       * 
+ * + * int64 relative_timestamp = 1; + * @return The relativeTimestamp. + */ + @java.lang.Override + public long getRelativeTimestamp() { + return relativeTimestamp_; + } + /** + *
+       * milliseconds
+       * 
+ * + * int64 relative_timestamp = 1; + * @param value The relativeTimestamp to set. + * @return This builder for chaining. + */ + public Builder setRelativeTimestamp(long value) { + + relativeTimestamp_ = value; + bitField0_ |= 0x00000001; + onChanged(); + return this; + } + /** + *
+       * milliseconds
+       * 
+ * + * int64 relative_timestamp = 1; + * @return This builder for chaining. + */ + public Builder clearRelativeTimestamp() { + bitField0_ = (bitField0_ & ~0x00000001); + relativeTimestamp_ = 0L; + onChanged(); + return this; + } + + private com.openpositioning.PositionMe.Traj.Vector3 acc_; + private com.google.protobuf.SingleFieldBuilder< + com.openpositioning.PositionMe.Traj.Vector3, com.openpositioning.PositionMe.Traj.Vector3.Builder, com.openpositioning.PositionMe.Traj.Vector3OrBuilder> accBuilder_; + /** + *
+       * Accelerometer [m/s^2]
+       * 
+ * + * .Vector3 acc = 2; + * @return Whether the acc field is set. + */ + public boolean hasAcc() { + return ((bitField0_ & 0x00000002) != 0); + } + /** + *
+       * Accelerometer [m/s^2]
+       * 
+ * + * .Vector3 acc = 2; + * @return The acc. + */ + public com.openpositioning.PositionMe.Traj.Vector3 getAcc() { + if (accBuilder_ == null) { + return acc_ == null ? com.openpositioning.PositionMe.Traj.Vector3.getDefaultInstance() : acc_; + } else { + return accBuilder_.getMessage(); + } + } + /** + *
+       * Accelerometer [m/s^2]
+       * 
+ * + * .Vector3 acc = 2; + */ + public Builder setAcc(com.openpositioning.PositionMe.Traj.Vector3 value) { + if (accBuilder_ == null) { + if (value == null) { + throw new NullPointerException(); + } + acc_ = value; + } else { + accBuilder_.setMessage(value); + } + bitField0_ |= 0x00000002; + onChanged(); + return this; + } + /** + *
+       * Accelerometer [m/s^2]
+       * 
+ * + * .Vector3 acc = 2; + */ + public Builder setAcc( + com.openpositioning.PositionMe.Traj.Vector3.Builder builderForValue) { + if (accBuilder_ == null) { + acc_ = builderForValue.build(); + } else { + accBuilder_.setMessage(builderForValue.build()); + } + bitField0_ |= 0x00000002; + onChanged(); + return this; + } + /** + *
+       * Accelerometer [m/s^2]
+       * 
+ * + * .Vector3 acc = 2; + */ + public Builder mergeAcc(com.openpositioning.PositionMe.Traj.Vector3 value) { + if (accBuilder_ == null) { + if (((bitField0_ & 0x00000002) != 0) && + acc_ != null && + acc_ != com.openpositioning.PositionMe.Traj.Vector3.getDefaultInstance()) { + getAccBuilder().mergeFrom(value); + } else { + acc_ = value; + } + } else { + accBuilder_.mergeFrom(value); + } + if (acc_ != null) { + bitField0_ |= 0x00000002; + onChanged(); + } + return this; + } + /** + *
+       * Accelerometer [m/s^2]
+       * 
+ * + * .Vector3 acc = 2; + */ + public Builder clearAcc() { + bitField0_ = (bitField0_ & ~0x00000002); + acc_ = null; + if (accBuilder_ != null) { + accBuilder_.dispose(); + accBuilder_ = null; + } + onChanged(); + return this; + } + /** + *
+       * Accelerometer [m/s^2]
+       * 
+ * + * .Vector3 acc = 2; + */ + public com.openpositioning.PositionMe.Traj.Vector3.Builder getAccBuilder() { + bitField0_ |= 0x00000002; + onChanged(); + return getAccFieldBuilder().getBuilder(); + } + /** + *
+       * Accelerometer [m/s^2]
+       * 
+ * + * .Vector3 acc = 2; + */ + public com.openpositioning.PositionMe.Traj.Vector3OrBuilder getAccOrBuilder() { + if (accBuilder_ != null) { + return accBuilder_.getMessageOrBuilder(); + } else { + return acc_ == null ? + com.openpositioning.PositionMe.Traj.Vector3.getDefaultInstance() : acc_; + } + } + /** + *
+       * Accelerometer [m/s^2]
+       * 
+ * + * .Vector3 acc = 2; + */ + private com.google.protobuf.SingleFieldBuilder< + com.openpositioning.PositionMe.Traj.Vector3, com.openpositioning.PositionMe.Traj.Vector3.Builder, com.openpositioning.PositionMe.Traj.Vector3OrBuilder> + getAccFieldBuilder() { + if (accBuilder_ == null) { + accBuilder_ = new com.google.protobuf.SingleFieldBuilder< + com.openpositioning.PositionMe.Traj.Vector3, com.openpositioning.PositionMe.Traj.Vector3.Builder, com.openpositioning.PositionMe.Traj.Vector3OrBuilder>( + getAcc(), + getParentForChildren(), + isClean()); + acc_ = null; + } + return accBuilder_; + } + + private com.openpositioning.PositionMe.Traj.Vector3 gyr_; + private com.google.protobuf.SingleFieldBuilder< + com.openpositioning.PositionMe.Traj.Vector3, com.openpositioning.PositionMe.Traj.Vector3.Builder, com.openpositioning.PositionMe.Traj.Vector3OrBuilder> gyrBuilder_; + /** + *
+       * Gyroscope [radians/s]
+       * 
+ * + * .Vector3 gyr = 3; + * @return Whether the gyr field is set. + */ + public boolean hasGyr() { + return ((bitField0_ & 0x00000004) != 0); + } + /** + *
+       * Gyroscope [radians/s]
+       * 
+ * + * .Vector3 gyr = 3; + * @return The gyr. + */ + public com.openpositioning.PositionMe.Traj.Vector3 getGyr() { + if (gyrBuilder_ == null) { + return gyr_ == null ? com.openpositioning.PositionMe.Traj.Vector3.getDefaultInstance() : gyr_; + } else { + return gyrBuilder_.getMessage(); + } + } + /** + *
+       * Gyroscope [radians/s]
+       * 
+ * + * .Vector3 gyr = 3; + */ + public Builder setGyr(com.openpositioning.PositionMe.Traj.Vector3 value) { + if (gyrBuilder_ == null) { + if (value == null) { + throw new NullPointerException(); + } + gyr_ = value; + } else { + gyrBuilder_.setMessage(value); + } + bitField0_ |= 0x00000004; + onChanged(); + return this; + } + /** + *
+       * Gyroscope [radians/s]
+       * 
+ * + * .Vector3 gyr = 3; + */ + public Builder setGyr( + com.openpositioning.PositionMe.Traj.Vector3.Builder builderForValue) { + if (gyrBuilder_ == null) { + gyr_ = builderForValue.build(); + } else { + gyrBuilder_.setMessage(builderForValue.build()); + } + bitField0_ |= 0x00000004; + onChanged(); + return this; + } + /** + *
+       * Gyroscope [radians/s]
+       * 
+ * + * .Vector3 gyr = 3; + */ + public Builder mergeGyr(com.openpositioning.PositionMe.Traj.Vector3 value) { + if (gyrBuilder_ == null) { + if (((bitField0_ & 0x00000004) != 0) && + gyr_ != null && + gyr_ != com.openpositioning.PositionMe.Traj.Vector3.getDefaultInstance()) { + getGyrBuilder().mergeFrom(value); + } else { + gyr_ = value; + } + } else { + gyrBuilder_.mergeFrom(value); + } + if (gyr_ != null) { + bitField0_ |= 0x00000004; + onChanged(); + } + return this; + } + /** + *
+       * Gyroscope [radians/s]
+       * 
+ * + * .Vector3 gyr = 3; + */ + public Builder clearGyr() { + bitField0_ = (bitField0_ & ~0x00000004); + gyr_ = null; + if (gyrBuilder_ != null) { + gyrBuilder_.dispose(); + gyrBuilder_ = null; + } + onChanged(); + return this; + } + /** + *
+       * Gyroscope [radians/s]
+       * 
+ * + * .Vector3 gyr = 3; + */ + public com.openpositioning.PositionMe.Traj.Vector3.Builder getGyrBuilder() { + bitField0_ |= 0x00000004; + onChanged(); + return getGyrFieldBuilder().getBuilder(); + } + /** + *
+       * Gyroscope [radians/s]
+       * 
+ * + * .Vector3 gyr = 3; + */ + public com.openpositioning.PositionMe.Traj.Vector3OrBuilder getGyrOrBuilder() { + if (gyrBuilder_ != null) { + return gyrBuilder_.getMessageOrBuilder(); + } else { + return gyr_ == null ? + com.openpositioning.PositionMe.Traj.Vector3.getDefaultInstance() : gyr_; + } + } + /** + *
+       * Gyroscope [radians/s]
+       * 
+ * + * .Vector3 gyr = 3; + */ + private com.google.protobuf.SingleFieldBuilder< + com.openpositioning.PositionMe.Traj.Vector3, com.openpositioning.PositionMe.Traj.Vector3.Builder, com.openpositioning.PositionMe.Traj.Vector3OrBuilder> + getGyrFieldBuilder() { + if (gyrBuilder_ == null) { + gyrBuilder_ = new com.google.protobuf.SingleFieldBuilder< + com.openpositioning.PositionMe.Traj.Vector3, com.openpositioning.PositionMe.Traj.Vector3.Builder, com.openpositioning.PositionMe.Traj.Vector3OrBuilder>( + getGyr(), + getParentForChildren(), + isClean()); + gyr_ = null; + } + return gyrBuilder_; + } + + private com.openpositioning.PositionMe.Traj.Quaternion rotationVector_; + private com.google.protobuf.SingleFieldBuilder< + com.openpositioning.PositionMe.Traj.Quaternion, com.openpositioning.PositionMe.Traj.Quaternion.Builder, com.openpositioning.PositionMe.Traj.QuaternionOrBuilder> rotationVectorBuilder_; + /** + *
+       * Orientation [unitless], 4 components should square sum to ~1
+       * 
+ * + * .Quaternion rotation_vector = 4; + * @return Whether the rotationVector field is set. + */ + public boolean hasRotationVector() { + return ((bitField0_ & 0x00000008) != 0); + } + /** + *
+       * Orientation [unitless], 4 components should square sum to ~1
+       * 
+ * + * .Quaternion rotation_vector = 4; + * @return The rotationVector. + */ + public com.openpositioning.PositionMe.Traj.Quaternion getRotationVector() { + if (rotationVectorBuilder_ == null) { + return rotationVector_ == null ? com.openpositioning.PositionMe.Traj.Quaternion.getDefaultInstance() : rotationVector_; + } else { + return rotationVectorBuilder_.getMessage(); + } + } + /** + *
+       * Orientation [unitless], 4 components should square sum to ~1
+       * 
+ * + * .Quaternion rotation_vector = 4; + */ + public Builder setRotationVector(com.openpositioning.PositionMe.Traj.Quaternion value) { + if (rotationVectorBuilder_ == null) { + if (value == null) { + throw new NullPointerException(); + } + rotationVector_ = value; + } else { + rotationVectorBuilder_.setMessage(value); + } + bitField0_ |= 0x00000008; + onChanged(); + return this; + } + /** + *
+       * Orientation [unitless], 4 components should square sum to ~1
+       * 
+ * + * .Quaternion rotation_vector = 4; + */ + public Builder setRotationVector( + com.openpositioning.PositionMe.Traj.Quaternion.Builder builderForValue) { + if (rotationVectorBuilder_ == null) { + rotationVector_ = builderForValue.build(); + } else { + rotationVectorBuilder_.setMessage(builderForValue.build()); + } + bitField0_ |= 0x00000008; + onChanged(); + return this; + } + /** + *
+       * Orientation [unitless], 4 components should square sum to ~1
+       * 
+ * + * .Quaternion rotation_vector = 4; + */ + public Builder mergeRotationVector(com.openpositioning.PositionMe.Traj.Quaternion value) { + if (rotationVectorBuilder_ == null) { + if (((bitField0_ & 0x00000008) != 0) && + rotationVector_ != null && + rotationVector_ != com.openpositioning.PositionMe.Traj.Quaternion.getDefaultInstance()) { + getRotationVectorBuilder().mergeFrom(value); + } else { + rotationVector_ = value; + } + } else { + rotationVectorBuilder_.mergeFrom(value); + } + if (rotationVector_ != null) { + bitField0_ |= 0x00000008; + onChanged(); + } + return this; + } + /** + *
+       * Orientation [unitless], 4 components should square sum to ~1
+       * 
+ * + * .Quaternion rotation_vector = 4; + */ + public Builder clearRotationVector() { + bitField0_ = (bitField0_ & ~0x00000008); + rotationVector_ = null; + if (rotationVectorBuilder_ != null) { + rotationVectorBuilder_.dispose(); + rotationVectorBuilder_ = null; + } + onChanged(); + return this; + } + /** + *
+       * Orientation [unitless], 4 components should square sum to ~1
+       * 
+ * + * .Quaternion rotation_vector = 4; + */ + public com.openpositioning.PositionMe.Traj.Quaternion.Builder getRotationVectorBuilder() { + bitField0_ |= 0x00000008; + onChanged(); + return getRotationVectorFieldBuilder().getBuilder(); + } + /** + *
+       * Orientation [unitless], 4 components should square sum to ~1
+       * 
+ * + * .Quaternion rotation_vector = 4; + */ + public com.openpositioning.PositionMe.Traj.QuaternionOrBuilder getRotationVectorOrBuilder() { + if (rotationVectorBuilder_ != null) { + return rotationVectorBuilder_.getMessageOrBuilder(); + } else { + return rotationVector_ == null ? + com.openpositioning.PositionMe.Traj.Quaternion.getDefaultInstance() : rotationVector_; + } + } + /** + *
+       * Orientation [unitless], 4 components should square sum to ~1
+       * 
+ * + * .Quaternion rotation_vector = 4; + */ + private com.google.protobuf.SingleFieldBuilder< + com.openpositioning.PositionMe.Traj.Quaternion, com.openpositioning.PositionMe.Traj.Quaternion.Builder, com.openpositioning.PositionMe.Traj.QuaternionOrBuilder> + getRotationVectorFieldBuilder() { + if (rotationVectorBuilder_ == null) { + rotationVectorBuilder_ = new com.google.protobuf.SingleFieldBuilder< + com.openpositioning.PositionMe.Traj.Quaternion, com.openpositioning.PositionMe.Traj.Quaternion.Builder, com.openpositioning.PositionMe.Traj.QuaternionOrBuilder>( + getRotationVector(), + getParentForChildren(), + isClean()); + rotationVector_ = null; + } + return rotationVectorBuilder_; + } + + private int stepCount_ ; + /** + *
+       * Number of steps so far
+       * 
+ * + * int32 step_count = 5; + * @return The stepCount. + */ + @java.lang.Override + public int getStepCount() { + return stepCount_; + } + /** + *
+       * Number of steps so far
+       * 
+ * + * int32 step_count = 5; + * @param value The stepCount to set. + * @return This builder for chaining. + */ + public Builder setStepCount(int value) { + + stepCount_ = value; + bitField0_ |= 0x00000010; + onChanged(); + return this; + } + /** + *
+       * Number of steps so far
+       * 
+ * + * int32 step_count = 5; + * @return This builder for chaining. + */ + public Builder clearStepCount() { + bitField0_ = (bitField0_ & ~0x00000010); + stepCount_ = 0; + onChanged(); + return this; + } + + // @@protoc_insertion_point(builder_scope:IMUReading) + } + + // @@protoc_insertion_point(class_scope:IMUReading) + private static final com.openpositioning.PositionMe.Traj.IMUReading DEFAULT_INSTANCE; + static { + DEFAULT_INSTANCE = new com.openpositioning.PositionMe.Traj.IMUReading(); + } + + public static com.openpositioning.PositionMe.Traj.IMUReading getDefaultInstance() { + return DEFAULT_INSTANCE; + } + + private static final com.google.protobuf.Parser + PARSER = new com.google.protobuf.AbstractParser() { + @java.lang.Override + public IMUReading parsePartialFrom( + com.google.protobuf.CodedInputStream input, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + Builder builder = newBuilder(); + try { + builder.mergeFrom(input, extensionRegistry); + } catch (com.google.protobuf.InvalidProtocolBufferException e) { + throw e.setUnfinishedMessage(builder.buildPartial()); + } catch (com.google.protobuf.UninitializedMessageException e) { + throw e.asInvalidProtocolBufferException().setUnfinishedMessage(builder.buildPartial()); + } catch (java.io.IOException e) { + throw new com.google.protobuf.InvalidProtocolBufferException(e) + .setUnfinishedMessage(builder.buildPartial()); + } + return builder.buildPartial(); + } + }; + + public static com.google.protobuf.Parser parser() { + return PARSER; + } + + @java.lang.Override + public com.google.protobuf.Parser getParserForType() { + return PARSER; + } + + @java.lang.Override + public com.openpositioning.PositionMe.Traj.IMUReading getDefaultInstanceForType() { + return DEFAULT_INSTANCE; + } + + } + + public interface MagnetometerReadingOrBuilder extends + // @@protoc_insertion_point(interface_extends:MagnetometerReading) + com.google.protobuf.MessageOrBuilder { + + /** + * int64 relative_timestamp = 1; + * @return The relativeTimestamp. + */ + long getRelativeTimestamp(); + + /** + *
+     * Magnetometer [uT]
+     * 
+ * + * .Vector3 mag = 2; + * @return Whether the mag field is set. + */ + boolean hasMag(); + /** + *
+     * Magnetometer [uT]
+     * 
+ * + * .Vector3 mag = 2; + * @return The mag. + */ + com.openpositioning.PositionMe.Traj.Vector3 getMag(); + /** + *
+     * Magnetometer [uT]
+     * 
+ * + * .Vector3 mag = 2; + */ + com.openpositioning.PositionMe.Traj.Vector3OrBuilder getMagOrBuilder(); + } + /** + * Protobuf type {@code MagnetometerReading} + */ + public static final class MagnetometerReading extends + com.google.protobuf.GeneratedMessage implements + // @@protoc_insertion_point(message_implements:MagnetometerReading) + MagnetometerReadingOrBuilder { + private static final long serialVersionUID = 0L; + static { + com.google.protobuf.RuntimeVersion.validateProtobufGencodeVersion( + com.google.protobuf.RuntimeVersion.RuntimeDomain.PUBLIC, + /* major= */ 4, + /* minor= */ 29, + /* patch= */ 6, + /* suffix= */ "", + MagnetometerReading.class.getName()); + } + // Use MagnetometerReading.newBuilder() to construct. + private MagnetometerReading(com.google.protobuf.GeneratedMessage.Builder builder) { + super(builder); + } + private MagnetometerReading() { + } + + public static final com.google.protobuf.Descriptors.Descriptor + getDescriptor() { + return com.openpositioning.PositionMe.Traj.internal_static_MagnetometerReading_descriptor; + } + + @java.lang.Override + protected com.google.protobuf.GeneratedMessage.FieldAccessorTable + internalGetFieldAccessorTable() { + return com.openpositioning.PositionMe.Traj.internal_static_MagnetometerReading_fieldAccessorTable + .ensureFieldAccessorsInitialized( + com.openpositioning.PositionMe.Traj.MagnetometerReading.class, com.openpositioning.PositionMe.Traj.MagnetometerReading.Builder.class); + } + + private int bitField0_; + public static final int RELATIVE_TIMESTAMP_FIELD_NUMBER = 1; + private long relativeTimestamp_ = 0L; + /** + * int64 relative_timestamp = 1; + * @return The relativeTimestamp. + */ + @java.lang.Override + public long getRelativeTimestamp() { + return relativeTimestamp_; + } + + public static final int MAG_FIELD_NUMBER = 2; + private com.openpositioning.PositionMe.Traj.Vector3 mag_; + /** + *
+     * Magnetometer [uT]
+     * 
+ * + * .Vector3 mag = 2; + * @return Whether the mag field is set. + */ + @java.lang.Override + public boolean hasMag() { + return ((bitField0_ & 0x00000001) != 0); + } + /** + *
+     * Magnetometer [uT]
+     * 
+ * + * .Vector3 mag = 2; + * @return The mag. + */ + @java.lang.Override + public com.openpositioning.PositionMe.Traj.Vector3 getMag() { + return mag_ == null ? com.openpositioning.PositionMe.Traj.Vector3.getDefaultInstance() : mag_; + } + /** + *
+     * Magnetometer [uT]
+     * 
+ * + * .Vector3 mag = 2; + */ + @java.lang.Override + public com.openpositioning.PositionMe.Traj.Vector3OrBuilder getMagOrBuilder() { + return mag_ == null ? com.openpositioning.PositionMe.Traj.Vector3.getDefaultInstance() : mag_; + } + + private byte memoizedIsInitialized = -1; + @java.lang.Override + public final boolean isInitialized() { + byte isInitialized = memoizedIsInitialized; + if (isInitialized == 1) return true; + if (isInitialized == 0) return false; + + memoizedIsInitialized = 1; + return true; + } + + @java.lang.Override + public void writeTo(com.google.protobuf.CodedOutputStream output) + throws java.io.IOException { + if (relativeTimestamp_ != 0L) { + output.writeInt64(1, relativeTimestamp_); + } + if (((bitField0_ & 0x00000001) != 0)) { + output.writeMessage(2, getMag()); + } + getUnknownFields().writeTo(output); + } + + @java.lang.Override + public int getSerializedSize() { + int size = memoizedSize; + if (size != -1) return size; + + size = 0; + if (relativeTimestamp_ != 0L) { + size += com.google.protobuf.CodedOutputStream + .computeInt64Size(1, relativeTimestamp_); + } + if (((bitField0_ & 0x00000001) != 0)) { + size += com.google.protobuf.CodedOutputStream + .computeMessageSize(2, getMag()); + } + size += getUnknownFields().getSerializedSize(); + memoizedSize = size; + return size; + } + + @java.lang.Override + public boolean equals(final java.lang.Object obj) { + if (obj == this) { + return true; + } + if (!(obj instanceof com.openpositioning.PositionMe.Traj.MagnetometerReading)) { + return super.equals(obj); + } + com.openpositioning.PositionMe.Traj.MagnetometerReading other = (com.openpositioning.PositionMe.Traj.MagnetometerReading) obj; + + if (getRelativeTimestamp() + != other.getRelativeTimestamp()) return false; + if (hasMag() != other.hasMag()) return false; + if (hasMag()) { + if (!getMag() + .equals(other.getMag())) return false; + } + if (!getUnknownFields().equals(other.getUnknownFields())) return false; + return true; + } + + @java.lang.Override + public int hashCode() { + if (memoizedHashCode != 0) { + return memoizedHashCode; + } + int hash = 41; + hash = (19 * hash) + getDescriptor().hashCode(); + hash = (37 * hash) + RELATIVE_TIMESTAMP_FIELD_NUMBER; + hash = (53 * hash) + com.google.protobuf.Internal.hashLong( + getRelativeTimestamp()); + if (hasMag()) { + hash = (37 * hash) + MAG_FIELD_NUMBER; + hash = (53 * hash) + getMag().hashCode(); + } + hash = (29 * hash) + getUnknownFields().hashCode(); + memoizedHashCode = hash; + return hash; + } + + public static com.openpositioning.PositionMe.Traj.MagnetometerReading parseFrom( + java.nio.ByteBuffer data) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + public static com.openpositioning.PositionMe.Traj.MagnetometerReading parseFrom( + java.nio.ByteBuffer data, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data, extensionRegistry); + } + public static com.openpositioning.PositionMe.Traj.MagnetometerReading parseFrom( + com.google.protobuf.ByteString data) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + public static com.openpositioning.PositionMe.Traj.MagnetometerReading parseFrom( + com.google.protobuf.ByteString data, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data, extensionRegistry); + } + public static com.openpositioning.PositionMe.Traj.MagnetometerReading parseFrom(byte[] data) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + public static com.openpositioning.PositionMe.Traj.MagnetometerReading parseFrom( + byte[] data, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data, extensionRegistry); + } + public static com.openpositioning.PositionMe.Traj.MagnetometerReading parseFrom(java.io.InputStream input) + throws java.io.IOException { + return com.google.protobuf.GeneratedMessage + .parseWithIOException(PARSER, input); + } + public static com.openpositioning.PositionMe.Traj.MagnetometerReading parseFrom( + java.io.InputStream input, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws java.io.IOException { + return com.google.protobuf.GeneratedMessage + .parseWithIOException(PARSER, input, extensionRegistry); + } + + public static com.openpositioning.PositionMe.Traj.MagnetometerReading parseDelimitedFrom(java.io.InputStream input) + throws java.io.IOException { + return com.google.protobuf.GeneratedMessage + .parseDelimitedWithIOException(PARSER, input); + } + + public static com.openpositioning.PositionMe.Traj.MagnetometerReading parseDelimitedFrom( + java.io.InputStream input, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws java.io.IOException { + return com.google.protobuf.GeneratedMessage + .parseDelimitedWithIOException(PARSER, input, extensionRegistry); + } + public static com.openpositioning.PositionMe.Traj.MagnetometerReading parseFrom( + com.google.protobuf.CodedInputStream input) + throws java.io.IOException { + return com.google.protobuf.GeneratedMessage + .parseWithIOException(PARSER, input); + } + public static com.openpositioning.PositionMe.Traj.MagnetometerReading parseFrom( + com.google.protobuf.CodedInputStream input, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws java.io.IOException { + return com.google.protobuf.GeneratedMessage + .parseWithIOException(PARSER, input, extensionRegistry); + } + + @java.lang.Override + public Builder newBuilderForType() { return newBuilder(); } + public static Builder newBuilder() { + return DEFAULT_INSTANCE.toBuilder(); + } + public static Builder newBuilder(com.openpositioning.PositionMe.Traj.MagnetometerReading prototype) { + return DEFAULT_INSTANCE.toBuilder().mergeFrom(prototype); + } + @java.lang.Override + public Builder toBuilder() { + return this == DEFAULT_INSTANCE + ? new Builder() : new Builder().mergeFrom(this); + } + + @java.lang.Override + protected Builder newBuilderForType( + com.google.protobuf.GeneratedMessage.BuilderParent parent) { + Builder builder = new Builder(parent); + return builder; + } + /** + * Protobuf type {@code MagnetometerReading} + */ + public static final class Builder extends + com.google.protobuf.GeneratedMessage.Builder implements + // @@protoc_insertion_point(builder_implements:MagnetometerReading) + com.openpositioning.PositionMe.Traj.MagnetometerReadingOrBuilder { + public static final com.google.protobuf.Descriptors.Descriptor + getDescriptor() { + return com.openpositioning.PositionMe.Traj.internal_static_MagnetometerReading_descriptor; + } + + @java.lang.Override + protected com.google.protobuf.GeneratedMessage.FieldAccessorTable + internalGetFieldAccessorTable() { + return com.openpositioning.PositionMe.Traj.internal_static_MagnetometerReading_fieldAccessorTable + .ensureFieldAccessorsInitialized( + com.openpositioning.PositionMe.Traj.MagnetometerReading.class, com.openpositioning.PositionMe.Traj.MagnetometerReading.Builder.class); + } + + // Construct using com.openpositioning.PositionMe.Traj.MagnetometerReading.newBuilder() + private Builder() { + maybeForceBuilderInitialization(); + } + + private Builder( + com.google.protobuf.GeneratedMessage.BuilderParent parent) { + super(parent); + maybeForceBuilderInitialization(); + } + private void maybeForceBuilderInitialization() { + if (com.google.protobuf.GeneratedMessage + .alwaysUseFieldBuilders) { + getMagFieldBuilder(); + } + } + @java.lang.Override + public Builder clear() { + super.clear(); + bitField0_ = 0; + relativeTimestamp_ = 0L; + mag_ = null; + if (magBuilder_ != null) { + magBuilder_.dispose(); + magBuilder_ = null; + } + return this; + } + + @java.lang.Override + public com.google.protobuf.Descriptors.Descriptor + getDescriptorForType() { + return com.openpositioning.PositionMe.Traj.internal_static_MagnetometerReading_descriptor; + } + + @java.lang.Override + public com.openpositioning.PositionMe.Traj.MagnetometerReading getDefaultInstanceForType() { + return com.openpositioning.PositionMe.Traj.MagnetometerReading.getDefaultInstance(); + } + + @java.lang.Override + public com.openpositioning.PositionMe.Traj.MagnetometerReading build() { + com.openpositioning.PositionMe.Traj.MagnetometerReading result = buildPartial(); + if (!result.isInitialized()) { + throw newUninitializedMessageException(result); + } + return result; + } + + @java.lang.Override + public com.openpositioning.PositionMe.Traj.MagnetometerReading buildPartial() { + com.openpositioning.PositionMe.Traj.MagnetometerReading result = new com.openpositioning.PositionMe.Traj.MagnetometerReading(this); + if (bitField0_ != 0) { buildPartial0(result); } + onBuilt(); + return result; + } + + private void buildPartial0(com.openpositioning.PositionMe.Traj.MagnetometerReading result) { + int from_bitField0_ = bitField0_; + if (((from_bitField0_ & 0x00000001) != 0)) { + result.relativeTimestamp_ = relativeTimestamp_; + } + int to_bitField0_ = 0; + if (((from_bitField0_ & 0x00000002) != 0)) { + result.mag_ = magBuilder_ == null + ? mag_ + : magBuilder_.build(); + to_bitField0_ |= 0x00000001; + } + result.bitField0_ |= to_bitField0_; + } + + @java.lang.Override + public Builder mergeFrom(com.google.protobuf.Message other) { + if (other instanceof com.openpositioning.PositionMe.Traj.MagnetometerReading) { + return mergeFrom((com.openpositioning.PositionMe.Traj.MagnetometerReading)other); + } else { + super.mergeFrom(other); + return this; + } + } + + public Builder mergeFrom(com.openpositioning.PositionMe.Traj.MagnetometerReading other) { + if (other == com.openpositioning.PositionMe.Traj.MagnetometerReading.getDefaultInstance()) return this; + if (other.getRelativeTimestamp() != 0L) { + setRelativeTimestamp(other.getRelativeTimestamp()); + } + if (other.hasMag()) { + mergeMag(other.getMag()); + } + this.mergeUnknownFields(other.getUnknownFields()); + onChanged(); + return this; + } + + @java.lang.Override + public final boolean isInitialized() { + return true; + } + + @java.lang.Override + public Builder mergeFrom( + com.google.protobuf.CodedInputStream input, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws java.io.IOException { + if (extensionRegistry == null) { + throw new java.lang.NullPointerException(); + } + try { + boolean done = false; + while (!done) { + int tag = input.readTag(); + switch (tag) { + case 0: + done = true; + break; + case 8: { + relativeTimestamp_ = input.readInt64(); + bitField0_ |= 0x00000001; + break; + } // case 8 + case 18: { + input.readMessage( + getMagFieldBuilder().getBuilder(), + extensionRegistry); + bitField0_ |= 0x00000002; + break; + } // case 18 + default: { + if (!super.parseUnknownField(input, extensionRegistry, tag)) { + done = true; // was an endgroup tag + } + break; + } // default: + } // switch (tag) + } // while (!done) + } catch (com.google.protobuf.InvalidProtocolBufferException e) { + throw e.unwrapIOException(); + } finally { + onChanged(); + } // finally + return this; + } + private int bitField0_; + + private long relativeTimestamp_ ; + /** + * int64 relative_timestamp = 1; + * @return The relativeTimestamp. + */ + @java.lang.Override + public long getRelativeTimestamp() { + return relativeTimestamp_; + } + /** + * int64 relative_timestamp = 1; + * @param value The relativeTimestamp to set. + * @return This builder for chaining. + */ + public Builder setRelativeTimestamp(long value) { + + relativeTimestamp_ = value; + bitField0_ |= 0x00000001; + onChanged(); + return this; + } + /** + * int64 relative_timestamp = 1; + * @return This builder for chaining. + */ + public Builder clearRelativeTimestamp() { + bitField0_ = (bitField0_ & ~0x00000001); + relativeTimestamp_ = 0L; + onChanged(); + return this; + } + + private com.openpositioning.PositionMe.Traj.Vector3 mag_; + private com.google.protobuf.SingleFieldBuilder< + com.openpositioning.PositionMe.Traj.Vector3, com.openpositioning.PositionMe.Traj.Vector3.Builder, com.openpositioning.PositionMe.Traj.Vector3OrBuilder> magBuilder_; + /** + *
+       * Magnetometer [uT]
+       * 
+ * + * .Vector3 mag = 2; + * @return Whether the mag field is set. + */ + public boolean hasMag() { + return ((bitField0_ & 0x00000002) != 0); + } + /** + *
+       * Magnetometer [uT]
+       * 
+ * + * .Vector3 mag = 2; + * @return The mag. + */ + public com.openpositioning.PositionMe.Traj.Vector3 getMag() { + if (magBuilder_ == null) { + return mag_ == null ? com.openpositioning.PositionMe.Traj.Vector3.getDefaultInstance() : mag_; + } else { + return magBuilder_.getMessage(); + } + } + /** + *
+       * Magnetometer [uT]
+       * 
+ * + * .Vector3 mag = 2; + */ + public Builder setMag(com.openpositioning.PositionMe.Traj.Vector3 value) { + if (magBuilder_ == null) { + if (value == null) { + throw new NullPointerException(); + } + mag_ = value; + } else { + magBuilder_.setMessage(value); + } + bitField0_ |= 0x00000002; + onChanged(); + return this; + } + /** + *
+       * Magnetometer [uT]
+       * 
+ * + * .Vector3 mag = 2; + */ + public Builder setMag( + com.openpositioning.PositionMe.Traj.Vector3.Builder builderForValue) { + if (magBuilder_ == null) { + mag_ = builderForValue.build(); + } else { + magBuilder_.setMessage(builderForValue.build()); + } + bitField0_ |= 0x00000002; + onChanged(); + return this; + } + /** + *
+       * Magnetometer [uT]
+       * 
+ * + * .Vector3 mag = 2; + */ + public Builder mergeMag(com.openpositioning.PositionMe.Traj.Vector3 value) { + if (magBuilder_ == null) { + if (((bitField0_ & 0x00000002) != 0) && + mag_ != null && + mag_ != com.openpositioning.PositionMe.Traj.Vector3.getDefaultInstance()) { + getMagBuilder().mergeFrom(value); + } else { + mag_ = value; + } + } else { + magBuilder_.mergeFrom(value); + } + if (mag_ != null) { + bitField0_ |= 0x00000002; + onChanged(); + } + return this; + } + /** + *
+       * Magnetometer [uT]
+       * 
+ * + * .Vector3 mag = 2; + */ + public Builder clearMag() { + bitField0_ = (bitField0_ & ~0x00000002); + mag_ = null; + if (magBuilder_ != null) { + magBuilder_.dispose(); + magBuilder_ = null; + } + onChanged(); + return this; + } + /** + *
+       * Magnetometer [uT]
+       * 
+ * + * .Vector3 mag = 2; + */ + public com.openpositioning.PositionMe.Traj.Vector3.Builder getMagBuilder() { + bitField0_ |= 0x00000002; + onChanged(); + return getMagFieldBuilder().getBuilder(); + } + /** + *
+       * Magnetometer [uT]
+       * 
+ * + * .Vector3 mag = 2; + */ + public com.openpositioning.PositionMe.Traj.Vector3OrBuilder getMagOrBuilder() { + if (magBuilder_ != null) { + return magBuilder_.getMessageOrBuilder(); + } else { + return mag_ == null ? + com.openpositioning.PositionMe.Traj.Vector3.getDefaultInstance() : mag_; + } + } + /** + *
+       * Magnetometer [uT]
+       * 
+ * + * .Vector3 mag = 2; + */ + private com.google.protobuf.SingleFieldBuilder< + com.openpositioning.PositionMe.Traj.Vector3, com.openpositioning.PositionMe.Traj.Vector3.Builder, com.openpositioning.PositionMe.Traj.Vector3OrBuilder> + getMagFieldBuilder() { + if (magBuilder_ == null) { + magBuilder_ = new com.google.protobuf.SingleFieldBuilder< + com.openpositioning.PositionMe.Traj.Vector3, com.openpositioning.PositionMe.Traj.Vector3.Builder, com.openpositioning.PositionMe.Traj.Vector3OrBuilder>( + getMag(), + getParentForChildren(), + isClean()); + mag_ = null; + } + return magBuilder_; + } + + // @@protoc_insertion_point(builder_scope:MagnetometerReading) + } + + // @@protoc_insertion_point(class_scope:MagnetometerReading) + private static final com.openpositioning.PositionMe.Traj.MagnetometerReading DEFAULT_INSTANCE; + static { + DEFAULT_INSTANCE = new com.openpositioning.PositionMe.Traj.MagnetometerReading(); + } + + public static com.openpositioning.PositionMe.Traj.MagnetometerReading getDefaultInstance() { + return DEFAULT_INSTANCE; + } + + private static final com.google.protobuf.Parser + PARSER = new com.google.protobuf.AbstractParser() { + @java.lang.Override + public MagnetometerReading parsePartialFrom( + com.google.protobuf.CodedInputStream input, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + Builder builder = newBuilder(); + try { + builder.mergeFrom(input, extensionRegistry); + } catch (com.google.protobuf.InvalidProtocolBufferException e) { + throw e.setUnfinishedMessage(builder.buildPartial()); + } catch (com.google.protobuf.UninitializedMessageException e) { + throw e.asInvalidProtocolBufferException().setUnfinishedMessage(builder.buildPartial()); + } catch (java.io.IOException e) { + throw new com.google.protobuf.InvalidProtocolBufferException(e) + .setUnfinishedMessage(builder.buildPartial()); + } + return builder.buildPartial(); + } + }; + + public static com.google.protobuf.Parser parser() { + return PARSER; + } + + @java.lang.Override + public com.google.protobuf.Parser getParserForType() { + return PARSER; + } + + @java.lang.Override + public com.openpositioning.PositionMe.Traj.MagnetometerReading getDefaultInstanceForType() { + return DEFAULT_INSTANCE; + } + + } + + public interface BarometerReadingOrBuilder extends + // @@protoc_insertion_point(interface_extends:BarometerReading) + com.google.protobuf.MessageOrBuilder { + + /** + * int64 relative_timestamp = 1; + * @return The relativeTimestamp. + */ + long getRelativeTimestamp(); + + /** + *
+     * mbar
+     * 
+ * + * float pressure = 2; + * @return The pressure. + */ + float getPressure(); + } + /** + * Protobuf type {@code BarometerReading} + */ + public static final class BarometerReading extends + com.google.protobuf.GeneratedMessage implements + // @@protoc_insertion_point(message_implements:BarometerReading) + BarometerReadingOrBuilder { + private static final long serialVersionUID = 0L; + static { + com.google.protobuf.RuntimeVersion.validateProtobufGencodeVersion( + com.google.protobuf.RuntimeVersion.RuntimeDomain.PUBLIC, + /* major= */ 4, + /* minor= */ 29, + /* patch= */ 6, + /* suffix= */ "", + BarometerReading.class.getName()); + } + // Use BarometerReading.newBuilder() to construct. + private BarometerReading(com.google.protobuf.GeneratedMessage.Builder builder) { + super(builder); + } + private BarometerReading() { + } + + public static final com.google.protobuf.Descriptors.Descriptor + getDescriptor() { + return com.openpositioning.PositionMe.Traj.internal_static_BarometerReading_descriptor; + } + + @java.lang.Override + protected com.google.protobuf.GeneratedMessage.FieldAccessorTable + internalGetFieldAccessorTable() { + return com.openpositioning.PositionMe.Traj.internal_static_BarometerReading_fieldAccessorTable + .ensureFieldAccessorsInitialized( + com.openpositioning.PositionMe.Traj.BarometerReading.class, com.openpositioning.PositionMe.Traj.BarometerReading.Builder.class); + } + + public static final int RELATIVE_TIMESTAMP_FIELD_NUMBER = 1; + private long relativeTimestamp_ = 0L; + /** + * int64 relative_timestamp = 1; + * @return The relativeTimestamp. + */ + @java.lang.Override + public long getRelativeTimestamp() { + return relativeTimestamp_; + } + + public static final int PRESSURE_FIELD_NUMBER = 2; + private float pressure_ = 0F; + /** + *
+     * mbar
+     * 
+ * + * float pressure = 2; + * @return The pressure. + */ + @java.lang.Override + public float getPressure() { + return pressure_; + } + + private byte memoizedIsInitialized = -1; + @java.lang.Override + public final boolean isInitialized() { + byte isInitialized = memoizedIsInitialized; + if (isInitialized == 1) return true; + if (isInitialized == 0) return false; + + memoizedIsInitialized = 1; + return true; + } + + @java.lang.Override + public void writeTo(com.google.protobuf.CodedOutputStream output) + throws java.io.IOException { + if (relativeTimestamp_ != 0L) { + output.writeInt64(1, relativeTimestamp_); + } + if (java.lang.Float.floatToRawIntBits(pressure_) != 0) { + output.writeFloat(2, pressure_); + } + getUnknownFields().writeTo(output); + } + + @java.lang.Override + public int getSerializedSize() { + int size = memoizedSize; + if (size != -1) return size; + + size = 0; + if (relativeTimestamp_ != 0L) { + size += com.google.protobuf.CodedOutputStream + .computeInt64Size(1, relativeTimestamp_); + } + if (java.lang.Float.floatToRawIntBits(pressure_) != 0) { + size += com.google.protobuf.CodedOutputStream + .computeFloatSize(2, pressure_); + } + size += getUnknownFields().getSerializedSize(); + memoizedSize = size; + return size; + } + + @java.lang.Override + public boolean equals(final java.lang.Object obj) { + if (obj == this) { + return true; + } + if (!(obj instanceof com.openpositioning.PositionMe.Traj.BarometerReading)) { + return super.equals(obj); + } + com.openpositioning.PositionMe.Traj.BarometerReading other = (com.openpositioning.PositionMe.Traj.BarometerReading) obj; + + if (getRelativeTimestamp() + != other.getRelativeTimestamp()) return false; + if (java.lang.Float.floatToIntBits(getPressure()) + != java.lang.Float.floatToIntBits( + other.getPressure())) return false; + if (!getUnknownFields().equals(other.getUnknownFields())) return false; + return true; + } + + @java.lang.Override + public int hashCode() { + if (memoizedHashCode != 0) { + return memoizedHashCode; + } + int hash = 41; + hash = (19 * hash) + getDescriptor().hashCode(); + hash = (37 * hash) + RELATIVE_TIMESTAMP_FIELD_NUMBER; + hash = (53 * hash) + com.google.protobuf.Internal.hashLong( + getRelativeTimestamp()); + hash = (37 * hash) + PRESSURE_FIELD_NUMBER; + hash = (53 * hash) + java.lang.Float.floatToIntBits( + getPressure()); + hash = (29 * hash) + getUnknownFields().hashCode(); + memoizedHashCode = hash; + return hash; + } + + public static com.openpositioning.PositionMe.Traj.BarometerReading parseFrom( + java.nio.ByteBuffer data) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + public static com.openpositioning.PositionMe.Traj.BarometerReading parseFrom( + java.nio.ByteBuffer data, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data, extensionRegistry); + } + public static com.openpositioning.PositionMe.Traj.BarometerReading parseFrom( + com.google.protobuf.ByteString data) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + public static com.openpositioning.PositionMe.Traj.BarometerReading parseFrom( + com.google.protobuf.ByteString data, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data, extensionRegistry); + } + public static com.openpositioning.PositionMe.Traj.BarometerReading parseFrom(byte[] data) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + public static com.openpositioning.PositionMe.Traj.BarometerReading parseFrom( + byte[] data, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data, extensionRegistry); + } + public static com.openpositioning.PositionMe.Traj.BarometerReading parseFrom(java.io.InputStream input) + throws java.io.IOException { + return com.google.protobuf.GeneratedMessage + .parseWithIOException(PARSER, input); + } + public static com.openpositioning.PositionMe.Traj.BarometerReading parseFrom( + java.io.InputStream input, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws java.io.IOException { + return com.google.protobuf.GeneratedMessage + .parseWithIOException(PARSER, input, extensionRegistry); + } + + public static com.openpositioning.PositionMe.Traj.BarometerReading parseDelimitedFrom(java.io.InputStream input) + throws java.io.IOException { + return com.google.protobuf.GeneratedMessage + .parseDelimitedWithIOException(PARSER, input); + } + + public static com.openpositioning.PositionMe.Traj.BarometerReading parseDelimitedFrom( + java.io.InputStream input, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws java.io.IOException { + return com.google.protobuf.GeneratedMessage + .parseDelimitedWithIOException(PARSER, input, extensionRegistry); + } + public static com.openpositioning.PositionMe.Traj.BarometerReading parseFrom( + com.google.protobuf.CodedInputStream input) + throws java.io.IOException { + return com.google.protobuf.GeneratedMessage + .parseWithIOException(PARSER, input); + } + public static com.openpositioning.PositionMe.Traj.BarometerReading parseFrom( + com.google.protobuf.CodedInputStream input, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws java.io.IOException { + return com.google.protobuf.GeneratedMessage + .parseWithIOException(PARSER, input, extensionRegistry); + } + + @java.lang.Override + public Builder newBuilderForType() { return newBuilder(); } + public static Builder newBuilder() { + return DEFAULT_INSTANCE.toBuilder(); + } + public static Builder newBuilder(com.openpositioning.PositionMe.Traj.BarometerReading prototype) { + return DEFAULT_INSTANCE.toBuilder().mergeFrom(prototype); + } + @java.lang.Override + public Builder toBuilder() { + return this == DEFAULT_INSTANCE + ? new Builder() : new Builder().mergeFrom(this); + } + + @java.lang.Override + protected Builder newBuilderForType( + com.google.protobuf.GeneratedMessage.BuilderParent parent) { + Builder builder = new Builder(parent); + return builder; + } + /** + * Protobuf type {@code BarometerReading} + */ + public static final class Builder extends + com.google.protobuf.GeneratedMessage.Builder implements + // @@protoc_insertion_point(builder_implements:BarometerReading) + com.openpositioning.PositionMe.Traj.BarometerReadingOrBuilder { + public static final com.google.protobuf.Descriptors.Descriptor + getDescriptor() { + return com.openpositioning.PositionMe.Traj.internal_static_BarometerReading_descriptor; + } + + @java.lang.Override + protected com.google.protobuf.GeneratedMessage.FieldAccessorTable + internalGetFieldAccessorTable() { + return com.openpositioning.PositionMe.Traj.internal_static_BarometerReading_fieldAccessorTable + .ensureFieldAccessorsInitialized( + com.openpositioning.PositionMe.Traj.BarometerReading.class, com.openpositioning.PositionMe.Traj.BarometerReading.Builder.class); + } + + // Construct using com.openpositioning.PositionMe.Traj.BarometerReading.newBuilder() + private Builder() { + + } + + private Builder( + com.google.protobuf.GeneratedMessage.BuilderParent parent) { + super(parent); + + } + @java.lang.Override + public Builder clear() { + super.clear(); + bitField0_ = 0; + relativeTimestamp_ = 0L; + pressure_ = 0F; + return this; + } + + @java.lang.Override + public com.google.protobuf.Descriptors.Descriptor + getDescriptorForType() { + return com.openpositioning.PositionMe.Traj.internal_static_BarometerReading_descriptor; + } + + @java.lang.Override + public com.openpositioning.PositionMe.Traj.BarometerReading getDefaultInstanceForType() { + return com.openpositioning.PositionMe.Traj.BarometerReading.getDefaultInstance(); + } + + @java.lang.Override + public com.openpositioning.PositionMe.Traj.BarometerReading build() { + com.openpositioning.PositionMe.Traj.BarometerReading result = buildPartial(); + if (!result.isInitialized()) { + throw newUninitializedMessageException(result); + } + return result; + } + + @java.lang.Override + public com.openpositioning.PositionMe.Traj.BarometerReading buildPartial() { + com.openpositioning.PositionMe.Traj.BarometerReading result = new com.openpositioning.PositionMe.Traj.BarometerReading(this); + if (bitField0_ != 0) { buildPartial0(result); } + onBuilt(); + return result; + } + + private void buildPartial0(com.openpositioning.PositionMe.Traj.BarometerReading result) { + int from_bitField0_ = bitField0_; + if (((from_bitField0_ & 0x00000001) != 0)) { + result.relativeTimestamp_ = relativeTimestamp_; + } + if (((from_bitField0_ & 0x00000002) != 0)) { + result.pressure_ = pressure_; + } + } + + @java.lang.Override + public Builder mergeFrom(com.google.protobuf.Message other) { + if (other instanceof com.openpositioning.PositionMe.Traj.BarometerReading) { + return mergeFrom((com.openpositioning.PositionMe.Traj.BarometerReading)other); + } else { + super.mergeFrom(other); + return this; + } + } + + public Builder mergeFrom(com.openpositioning.PositionMe.Traj.BarometerReading other) { + if (other == com.openpositioning.PositionMe.Traj.BarometerReading.getDefaultInstance()) return this; + if (other.getRelativeTimestamp() != 0L) { + setRelativeTimestamp(other.getRelativeTimestamp()); + } + if (other.getPressure() != 0F) { + setPressure(other.getPressure()); + } + this.mergeUnknownFields(other.getUnknownFields()); + onChanged(); + return this; + } + + @java.lang.Override + public final boolean isInitialized() { + return true; + } + + @java.lang.Override + public Builder mergeFrom( + com.google.protobuf.CodedInputStream input, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws java.io.IOException { + if (extensionRegistry == null) { + throw new java.lang.NullPointerException(); + } + try { + boolean done = false; + while (!done) { + int tag = input.readTag(); + switch (tag) { + case 0: + done = true; + break; + case 8: { + relativeTimestamp_ = input.readInt64(); + bitField0_ |= 0x00000001; + break; + } // case 8 + case 21: { + pressure_ = input.readFloat(); + bitField0_ |= 0x00000002; + break; + } // case 21 + default: { + if (!super.parseUnknownField(input, extensionRegistry, tag)) { + done = true; // was an endgroup tag + } + break; + } // default: + } // switch (tag) + } // while (!done) + } catch (com.google.protobuf.InvalidProtocolBufferException e) { + throw e.unwrapIOException(); + } finally { + onChanged(); + } // finally + return this; + } + private int bitField0_; + + private long relativeTimestamp_ ; + /** + * int64 relative_timestamp = 1; + * @return The relativeTimestamp. + */ + @java.lang.Override + public long getRelativeTimestamp() { + return relativeTimestamp_; + } + /** + * int64 relative_timestamp = 1; + * @param value The relativeTimestamp to set. + * @return This builder for chaining. + */ + public Builder setRelativeTimestamp(long value) { + + relativeTimestamp_ = value; + bitField0_ |= 0x00000001; + onChanged(); + return this; + } + /** + * int64 relative_timestamp = 1; + * @return This builder for chaining. + */ + public Builder clearRelativeTimestamp() { + bitField0_ = (bitField0_ & ~0x00000001); + relativeTimestamp_ = 0L; + onChanged(); + return this; + } + + private float pressure_ ; + /** + *
+       * mbar
+       * 
+ * + * float pressure = 2; + * @return The pressure. + */ + @java.lang.Override + public float getPressure() { + return pressure_; + } + /** + *
+       * mbar
+       * 
+ * + * float pressure = 2; + * @param value The pressure to set. + * @return This builder for chaining. + */ + public Builder setPressure(float value) { + + pressure_ = value; + bitField0_ |= 0x00000002; + onChanged(); + return this; + } + /** + *
+       * mbar
+       * 
+ * + * float pressure = 2; + * @return This builder for chaining. + */ + public Builder clearPressure() { + bitField0_ = (bitField0_ & ~0x00000002); + pressure_ = 0F; + onChanged(); + return this; + } + + // @@protoc_insertion_point(builder_scope:BarometerReading) + } + + // @@protoc_insertion_point(class_scope:BarometerReading) + private static final com.openpositioning.PositionMe.Traj.BarometerReading DEFAULT_INSTANCE; + static { + DEFAULT_INSTANCE = new com.openpositioning.PositionMe.Traj.BarometerReading(); + } + + public static com.openpositioning.PositionMe.Traj.BarometerReading getDefaultInstance() { + return DEFAULT_INSTANCE; + } + + private static final com.google.protobuf.Parser + PARSER = new com.google.protobuf.AbstractParser() { + @java.lang.Override + public BarometerReading parsePartialFrom( + com.google.protobuf.CodedInputStream input, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + Builder builder = newBuilder(); + try { + builder.mergeFrom(input, extensionRegistry); + } catch (com.google.protobuf.InvalidProtocolBufferException e) { + throw e.setUnfinishedMessage(builder.buildPartial()); + } catch (com.google.protobuf.UninitializedMessageException e) { + throw e.asInvalidProtocolBufferException().setUnfinishedMessage(builder.buildPartial()); + } catch (java.io.IOException e) { + throw new com.google.protobuf.InvalidProtocolBufferException(e) + .setUnfinishedMessage(builder.buildPartial()); + } + return builder.buildPartial(); + } + }; + + public static com.google.protobuf.Parser parser() { + return PARSER; + } + + @java.lang.Override + public com.google.protobuf.Parser getParserForType() { + return PARSER; + } + + @java.lang.Override + public com.openpositioning.PositionMe.Traj.BarometerReading getDefaultInstanceForType() { + return DEFAULT_INSTANCE; + } + + } + + public interface LightReadingOrBuilder extends + // @@protoc_insertion_point(interface_extends:LightReading) + com.google.protobuf.MessageOrBuilder { + + /** + * int64 relative_timestamp = 1; + * @return The relativeTimestamp. + */ + long getRelativeTimestamp(); + + /** + *
+     * lux
+     * 
+ * + * float light = 2; + * @return The light. + */ + float getLight(); + } + /** + * Protobuf type {@code LightReading} + */ + public static final class LightReading extends + com.google.protobuf.GeneratedMessage implements + // @@protoc_insertion_point(message_implements:LightReading) + LightReadingOrBuilder { + private static final long serialVersionUID = 0L; + static { + com.google.protobuf.RuntimeVersion.validateProtobufGencodeVersion( + com.google.protobuf.RuntimeVersion.RuntimeDomain.PUBLIC, + /* major= */ 4, + /* minor= */ 29, + /* patch= */ 6, + /* suffix= */ "", + LightReading.class.getName()); + } + // Use LightReading.newBuilder() to construct. + private LightReading(com.google.protobuf.GeneratedMessage.Builder builder) { + super(builder); + } + private LightReading() { + } + + public static final com.google.protobuf.Descriptors.Descriptor + getDescriptor() { + return com.openpositioning.PositionMe.Traj.internal_static_LightReading_descriptor; + } + + @java.lang.Override + protected com.google.protobuf.GeneratedMessage.FieldAccessorTable + internalGetFieldAccessorTable() { + return com.openpositioning.PositionMe.Traj.internal_static_LightReading_fieldAccessorTable + .ensureFieldAccessorsInitialized( + com.openpositioning.PositionMe.Traj.LightReading.class, com.openpositioning.PositionMe.Traj.LightReading.Builder.class); + } + + public static final int RELATIVE_TIMESTAMP_FIELD_NUMBER = 1; + private long relativeTimestamp_ = 0L; + /** + * int64 relative_timestamp = 1; + * @return The relativeTimestamp. + */ + @java.lang.Override + public long getRelativeTimestamp() { + return relativeTimestamp_; + } + + public static final int LIGHT_FIELD_NUMBER = 2; + private float light_ = 0F; + /** + *
+     * lux
+     * 
+ * + * float light = 2; + * @return The light. + */ + @java.lang.Override + public float getLight() { + return light_; + } + + private byte memoizedIsInitialized = -1; + @java.lang.Override + public final boolean isInitialized() { + byte isInitialized = memoizedIsInitialized; + if (isInitialized == 1) return true; + if (isInitialized == 0) return false; + + memoizedIsInitialized = 1; + return true; + } + + @java.lang.Override + public void writeTo(com.google.protobuf.CodedOutputStream output) + throws java.io.IOException { + if (relativeTimestamp_ != 0L) { + output.writeInt64(1, relativeTimestamp_); + } + if (java.lang.Float.floatToRawIntBits(light_) != 0) { + output.writeFloat(2, light_); + } + getUnknownFields().writeTo(output); + } + + @java.lang.Override + public int getSerializedSize() { + int size = memoizedSize; + if (size != -1) return size; + + size = 0; + if (relativeTimestamp_ != 0L) { + size += com.google.protobuf.CodedOutputStream + .computeInt64Size(1, relativeTimestamp_); + } + if (java.lang.Float.floatToRawIntBits(light_) != 0) { + size += com.google.protobuf.CodedOutputStream + .computeFloatSize(2, light_); + } + size += getUnknownFields().getSerializedSize(); + memoizedSize = size; + return size; + } + + @java.lang.Override + public boolean equals(final java.lang.Object obj) { + if (obj == this) { + return true; + } + if (!(obj instanceof com.openpositioning.PositionMe.Traj.LightReading)) { + return super.equals(obj); + } + com.openpositioning.PositionMe.Traj.LightReading other = (com.openpositioning.PositionMe.Traj.LightReading) obj; + + if (getRelativeTimestamp() + != other.getRelativeTimestamp()) return false; + if (java.lang.Float.floatToIntBits(getLight()) + != java.lang.Float.floatToIntBits( + other.getLight())) return false; + if (!getUnknownFields().equals(other.getUnknownFields())) return false; + return true; + } + + @java.lang.Override + public int hashCode() { + if (memoizedHashCode != 0) { + return memoizedHashCode; + } + int hash = 41; + hash = (19 * hash) + getDescriptor().hashCode(); + hash = (37 * hash) + RELATIVE_TIMESTAMP_FIELD_NUMBER; + hash = (53 * hash) + com.google.protobuf.Internal.hashLong( + getRelativeTimestamp()); + hash = (37 * hash) + LIGHT_FIELD_NUMBER; + hash = (53 * hash) + java.lang.Float.floatToIntBits( + getLight()); + hash = (29 * hash) + getUnknownFields().hashCode(); + memoizedHashCode = hash; + return hash; + } + + public static com.openpositioning.PositionMe.Traj.LightReading parseFrom( + java.nio.ByteBuffer data) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + public static com.openpositioning.PositionMe.Traj.LightReading parseFrom( + java.nio.ByteBuffer data, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data, extensionRegistry); + } + public static com.openpositioning.PositionMe.Traj.LightReading parseFrom( + com.google.protobuf.ByteString data) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + public static com.openpositioning.PositionMe.Traj.LightReading parseFrom( + com.google.protobuf.ByteString data, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data, extensionRegistry); + } + public static com.openpositioning.PositionMe.Traj.LightReading parseFrom(byte[] data) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + public static com.openpositioning.PositionMe.Traj.LightReading parseFrom( + byte[] data, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data, extensionRegistry); + } + public static com.openpositioning.PositionMe.Traj.LightReading parseFrom(java.io.InputStream input) + throws java.io.IOException { + return com.google.protobuf.GeneratedMessage + .parseWithIOException(PARSER, input); + } + public static com.openpositioning.PositionMe.Traj.LightReading parseFrom( + java.io.InputStream input, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws java.io.IOException { + return com.google.protobuf.GeneratedMessage + .parseWithIOException(PARSER, input, extensionRegistry); + } + + public static com.openpositioning.PositionMe.Traj.LightReading parseDelimitedFrom(java.io.InputStream input) + throws java.io.IOException { + return com.google.protobuf.GeneratedMessage + .parseDelimitedWithIOException(PARSER, input); + } + + public static com.openpositioning.PositionMe.Traj.LightReading parseDelimitedFrom( + java.io.InputStream input, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws java.io.IOException { + return com.google.protobuf.GeneratedMessage + .parseDelimitedWithIOException(PARSER, input, extensionRegistry); + } + public static com.openpositioning.PositionMe.Traj.LightReading parseFrom( + com.google.protobuf.CodedInputStream input) + throws java.io.IOException { + return com.google.protobuf.GeneratedMessage + .parseWithIOException(PARSER, input); + } + public static com.openpositioning.PositionMe.Traj.LightReading parseFrom( + com.google.protobuf.CodedInputStream input, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws java.io.IOException { + return com.google.protobuf.GeneratedMessage + .parseWithIOException(PARSER, input, extensionRegistry); + } + + @java.lang.Override + public Builder newBuilderForType() { return newBuilder(); } + public static Builder newBuilder() { + return DEFAULT_INSTANCE.toBuilder(); + } + public static Builder newBuilder(com.openpositioning.PositionMe.Traj.LightReading prototype) { + return DEFAULT_INSTANCE.toBuilder().mergeFrom(prototype); + } + @java.lang.Override + public Builder toBuilder() { + return this == DEFAULT_INSTANCE + ? new Builder() : new Builder().mergeFrom(this); + } + + @java.lang.Override + protected Builder newBuilderForType( + com.google.protobuf.GeneratedMessage.BuilderParent parent) { + Builder builder = new Builder(parent); + return builder; + } + /** + * Protobuf type {@code LightReading} + */ + public static final class Builder extends + com.google.protobuf.GeneratedMessage.Builder implements + // @@protoc_insertion_point(builder_implements:LightReading) + com.openpositioning.PositionMe.Traj.LightReadingOrBuilder { + public static final com.google.protobuf.Descriptors.Descriptor + getDescriptor() { + return com.openpositioning.PositionMe.Traj.internal_static_LightReading_descriptor; + } + + @java.lang.Override + protected com.google.protobuf.GeneratedMessage.FieldAccessorTable + internalGetFieldAccessorTable() { + return com.openpositioning.PositionMe.Traj.internal_static_LightReading_fieldAccessorTable + .ensureFieldAccessorsInitialized( + com.openpositioning.PositionMe.Traj.LightReading.class, com.openpositioning.PositionMe.Traj.LightReading.Builder.class); + } + + // Construct using com.openpositioning.PositionMe.Traj.LightReading.newBuilder() + private Builder() { + + } + + private Builder( + com.google.protobuf.GeneratedMessage.BuilderParent parent) { + super(parent); + + } + @java.lang.Override + public Builder clear() { + super.clear(); + bitField0_ = 0; + relativeTimestamp_ = 0L; + light_ = 0F; + return this; + } + + @java.lang.Override + public com.google.protobuf.Descriptors.Descriptor + getDescriptorForType() { + return com.openpositioning.PositionMe.Traj.internal_static_LightReading_descriptor; + } + + @java.lang.Override + public com.openpositioning.PositionMe.Traj.LightReading getDefaultInstanceForType() { + return com.openpositioning.PositionMe.Traj.LightReading.getDefaultInstance(); + } + + @java.lang.Override + public com.openpositioning.PositionMe.Traj.LightReading build() { + com.openpositioning.PositionMe.Traj.LightReading result = buildPartial(); + if (!result.isInitialized()) { + throw newUninitializedMessageException(result); + } + return result; + } + + @java.lang.Override + public com.openpositioning.PositionMe.Traj.LightReading buildPartial() { + com.openpositioning.PositionMe.Traj.LightReading result = new com.openpositioning.PositionMe.Traj.LightReading(this); + if (bitField0_ != 0) { buildPartial0(result); } + onBuilt(); + return result; + } + + private void buildPartial0(com.openpositioning.PositionMe.Traj.LightReading result) { + int from_bitField0_ = bitField0_; + if (((from_bitField0_ & 0x00000001) != 0)) { + result.relativeTimestamp_ = relativeTimestamp_; + } + if (((from_bitField0_ & 0x00000002) != 0)) { + result.light_ = light_; + } + } + + @java.lang.Override + public Builder mergeFrom(com.google.protobuf.Message other) { + if (other instanceof com.openpositioning.PositionMe.Traj.LightReading) { + return mergeFrom((com.openpositioning.PositionMe.Traj.LightReading)other); + } else { + super.mergeFrom(other); + return this; + } + } + + public Builder mergeFrom(com.openpositioning.PositionMe.Traj.LightReading other) { + if (other == com.openpositioning.PositionMe.Traj.LightReading.getDefaultInstance()) return this; + if (other.getRelativeTimestamp() != 0L) { + setRelativeTimestamp(other.getRelativeTimestamp()); + } + if (other.getLight() != 0F) { + setLight(other.getLight()); + } + this.mergeUnknownFields(other.getUnknownFields()); + onChanged(); + return this; + } + + @java.lang.Override + public final boolean isInitialized() { + return true; + } + + @java.lang.Override + public Builder mergeFrom( + com.google.protobuf.CodedInputStream input, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws java.io.IOException { + if (extensionRegistry == null) { + throw new java.lang.NullPointerException(); + } + try { + boolean done = false; + while (!done) { + int tag = input.readTag(); + switch (tag) { + case 0: + done = true; + break; + case 8: { + relativeTimestamp_ = input.readInt64(); + bitField0_ |= 0x00000001; + break; + } // case 8 + case 21: { + light_ = input.readFloat(); + bitField0_ |= 0x00000002; + break; + } // case 21 + default: { + if (!super.parseUnknownField(input, extensionRegistry, tag)) { + done = true; // was an endgroup tag + } + break; + } // default: + } // switch (tag) + } // while (!done) + } catch (com.google.protobuf.InvalidProtocolBufferException e) { + throw e.unwrapIOException(); + } finally { + onChanged(); + } // finally + return this; + } + private int bitField0_; + + private long relativeTimestamp_ ; + /** + * int64 relative_timestamp = 1; + * @return The relativeTimestamp. + */ + @java.lang.Override + public long getRelativeTimestamp() { + return relativeTimestamp_; + } + /** + * int64 relative_timestamp = 1; + * @param value The relativeTimestamp to set. + * @return This builder for chaining. + */ + public Builder setRelativeTimestamp(long value) { + + relativeTimestamp_ = value; + bitField0_ |= 0x00000001; + onChanged(); + return this; + } + /** + * int64 relative_timestamp = 1; + * @return This builder for chaining. + */ + public Builder clearRelativeTimestamp() { + bitField0_ = (bitField0_ & ~0x00000001); + relativeTimestamp_ = 0L; + onChanged(); + return this; + } + + private float light_ ; + /** + *
+       * lux
+       * 
+ * + * float light = 2; + * @return The light. + */ + @java.lang.Override + public float getLight() { + return light_; + } + /** + *
+       * lux
+       * 
+ * + * float light = 2; + * @param value The light to set. + * @return This builder for chaining. + */ + public Builder setLight(float value) { + + light_ = value; + bitField0_ |= 0x00000002; + onChanged(); + return this; + } + /** + *
+       * lux
+       * 
+ * + * float light = 2; + * @return This builder for chaining. + */ + public Builder clearLight() { + bitField0_ = (bitField0_ & ~0x00000002); + light_ = 0F; + onChanged(); + return this; + } + + // @@protoc_insertion_point(builder_scope:LightReading) + } + + // @@protoc_insertion_point(class_scope:LightReading) + private static final com.openpositioning.PositionMe.Traj.LightReading DEFAULT_INSTANCE; + static { + DEFAULT_INSTANCE = new com.openpositioning.PositionMe.Traj.LightReading(); + } + + public static com.openpositioning.PositionMe.Traj.LightReading getDefaultInstance() { + return DEFAULT_INSTANCE; + } + + private static final com.google.protobuf.Parser + PARSER = new com.google.protobuf.AbstractParser() { + @java.lang.Override + public LightReading parsePartialFrom( + com.google.protobuf.CodedInputStream input, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + Builder builder = newBuilder(); + try { + builder.mergeFrom(input, extensionRegistry); + } catch (com.google.protobuf.InvalidProtocolBufferException e) { + throw e.setUnfinishedMessage(builder.buildPartial()); + } catch (com.google.protobuf.UninitializedMessageException e) { + throw e.asInvalidProtocolBufferException().setUnfinishedMessage(builder.buildPartial()); + } catch (java.io.IOException e) { + throw new com.google.protobuf.InvalidProtocolBufferException(e) + .setUnfinishedMessage(builder.buildPartial()); + } + return builder.buildPartial(); + } + }; + + public static com.google.protobuf.Parser parser() { + return PARSER; + } + + @java.lang.Override + public com.google.protobuf.Parser getParserForType() { + return PARSER; + } + + @java.lang.Override + public com.openpositioning.PositionMe.Traj.LightReading getDefaultInstanceForType() { + return DEFAULT_INSTANCE; + } + + } + + public interface ProximityReadingOrBuilder extends + // @@protoc_insertion_point(interface_extends:ProximityReading) + com.google.protobuf.MessageOrBuilder { + + /** + * int64 relative_timestamp = 1; + * @return The relativeTimestamp. + */ + long getRelativeTimestamp(); + + /** + *
+     * cm
+     * 
+ * + * float distance = 2; + * @return The distance. + */ + float getDistance(); + } + /** + * Protobuf type {@code ProximityReading} + */ + public static final class ProximityReading extends + com.google.protobuf.GeneratedMessage implements + // @@protoc_insertion_point(message_implements:ProximityReading) + ProximityReadingOrBuilder { + private static final long serialVersionUID = 0L; + static { + com.google.protobuf.RuntimeVersion.validateProtobufGencodeVersion( + com.google.protobuf.RuntimeVersion.RuntimeDomain.PUBLIC, + /* major= */ 4, + /* minor= */ 29, + /* patch= */ 6, + /* suffix= */ "", + ProximityReading.class.getName()); + } + // Use ProximityReading.newBuilder() to construct. + private ProximityReading(com.google.protobuf.GeneratedMessage.Builder builder) { + super(builder); + } + private ProximityReading() { + } + + public static final com.google.protobuf.Descriptors.Descriptor + getDescriptor() { + return com.openpositioning.PositionMe.Traj.internal_static_ProximityReading_descriptor; + } + + @java.lang.Override + protected com.google.protobuf.GeneratedMessage.FieldAccessorTable + internalGetFieldAccessorTable() { + return com.openpositioning.PositionMe.Traj.internal_static_ProximityReading_fieldAccessorTable + .ensureFieldAccessorsInitialized( + com.openpositioning.PositionMe.Traj.ProximityReading.class, com.openpositioning.PositionMe.Traj.ProximityReading.Builder.class); + } + + public static final int RELATIVE_TIMESTAMP_FIELD_NUMBER = 1; + private long relativeTimestamp_ = 0L; + /** + * int64 relative_timestamp = 1; + * @return The relativeTimestamp. + */ + @java.lang.Override + public long getRelativeTimestamp() { + return relativeTimestamp_; + } + + public static final int DISTANCE_FIELD_NUMBER = 2; + private float distance_ = 0F; + /** + *
+     * cm
+     * 
+ * + * float distance = 2; + * @return The distance. + */ + @java.lang.Override + public float getDistance() { + return distance_; + } + + private byte memoizedIsInitialized = -1; + @java.lang.Override + public final boolean isInitialized() { + byte isInitialized = memoizedIsInitialized; + if (isInitialized == 1) return true; + if (isInitialized == 0) return false; + + memoizedIsInitialized = 1; + return true; + } + + @java.lang.Override + public void writeTo(com.google.protobuf.CodedOutputStream output) + throws java.io.IOException { + if (relativeTimestamp_ != 0L) { + output.writeInt64(1, relativeTimestamp_); + } + if (java.lang.Float.floatToRawIntBits(distance_) != 0) { + output.writeFloat(2, distance_); + } + getUnknownFields().writeTo(output); + } + + @java.lang.Override + public int getSerializedSize() { + int size = memoizedSize; + if (size != -1) return size; + + size = 0; + if (relativeTimestamp_ != 0L) { + size += com.google.protobuf.CodedOutputStream + .computeInt64Size(1, relativeTimestamp_); + } + if (java.lang.Float.floatToRawIntBits(distance_) != 0) { + size += com.google.protobuf.CodedOutputStream + .computeFloatSize(2, distance_); + } + size += getUnknownFields().getSerializedSize(); + memoizedSize = size; + return size; + } + + @java.lang.Override + public boolean equals(final java.lang.Object obj) { + if (obj == this) { + return true; + } + if (!(obj instanceof com.openpositioning.PositionMe.Traj.ProximityReading)) { + return super.equals(obj); + } + com.openpositioning.PositionMe.Traj.ProximityReading other = (com.openpositioning.PositionMe.Traj.ProximityReading) obj; + + if (getRelativeTimestamp() + != other.getRelativeTimestamp()) return false; + if (java.lang.Float.floatToIntBits(getDistance()) + != java.lang.Float.floatToIntBits( + other.getDistance())) return false; + if (!getUnknownFields().equals(other.getUnknownFields())) return false; + return true; + } + + @java.lang.Override + public int hashCode() { + if (memoizedHashCode != 0) { + return memoizedHashCode; + } + int hash = 41; + hash = (19 * hash) + getDescriptor().hashCode(); + hash = (37 * hash) + RELATIVE_TIMESTAMP_FIELD_NUMBER; + hash = (53 * hash) + com.google.protobuf.Internal.hashLong( + getRelativeTimestamp()); + hash = (37 * hash) + DISTANCE_FIELD_NUMBER; + hash = (53 * hash) + java.lang.Float.floatToIntBits( + getDistance()); + hash = (29 * hash) + getUnknownFields().hashCode(); + memoizedHashCode = hash; + return hash; + } + + public static com.openpositioning.PositionMe.Traj.ProximityReading parseFrom( + java.nio.ByteBuffer data) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + public static com.openpositioning.PositionMe.Traj.ProximityReading parseFrom( + java.nio.ByteBuffer data, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data, extensionRegistry); + } + public static com.openpositioning.PositionMe.Traj.ProximityReading parseFrom( + com.google.protobuf.ByteString data) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + public static com.openpositioning.PositionMe.Traj.ProximityReading parseFrom( + com.google.protobuf.ByteString data, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data, extensionRegistry); + } + public static com.openpositioning.PositionMe.Traj.ProximityReading parseFrom(byte[] data) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + public static com.openpositioning.PositionMe.Traj.ProximityReading parseFrom( + byte[] data, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data, extensionRegistry); + } + public static com.openpositioning.PositionMe.Traj.ProximityReading parseFrom(java.io.InputStream input) + throws java.io.IOException { + return com.google.protobuf.GeneratedMessage + .parseWithIOException(PARSER, input); + } + public static com.openpositioning.PositionMe.Traj.ProximityReading parseFrom( + java.io.InputStream input, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws java.io.IOException { + return com.google.protobuf.GeneratedMessage + .parseWithIOException(PARSER, input, extensionRegistry); + } + + public static com.openpositioning.PositionMe.Traj.ProximityReading parseDelimitedFrom(java.io.InputStream input) + throws java.io.IOException { + return com.google.protobuf.GeneratedMessage + .parseDelimitedWithIOException(PARSER, input); + } + + public static com.openpositioning.PositionMe.Traj.ProximityReading parseDelimitedFrom( + java.io.InputStream input, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws java.io.IOException { + return com.google.protobuf.GeneratedMessage + .parseDelimitedWithIOException(PARSER, input, extensionRegistry); + } + public static com.openpositioning.PositionMe.Traj.ProximityReading parseFrom( + com.google.protobuf.CodedInputStream input) + throws java.io.IOException { + return com.google.protobuf.GeneratedMessage + .parseWithIOException(PARSER, input); + } + public static com.openpositioning.PositionMe.Traj.ProximityReading parseFrom( + com.google.protobuf.CodedInputStream input, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws java.io.IOException { + return com.google.protobuf.GeneratedMessage + .parseWithIOException(PARSER, input, extensionRegistry); + } + + @java.lang.Override + public Builder newBuilderForType() { return newBuilder(); } + public static Builder newBuilder() { + return DEFAULT_INSTANCE.toBuilder(); + } + public static Builder newBuilder(com.openpositioning.PositionMe.Traj.ProximityReading prototype) { + return DEFAULT_INSTANCE.toBuilder().mergeFrom(prototype); + } + @java.lang.Override + public Builder toBuilder() { + return this == DEFAULT_INSTANCE + ? new Builder() : new Builder().mergeFrom(this); + } + + @java.lang.Override + protected Builder newBuilderForType( + com.google.protobuf.GeneratedMessage.BuilderParent parent) { + Builder builder = new Builder(parent); + return builder; + } + /** + * Protobuf type {@code ProximityReading} + */ + public static final class Builder extends + com.google.protobuf.GeneratedMessage.Builder implements + // @@protoc_insertion_point(builder_implements:ProximityReading) + com.openpositioning.PositionMe.Traj.ProximityReadingOrBuilder { + public static final com.google.protobuf.Descriptors.Descriptor + getDescriptor() { + return com.openpositioning.PositionMe.Traj.internal_static_ProximityReading_descriptor; + } + + @java.lang.Override + protected com.google.protobuf.GeneratedMessage.FieldAccessorTable + internalGetFieldAccessorTable() { + return com.openpositioning.PositionMe.Traj.internal_static_ProximityReading_fieldAccessorTable + .ensureFieldAccessorsInitialized( + com.openpositioning.PositionMe.Traj.ProximityReading.class, com.openpositioning.PositionMe.Traj.ProximityReading.Builder.class); + } + + // Construct using com.openpositioning.PositionMe.Traj.ProximityReading.newBuilder() + private Builder() { + + } + + private Builder( + com.google.protobuf.GeneratedMessage.BuilderParent parent) { + super(parent); + + } + @java.lang.Override + public Builder clear() { + super.clear(); + bitField0_ = 0; + relativeTimestamp_ = 0L; + distance_ = 0F; + return this; + } + + @java.lang.Override + public com.google.protobuf.Descriptors.Descriptor + getDescriptorForType() { + return com.openpositioning.PositionMe.Traj.internal_static_ProximityReading_descriptor; + } + + @java.lang.Override + public com.openpositioning.PositionMe.Traj.ProximityReading getDefaultInstanceForType() { + return com.openpositioning.PositionMe.Traj.ProximityReading.getDefaultInstance(); + } + + @java.lang.Override + public com.openpositioning.PositionMe.Traj.ProximityReading build() { + com.openpositioning.PositionMe.Traj.ProximityReading result = buildPartial(); + if (!result.isInitialized()) { + throw newUninitializedMessageException(result); + } + return result; + } + + @java.lang.Override + public com.openpositioning.PositionMe.Traj.ProximityReading buildPartial() { + com.openpositioning.PositionMe.Traj.ProximityReading result = new com.openpositioning.PositionMe.Traj.ProximityReading(this); + if (bitField0_ != 0) { buildPartial0(result); } + onBuilt(); + return result; + } + + private void buildPartial0(com.openpositioning.PositionMe.Traj.ProximityReading result) { + int from_bitField0_ = bitField0_; + if (((from_bitField0_ & 0x00000001) != 0)) { + result.relativeTimestamp_ = relativeTimestamp_; + } + if (((from_bitField0_ & 0x00000002) != 0)) { + result.distance_ = distance_; + } + } + + @java.lang.Override + public Builder mergeFrom(com.google.protobuf.Message other) { + if (other instanceof com.openpositioning.PositionMe.Traj.ProximityReading) { + return mergeFrom((com.openpositioning.PositionMe.Traj.ProximityReading)other); + } else { + super.mergeFrom(other); + return this; + } + } + + public Builder mergeFrom(com.openpositioning.PositionMe.Traj.ProximityReading other) { + if (other == com.openpositioning.PositionMe.Traj.ProximityReading.getDefaultInstance()) return this; + if (other.getRelativeTimestamp() != 0L) { + setRelativeTimestamp(other.getRelativeTimestamp()); + } + if (other.getDistance() != 0F) { + setDistance(other.getDistance()); + } + this.mergeUnknownFields(other.getUnknownFields()); + onChanged(); + return this; + } + + @java.lang.Override + public final boolean isInitialized() { + return true; + } + + @java.lang.Override + public Builder mergeFrom( + com.google.protobuf.CodedInputStream input, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws java.io.IOException { + if (extensionRegistry == null) { + throw new java.lang.NullPointerException(); + } + try { + boolean done = false; + while (!done) { + int tag = input.readTag(); + switch (tag) { + case 0: + done = true; + break; + case 8: { + relativeTimestamp_ = input.readInt64(); + bitField0_ |= 0x00000001; + break; + } // case 8 + case 21: { + distance_ = input.readFloat(); + bitField0_ |= 0x00000002; + break; + } // case 21 + default: { + if (!super.parseUnknownField(input, extensionRegistry, tag)) { + done = true; // was an endgroup tag + } + break; + } // default: + } // switch (tag) + } // while (!done) + } catch (com.google.protobuf.InvalidProtocolBufferException e) { + throw e.unwrapIOException(); + } finally { + onChanged(); + } // finally + return this; + } + private int bitField0_; + + private long relativeTimestamp_ ; + /** + * int64 relative_timestamp = 1; + * @return The relativeTimestamp. + */ + @java.lang.Override + public long getRelativeTimestamp() { + return relativeTimestamp_; + } + /** + * int64 relative_timestamp = 1; + * @param value The relativeTimestamp to set. + * @return This builder for chaining. + */ + public Builder setRelativeTimestamp(long value) { + + relativeTimestamp_ = value; + bitField0_ |= 0x00000001; + onChanged(); + return this; + } + /** + * int64 relative_timestamp = 1; + * @return This builder for chaining. + */ + public Builder clearRelativeTimestamp() { + bitField0_ = (bitField0_ & ~0x00000001); + relativeTimestamp_ = 0L; + onChanged(); + return this; + } + + private float distance_ ; + /** + *
+       * cm
+       * 
+ * + * float distance = 2; + * @return The distance. + */ + @java.lang.Override + public float getDistance() { + return distance_; + } + /** + *
+       * cm
+       * 
+ * + * float distance = 2; + * @param value The distance to set. + * @return This builder for chaining. + */ + public Builder setDistance(float value) { + + distance_ = value; + bitField0_ |= 0x00000002; + onChanged(); + return this; + } + /** + *
+       * cm
+       * 
+ * + * float distance = 2; + * @return This builder for chaining. + */ + public Builder clearDistance() { + bitField0_ = (bitField0_ & ~0x00000002); + distance_ = 0F; + onChanged(); + return this; + } + + // @@protoc_insertion_point(builder_scope:ProximityReading) + } + + // @@protoc_insertion_point(class_scope:ProximityReading) + private static final com.openpositioning.PositionMe.Traj.ProximityReading DEFAULT_INSTANCE; static { - DEFAULT_INSTANCE = new Trajectory(); + DEFAULT_INSTANCE = new com.openpositioning.PositionMe.Traj.ProximityReading(); } - public static Trajectory getDefaultInstance() { + public static com.openpositioning.PositionMe.Traj.ProximityReading getDefaultInstance() { return DEFAULT_INSTANCE; } - private static final com.google.protobuf.Parser - PARSER = new com.google.protobuf.AbstractParser() { - public Trajectory parsePartialFrom( - com.google.protobuf.CodedInputStream input, - com.google.protobuf.ExtensionRegistryLite extensionRegistry) - throws com.google.protobuf.InvalidProtocolBufferException { - return new Trajectory(input, extensionRegistry); + private static final com.google.protobuf.Parser + PARSER = new com.google.protobuf.AbstractParser() { + @java.lang.Override + public ProximityReading parsePartialFrom( + com.google.protobuf.CodedInputStream input, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + Builder builder = newBuilder(); + try { + builder.mergeFrom(input, extensionRegistry); + } catch (com.google.protobuf.InvalidProtocolBufferException e) { + throw e.setUnfinishedMessage(builder.buildPartial()); + } catch (com.google.protobuf.UninitializedMessageException e) { + throw e.asInvalidProtocolBufferException().setUnfinishedMessage(builder.buildPartial()); + } catch (java.io.IOException e) { + throw new com.google.protobuf.InvalidProtocolBufferException(e) + .setUnfinishedMessage(builder.buildPartial()); + } + return builder.buildPartial(); } }; - public static com.google.protobuf.Parser parser() { + public static com.google.protobuf.Parser parser() { return PARSER; } - @Override - public com.google.protobuf.Parser getParserForType() { + @java.lang.Override + public com.google.protobuf.Parser getParserForType() { return PARSER; } - public Trajectory getDefaultInstanceForType() { + @java.lang.Override + public com.openpositioning.PositionMe.Traj.ProximityReading getDefaultInstanceForType() { return DEFAULT_INSTANCE; } } - public interface Pdr_SampleOrBuilder extends - // @@protoc_insertion_point(interface_extends:Pdr_Sample) - com.google.protobuf.MessageOrBuilder { + public interface GNSSPositionOrBuilder extends + // @@protoc_insertion_point(interface_extends:GNSSPosition) + com.google.protobuf.MessageOrBuilder { + + /** + * int64 relative_timestamp = 1; + * @return The relativeTimestamp. + */ + long getRelativeTimestamp(); /** *
-     * milliseconds from the start_timestamp
+     * degrees (minimum 6 significant figures)
+     * latitude between -90 and 90
      * 
* - * optional int64 relative_timestamp = 1; + * double latitude = 2; + * @return The latitude. */ - long getRelativeTimestamp(); + double getLatitude(); /** *
-     * Both in metres. You should implement an algorithm to estimate
-     * these values. The values are always relative to your start point
-     * so the first entry should always be x = 0.0, y = 0.0
+     * longitude between -180 and 180
      * 
* - * optional float x = 2; + * double longitude = 3; + * @return The longitude. */ - float getX(); + double getLongitude(); /** - * optional float y = 3; + *
+     * metres
+     * 
+ * + * double altitude = 4; + * @return The altitude. */ - float getY(); + double getAltitude(); + + /** + *
+     * floor name
+     * 
+ * + * optional string floor = 5; + * @return Whether the floor field is set. + */ + boolean hasFloor(); + /** + *
+     * floor name
+     * 
+ * + * optional string floor = 5; + * @return The floor. + */ + java.lang.String getFloor(); + /** + *
+     * floor name
+     * 
+ * + * optional string floor = 5; + * @return The bytes for floor. + */ + com.google.protobuf.ByteString + getFloorBytes(); } /** - * Protobuf type {@code Pdr_Sample} + * Protobuf type {@code GNSSPosition} */ - public static final class Pdr_Sample extends - com.google.protobuf.GeneratedMessageV3 implements - // @@protoc_insertion_point(message_implements:Pdr_Sample) - Pdr_SampleOrBuilder { - // Use Pdr_Sample.newBuilder() to construct. - private Pdr_Sample(com.google.protobuf.GeneratedMessageV3.Builder builder) { + public static final class GNSSPosition extends + com.google.protobuf.GeneratedMessage implements + // @@protoc_insertion_point(message_implements:GNSSPosition) + GNSSPositionOrBuilder { + private static final long serialVersionUID = 0L; + static { + com.google.protobuf.RuntimeVersion.validateProtobufGencodeVersion( + com.google.protobuf.RuntimeVersion.RuntimeDomain.PUBLIC, + /* major= */ 4, + /* minor= */ 29, + /* patch= */ 6, + /* suffix= */ "", + GNSSPosition.class.getName()); + } + // Use GNSSPosition.newBuilder() to construct. + private GNSSPosition(com.google.protobuf.GeneratedMessage.Builder builder) { super(builder); } - private Pdr_Sample() { - relativeTimestamp_ = 0L; - x_ = 0F; - y_ = 0F; - } - - @Override - public final com.google.protobuf.UnknownFieldSet - getUnknownFields() { - return com.google.protobuf.UnknownFieldSet.getDefaultInstance(); - } - private Pdr_Sample( - com.google.protobuf.CodedInputStream input, - com.google.protobuf.ExtensionRegistryLite extensionRegistry) - throws com.google.protobuf.InvalidProtocolBufferException { - this(); - int mutable_bitField0_ = 0; - try { - boolean done = false; - while (!done) { - int tag = input.readTag(); - switch (tag) { - case 0: - done = true; - break; - default: { - if (!input.skipField(tag)) { - done = true; - } - break; - } - case 8: { + private GNSSPosition() { + floor_ = ""; + } - relativeTimestamp_ = input.readInt64(); - break; - } - case 21: { + public static final com.google.protobuf.Descriptors.Descriptor + getDescriptor() { + return com.openpositioning.PositionMe.Traj.internal_static_GNSSPosition_descriptor; + } - x_ = input.readFloat(); - break; - } - case 29: { + @java.lang.Override + protected com.google.protobuf.GeneratedMessage.FieldAccessorTable + internalGetFieldAccessorTable() { + return com.openpositioning.PositionMe.Traj.internal_static_GNSSPosition_fieldAccessorTable + .ensureFieldAccessorsInitialized( + com.openpositioning.PositionMe.Traj.GNSSPosition.class, com.openpositioning.PositionMe.Traj.GNSSPosition.Builder.class); + } - y_ = input.readFloat(); - break; - } - } - } - } catch (com.google.protobuf.InvalidProtocolBufferException e) { - throw e.setUnfinishedMessage(this); - } catch (java.io.IOException e) { - throw new com.google.protobuf.InvalidProtocolBufferException( - e).setUnfinishedMessage(this); - } finally { - makeExtensionsImmutable(); - } + private int bitField0_; + public static final int RELATIVE_TIMESTAMP_FIELD_NUMBER = 1; + private long relativeTimestamp_ = 0L; + /** + * int64 relative_timestamp = 1; + * @return The relativeTimestamp. + */ + @java.lang.Override + public long getRelativeTimestamp() { + return relativeTimestamp_; } - public static final com.google.protobuf.Descriptors.Descriptor - getDescriptor() { - return Traj.internal_static_Pdr_Sample_descriptor; + + public static final int LATITUDE_FIELD_NUMBER = 2; + private double latitude_ = 0D; + /** + *
+     * degrees (minimum 6 significant figures)
+     * latitude between -90 and 90
+     * 
+ * + * double latitude = 2; + * @return The latitude. + */ + @java.lang.Override + public double getLatitude() { + return latitude_; + } + + public static final int LONGITUDE_FIELD_NUMBER = 3; + private double longitude_ = 0D; + /** + *
+     * longitude between -180 and 180
+     * 
+ * + * double longitude = 3; + * @return The longitude. + */ + @java.lang.Override + public double getLongitude() { + return longitude_; } - protected com.google.protobuf.GeneratedMessageV3.FieldAccessorTable - internalGetFieldAccessorTable() { - return Traj.internal_static_Pdr_Sample_fieldAccessorTable - .ensureFieldAccessorsInitialized( - Pdr_Sample.class, Builder.class); + public static final int ALTITUDE_FIELD_NUMBER = 4; + private double altitude_ = 0D; + /** + *
+     * metres
+     * 
+ * + * double altitude = 4; + * @return The altitude. + */ + @java.lang.Override + public double getAltitude() { + return altitude_; } - public static final int RELATIVE_TIMESTAMP_FIELD_NUMBER = 1; - private long relativeTimestamp_; + public static final int FLOOR_FIELD_NUMBER = 5; + @SuppressWarnings("serial") + private volatile java.lang.Object floor_ = ""; /** *
-     * milliseconds from the start_timestamp
+     * floor name
      * 
* - * optional int64 relative_timestamp = 1; + * optional string floor = 5; + * @return Whether the floor field is set. */ - public long getRelativeTimestamp() { - return relativeTimestamp_; + @java.lang.Override + public boolean hasFloor() { + return ((bitField0_ & 0x00000001) != 0); } - - public static final int X_FIELD_NUMBER = 2; - private float x_; /** *
-     * Both in metres. You should implement an algorithm to estimate
-     * these values. The values are always relative to your start point
-     * so the first entry should always be x = 0.0, y = 0.0
+     * floor name
      * 
* - * optional float x = 2; + * optional string floor = 5; + * @return The floor. */ - public float getX() { - return x_; + @java.lang.Override + public java.lang.String getFloor() { + java.lang.Object ref = floor_; + if (ref instanceof java.lang.String) { + return (java.lang.String) ref; + } else { + com.google.protobuf.ByteString bs = + (com.google.protobuf.ByteString) ref; + java.lang.String s = bs.toStringUtf8(); + floor_ = s; + return s; + } } - - public static final int Y_FIELD_NUMBER = 3; - private float y_; /** - * optional float y = 3; + *
+     * floor name
+     * 
+ * + * optional string floor = 5; + * @return The bytes for floor. */ - public float getY() { - return y_; + @java.lang.Override + public com.google.protobuf.ByteString + getFloorBytes() { + java.lang.Object ref = floor_; + if (ref instanceof java.lang.String) { + com.google.protobuf.ByteString b = + com.google.protobuf.ByteString.copyFromUtf8( + (java.lang.String) ref); + floor_ = b; + return b; + } else { + return (com.google.protobuf.ByteString) ref; + } } private byte memoizedIsInitialized = -1; + @java.lang.Override public final boolean isInitialized() { byte isInitialized = memoizedIsInitialized; if (isInitialized == 1) return true; @@ -5027,19 +12292,28 @@ public final boolean isInitialized() { return true; } + @java.lang.Override public void writeTo(com.google.protobuf.CodedOutputStream output) - throws java.io.IOException { + throws java.io.IOException { if (relativeTimestamp_ != 0L) { output.writeInt64(1, relativeTimestamp_); } - if (x_ != 0F) { - output.writeFloat(2, x_); + if (java.lang.Double.doubleToRawLongBits(latitude_) != 0) { + output.writeDouble(2, latitude_); } - if (y_ != 0F) { - output.writeFloat(3, y_); + if (java.lang.Double.doubleToRawLongBits(longitude_) != 0) { + output.writeDouble(3, longitude_); + } + if (java.lang.Double.doubleToRawLongBits(altitude_) != 0) { + output.writeDouble(4, altitude_); + } + if (((bitField0_ & 0x00000001) != 0)) { + com.google.protobuf.GeneratedMessage.writeString(output, 5, floor_); } + getUnknownFields().writeTo(output); } + @java.lang.Override public int getSerializedSize() { int size = memoizedSize; if (size != -1) return size; @@ -5047,789 +12321,916 @@ public int getSerializedSize() { size = 0; if (relativeTimestamp_ != 0L) { size += com.google.protobuf.CodedOutputStream - .computeInt64Size(1, relativeTimestamp_); + .computeInt64Size(1, relativeTimestamp_); } - if (x_ != 0F) { + if (java.lang.Double.doubleToRawLongBits(latitude_) != 0) { size += com.google.protobuf.CodedOutputStream - .computeFloatSize(2, x_); + .computeDoubleSize(2, latitude_); } - if (y_ != 0F) { + if (java.lang.Double.doubleToRawLongBits(longitude_) != 0) { size += com.google.protobuf.CodedOutputStream - .computeFloatSize(3, y_); + .computeDoubleSize(3, longitude_); } + if (java.lang.Double.doubleToRawLongBits(altitude_) != 0) { + size += com.google.protobuf.CodedOutputStream + .computeDoubleSize(4, altitude_); + } + if (((bitField0_ & 0x00000001) != 0)) { + size += com.google.protobuf.GeneratedMessage.computeStringSize(5, floor_); + } + size += getUnknownFields().getSerializedSize(); memoizedSize = size; return size; } - private static final long serialVersionUID = 0L; - @Override - public boolean equals(final Object obj) { + @java.lang.Override + public boolean equals(final java.lang.Object obj) { if (obj == this) { - return true; + return true; } - if (!(obj instanceof Pdr_Sample)) { + if (!(obj instanceof com.openpositioning.PositionMe.Traj.GNSSPosition)) { return super.equals(obj); } - Pdr_Sample other = (Pdr_Sample) obj; - - boolean result = true; - result = result && (getRelativeTimestamp() - == other.getRelativeTimestamp()); - result = result && ( - Float.floatToIntBits(getX()) - == Float.floatToIntBits( - other.getX())); - result = result && ( - Float.floatToIntBits(getY()) - == Float.floatToIntBits( - other.getY())); - return result; + com.openpositioning.PositionMe.Traj.GNSSPosition other = (com.openpositioning.PositionMe.Traj.GNSSPosition) obj; + + if (getRelativeTimestamp() + != other.getRelativeTimestamp()) return false; + if (java.lang.Double.doubleToLongBits(getLatitude()) + != java.lang.Double.doubleToLongBits( + other.getLatitude())) return false; + if (java.lang.Double.doubleToLongBits(getLongitude()) + != java.lang.Double.doubleToLongBits( + other.getLongitude())) return false; + if (java.lang.Double.doubleToLongBits(getAltitude()) + != java.lang.Double.doubleToLongBits( + other.getAltitude())) return false; + if (hasFloor() != other.hasFloor()) return false; + if (hasFloor()) { + if (!getFloor() + .equals(other.getFloor())) return false; + } + if (!getUnknownFields().equals(other.getUnknownFields())) return false; + return true; } - @Override + @java.lang.Override public int hashCode() { if (memoizedHashCode != 0) { return memoizedHashCode; } int hash = 41; - hash = (19 * hash) + getDescriptorForType().hashCode(); + hash = (19 * hash) + getDescriptor().hashCode(); hash = (37 * hash) + RELATIVE_TIMESTAMP_FIELD_NUMBER; hash = (53 * hash) + com.google.protobuf.Internal.hashLong( - getRelativeTimestamp()); - hash = (37 * hash) + X_FIELD_NUMBER; - hash = (53 * hash) + Float.floatToIntBits( - getX()); - hash = (37 * hash) + Y_FIELD_NUMBER; - hash = (53 * hash) + Float.floatToIntBits( - getY()); - hash = (29 * hash) + unknownFields.hashCode(); + getRelativeTimestamp()); + hash = (37 * hash) + LATITUDE_FIELD_NUMBER; + hash = (53 * hash) + com.google.protobuf.Internal.hashLong( + java.lang.Double.doubleToLongBits(getLatitude())); + hash = (37 * hash) + LONGITUDE_FIELD_NUMBER; + hash = (53 * hash) + com.google.protobuf.Internal.hashLong( + java.lang.Double.doubleToLongBits(getLongitude())); + hash = (37 * hash) + ALTITUDE_FIELD_NUMBER; + hash = (53 * hash) + com.google.protobuf.Internal.hashLong( + java.lang.Double.doubleToLongBits(getAltitude())); + if (hasFloor()) { + hash = (37 * hash) + FLOOR_FIELD_NUMBER; + hash = (53 * hash) + getFloor().hashCode(); + } + hash = (29 * hash) + getUnknownFields().hashCode(); memoizedHashCode = hash; return hash; } - public static Pdr_Sample parseFrom( - com.google.protobuf.ByteString data) - throws com.google.protobuf.InvalidProtocolBufferException { + public static com.openpositioning.PositionMe.Traj.GNSSPosition parseFrom( + java.nio.ByteBuffer data) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + public static com.openpositioning.PositionMe.Traj.GNSSPosition parseFrom( + java.nio.ByteBuffer data, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data, extensionRegistry); + } + public static com.openpositioning.PositionMe.Traj.GNSSPosition parseFrom( + com.google.protobuf.ByteString data) + throws com.google.protobuf.InvalidProtocolBufferException { return PARSER.parseFrom(data); } - public static Pdr_Sample parseFrom( - com.google.protobuf.ByteString data, - com.google.protobuf.ExtensionRegistryLite extensionRegistry) - throws com.google.protobuf.InvalidProtocolBufferException { + public static com.openpositioning.PositionMe.Traj.GNSSPosition parseFrom( + com.google.protobuf.ByteString data, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { return PARSER.parseFrom(data, extensionRegistry); } - public static Pdr_Sample parseFrom(byte[] data) - throws com.google.protobuf.InvalidProtocolBufferException { + public static com.openpositioning.PositionMe.Traj.GNSSPosition parseFrom(byte[] data) + throws com.google.protobuf.InvalidProtocolBufferException { return PARSER.parseFrom(data); } - public static Pdr_Sample parseFrom( - byte[] data, - com.google.protobuf.ExtensionRegistryLite extensionRegistry) - throws com.google.protobuf.InvalidProtocolBufferException { + public static com.openpositioning.PositionMe.Traj.GNSSPosition parseFrom( + byte[] data, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { return PARSER.parseFrom(data, extensionRegistry); } - public static Pdr_Sample parseFrom(java.io.InputStream input) - throws java.io.IOException { - return com.google.protobuf.GeneratedMessageV3 - .parseWithIOException(PARSER, input); - } - public static Pdr_Sample parseFrom( - java.io.InputStream input, - com.google.protobuf.ExtensionRegistryLite extensionRegistry) - throws java.io.IOException { - return com.google.protobuf.GeneratedMessageV3 - .parseWithIOException(PARSER, input, extensionRegistry); - } - public static Pdr_Sample parseDelimitedFrom(java.io.InputStream input) - throws java.io.IOException { - return com.google.protobuf.GeneratedMessageV3 - .parseDelimitedWithIOException(PARSER, input); - } - public static Pdr_Sample parseDelimitedFrom( - java.io.InputStream input, - com.google.protobuf.ExtensionRegistryLite extensionRegistry) - throws java.io.IOException { - return com.google.protobuf.GeneratedMessageV3 - .parseDelimitedWithIOException(PARSER, input, extensionRegistry); - } - public static Pdr_Sample parseFrom( - com.google.protobuf.CodedInputStream input) - throws java.io.IOException { - return com.google.protobuf.GeneratedMessageV3 - .parseWithIOException(PARSER, input); - } - public static Pdr_Sample parseFrom( - com.google.protobuf.CodedInputStream input, - com.google.protobuf.ExtensionRegistryLite extensionRegistry) - throws java.io.IOException { - return com.google.protobuf.GeneratedMessageV3 - .parseWithIOException(PARSER, input, extensionRegistry); + public static com.openpositioning.PositionMe.Traj.GNSSPosition parseFrom(java.io.InputStream input) + throws java.io.IOException { + return com.google.protobuf.GeneratedMessage + .parseWithIOException(PARSER, input); + } + public static com.openpositioning.PositionMe.Traj.GNSSPosition parseFrom( + java.io.InputStream input, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws java.io.IOException { + return com.google.protobuf.GeneratedMessage + .parseWithIOException(PARSER, input, extensionRegistry); + } + + public static com.openpositioning.PositionMe.Traj.GNSSPosition parseDelimitedFrom(java.io.InputStream input) + throws java.io.IOException { + return com.google.protobuf.GeneratedMessage + .parseDelimitedWithIOException(PARSER, input); + } + + public static com.openpositioning.PositionMe.Traj.GNSSPosition parseDelimitedFrom( + java.io.InputStream input, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws java.io.IOException { + return com.google.protobuf.GeneratedMessage + .parseDelimitedWithIOException(PARSER, input, extensionRegistry); + } + public static com.openpositioning.PositionMe.Traj.GNSSPosition parseFrom( + com.google.protobuf.CodedInputStream input) + throws java.io.IOException { + return com.google.protobuf.GeneratedMessage + .parseWithIOException(PARSER, input); + } + public static com.openpositioning.PositionMe.Traj.GNSSPosition parseFrom( + com.google.protobuf.CodedInputStream input, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws java.io.IOException { + return com.google.protobuf.GeneratedMessage + .parseWithIOException(PARSER, input, extensionRegistry); } + @java.lang.Override public Builder newBuilderForType() { return newBuilder(); } public static Builder newBuilder() { return DEFAULT_INSTANCE.toBuilder(); } - public static Builder newBuilder(Pdr_Sample prototype) { + public static Builder newBuilder(com.openpositioning.PositionMe.Traj.GNSSPosition prototype) { return DEFAULT_INSTANCE.toBuilder().mergeFrom(prototype); } + @java.lang.Override public Builder toBuilder() { return this == DEFAULT_INSTANCE - ? new Builder() : new Builder().mergeFrom(this); + ? new Builder() : new Builder().mergeFrom(this); } - @Override + @java.lang.Override protected Builder newBuilderForType( - com.google.protobuf.GeneratedMessageV3.BuilderParent parent) { + com.google.protobuf.GeneratedMessage.BuilderParent parent) { Builder builder = new Builder(parent); return builder; } /** - * Protobuf type {@code Pdr_Sample} + * Protobuf type {@code GNSSPosition} */ public static final class Builder extends - com.google.protobuf.GeneratedMessageV3.Builder implements - // @@protoc_insertion_point(builder_implements:Pdr_Sample) - Pdr_SampleOrBuilder { + com.google.protobuf.GeneratedMessage.Builder implements + // @@protoc_insertion_point(builder_implements:GNSSPosition) + com.openpositioning.PositionMe.Traj.GNSSPositionOrBuilder { public static final com.google.protobuf.Descriptors.Descriptor - getDescriptor() { - return Traj.internal_static_Pdr_Sample_descriptor; + getDescriptor() { + return com.openpositioning.PositionMe.Traj.internal_static_GNSSPosition_descriptor; } - protected com.google.protobuf.GeneratedMessageV3.FieldAccessorTable - internalGetFieldAccessorTable() { - return Traj.internal_static_Pdr_Sample_fieldAccessorTable - .ensureFieldAccessorsInitialized( - Pdr_Sample.class, Builder.class); + @java.lang.Override + protected com.google.protobuf.GeneratedMessage.FieldAccessorTable + internalGetFieldAccessorTable() { + return com.openpositioning.PositionMe.Traj.internal_static_GNSSPosition_fieldAccessorTable + .ensureFieldAccessorsInitialized( + com.openpositioning.PositionMe.Traj.GNSSPosition.class, com.openpositioning.PositionMe.Traj.GNSSPosition.Builder.class); } - // Construct using Traj.Pdr_Sample.newBuilder() + // Construct using com.openpositioning.PositionMe.Traj.GNSSPosition.newBuilder() private Builder() { - maybeForceBuilderInitialization(); + } private Builder( - com.google.protobuf.GeneratedMessageV3.BuilderParent parent) { + com.google.protobuf.GeneratedMessage.BuilderParent parent) { super(parent); - maybeForceBuilderInitialization(); - } - private void maybeForceBuilderInitialization() { - if (com.google.protobuf.GeneratedMessageV3 - .alwaysUseFieldBuilders) { - } + } + @java.lang.Override public Builder clear() { super.clear(); + bitField0_ = 0; relativeTimestamp_ = 0L; - - x_ = 0F; - - y_ = 0F; - + latitude_ = 0D; + longitude_ = 0D; + altitude_ = 0D; + floor_ = ""; return this; } + @java.lang.Override public com.google.protobuf.Descriptors.Descriptor - getDescriptorForType() { - return Traj.internal_static_Pdr_Sample_descriptor; + getDescriptorForType() { + return com.openpositioning.PositionMe.Traj.internal_static_GNSSPosition_descriptor; } - public Pdr_Sample getDefaultInstanceForType() { - return Pdr_Sample.getDefaultInstance(); + @java.lang.Override + public com.openpositioning.PositionMe.Traj.GNSSPosition getDefaultInstanceForType() { + return com.openpositioning.PositionMe.Traj.GNSSPosition.getDefaultInstance(); } - public Pdr_Sample build() { - Pdr_Sample result = buildPartial(); + @java.lang.Override + public com.openpositioning.PositionMe.Traj.GNSSPosition build() { + com.openpositioning.PositionMe.Traj.GNSSPosition result = buildPartial(); if (!result.isInitialized()) { throw newUninitializedMessageException(result); } return result; } - public Pdr_Sample buildPartial() { - Pdr_Sample result = new Pdr_Sample(this); - result.relativeTimestamp_ = relativeTimestamp_; - result.x_ = x_; - result.y_ = y_; + @java.lang.Override + public com.openpositioning.PositionMe.Traj.GNSSPosition buildPartial() { + com.openpositioning.PositionMe.Traj.GNSSPosition result = new com.openpositioning.PositionMe.Traj.GNSSPosition(this); + if (bitField0_ != 0) { buildPartial0(result); } onBuilt(); return result; } - public Builder clone() { - return (Builder) super.clone(); - } - public Builder setField( - com.google.protobuf.Descriptors.FieldDescriptor field, - Object value) { - return (Builder) super.setField(field, value); - } - public Builder clearField( - com.google.protobuf.Descriptors.FieldDescriptor field) { - return (Builder) super.clearField(field); - } - public Builder clearOneof( - com.google.protobuf.Descriptors.OneofDescriptor oneof) { - return (Builder) super.clearOneof(oneof); - } - public Builder setRepeatedField( - com.google.protobuf.Descriptors.FieldDescriptor field, - int index, Object value) { - return (Builder) super.setRepeatedField(field, index, value); - } - public Builder addRepeatedField( - com.google.protobuf.Descriptors.FieldDescriptor field, - Object value) { - return (Builder) super.addRepeatedField(field, value); + private void buildPartial0(com.openpositioning.PositionMe.Traj.GNSSPosition result) { + int from_bitField0_ = bitField0_; + if (((from_bitField0_ & 0x00000001) != 0)) { + result.relativeTimestamp_ = relativeTimestamp_; + } + if (((from_bitField0_ & 0x00000002) != 0)) { + result.latitude_ = latitude_; + } + if (((from_bitField0_ & 0x00000004) != 0)) { + result.longitude_ = longitude_; + } + if (((from_bitField0_ & 0x00000008) != 0)) { + result.altitude_ = altitude_; + } + int to_bitField0_ = 0; + if (((from_bitField0_ & 0x00000010) != 0)) { + result.floor_ = floor_; + to_bitField0_ |= 0x00000001; + } + result.bitField0_ |= to_bitField0_; } + + @java.lang.Override public Builder mergeFrom(com.google.protobuf.Message other) { - if (other instanceof Pdr_Sample) { - return mergeFrom((Pdr_Sample)other); + if (other instanceof com.openpositioning.PositionMe.Traj.GNSSPosition) { + return mergeFrom((com.openpositioning.PositionMe.Traj.GNSSPosition)other); } else { super.mergeFrom(other); return this; } } - public Builder mergeFrom(Pdr_Sample other) { - if (other == Pdr_Sample.getDefaultInstance()) return this; + public Builder mergeFrom(com.openpositioning.PositionMe.Traj.GNSSPosition other) { + if (other == com.openpositioning.PositionMe.Traj.GNSSPosition.getDefaultInstance()) return this; if (other.getRelativeTimestamp() != 0L) { setRelativeTimestamp(other.getRelativeTimestamp()); } - if (other.getX() != 0F) { - setX(other.getX()); + if (other.getLatitude() != 0D) { + setLatitude(other.getLatitude()); } - if (other.getY() != 0F) { - setY(other.getY()); + if (other.getLongitude() != 0D) { + setLongitude(other.getLongitude()); } + if (other.getAltitude() != 0D) { + setAltitude(other.getAltitude()); + } + if (other.hasFloor()) { + floor_ = other.floor_; + bitField0_ |= 0x00000010; + onChanged(); + } + this.mergeUnknownFields(other.getUnknownFields()); onChanged(); return this; } + @java.lang.Override public final boolean isInitialized() { return true; } + @java.lang.Override public Builder mergeFrom( - com.google.protobuf.CodedInputStream input, - com.google.protobuf.ExtensionRegistryLite extensionRegistry) - throws java.io.IOException { - Pdr_Sample parsedMessage = null; + com.google.protobuf.CodedInputStream input, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws java.io.IOException { + if (extensionRegistry == null) { + throw new java.lang.NullPointerException(); + } try { - parsedMessage = PARSER.parsePartialFrom(input, extensionRegistry); + boolean done = false; + while (!done) { + int tag = input.readTag(); + switch (tag) { + case 0: + done = true; + break; + case 8: { + relativeTimestamp_ = input.readInt64(); + bitField0_ |= 0x00000001; + break; + } // case 8 + case 17: { + latitude_ = input.readDouble(); + bitField0_ |= 0x00000002; + break; + } // case 17 + case 25: { + longitude_ = input.readDouble(); + bitField0_ |= 0x00000004; + break; + } // case 25 + case 33: { + altitude_ = input.readDouble(); + bitField0_ |= 0x00000008; + break; + } // case 33 + case 42: { + floor_ = input.readStringRequireUtf8(); + bitField0_ |= 0x00000010; + break; + } // case 42 + default: { + if (!super.parseUnknownField(input, extensionRegistry, tag)) { + done = true; // was an endgroup tag + } + break; + } // default: + } // switch (tag) + } // while (!done) } catch (com.google.protobuf.InvalidProtocolBufferException e) { - parsedMessage = (Pdr_Sample) e.getUnfinishedMessage(); throw e.unwrapIOException(); } finally { - if (parsedMessage != null) { - mergeFrom(parsedMessage); - } - } + onChanged(); + } // finally return this; } + private int bitField0_; private long relativeTimestamp_ ; + /** + * int64 relative_timestamp = 1; + * @return The relativeTimestamp. + */ + @java.lang.Override + public long getRelativeTimestamp() { + return relativeTimestamp_; + } + /** + * int64 relative_timestamp = 1; + * @param value The relativeTimestamp to set. + * @return This builder for chaining. + */ + public Builder setRelativeTimestamp(long value) { + + relativeTimestamp_ = value; + bitField0_ |= 0x00000001; + onChanged(); + return this; + } + /** + * int64 relative_timestamp = 1; + * @return This builder for chaining. + */ + public Builder clearRelativeTimestamp() { + bitField0_ = (bitField0_ & ~0x00000001); + relativeTimestamp_ = 0L; + onChanged(); + return this; + } + + private double latitude_ ; /** *
-       * milliseconds from the start_timestamp
+       * degrees (minimum 6 significant figures)
+       * latitude between -90 and 90
        * 
* - * optional int64 relative_timestamp = 1; + * double latitude = 2; + * @return The latitude. */ - public long getRelativeTimestamp() { - return relativeTimestamp_; + @java.lang.Override + public double getLatitude() { + return latitude_; } /** *
-       * milliseconds from the start_timestamp
+       * degrees (minimum 6 significant figures)
+       * latitude between -90 and 90
        * 
* - * optional int64 relative_timestamp = 1; + * double latitude = 2; + * @param value The latitude to set. + * @return This builder for chaining. */ - public Builder setRelativeTimestamp(long value) { - - relativeTimestamp_ = value; + public Builder setLatitude(double value) { + + latitude_ = value; + bitField0_ |= 0x00000002; onChanged(); return this; } /** *
-       * milliseconds from the start_timestamp
+       * degrees (minimum 6 significant figures)
+       * latitude between -90 and 90
        * 
* - * optional int64 relative_timestamp = 1; + * double latitude = 2; + * @return This builder for chaining. */ - public Builder clearRelativeTimestamp() { - - relativeTimestamp_ = 0L; + public Builder clearLatitude() { + bitField0_ = (bitField0_ & ~0x00000002); + latitude_ = 0D; onChanged(); return this; } - private float x_ ; + private double longitude_ ; /** *
-       * Both in metres. You should implement an algorithm to estimate
-       * these values. The values are always relative to your start point
-       * so the first entry should always be x = 0.0, y = 0.0
+       * longitude between -180 and 180
        * 
* - * optional float x = 2; + * double longitude = 3; + * @return The longitude. */ - public float getX() { - return x_; + @java.lang.Override + public double getLongitude() { + return longitude_; } /** *
-       * Both in metres. You should implement an algorithm to estimate
-       * these values. The values are always relative to your start point
-       * so the first entry should always be x = 0.0, y = 0.0
+       * longitude between -180 and 180
        * 
* - * optional float x = 2; + * double longitude = 3; + * @param value The longitude to set. + * @return This builder for chaining. */ - public Builder setX(float value) { - - x_ = value; + public Builder setLongitude(double value) { + + longitude_ = value; + bitField0_ |= 0x00000004; onChanged(); return this; } /** *
-       * Both in metres. You should implement an algorithm to estimate
-       * these values. The values are always relative to your start point
-       * so the first entry should always be x = 0.0, y = 0.0
+       * longitude between -180 and 180
        * 
* - * optional float x = 2; + * double longitude = 3; + * @return This builder for chaining. */ - public Builder clearX() { - - x_ = 0F; + public Builder clearLongitude() { + bitField0_ = (bitField0_ & ~0x00000004); + longitude_ = 0D; onChanged(); return this; } - private float y_ ; + private double altitude_ ; /** - * optional float y = 3; + *
+       * metres
+       * 
+ * + * double altitude = 4; + * @return The altitude. */ - public float getY() { - return y_; + @java.lang.Override + public double getAltitude() { + return altitude_; } /** - * optional float y = 3; + *
+       * metres
+       * 
+ * + * double altitude = 4; + * @param value The altitude to set. + * @return This builder for chaining. */ - public Builder setY(float value) { - - y_ = value; + public Builder setAltitude(double value) { + + altitude_ = value; + bitField0_ |= 0x00000008; onChanged(); return this; } /** - * optional float y = 3; + *
+       * metres
+       * 
+ * + * double altitude = 4; + * @return This builder for chaining. */ - public Builder clearY() { - - y_ = 0F; + public Builder clearAltitude() { + bitField0_ = (bitField0_ & ~0x00000008); + altitude_ = 0D; + onChanged(); + return this; + } + + private java.lang.Object floor_ = ""; + /** + *
+       * floor name
+       * 
+ * + * optional string floor = 5; + * @return Whether the floor field is set. + */ + public boolean hasFloor() { + return ((bitField0_ & 0x00000010) != 0); + } + /** + *
+       * floor name
+       * 
+ * + * optional string floor = 5; + * @return The floor. + */ + public java.lang.String getFloor() { + java.lang.Object ref = floor_; + if (!(ref instanceof java.lang.String)) { + com.google.protobuf.ByteString bs = + (com.google.protobuf.ByteString) ref; + java.lang.String s = bs.toStringUtf8(); + floor_ = s; + return s; + } else { + return (java.lang.String) ref; + } + } + /** + *
+       * floor name
+       * 
+ * + * optional string floor = 5; + * @return The bytes for floor. + */ + public com.google.protobuf.ByteString + getFloorBytes() { + java.lang.Object ref = floor_; + if (ref instanceof String) { + com.google.protobuf.ByteString b = + com.google.protobuf.ByteString.copyFromUtf8( + (java.lang.String) ref); + floor_ = b; + return b; + } else { + return (com.google.protobuf.ByteString) ref; + } + } + /** + *
+       * floor name
+       * 
+ * + * optional string floor = 5; + * @param value The floor to set. + * @return This builder for chaining. + */ + public Builder setFloor( + java.lang.String value) { + if (value == null) { throw new NullPointerException(); } + floor_ = value; + bitField0_ |= 0x00000010; onChanged(); return this; } - public final Builder setUnknownFields( - final com.google.protobuf.UnknownFieldSet unknownFields) { + /** + *
+       * floor name
+       * 
+ * + * optional string floor = 5; + * @return This builder for chaining. + */ + public Builder clearFloor() { + floor_ = getDefaultInstance().getFloor(); + bitField0_ = (bitField0_ & ~0x00000010); + onChanged(); return this; } - - public final Builder mergeUnknownFields( - final com.google.protobuf.UnknownFieldSet unknownFields) { + /** + *
+       * floor name
+       * 
+ * + * optional string floor = 5; + * @param value The bytes for floor to set. + * @return This builder for chaining. + */ + public Builder setFloorBytes( + com.google.protobuf.ByteString value) { + if (value == null) { throw new NullPointerException(); } + checkByteStringIsUtf8(value); + floor_ = value; + bitField0_ |= 0x00000010; + onChanged(); return this; } - - // @@protoc_insertion_point(builder_scope:Pdr_Sample) + // @@protoc_insertion_point(builder_scope:GNSSPosition) } - // @@protoc_insertion_point(class_scope:Pdr_Sample) - private static final Pdr_Sample DEFAULT_INSTANCE; + // @@protoc_insertion_point(class_scope:GNSSPosition) + private static final com.openpositioning.PositionMe.Traj.GNSSPosition DEFAULT_INSTANCE; static { - DEFAULT_INSTANCE = new Pdr_Sample(); + DEFAULT_INSTANCE = new com.openpositioning.PositionMe.Traj.GNSSPosition(); } - public static Pdr_Sample getDefaultInstance() { + public static com.openpositioning.PositionMe.Traj.GNSSPosition getDefaultInstance() { return DEFAULT_INSTANCE; } - private static final com.google.protobuf.Parser - PARSER = new com.google.protobuf.AbstractParser() { - public Pdr_Sample parsePartialFrom( - com.google.protobuf.CodedInputStream input, - com.google.protobuf.ExtensionRegistryLite extensionRegistry) - throws com.google.protobuf.InvalidProtocolBufferException { - return new Pdr_Sample(input, extensionRegistry); + private static final com.google.protobuf.Parser + PARSER = new com.google.protobuf.AbstractParser() { + @java.lang.Override + public GNSSPosition parsePartialFrom( + com.google.protobuf.CodedInputStream input, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + Builder builder = newBuilder(); + try { + builder.mergeFrom(input, extensionRegistry); + } catch (com.google.protobuf.InvalidProtocolBufferException e) { + throw e.setUnfinishedMessage(builder.buildPartial()); + } catch (com.google.protobuf.UninitializedMessageException e) { + throw e.asInvalidProtocolBufferException().setUnfinishedMessage(builder.buildPartial()); + } catch (java.io.IOException e) { + throw new com.google.protobuf.InvalidProtocolBufferException(e) + .setUnfinishedMessage(builder.buildPartial()); + } + return builder.buildPartial(); } }; - public static com.google.protobuf.Parser parser() { + public static com.google.protobuf.Parser parser() { return PARSER; } - @Override - public com.google.protobuf.Parser getParserForType() { + @java.lang.Override + public com.google.protobuf.Parser getParserForType() { return PARSER; } - public Pdr_Sample getDefaultInstanceForType() { + @java.lang.Override + public com.openpositioning.PositionMe.Traj.GNSSPosition getDefaultInstanceForType() { return DEFAULT_INSTANCE; } - } - - public interface Motion_SampleOrBuilder extends - // @@protoc_insertion_point(interface_extends:Motion_Sample) - com.google.protobuf.MessageOrBuilder { - - /** - *
-     * milliseconds
-     * 
- * - * optional int64 relative_timestamp = 1; - */ - long getRelativeTimestamp(); - - /** - *
-     * m/s^2
-     * 
- * - * optional float acc_x = 2; - */ - float getAccX(); - - /** - * optional float acc_y = 3; - */ - float getAccY(); + } - /** - * optional float acc_z = 4; - */ - float getAccZ(); + public interface GNSSReadingOrBuilder extends + // @@protoc_insertion_point(interface_extends:GNSSReading) + com.google.protobuf.MessageOrBuilder { /** - *
-     * radians/s
-     * 
- * - * optional float gyr_x = 5; + * .GNSSPosition position = 1; + * @return Whether the position field is set. */ - float getGyrX(); - + boolean hasPosition(); /** - * optional float gyr_y = 6; + * .GNSSPosition position = 1; + * @return The position. */ - float getGyrY(); - + com.openpositioning.PositionMe.Traj.GNSSPosition getPosition(); /** - * optional float gyr_z = 7; + * .GNSSPosition position = 1; */ - float getGyrZ(); + com.openpositioning.PositionMe.Traj.GNSSPositionOrBuilder getPositionOrBuilder(); /** *
-     * unitless, 4 components should sum to ~1
+     * metres
      * 
* - * optional float rotation_vector_x = 8; + * float accuracy = 2; + * @return The accuracy. */ - float getRotationVectorX(); + float getAccuracy(); /** - * optional float rotation_vector_y = 9; + *
+     * m/s
+     * 
+ * + * float speed = 3; + * @return The speed. */ - float getRotationVectorY(); + float getSpeed(); /** - * optional float rotation_vector_z = 10; + *
+     * degrees
+     * 
+ * + * float bearing = 4; + * @return The bearing. */ - float getRotationVectorZ(); + float getBearing(); /** - * optional float rotation_vector_w = 11; + *
+     * e.g 'gps' or 'network'
+     * 
+ * + * string provider = 5; + * @return The provider. */ - float getRotationVectorW(); - + java.lang.String getProvider(); /** *
-     * Integer
+     * e.g 'gps' or 'network'
      * 
* - * optional int32 step_count = 12; + * string provider = 5; + * @return The bytes for provider. */ - int getStepCount(); + com.google.protobuf.ByteString + getProviderBytes(); } /** - * Protobuf type {@code Motion_Sample} + * Protobuf type {@code GNSSReading} */ - public static final class Motion_Sample extends - com.google.protobuf.GeneratedMessageV3 implements - // @@protoc_insertion_point(message_implements:Motion_Sample) - Motion_SampleOrBuilder { - // Use Motion_Sample.newBuilder() to construct. - private Motion_Sample(com.google.protobuf.GeneratedMessageV3.Builder builder) { + public static final class GNSSReading extends + com.google.protobuf.GeneratedMessage implements + // @@protoc_insertion_point(message_implements:GNSSReading) + GNSSReadingOrBuilder { + private static final long serialVersionUID = 0L; + static { + com.google.protobuf.RuntimeVersion.validateProtobufGencodeVersion( + com.google.protobuf.RuntimeVersion.RuntimeDomain.PUBLIC, + /* major= */ 4, + /* minor= */ 29, + /* patch= */ 6, + /* suffix= */ "", + GNSSReading.class.getName()); + } + // Use GNSSReading.newBuilder() to construct. + private GNSSReading(com.google.protobuf.GeneratedMessage.Builder builder) { super(builder); } - private Motion_Sample() { - relativeTimestamp_ = 0L; - accX_ = 0F; - accY_ = 0F; - accZ_ = 0F; - gyrX_ = 0F; - gyrY_ = 0F; - gyrZ_ = 0F; - rotationVectorX_ = 0F; - rotationVectorY_ = 0F; - rotationVectorZ_ = 0F; - rotationVectorW_ = 0F; - stepCount_ = 0; - } - - @Override - public final com.google.protobuf.UnknownFieldSet - getUnknownFields() { - return com.google.protobuf.UnknownFieldSet.getDefaultInstance(); - } - private Motion_Sample( - com.google.protobuf.CodedInputStream input, - com.google.protobuf.ExtensionRegistryLite extensionRegistry) - throws com.google.protobuf.InvalidProtocolBufferException { - this(); - int mutable_bitField0_ = 0; - try { - boolean done = false; - while (!done) { - int tag = input.readTag(); - switch (tag) { - case 0: - done = true; - break; - default: { - if (!input.skipField(tag)) { - done = true; - } - break; - } - case 8: { - - relativeTimestamp_ = input.readInt64(); - break; - } - case 21: { - - accX_ = input.readFloat(); - break; - } - case 29: { - - accY_ = input.readFloat(); - break; - } - case 37: { - - accZ_ = input.readFloat(); - break; - } - case 45: { - - gyrX_ = input.readFloat(); - break; - } - case 53: { - - gyrY_ = input.readFloat(); - break; - } - case 61: { - - gyrZ_ = input.readFloat(); - break; - } - case 69: { - - rotationVectorX_ = input.readFloat(); - break; - } - case 77: { - - rotationVectorY_ = input.readFloat(); - break; - } - case 85: { - - rotationVectorZ_ = input.readFloat(); - break; - } - case 93: { - - rotationVectorW_ = input.readFloat(); - break; - } - case 96: { - - stepCount_ = input.readInt32(); - break; - } - } - } - } catch (com.google.protobuf.InvalidProtocolBufferException e) { - throw e.setUnfinishedMessage(this); - } catch (java.io.IOException e) { - throw new com.google.protobuf.InvalidProtocolBufferException( - e).setUnfinishedMessage(this); - } finally { - makeExtensionsImmutable(); - } - } - public static final com.google.protobuf.Descriptors.Descriptor - getDescriptor() { - return Traj.internal_static_Motion_Sample_descriptor; + private GNSSReading() { + provider_ = ""; } - protected com.google.protobuf.GeneratedMessageV3.FieldAccessorTable - internalGetFieldAccessorTable() { - return Traj.internal_static_Motion_Sample_fieldAccessorTable - .ensureFieldAccessorsInitialized( - Motion_Sample.class, Builder.class); + public static final com.google.protobuf.Descriptors.Descriptor + getDescriptor() { + return com.openpositioning.PositionMe.Traj.internal_static_GNSSReading_descriptor; } - public static final int RELATIVE_TIMESTAMP_FIELD_NUMBER = 1; - private long relativeTimestamp_; - /** - *
-     * milliseconds
-     * 
- * - * optional int64 relative_timestamp = 1; - */ - public long getRelativeTimestamp() { - return relativeTimestamp_; + @java.lang.Override + protected com.google.protobuf.GeneratedMessage.FieldAccessorTable + internalGetFieldAccessorTable() { + return com.openpositioning.PositionMe.Traj.internal_static_GNSSReading_fieldAccessorTable + .ensureFieldAccessorsInitialized( + com.openpositioning.PositionMe.Traj.GNSSReading.class, com.openpositioning.PositionMe.Traj.GNSSReading.Builder.class); } - public static final int ACC_X_FIELD_NUMBER = 2; - private float accX_; + private int bitField0_; + public static final int POSITION_FIELD_NUMBER = 1; + private com.openpositioning.PositionMe.Traj.GNSSPosition position_; /** - *
-     * m/s^2
-     * 
- * - * optional float acc_x = 2; + * .GNSSPosition position = 1; + * @return Whether the position field is set. */ - public float getAccX() { - return accX_; + @java.lang.Override + public boolean hasPosition() { + return ((bitField0_ & 0x00000001) != 0); } - - public static final int ACC_Y_FIELD_NUMBER = 3; - private float accY_; /** - * optional float acc_y = 3; + * .GNSSPosition position = 1; + * @return The position. */ - public float getAccY() { - return accY_; + @java.lang.Override + public com.openpositioning.PositionMe.Traj.GNSSPosition getPosition() { + return position_ == null ? com.openpositioning.PositionMe.Traj.GNSSPosition.getDefaultInstance() : position_; } - - public static final int ACC_Z_FIELD_NUMBER = 4; - private float accZ_; /** - * optional float acc_z = 4; + * .GNSSPosition position = 1; */ - public float getAccZ() { - return accZ_; + @java.lang.Override + public com.openpositioning.PositionMe.Traj.GNSSPositionOrBuilder getPositionOrBuilder() { + return position_ == null ? com.openpositioning.PositionMe.Traj.GNSSPosition.getDefaultInstance() : position_; } - public static final int GYR_X_FIELD_NUMBER = 5; - private float gyrX_; + public static final int ACCURACY_FIELD_NUMBER = 2; + private float accuracy_ = 0F; /** *
-     * radians/s
+     * metres
      * 
* - * optional float gyr_x = 5; - */ - public float getGyrX() { - return gyrX_; - } - - public static final int GYR_Y_FIELD_NUMBER = 6; - private float gyrY_; - /** - * optional float gyr_y = 6; - */ - public float getGyrY() { - return gyrY_; - } - - public static final int GYR_Z_FIELD_NUMBER = 7; - private float gyrZ_; - /** - * optional float gyr_z = 7; + * float accuracy = 2; + * @return The accuracy. */ - public float getGyrZ() { - return gyrZ_; + @java.lang.Override + public float getAccuracy() { + return accuracy_; } - public static final int ROTATION_VECTOR_X_FIELD_NUMBER = 8; - private float rotationVectorX_; + public static final int SPEED_FIELD_NUMBER = 3; + private float speed_ = 0F; /** *
-     * unitless, 4 components should sum to ~1
+     * m/s
      * 
* - * optional float rotation_vector_x = 8; + * float speed = 3; + * @return The speed. */ - public float getRotationVectorX() { - return rotationVectorX_; - } - - public static final int ROTATION_VECTOR_Y_FIELD_NUMBER = 9; - private float rotationVectorY_; - /** - * optional float rotation_vector_y = 9; - */ - public float getRotationVectorY() { - return rotationVectorY_; + @java.lang.Override + public float getSpeed() { + return speed_; } - public static final int ROTATION_VECTOR_Z_FIELD_NUMBER = 10; - private float rotationVectorZ_; + public static final int BEARING_FIELD_NUMBER = 4; + private float bearing_ = 0F; /** - * optional float rotation_vector_z = 10; + *
+     * degrees
+     * 
+ * + * float bearing = 4; + * @return The bearing. */ - public float getRotationVectorZ() { - return rotationVectorZ_; + @java.lang.Override + public float getBearing() { + return bearing_; } - public static final int ROTATION_VECTOR_W_FIELD_NUMBER = 11; - private float rotationVectorW_; + public static final int PROVIDER_FIELD_NUMBER = 5; + @SuppressWarnings("serial") + private volatile java.lang.Object provider_ = ""; /** - * optional float rotation_vector_w = 11; + *
+     * e.g 'gps' or 'network'
+     * 
+ * + * string provider = 5; + * @return The provider. */ - public float getRotationVectorW() { - return rotationVectorW_; + @java.lang.Override + public java.lang.String getProvider() { + java.lang.Object ref = provider_; + if (ref instanceof java.lang.String) { + return (java.lang.String) ref; + } else { + com.google.protobuf.ByteString bs = + (com.google.protobuf.ByteString) ref; + java.lang.String s = bs.toStringUtf8(); + provider_ = s; + return s; + } } - - public static final int STEP_COUNT_FIELD_NUMBER = 12; - private int stepCount_; /** *
-     * Integer
+     * e.g 'gps' or 'network'
      * 
* - * optional int32 step_count = 12; + * string provider = 5; + * @return The bytes for provider. */ - public int getStepCount() { - return stepCount_; + @java.lang.Override + public com.google.protobuf.ByteString + getProviderBytes() { + java.lang.Object ref = provider_; + if (ref instanceof java.lang.String) { + com.google.protobuf.ByteString b = + com.google.protobuf.ByteString.copyFromUtf8( + (java.lang.String) ref); + provider_ = b; + return b; + } else { + return (com.google.protobuf.ByteString) ref; + } } private byte memoizedIsInitialized = -1; + @java.lang.Override public final boolean isInitialized() { byte isInitialized = memoizedIsInitialized; if (isInitialized == 1) return true; @@ -5839,1058 +13240,931 @@ public final boolean isInitialized() { return true; } + @java.lang.Override public void writeTo(com.google.protobuf.CodedOutputStream output) - throws java.io.IOException { - if (relativeTimestamp_ != 0L) { - output.writeInt64(1, relativeTimestamp_); - } - if (accX_ != 0F) { - output.writeFloat(2, accX_); - } - if (accY_ != 0F) { - output.writeFloat(3, accY_); - } - if (accZ_ != 0F) { - output.writeFloat(4, accZ_); + throws java.io.IOException { + if (((bitField0_ & 0x00000001) != 0)) { + output.writeMessage(1, getPosition()); } - if (gyrX_ != 0F) { - output.writeFloat(5, gyrX_); + if (java.lang.Float.floatToRawIntBits(accuracy_) != 0) { + output.writeFloat(2, accuracy_); } - if (gyrY_ != 0F) { - output.writeFloat(6, gyrY_); + if (java.lang.Float.floatToRawIntBits(speed_) != 0) { + output.writeFloat(3, speed_); } - if (gyrZ_ != 0F) { - output.writeFloat(7, gyrZ_); + if (java.lang.Float.floatToRawIntBits(bearing_) != 0) { + output.writeFloat(4, bearing_); } - if (rotationVectorX_ != 0F) { - output.writeFloat(8, rotationVectorX_); - } - if (rotationVectorY_ != 0F) { - output.writeFloat(9, rotationVectorY_); - } - if (rotationVectorZ_ != 0F) { - output.writeFloat(10, rotationVectorZ_); - } - if (rotationVectorW_ != 0F) { - output.writeFloat(11, rotationVectorW_); - } - if (stepCount_ != 0) { - output.writeInt32(12, stepCount_); + if (!com.google.protobuf.GeneratedMessage.isStringEmpty(provider_)) { + com.google.protobuf.GeneratedMessage.writeString(output, 5, provider_); } + getUnknownFields().writeTo(output); } + @java.lang.Override public int getSerializedSize() { int size = memoizedSize; if (size != -1) return size; size = 0; - if (relativeTimestamp_ != 0L) { - size += com.google.protobuf.CodedOutputStream - .computeInt64Size(1, relativeTimestamp_); - } - if (accX_ != 0F) { + if (((bitField0_ & 0x00000001) != 0)) { size += com.google.protobuf.CodedOutputStream - .computeFloatSize(2, accX_); + .computeMessageSize(1, getPosition()); } - if (accY_ != 0F) { + if (java.lang.Float.floatToRawIntBits(accuracy_) != 0) { size += com.google.protobuf.CodedOutputStream - .computeFloatSize(3, accY_); + .computeFloatSize(2, accuracy_); } - if (accZ_ != 0F) { + if (java.lang.Float.floatToRawIntBits(speed_) != 0) { size += com.google.protobuf.CodedOutputStream - .computeFloatSize(4, accZ_); + .computeFloatSize(3, speed_); } - if (gyrX_ != 0F) { + if (java.lang.Float.floatToRawIntBits(bearing_) != 0) { size += com.google.protobuf.CodedOutputStream - .computeFloatSize(5, gyrX_); + .computeFloatSize(4, bearing_); } - if (gyrY_ != 0F) { - size += com.google.protobuf.CodedOutputStream - .computeFloatSize(6, gyrY_); - } - if (gyrZ_ != 0F) { - size += com.google.protobuf.CodedOutputStream - .computeFloatSize(7, gyrZ_); - } - if (rotationVectorX_ != 0F) { - size += com.google.protobuf.CodedOutputStream - .computeFloatSize(8, rotationVectorX_); - } - if (rotationVectorY_ != 0F) { - size += com.google.protobuf.CodedOutputStream - .computeFloatSize(9, rotationVectorY_); - } - if (rotationVectorZ_ != 0F) { - size += com.google.protobuf.CodedOutputStream - .computeFloatSize(10, rotationVectorZ_); - } - if (rotationVectorW_ != 0F) { - size += com.google.protobuf.CodedOutputStream - .computeFloatSize(11, rotationVectorW_); - } - if (stepCount_ != 0) { - size += com.google.protobuf.CodedOutputStream - .computeInt32Size(12, stepCount_); + if (!com.google.protobuf.GeneratedMessage.isStringEmpty(provider_)) { + size += com.google.protobuf.GeneratedMessage.computeStringSize(5, provider_); } + size += getUnknownFields().getSerializedSize(); memoizedSize = size; return size; } - private static final long serialVersionUID = 0L; - @Override - public boolean equals(final Object obj) { + @java.lang.Override + public boolean equals(final java.lang.Object obj) { if (obj == this) { - return true; + return true; } - if (!(obj instanceof Motion_Sample)) { + if (!(obj instanceof com.openpositioning.PositionMe.Traj.GNSSReading)) { return super.equals(obj); } - Motion_Sample other = (Motion_Sample) obj; - - boolean result = true; - result = result && (getRelativeTimestamp() - == other.getRelativeTimestamp()); - result = result && ( - Float.floatToIntBits(getAccX()) - == Float.floatToIntBits( - other.getAccX())); - result = result && ( - Float.floatToIntBits(getAccY()) - == Float.floatToIntBits( - other.getAccY())); - result = result && ( - Float.floatToIntBits(getAccZ()) - == Float.floatToIntBits( - other.getAccZ())); - result = result && ( - Float.floatToIntBits(getGyrX()) - == Float.floatToIntBits( - other.getGyrX())); - result = result && ( - Float.floatToIntBits(getGyrY()) - == Float.floatToIntBits( - other.getGyrY())); - result = result && ( - Float.floatToIntBits(getGyrZ()) - == Float.floatToIntBits( - other.getGyrZ())); - result = result && ( - Float.floatToIntBits(getRotationVectorX()) - == Float.floatToIntBits( - other.getRotationVectorX())); - result = result && ( - Float.floatToIntBits(getRotationVectorY()) - == Float.floatToIntBits( - other.getRotationVectorY())); - result = result && ( - Float.floatToIntBits(getRotationVectorZ()) - == Float.floatToIntBits( - other.getRotationVectorZ())); - result = result && ( - Float.floatToIntBits(getRotationVectorW()) - == Float.floatToIntBits( - other.getRotationVectorW())); - result = result && (getStepCount() - == other.getStepCount()); - return result; - } - - @Override + com.openpositioning.PositionMe.Traj.GNSSReading other = (com.openpositioning.PositionMe.Traj.GNSSReading) obj; + + if (hasPosition() != other.hasPosition()) return false; + if (hasPosition()) { + if (!getPosition() + .equals(other.getPosition())) return false; + } + if (java.lang.Float.floatToIntBits(getAccuracy()) + != java.lang.Float.floatToIntBits( + other.getAccuracy())) return false; + if (java.lang.Float.floatToIntBits(getSpeed()) + != java.lang.Float.floatToIntBits( + other.getSpeed())) return false; + if (java.lang.Float.floatToIntBits(getBearing()) + != java.lang.Float.floatToIntBits( + other.getBearing())) return false; + if (!getProvider() + .equals(other.getProvider())) return false; + if (!getUnknownFields().equals(other.getUnknownFields())) return false; + return true; + } + + @java.lang.Override public int hashCode() { if (memoizedHashCode != 0) { return memoizedHashCode; } int hash = 41; - hash = (19 * hash) + getDescriptorForType().hashCode(); - hash = (37 * hash) + RELATIVE_TIMESTAMP_FIELD_NUMBER; - hash = (53 * hash) + com.google.protobuf.Internal.hashLong( - getRelativeTimestamp()); - hash = (37 * hash) + ACC_X_FIELD_NUMBER; - hash = (53 * hash) + Float.floatToIntBits( - getAccX()); - hash = (37 * hash) + ACC_Y_FIELD_NUMBER; - hash = (53 * hash) + Float.floatToIntBits( - getAccY()); - hash = (37 * hash) + ACC_Z_FIELD_NUMBER; - hash = (53 * hash) + Float.floatToIntBits( - getAccZ()); - hash = (37 * hash) + GYR_X_FIELD_NUMBER; - hash = (53 * hash) + Float.floatToIntBits( - getGyrX()); - hash = (37 * hash) + GYR_Y_FIELD_NUMBER; - hash = (53 * hash) + Float.floatToIntBits( - getGyrY()); - hash = (37 * hash) + GYR_Z_FIELD_NUMBER; - hash = (53 * hash) + Float.floatToIntBits( - getGyrZ()); - hash = (37 * hash) + ROTATION_VECTOR_X_FIELD_NUMBER; - hash = (53 * hash) + Float.floatToIntBits( - getRotationVectorX()); - hash = (37 * hash) + ROTATION_VECTOR_Y_FIELD_NUMBER; - hash = (53 * hash) + Float.floatToIntBits( - getRotationVectorY()); - hash = (37 * hash) + ROTATION_VECTOR_Z_FIELD_NUMBER; - hash = (53 * hash) + Float.floatToIntBits( - getRotationVectorZ()); - hash = (37 * hash) + ROTATION_VECTOR_W_FIELD_NUMBER; - hash = (53 * hash) + Float.floatToIntBits( - getRotationVectorW()); - hash = (37 * hash) + STEP_COUNT_FIELD_NUMBER; - hash = (53 * hash) + getStepCount(); - hash = (29 * hash) + unknownFields.hashCode(); + hash = (19 * hash) + getDescriptor().hashCode(); + if (hasPosition()) { + hash = (37 * hash) + POSITION_FIELD_NUMBER; + hash = (53 * hash) + getPosition().hashCode(); + } + hash = (37 * hash) + ACCURACY_FIELD_NUMBER; + hash = (53 * hash) + java.lang.Float.floatToIntBits( + getAccuracy()); + hash = (37 * hash) + SPEED_FIELD_NUMBER; + hash = (53 * hash) + java.lang.Float.floatToIntBits( + getSpeed()); + hash = (37 * hash) + BEARING_FIELD_NUMBER; + hash = (53 * hash) + java.lang.Float.floatToIntBits( + getBearing()); + hash = (37 * hash) + PROVIDER_FIELD_NUMBER; + hash = (53 * hash) + getProvider().hashCode(); + hash = (29 * hash) + getUnknownFields().hashCode(); memoizedHashCode = hash; return hash; } - public static Motion_Sample parseFrom( - com.google.protobuf.ByteString data) - throws com.google.protobuf.InvalidProtocolBufferException { + public static com.openpositioning.PositionMe.Traj.GNSSReading parseFrom( + java.nio.ByteBuffer data) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + public static com.openpositioning.PositionMe.Traj.GNSSReading parseFrom( + java.nio.ByteBuffer data, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data, extensionRegistry); + } + public static com.openpositioning.PositionMe.Traj.GNSSReading parseFrom( + com.google.protobuf.ByteString data) + throws com.google.protobuf.InvalidProtocolBufferException { return PARSER.parseFrom(data); } - public static Motion_Sample parseFrom( - com.google.protobuf.ByteString data, - com.google.protobuf.ExtensionRegistryLite extensionRegistry) - throws com.google.protobuf.InvalidProtocolBufferException { + public static com.openpositioning.PositionMe.Traj.GNSSReading parseFrom( + com.google.protobuf.ByteString data, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { return PARSER.parseFrom(data, extensionRegistry); } - public static Motion_Sample parseFrom(byte[] data) - throws com.google.protobuf.InvalidProtocolBufferException { + public static com.openpositioning.PositionMe.Traj.GNSSReading parseFrom(byte[] data) + throws com.google.protobuf.InvalidProtocolBufferException { return PARSER.parseFrom(data); } - public static Motion_Sample parseFrom( - byte[] data, - com.google.protobuf.ExtensionRegistryLite extensionRegistry) - throws com.google.protobuf.InvalidProtocolBufferException { + public static com.openpositioning.PositionMe.Traj.GNSSReading parseFrom( + byte[] data, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { return PARSER.parseFrom(data, extensionRegistry); } - public static Motion_Sample parseFrom(java.io.InputStream input) - throws java.io.IOException { - return com.google.protobuf.GeneratedMessageV3 - .parseWithIOException(PARSER, input); - } - public static Motion_Sample parseFrom( - java.io.InputStream input, - com.google.protobuf.ExtensionRegistryLite extensionRegistry) - throws java.io.IOException { - return com.google.protobuf.GeneratedMessageV3 - .parseWithIOException(PARSER, input, extensionRegistry); - } - public static Motion_Sample parseDelimitedFrom(java.io.InputStream input) - throws java.io.IOException { - return com.google.protobuf.GeneratedMessageV3 - .parseDelimitedWithIOException(PARSER, input); - } - public static Motion_Sample parseDelimitedFrom( - java.io.InputStream input, - com.google.protobuf.ExtensionRegistryLite extensionRegistry) - throws java.io.IOException { - return com.google.protobuf.GeneratedMessageV3 - .parseDelimitedWithIOException(PARSER, input, extensionRegistry); - } - public static Motion_Sample parseFrom( - com.google.protobuf.CodedInputStream input) - throws java.io.IOException { - return com.google.protobuf.GeneratedMessageV3 - .parseWithIOException(PARSER, input); - } - public static Motion_Sample parseFrom( - com.google.protobuf.CodedInputStream input, - com.google.protobuf.ExtensionRegistryLite extensionRegistry) - throws java.io.IOException { - return com.google.protobuf.GeneratedMessageV3 - .parseWithIOException(PARSER, input, extensionRegistry); + public static com.openpositioning.PositionMe.Traj.GNSSReading parseFrom(java.io.InputStream input) + throws java.io.IOException { + return com.google.protobuf.GeneratedMessage + .parseWithIOException(PARSER, input); + } + public static com.openpositioning.PositionMe.Traj.GNSSReading parseFrom( + java.io.InputStream input, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws java.io.IOException { + return com.google.protobuf.GeneratedMessage + .parseWithIOException(PARSER, input, extensionRegistry); + } + + public static com.openpositioning.PositionMe.Traj.GNSSReading parseDelimitedFrom(java.io.InputStream input) + throws java.io.IOException { + return com.google.protobuf.GeneratedMessage + .parseDelimitedWithIOException(PARSER, input); + } + + public static com.openpositioning.PositionMe.Traj.GNSSReading parseDelimitedFrom( + java.io.InputStream input, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws java.io.IOException { + return com.google.protobuf.GeneratedMessage + .parseDelimitedWithIOException(PARSER, input, extensionRegistry); + } + public static com.openpositioning.PositionMe.Traj.GNSSReading parseFrom( + com.google.protobuf.CodedInputStream input) + throws java.io.IOException { + return com.google.protobuf.GeneratedMessage + .parseWithIOException(PARSER, input); + } + public static com.openpositioning.PositionMe.Traj.GNSSReading parseFrom( + com.google.protobuf.CodedInputStream input, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws java.io.IOException { + return com.google.protobuf.GeneratedMessage + .parseWithIOException(PARSER, input, extensionRegistry); } + @java.lang.Override public Builder newBuilderForType() { return newBuilder(); } public static Builder newBuilder() { return DEFAULT_INSTANCE.toBuilder(); } - public static Builder newBuilder(Motion_Sample prototype) { + public static Builder newBuilder(com.openpositioning.PositionMe.Traj.GNSSReading prototype) { return DEFAULT_INSTANCE.toBuilder().mergeFrom(prototype); } + @java.lang.Override public Builder toBuilder() { return this == DEFAULT_INSTANCE - ? new Builder() : new Builder().mergeFrom(this); + ? new Builder() : new Builder().mergeFrom(this); } - @Override + @java.lang.Override protected Builder newBuilderForType( - com.google.protobuf.GeneratedMessageV3.BuilderParent parent) { + com.google.protobuf.GeneratedMessage.BuilderParent parent) { Builder builder = new Builder(parent); return builder; } /** - * Protobuf type {@code Motion_Sample} + * Protobuf type {@code GNSSReading} */ public static final class Builder extends - com.google.protobuf.GeneratedMessageV3.Builder implements - // @@protoc_insertion_point(builder_implements:Motion_Sample) - Motion_SampleOrBuilder { + com.google.protobuf.GeneratedMessage.Builder implements + // @@protoc_insertion_point(builder_implements:GNSSReading) + com.openpositioning.PositionMe.Traj.GNSSReadingOrBuilder { public static final com.google.protobuf.Descriptors.Descriptor - getDescriptor() { - return Traj.internal_static_Motion_Sample_descriptor; + getDescriptor() { + return com.openpositioning.PositionMe.Traj.internal_static_GNSSReading_descriptor; } - protected com.google.protobuf.GeneratedMessageV3.FieldAccessorTable - internalGetFieldAccessorTable() { - return Traj.internal_static_Motion_Sample_fieldAccessorTable - .ensureFieldAccessorsInitialized( - Motion_Sample.class, Builder.class); + @java.lang.Override + protected com.google.protobuf.GeneratedMessage.FieldAccessorTable + internalGetFieldAccessorTable() { + return com.openpositioning.PositionMe.Traj.internal_static_GNSSReading_fieldAccessorTable + .ensureFieldAccessorsInitialized( + com.openpositioning.PositionMe.Traj.GNSSReading.class, com.openpositioning.PositionMe.Traj.GNSSReading.Builder.class); } - // Construct using Traj.Motion_Sample.newBuilder() + // Construct using com.openpositioning.PositionMe.Traj.GNSSReading.newBuilder() private Builder() { maybeForceBuilderInitialization(); } private Builder( - com.google.protobuf.GeneratedMessageV3.BuilderParent parent) { + com.google.protobuf.GeneratedMessage.BuilderParent parent) { super(parent); maybeForceBuilderInitialization(); } private void maybeForceBuilderInitialization() { - if (com.google.protobuf.GeneratedMessageV3 + if (com.google.protobuf.GeneratedMessage .alwaysUseFieldBuilders) { + getPositionFieldBuilder(); } } + @java.lang.Override public Builder clear() { super.clear(); - relativeTimestamp_ = 0L; - - accX_ = 0F; - - accY_ = 0F; - - accZ_ = 0F; - - gyrX_ = 0F; - - gyrY_ = 0F; - - gyrZ_ = 0F; - - rotationVectorX_ = 0F; - - rotationVectorY_ = 0F; - - rotationVectorZ_ = 0F; - - rotationVectorW_ = 0F; - - stepCount_ = 0; - + bitField0_ = 0; + position_ = null; + if (positionBuilder_ != null) { + positionBuilder_.dispose(); + positionBuilder_ = null; + } + accuracy_ = 0F; + speed_ = 0F; + bearing_ = 0F; + provider_ = ""; return this; } + @java.lang.Override public com.google.protobuf.Descriptors.Descriptor - getDescriptorForType() { - return Traj.internal_static_Motion_Sample_descriptor; + getDescriptorForType() { + return com.openpositioning.PositionMe.Traj.internal_static_GNSSReading_descriptor; } - public Motion_Sample getDefaultInstanceForType() { - return Motion_Sample.getDefaultInstance(); + @java.lang.Override + public com.openpositioning.PositionMe.Traj.GNSSReading getDefaultInstanceForType() { + return com.openpositioning.PositionMe.Traj.GNSSReading.getDefaultInstance(); } - public Motion_Sample build() { - Motion_Sample result = buildPartial(); + @java.lang.Override + public com.openpositioning.PositionMe.Traj.GNSSReading build() { + com.openpositioning.PositionMe.Traj.GNSSReading result = buildPartial(); if (!result.isInitialized()) { throw newUninitializedMessageException(result); } return result; } - public Motion_Sample buildPartial() { - Motion_Sample result = new Motion_Sample(this); - result.relativeTimestamp_ = relativeTimestamp_; - result.accX_ = accX_; - result.accY_ = accY_; - result.accZ_ = accZ_; - result.gyrX_ = gyrX_; - result.gyrY_ = gyrY_; - result.gyrZ_ = gyrZ_; - result.rotationVectorX_ = rotationVectorX_; - result.rotationVectorY_ = rotationVectorY_; - result.rotationVectorZ_ = rotationVectorZ_; - result.rotationVectorW_ = rotationVectorW_; - result.stepCount_ = stepCount_; + @java.lang.Override + public com.openpositioning.PositionMe.Traj.GNSSReading buildPartial() { + com.openpositioning.PositionMe.Traj.GNSSReading result = new com.openpositioning.PositionMe.Traj.GNSSReading(this); + if (bitField0_ != 0) { buildPartial0(result); } onBuilt(); return result; } - public Builder clone() { - return (Builder) super.clone(); - } - public Builder setField( - com.google.protobuf.Descriptors.FieldDescriptor field, - Object value) { - return (Builder) super.setField(field, value); - } - public Builder clearField( - com.google.protobuf.Descriptors.FieldDescriptor field) { - return (Builder) super.clearField(field); - } - public Builder clearOneof( - com.google.protobuf.Descriptors.OneofDescriptor oneof) { - return (Builder) super.clearOneof(oneof); - } - public Builder setRepeatedField( - com.google.protobuf.Descriptors.FieldDescriptor field, - int index, Object value) { - return (Builder) super.setRepeatedField(field, index, value); - } - public Builder addRepeatedField( - com.google.protobuf.Descriptors.FieldDescriptor field, - Object value) { - return (Builder) super.addRepeatedField(field, value); + private void buildPartial0(com.openpositioning.PositionMe.Traj.GNSSReading result) { + int from_bitField0_ = bitField0_; + int to_bitField0_ = 0; + if (((from_bitField0_ & 0x00000001) != 0)) { + result.position_ = positionBuilder_ == null + ? position_ + : positionBuilder_.build(); + to_bitField0_ |= 0x00000001; + } + if (((from_bitField0_ & 0x00000002) != 0)) { + result.accuracy_ = accuracy_; + } + if (((from_bitField0_ & 0x00000004) != 0)) { + result.speed_ = speed_; + } + if (((from_bitField0_ & 0x00000008) != 0)) { + result.bearing_ = bearing_; + } + if (((from_bitField0_ & 0x00000010) != 0)) { + result.provider_ = provider_; + } + result.bitField0_ |= to_bitField0_; } + + @java.lang.Override public Builder mergeFrom(com.google.protobuf.Message other) { - if (other instanceof Motion_Sample) { - return mergeFrom((Motion_Sample)other); + if (other instanceof com.openpositioning.PositionMe.Traj.GNSSReading) { + return mergeFrom((com.openpositioning.PositionMe.Traj.GNSSReading)other); } else { super.mergeFrom(other); return this; } } - public Builder mergeFrom(Motion_Sample other) { - if (other == Motion_Sample.getDefaultInstance()) return this; - if (other.getRelativeTimestamp() != 0L) { - setRelativeTimestamp(other.getRelativeTimestamp()); - } - if (other.getAccX() != 0F) { - setAccX(other.getAccX()); - } - if (other.getAccY() != 0F) { - setAccY(other.getAccY()); - } - if (other.getAccZ() != 0F) { - setAccZ(other.getAccZ()); - } - if (other.getGyrX() != 0F) { - setGyrX(other.getGyrX()); - } - if (other.getGyrY() != 0F) { - setGyrY(other.getGyrY()); - } - if (other.getGyrZ() != 0F) { - setGyrZ(other.getGyrZ()); - } - if (other.getRotationVectorX() != 0F) { - setRotationVectorX(other.getRotationVectorX()); + public Builder mergeFrom(com.openpositioning.PositionMe.Traj.GNSSReading other) { + if (other == com.openpositioning.PositionMe.Traj.GNSSReading.getDefaultInstance()) return this; + if (other.hasPosition()) { + mergePosition(other.getPosition()); } - if (other.getRotationVectorY() != 0F) { - setRotationVectorY(other.getRotationVectorY()); + if (other.getAccuracy() != 0F) { + setAccuracy(other.getAccuracy()); } - if (other.getRotationVectorZ() != 0F) { - setRotationVectorZ(other.getRotationVectorZ()); + if (other.getSpeed() != 0F) { + setSpeed(other.getSpeed()); } - if (other.getRotationVectorW() != 0F) { - setRotationVectorW(other.getRotationVectorW()); + if (other.getBearing() != 0F) { + setBearing(other.getBearing()); } - if (other.getStepCount() != 0) { - setStepCount(other.getStepCount()); + if (!other.getProvider().isEmpty()) { + provider_ = other.provider_; + bitField0_ |= 0x00000010; + onChanged(); } + this.mergeUnknownFields(other.getUnknownFields()); onChanged(); return this; } + @java.lang.Override public final boolean isInitialized() { return true; } + @java.lang.Override public Builder mergeFrom( - com.google.protobuf.CodedInputStream input, - com.google.protobuf.ExtensionRegistryLite extensionRegistry) - throws java.io.IOException { - Motion_Sample parsedMessage = null; + com.google.protobuf.CodedInputStream input, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws java.io.IOException { + if (extensionRegistry == null) { + throw new java.lang.NullPointerException(); + } try { - parsedMessage = PARSER.parsePartialFrom(input, extensionRegistry); + boolean done = false; + while (!done) { + int tag = input.readTag(); + switch (tag) { + case 0: + done = true; + break; + case 10: { + input.readMessage( + getPositionFieldBuilder().getBuilder(), + extensionRegistry); + bitField0_ |= 0x00000001; + break; + } // case 10 + case 21: { + accuracy_ = input.readFloat(); + bitField0_ |= 0x00000002; + break; + } // case 21 + case 29: { + speed_ = input.readFloat(); + bitField0_ |= 0x00000004; + break; + } // case 29 + case 37: { + bearing_ = input.readFloat(); + bitField0_ |= 0x00000008; + break; + } // case 37 + case 42: { + provider_ = input.readStringRequireUtf8(); + bitField0_ |= 0x00000010; + break; + } // case 42 + default: { + if (!super.parseUnknownField(input, extensionRegistry, tag)) { + done = true; // was an endgroup tag + } + break; + } // default: + } // switch (tag) + } // while (!done) } catch (com.google.protobuf.InvalidProtocolBufferException e) { - parsedMessage = (Motion_Sample) e.getUnfinishedMessage(); throw e.unwrapIOException(); } finally { - if (parsedMessage != null) { - mergeFrom(parsedMessage); - } - } - return this; - } - - private long relativeTimestamp_ ; - /** - *
-       * milliseconds
-       * 
- * - * optional int64 relative_timestamp = 1; - */ - public long getRelativeTimestamp() { - return relativeTimestamp_; - } - /** - *
-       * milliseconds
-       * 
- * - * optional int64 relative_timestamp = 1; - */ - public Builder setRelativeTimestamp(long value) { - - relativeTimestamp_ = value; - onChanged(); - return this; - } - /** - *
-       * milliseconds
-       * 
- * - * optional int64 relative_timestamp = 1; - */ - public Builder clearRelativeTimestamp() { - - relativeTimestamp_ = 0L; - onChanged(); + onChanged(); + } // finally return this; } + private int bitField0_; - private float accX_ ; + private com.openpositioning.PositionMe.Traj.GNSSPosition position_; + private com.google.protobuf.SingleFieldBuilder< + com.openpositioning.PositionMe.Traj.GNSSPosition, com.openpositioning.PositionMe.Traj.GNSSPosition.Builder, com.openpositioning.PositionMe.Traj.GNSSPositionOrBuilder> positionBuilder_; /** - *
-       * m/s^2
-       * 
- * - * optional float acc_x = 2; + * .GNSSPosition position = 1; + * @return Whether the position field is set. */ - public float getAccX() { - return accX_; + public boolean hasPosition() { + return ((bitField0_ & 0x00000001) != 0); } /** - *
-       * m/s^2
-       * 
- * - * optional float acc_x = 2; + * .GNSSPosition position = 1; + * @return The position. */ - public Builder setAccX(float value) { - - accX_ = value; - onChanged(); - return this; + public com.openpositioning.PositionMe.Traj.GNSSPosition getPosition() { + if (positionBuilder_ == null) { + return position_ == null ? com.openpositioning.PositionMe.Traj.GNSSPosition.getDefaultInstance() : position_; + } else { + return positionBuilder_.getMessage(); + } } /** - *
-       * m/s^2
-       * 
- * - * optional float acc_x = 2; + * .GNSSPosition position = 1; */ - public Builder clearAccX() { - - accX_ = 0F; + public Builder setPosition(com.openpositioning.PositionMe.Traj.GNSSPosition value) { + if (positionBuilder_ == null) { + if (value == null) { + throw new NullPointerException(); + } + position_ = value; + } else { + positionBuilder_.setMessage(value); + } + bitField0_ |= 0x00000001; onChanged(); return this; } - - private float accY_ ; /** - * optional float acc_y = 3; + * .GNSSPosition position = 1; */ - public float getAccY() { - return accY_; + public Builder setPosition( + com.openpositioning.PositionMe.Traj.GNSSPosition.Builder builderForValue) { + if (positionBuilder_ == null) { + position_ = builderForValue.build(); + } else { + positionBuilder_.setMessage(builderForValue.build()); + } + bitField0_ |= 0x00000001; + onChanged(); + return this; } /** - * optional float acc_y = 3; + * .GNSSPosition position = 1; */ - public Builder setAccY(float value) { - - accY_ = value; - onChanged(); + public Builder mergePosition(com.openpositioning.PositionMe.Traj.GNSSPosition value) { + if (positionBuilder_ == null) { + if (((bitField0_ & 0x00000001) != 0) && + position_ != null && + position_ != com.openpositioning.PositionMe.Traj.GNSSPosition.getDefaultInstance()) { + getPositionBuilder().mergeFrom(value); + } else { + position_ = value; + } + } else { + positionBuilder_.mergeFrom(value); + } + if (position_ != null) { + bitField0_ |= 0x00000001; + onChanged(); + } return this; } /** - * optional float acc_y = 3; + * .GNSSPosition position = 1; */ - public Builder clearAccY() { - - accY_ = 0F; + public Builder clearPosition() { + bitField0_ = (bitField0_ & ~0x00000001); + position_ = null; + if (positionBuilder_ != null) { + positionBuilder_.dispose(); + positionBuilder_ = null; + } onChanged(); return this; } - - private float accZ_ ; /** - * optional float acc_z = 4; + * .GNSSPosition position = 1; */ - public float getAccZ() { - return accZ_; + public com.openpositioning.PositionMe.Traj.GNSSPosition.Builder getPositionBuilder() { + bitField0_ |= 0x00000001; + onChanged(); + return getPositionFieldBuilder().getBuilder(); } /** - * optional float acc_z = 4; + * .GNSSPosition position = 1; */ - public Builder setAccZ(float value) { - - accZ_ = value; - onChanged(); - return this; + public com.openpositioning.PositionMe.Traj.GNSSPositionOrBuilder getPositionOrBuilder() { + if (positionBuilder_ != null) { + return positionBuilder_.getMessageOrBuilder(); + } else { + return position_ == null ? + com.openpositioning.PositionMe.Traj.GNSSPosition.getDefaultInstance() : position_; + } } /** - * optional float acc_z = 4; + * .GNSSPosition position = 1; */ - public Builder clearAccZ() { - - accZ_ = 0F; - onChanged(); - return this; + private com.google.protobuf.SingleFieldBuilder< + com.openpositioning.PositionMe.Traj.GNSSPosition, com.openpositioning.PositionMe.Traj.GNSSPosition.Builder, com.openpositioning.PositionMe.Traj.GNSSPositionOrBuilder> + getPositionFieldBuilder() { + if (positionBuilder_ == null) { + positionBuilder_ = new com.google.protobuf.SingleFieldBuilder< + com.openpositioning.PositionMe.Traj.GNSSPosition, com.openpositioning.PositionMe.Traj.GNSSPosition.Builder, com.openpositioning.PositionMe.Traj.GNSSPositionOrBuilder>( + getPosition(), + getParentForChildren(), + isClean()); + position_ = null; + } + return positionBuilder_; } - private float gyrX_ ; + private float accuracy_ ; /** *
-       * radians/s
+       * metres
        * 
* - * optional float gyr_x = 5; + * float accuracy = 2; + * @return The accuracy. */ - public float getGyrX() { - return gyrX_; + @java.lang.Override + public float getAccuracy() { + return accuracy_; } /** *
-       * radians/s
+       * metres
        * 
* - * optional float gyr_x = 5; + * float accuracy = 2; + * @param value The accuracy to set. + * @return This builder for chaining. */ - public Builder setGyrX(float value) { - - gyrX_ = value; + public Builder setAccuracy(float value) { + + accuracy_ = value; + bitField0_ |= 0x00000002; onChanged(); return this; } /** *
-       * radians/s
+       * metres
        * 
* - * optional float gyr_x = 5; - */ - public Builder clearGyrX() { - - gyrX_ = 0F; - onChanged(); - return this; - } - - private float gyrY_ ; - /** - * optional float gyr_y = 6; - */ - public float getGyrY() { - return gyrY_; - } - /** - * optional float gyr_y = 6; - */ - public Builder setGyrY(float value) { - - gyrY_ = value; - onChanged(); - return this; - } - /** - * optional float gyr_y = 6; - */ - public Builder clearGyrY() { - - gyrY_ = 0F; - onChanged(); - return this; - } - - private float gyrZ_ ; - /** - * optional float gyr_z = 7; - */ - public float getGyrZ() { - return gyrZ_; - } - /** - * optional float gyr_z = 7; - */ - public Builder setGyrZ(float value) { - - gyrZ_ = value; - onChanged(); - return this; - } - /** - * optional float gyr_z = 7; + * float accuracy = 2; + * @return This builder for chaining. */ - public Builder clearGyrZ() { - - gyrZ_ = 0F; + public Builder clearAccuracy() { + bitField0_ = (bitField0_ & ~0x00000002); + accuracy_ = 0F; onChanged(); return this; } - private float rotationVectorX_ ; + private float speed_ ; /** *
-       * unitless, 4 components should sum to ~1
+       * m/s
        * 
* - * optional float rotation_vector_x = 8; + * float speed = 3; + * @return The speed. */ - public float getRotationVectorX() { - return rotationVectorX_; + @java.lang.Override + public float getSpeed() { + return speed_; } /** *
-       * unitless, 4 components should sum to ~1
+       * m/s
        * 
* - * optional float rotation_vector_x = 8; + * float speed = 3; + * @param value The speed to set. + * @return This builder for chaining. */ - public Builder setRotationVectorX(float value) { - - rotationVectorX_ = value; + public Builder setSpeed(float value) { + + speed_ = value; + bitField0_ |= 0x00000004; onChanged(); return this; } /** *
-       * unitless, 4 components should sum to ~1
+       * m/s
        * 
* - * optional float rotation_vector_x = 8; + * float speed = 3; + * @return This builder for chaining. */ - public Builder clearRotationVectorX() { - - rotationVectorX_ = 0F; + public Builder clearSpeed() { + bitField0_ = (bitField0_ & ~0x00000004); + speed_ = 0F; onChanged(); return this; } - private float rotationVectorY_ ; - /** - * optional float rotation_vector_y = 9; - */ - public float getRotationVectorY() { - return rotationVectorY_; - } + private float bearing_ ; /** - * optional float rotation_vector_y = 9; + *
+       * degrees
+       * 
+ * + * float bearing = 4; + * @return The bearing. */ - public Builder setRotationVectorY(float value) { - - rotationVectorY_ = value; - onChanged(); - return this; + @java.lang.Override + public float getBearing() { + return bearing_; } /** - * optional float rotation_vector_y = 9; + *
+       * degrees
+       * 
+ * + * float bearing = 4; + * @param value The bearing to set. + * @return This builder for chaining. */ - public Builder clearRotationVectorY() { - - rotationVectorY_ = 0F; - onChanged(); - return this; - } + public Builder setBearing(float value) { - private float rotationVectorZ_ ; - /** - * optional float rotation_vector_z = 10; - */ - public float getRotationVectorZ() { - return rotationVectorZ_; - } - /** - * optional float rotation_vector_z = 10; - */ - public Builder setRotationVectorZ(float value) { - - rotationVectorZ_ = value; + bearing_ = value; + bitField0_ |= 0x00000008; onChanged(); return this; } /** - * optional float rotation_vector_z = 10; + *
+       * degrees
+       * 
+ * + * float bearing = 4; + * @return This builder for chaining. */ - public Builder clearRotationVectorZ() { - - rotationVectorZ_ = 0F; + public Builder clearBearing() { + bitField0_ = (bitField0_ & ~0x00000008); + bearing_ = 0F; onChanged(); return this; } - private float rotationVectorW_ ; - /** - * optional float rotation_vector_w = 11; - */ - public float getRotationVectorW() { - return rotationVectorW_; - } + private java.lang.Object provider_ = ""; /** - * optional float rotation_vector_w = 11; + *
+       * e.g 'gps' or 'network'
+       * 
+ * + * string provider = 5; + * @return The provider. */ - public Builder setRotationVectorW(float value) { - - rotationVectorW_ = value; - onChanged(); - return this; + public java.lang.String getProvider() { + java.lang.Object ref = provider_; + if (!(ref instanceof java.lang.String)) { + com.google.protobuf.ByteString bs = + (com.google.protobuf.ByteString) ref; + java.lang.String s = bs.toStringUtf8(); + provider_ = s; + return s; + } else { + return (java.lang.String) ref; + } } /** - * optional float rotation_vector_w = 11; + *
+       * e.g 'gps' or 'network'
+       * 
+ * + * string provider = 5; + * @return The bytes for provider. */ - public Builder clearRotationVectorW() { - - rotationVectorW_ = 0F; - onChanged(); - return this; + public com.google.protobuf.ByteString + getProviderBytes() { + java.lang.Object ref = provider_; + if (ref instanceof String) { + com.google.protobuf.ByteString b = + com.google.protobuf.ByteString.copyFromUtf8( + (java.lang.String) ref); + provider_ = b; + return b; + } else { + return (com.google.protobuf.ByteString) ref; + } } - - private int stepCount_ ; /** *
-       * Integer
+       * e.g 'gps' or 'network'
        * 
* - * optional int32 step_count = 12; + * string provider = 5; + * @param value The provider to set. + * @return This builder for chaining. */ - public int getStepCount() { - return stepCount_; + public Builder setProvider( + java.lang.String value) { + if (value == null) { throw new NullPointerException(); } + provider_ = value; + bitField0_ |= 0x00000010; + onChanged(); + return this; } /** *
-       * Integer
+       * e.g 'gps' or 'network'
        * 
* - * optional int32 step_count = 12; + * string provider = 5; + * @return This builder for chaining. */ - public Builder setStepCount(int value) { - - stepCount_ = value; + public Builder clearProvider() { + provider_ = getDefaultInstance().getProvider(); + bitField0_ = (bitField0_ & ~0x00000010); onChanged(); return this; } /** *
-       * Integer
+       * e.g 'gps' or 'network'
        * 
* - * optional int32 step_count = 12; + * string provider = 5; + * @param value The bytes for provider to set. + * @return This builder for chaining. */ - public Builder clearStepCount() { - - stepCount_ = 0; + public Builder setProviderBytes( + com.google.protobuf.ByteString value) { + if (value == null) { throw new NullPointerException(); } + checkByteStringIsUtf8(value); + provider_ = value; + bitField0_ |= 0x00000010; onChanged(); return this; } - public final Builder setUnknownFields( - final com.google.protobuf.UnknownFieldSet unknownFields) { - return this; - } - - public final Builder mergeUnknownFields( - final com.google.protobuf.UnknownFieldSet unknownFields) { - return this; - } - - // @@protoc_insertion_point(builder_scope:Motion_Sample) + // @@protoc_insertion_point(builder_scope:GNSSReading) } - // @@protoc_insertion_point(class_scope:Motion_Sample) - private static final Motion_Sample DEFAULT_INSTANCE; + // @@protoc_insertion_point(class_scope:GNSSReading) + private static final com.openpositioning.PositionMe.Traj.GNSSReading DEFAULT_INSTANCE; static { - DEFAULT_INSTANCE = new Motion_Sample(); + DEFAULT_INSTANCE = new com.openpositioning.PositionMe.Traj.GNSSReading(); } - public static Motion_Sample getDefaultInstance() { + public static com.openpositioning.PositionMe.Traj.GNSSReading getDefaultInstance() { return DEFAULT_INSTANCE; } - private static final com.google.protobuf.Parser - PARSER = new com.google.protobuf.AbstractParser() { - public Motion_Sample parsePartialFrom( - com.google.protobuf.CodedInputStream input, - com.google.protobuf.ExtensionRegistryLite extensionRegistry) - throws com.google.protobuf.InvalidProtocolBufferException { - return new Motion_Sample(input, extensionRegistry); + private static final com.google.protobuf.Parser + PARSER = new com.google.protobuf.AbstractParser() { + @java.lang.Override + public GNSSReading parsePartialFrom( + com.google.protobuf.CodedInputStream input, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + Builder builder = newBuilder(); + try { + builder.mergeFrom(input, extensionRegistry); + } catch (com.google.protobuf.InvalidProtocolBufferException e) { + throw e.setUnfinishedMessage(builder.buildPartial()); + } catch (com.google.protobuf.UninitializedMessageException e) { + throw e.asInvalidProtocolBufferException().setUnfinishedMessage(builder.buildPartial()); + } catch (java.io.IOException e) { + throw new com.google.protobuf.InvalidProtocolBufferException(e) + .setUnfinishedMessage(builder.buildPartial()); + } + return builder.buildPartial(); } }; - public static com.google.protobuf.Parser parser() { + public static com.google.protobuf.Parser parser() { return PARSER; } - @Override - public com.google.protobuf.Parser getParserForType() { + @java.lang.Override + public com.google.protobuf.Parser getParserForType() { return PARSER; } - public Motion_Sample getDefaultInstanceForType() { + @java.lang.Override + public com.openpositioning.PositionMe.Traj.GNSSReading getDefaultInstanceForType() { return DEFAULT_INSTANCE; } } - public interface Position_SampleOrBuilder extends - // @@protoc_insertion_point(interface_extends:Position_Sample) - com.google.protobuf.MessageOrBuilder { + public interface FingerprintOrBuilder extends + // @@protoc_insertion_point(interface_extends:Fingerprint) + com.google.protobuf.MessageOrBuilder { /** - * optional int64 relative_timestamp = 1; + * int64 relative_timestamp = 1; + * @return The relativeTimestamp. */ long getRelativeTimestamp(); /** - *
-     * uT
-     * 
- * - * optional float mag_x = 2; + * repeated .RFScan rf_scans = 2; */ - float getMagX(); - + java.util.List + getRfScansList(); /** - * optional float mag_y = 3; + * repeated .RFScan rf_scans = 2; */ - float getMagY(); - + com.openpositioning.PositionMe.Traj.RFScan getRfScans(int index); + /** + * repeated .RFScan rf_scans = 2; + */ + int getRfScansCount(); + /** + * repeated .RFScan rf_scans = 2; + */ + java.util.List + getRfScansOrBuilderList(); /** - * optional float mag_z = 4; + * repeated .RFScan rf_scans = 2; */ - float getMagZ(); + com.openpositioning.PositionMe.Traj.RFScanOrBuilder getRfScansOrBuilder( + int index); } /** - * Protobuf type {@code Position_Sample} + * Protobuf type {@code Fingerprint} */ - public static final class Position_Sample extends - com.google.protobuf.GeneratedMessageV3 implements - // @@protoc_insertion_point(message_implements:Position_Sample) - Position_SampleOrBuilder { - // Use Position_Sample.newBuilder() to construct. - private Position_Sample(com.google.protobuf.GeneratedMessageV3.Builder builder) { + public static final class Fingerprint extends + com.google.protobuf.GeneratedMessage implements + // @@protoc_insertion_point(message_implements:Fingerprint) + FingerprintOrBuilder { + private static final long serialVersionUID = 0L; + static { + com.google.protobuf.RuntimeVersion.validateProtobufGencodeVersion( + com.google.protobuf.RuntimeVersion.RuntimeDomain.PUBLIC, + /* major= */ 4, + /* minor= */ 29, + /* patch= */ 6, + /* suffix= */ "", + Fingerprint.class.getName()); + } + // Use Fingerprint.newBuilder() to construct. + private Fingerprint(com.google.protobuf.GeneratedMessage.Builder builder) { super(builder); } - private Position_Sample() { - relativeTimestamp_ = 0L; - magX_ = 0F; - magY_ = 0F; - magZ_ = 0F; - } - - @Override - public final com.google.protobuf.UnknownFieldSet - getUnknownFields() { - return com.google.protobuf.UnknownFieldSet.getDefaultInstance(); - } - private Position_Sample( - com.google.protobuf.CodedInputStream input, - com.google.protobuf.ExtensionRegistryLite extensionRegistry) - throws com.google.protobuf.InvalidProtocolBufferException { - this(); - int mutable_bitField0_ = 0; - try { - boolean done = false; - while (!done) { - int tag = input.readTag(); - switch (tag) { - case 0: - done = true; - break; - default: { - if (!input.skipField(tag)) { - done = true; - } - break; - } - case 8: { - - relativeTimestamp_ = input.readInt64(); - break; - } - case 21: { - - magX_ = input.readFloat(); - break; - } - case 29: { - - magY_ = input.readFloat(); - break; - } - case 37: { - - magZ_ = input.readFloat(); - break; - } - } - } - } catch (com.google.protobuf.InvalidProtocolBufferException e) { - throw e.setUnfinishedMessage(this); - } catch (java.io.IOException e) { - throw new com.google.protobuf.InvalidProtocolBufferException( - e).setUnfinishedMessage(this); - } finally { - makeExtensionsImmutable(); - } + private Fingerprint() { + rfScans_ = java.util.Collections.emptyList(); } + public static final com.google.protobuf.Descriptors.Descriptor - getDescriptor() { - return Traj.internal_static_Position_Sample_descriptor; + getDescriptor() { + return com.openpositioning.PositionMe.Traj.internal_static_Fingerprint_descriptor; } - protected com.google.protobuf.GeneratedMessageV3.FieldAccessorTable - internalGetFieldAccessorTable() { - return Traj.internal_static_Position_Sample_fieldAccessorTable - .ensureFieldAccessorsInitialized( - Position_Sample.class, Builder.class); + @java.lang.Override + protected com.google.protobuf.GeneratedMessage.FieldAccessorTable + internalGetFieldAccessorTable() { + return com.openpositioning.PositionMe.Traj.internal_static_Fingerprint_fieldAccessorTable + .ensureFieldAccessorsInitialized( + com.openpositioning.PositionMe.Traj.Fingerprint.class, com.openpositioning.PositionMe.Traj.Fingerprint.Builder.class); } public static final int RELATIVE_TIMESTAMP_FIELD_NUMBER = 1; - private long relativeTimestamp_; + private long relativeTimestamp_ = 0L; /** - * optional int64 relative_timestamp = 1; + * int64 relative_timestamp = 1; + * @return The relativeTimestamp. */ + @java.lang.Override public long getRelativeTimestamp() { return relativeTimestamp_; } - public static final int MAG_X_FIELD_NUMBER = 2; - private float magX_; + public static final int RF_SCANS_FIELD_NUMBER = 2; + @SuppressWarnings("serial") + private java.util.List rfScans_; /** - *
-     * uT
-     * 
- * - * optional float mag_x = 2; + * repeated .RFScan rf_scans = 2; */ - public float getMagX() { - return magX_; + @java.lang.Override + public java.util.List getRfScansList() { + return rfScans_; } - - public static final int MAG_Y_FIELD_NUMBER = 3; - private float magY_; /** - * optional float mag_y = 3; + * repeated .RFScan rf_scans = 2; */ - public float getMagY() { - return magY_; + @java.lang.Override + public java.util.List + getRfScansOrBuilderList() { + return rfScans_; } - - public static final int MAG_Z_FIELD_NUMBER = 4; - private float magZ_; /** - * optional float mag_z = 4; + * repeated .RFScan rf_scans = 2; */ - public float getMagZ() { - return magZ_; + @java.lang.Override + public int getRfScansCount() { + return rfScans_.size(); + } + /** + * repeated .RFScan rf_scans = 2; + */ + @java.lang.Override + public com.openpositioning.PositionMe.Traj.RFScan getRfScans(int index) { + return rfScans_.get(index); + } + /** + * repeated .RFScan rf_scans = 2; + */ + @java.lang.Override + public com.openpositioning.PositionMe.Traj.RFScanOrBuilder getRfScansOrBuilder( + int index) { + return rfScans_.get(index); } private byte memoizedIsInitialized = -1; + @java.lang.Override public final boolean isInitialized() { byte isInitialized = memoizedIsInitialized; if (isInitialized == 1) return true; @@ -6900,22 +14174,19 @@ public final boolean isInitialized() { return true; } + @java.lang.Override public void writeTo(com.google.protobuf.CodedOutputStream output) - throws java.io.IOException { + throws java.io.IOException { if (relativeTimestamp_ != 0L) { output.writeInt64(1, relativeTimestamp_); } - if (magX_ != 0F) { - output.writeFloat(2, magX_); - } - if (magY_ != 0F) { - output.writeFloat(3, magY_); - } - if (magZ_ != 0F) { - output.writeFloat(4, magZ_); + for (int i = 0; i < rfScans_.size(); i++) { + output.writeMessage(2, rfScans_.get(i)); } + getUnknownFields().writeTo(output); } + @java.lang.Override public int getSerializedSize() { int size = memoizedSize; if (size != -1) return size; @@ -6923,582 +14194,844 @@ public int getSerializedSize() { size = 0; if (relativeTimestamp_ != 0L) { size += com.google.protobuf.CodedOutputStream - .computeInt64Size(1, relativeTimestamp_); + .computeInt64Size(1, relativeTimestamp_); } - if (magX_ != 0F) { + for (int i = 0; i < rfScans_.size(); i++) { size += com.google.protobuf.CodedOutputStream - .computeFloatSize(2, magX_); - } - if (magY_ != 0F) { - size += com.google.protobuf.CodedOutputStream - .computeFloatSize(3, magY_); - } - if (magZ_ != 0F) { - size += com.google.protobuf.CodedOutputStream - .computeFloatSize(4, magZ_); + .computeMessageSize(2, rfScans_.get(i)); } + size += getUnknownFields().getSerializedSize(); memoizedSize = size; return size; } - private static final long serialVersionUID = 0L; - @Override - public boolean equals(final Object obj) { + @java.lang.Override + public boolean equals(final java.lang.Object obj) { if (obj == this) { - return true; + return true; } - if (!(obj instanceof Position_Sample)) { + if (!(obj instanceof com.openpositioning.PositionMe.Traj.Fingerprint)) { return super.equals(obj); } - Position_Sample other = (Position_Sample) obj; - - boolean result = true; - result = result && (getRelativeTimestamp() - == other.getRelativeTimestamp()); - result = result && ( - Float.floatToIntBits(getMagX()) - == Float.floatToIntBits( - other.getMagX())); - result = result && ( - Float.floatToIntBits(getMagY()) - == Float.floatToIntBits( - other.getMagY())); - result = result && ( - Float.floatToIntBits(getMagZ()) - == Float.floatToIntBits( - other.getMagZ())); - return result; - } - - @Override + com.openpositioning.PositionMe.Traj.Fingerprint other = (com.openpositioning.PositionMe.Traj.Fingerprint) obj; + + if (getRelativeTimestamp() + != other.getRelativeTimestamp()) return false; + if (!getRfScansList() + .equals(other.getRfScansList())) return false; + if (!getUnknownFields().equals(other.getUnknownFields())) return false; + return true; + } + + @java.lang.Override public int hashCode() { if (memoizedHashCode != 0) { return memoizedHashCode; } int hash = 41; - hash = (19 * hash) + getDescriptorForType().hashCode(); + hash = (19 * hash) + getDescriptor().hashCode(); hash = (37 * hash) + RELATIVE_TIMESTAMP_FIELD_NUMBER; hash = (53 * hash) + com.google.protobuf.Internal.hashLong( - getRelativeTimestamp()); - hash = (37 * hash) + MAG_X_FIELD_NUMBER; - hash = (53 * hash) + Float.floatToIntBits( - getMagX()); - hash = (37 * hash) + MAG_Y_FIELD_NUMBER; - hash = (53 * hash) + Float.floatToIntBits( - getMagY()); - hash = (37 * hash) + MAG_Z_FIELD_NUMBER; - hash = (53 * hash) + Float.floatToIntBits( - getMagZ()); - hash = (29 * hash) + unknownFields.hashCode(); + getRelativeTimestamp()); + if (getRfScansCount() > 0) { + hash = (37 * hash) + RF_SCANS_FIELD_NUMBER; + hash = (53 * hash) + getRfScansList().hashCode(); + } + hash = (29 * hash) + getUnknownFields().hashCode(); memoizedHashCode = hash; return hash; } - public static Position_Sample parseFrom( - com.google.protobuf.ByteString data) - throws com.google.protobuf.InvalidProtocolBufferException { + public static com.openpositioning.PositionMe.Traj.Fingerprint parseFrom( + java.nio.ByteBuffer data) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + public static com.openpositioning.PositionMe.Traj.Fingerprint parseFrom( + java.nio.ByteBuffer data, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data, extensionRegistry); + } + public static com.openpositioning.PositionMe.Traj.Fingerprint parseFrom( + com.google.protobuf.ByteString data) + throws com.google.protobuf.InvalidProtocolBufferException { return PARSER.parseFrom(data); } - public static Position_Sample parseFrom( - com.google.protobuf.ByteString data, - com.google.protobuf.ExtensionRegistryLite extensionRegistry) - throws com.google.protobuf.InvalidProtocolBufferException { + public static com.openpositioning.PositionMe.Traj.Fingerprint parseFrom( + com.google.protobuf.ByteString data, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { return PARSER.parseFrom(data, extensionRegistry); } - public static Position_Sample parseFrom(byte[] data) - throws com.google.protobuf.InvalidProtocolBufferException { + public static com.openpositioning.PositionMe.Traj.Fingerprint parseFrom(byte[] data) + throws com.google.protobuf.InvalidProtocolBufferException { return PARSER.parseFrom(data); } - public static Position_Sample parseFrom( - byte[] data, - com.google.protobuf.ExtensionRegistryLite extensionRegistry) - throws com.google.protobuf.InvalidProtocolBufferException { + public static com.openpositioning.PositionMe.Traj.Fingerprint parseFrom( + byte[] data, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { return PARSER.parseFrom(data, extensionRegistry); } - public static Position_Sample parseFrom(java.io.InputStream input) - throws java.io.IOException { - return com.google.protobuf.GeneratedMessageV3 - .parseWithIOException(PARSER, input); - } - public static Position_Sample parseFrom( - java.io.InputStream input, - com.google.protobuf.ExtensionRegistryLite extensionRegistry) - throws java.io.IOException { - return com.google.protobuf.GeneratedMessageV3 - .parseWithIOException(PARSER, input, extensionRegistry); - } - public static Position_Sample parseDelimitedFrom(java.io.InputStream input) - throws java.io.IOException { - return com.google.protobuf.GeneratedMessageV3 - .parseDelimitedWithIOException(PARSER, input); - } - public static Position_Sample parseDelimitedFrom( - java.io.InputStream input, - com.google.protobuf.ExtensionRegistryLite extensionRegistry) - throws java.io.IOException { - return com.google.protobuf.GeneratedMessageV3 - .parseDelimitedWithIOException(PARSER, input, extensionRegistry); - } - public static Position_Sample parseFrom( - com.google.protobuf.CodedInputStream input) - throws java.io.IOException { - return com.google.protobuf.GeneratedMessageV3 - .parseWithIOException(PARSER, input); - } - public static Position_Sample parseFrom( - com.google.protobuf.CodedInputStream input, - com.google.protobuf.ExtensionRegistryLite extensionRegistry) - throws java.io.IOException { - return com.google.protobuf.GeneratedMessageV3 - .parseWithIOException(PARSER, input, extensionRegistry); + public static com.openpositioning.PositionMe.Traj.Fingerprint parseFrom(java.io.InputStream input) + throws java.io.IOException { + return com.google.protobuf.GeneratedMessage + .parseWithIOException(PARSER, input); + } + public static com.openpositioning.PositionMe.Traj.Fingerprint parseFrom( + java.io.InputStream input, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws java.io.IOException { + return com.google.protobuf.GeneratedMessage + .parseWithIOException(PARSER, input, extensionRegistry); } + public static com.openpositioning.PositionMe.Traj.Fingerprint parseDelimitedFrom(java.io.InputStream input) + throws java.io.IOException { + return com.google.protobuf.GeneratedMessage + .parseDelimitedWithIOException(PARSER, input); + } + + public static com.openpositioning.PositionMe.Traj.Fingerprint parseDelimitedFrom( + java.io.InputStream input, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws java.io.IOException { + return com.google.protobuf.GeneratedMessage + .parseDelimitedWithIOException(PARSER, input, extensionRegistry); + } + public static com.openpositioning.PositionMe.Traj.Fingerprint parseFrom( + com.google.protobuf.CodedInputStream input) + throws java.io.IOException { + return com.google.protobuf.GeneratedMessage + .parseWithIOException(PARSER, input); + } + public static com.openpositioning.PositionMe.Traj.Fingerprint parseFrom( + com.google.protobuf.CodedInputStream input, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws java.io.IOException { + return com.google.protobuf.GeneratedMessage + .parseWithIOException(PARSER, input, extensionRegistry); + } + + @java.lang.Override public Builder newBuilderForType() { return newBuilder(); } public static Builder newBuilder() { return DEFAULT_INSTANCE.toBuilder(); } - public static Builder newBuilder(Position_Sample prototype) { + public static Builder newBuilder(com.openpositioning.PositionMe.Traj.Fingerprint prototype) { return DEFAULT_INSTANCE.toBuilder().mergeFrom(prototype); } + @java.lang.Override public Builder toBuilder() { return this == DEFAULT_INSTANCE - ? new Builder() : new Builder().mergeFrom(this); + ? new Builder() : new Builder().mergeFrom(this); } - @Override + @java.lang.Override protected Builder newBuilderForType( - com.google.protobuf.GeneratedMessageV3.BuilderParent parent) { + com.google.protobuf.GeneratedMessage.BuilderParent parent) { Builder builder = new Builder(parent); return builder; } /** - * Protobuf type {@code Position_Sample} + * Protobuf type {@code Fingerprint} */ public static final class Builder extends - com.google.protobuf.GeneratedMessageV3.Builder implements - // @@protoc_insertion_point(builder_implements:Position_Sample) - Position_SampleOrBuilder { + com.google.protobuf.GeneratedMessage.Builder implements + // @@protoc_insertion_point(builder_implements:Fingerprint) + com.openpositioning.PositionMe.Traj.FingerprintOrBuilder { public static final com.google.protobuf.Descriptors.Descriptor - getDescriptor() { - return Traj.internal_static_Position_Sample_descriptor; + getDescriptor() { + return com.openpositioning.PositionMe.Traj.internal_static_Fingerprint_descriptor; } - protected com.google.protobuf.GeneratedMessageV3.FieldAccessorTable - internalGetFieldAccessorTable() { - return Traj.internal_static_Position_Sample_fieldAccessorTable - .ensureFieldAccessorsInitialized( - Position_Sample.class, Builder.class); + @java.lang.Override + protected com.google.protobuf.GeneratedMessage.FieldAccessorTable + internalGetFieldAccessorTable() { + return com.openpositioning.PositionMe.Traj.internal_static_Fingerprint_fieldAccessorTable + .ensureFieldAccessorsInitialized( + com.openpositioning.PositionMe.Traj.Fingerprint.class, com.openpositioning.PositionMe.Traj.Fingerprint.Builder.class); } - // Construct using Traj.Position_Sample.newBuilder() + // Construct using com.openpositioning.PositionMe.Traj.Fingerprint.newBuilder() private Builder() { - maybeForceBuilderInitialization(); + } private Builder( - com.google.protobuf.GeneratedMessageV3.BuilderParent parent) { + com.google.protobuf.GeneratedMessage.BuilderParent parent) { super(parent); - maybeForceBuilderInitialization(); - } - private void maybeForceBuilderInitialization() { - if (com.google.protobuf.GeneratedMessageV3 - .alwaysUseFieldBuilders) { - } + } + @java.lang.Override public Builder clear() { super.clear(); + bitField0_ = 0; relativeTimestamp_ = 0L; - - magX_ = 0F; - - magY_ = 0F; - - magZ_ = 0F; - + if (rfScansBuilder_ == null) { + rfScans_ = java.util.Collections.emptyList(); + } else { + rfScans_ = null; + rfScansBuilder_.clear(); + } + bitField0_ = (bitField0_ & ~0x00000002); return this; } + @java.lang.Override public com.google.protobuf.Descriptors.Descriptor - getDescriptorForType() { - return Traj.internal_static_Position_Sample_descriptor; + getDescriptorForType() { + return com.openpositioning.PositionMe.Traj.internal_static_Fingerprint_descriptor; } - public Position_Sample getDefaultInstanceForType() { - return Position_Sample.getDefaultInstance(); + @java.lang.Override + public com.openpositioning.PositionMe.Traj.Fingerprint getDefaultInstanceForType() { + return com.openpositioning.PositionMe.Traj.Fingerprint.getDefaultInstance(); } - public Position_Sample build() { - Position_Sample result = buildPartial(); + @java.lang.Override + public com.openpositioning.PositionMe.Traj.Fingerprint build() { + com.openpositioning.PositionMe.Traj.Fingerprint result = buildPartial(); if (!result.isInitialized()) { throw newUninitializedMessageException(result); } return result; } - public Position_Sample buildPartial() { - Position_Sample result = new Position_Sample(this); - result.relativeTimestamp_ = relativeTimestamp_; - result.magX_ = magX_; - result.magY_ = magY_; - result.magZ_ = magZ_; + @java.lang.Override + public com.openpositioning.PositionMe.Traj.Fingerprint buildPartial() { + com.openpositioning.PositionMe.Traj.Fingerprint result = new com.openpositioning.PositionMe.Traj.Fingerprint(this); + buildPartialRepeatedFields(result); + if (bitField0_ != 0) { buildPartial0(result); } onBuilt(); return result; } - public Builder clone() { - return (Builder) super.clone(); - } - public Builder setField( - com.google.protobuf.Descriptors.FieldDescriptor field, - Object value) { - return (Builder) super.setField(field, value); - } - public Builder clearField( - com.google.protobuf.Descriptors.FieldDescriptor field) { - return (Builder) super.clearField(field); - } - public Builder clearOneof( - com.google.protobuf.Descriptors.OneofDescriptor oneof) { - return (Builder) super.clearOneof(oneof); - } - public Builder setRepeatedField( - com.google.protobuf.Descriptors.FieldDescriptor field, - int index, Object value) { - return (Builder) super.setRepeatedField(field, index, value); + private void buildPartialRepeatedFields(com.openpositioning.PositionMe.Traj.Fingerprint result) { + if (rfScansBuilder_ == null) { + if (((bitField0_ & 0x00000002) != 0)) { + rfScans_ = java.util.Collections.unmodifiableList(rfScans_); + bitField0_ = (bitField0_ & ~0x00000002); + } + result.rfScans_ = rfScans_; + } else { + result.rfScans_ = rfScansBuilder_.build(); + } } - public Builder addRepeatedField( - com.google.protobuf.Descriptors.FieldDescriptor field, - Object value) { - return (Builder) super.addRepeatedField(field, value); + + private void buildPartial0(com.openpositioning.PositionMe.Traj.Fingerprint result) { + int from_bitField0_ = bitField0_; + if (((from_bitField0_ & 0x00000001) != 0)) { + result.relativeTimestamp_ = relativeTimestamp_; + } } + + @java.lang.Override public Builder mergeFrom(com.google.protobuf.Message other) { - if (other instanceof Position_Sample) { - return mergeFrom((Position_Sample)other); + if (other instanceof com.openpositioning.PositionMe.Traj.Fingerprint) { + return mergeFrom((com.openpositioning.PositionMe.Traj.Fingerprint)other); } else { super.mergeFrom(other); return this; } } - public Builder mergeFrom(Position_Sample other) { - if (other == Position_Sample.getDefaultInstance()) return this; + public Builder mergeFrom(com.openpositioning.PositionMe.Traj.Fingerprint other) { + if (other == com.openpositioning.PositionMe.Traj.Fingerprint.getDefaultInstance()) return this; if (other.getRelativeTimestamp() != 0L) { setRelativeTimestamp(other.getRelativeTimestamp()); } - if (other.getMagX() != 0F) { - setMagX(other.getMagX()); - } - if (other.getMagY() != 0F) { - setMagY(other.getMagY()); - } - if (other.getMagZ() != 0F) { - setMagZ(other.getMagZ()); + if (rfScansBuilder_ == null) { + if (!other.rfScans_.isEmpty()) { + if (rfScans_.isEmpty()) { + rfScans_ = other.rfScans_; + bitField0_ = (bitField0_ & ~0x00000002); + } else { + ensureRfScansIsMutable(); + rfScans_.addAll(other.rfScans_); + } + onChanged(); + } + } else { + if (!other.rfScans_.isEmpty()) { + if (rfScansBuilder_.isEmpty()) { + rfScansBuilder_.dispose(); + rfScansBuilder_ = null; + rfScans_ = other.rfScans_; + bitField0_ = (bitField0_ & ~0x00000002); + rfScansBuilder_ = + com.google.protobuf.GeneratedMessage.alwaysUseFieldBuilders ? + getRfScansFieldBuilder() : null; + } else { + rfScansBuilder_.addAllMessages(other.rfScans_); + } + } } + this.mergeUnknownFields(other.getUnknownFields()); onChanged(); return this; } + @java.lang.Override public final boolean isInitialized() { return true; } + @java.lang.Override public Builder mergeFrom( - com.google.protobuf.CodedInputStream input, - com.google.protobuf.ExtensionRegistryLite extensionRegistry) - throws java.io.IOException { - Position_Sample parsedMessage = null; + com.google.protobuf.CodedInputStream input, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws java.io.IOException { + if (extensionRegistry == null) { + throw new java.lang.NullPointerException(); + } try { - parsedMessage = PARSER.parsePartialFrom(input, extensionRegistry); + boolean done = false; + while (!done) { + int tag = input.readTag(); + switch (tag) { + case 0: + done = true; + break; + case 8: { + relativeTimestamp_ = input.readInt64(); + bitField0_ |= 0x00000001; + break; + } // case 8 + case 18: { + com.openpositioning.PositionMe.Traj.RFScan m = + input.readMessage( + com.openpositioning.PositionMe.Traj.RFScan.parser(), + extensionRegistry); + if (rfScansBuilder_ == null) { + ensureRfScansIsMutable(); + rfScans_.add(m); + } else { + rfScansBuilder_.addMessage(m); + } + break; + } // case 18 + default: { + if (!super.parseUnknownField(input, extensionRegistry, tag)) { + done = true; // was an endgroup tag + } + break; + } // default: + } // switch (tag) + } // while (!done) } catch (com.google.protobuf.InvalidProtocolBufferException e) { - parsedMessage = (Position_Sample) e.getUnfinishedMessage(); throw e.unwrapIOException(); } finally { - if (parsedMessage != null) { - mergeFrom(parsedMessage); - } - } + onChanged(); + } // finally return this; } + private int bitField0_; private long relativeTimestamp_ ; /** - * optional int64 relative_timestamp = 1; + * int64 relative_timestamp = 1; + * @return The relativeTimestamp. */ + @java.lang.Override public long getRelativeTimestamp() { return relativeTimestamp_; } /** - * optional int64 relative_timestamp = 1; + * int64 relative_timestamp = 1; + * @param value The relativeTimestamp to set. + * @return This builder for chaining. */ public Builder setRelativeTimestamp(long value) { - + relativeTimestamp_ = value; + bitField0_ |= 0x00000001; onChanged(); return this; } /** - * optional int64 relative_timestamp = 1; + * int64 relative_timestamp = 1; + * @return This builder for chaining. */ public Builder clearRelativeTimestamp() { - + bitField0_ = (bitField0_ & ~0x00000001); relativeTimestamp_ = 0L; onChanged(); return this; } - private float magX_ ; + private java.util.List rfScans_ = + java.util.Collections.emptyList(); + private void ensureRfScansIsMutable() { + if (!((bitField0_ & 0x00000002) != 0)) { + rfScans_ = new java.util.ArrayList(rfScans_); + bitField0_ |= 0x00000002; + } + } + + private com.google.protobuf.RepeatedFieldBuilder< + com.openpositioning.PositionMe.Traj.RFScan, com.openpositioning.PositionMe.Traj.RFScan.Builder, com.openpositioning.PositionMe.Traj.RFScanOrBuilder> rfScansBuilder_; + /** - *
-       * uT
-       * 
- * - * optional float mag_x = 2; + * repeated .RFScan rf_scans = 2; */ - public float getMagX() { - return magX_; + public java.util.List getRfScansList() { + if (rfScansBuilder_ == null) { + return java.util.Collections.unmodifiableList(rfScans_); + } else { + return rfScansBuilder_.getMessageList(); + } } /** - *
-       * uT
-       * 
- * - * optional float mag_x = 2; + * repeated .RFScan rf_scans = 2; */ - public Builder setMagX(float value) { - - magX_ = value; - onChanged(); - return this; + public int getRfScansCount() { + if (rfScansBuilder_ == null) { + return rfScans_.size(); + } else { + return rfScansBuilder_.getCount(); + } } /** - *
-       * uT
-       * 
- * - * optional float mag_x = 2; + * repeated .RFScan rf_scans = 2; */ - public Builder clearMagX() { - - magX_ = 0F; - onChanged(); + public com.openpositioning.PositionMe.Traj.RFScan getRfScans(int index) { + if (rfScansBuilder_ == null) { + return rfScans_.get(index); + } else { + return rfScansBuilder_.getMessage(index); + } + } + /** + * repeated .RFScan rf_scans = 2; + */ + public Builder setRfScans( + int index, com.openpositioning.PositionMe.Traj.RFScan value) { + if (rfScansBuilder_ == null) { + if (value == null) { + throw new NullPointerException(); + } + ensureRfScansIsMutable(); + rfScans_.set(index, value); + onChanged(); + } else { + rfScansBuilder_.setMessage(index, value); + } return this; } - - private float magY_ ; /** - * optional float mag_y = 3; + * repeated .RFScan rf_scans = 2; */ - public float getMagY() { - return magY_; + public Builder setRfScans( + int index, com.openpositioning.PositionMe.Traj.RFScan.Builder builderForValue) { + if (rfScansBuilder_ == null) { + ensureRfScansIsMutable(); + rfScans_.set(index, builderForValue.build()); + onChanged(); + } else { + rfScansBuilder_.setMessage(index, builderForValue.build()); + } + return this; } /** - * optional float mag_y = 3; + * repeated .RFScan rf_scans = 2; */ - public Builder setMagY(float value) { - - magY_ = value; - onChanged(); + public Builder addRfScans(com.openpositioning.PositionMe.Traj.RFScan value) { + if (rfScansBuilder_ == null) { + if (value == null) { + throw new NullPointerException(); + } + ensureRfScansIsMutable(); + rfScans_.add(value); + onChanged(); + } else { + rfScansBuilder_.addMessage(value); + } return this; } /** - * optional float mag_y = 3; + * repeated .RFScan rf_scans = 2; */ - public Builder clearMagY() { - - magY_ = 0F; - onChanged(); + public Builder addRfScans( + int index, com.openpositioning.PositionMe.Traj.RFScan value) { + if (rfScansBuilder_ == null) { + if (value == null) { + throw new NullPointerException(); + } + ensureRfScansIsMutable(); + rfScans_.add(index, value); + onChanged(); + } else { + rfScansBuilder_.addMessage(index, value); + } return this; } - - private float magZ_ ; /** - * optional float mag_z = 4; + * repeated .RFScan rf_scans = 2; */ - public float getMagZ() { - return magZ_; + public Builder addRfScans( + com.openpositioning.PositionMe.Traj.RFScan.Builder builderForValue) { + if (rfScansBuilder_ == null) { + ensureRfScansIsMutable(); + rfScans_.add(builderForValue.build()); + onChanged(); + } else { + rfScansBuilder_.addMessage(builderForValue.build()); + } + return this; } /** - * optional float mag_z = 4; + * repeated .RFScan rf_scans = 2; */ - public Builder setMagZ(float value) { - - magZ_ = value; - onChanged(); + public Builder addRfScans( + int index, com.openpositioning.PositionMe.Traj.RFScan.Builder builderForValue) { + if (rfScansBuilder_ == null) { + ensureRfScansIsMutable(); + rfScans_.add(index, builderForValue.build()); + onChanged(); + } else { + rfScansBuilder_.addMessage(index, builderForValue.build()); + } return this; } /** - * optional float mag_z = 4; + * repeated .RFScan rf_scans = 2; */ - public Builder clearMagZ() { - - magZ_ = 0F; - onChanged(); + public Builder addAllRfScans( + java.lang.Iterable values) { + if (rfScansBuilder_ == null) { + ensureRfScansIsMutable(); + com.google.protobuf.AbstractMessageLite.Builder.addAll( + values, rfScans_); + onChanged(); + } else { + rfScansBuilder_.addAllMessages(values); + } return this; } - public final Builder setUnknownFields( - final com.google.protobuf.UnknownFieldSet unknownFields) { + /** + * repeated .RFScan rf_scans = 2; + */ + public Builder clearRfScans() { + if (rfScansBuilder_ == null) { + rfScans_ = java.util.Collections.emptyList(); + bitField0_ = (bitField0_ & ~0x00000002); + onChanged(); + } else { + rfScansBuilder_.clear(); + } return this; } - - public final Builder mergeUnknownFields( - final com.google.protobuf.UnknownFieldSet unknownFields) { + /** + * repeated .RFScan rf_scans = 2; + */ + public Builder removeRfScans(int index) { + if (rfScansBuilder_ == null) { + ensureRfScansIsMutable(); + rfScans_.remove(index); + onChanged(); + } else { + rfScansBuilder_.remove(index); + } return this; } + /** + * repeated .RFScan rf_scans = 2; + */ + public com.openpositioning.PositionMe.Traj.RFScan.Builder getRfScansBuilder( + int index) { + return getRfScansFieldBuilder().getBuilder(index); + } + /** + * repeated .RFScan rf_scans = 2; + */ + public com.openpositioning.PositionMe.Traj.RFScanOrBuilder getRfScansOrBuilder( + int index) { + if (rfScansBuilder_ == null) { + return rfScans_.get(index); } else { + return rfScansBuilder_.getMessageOrBuilder(index); + } + } + /** + * repeated .RFScan rf_scans = 2; + */ + public java.util.List + getRfScansOrBuilderList() { + if (rfScansBuilder_ != null) { + return rfScansBuilder_.getMessageOrBuilderList(); + } else { + return java.util.Collections.unmodifiableList(rfScans_); + } + } + /** + * repeated .RFScan rf_scans = 2; + */ + public com.openpositioning.PositionMe.Traj.RFScan.Builder addRfScansBuilder() { + return getRfScansFieldBuilder().addBuilder( + com.openpositioning.PositionMe.Traj.RFScan.getDefaultInstance()); + } + /** + * repeated .RFScan rf_scans = 2; + */ + public com.openpositioning.PositionMe.Traj.RFScan.Builder addRfScansBuilder( + int index) { + return getRfScansFieldBuilder().addBuilder( + index, com.openpositioning.PositionMe.Traj.RFScan.getDefaultInstance()); + } + /** + * repeated .RFScan rf_scans = 2; + */ + public java.util.List + getRfScansBuilderList() { + return getRfScansFieldBuilder().getBuilderList(); + } + private com.google.protobuf.RepeatedFieldBuilder< + com.openpositioning.PositionMe.Traj.RFScan, com.openpositioning.PositionMe.Traj.RFScan.Builder, com.openpositioning.PositionMe.Traj.RFScanOrBuilder> + getRfScansFieldBuilder() { + if (rfScansBuilder_ == null) { + rfScansBuilder_ = new com.google.protobuf.RepeatedFieldBuilder< + com.openpositioning.PositionMe.Traj.RFScan, com.openpositioning.PositionMe.Traj.RFScan.Builder, com.openpositioning.PositionMe.Traj.RFScanOrBuilder>( + rfScans_, + ((bitField0_ & 0x00000002) != 0), + getParentForChildren(), + isClean()); + rfScans_ = null; + } + return rfScansBuilder_; + } - - // @@protoc_insertion_point(builder_scope:Position_Sample) + // @@protoc_insertion_point(builder_scope:Fingerprint) } - // @@protoc_insertion_point(class_scope:Position_Sample) - private static final Position_Sample DEFAULT_INSTANCE; + // @@protoc_insertion_point(class_scope:Fingerprint) + private static final com.openpositioning.PositionMe.Traj.Fingerprint DEFAULT_INSTANCE; static { - DEFAULT_INSTANCE = new Position_Sample(); + DEFAULT_INSTANCE = new com.openpositioning.PositionMe.Traj.Fingerprint(); } - public static Position_Sample getDefaultInstance() { + public static com.openpositioning.PositionMe.Traj.Fingerprint getDefaultInstance() { return DEFAULT_INSTANCE; } - private static final com.google.protobuf.Parser - PARSER = new com.google.protobuf.AbstractParser() { - public Position_Sample parsePartialFrom( - com.google.protobuf.CodedInputStream input, - com.google.protobuf.ExtensionRegistryLite extensionRegistry) - throws com.google.protobuf.InvalidProtocolBufferException { - return new Position_Sample(input, extensionRegistry); + private static final com.google.protobuf.Parser + PARSER = new com.google.protobuf.AbstractParser() { + @java.lang.Override + public Fingerprint parsePartialFrom( + com.google.protobuf.CodedInputStream input, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + Builder builder = newBuilder(); + try { + builder.mergeFrom(input, extensionRegistry); + } catch (com.google.protobuf.InvalidProtocolBufferException e) { + throw e.setUnfinishedMessage(builder.buildPartial()); + } catch (com.google.protobuf.UninitializedMessageException e) { + throw e.asInvalidProtocolBufferException().setUnfinishedMessage(builder.buildPartial()); + } catch (java.io.IOException e) { + throw new com.google.protobuf.InvalidProtocolBufferException(e) + .setUnfinishedMessage(builder.buildPartial()); + } + return builder.buildPartial(); } }; - public static com.google.protobuf.Parser parser() { + public static com.google.protobuf.Parser parser() { return PARSER; } - @Override - public com.google.protobuf.Parser getParserForType() { + @java.lang.Override + public com.google.protobuf.Parser getParserForType() { return PARSER; } - public Position_Sample getDefaultInstanceForType() { + @java.lang.Override + public com.openpositioning.PositionMe.Traj.Fingerprint getDefaultInstanceForType() { return DEFAULT_INSTANCE; } } - public interface Pressure_SampleOrBuilder extends - // @@protoc_insertion_point(interface_extends:Pressure_Sample) - com.google.protobuf.MessageOrBuilder { + public interface RFScanOrBuilder extends + // @@protoc_insertion_point(interface_extends:RFScan) + com.google.protobuf.MessageOrBuilder { /** - * optional int64 relative_timestamp = 1; + * int64 relative_timestamp = 1; + * @return The relativeTimestamp. */ long getRelativeTimestamp(); /** *
-     * mbar
+     * Integer encoding of the hex mac address (BSSID)
+     * e.g. 207394925843984
      * 
* - * optional float pressure = 2; + * int64 mac = 2; + * @return The mac. */ - float getPressure(); + long getMac(); + + /** + *
+     * rssi integer in dBm.
+     * typically between -120 and -10
+     * 
+ * + * int32 rssi = 3; + * @return The rssi. + */ + int getRssi(); + + /** + *
+     * returned position
+     * 
+ * + * optional .GNSSPosition position = 4; + * @return Whether the position field is set. + */ + boolean hasPosition(); + /** + *
+     * returned position
+     * 
+ * + * optional .GNSSPosition position = 4; + * @return The position. + */ + com.openpositioning.PositionMe.Traj.GNSSPosition getPosition(); + /** + *
+     * returned position
+     * 
+ * + * optional .GNSSPosition position = 4; + */ + com.openpositioning.PositionMe.Traj.GNSSPositionOrBuilder getPositionOrBuilder(); } /** - * Protobuf type {@code Pressure_Sample} + * Protobuf type {@code RFScan} */ - public static final class Pressure_Sample extends - com.google.protobuf.GeneratedMessageV3 implements - // @@protoc_insertion_point(message_implements:Pressure_Sample) - Pressure_SampleOrBuilder { - // Use Pressure_Sample.newBuilder() to construct. - private Pressure_Sample(com.google.protobuf.GeneratedMessageV3.Builder builder) { + public static final class RFScan extends + com.google.protobuf.GeneratedMessage implements + // @@protoc_insertion_point(message_implements:RFScan) + RFScanOrBuilder { + private static final long serialVersionUID = 0L; + static { + com.google.protobuf.RuntimeVersion.validateProtobufGencodeVersion( + com.google.protobuf.RuntimeVersion.RuntimeDomain.PUBLIC, + /* major= */ 4, + /* minor= */ 29, + /* patch= */ 6, + /* suffix= */ "", + RFScan.class.getName()); + } + // Use RFScan.newBuilder() to construct. + private RFScan(com.google.protobuf.GeneratedMessage.Builder builder) { super(builder); } - private Pressure_Sample() { - relativeTimestamp_ = 0L; - pressure_ = 0F; - } - - @Override - public final com.google.protobuf.UnknownFieldSet - getUnknownFields() { - return com.google.protobuf.UnknownFieldSet.getDefaultInstance(); - } - private Pressure_Sample( - com.google.protobuf.CodedInputStream input, - com.google.protobuf.ExtensionRegistryLite extensionRegistry) - throws com.google.protobuf.InvalidProtocolBufferException { - this(); - int mutable_bitField0_ = 0; - try { - boolean done = false; - while (!done) { - int tag = input.readTag(); - switch (tag) { - case 0: - done = true; - break; - default: { - if (!input.skipField(tag)) { - done = true; - } - break; - } - case 8: { - - relativeTimestamp_ = input.readInt64(); - break; - } - case 21: { - - pressure_ = input.readFloat(); - break; - } - } - } - } catch (com.google.protobuf.InvalidProtocolBufferException e) { - throw e.setUnfinishedMessage(this); - } catch (java.io.IOException e) { - throw new com.google.protobuf.InvalidProtocolBufferException( - e).setUnfinishedMessage(this); - } finally { - makeExtensionsImmutable(); - } + private RFScan() { } + public static final com.google.protobuf.Descriptors.Descriptor - getDescriptor() { - return Traj.internal_static_Pressure_Sample_descriptor; + getDescriptor() { + return com.openpositioning.PositionMe.Traj.internal_static_RFScan_descriptor; } - protected com.google.protobuf.GeneratedMessageV3.FieldAccessorTable - internalGetFieldAccessorTable() { - return Traj.internal_static_Pressure_Sample_fieldAccessorTable - .ensureFieldAccessorsInitialized( - Pressure_Sample.class, Builder.class); + @java.lang.Override + protected com.google.protobuf.GeneratedMessage.FieldAccessorTable + internalGetFieldAccessorTable() { + return com.openpositioning.PositionMe.Traj.internal_static_RFScan_fieldAccessorTable + .ensureFieldAccessorsInitialized( + com.openpositioning.PositionMe.Traj.RFScan.class, com.openpositioning.PositionMe.Traj.RFScan.Builder.class); } + private int bitField0_; public static final int RELATIVE_TIMESTAMP_FIELD_NUMBER = 1; - private long relativeTimestamp_; + private long relativeTimestamp_ = 0L; /** - * optional int64 relative_timestamp = 1; + * int64 relative_timestamp = 1; + * @return The relativeTimestamp. */ + @java.lang.Override public long getRelativeTimestamp() { return relativeTimestamp_; } - public static final int PRESSURE_FIELD_NUMBER = 2; - private float pressure_; + public static final int MAC_FIELD_NUMBER = 2; + private long mac_ = 0L; /** *
-     * mbar
+     * Integer encoding of the hex mac address (BSSID)
+     * e.g. 207394925843984
      * 
* - * optional float pressure = 2; + * int64 mac = 2; + * @return The mac. */ - public float getPressure() { - return pressure_; + @java.lang.Override + public long getMac() { + return mac_; + } + + public static final int RSSI_FIELD_NUMBER = 3; + private int rssi_ = 0; + /** + *
+     * rssi integer in dBm.
+     * typically between -120 and -10
+     * 
+ * + * int32 rssi = 3; + * @return The rssi. + */ + @java.lang.Override + public int getRssi() { + return rssi_; + } + + public static final int POSITION_FIELD_NUMBER = 4; + private com.openpositioning.PositionMe.Traj.GNSSPosition position_; + /** + *
+     * returned position
+     * 
+ * + * optional .GNSSPosition position = 4; + * @return Whether the position field is set. + */ + @java.lang.Override + public boolean hasPosition() { + return ((bitField0_ & 0x00000001) != 0); + } + /** + *
+     * returned position
+     * 
+ * + * optional .GNSSPosition position = 4; + * @return The position. + */ + @java.lang.Override + public com.openpositioning.PositionMe.Traj.GNSSPosition getPosition() { + return position_ == null ? com.openpositioning.PositionMe.Traj.GNSSPosition.getDefaultInstance() : position_; + } + /** + *
+     * returned position
+     * 
+ * + * optional .GNSSPosition position = 4; + */ + @java.lang.Override + public com.openpositioning.PositionMe.Traj.GNSSPositionOrBuilder getPositionOrBuilder() { + return position_ == null ? com.openpositioning.PositionMe.Traj.GNSSPosition.getDefaultInstance() : position_; } private byte memoizedIsInitialized = -1; + @java.lang.Override public final boolean isInitialized() { byte isInitialized = memoizedIsInitialized; if (isInitialized == 1) return true; @@ -7508,16 +15041,25 @@ public final boolean isInitialized() { return true; } + @java.lang.Override public void writeTo(com.google.protobuf.CodedOutputStream output) - throws java.io.IOException { + throws java.io.IOException { if (relativeTimestamp_ != 0L) { output.writeInt64(1, relativeTimestamp_); } - if (pressure_ != 0F) { - output.writeFloat(2, pressure_); + if (mac_ != 0L) { + output.writeInt64(2, mac_); + } + if (rssi_ != 0) { + output.writeInt32(3, rssi_); + } + if (((bitField0_ & 0x00000001) != 0)) { + output.writeMessage(4, getPosition()); } + getUnknownFields().writeTo(output); } + @java.lang.Override public int getSerializedSize() { int size = memoizedSize; if (size != -1) return size; @@ -7525,496 +15067,853 @@ public int getSerializedSize() { size = 0; if (relativeTimestamp_ != 0L) { size += com.google.protobuf.CodedOutputStream - .computeInt64Size(1, relativeTimestamp_); + .computeInt64Size(1, relativeTimestamp_); + } + if (mac_ != 0L) { + size += com.google.protobuf.CodedOutputStream + .computeInt64Size(2, mac_); + } + if (rssi_ != 0) { + size += com.google.protobuf.CodedOutputStream + .computeInt32Size(3, rssi_); } - if (pressure_ != 0F) { + if (((bitField0_ & 0x00000001) != 0)) { size += com.google.protobuf.CodedOutputStream - .computeFloatSize(2, pressure_); + .computeMessageSize(4, getPosition()); } + size += getUnknownFields().getSerializedSize(); memoizedSize = size; return size; } - private static final long serialVersionUID = 0L; - @Override - public boolean equals(final Object obj) { + @java.lang.Override + public boolean equals(final java.lang.Object obj) { if (obj == this) { - return true; + return true; } - if (!(obj instanceof Pressure_Sample)) { + if (!(obj instanceof com.openpositioning.PositionMe.Traj.RFScan)) { return super.equals(obj); } - Pressure_Sample other = (Pressure_Sample) obj; + com.openpositioning.PositionMe.Traj.RFScan other = (com.openpositioning.PositionMe.Traj.RFScan) obj; - boolean result = true; - result = result && (getRelativeTimestamp() - == other.getRelativeTimestamp()); - result = result && ( - Float.floatToIntBits(getPressure()) - == Float.floatToIntBits( - other.getPressure())); - return result; + if (getRelativeTimestamp() + != other.getRelativeTimestamp()) return false; + if (getMac() + != other.getMac()) return false; + if (getRssi() + != other.getRssi()) return false; + if (hasPosition() != other.hasPosition()) return false; + if (hasPosition()) { + if (!getPosition() + .equals(other.getPosition())) return false; + } + if (!getUnknownFields().equals(other.getUnknownFields())) return false; + return true; } - @Override + @java.lang.Override public int hashCode() { if (memoizedHashCode != 0) { return memoizedHashCode; } int hash = 41; - hash = (19 * hash) + getDescriptorForType().hashCode(); + hash = (19 * hash) + getDescriptor().hashCode(); hash = (37 * hash) + RELATIVE_TIMESTAMP_FIELD_NUMBER; hash = (53 * hash) + com.google.protobuf.Internal.hashLong( - getRelativeTimestamp()); - hash = (37 * hash) + PRESSURE_FIELD_NUMBER; - hash = (53 * hash) + Float.floatToIntBits( - getPressure()); - hash = (29 * hash) + unknownFields.hashCode(); + getRelativeTimestamp()); + hash = (37 * hash) + MAC_FIELD_NUMBER; + hash = (53 * hash) + com.google.protobuf.Internal.hashLong( + getMac()); + hash = (37 * hash) + RSSI_FIELD_NUMBER; + hash = (53 * hash) + getRssi(); + if (hasPosition()) { + hash = (37 * hash) + POSITION_FIELD_NUMBER; + hash = (53 * hash) + getPosition().hashCode(); + } + hash = (29 * hash) + getUnknownFields().hashCode(); memoizedHashCode = hash; return hash; } - public static Pressure_Sample parseFrom( - com.google.protobuf.ByteString data) - throws com.google.protobuf.InvalidProtocolBufferException { + public static com.openpositioning.PositionMe.Traj.RFScan parseFrom( + java.nio.ByteBuffer data) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + public static com.openpositioning.PositionMe.Traj.RFScan parseFrom( + java.nio.ByteBuffer data, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data, extensionRegistry); + } + public static com.openpositioning.PositionMe.Traj.RFScan parseFrom( + com.google.protobuf.ByteString data) + throws com.google.protobuf.InvalidProtocolBufferException { return PARSER.parseFrom(data); } - public static Pressure_Sample parseFrom( - com.google.protobuf.ByteString data, - com.google.protobuf.ExtensionRegistryLite extensionRegistry) - throws com.google.protobuf.InvalidProtocolBufferException { + public static com.openpositioning.PositionMe.Traj.RFScan parseFrom( + com.google.protobuf.ByteString data, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { return PARSER.parseFrom(data, extensionRegistry); } - public static Pressure_Sample parseFrom(byte[] data) - throws com.google.protobuf.InvalidProtocolBufferException { + public static com.openpositioning.PositionMe.Traj.RFScan parseFrom(byte[] data) + throws com.google.protobuf.InvalidProtocolBufferException { return PARSER.parseFrom(data); } - public static Pressure_Sample parseFrom( - byte[] data, - com.google.protobuf.ExtensionRegistryLite extensionRegistry) - throws com.google.protobuf.InvalidProtocolBufferException { + public static com.openpositioning.PositionMe.Traj.RFScan parseFrom( + byte[] data, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { return PARSER.parseFrom(data, extensionRegistry); } - public static Pressure_Sample parseFrom(java.io.InputStream input) - throws java.io.IOException { - return com.google.protobuf.GeneratedMessageV3 - .parseWithIOException(PARSER, input); - } - public static Pressure_Sample parseFrom( - java.io.InputStream input, - com.google.protobuf.ExtensionRegistryLite extensionRegistry) - throws java.io.IOException { - return com.google.protobuf.GeneratedMessageV3 - .parseWithIOException(PARSER, input, extensionRegistry); - } - public static Pressure_Sample parseDelimitedFrom(java.io.InputStream input) - throws java.io.IOException { - return com.google.protobuf.GeneratedMessageV3 - .parseDelimitedWithIOException(PARSER, input); - } - public static Pressure_Sample parseDelimitedFrom( - java.io.InputStream input, - com.google.protobuf.ExtensionRegistryLite extensionRegistry) - throws java.io.IOException { - return com.google.protobuf.GeneratedMessageV3 - .parseDelimitedWithIOException(PARSER, input, extensionRegistry); - } - public static Pressure_Sample parseFrom( - com.google.protobuf.CodedInputStream input) - throws java.io.IOException { - return com.google.protobuf.GeneratedMessageV3 - .parseWithIOException(PARSER, input); - } - public static Pressure_Sample parseFrom( - com.google.protobuf.CodedInputStream input, - com.google.protobuf.ExtensionRegistryLite extensionRegistry) - throws java.io.IOException { - return com.google.protobuf.GeneratedMessageV3 - .parseWithIOException(PARSER, input, extensionRegistry); + public static com.openpositioning.PositionMe.Traj.RFScan parseFrom(java.io.InputStream input) + throws java.io.IOException { + return com.google.protobuf.GeneratedMessage + .parseWithIOException(PARSER, input); + } + public static com.openpositioning.PositionMe.Traj.RFScan parseFrom( + java.io.InputStream input, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws java.io.IOException { + return com.google.protobuf.GeneratedMessage + .parseWithIOException(PARSER, input, extensionRegistry); + } + + public static com.openpositioning.PositionMe.Traj.RFScan parseDelimitedFrom(java.io.InputStream input) + throws java.io.IOException { + return com.google.protobuf.GeneratedMessage + .parseDelimitedWithIOException(PARSER, input); + } + + public static com.openpositioning.PositionMe.Traj.RFScan parseDelimitedFrom( + java.io.InputStream input, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws java.io.IOException { + return com.google.protobuf.GeneratedMessage + .parseDelimitedWithIOException(PARSER, input, extensionRegistry); + } + public static com.openpositioning.PositionMe.Traj.RFScan parseFrom( + com.google.protobuf.CodedInputStream input) + throws java.io.IOException { + return com.google.protobuf.GeneratedMessage + .parseWithIOException(PARSER, input); + } + public static com.openpositioning.PositionMe.Traj.RFScan parseFrom( + com.google.protobuf.CodedInputStream input, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws java.io.IOException { + return com.google.protobuf.GeneratedMessage + .parseWithIOException(PARSER, input, extensionRegistry); } + @java.lang.Override public Builder newBuilderForType() { return newBuilder(); } public static Builder newBuilder() { return DEFAULT_INSTANCE.toBuilder(); } - public static Builder newBuilder(Pressure_Sample prototype) { + public static Builder newBuilder(com.openpositioning.PositionMe.Traj.RFScan prototype) { return DEFAULT_INSTANCE.toBuilder().mergeFrom(prototype); } + @java.lang.Override public Builder toBuilder() { return this == DEFAULT_INSTANCE - ? new Builder() : new Builder().mergeFrom(this); + ? new Builder() : new Builder().mergeFrom(this); } - @Override + @java.lang.Override protected Builder newBuilderForType( - com.google.protobuf.GeneratedMessageV3.BuilderParent parent) { + com.google.protobuf.GeneratedMessage.BuilderParent parent) { Builder builder = new Builder(parent); return builder; } /** - * Protobuf type {@code Pressure_Sample} + * Protobuf type {@code RFScan} */ public static final class Builder extends - com.google.protobuf.GeneratedMessageV3.Builder implements - // @@protoc_insertion_point(builder_implements:Pressure_Sample) - Pressure_SampleOrBuilder { + com.google.protobuf.GeneratedMessage.Builder implements + // @@protoc_insertion_point(builder_implements:RFScan) + com.openpositioning.PositionMe.Traj.RFScanOrBuilder { public static final com.google.protobuf.Descriptors.Descriptor - getDescriptor() { - return Traj.internal_static_Pressure_Sample_descriptor; + getDescriptor() { + return com.openpositioning.PositionMe.Traj.internal_static_RFScan_descriptor; } - protected com.google.protobuf.GeneratedMessageV3.FieldAccessorTable - internalGetFieldAccessorTable() { - return Traj.internal_static_Pressure_Sample_fieldAccessorTable - .ensureFieldAccessorsInitialized( - Pressure_Sample.class, Builder.class); + @java.lang.Override + protected com.google.protobuf.GeneratedMessage.FieldAccessorTable + internalGetFieldAccessorTable() { + return com.openpositioning.PositionMe.Traj.internal_static_RFScan_fieldAccessorTable + .ensureFieldAccessorsInitialized( + com.openpositioning.PositionMe.Traj.RFScan.class, com.openpositioning.PositionMe.Traj.RFScan.Builder.class); } - // Construct using Traj.Pressure_Sample.newBuilder() + // Construct using com.openpositioning.PositionMe.Traj.RFScan.newBuilder() private Builder() { maybeForceBuilderInitialization(); } private Builder( - com.google.protobuf.GeneratedMessageV3.BuilderParent parent) { + com.google.protobuf.GeneratedMessage.BuilderParent parent) { super(parent); maybeForceBuilderInitialization(); } private void maybeForceBuilderInitialization() { - if (com.google.protobuf.GeneratedMessageV3 + if (com.google.protobuf.GeneratedMessage .alwaysUseFieldBuilders) { + getPositionFieldBuilder(); } } + @java.lang.Override public Builder clear() { super.clear(); + bitField0_ = 0; relativeTimestamp_ = 0L; - - pressure_ = 0F; - + mac_ = 0L; + rssi_ = 0; + position_ = null; + if (positionBuilder_ != null) { + positionBuilder_.dispose(); + positionBuilder_ = null; + } return this; } + @java.lang.Override public com.google.protobuf.Descriptors.Descriptor - getDescriptorForType() { - return Traj.internal_static_Pressure_Sample_descriptor; + getDescriptorForType() { + return com.openpositioning.PositionMe.Traj.internal_static_RFScan_descriptor; } - public Pressure_Sample getDefaultInstanceForType() { - return Pressure_Sample.getDefaultInstance(); + @java.lang.Override + public com.openpositioning.PositionMe.Traj.RFScan getDefaultInstanceForType() { + return com.openpositioning.PositionMe.Traj.RFScan.getDefaultInstance(); } - public Pressure_Sample build() { - Pressure_Sample result = buildPartial(); + @java.lang.Override + public com.openpositioning.PositionMe.Traj.RFScan build() { + com.openpositioning.PositionMe.Traj.RFScan result = buildPartial(); if (!result.isInitialized()) { throw newUninitializedMessageException(result); } return result; } - public Pressure_Sample buildPartial() { - Pressure_Sample result = new Pressure_Sample(this); - result.relativeTimestamp_ = relativeTimestamp_; - result.pressure_ = pressure_; + @java.lang.Override + public com.openpositioning.PositionMe.Traj.RFScan buildPartial() { + com.openpositioning.PositionMe.Traj.RFScan result = new com.openpositioning.PositionMe.Traj.RFScan(this); + if (bitField0_ != 0) { buildPartial0(result); } onBuilt(); return result; } - public Builder clone() { - return (Builder) super.clone(); - } - public Builder setField( - com.google.protobuf.Descriptors.FieldDescriptor field, - Object value) { - return (Builder) super.setField(field, value); - } - public Builder clearField( - com.google.protobuf.Descriptors.FieldDescriptor field) { - return (Builder) super.clearField(field); - } - public Builder clearOneof( - com.google.protobuf.Descriptors.OneofDescriptor oneof) { - return (Builder) super.clearOneof(oneof); - } - public Builder setRepeatedField( - com.google.protobuf.Descriptors.FieldDescriptor field, - int index, Object value) { - return (Builder) super.setRepeatedField(field, index, value); - } - public Builder addRepeatedField( - com.google.protobuf.Descriptors.FieldDescriptor field, - Object value) { - return (Builder) super.addRepeatedField(field, value); + private void buildPartial0(com.openpositioning.PositionMe.Traj.RFScan result) { + int from_bitField0_ = bitField0_; + if (((from_bitField0_ & 0x00000001) != 0)) { + result.relativeTimestamp_ = relativeTimestamp_; + } + if (((from_bitField0_ & 0x00000002) != 0)) { + result.mac_ = mac_; + } + if (((from_bitField0_ & 0x00000004) != 0)) { + result.rssi_ = rssi_; + } + int to_bitField0_ = 0; + if (((from_bitField0_ & 0x00000008) != 0)) { + result.position_ = positionBuilder_ == null + ? position_ + : positionBuilder_.build(); + to_bitField0_ |= 0x00000001; + } + result.bitField0_ |= to_bitField0_; } + + @java.lang.Override public Builder mergeFrom(com.google.protobuf.Message other) { - if (other instanceof Pressure_Sample) { - return mergeFrom((Pressure_Sample)other); + if (other instanceof com.openpositioning.PositionMe.Traj.RFScan) { + return mergeFrom((com.openpositioning.PositionMe.Traj.RFScan)other); } else { super.mergeFrom(other); return this; } } - public Builder mergeFrom(Pressure_Sample other) { - if (other == Pressure_Sample.getDefaultInstance()) return this; + public Builder mergeFrom(com.openpositioning.PositionMe.Traj.RFScan other) { + if (other == com.openpositioning.PositionMe.Traj.RFScan.getDefaultInstance()) return this; if (other.getRelativeTimestamp() != 0L) { setRelativeTimestamp(other.getRelativeTimestamp()); } - if (other.getPressure() != 0F) { - setPressure(other.getPressure()); + if (other.getMac() != 0L) { + setMac(other.getMac()); } + if (other.getRssi() != 0) { + setRssi(other.getRssi()); + } + if (other.hasPosition()) { + mergePosition(other.getPosition()); + } + this.mergeUnknownFields(other.getUnknownFields()); onChanged(); return this; } + @java.lang.Override public final boolean isInitialized() { return true; } + @java.lang.Override public Builder mergeFrom( - com.google.protobuf.CodedInputStream input, - com.google.protobuf.ExtensionRegistryLite extensionRegistry) - throws java.io.IOException { - Pressure_Sample parsedMessage = null; + com.google.protobuf.CodedInputStream input, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws java.io.IOException { + if (extensionRegistry == null) { + throw new java.lang.NullPointerException(); + } try { - parsedMessage = PARSER.parsePartialFrom(input, extensionRegistry); + boolean done = false; + while (!done) { + int tag = input.readTag(); + switch (tag) { + case 0: + done = true; + break; + case 8: { + relativeTimestamp_ = input.readInt64(); + bitField0_ |= 0x00000001; + break; + } // case 8 + case 16: { + mac_ = input.readInt64(); + bitField0_ |= 0x00000002; + break; + } // case 16 + case 24: { + rssi_ = input.readInt32(); + bitField0_ |= 0x00000004; + break; + } // case 24 + case 34: { + input.readMessage( + getPositionFieldBuilder().getBuilder(), + extensionRegistry); + bitField0_ |= 0x00000008; + break; + } // case 34 + default: { + if (!super.parseUnknownField(input, extensionRegistry, tag)) { + done = true; // was an endgroup tag + } + break; + } // default: + } // switch (tag) + } // while (!done) } catch (com.google.protobuf.InvalidProtocolBufferException e) { - parsedMessage = (Pressure_Sample) e.getUnfinishedMessage(); throw e.unwrapIOException(); } finally { - if (parsedMessage != null) { - mergeFrom(parsedMessage); - } - } + onChanged(); + } // finally return this; } + private int bitField0_; private long relativeTimestamp_ ; /** - * optional int64 relative_timestamp = 1; + * int64 relative_timestamp = 1; + * @return The relativeTimestamp. */ + @java.lang.Override public long getRelativeTimestamp() { return relativeTimestamp_; } /** - * optional int64 relative_timestamp = 1; + * int64 relative_timestamp = 1; + * @param value The relativeTimestamp to set. + * @return This builder for chaining. */ public Builder setRelativeTimestamp(long value) { - + relativeTimestamp_ = value; + bitField0_ |= 0x00000001; onChanged(); return this; } /** - * optional int64 relative_timestamp = 1; + * int64 relative_timestamp = 1; + * @return This builder for chaining. */ public Builder clearRelativeTimestamp() { - + bitField0_ = (bitField0_ & ~0x00000001); relativeTimestamp_ = 0L; onChanged(); return this; } - private float pressure_ ; + private long mac_ ; /** *
-       * mbar
+       * Integer encoding of the hex mac address (BSSID)
+       * e.g. 207394925843984
        * 
* - * optional float pressure = 2; + * int64 mac = 2; + * @return The mac. */ - public float getPressure() { - return pressure_; + @java.lang.Override + public long getMac() { + return mac_; } /** *
-       * mbar
+       * Integer encoding of the hex mac address (BSSID)
+       * e.g. 207394925843984
        * 
* - * optional float pressure = 2; + * int64 mac = 2; + * @param value The mac to set. + * @return This builder for chaining. */ - public Builder setPressure(float value) { - - pressure_ = value; + public Builder setMac(long value) { + + mac_ = value; + bitField0_ |= 0x00000002; onChanged(); return this; } /** *
-       * mbar
+       * Integer encoding of the hex mac address (BSSID)
+       * e.g. 207394925843984
        * 
* - * optional float pressure = 2; + * int64 mac = 2; + * @return This builder for chaining. */ - public Builder clearPressure() { - - pressure_ = 0F; + public Builder clearMac() { + bitField0_ = (bitField0_ & ~0x00000002); + mac_ = 0L; onChanged(); return this; } - public final Builder setUnknownFields( - final com.google.protobuf.UnknownFieldSet unknownFields) { - return this; + + private int rssi_ ; + /** + *
+       * rssi integer in dBm.
+       * typically between -120 and -10
+       * 
+ * + * int32 rssi = 3; + * @return The rssi. + */ + @java.lang.Override + public int getRssi() { + return rssi_; } + /** + *
+       * rssi integer in dBm.
+       * typically between -120 and -10
+       * 
+ * + * int32 rssi = 3; + * @param value The rssi to set. + * @return This builder for chaining. + */ + public Builder setRssi(int value) { - public final Builder mergeUnknownFields( - final com.google.protobuf.UnknownFieldSet unknownFields) { + rssi_ = value; + bitField0_ |= 0x00000004; + onChanged(); + return this; + } + /** + *
+       * rssi integer in dBm.
+       * typically between -120 and -10
+       * 
+ * + * int32 rssi = 3; + * @return This builder for chaining. + */ + public Builder clearRssi() { + bitField0_ = (bitField0_ & ~0x00000004); + rssi_ = 0; + onChanged(); return this; } + private com.openpositioning.PositionMe.Traj.GNSSPosition position_; + private com.google.protobuf.SingleFieldBuilder< + com.openpositioning.PositionMe.Traj.GNSSPosition, com.openpositioning.PositionMe.Traj.GNSSPosition.Builder, com.openpositioning.PositionMe.Traj.GNSSPositionOrBuilder> positionBuilder_; + /** + *
+       * returned position
+       * 
+ * + * optional .GNSSPosition position = 4; + * @return Whether the position field is set. + */ + public boolean hasPosition() { + return ((bitField0_ & 0x00000008) != 0); + } + /** + *
+       * returned position
+       * 
+ * + * optional .GNSSPosition position = 4; + * @return The position. + */ + public com.openpositioning.PositionMe.Traj.GNSSPosition getPosition() { + if (positionBuilder_ == null) { + return position_ == null ? com.openpositioning.PositionMe.Traj.GNSSPosition.getDefaultInstance() : position_; + } else { + return positionBuilder_.getMessage(); + } + } + /** + *
+       * returned position
+       * 
+ * + * optional .GNSSPosition position = 4; + */ + public Builder setPosition(com.openpositioning.PositionMe.Traj.GNSSPosition value) { + if (positionBuilder_ == null) { + if (value == null) { + throw new NullPointerException(); + } + position_ = value; + } else { + positionBuilder_.setMessage(value); + } + bitField0_ |= 0x00000008; + onChanged(); + return this; + } + /** + *
+       * returned position
+       * 
+ * + * optional .GNSSPosition position = 4; + */ + public Builder setPosition( + com.openpositioning.PositionMe.Traj.GNSSPosition.Builder builderForValue) { + if (positionBuilder_ == null) { + position_ = builderForValue.build(); + } else { + positionBuilder_.setMessage(builderForValue.build()); + } + bitField0_ |= 0x00000008; + onChanged(); + return this; + } + /** + *
+       * returned position
+       * 
+ * + * optional .GNSSPosition position = 4; + */ + public Builder mergePosition(com.openpositioning.PositionMe.Traj.GNSSPosition value) { + if (positionBuilder_ == null) { + if (((bitField0_ & 0x00000008) != 0) && + position_ != null && + position_ != com.openpositioning.PositionMe.Traj.GNSSPosition.getDefaultInstance()) { + getPositionBuilder().mergeFrom(value); + } else { + position_ = value; + } + } else { + positionBuilder_.mergeFrom(value); + } + if (position_ != null) { + bitField0_ |= 0x00000008; + onChanged(); + } + return this; + } + /** + *
+       * returned position
+       * 
+ * + * optional .GNSSPosition position = 4; + */ + public Builder clearPosition() { + bitField0_ = (bitField0_ & ~0x00000008); + position_ = null; + if (positionBuilder_ != null) { + positionBuilder_.dispose(); + positionBuilder_ = null; + } + onChanged(); + return this; + } + /** + *
+       * returned position
+       * 
+ * + * optional .GNSSPosition position = 4; + */ + public com.openpositioning.PositionMe.Traj.GNSSPosition.Builder getPositionBuilder() { + bitField0_ |= 0x00000008; + onChanged(); + return getPositionFieldBuilder().getBuilder(); + } + /** + *
+       * returned position
+       * 
+ * + * optional .GNSSPosition position = 4; + */ + public com.openpositioning.PositionMe.Traj.GNSSPositionOrBuilder getPositionOrBuilder() { + if (positionBuilder_ != null) { + return positionBuilder_.getMessageOrBuilder(); + } else { + return position_ == null ? + com.openpositioning.PositionMe.Traj.GNSSPosition.getDefaultInstance() : position_; + } + } + /** + *
+       * returned position
+       * 
+ * + * optional .GNSSPosition position = 4; + */ + private com.google.protobuf.SingleFieldBuilder< + com.openpositioning.PositionMe.Traj.GNSSPosition, com.openpositioning.PositionMe.Traj.GNSSPosition.Builder, com.openpositioning.PositionMe.Traj.GNSSPositionOrBuilder> + getPositionFieldBuilder() { + if (positionBuilder_ == null) { + positionBuilder_ = new com.google.protobuf.SingleFieldBuilder< + com.openpositioning.PositionMe.Traj.GNSSPosition, com.openpositioning.PositionMe.Traj.GNSSPosition.Builder, com.openpositioning.PositionMe.Traj.GNSSPositionOrBuilder>( + getPosition(), + getParentForChildren(), + isClean()); + position_ = null; + } + return positionBuilder_; + } - // @@protoc_insertion_point(builder_scope:Pressure_Sample) + // @@protoc_insertion_point(builder_scope:RFScan) } - // @@protoc_insertion_point(class_scope:Pressure_Sample) - private static final Pressure_Sample DEFAULT_INSTANCE; + // @@protoc_insertion_point(class_scope:RFScan) + private static final com.openpositioning.PositionMe.Traj.RFScan DEFAULT_INSTANCE; static { - DEFAULT_INSTANCE = new Pressure_Sample(); + DEFAULT_INSTANCE = new com.openpositioning.PositionMe.Traj.RFScan(); } - public static Pressure_Sample getDefaultInstance() { + public static com.openpositioning.PositionMe.Traj.RFScan getDefaultInstance() { return DEFAULT_INSTANCE; } - private static final com.google.protobuf.Parser - PARSER = new com.google.protobuf.AbstractParser() { - public Pressure_Sample parsePartialFrom( - com.google.protobuf.CodedInputStream input, - com.google.protobuf.ExtensionRegistryLite extensionRegistry) - throws com.google.protobuf.InvalidProtocolBufferException { - return new Pressure_Sample(input, extensionRegistry); + private static final com.google.protobuf.Parser + PARSER = new com.google.protobuf.AbstractParser() { + @java.lang.Override + public RFScan parsePartialFrom( + com.google.protobuf.CodedInputStream input, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + Builder builder = newBuilder(); + try { + builder.mergeFrom(input, extensionRegistry); + } catch (com.google.protobuf.InvalidProtocolBufferException e) { + throw e.setUnfinishedMessage(builder.buildPartial()); + } catch (com.google.protobuf.UninitializedMessageException e) { + throw e.asInvalidProtocolBufferException().setUnfinishedMessage(builder.buildPartial()); + } catch (java.io.IOException e) { + throw new com.google.protobuf.InvalidProtocolBufferException(e) + .setUnfinishedMessage(builder.buildPartial()); + } + return builder.buildPartial(); } }; - public static com.google.protobuf.Parser parser() { + public static com.google.protobuf.Parser parser() { return PARSER; } - @Override - public com.google.protobuf.Parser getParserForType() { + @java.lang.Override + public com.google.protobuf.Parser getParserForType() { return PARSER; } - public Pressure_Sample getDefaultInstanceForType() { + @java.lang.Override + public com.openpositioning.PositionMe.Traj.RFScan getDefaultInstanceForType() { return DEFAULT_INSTANCE; } } - public interface Light_SampleOrBuilder extends - // @@protoc_insertion_point(interface_extends:Light_Sample) - com.google.protobuf.MessageOrBuilder { + public interface WiFiRTTReadingOrBuilder extends + // @@protoc_insertion_point(interface_extends:WiFiRTTReading) + com.google.protobuf.MessageOrBuilder { /** - * optional int64 relative_timestamp = 1; + * int64 relative_timestamp = 1; + * @return The relativeTimestamp. */ long getRelativeTimestamp(); /** *
-     * lux
+     * Integer encoding of the hex mac address (BSSID)
+     * e.g. 207394925843984
      * 
* - * optional float light = 2; + * int64 mac = 2; + * @return The mac. */ - float getLight(); + long getMac(); + + /** + *
+     * in mm
+     * 
+ * + * float distance = 3; + * @return The distance. + */ + float getDistance(); + + /** + *
+     * in mm
+     * 
+ * + * float distance_std = 4; + * @return The distanceStd. + */ + float getDistanceStd(); + + /** + *
+     * rssi integer in dBm.
+     * typically between -120 and -10
+     * 
+ * + * int32 rssi = 5; + * @return The rssi. + */ + int getRssi(); } /** - * Protobuf type {@code Light_Sample} + * Protobuf type {@code WiFiRTTReading} */ - public static final class Light_Sample extends - com.google.protobuf.GeneratedMessageV3 implements - // @@protoc_insertion_point(message_implements:Light_Sample) - Light_SampleOrBuilder { - // Use Light_Sample.newBuilder() to construct. - private Light_Sample(com.google.protobuf.GeneratedMessageV3.Builder builder) { + public static final class WiFiRTTReading extends + com.google.protobuf.GeneratedMessage implements + // @@protoc_insertion_point(message_implements:WiFiRTTReading) + WiFiRTTReadingOrBuilder { + private static final long serialVersionUID = 0L; + static { + com.google.protobuf.RuntimeVersion.validateProtobufGencodeVersion( + com.google.protobuf.RuntimeVersion.RuntimeDomain.PUBLIC, + /* major= */ 4, + /* minor= */ 29, + /* patch= */ 6, + /* suffix= */ "", + WiFiRTTReading.class.getName()); + } + // Use WiFiRTTReading.newBuilder() to construct. + private WiFiRTTReading(com.google.protobuf.GeneratedMessage.Builder builder) { super(builder); } - private Light_Sample() { - relativeTimestamp_ = 0L; - light_ = 0F; - } - - @Override - public final com.google.protobuf.UnknownFieldSet - getUnknownFields() { - return com.google.protobuf.UnknownFieldSet.getDefaultInstance(); - } - private Light_Sample( - com.google.protobuf.CodedInputStream input, - com.google.protobuf.ExtensionRegistryLite extensionRegistry) - throws com.google.protobuf.InvalidProtocolBufferException { - this(); - int mutable_bitField0_ = 0; - try { - boolean done = false; - while (!done) { - int tag = input.readTag(); - switch (tag) { - case 0: - done = true; - break; - default: { - if (!input.skipField(tag)) { - done = true; - } - break; - } - case 8: { - - relativeTimestamp_ = input.readInt64(); - break; - } - case 21: { - - light_ = input.readFloat(); - break; - } - } - } - } catch (com.google.protobuf.InvalidProtocolBufferException e) { - throw e.setUnfinishedMessage(this); - } catch (java.io.IOException e) { - throw new com.google.protobuf.InvalidProtocolBufferException( - e).setUnfinishedMessage(this); - } finally { - makeExtensionsImmutable(); - } + private WiFiRTTReading() { } + public static final com.google.protobuf.Descriptors.Descriptor - getDescriptor() { - return Traj.internal_static_Light_Sample_descriptor; + getDescriptor() { + return com.openpositioning.PositionMe.Traj.internal_static_WiFiRTTReading_descriptor; } - protected com.google.protobuf.GeneratedMessageV3.FieldAccessorTable - internalGetFieldAccessorTable() { - return Traj.internal_static_Light_Sample_fieldAccessorTable - .ensureFieldAccessorsInitialized( - Light_Sample.class, Builder.class); + @java.lang.Override + protected com.google.protobuf.GeneratedMessage.FieldAccessorTable + internalGetFieldAccessorTable() { + return com.openpositioning.PositionMe.Traj.internal_static_WiFiRTTReading_fieldAccessorTable + .ensureFieldAccessorsInitialized( + com.openpositioning.PositionMe.Traj.WiFiRTTReading.class, com.openpositioning.PositionMe.Traj.WiFiRTTReading.Builder.class); } public static final int RELATIVE_TIMESTAMP_FIELD_NUMBER = 1; - private long relativeTimestamp_; + private long relativeTimestamp_ = 0L; /** - * optional int64 relative_timestamp = 1; + * int64 relative_timestamp = 1; + * @return The relativeTimestamp. */ + @java.lang.Override public long getRelativeTimestamp() { return relativeTimestamp_; } - public static final int LIGHT_FIELD_NUMBER = 2; - private float light_; + public static final int MAC_FIELD_NUMBER = 2; + private long mac_ = 0L; /** *
-     * lux
+     * Integer encoding of the hex mac address (BSSID)
+     * e.g. 207394925843984
      * 
* - * optional float light = 2; + * int64 mac = 2; + * @return The mac. */ - public float getLight() { - return light_; + @java.lang.Override + public long getMac() { + return mac_; + } + + public static final int DISTANCE_FIELD_NUMBER = 3; + private float distance_ = 0F; + /** + *
+     * in mm
+     * 
+ * + * float distance = 3; + * @return The distance. + */ + @java.lang.Override + public float getDistance() { + return distance_; + } + + public static final int DISTANCE_STD_FIELD_NUMBER = 4; + private float distanceStd_ = 0F; + /** + *
+     * in mm
+     * 
+ * + * float distance_std = 4; + * @return The distanceStd. + */ + @java.lang.Override + public float getDistanceStd() { + return distanceStd_; + } + + public static final int RSSI_FIELD_NUMBER = 5; + private int rssi_ = 0; + /** + *
+     * rssi integer in dBm.
+     * typically between -120 and -10
+     * 
+ * + * int32 rssi = 5; + * @return The rssi. + */ + @java.lang.Override + public int getRssi() { + return rssi_; } private byte memoizedIsInitialized = -1; + @java.lang.Override public final boolean isInitialized() { byte isInitialized = memoizedIsInitialized; if (isInitialized == 1) return true; @@ -8024,16 +15923,28 @@ public final boolean isInitialized() { return true; } + @java.lang.Override public void writeTo(com.google.protobuf.CodedOutputStream output) - throws java.io.IOException { + throws java.io.IOException { if (relativeTimestamp_ != 0L) { output.writeInt64(1, relativeTimestamp_); } - if (light_ != 0F) { - output.writeFloat(2, light_); + if (mac_ != 0L) { + output.writeInt64(2, mac_); } + if (java.lang.Float.floatToRawIntBits(distance_) != 0) { + output.writeFloat(3, distance_); + } + if (java.lang.Float.floatToRawIntBits(distanceStd_) != 0) { + output.writeFloat(4, distanceStd_); + } + if (rssi_ != 0) { + output.writeInt32(5, rssi_); + } + getUnknownFields().writeTo(output); } + @java.lang.Override public int getSerializedSize() { int size = memoizedSize; if (size != -1) return size; @@ -8041,677 +15952,810 @@ public int getSerializedSize() { size = 0; if (relativeTimestamp_ != 0L) { size += com.google.protobuf.CodedOutputStream - .computeInt64Size(1, relativeTimestamp_); + .computeInt64Size(1, relativeTimestamp_); + } + if (mac_ != 0L) { + size += com.google.protobuf.CodedOutputStream + .computeInt64Size(2, mac_); + } + if (java.lang.Float.floatToRawIntBits(distance_) != 0) { + size += com.google.protobuf.CodedOutputStream + .computeFloatSize(3, distance_); + } + if (java.lang.Float.floatToRawIntBits(distanceStd_) != 0) { + size += com.google.protobuf.CodedOutputStream + .computeFloatSize(4, distanceStd_); } - if (light_ != 0F) { + if (rssi_ != 0) { size += com.google.protobuf.CodedOutputStream - .computeFloatSize(2, light_); + .computeInt32Size(5, rssi_); } + size += getUnknownFields().getSerializedSize(); memoizedSize = size; return size; } - private static final long serialVersionUID = 0L; - @Override - public boolean equals(final Object obj) { + @java.lang.Override + public boolean equals(final java.lang.Object obj) { if (obj == this) { - return true; + return true; } - if (!(obj instanceof Light_Sample)) { + if (!(obj instanceof com.openpositioning.PositionMe.Traj.WiFiRTTReading)) { return super.equals(obj); } - Light_Sample other = (Light_Sample) obj; - - boolean result = true; - result = result && (getRelativeTimestamp() - == other.getRelativeTimestamp()); - result = result && ( - Float.floatToIntBits(getLight()) - == Float.floatToIntBits( - other.getLight())); - return result; + com.openpositioning.PositionMe.Traj.WiFiRTTReading other = (com.openpositioning.PositionMe.Traj.WiFiRTTReading) obj; + + if (getRelativeTimestamp() + != other.getRelativeTimestamp()) return false; + if (getMac() + != other.getMac()) return false; + if (java.lang.Float.floatToIntBits(getDistance()) + != java.lang.Float.floatToIntBits( + other.getDistance())) return false; + if (java.lang.Float.floatToIntBits(getDistanceStd()) + != java.lang.Float.floatToIntBits( + other.getDistanceStd())) return false; + if (getRssi() + != other.getRssi()) return false; + if (!getUnknownFields().equals(other.getUnknownFields())) return false; + return true; } - @Override + @java.lang.Override public int hashCode() { if (memoizedHashCode != 0) { return memoizedHashCode; } int hash = 41; - hash = (19 * hash) + getDescriptorForType().hashCode(); + hash = (19 * hash) + getDescriptor().hashCode(); hash = (37 * hash) + RELATIVE_TIMESTAMP_FIELD_NUMBER; hash = (53 * hash) + com.google.protobuf.Internal.hashLong( - getRelativeTimestamp()); - hash = (37 * hash) + LIGHT_FIELD_NUMBER; - hash = (53 * hash) + Float.floatToIntBits( - getLight()); - hash = (29 * hash) + unknownFields.hashCode(); + getRelativeTimestamp()); + hash = (37 * hash) + MAC_FIELD_NUMBER; + hash = (53 * hash) + com.google.protobuf.Internal.hashLong( + getMac()); + hash = (37 * hash) + DISTANCE_FIELD_NUMBER; + hash = (53 * hash) + java.lang.Float.floatToIntBits( + getDistance()); + hash = (37 * hash) + DISTANCE_STD_FIELD_NUMBER; + hash = (53 * hash) + java.lang.Float.floatToIntBits( + getDistanceStd()); + hash = (37 * hash) + RSSI_FIELD_NUMBER; + hash = (53 * hash) + getRssi(); + hash = (29 * hash) + getUnknownFields().hashCode(); memoizedHashCode = hash; return hash; } - - public static Light_Sample parseFrom( - com.google.protobuf.ByteString data) - throws com.google.protobuf.InvalidProtocolBufferException { + + public static com.openpositioning.PositionMe.Traj.WiFiRTTReading parseFrom( + java.nio.ByteBuffer data) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + public static com.openpositioning.PositionMe.Traj.WiFiRTTReading parseFrom( + java.nio.ByteBuffer data, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data, extensionRegistry); + } + public static com.openpositioning.PositionMe.Traj.WiFiRTTReading parseFrom( + com.google.protobuf.ByteString data) + throws com.google.protobuf.InvalidProtocolBufferException { return PARSER.parseFrom(data); } - public static Light_Sample parseFrom( - com.google.protobuf.ByteString data, - com.google.protobuf.ExtensionRegistryLite extensionRegistry) - throws com.google.protobuf.InvalidProtocolBufferException { + public static com.openpositioning.PositionMe.Traj.WiFiRTTReading parseFrom( + com.google.protobuf.ByteString data, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { return PARSER.parseFrom(data, extensionRegistry); } - public static Light_Sample parseFrom(byte[] data) - throws com.google.protobuf.InvalidProtocolBufferException { + public static com.openpositioning.PositionMe.Traj.WiFiRTTReading parseFrom(byte[] data) + throws com.google.protobuf.InvalidProtocolBufferException { return PARSER.parseFrom(data); } - public static Light_Sample parseFrom( - byte[] data, - com.google.protobuf.ExtensionRegistryLite extensionRegistry) - throws com.google.protobuf.InvalidProtocolBufferException { + public static com.openpositioning.PositionMe.Traj.WiFiRTTReading parseFrom( + byte[] data, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { return PARSER.parseFrom(data, extensionRegistry); } - public static Light_Sample parseFrom(java.io.InputStream input) - throws java.io.IOException { - return com.google.protobuf.GeneratedMessageV3 - .parseWithIOException(PARSER, input); - } - public static Light_Sample parseFrom( - java.io.InputStream input, - com.google.protobuf.ExtensionRegistryLite extensionRegistry) - throws java.io.IOException { - return com.google.protobuf.GeneratedMessageV3 - .parseWithIOException(PARSER, input, extensionRegistry); - } - public static Light_Sample parseDelimitedFrom(java.io.InputStream input) - throws java.io.IOException { - return com.google.protobuf.GeneratedMessageV3 - .parseDelimitedWithIOException(PARSER, input); - } - public static Light_Sample parseDelimitedFrom( - java.io.InputStream input, - com.google.protobuf.ExtensionRegistryLite extensionRegistry) - throws java.io.IOException { - return com.google.protobuf.GeneratedMessageV3 - .parseDelimitedWithIOException(PARSER, input, extensionRegistry); - } - public static Light_Sample parseFrom( - com.google.protobuf.CodedInputStream input) - throws java.io.IOException { - return com.google.protobuf.GeneratedMessageV3 - .parseWithIOException(PARSER, input); - } - public static Light_Sample parseFrom( - com.google.protobuf.CodedInputStream input, - com.google.protobuf.ExtensionRegistryLite extensionRegistry) - throws java.io.IOException { - return com.google.protobuf.GeneratedMessageV3 - .parseWithIOException(PARSER, input, extensionRegistry); + public static com.openpositioning.PositionMe.Traj.WiFiRTTReading parseFrom(java.io.InputStream input) + throws java.io.IOException { + return com.google.protobuf.GeneratedMessage + .parseWithIOException(PARSER, input); + } + public static com.openpositioning.PositionMe.Traj.WiFiRTTReading parseFrom( + java.io.InputStream input, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws java.io.IOException { + return com.google.protobuf.GeneratedMessage + .parseWithIOException(PARSER, input, extensionRegistry); + } + + public static com.openpositioning.PositionMe.Traj.WiFiRTTReading parseDelimitedFrom(java.io.InputStream input) + throws java.io.IOException { + return com.google.protobuf.GeneratedMessage + .parseDelimitedWithIOException(PARSER, input); + } + + public static com.openpositioning.PositionMe.Traj.WiFiRTTReading parseDelimitedFrom( + java.io.InputStream input, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws java.io.IOException { + return com.google.protobuf.GeneratedMessage + .parseDelimitedWithIOException(PARSER, input, extensionRegistry); + } + public static com.openpositioning.PositionMe.Traj.WiFiRTTReading parseFrom( + com.google.protobuf.CodedInputStream input) + throws java.io.IOException { + return com.google.protobuf.GeneratedMessage + .parseWithIOException(PARSER, input); + } + public static com.openpositioning.PositionMe.Traj.WiFiRTTReading parseFrom( + com.google.protobuf.CodedInputStream input, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws java.io.IOException { + return com.google.protobuf.GeneratedMessage + .parseWithIOException(PARSER, input, extensionRegistry); } + @java.lang.Override public Builder newBuilderForType() { return newBuilder(); } public static Builder newBuilder() { return DEFAULT_INSTANCE.toBuilder(); } - public static Builder newBuilder(Light_Sample prototype) { + public static Builder newBuilder(com.openpositioning.PositionMe.Traj.WiFiRTTReading prototype) { return DEFAULT_INSTANCE.toBuilder().mergeFrom(prototype); } + @java.lang.Override public Builder toBuilder() { return this == DEFAULT_INSTANCE - ? new Builder() : new Builder().mergeFrom(this); + ? new Builder() : new Builder().mergeFrom(this); } - @Override + @java.lang.Override protected Builder newBuilderForType( - com.google.protobuf.GeneratedMessageV3.BuilderParent parent) { + com.google.protobuf.GeneratedMessage.BuilderParent parent) { Builder builder = new Builder(parent); return builder; } /** - * Protobuf type {@code Light_Sample} + * Protobuf type {@code WiFiRTTReading} */ public static final class Builder extends - com.google.protobuf.GeneratedMessageV3.Builder implements - // @@protoc_insertion_point(builder_implements:Light_Sample) - Light_SampleOrBuilder { + com.google.protobuf.GeneratedMessage.Builder implements + // @@protoc_insertion_point(builder_implements:WiFiRTTReading) + com.openpositioning.PositionMe.Traj.WiFiRTTReadingOrBuilder { public static final com.google.protobuf.Descriptors.Descriptor - getDescriptor() { - return Traj.internal_static_Light_Sample_descriptor; + getDescriptor() { + return com.openpositioning.PositionMe.Traj.internal_static_WiFiRTTReading_descriptor; } - protected com.google.protobuf.GeneratedMessageV3.FieldAccessorTable - internalGetFieldAccessorTable() { - return Traj.internal_static_Light_Sample_fieldAccessorTable - .ensureFieldAccessorsInitialized( - Light_Sample.class, Builder.class); + @java.lang.Override + protected com.google.protobuf.GeneratedMessage.FieldAccessorTable + internalGetFieldAccessorTable() { + return com.openpositioning.PositionMe.Traj.internal_static_WiFiRTTReading_fieldAccessorTable + .ensureFieldAccessorsInitialized( + com.openpositioning.PositionMe.Traj.WiFiRTTReading.class, com.openpositioning.PositionMe.Traj.WiFiRTTReading.Builder.class); } - // Construct using Traj.Light_Sample.newBuilder() + // Construct using com.openpositioning.PositionMe.Traj.WiFiRTTReading.newBuilder() private Builder() { - maybeForceBuilderInitialization(); + } private Builder( - com.google.protobuf.GeneratedMessageV3.BuilderParent parent) { + com.google.protobuf.GeneratedMessage.BuilderParent parent) { super(parent); - maybeForceBuilderInitialization(); - } - private void maybeForceBuilderInitialization() { - if (com.google.protobuf.GeneratedMessageV3 - .alwaysUseFieldBuilders) { - } + } + @java.lang.Override public Builder clear() { super.clear(); + bitField0_ = 0; relativeTimestamp_ = 0L; - - light_ = 0F; - + mac_ = 0L; + distance_ = 0F; + distanceStd_ = 0F; + rssi_ = 0; return this; } + @java.lang.Override public com.google.protobuf.Descriptors.Descriptor - getDescriptorForType() { - return Traj.internal_static_Light_Sample_descriptor; + getDescriptorForType() { + return com.openpositioning.PositionMe.Traj.internal_static_WiFiRTTReading_descriptor; } - public Light_Sample getDefaultInstanceForType() { - return Light_Sample.getDefaultInstance(); + @java.lang.Override + public com.openpositioning.PositionMe.Traj.WiFiRTTReading getDefaultInstanceForType() { + return com.openpositioning.PositionMe.Traj.WiFiRTTReading.getDefaultInstance(); } - public Light_Sample build() { - Light_Sample result = buildPartial(); + @java.lang.Override + public com.openpositioning.PositionMe.Traj.WiFiRTTReading build() { + com.openpositioning.PositionMe.Traj.WiFiRTTReading result = buildPartial(); if (!result.isInitialized()) { throw newUninitializedMessageException(result); } return result; } - public Light_Sample buildPartial() { - Light_Sample result = new Light_Sample(this); - result.relativeTimestamp_ = relativeTimestamp_; - result.light_ = light_; + @java.lang.Override + public com.openpositioning.PositionMe.Traj.WiFiRTTReading buildPartial() { + com.openpositioning.PositionMe.Traj.WiFiRTTReading result = new com.openpositioning.PositionMe.Traj.WiFiRTTReading(this); + if (bitField0_ != 0) { buildPartial0(result); } onBuilt(); return result; } - public Builder clone() { - return (Builder) super.clone(); - } - public Builder setField( - com.google.protobuf.Descriptors.FieldDescriptor field, - Object value) { - return (Builder) super.setField(field, value); - } - public Builder clearField( - com.google.protobuf.Descriptors.FieldDescriptor field) { - return (Builder) super.clearField(field); - } - public Builder clearOneof( - com.google.protobuf.Descriptors.OneofDescriptor oneof) { - return (Builder) super.clearOneof(oneof); - } - public Builder setRepeatedField( - com.google.protobuf.Descriptors.FieldDescriptor field, - int index, Object value) { - return (Builder) super.setRepeatedField(field, index, value); - } - public Builder addRepeatedField( - com.google.protobuf.Descriptors.FieldDescriptor field, - Object value) { - return (Builder) super.addRepeatedField(field, value); + private void buildPartial0(com.openpositioning.PositionMe.Traj.WiFiRTTReading result) { + int from_bitField0_ = bitField0_; + if (((from_bitField0_ & 0x00000001) != 0)) { + result.relativeTimestamp_ = relativeTimestamp_; + } + if (((from_bitField0_ & 0x00000002) != 0)) { + result.mac_ = mac_; + } + if (((from_bitField0_ & 0x00000004) != 0)) { + result.distance_ = distance_; + } + if (((from_bitField0_ & 0x00000008) != 0)) { + result.distanceStd_ = distanceStd_; + } + if (((from_bitField0_ & 0x00000010) != 0)) { + result.rssi_ = rssi_; + } } + + @java.lang.Override public Builder mergeFrom(com.google.protobuf.Message other) { - if (other instanceof Light_Sample) { - return mergeFrom((Light_Sample)other); + if (other instanceof com.openpositioning.PositionMe.Traj.WiFiRTTReading) { + return mergeFrom((com.openpositioning.PositionMe.Traj.WiFiRTTReading)other); } else { super.mergeFrom(other); return this; } } - public Builder mergeFrom(Light_Sample other) { - if (other == Light_Sample.getDefaultInstance()) return this; + public Builder mergeFrom(com.openpositioning.PositionMe.Traj.WiFiRTTReading other) { + if (other == com.openpositioning.PositionMe.Traj.WiFiRTTReading.getDefaultInstance()) return this; if (other.getRelativeTimestamp() != 0L) { setRelativeTimestamp(other.getRelativeTimestamp()); } - if (other.getLight() != 0F) { - setLight(other.getLight()); + if (other.getMac() != 0L) { + setMac(other.getMac()); } + if (other.getDistance() != 0F) { + setDistance(other.getDistance()); + } + if (other.getDistanceStd() != 0F) { + setDistanceStd(other.getDistanceStd()); + } + if (other.getRssi() != 0) { + setRssi(other.getRssi()); + } + this.mergeUnknownFields(other.getUnknownFields()); onChanged(); return this; } + @java.lang.Override public final boolean isInitialized() { return true; } + @java.lang.Override public Builder mergeFrom( - com.google.protobuf.CodedInputStream input, - com.google.protobuf.ExtensionRegistryLite extensionRegistry) - throws java.io.IOException { - Light_Sample parsedMessage = null; + com.google.protobuf.CodedInputStream input, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws java.io.IOException { + if (extensionRegistry == null) { + throw new java.lang.NullPointerException(); + } try { - parsedMessage = PARSER.parsePartialFrom(input, extensionRegistry); + boolean done = false; + while (!done) { + int tag = input.readTag(); + switch (tag) { + case 0: + done = true; + break; + case 8: { + relativeTimestamp_ = input.readInt64(); + bitField0_ |= 0x00000001; + break; + } // case 8 + case 16: { + mac_ = input.readInt64(); + bitField0_ |= 0x00000002; + break; + } // case 16 + case 29: { + distance_ = input.readFloat(); + bitField0_ |= 0x00000004; + break; + } // case 29 + case 37: { + distanceStd_ = input.readFloat(); + bitField0_ |= 0x00000008; + break; + } // case 37 + case 40: { + rssi_ = input.readInt32(); + bitField0_ |= 0x00000010; + break; + } // case 40 + default: { + if (!super.parseUnknownField(input, extensionRegistry, tag)) { + done = true; // was an endgroup tag + } + break; + } // default: + } // switch (tag) + } // while (!done) } catch (com.google.protobuf.InvalidProtocolBufferException e) { - parsedMessage = (Light_Sample) e.getUnfinishedMessage(); throw e.unwrapIOException(); } finally { - if (parsedMessage != null) { - mergeFrom(parsedMessage); - } - } + onChanged(); + } // finally return this; } + private int bitField0_; private long relativeTimestamp_ ; /** - * optional int64 relative_timestamp = 1; + * int64 relative_timestamp = 1; + * @return The relativeTimestamp. */ + @java.lang.Override public long getRelativeTimestamp() { return relativeTimestamp_; } /** - * optional int64 relative_timestamp = 1; + * int64 relative_timestamp = 1; + * @param value The relativeTimestamp to set. + * @return This builder for chaining. */ public Builder setRelativeTimestamp(long value) { - + relativeTimestamp_ = value; + bitField0_ |= 0x00000001; onChanged(); return this; } /** - * optional int64 relative_timestamp = 1; + * int64 relative_timestamp = 1; + * @return This builder for chaining. */ public Builder clearRelativeTimestamp() { - + bitField0_ = (bitField0_ & ~0x00000001); relativeTimestamp_ = 0L; onChanged(); return this; } - private float light_ ; + private long mac_ ; /** *
-       * lux
+       * Integer encoding of the hex mac address (BSSID)
+       * e.g. 207394925843984
        * 
* - * optional float light = 2; + * int64 mac = 2; + * @return The mac. */ - public float getLight() { - return light_; + @java.lang.Override + public long getMac() { + return mac_; } /** *
-       * lux
+       * Integer encoding of the hex mac address (BSSID)
+       * e.g. 207394925843984
        * 
* - * optional float light = 2; + * int64 mac = 2; + * @param value The mac to set. + * @return This builder for chaining. */ - public Builder setLight(float value) { - - light_ = value; + public Builder setMac(long value) { + + mac_ = value; + bitField0_ |= 0x00000002; onChanged(); return this; } /** *
-       * lux
+       * Integer encoding of the hex mac address (BSSID)
+       * e.g. 207394925843984
        * 
* - * optional float light = 2; + * int64 mac = 2; + * @return This builder for chaining. */ - public Builder clearLight() { - - light_ = 0F; + public Builder clearMac() { + bitField0_ = (bitField0_ & ~0x00000002); + mac_ = 0L; + onChanged(); + return this; + } + + private float distance_ ; + /** + *
+       * in mm
+       * 
+ * + * float distance = 3; + * @return The distance. + */ + @java.lang.Override + public float getDistance() { + return distance_; + } + /** + *
+       * in mm
+       * 
+ * + * float distance = 3; + * @param value The distance to set. + * @return This builder for chaining. + */ + public Builder setDistance(float value) { + + distance_ = value; + bitField0_ |= 0x00000004; onChanged(); return this; } - public final Builder setUnknownFields( - final com.google.protobuf.UnknownFieldSet unknownFields) { + /** + *
+       * in mm
+       * 
+ * + * float distance = 3; + * @return This builder for chaining. + */ + public Builder clearDistance() { + bitField0_ = (bitField0_ & ~0x00000004); + distance_ = 0F; + onChanged(); return this; } - public final Builder mergeUnknownFields( - final com.google.protobuf.UnknownFieldSet unknownFields) { + private float distanceStd_ ; + /** + *
+       * in mm
+       * 
+ * + * float distance_std = 4; + * @return The distanceStd. + */ + @java.lang.Override + public float getDistanceStd() { + return distanceStd_; + } + /** + *
+       * in mm
+       * 
+ * + * float distance_std = 4; + * @param value The distanceStd to set. + * @return This builder for chaining. + */ + public Builder setDistanceStd(float value) { + + distanceStd_ = value; + bitField0_ |= 0x00000008; + onChanged(); + return this; + } + /** + *
+       * in mm
+       * 
+ * + * float distance_std = 4; + * @return This builder for chaining. + */ + public Builder clearDistanceStd() { + bitField0_ = (bitField0_ & ~0x00000008); + distanceStd_ = 0F; + onChanged(); return this; } + private int rssi_ ; + /** + *
+       * rssi integer in dBm.
+       * typically between -120 and -10
+       * 
+ * + * int32 rssi = 5; + * @return The rssi. + */ + @java.lang.Override + public int getRssi() { + return rssi_; + } + /** + *
+       * rssi integer in dBm.
+       * typically between -120 and -10
+       * 
+ * + * int32 rssi = 5; + * @param value The rssi to set. + * @return This builder for chaining. + */ + public Builder setRssi(int value) { + + rssi_ = value; + bitField0_ |= 0x00000010; + onChanged(); + return this; + } + /** + *
+       * rssi integer in dBm.
+       * typically between -120 and -10
+       * 
+ * + * int32 rssi = 5; + * @return This builder for chaining. + */ + public Builder clearRssi() { + bitField0_ = (bitField0_ & ~0x00000010); + rssi_ = 0; + onChanged(); + return this; + } - // @@protoc_insertion_point(builder_scope:Light_Sample) + // @@protoc_insertion_point(builder_scope:WiFiRTTReading) } - // @@protoc_insertion_point(class_scope:Light_Sample) - private static final Light_Sample DEFAULT_INSTANCE; + // @@protoc_insertion_point(class_scope:WiFiRTTReading) + private static final com.openpositioning.PositionMe.Traj.WiFiRTTReading DEFAULT_INSTANCE; static { - DEFAULT_INSTANCE = new Light_Sample(); + DEFAULT_INSTANCE = new com.openpositioning.PositionMe.Traj.WiFiRTTReading(); } - public static Light_Sample getDefaultInstance() { + public static com.openpositioning.PositionMe.Traj.WiFiRTTReading getDefaultInstance() { return DEFAULT_INSTANCE; } - private static final com.google.protobuf.Parser - PARSER = new com.google.protobuf.AbstractParser() { - public Light_Sample parsePartialFrom( - com.google.protobuf.CodedInputStream input, - com.google.protobuf.ExtensionRegistryLite extensionRegistry) - throws com.google.protobuf.InvalidProtocolBufferException { - return new Light_Sample(input, extensionRegistry); + private static final com.google.protobuf.Parser + PARSER = new com.google.protobuf.AbstractParser() { + @java.lang.Override + public WiFiRTTReading parsePartialFrom( + com.google.protobuf.CodedInputStream input, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + Builder builder = newBuilder(); + try { + builder.mergeFrom(input, extensionRegistry); + } catch (com.google.protobuf.InvalidProtocolBufferException e) { + throw e.setUnfinishedMessage(builder.buildPartial()); + } catch (com.google.protobuf.UninitializedMessageException e) { + throw e.asInvalidProtocolBufferException().setUnfinishedMessage(builder.buildPartial()); + } catch (java.io.IOException e) { + throw new com.google.protobuf.InvalidProtocolBufferException(e) + .setUnfinishedMessage(builder.buildPartial()); + } + return builder.buildPartial(); } }; - public static com.google.protobuf.Parser parser() { + public static com.google.protobuf.Parser parser() { return PARSER; } - @Override - public com.google.protobuf.Parser getParserForType() { + @java.lang.Override + public com.google.protobuf.Parser getParserForType() { return PARSER; } - public Light_Sample getDefaultInstanceForType() { + @java.lang.Override + public com.openpositioning.PositionMe.Traj.WiFiRTTReading getDefaultInstanceForType() { return DEFAULT_INSTANCE; } } - public interface GNSS_SampleOrBuilder extends - // @@protoc_insertion_point(interface_extends:GNSS_Sample) - com.google.protobuf.MessageOrBuilder { - - /** - * optional int64 relative_timestamp = 1; - */ - long getRelativeTimestamp(); - - /** - *
-     * degrees (minimum 6 significant figures)
-     * latitude between -90 and 90
-     * 
- * - * optional float latitude = 2; - */ - float getLatitude(); - - /** - *
-     * longitude between -180 and 180
-     * 
- * - * optional float longitude = 3; - */ - float getLongitude(); - - /** - *
-     *metres
-     * 
- * - * optional float altitude = 4; - */ - float getAltitude(); - - /** - *
-     * metres
-     * 
- * - * optional float accuracy = 5; - */ - float getAccuracy(); + public interface WiFiAPDataOrBuilder extends + // @@protoc_insertion_point(interface_extends:WiFiAPData) + com.google.protobuf.MessageOrBuilder { /** *
-     * m/s
+     * Integer encoding of the hex mac address (BSSID)
+     * e.g. 207394925843984
      * 
* - * optional float speed = 6; + * int64 mac = 1; + * @return The mac. */ - float getSpeed(); + long getMac(); /** *
-     * e.g 'gps' or 'network'
+     * E.g. 'Eduroam' or 'Starbucks_free_wifi'
      * 
* - * optional string provider = 7; + * string ssid = 2; + * @return The ssid. */ - String getProvider(); + java.lang.String getSsid(); /** *
-     * e.g 'gps' or 'network'
+     * E.g. 'Eduroam' or 'Starbucks_free_wifi'
      * 
* - * optional string provider = 7; + * string ssid = 2; + * @return The bytes for ssid. */ com.google.protobuf.ByteString - getProviderBytes(); - } - /** - * Protobuf type {@code GNSS_Sample} - */ - public static final class GNSS_Sample extends - com.google.protobuf.GeneratedMessageV3 implements - // @@protoc_insertion_point(message_implements:GNSS_Sample) - GNSS_SampleOrBuilder { - // Use GNSS_Sample.newBuilder() to construct. - private GNSS_Sample(com.google.protobuf.GeneratedMessageV3.Builder builder) { - super(builder); - } - private GNSS_Sample() { - relativeTimestamp_ = 0L; - latitude_ = 0F; - longitude_ = 0F; - altitude_ = 0F; - accuracy_ = 0F; - speed_ = 0F; - provider_ = ""; - } - - @Override - public final com.google.protobuf.UnknownFieldSet - getUnknownFields() { - return com.google.protobuf.UnknownFieldSet.getDefaultInstance(); - } - private GNSS_Sample( - com.google.protobuf.CodedInputStream input, - com.google.protobuf.ExtensionRegistryLite extensionRegistry) - throws com.google.protobuf.InvalidProtocolBufferException { - this(); - int mutable_bitField0_ = 0; - try { - boolean done = false; - while (!done) { - int tag = input.readTag(); - switch (tag) { - case 0: - done = true; - break; - default: { - if (!input.skipField(tag)) { - done = true; - } - break; - } - case 8: { - - relativeTimestamp_ = input.readInt64(); - break; - } - case 21: { - - latitude_ = input.readFloat(); - break; - } - case 29: { - - longitude_ = input.readFloat(); - break; - } - case 37: { - - altitude_ = input.readFloat(); - break; - } - case 45: { - - accuracy_ = input.readFloat(); - break; - } - case 53: { - - speed_ = input.readFloat(); - break; - } - case 58: { - String s = input.readStringRequireUtf8(); - - provider_ = s; - break; - } - } - } - } catch (com.google.protobuf.InvalidProtocolBufferException e) { - throw e.setUnfinishedMessage(this); - } catch (java.io.IOException e) { - throw new com.google.protobuf.InvalidProtocolBufferException( - e).setUnfinishedMessage(this); - } finally { - makeExtensionsImmutable(); - } - } - public static final com.google.protobuf.Descriptors.Descriptor - getDescriptor() { - return Traj.internal_static_GNSS_Sample_descriptor; - } - - protected com.google.protobuf.GeneratedMessageV3.FieldAccessorTable - internalGetFieldAccessorTable() { - return Traj.internal_static_GNSS_Sample_fieldAccessorTable - .ensureFieldAccessorsInitialized( - GNSS_Sample.class, Builder.class); - } - - public static final int RELATIVE_TIMESTAMP_FIELD_NUMBER = 1; - private long relativeTimestamp_; - /** - * optional int64 relative_timestamp = 1; - */ - public long getRelativeTimestamp() { - return relativeTimestamp_; - } - - public static final int LATITUDE_FIELD_NUMBER = 2; - private float latitude_; - /** - *
-     * degrees (minimum 6 significant figures)
-     * latitude between -90 and 90
-     * 
- * - * optional float latitude = 2; - */ - public float getLatitude() { - return latitude_; - } - - public static final int LONGITUDE_FIELD_NUMBER = 3; - private float longitude_; - /** - *
-     * longitude between -180 and 180
-     * 
- * - * optional float longitude = 3; - */ - public float getLongitude() { - return longitude_; - } + getSsidBytes(); - public static final int ALTITUDE_FIELD_NUMBER = 4; - private float altitude_; /** *
-     *metres
+     * Typically 2.4GHz or 5GHz
      * 
* - * optional float altitude = 4; + * int64 frequency = 3; + * @return The frequency. */ - public float getAltitude() { - return altitude_; - } + long getFrequency(); - public static final int ACCURACY_FIELD_NUMBER = 5; - private float accuracy_; /** *
-     * metres
+     * Flag to indicate if the AP supports RTT measurements
      * 
* - * optional float accuracy = 5; + * bool rtt_enabled = 4; + * @return The rttEnabled. */ - public float getAccuracy() { - return accuracy_; + boolean getRttEnabled(); + } + /** + * Protobuf type {@code WiFiAPData} + */ + public static final class WiFiAPData extends + com.google.protobuf.GeneratedMessage implements + // @@protoc_insertion_point(message_implements:WiFiAPData) + WiFiAPDataOrBuilder { + private static final long serialVersionUID = 0L; + static { + com.google.protobuf.RuntimeVersion.validateProtobufGencodeVersion( + com.google.protobuf.RuntimeVersion.RuntimeDomain.PUBLIC, + /* major= */ 4, + /* minor= */ 29, + /* patch= */ 6, + /* suffix= */ "", + WiFiAPData.class.getName()); + } + // Use WiFiAPData.newBuilder() to construct. + private WiFiAPData(com.google.protobuf.GeneratedMessage.Builder builder) { + super(builder); + } + private WiFiAPData() { + ssid_ = ""; } - public static final int SPEED_FIELD_NUMBER = 6; - private float speed_; + public static final com.google.protobuf.Descriptors.Descriptor + getDescriptor() { + return com.openpositioning.PositionMe.Traj.internal_static_WiFiAPData_descriptor; + } + + @java.lang.Override + protected com.google.protobuf.GeneratedMessage.FieldAccessorTable + internalGetFieldAccessorTable() { + return com.openpositioning.PositionMe.Traj.internal_static_WiFiAPData_fieldAccessorTable + .ensureFieldAccessorsInitialized( + com.openpositioning.PositionMe.Traj.WiFiAPData.class, com.openpositioning.PositionMe.Traj.WiFiAPData.Builder.class); + } + + public static final int MAC_FIELD_NUMBER = 1; + private long mac_ = 0L; /** *
-     * m/s
+     * Integer encoding of the hex mac address (BSSID)
+     * e.g. 207394925843984
      * 
* - * optional float speed = 6; + * int64 mac = 1; + * @return The mac. */ - public float getSpeed() { - return speed_; + @java.lang.Override + public long getMac() { + return mac_; } - public static final int PROVIDER_FIELD_NUMBER = 7; - private volatile Object provider_; + public static final int SSID_FIELD_NUMBER = 2; + @SuppressWarnings("serial") + private volatile java.lang.Object ssid_ = ""; /** *
-     * e.g 'gps' or 'network'
+     * E.g. 'Eduroam' or 'Starbucks_free_wifi'
      * 
* - * optional string provider = 7; + * string ssid = 2; + * @return The ssid. */ - public String getProvider() { - Object ref = provider_; - if (ref instanceof String) { - return (String) ref; + @java.lang.Override + public java.lang.String getSsid() { + java.lang.Object ref = ssid_; + if (ref instanceof java.lang.String) { + return (java.lang.String) ref; } else { - com.google.protobuf.ByteString bs = - (com.google.protobuf.ByteString) ref; - String s = bs.toStringUtf8(); - provider_ = s; + com.google.protobuf.ByteString bs = + (com.google.protobuf.ByteString) ref; + java.lang.String s = bs.toStringUtf8(); + ssid_ = s; return s; } } /** *
-     * e.g 'gps' or 'network'
+     * E.g. 'Eduroam' or 'Starbucks_free_wifi'
      * 
* - * optional string provider = 7; + * string ssid = 2; + * @return The bytes for ssid. */ + @java.lang.Override public com.google.protobuf.ByteString - getProviderBytes() { - Object ref = provider_; - if (ref instanceof String) { - com.google.protobuf.ByteString b = - com.google.protobuf.ByteString.copyFromUtf8( - (String) ref); - provider_ = b; + getSsidBytes() { + java.lang.Object ref = ssid_; + if (ref instanceof java.lang.String) { + com.google.protobuf.ByteString b = + com.google.protobuf.ByteString.copyFromUtf8( + (java.lang.String) ref); + ssid_ = b; return b; } else { return (com.google.protobuf.ByteString) ref; } } + public static final int FREQUENCY_FIELD_NUMBER = 3; + private long frequency_ = 0L; + /** + *
+     * Typically 2.4GHz or 5GHz
+     * 
+ * + * int64 frequency = 3; + * @return The frequency. + */ + @java.lang.Override + public long getFrequency() { + return frequency_; + } + + public static final int RTT_ENABLED_FIELD_NUMBER = 4; + private boolean rttEnabled_ = false; + /** + *
+     * Flag to indicate if the AP supports RTT measurements
+     * 
+ * + * bool rtt_enabled = 4; + * @return The rttEnabled. + */ + @java.lang.Override + public boolean getRttEnabled() { + return rttEnabled_; + } + private byte memoizedIsInitialized = -1; + @java.lang.Override public final boolean isInitialized() { byte isInitialized = memoizedIsInitialized; if (isInitialized == 1) return true; @@ -8721,899 +16765,902 @@ public final boolean isInitialized() { return true; } + @java.lang.Override public void writeTo(com.google.protobuf.CodedOutputStream output) - throws java.io.IOException { - if (relativeTimestamp_ != 0L) { - output.writeInt64(1, relativeTimestamp_); - } - if (latitude_ != 0F) { - output.writeFloat(2, latitude_); - } - if (longitude_ != 0F) { - output.writeFloat(3, longitude_); - } - if (altitude_ != 0F) { - output.writeFloat(4, altitude_); + throws java.io.IOException { + if (mac_ != 0L) { + output.writeInt64(1, mac_); } - if (accuracy_ != 0F) { - output.writeFloat(5, accuracy_); + if (!com.google.protobuf.GeneratedMessage.isStringEmpty(ssid_)) { + com.google.protobuf.GeneratedMessage.writeString(output, 2, ssid_); } - if (speed_ != 0F) { - output.writeFloat(6, speed_); + if (frequency_ != 0L) { + output.writeInt64(3, frequency_); } - if (!getProviderBytes().isEmpty()) { - com.google.protobuf.GeneratedMessageV3.writeString(output, 7, provider_); + if (rttEnabled_ != false) { + output.writeBool(4, rttEnabled_); } + getUnknownFields().writeTo(output); } + @java.lang.Override public int getSerializedSize() { int size = memoizedSize; if (size != -1) return size; size = 0; - if (relativeTimestamp_ != 0L) { - size += com.google.protobuf.CodedOutputStream - .computeInt64Size(1, relativeTimestamp_); - } - if (latitude_ != 0F) { - size += com.google.protobuf.CodedOutputStream - .computeFloatSize(2, latitude_); - } - if (longitude_ != 0F) { + if (mac_ != 0L) { size += com.google.protobuf.CodedOutputStream - .computeFloatSize(3, longitude_); + .computeInt64Size(1, mac_); } - if (altitude_ != 0F) { - size += com.google.protobuf.CodedOutputStream - .computeFloatSize(4, altitude_); + if (!com.google.protobuf.GeneratedMessage.isStringEmpty(ssid_)) { + size += com.google.protobuf.GeneratedMessage.computeStringSize(2, ssid_); } - if (accuracy_ != 0F) { + if (frequency_ != 0L) { size += com.google.protobuf.CodedOutputStream - .computeFloatSize(5, accuracy_); + .computeInt64Size(3, frequency_); } - if (speed_ != 0F) { + if (rttEnabled_ != false) { size += com.google.protobuf.CodedOutputStream - .computeFloatSize(6, speed_); - } - if (!getProviderBytes().isEmpty()) { - size += com.google.protobuf.GeneratedMessageV3.computeStringSize(7, provider_); + .computeBoolSize(4, rttEnabled_); } + size += getUnknownFields().getSerializedSize(); memoizedSize = size; return size; } - private static final long serialVersionUID = 0L; - @Override - public boolean equals(final Object obj) { + @java.lang.Override + public boolean equals(final java.lang.Object obj) { if (obj == this) { - return true; + return true; } - if (!(obj instanceof GNSS_Sample)) { + if (!(obj instanceof com.openpositioning.PositionMe.Traj.WiFiAPData)) { return super.equals(obj); } - GNSS_Sample other = (GNSS_Sample) obj; - - boolean result = true; - result = result && (getRelativeTimestamp() - == other.getRelativeTimestamp()); - result = result && ( - Float.floatToIntBits(getLatitude()) - == Float.floatToIntBits( - other.getLatitude())); - result = result && ( - Float.floatToIntBits(getLongitude()) - == Float.floatToIntBits( - other.getLongitude())); - result = result && ( - Float.floatToIntBits(getAltitude()) - == Float.floatToIntBits( - other.getAltitude())); - result = result && ( - Float.floatToIntBits(getAccuracy()) - == Float.floatToIntBits( - other.getAccuracy())); - result = result && ( - Float.floatToIntBits(getSpeed()) - == Float.floatToIntBits( - other.getSpeed())); - result = result && getProvider() - .equals(other.getProvider()); - return result; - } - - @Override + com.openpositioning.PositionMe.Traj.WiFiAPData other = (com.openpositioning.PositionMe.Traj.WiFiAPData) obj; + + if (getMac() + != other.getMac()) return false; + if (!getSsid() + .equals(other.getSsid())) return false; + if (getFrequency() + != other.getFrequency()) return false; + if (getRttEnabled() + != other.getRttEnabled()) return false; + if (!getUnknownFields().equals(other.getUnknownFields())) return false; + return true; + } + + @java.lang.Override public int hashCode() { if (memoizedHashCode != 0) { return memoizedHashCode; } int hash = 41; - hash = (19 * hash) + getDescriptorForType().hashCode(); - hash = (37 * hash) + RELATIVE_TIMESTAMP_FIELD_NUMBER; + hash = (19 * hash) + getDescriptor().hashCode(); + hash = (37 * hash) + MAC_FIELD_NUMBER; hash = (53 * hash) + com.google.protobuf.Internal.hashLong( - getRelativeTimestamp()); - hash = (37 * hash) + LATITUDE_FIELD_NUMBER; - hash = (53 * hash) + Float.floatToIntBits( - getLatitude()); - hash = (37 * hash) + LONGITUDE_FIELD_NUMBER; - hash = (53 * hash) + Float.floatToIntBits( - getLongitude()); - hash = (37 * hash) + ALTITUDE_FIELD_NUMBER; - hash = (53 * hash) + Float.floatToIntBits( - getAltitude()); - hash = (37 * hash) + ACCURACY_FIELD_NUMBER; - hash = (53 * hash) + Float.floatToIntBits( - getAccuracy()); - hash = (37 * hash) + SPEED_FIELD_NUMBER; - hash = (53 * hash) + Float.floatToIntBits( - getSpeed()); - hash = (37 * hash) + PROVIDER_FIELD_NUMBER; - hash = (53 * hash) + getProvider().hashCode(); - hash = (29 * hash) + unknownFields.hashCode(); + getMac()); + hash = (37 * hash) + SSID_FIELD_NUMBER; + hash = (53 * hash) + getSsid().hashCode(); + hash = (37 * hash) + FREQUENCY_FIELD_NUMBER; + hash = (53 * hash) + com.google.protobuf.Internal.hashLong( + getFrequency()); + hash = (37 * hash) + RTT_ENABLED_FIELD_NUMBER; + hash = (53 * hash) + com.google.protobuf.Internal.hashBoolean( + getRttEnabled()); + hash = (29 * hash) + getUnknownFields().hashCode(); memoizedHashCode = hash; return hash; } - public static GNSS_Sample parseFrom( - com.google.protobuf.ByteString data) - throws com.google.protobuf.InvalidProtocolBufferException { + public static com.openpositioning.PositionMe.Traj.WiFiAPData parseFrom( + java.nio.ByteBuffer data) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + public static com.openpositioning.PositionMe.Traj.WiFiAPData parseFrom( + java.nio.ByteBuffer data, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data, extensionRegistry); + } + public static com.openpositioning.PositionMe.Traj.WiFiAPData parseFrom( + com.google.protobuf.ByteString data) + throws com.google.protobuf.InvalidProtocolBufferException { return PARSER.parseFrom(data); } - public static GNSS_Sample parseFrom( - com.google.protobuf.ByteString data, - com.google.protobuf.ExtensionRegistryLite extensionRegistry) - throws com.google.protobuf.InvalidProtocolBufferException { + public static com.openpositioning.PositionMe.Traj.WiFiAPData parseFrom( + com.google.protobuf.ByteString data, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { return PARSER.parseFrom(data, extensionRegistry); } - public static GNSS_Sample parseFrom(byte[] data) - throws com.google.protobuf.InvalidProtocolBufferException { + public static com.openpositioning.PositionMe.Traj.WiFiAPData parseFrom(byte[] data) + throws com.google.protobuf.InvalidProtocolBufferException { return PARSER.parseFrom(data); } - public static GNSS_Sample parseFrom( - byte[] data, - com.google.protobuf.ExtensionRegistryLite extensionRegistry) - throws com.google.protobuf.InvalidProtocolBufferException { + public static com.openpositioning.PositionMe.Traj.WiFiAPData parseFrom( + byte[] data, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { return PARSER.parseFrom(data, extensionRegistry); } - public static GNSS_Sample parseFrom(java.io.InputStream input) - throws java.io.IOException { - return com.google.protobuf.GeneratedMessageV3 - .parseWithIOException(PARSER, input); - } - public static GNSS_Sample parseFrom( - java.io.InputStream input, - com.google.protobuf.ExtensionRegistryLite extensionRegistry) - throws java.io.IOException { - return com.google.protobuf.GeneratedMessageV3 - .parseWithIOException(PARSER, input, extensionRegistry); - } - public static GNSS_Sample parseDelimitedFrom(java.io.InputStream input) - throws java.io.IOException { - return com.google.protobuf.GeneratedMessageV3 - .parseDelimitedWithIOException(PARSER, input); - } - public static GNSS_Sample parseDelimitedFrom( - java.io.InputStream input, - com.google.protobuf.ExtensionRegistryLite extensionRegistry) - throws java.io.IOException { - return com.google.protobuf.GeneratedMessageV3 - .parseDelimitedWithIOException(PARSER, input, extensionRegistry); - } - public static GNSS_Sample parseFrom( - com.google.protobuf.CodedInputStream input) - throws java.io.IOException { - return com.google.protobuf.GeneratedMessageV3 - .parseWithIOException(PARSER, input); - } - public static GNSS_Sample parseFrom( - com.google.protobuf.CodedInputStream input, - com.google.protobuf.ExtensionRegistryLite extensionRegistry) - throws java.io.IOException { - return com.google.protobuf.GeneratedMessageV3 - .parseWithIOException(PARSER, input, extensionRegistry); + public static com.openpositioning.PositionMe.Traj.WiFiAPData parseFrom(java.io.InputStream input) + throws java.io.IOException { + return com.google.protobuf.GeneratedMessage + .parseWithIOException(PARSER, input); + } + public static com.openpositioning.PositionMe.Traj.WiFiAPData parseFrom( + java.io.InputStream input, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws java.io.IOException { + return com.google.protobuf.GeneratedMessage + .parseWithIOException(PARSER, input, extensionRegistry); } + public static com.openpositioning.PositionMe.Traj.WiFiAPData parseDelimitedFrom(java.io.InputStream input) + throws java.io.IOException { + return com.google.protobuf.GeneratedMessage + .parseDelimitedWithIOException(PARSER, input); + } + + public static com.openpositioning.PositionMe.Traj.WiFiAPData parseDelimitedFrom( + java.io.InputStream input, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws java.io.IOException { + return com.google.protobuf.GeneratedMessage + .parseDelimitedWithIOException(PARSER, input, extensionRegistry); + } + public static com.openpositioning.PositionMe.Traj.WiFiAPData parseFrom( + com.google.protobuf.CodedInputStream input) + throws java.io.IOException { + return com.google.protobuf.GeneratedMessage + .parseWithIOException(PARSER, input); + } + public static com.openpositioning.PositionMe.Traj.WiFiAPData parseFrom( + com.google.protobuf.CodedInputStream input, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws java.io.IOException { + return com.google.protobuf.GeneratedMessage + .parseWithIOException(PARSER, input, extensionRegistry); + } + + @java.lang.Override public Builder newBuilderForType() { return newBuilder(); } public static Builder newBuilder() { return DEFAULT_INSTANCE.toBuilder(); } - public static Builder newBuilder(GNSS_Sample prototype) { + public static Builder newBuilder(com.openpositioning.PositionMe.Traj.WiFiAPData prototype) { return DEFAULT_INSTANCE.toBuilder().mergeFrom(prototype); } + @java.lang.Override public Builder toBuilder() { return this == DEFAULT_INSTANCE - ? new Builder() : new Builder().mergeFrom(this); + ? new Builder() : new Builder().mergeFrom(this); } - @Override + @java.lang.Override protected Builder newBuilderForType( - com.google.protobuf.GeneratedMessageV3.BuilderParent parent) { + com.google.protobuf.GeneratedMessage.BuilderParent parent) { Builder builder = new Builder(parent); return builder; } /** - * Protobuf type {@code GNSS_Sample} + * Protobuf type {@code WiFiAPData} */ public static final class Builder extends - com.google.protobuf.GeneratedMessageV3.Builder implements - // @@protoc_insertion_point(builder_implements:GNSS_Sample) - GNSS_SampleOrBuilder { + com.google.protobuf.GeneratedMessage.Builder implements + // @@protoc_insertion_point(builder_implements:WiFiAPData) + com.openpositioning.PositionMe.Traj.WiFiAPDataOrBuilder { public static final com.google.protobuf.Descriptors.Descriptor - getDescriptor() { - return Traj.internal_static_GNSS_Sample_descriptor; + getDescriptor() { + return com.openpositioning.PositionMe.Traj.internal_static_WiFiAPData_descriptor; } - protected com.google.protobuf.GeneratedMessageV3.FieldAccessorTable - internalGetFieldAccessorTable() { - return Traj.internal_static_GNSS_Sample_fieldAccessorTable - .ensureFieldAccessorsInitialized( - GNSS_Sample.class, Builder.class); + @java.lang.Override + protected com.google.protobuf.GeneratedMessage.FieldAccessorTable + internalGetFieldAccessorTable() { + return com.openpositioning.PositionMe.Traj.internal_static_WiFiAPData_fieldAccessorTable + .ensureFieldAccessorsInitialized( + com.openpositioning.PositionMe.Traj.WiFiAPData.class, com.openpositioning.PositionMe.Traj.WiFiAPData.Builder.class); } - // Construct using Traj.GNSS_Sample.newBuilder() + // Construct using com.openpositioning.PositionMe.Traj.WiFiAPData.newBuilder() private Builder() { - maybeForceBuilderInitialization(); + } private Builder( - com.google.protobuf.GeneratedMessageV3.BuilderParent parent) { + com.google.protobuf.GeneratedMessage.BuilderParent parent) { super(parent); - maybeForceBuilderInitialization(); - } - private void maybeForceBuilderInitialization() { - if (com.google.protobuf.GeneratedMessageV3 - .alwaysUseFieldBuilders) { - } + } + @java.lang.Override public Builder clear() { super.clear(); - relativeTimestamp_ = 0L; - - latitude_ = 0F; - - longitude_ = 0F; - - altitude_ = 0F; - - accuracy_ = 0F; - - speed_ = 0F; - - provider_ = ""; - + bitField0_ = 0; + mac_ = 0L; + ssid_ = ""; + frequency_ = 0L; + rttEnabled_ = false; return this; } + @java.lang.Override public com.google.protobuf.Descriptors.Descriptor - getDescriptorForType() { - return Traj.internal_static_GNSS_Sample_descriptor; + getDescriptorForType() { + return com.openpositioning.PositionMe.Traj.internal_static_WiFiAPData_descriptor; } - public GNSS_Sample getDefaultInstanceForType() { - return GNSS_Sample.getDefaultInstance(); + @java.lang.Override + public com.openpositioning.PositionMe.Traj.WiFiAPData getDefaultInstanceForType() { + return com.openpositioning.PositionMe.Traj.WiFiAPData.getDefaultInstance(); } - public GNSS_Sample build() { - GNSS_Sample result = buildPartial(); + @java.lang.Override + public com.openpositioning.PositionMe.Traj.WiFiAPData build() { + com.openpositioning.PositionMe.Traj.WiFiAPData result = buildPartial(); if (!result.isInitialized()) { throw newUninitializedMessageException(result); } return result; } - public GNSS_Sample buildPartial() { - GNSS_Sample result = new GNSS_Sample(this); - result.relativeTimestamp_ = relativeTimestamp_; - result.latitude_ = latitude_; - result.longitude_ = longitude_; - result.altitude_ = altitude_; - result.accuracy_ = accuracy_; - result.speed_ = speed_; - result.provider_ = provider_; + @java.lang.Override + public com.openpositioning.PositionMe.Traj.WiFiAPData buildPartial() { + com.openpositioning.PositionMe.Traj.WiFiAPData result = new com.openpositioning.PositionMe.Traj.WiFiAPData(this); + if (bitField0_ != 0) { buildPartial0(result); } onBuilt(); return result; } - public Builder clone() { - return (Builder) super.clone(); - } - public Builder setField( - com.google.protobuf.Descriptors.FieldDescriptor field, - Object value) { - return (Builder) super.setField(field, value); - } - public Builder clearField( - com.google.protobuf.Descriptors.FieldDescriptor field) { - return (Builder) super.clearField(field); - } - public Builder clearOneof( - com.google.protobuf.Descriptors.OneofDescriptor oneof) { - return (Builder) super.clearOneof(oneof); - } - public Builder setRepeatedField( - com.google.protobuf.Descriptors.FieldDescriptor field, - int index, Object value) { - return (Builder) super.setRepeatedField(field, index, value); - } - public Builder addRepeatedField( - com.google.protobuf.Descriptors.FieldDescriptor field, - Object value) { - return (Builder) super.addRepeatedField(field, value); + private void buildPartial0(com.openpositioning.PositionMe.Traj.WiFiAPData result) { + int from_bitField0_ = bitField0_; + if (((from_bitField0_ & 0x00000001) != 0)) { + result.mac_ = mac_; + } + if (((from_bitField0_ & 0x00000002) != 0)) { + result.ssid_ = ssid_; + } + if (((from_bitField0_ & 0x00000004) != 0)) { + result.frequency_ = frequency_; + } + if (((from_bitField0_ & 0x00000008) != 0)) { + result.rttEnabled_ = rttEnabled_; + } } + + @java.lang.Override public Builder mergeFrom(com.google.protobuf.Message other) { - if (other instanceof GNSS_Sample) { - return mergeFrom((GNSS_Sample)other); + if (other instanceof com.openpositioning.PositionMe.Traj.WiFiAPData) { + return mergeFrom((com.openpositioning.PositionMe.Traj.WiFiAPData)other); } else { super.mergeFrom(other); return this; } } - public Builder mergeFrom(GNSS_Sample other) { - if (other == GNSS_Sample.getDefaultInstance()) return this; - if (other.getRelativeTimestamp() != 0L) { - setRelativeTimestamp(other.getRelativeTimestamp()); - } - if (other.getLatitude() != 0F) { - setLatitude(other.getLatitude()); - } - if (other.getLongitude() != 0F) { - setLongitude(other.getLongitude()); - } - if (other.getAltitude() != 0F) { - setAltitude(other.getAltitude()); + public Builder mergeFrom(com.openpositioning.PositionMe.Traj.WiFiAPData other) { + if (other == com.openpositioning.PositionMe.Traj.WiFiAPData.getDefaultInstance()) return this; + if (other.getMac() != 0L) { + setMac(other.getMac()); } - if (other.getAccuracy() != 0F) { - setAccuracy(other.getAccuracy()); + if (!other.getSsid().isEmpty()) { + ssid_ = other.ssid_; + bitField0_ |= 0x00000002; + onChanged(); } - if (other.getSpeed() != 0F) { - setSpeed(other.getSpeed()); + if (other.getFrequency() != 0L) { + setFrequency(other.getFrequency()); } - if (!other.getProvider().isEmpty()) { - provider_ = other.provider_; - onChanged(); + if (other.getRttEnabled() != false) { + setRttEnabled(other.getRttEnabled()); } + this.mergeUnknownFields(other.getUnknownFields()); onChanged(); return this; } + @java.lang.Override public final boolean isInitialized() { return true; } + @java.lang.Override public Builder mergeFrom( - com.google.protobuf.CodedInputStream input, - com.google.protobuf.ExtensionRegistryLite extensionRegistry) - throws java.io.IOException { - GNSS_Sample parsedMessage = null; + com.google.protobuf.CodedInputStream input, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws java.io.IOException { + if (extensionRegistry == null) { + throw new java.lang.NullPointerException(); + } try { - parsedMessage = PARSER.parsePartialFrom(input, extensionRegistry); + boolean done = false; + while (!done) { + int tag = input.readTag(); + switch (tag) { + case 0: + done = true; + break; + case 8: { + mac_ = input.readInt64(); + bitField0_ |= 0x00000001; + break; + } // case 8 + case 18: { + ssid_ = input.readStringRequireUtf8(); + bitField0_ |= 0x00000002; + break; + } // case 18 + case 24: { + frequency_ = input.readInt64(); + bitField0_ |= 0x00000004; + break; + } // case 24 + case 32: { + rttEnabled_ = input.readBool(); + bitField0_ |= 0x00000008; + break; + } // case 32 + default: { + if (!super.parseUnknownField(input, extensionRegistry, tag)) { + done = true; // was an endgroup tag + } + break; + } // default: + } // switch (tag) + } // while (!done) } catch (com.google.protobuf.InvalidProtocolBufferException e) { - parsedMessage = (GNSS_Sample) e.getUnfinishedMessage(); throw e.unwrapIOException(); } finally { - if (parsedMessage != null) { - mergeFrom(parsedMessage); - } - } - return this; - } - - private long relativeTimestamp_ ; - /** - * optional int64 relative_timestamp = 1; - */ - public long getRelativeTimestamp() { - return relativeTimestamp_; - } - /** - * optional int64 relative_timestamp = 1; - */ - public Builder setRelativeTimestamp(long value) { - - relativeTimestamp_ = value; - onChanged(); - return this; - } - /** - * optional int64 relative_timestamp = 1; - */ - public Builder clearRelativeTimestamp() { - - relativeTimestamp_ = 0L; - onChanged(); - return this; - } - - private float latitude_ ; - /** - *
-       * degrees (minimum 6 significant figures)
-       * latitude between -90 and 90
-       * 
- * - * optional float latitude = 2; - */ - public float getLatitude() { - return latitude_; - } - /** - *
-       * degrees (minimum 6 significant figures)
-       * latitude between -90 and 90
-       * 
- * - * optional float latitude = 2; - */ - public Builder setLatitude(float value) { - - latitude_ = value; - onChanged(); - return this; - } - /** - *
-       * degrees (minimum 6 significant figures)
-       * latitude between -90 and 90
-       * 
- * - * optional float latitude = 2; - */ - public Builder clearLatitude() { - - latitude_ = 0F; - onChanged(); + onChanged(); + } // finally return this; } + private int bitField0_; - private float longitude_ ; - /** - *
-       * longitude between -180 and 180
-       * 
- * - * optional float longitude = 3; - */ - public float getLongitude() { - return longitude_; - } + private long mac_ ; /** *
-       * longitude between -180 and 180
+       * Integer encoding of the hex mac address (BSSID)
+       * e.g. 207394925843984
        * 
* - * optional float longitude = 3; + * int64 mac = 1; + * @return The mac. */ - public Builder setLongitude(float value) { - - longitude_ = value; - onChanged(); - return this; + @java.lang.Override + public long getMac() { + return mac_; } /** *
-       * longitude between -180 and 180
+       * Integer encoding of the hex mac address (BSSID)
+       * e.g. 207394925843984
        * 
* - * optional float longitude = 3; + * int64 mac = 1; + * @param value The mac to set. + * @return This builder for chaining. */ - public Builder clearLongitude() { - - longitude_ = 0F; - onChanged(); - return this; - } + public Builder setMac(long value) { - private float altitude_ ; - /** - *
-       *metres
-       * 
- * - * optional float altitude = 4; - */ - public float getAltitude() { - return altitude_; - } - /** - *
-       *metres
-       * 
- * - * optional float altitude = 4; - */ - public Builder setAltitude(float value) { - - altitude_ = value; + mac_ = value; + bitField0_ |= 0x00000001; onChanged(); return this; } /** *
-       *metres
+       * Integer encoding of the hex mac address (BSSID)
+       * e.g. 207394925843984
        * 
* - * optional float altitude = 4; + * int64 mac = 1; + * @return This builder for chaining. */ - public Builder clearAltitude() { - - altitude_ = 0F; + public Builder clearMac() { + bitField0_ = (bitField0_ & ~0x00000001); + mac_ = 0L; onChanged(); return this; } - private float accuracy_ ; + private java.lang.Object ssid_ = ""; /** *
-       * metres
+       * E.g. 'Eduroam' or 'Starbucks_free_wifi'
        * 
* - * optional float accuracy = 5; + * string ssid = 2; + * @return The ssid. */ - public float getAccuracy() { - return accuracy_; + public java.lang.String getSsid() { + java.lang.Object ref = ssid_; + if (!(ref instanceof java.lang.String)) { + com.google.protobuf.ByteString bs = + (com.google.protobuf.ByteString) ref; + java.lang.String s = bs.toStringUtf8(); + ssid_ = s; + return s; + } else { + return (java.lang.String) ref; + } } /** *
-       * metres
+       * E.g. 'Eduroam' or 'Starbucks_free_wifi'
        * 
* - * optional float accuracy = 5; + * string ssid = 2; + * @return The bytes for ssid. */ - public Builder setAccuracy(float value) { - - accuracy_ = value; - onChanged(); - return this; + public com.google.protobuf.ByteString + getSsidBytes() { + java.lang.Object ref = ssid_; + if (ref instanceof String) { + com.google.protobuf.ByteString b = + com.google.protobuf.ByteString.copyFromUtf8( + (java.lang.String) ref); + ssid_ = b; + return b; + } else { + return (com.google.protobuf.ByteString) ref; + } } /** *
-       * metres
+       * E.g. 'Eduroam' or 'Starbucks_free_wifi'
        * 
* - * optional float accuracy = 5; + * string ssid = 2; + * @param value The ssid to set. + * @return This builder for chaining. */ - public Builder clearAccuracy() { - - accuracy_ = 0F; + public Builder setSsid( + java.lang.String value) { + if (value == null) { throw new NullPointerException(); } + ssid_ = value; + bitField0_ |= 0x00000002; onChanged(); return this; } - - private float speed_ ; /** *
-       * m/s
+       * E.g. 'Eduroam' or 'Starbucks_free_wifi'
        * 
* - * optional float speed = 6; + * string ssid = 2; + * @return This builder for chaining. */ - public float getSpeed() { - return speed_; + public Builder clearSsid() { + ssid_ = getDefaultInstance().getSsid(); + bitField0_ = (bitField0_ & ~0x00000002); + onChanged(); + return this; } /** *
-       * m/s
+       * E.g. 'Eduroam' or 'Starbucks_free_wifi'
        * 
* - * optional float speed = 6; + * string ssid = 2; + * @param value The bytes for ssid to set. + * @return This builder for chaining. */ - public Builder setSpeed(float value) { - - speed_ = value; + public Builder setSsidBytes( + com.google.protobuf.ByteString value) { + if (value == null) { throw new NullPointerException(); } + checkByteStringIsUtf8(value); + ssid_ = value; + bitField0_ |= 0x00000002; onChanged(); return this; } + + private long frequency_ ; /** *
-       * m/s
+       * Typically 2.4GHz or 5GHz
        * 
* - * optional float speed = 6; + * int64 frequency = 3; + * @return The frequency. */ - public Builder clearSpeed() { - - speed_ = 0F; - onChanged(); - return this; + @java.lang.Override + public long getFrequency() { + return frequency_; } - - private Object provider_ = ""; /** *
-       * e.g 'gps' or 'network'
+       * Typically 2.4GHz or 5GHz
        * 
* - * optional string provider = 7; + * int64 frequency = 3; + * @param value The frequency to set. + * @return This builder for chaining. */ - public String getProvider() { - Object ref = provider_; - if (!(ref instanceof String)) { - com.google.protobuf.ByteString bs = - (com.google.protobuf.ByteString) ref; - String s = bs.toStringUtf8(); - provider_ = s; - return s; - } else { - return (String) ref; - } + public Builder setFrequency(long value) { + + frequency_ = value; + bitField0_ |= 0x00000004; + onChanged(); + return this; } /** *
-       * e.g 'gps' or 'network'
+       * Typically 2.4GHz or 5GHz
        * 
* - * optional string provider = 7; + * int64 frequency = 3; + * @return This builder for chaining. */ - public com.google.protobuf.ByteString - getProviderBytes() { - Object ref = provider_; - if (ref instanceof String) { - com.google.protobuf.ByteString b = - com.google.protobuf.ByteString.copyFromUtf8( - (String) ref); - provider_ = b; - return b; - } else { - return (com.google.protobuf.ByteString) ref; - } + public Builder clearFrequency() { + bitField0_ = (bitField0_ & ~0x00000004); + frequency_ = 0L; + onChanged(); + return this; } + + private boolean rttEnabled_ ; /** *
-       * e.g 'gps' or 'network'
+       * Flag to indicate if the AP supports RTT measurements
        * 
* - * optional string provider = 7; + * bool rtt_enabled = 4; + * @return The rttEnabled. */ - public Builder setProvider( - String value) { - if (value == null) { - throw new NullPointerException(); - } - - provider_ = value; - onChanged(); - return this; + @java.lang.Override + public boolean getRttEnabled() { + return rttEnabled_; } /** *
-       * e.g 'gps' or 'network'
+       * Flag to indicate if the AP supports RTT measurements
        * 
* - * optional string provider = 7; + * bool rtt_enabled = 4; + * @param value The rttEnabled to set. + * @return This builder for chaining. */ - public Builder clearProvider() { - - provider_ = getDefaultInstance().getProvider(); + public Builder setRttEnabled(boolean value) { + + rttEnabled_ = value; + bitField0_ |= 0x00000008; onChanged(); return this; } /** *
-       * e.g 'gps' or 'network'
+       * Flag to indicate if the AP supports RTT measurements
        * 
* - * optional string provider = 7; + * bool rtt_enabled = 4; + * @return This builder for chaining. */ - public Builder setProviderBytes( - com.google.protobuf.ByteString value) { - if (value == null) { - throw new NullPointerException(); - } - checkByteStringIsUtf8(value); - - provider_ = value; + public Builder clearRttEnabled() { + bitField0_ = (bitField0_ & ~0x00000008); + rttEnabled_ = false; onChanged(); return this; } - public final Builder setUnknownFields( - final com.google.protobuf.UnknownFieldSet unknownFields) { - return this; - } - - public final Builder mergeUnknownFields( - final com.google.protobuf.UnknownFieldSet unknownFields) { - return this; - } - - // @@protoc_insertion_point(builder_scope:GNSS_Sample) + // @@protoc_insertion_point(builder_scope:WiFiAPData) } - // @@protoc_insertion_point(class_scope:GNSS_Sample) - private static final GNSS_Sample DEFAULT_INSTANCE; + // @@protoc_insertion_point(class_scope:WiFiAPData) + private static final com.openpositioning.PositionMe.Traj.WiFiAPData DEFAULT_INSTANCE; static { - DEFAULT_INSTANCE = new GNSS_Sample(); + DEFAULT_INSTANCE = new com.openpositioning.PositionMe.Traj.WiFiAPData(); } - public static GNSS_Sample getDefaultInstance() { + public static com.openpositioning.PositionMe.Traj.WiFiAPData getDefaultInstance() { return DEFAULT_INSTANCE; } - private static final com.google.protobuf.Parser - PARSER = new com.google.protobuf.AbstractParser() { - public GNSS_Sample parsePartialFrom( - com.google.protobuf.CodedInputStream input, - com.google.protobuf.ExtensionRegistryLite extensionRegistry) - throws com.google.protobuf.InvalidProtocolBufferException { - return new GNSS_Sample(input, extensionRegistry); + private static final com.google.protobuf.Parser + PARSER = new com.google.protobuf.AbstractParser() { + @java.lang.Override + public WiFiAPData parsePartialFrom( + com.google.protobuf.CodedInputStream input, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + Builder builder = newBuilder(); + try { + builder.mergeFrom(input, extensionRegistry); + } catch (com.google.protobuf.InvalidProtocolBufferException e) { + throw e.setUnfinishedMessage(builder.buildPartial()); + } catch (com.google.protobuf.UninitializedMessageException e) { + throw e.asInvalidProtocolBufferException().setUnfinishedMessage(builder.buildPartial()); + } catch (java.io.IOException e) { + throw new com.google.protobuf.InvalidProtocolBufferException(e) + .setUnfinishedMessage(builder.buildPartial()); + } + return builder.buildPartial(); } }; - public static com.google.protobuf.Parser parser() { + public static com.google.protobuf.Parser parser() { return PARSER; } - @Override - public com.google.protobuf.Parser getParserForType() { + @java.lang.Override + public com.google.protobuf.Parser getParserForType() { return PARSER; } - public GNSS_Sample getDefaultInstanceForType() { + @java.lang.Override + public com.openpositioning.PositionMe.Traj.WiFiAPData getDefaultInstanceForType() { return DEFAULT_INSTANCE; } } - public interface WiFi_SampleOrBuilder extends - // @@protoc_insertion_point(interface_extends:WiFi_Sample) - com.google.protobuf.MessageOrBuilder { + public interface BleDataOrBuilder extends + // @@protoc_insertion_point(interface_extends:BleData) + com.google.protobuf.MessageOrBuilder { /** - * optional int64 relative_timestamp = 1; + * string mac_address = 1; + * @return The macAddress. */ - long getRelativeTimestamp(); + java.lang.String getMacAddress(); + /** + * string mac_address = 1; + * @return The bytes for macAddress. + */ + com.google.protobuf.ByteString + getMacAddressBytes(); /** - * repeated .Mac_Scan mac_scans = 2; + * string name = 2; + * @return The name. */ - java.util.List - getMacScansList(); + java.lang.String getName(); /** - * repeated .Mac_Scan mac_scans = 2; + * string name = 2; + * @return The bytes for name. */ - Mac_Scan getMacScans(int index); + com.google.protobuf.ByteString + getNameBytes(); + + /** + * int32 tx_power_level = 3; + * @return The txPowerLevel. + */ + int getTxPowerLevel(); + + /** + * int32 advertise_flags = 4; + * @return The advertiseFlags. + */ + int getAdvertiseFlags(); + /** - * repeated .Mac_Scan mac_scans = 2; + * repeated string service_uuids = 5; + * @return A list containing the serviceUuids. */ - int getMacScansCount(); + java.util.List + getServiceUuidsList(); /** - * repeated .Mac_Scan mac_scans = 2; + * repeated string service_uuids = 5; + * @return The count of serviceUuids. */ - java.util.List - getMacScansOrBuilderList(); + int getServiceUuidsCount(); /** - * repeated .Mac_Scan mac_scans = 2; + * repeated string service_uuids = 5; + * @param index The index of the element to return. + * @return The serviceUuids at the given index. */ - Mac_ScanOrBuilder getMacScansOrBuilder( - int index); + java.lang.String getServiceUuids(int index); + /** + * repeated string service_uuids = 5; + * @param index The index of the value to return. + * @return The bytes of the serviceUuids at the given index. + */ + com.google.protobuf.ByteString + getServiceUuidsBytes(int index); + + /** + * bytes manufacturer_data = 6; + * @return The manufacturerData. + */ + com.google.protobuf.ByteString getManufacturerData(); } /** - * Protobuf type {@code WiFi_Sample} + * Protobuf type {@code BleData} */ - public static final class WiFi_Sample extends - com.google.protobuf.GeneratedMessageV3 implements - // @@protoc_insertion_point(message_implements:WiFi_Sample) - WiFi_SampleOrBuilder { - // Use WiFi_Sample.newBuilder() to construct. - private WiFi_Sample(com.google.protobuf.GeneratedMessageV3.Builder builder) { + public static final class BleData extends + com.google.protobuf.GeneratedMessage implements + // @@protoc_insertion_point(message_implements:BleData) + BleDataOrBuilder { + private static final long serialVersionUID = 0L; + static { + com.google.protobuf.RuntimeVersion.validateProtobufGencodeVersion( + com.google.protobuf.RuntimeVersion.RuntimeDomain.PUBLIC, + /* major= */ 4, + /* minor= */ 29, + /* patch= */ 6, + /* suffix= */ "", + BleData.class.getName()); + } + // Use BleData.newBuilder() to construct. + private BleData(com.google.protobuf.GeneratedMessage.Builder builder) { super(builder); } - private WiFi_Sample() { - relativeTimestamp_ = 0L; - macScans_ = java.util.Collections.emptyList(); - } - - @Override - public final com.google.protobuf.UnknownFieldSet - getUnknownFields() { - return com.google.protobuf.UnknownFieldSet.getDefaultInstance(); - } - private WiFi_Sample( - com.google.protobuf.CodedInputStream input, - com.google.protobuf.ExtensionRegistryLite extensionRegistry) - throws com.google.protobuf.InvalidProtocolBufferException { - this(); - int mutable_bitField0_ = 0; - try { - boolean done = false; - while (!done) { - int tag = input.readTag(); - switch (tag) { - case 0: - done = true; - break; - default: { - if (!input.skipField(tag)) { - done = true; - } - break; - } - case 8: { + private BleData() { + macAddress_ = ""; + name_ = ""; + serviceUuids_ = + com.google.protobuf.LazyStringArrayList.emptyList(); + manufacturerData_ = com.google.protobuf.ByteString.EMPTY; + } - relativeTimestamp_ = input.readInt64(); - break; - } - case 18: { - if (!((mutable_bitField0_ & 0x00000002) == 0x00000002)) { - macScans_ = new java.util.ArrayList(); - mutable_bitField0_ |= 0x00000002; - } - macScans_.add( - input.readMessage(Mac_Scan.parser(), extensionRegistry)); - break; - } - } - } - } catch (com.google.protobuf.InvalidProtocolBufferException e) { - throw e.setUnfinishedMessage(this); - } catch (java.io.IOException e) { - throw new com.google.protobuf.InvalidProtocolBufferException( - e).setUnfinishedMessage(this); - } finally { - if (((mutable_bitField0_ & 0x00000002) == 0x00000002)) { - macScans_ = java.util.Collections.unmodifiableList(macScans_); - } - makeExtensionsImmutable(); + public static final com.google.protobuf.Descriptors.Descriptor + getDescriptor() { + return com.openpositioning.PositionMe.Traj.internal_static_BleData_descriptor; + } + + @java.lang.Override + protected com.google.protobuf.GeneratedMessage.FieldAccessorTable + internalGetFieldAccessorTable() { + return com.openpositioning.PositionMe.Traj.internal_static_BleData_fieldAccessorTable + .ensureFieldAccessorsInitialized( + com.openpositioning.PositionMe.Traj.BleData.class, com.openpositioning.PositionMe.Traj.BleData.Builder.class); + } + + public static final int MAC_ADDRESS_FIELD_NUMBER = 1; + @SuppressWarnings("serial") + private volatile java.lang.Object macAddress_ = ""; + /** + * string mac_address = 1; + * @return The macAddress. + */ + @java.lang.Override + public java.lang.String getMacAddress() { + java.lang.Object ref = macAddress_; + if (ref instanceof java.lang.String) { + return (java.lang.String) ref; + } else { + com.google.protobuf.ByteString bs = + (com.google.protobuf.ByteString) ref; + java.lang.String s = bs.toStringUtf8(); + macAddress_ = s; + return s; } } - public static final com.google.protobuf.Descriptors.Descriptor - getDescriptor() { - return Traj.internal_static_WiFi_Sample_descriptor; + /** + * string mac_address = 1; + * @return The bytes for macAddress. + */ + @java.lang.Override + public com.google.protobuf.ByteString + getMacAddressBytes() { + java.lang.Object ref = macAddress_; + if (ref instanceof java.lang.String) { + com.google.protobuf.ByteString b = + com.google.protobuf.ByteString.copyFromUtf8( + (java.lang.String) ref); + macAddress_ = b; + return b; + } else { + return (com.google.protobuf.ByteString) ref; + } + } + + public static final int NAME_FIELD_NUMBER = 2; + @SuppressWarnings("serial") + private volatile java.lang.Object name_ = ""; + /** + * string name = 2; + * @return The name. + */ + @java.lang.Override + public java.lang.String getName() { + java.lang.Object ref = name_; + if (ref instanceof java.lang.String) { + return (java.lang.String) ref; + } else { + com.google.protobuf.ByteString bs = + (com.google.protobuf.ByteString) ref; + java.lang.String s = bs.toStringUtf8(); + name_ = s; + return s; + } + } + /** + * string name = 2; + * @return The bytes for name. + */ + @java.lang.Override + public com.google.protobuf.ByteString + getNameBytes() { + java.lang.Object ref = name_; + if (ref instanceof java.lang.String) { + com.google.protobuf.ByteString b = + com.google.protobuf.ByteString.copyFromUtf8( + (java.lang.String) ref); + name_ = b; + return b; + } else { + return (com.google.protobuf.ByteString) ref; + } } - protected com.google.protobuf.GeneratedMessageV3.FieldAccessorTable - internalGetFieldAccessorTable() { - return Traj.internal_static_WiFi_Sample_fieldAccessorTable - .ensureFieldAccessorsInitialized( - WiFi_Sample.class, Builder.class); + public static final int TX_POWER_LEVEL_FIELD_NUMBER = 3; + private int txPowerLevel_ = 0; + /** + * int32 tx_power_level = 3; + * @return The txPowerLevel. + */ + @java.lang.Override + public int getTxPowerLevel() { + return txPowerLevel_; } - private int bitField0_; - public static final int RELATIVE_TIMESTAMP_FIELD_NUMBER = 1; - private long relativeTimestamp_; + public static final int ADVERTISE_FLAGS_FIELD_NUMBER = 4; + private int advertiseFlags_ = 0; /** - * optional int64 relative_timestamp = 1; + * int32 advertise_flags = 4; + * @return The advertiseFlags. */ - public long getRelativeTimestamp() { - return relativeTimestamp_; + @java.lang.Override + public int getAdvertiseFlags() { + return advertiseFlags_; } - public static final int MAC_SCANS_FIELD_NUMBER = 2; - private java.util.List macScans_; + public static final int SERVICE_UUIDS_FIELD_NUMBER = 5; + @SuppressWarnings("serial") + private com.google.protobuf.LazyStringArrayList serviceUuids_ = + com.google.protobuf.LazyStringArrayList.emptyList(); /** - * repeated .Mac_Scan mac_scans = 2; + * repeated string service_uuids = 5; + * @return A list containing the serviceUuids. */ - public java.util.List getMacScansList() { - return macScans_; + public com.google.protobuf.ProtocolStringList + getServiceUuidsList() { + return serviceUuids_; } /** - * repeated .Mac_Scan mac_scans = 2; + * repeated string service_uuids = 5; + * @return The count of serviceUuids. */ - public java.util.List - getMacScansOrBuilderList() { - return macScans_; + public int getServiceUuidsCount() { + return serviceUuids_.size(); } /** - * repeated .Mac_Scan mac_scans = 2; + * repeated string service_uuids = 5; + * @param index The index of the element to return. + * @return The serviceUuids at the given index. */ - public int getMacScansCount() { - return macScans_.size(); + public java.lang.String getServiceUuids(int index) { + return serviceUuids_.get(index); } /** - * repeated .Mac_Scan mac_scans = 2; + * repeated string service_uuids = 5; + * @param index The index of the value to return. + * @return The bytes of the serviceUuids at the given index. */ - public Mac_Scan getMacScans(int index) { - return macScans_.get(index); + public com.google.protobuf.ByteString + getServiceUuidsBytes(int index) { + return serviceUuids_.getByteString(index); } + + public static final int MANUFACTURER_DATA_FIELD_NUMBER = 6; + private com.google.protobuf.ByteString manufacturerData_ = com.google.protobuf.ByteString.EMPTY; /** - * repeated .Mac_Scan mac_scans = 2; + * bytes manufacturer_data = 6; + * @return The manufacturerData. */ - public Mac_ScanOrBuilder getMacScansOrBuilder( - int index) { - return macScans_.get(index); + @java.lang.Override + public com.google.protobuf.ByteString getManufacturerData() { + return manufacturerData_; } private byte memoizedIsInitialized = -1; + @java.lang.Override public final boolean isInitialized() { byte isInitialized = memoizedIsInitialized; if (isInitialized == 1) return true; @@ -9623,786 +17670,921 @@ public final boolean isInitialized() { return true; } + @java.lang.Override public void writeTo(com.google.protobuf.CodedOutputStream output) - throws java.io.IOException { - if (relativeTimestamp_ != 0L) { - output.writeInt64(1, relativeTimestamp_); + throws java.io.IOException { + if (!com.google.protobuf.GeneratedMessage.isStringEmpty(macAddress_)) { + com.google.protobuf.GeneratedMessage.writeString(output, 1, macAddress_); + } + if (!com.google.protobuf.GeneratedMessage.isStringEmpty(name_)) { + com.google.protobuf.GeneratedMessage.writeString(output, 2, name_); + } + if (txPowerLevel_ != 0) { + output.writeInt32(3, txPowerLevel_); + } + if (advertiseFlags_ != 0) { + output.writeInt32(4, advertiseFlags_); } - for (int i = 0; i < macScans_.size(); i++) { - output.writeMessage(2, macScans_.get(i)); + for (int i = 0; i < serviceUuids_.size(); i++) { + com.google.protobuf.GeneratedMessage.writeString(output, 5, serviceUuids_.getRaw(i)); } + if (!manufacturerData_.isEmpty()) { + output.writeBytes(6, manufacturerData_); + } + getUnknownFields().writeTo(output); } + @java.lang.Override public int getSerializedSize() { int size = memoizedSize; if (size != -1) return size; size = 0; - if (relativeTimestamp_ != 0L) { + if (!com.google.protobuf.GeneratedMessage.isStringEmpty(macAddress_)) { + size += com.google.protobuf.GeneratedMessage.computeStringSize(1, macAddress_); + } + if (!com.google.protobuf.GeneratedMessage.isStringEmpty(name_)) { + size += com.google.protobuf.GeneratedMessage.computeStringSize(2, name_); + } + if (txPowerLevel_ != 0) { size += com.google.protobuf.CodedOutputStream - .computeInt64Size(1, relativeTimestamp_); + .computeInt32Size(3, txPowerLevel_); + } + if (advertiseFlags_ != 0) { + size += com.google.protobuf.CodedOutputStream + .computeInt32Size(4, advertiseFlags_); + } + { + int dataSize = 0; + for (int i = 0; i < serviceUuids_.size(); i++) { + dataSize += computeStringSizeNoTag(serviceUuids_.getRaw(i)); + } + size += dataSize; + size += 1 * getServiceUuidsList().size(); } - for (int i = 0; i < macScans_.size(); i++) { + if (!manufacturerData_.isEmpty()) { size += com.google.protobuf.CodedOutputStream - .computeMessageSize(2, macScans_.get(i)); + .computeBytesSize(6, manufacturerData_); } + size += getUnknownFields().getSerializedSize(); memoizedSize = size; return size; } - private static final long serialVersionUID = 0L; - @Override - public boolean equals(final Object obj) { + @java.lang.Override + public boolean equals(final java.lang.Object obj) { if (obj == this) { - return true; + return true; } - if (!(obj instanceof WiFi_Sample)) { + if (!(obj instanceof com.openpositioning.PositionMe.Traj.BleData)) { return super.equals(obj); } - WiFi_Sample other = (WiFi_Sample) obj; - - boolean result = true; - result = result && (getRelativeTimestamp() - == other.getRelativeTimestamp()); - result = result && getMacScansList() - .equals(other.getMacScansList()); - return result; + com.openpositioning.PositionMe.Traj.BleData other = (com.openpositioning.PositionMe.Traj.BleData) obj; + + if (!getMacAddress() + .equals(other.getMacAddress())) return false; + if (!getName() + .equals(other.getName())) return false; + if (getTxPowerLevel() + != other.getTxPowerLevel()) return false; + if (getAdvertiseFlags() + != other.getAdvertiseFlags()) return false; + if (!getServiceUuidsList() + .equals(other.getServiceUuidsList())) return false; + if (!getManufacturerData() + .equals(other.getManufacturerData())) return false; + if (!getUnknownFields().equals(other.getUnknownFields())) return false; + return true; } - @Override + @java.lang.Override public int hashCode() { if (memoizedHashCode != 0) { return memoizedHashCode; } int hash = 41; - hash = (19 * hash) + getDescriptorForType().hashCode(); - hash = (37 * hash) + RELATIVE_TIMESTAMP_FIELD_NUMBER; - hash = (53 * hash) + com.google.protobuf.Internal.hashLong( - getRelativeTimestamp()); - if (getMacScansCount() > 0) { - hash = (37 * hash) + MAC_SCANS_FIELD_NUMBER; - hash = (53 * hash) + getMacScansList().hashCode(); - } - hash = (29 * hash) + unknownFields.hashCode(); + hash = (19 * hash) + getDescriptor().hashCode(); + hash = (37 * hash) + MAC_ADDRESS_FIELD_NUMBER; + hash = (53 * hash) + getMacAddress().hashCode(); + hash = (37 * hash) + NAME_FIELD_NUMBER; + hash = (53 * hash) + getName().hashCode(); + hash = (37 * hash) + TX_POWER_LEVEL_FIELD_NUMBER; + hash = (53 * hash) + getTxPowerLevel(); + hash = (37 * hash) + ADVERTISE_FLAGS_FIELD_NUMBER; + hash = (53 * hash) + getAdvertiseFlags(); + if (getServiceUuidsCount() > 0) { + hash = (37 * hash) + SERVICE_UUIDS_FIELD_NUMBER; + hash = (53 * hash) + getServiceUuidsList().hashCode(); + } + hash = (37 * hash) + MANUFACTURER_DATA_FIELD_NUMBER; + hash = (53 * hash) + getManufacturerData().hashCode(); + hash = (29 * hash) + getUnknownFields().hashCode(); memoizedHashCode = hash; return hash; } - public static WiFi_Sample parseFrom( - com.google.protobuf.ByteString data) - throws com.google.protobuf.InvalidProtocolBufferException { + public static com.openpositioning.PositionMe.Traj.BleData parseFrom( + java.nio.ByteBuffer data) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + public static com.openpositioning.PositionMe.Traj.BleData parseFrom( + java.nio.ByteBuffer data, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data, extensionRegistry); + } + public static com.openpositioning.PositionMe.Traj.BleData parseFrom( + com.google.protobuf.ByteString data) + throws com.google.protobuf.InvalidProtocolBufferException { return PARSER.parseFrom(data); } - public static WiFi_Sample parseFrom( - com.google.protobuf.ByteString data, - com.google.protobuf.ExtensionRegistryLite extensionRegistry) - throws com.google.protobuf.InvalidProtocolBufferException { + public static com.openpositioning.PositionMe.Traj.BleData parseFrom( + com.google.protobuf.ByteString data, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { return PARSER.parseFrom(data, extensionRegistry); } - public static WiFi_Sample parseFrom(byte[] data) - throws com.google.protobuf.InvalidProtocolBufferException { + public static com.openpositioning.PositionMe.Traj.BleData parseFrom(byte[] data) + throws com.google.protobuf.InvalidProtocolBufferException { return PARSER.parseFrom(data); } - public static WiFi_Sample parseFrom( - byte[] data, - com.google.protobuf.ExtensionRegistryLite extensionRegistry) - throws com.google.protobuf.InvalidProtocolBufferException { + public static com.openpositioning.PositionMe.Traj.BleData parseFrom( + byte[] data, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { return PARSER.parseFrom(data, extensionRegistry); } - public static WiFi_Sample parseFrom(java.io.InputStream input) - throws java.io.IOException { - return com.google.protobuf.GeneratedMessageV3 - .parseWithIOException(PARSER, input); - } - public static WiFi_Sample parseFrom( - java.io.InputStream input, - com.google.protobuf.ExtensionRegistryLite extensionRegistry) - throws java.io.IOException { - return com.google.protobuf.GeneratedMessageV3 - .parseWithIOException(PARSER, input, extensionRegistry); - } - public static WiFi_Sample parseDelimitedFrom(java.io.InputStream input) - throws java.io.IOException { - return com.google.protobuf.GeneratedMessageV3 - .parseDelimitedWithIOException(PARSER, input); - } - public static WiFi_Sample parseDelimitedFrom( - java.io.InputStream input, - com.google.protobuf.ExtensionRegistryLite extensionRegistry) - throws java.io.IOException { - return com.google.protobuf.GeneratedMessageV3 - .parseDelimitedWithIOException(PARSER, input, extensionRegistry); - } - public static WiFi_Sample parseFrom( - com.google.protobuf.CodedInputStream input) - throws java.io.IOException { - return com.google.protobuf.GeneratedMessageV3 - .parseWithIOException(PARSER, input); - } - public static WiFi_Sample parseFrom( - com.google.protobuf.CodedInputStream input, - com.google.protobuf.ExtensionRegistryLite extensionRegistry) - throws java.io.IOException { - return com.google.protobuf.GeneratedMessageV3 - .parseWithIOException(PARSER, input, extensionRegistry); + public static com.openpositioning.PositionMe.Traj.BleData parseFrom(java.io.InputStream input) + throws java.io.IOException { + return com.google.protobuf.GeneratedMessage + .parseWithIOException(PARSER, input); + } + public static com.openpositioning.PositionMe.Traj.BleData parseFrom( + java.io.InputStream input, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws java.io.IOException { + return com.google.protobuf.GeneratedMessage + .parseWithIOException(PARSER, input, extensionRegistry); + } + + public static com.openpositioning.PositionMe.Traj.BleData parseDelimitedFrom(java.io.InputStream input) + throws java.io.IOException { + return com.google.protobuf.GeneratedMessage + .parseDelimitedWithIOException(PARSER, input); + } + + public static com.openpositioning.PositionMe.Traj.BleData parseDelimitedFrom( + java.io.InputStream input, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws java.io.IOException { + return com.google.protobuf.GeneratedMessage + .parseDelimitedWithIOException(PARSER, input, extensionRegistry); + } + public static com.openpositioning.PositionMe.Traj.BleData parseFrom( + com.google.protobuf.CodedInputStream input) + throws java.io.IOException { + return com.google.protobuf.GeneratedMessage + .parseWithIOException(PARSER, input); + } + public static com.openpositioning.PositionMe.Traj.BleData parseFrom( + com.google.protobuf.CodedInputStream input, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws java.io.IOException { + return com.google.protobuf.GeneratedMessage + .parseWithIOException(PARSER, input, extensionRegistry); } + @java.lang.Override public Builder newBuilderForType() { return newBuilder(); } public static Builder newBuilder() { return DEFAULT_INSTANCE.toBuilder(); } - public static Builder newBuilder(WiFi_Sample prototype) { + public static Builder newBuilder(com.openpositioning.PositionMe.Traj.BleData prototype) { return DEFAULT_INSTANCE.toBuilder().mergeFrom(prototype); } + @java.lang.Override public Builder toBuilder() { return this == DEFAULT_INSTANCE - ? new Builder() : new Builder().mergeFrom(this); + ? new Builder() : new Builder().mergeFrom(this); } - @Override + @java.lang.Override protected Builder newBuilderForType( - com.google.protobuf.GeneratedMessageV3.BuilderParent parent) { + com.google.protobuf.GeneratedMessage.BuilderParent parent) { Builder builder = new Builder(parent); return builder; } /** - * Protobuf type {@code WiFi_Sample} + * Protobuf type {@code BleData} */ public static final class Builder extends - com.google.protobuf.GeneratedMessageV3.Builder implements - // @@protoc_insertion_point(builder_implements:WiFi_Sample) - WiFi_SampleOrBuilder { + com.google.protobuf.GeneratedMessage.Builder implements + // @@protoc_insertion_point(builder_implements:BleData) + com.openpositioning.PositionMe.Traj.BleDataOrBuilder { public static final com.google.protobuf.Descriptors.Descriptor - getDescriptor() { - return Traj.internal_static_WiFi_Sample_descriptor; + getDescriptor() { + return com.openpositioning.PositionMe.Traj.internal_static_BleData_descriptor; } - protected com.google.protobuf.GeneratedMessageV3.FieldAccessorTable - internalGetFieldAccessorTable() { - return Traj.internal_static_WiFi_Sample_fieldAccessorTable - .ensureFieldAccessorsInitialized( - WiFi_Sample.class, Builder.class); + @java.lang.Override + protected com.google.protobuf.GeneratedMessage.FieldAccessorTable + internalGetFieldAccessorTable() { + return com.openpositioning.PositionMe.Traj.internal_static_BleData_fieldAccessorTable + .ensureFieldAccessorsInitialized( + com.openpositioning.PositionMe.Traj.BleData.class, com.openpositioning.PositionMe.Traj.BleData.Builder.class); } - // Construct using Traj.WiFi_Sample.newBuilder() + // Construct using com.openpositioning.PositionMe.Traj.BleData.newBuilder() private Builder() { - maybeForceBuilderInitialization(); + } private Builder( - com.google.protobuf.GeneratedMessageV3.BuilderParent parent) { + com.google.protobuf.GeneratedMessage.BuilderParent parent) { super(parent); - maybeForceBuilderInitialization(); - } - private void maybeForceBuilderInitialization() { - if (com.google.protobuf.GeneratedMessageV3 - .alwaysUseFieldBuilders) { - getMacScansFieldBuilder(); - } + } + @java.lang.Override public Builder clear() { super.clear(); - relativeTimestamp_ = 0L; - - if (macScansBuilder_ == null) { - macScans_ = java.util.Collections.emptyList(); - bitField0_ = (bitField0_ & ~0x00000002); - } else { - macScansBuilder_.clear(); - } + bitField0_ = 0; + macAddress_ = ""; + name_ = ""; + txPowerLevel_ = 0; + advertiseFlags_ = 0; + serviceUuids_ = + com.google.protobuf.LazyStringArrayList.emptyList(); + manufacturerData_ = com.google.protobuf.ByteString.EMPTY; return this; } + @java.lang.Override public com.google.protobuf.Descriptors.Descriptor - getDescriptorForType() { - return Traj.internal_static_WiFi_Sample_descriptor; + getDescriptorForType() { + return com.openpositioning.PositionMe.Traj.internal_static_BleData_descriptor; } - public WiFi_Sample getDefaultInstanceForType() { - return WiFi_Sample.getDefaultInstance(); + @java.lang.Override + public com.openpositioning.PositionMe.Traj.BleData getDefaultInstanceForType() { + return com.openpositioning.PositionMe.Traj.BleData.getDefaultInstance(); } - public WiFi_Sample build() { - WiFi_Sample result = buildPartial(); + @java.lang.Override + public com.openpositioning.PositionMe.Traj.BleData build() { + com.openpositioning.PositionMe.Traj.BleData result = buildPartial(); if (!result.isInitialized()) { throw newUninitializedMessageException(result); } return result; } - public WiFi_Sample buildPartial() { - WiFi_Sample result = new WiFi_Sample(this); - int from_bitField0_ = bitField0_; - int to_bitField0_ = 0; - result.relativeTimestamp_ = relativeTimestamp_; - if (macScansBuilder_ == null) { - if (((bitField0_ & 0x00000002) == 0x00000002)) { - macScans_ = java.util.Collections.unmodifiableList(macScans_); - bitField0_ = (bitField0_ & ~0x00000002); - } - result.macScans_ = macScans_; - } else { - result.macScans_ = macScansBuilder_.build(); - } - result.bitField0_ = to_bitField0_; + @java.lang.Override + public com.openpositioning.PositionMe.Traj.BleData buildPartial() { + com.openpositioning.PositionMe.Traj.BleData result = new com.openpositioning.PositionMe.Traj.BleData(this); + if (bitField0_ != 0) { buildPartial0(result); } onBuilt(); return result; } - public Builder clone() { - return (Builder) super.clone(); - } - public Builder setField( - com.google.protobuf.Descriptors.FieldDescriptor field, - Object value) { - return (Builder) super.setField(field, value); - } - public Builder clearField( - com.google.protobuf.Descriptors.FieldDescriptor field) { - return (Builder) super.clearField(field); - } - public Builder clearOneof( - com.google.protobuf.Descriptors.OneofDescriptor oneof) { - return (Builder) super.clearOneof(oneof); - } - public Builder setRepeatedField( - com.google.protobuf.Descriptors.FieldDescriptor field, - int index, Object value) { - return (Builder) super.setRepeatedField(field, index, value); - } - public Builder addRepeatedField( - com.google.protobuf.Descriptors.FieldDescriptor field, - Object value) { - return (Builder) super.addRepeatedField(field, value); + private void buildPartial0(com.openpositioning.PositionMe.Traj.BleData result) { + int from_bitField0_ = bitField0_; + if (((from_bitField0_ & 0x00000001) != 0)) { + result.macAddress_ = macAddress_; + } + if (((from_bitField0_ & 0x00000002) != 0)) { + result.name_ = name_; + } + if (((from_bitField0_ & 0x00000004) != 0)) { + result.txPowerLevel_ = txPowerLevel_; + } + if (((from_bitField0_ & 0x00000008) != 0)) { + result.advertiseFlags_ = advertiseFlags_; + } + if (((from_bitField0_ & 0x00000010) != 0)) { + serviceUuids_.makeImmutable(); + result.serviceUuids_ = serviceUuids_; + } + if (((from_bitField0_ & 0x00000020) != 0)) { + result.manufacturerData_ = manufacturerData_; + } } + + @java.lang.Override public Builder mergeFrom(com.google.protobuf.Message other) { - if (other instanceof WiFi_Sample) { - return mergeFrom((WiFi_Sample)other); + if (other instanceof com.openpositioning.PositionMe.Traj.BleData) { + return mergeFrom((com.openpositioning.PositionMe.Traj.BleData)other); } else { super.mergeFrom(other); return this; } - } - - public Builder mergeFrom(WiFi_Sample other) { - if (other == WiFi_Sample.getDefaultInstance()) return this; - if (other.getRelativeTimestamp() != 0L) { - setRelativeTimestamp(other.getRelativeTimestamp()); + } + + public Builder mergeFrom(com.openpositioning.PositionMe.Traj.BleData other) { + if (other == com.openpositioning.PositionMe.Traj.BleData.getDefaultInstance()) return this; + if (!other.getMacAddress().isEmpty()) { + macAddress_ = other.macAddress_; + bitField0_ |= 0x00000001; + onChanged(); + } + if (!other.getName().isEmpty()) { + name_ = other.name_; + bitField0_ |= 0x00000002; + onChanged(); + } + if (other.getTxPowerLevel() != 0) { + setTxPowerLevel(other.getTxPowerLevel()); + } + if (other.getAdvertiseFlags() != 0) { + setAdvertiseFlags(other.getAdvertiseFlags()); } - if (macScansBuilder_ == null) { - if (!other.macScans_.isEmpty()) { - if (macScans_.isEmpty()) { - macScans_ = other.macScans_; - bitField0_ = (bitField0_ & ~0x00000002); - } else { - ensureMacScansIsMutable(); - macScans_.addAll(other.macScans_); - } - onChanged(); - } - } else { - if (!other.macScans_.isEmpty()) { - if (macScansBuilder_.isEmpty()) { - macScansBuilder_.dispose(); - macScansBuilder_ = null; - macScans_ = other.macScans_; - bitField0_ = (bitField0_ & ~0x00000002); - macScansBuilder_ = - com.google.protobuf.GeneratedMessageV3.alwaysUseFieldBuilders ? - getMacScansFieldBuilder() : null; - } else { - macScansBuilder_.addAllMessages(other.macScans_); - } + if (!other.serviceUuids_.isEmpty()) { + if (serviceUuids_.isEmpty()) { + serviceUuids_ = other.serviceUuids_; + bitField0_ |= 0x00000010; + } else { + ensureServiceUuidsIsMutable(); + serviceUuids_.addAll(other.serviceUuids_); } + onChanged(); + } + if (other.getManufacturerData() != com.google.protobuf.ByteString.EMPTY) { + setManufacturerData(other.getManufacturerData()); } + this.mergeUnknownFields(other.getUnknownFields()); onChanged(); return this; } + @java.lang.Override public final boolean isInitialized() { return true; } + @java.lang.Override public Builder mergeFrom( - com.google.protobuf.CodedInputStream input, - com.google.protobuf.ExtensionRegistryLite extensionRegistry) - throws java.io.IOException { - WiFi_Sample parsedMessage = null; + com.google.protobuf.CodedInputStream input, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws java.io.IOException { + if (extensionRegistry == null) { + throw new java.lang.NullPointerException(); + } try { - parsedMessage = PARSER.parsePartialFrom(input, extensionRegistry); + boolean done = false; + while (!done) { + int tag = input.readTag(); + switch (tag) { + case 0: + done = true; + break; + case 10: { + macAddress_ = input.readStringRequireUtf8(); + bitField0_ |= 0x00000001; + break; + } // case 10 + case 18: { + name_ = input.readStringRequireUtf8(); + bitField0_ |= 0x00000002; + break; + } // case 18 + case 24: { + txPowerLevel_ = input.readInt32(); + bitField0_ |= 0x00000004; + break; + } // case 24 + case 32: { + advertiseFlags_ = input.readInt32(); + bitField0_ |= 0x00000008; + break; + } // case 32 + case 42: { + java.lang.String s = input.readStringRequireUtf8(); + ensureServiceUuidsIsMutable(); + serviceUuids_.add(s); + break; + } // case 42 + case 50: { + manufacturerData_ = input.readBytes(); + bitField0_ |= 0x00000020; + break; + } // case 50 + default: { + if (!super.parseUnknownField(input, extensionRegistry, tag)) { + done = true; // was an endgroup tag + } + break; + } // default: + } // switch (tag) + } // while (!done) } catch (com.google.protobuf.InvalidProtocolBufferException e) { - parsedMessage = (WiFi_Sample) e.getUnfinishedMessage(); throw e.unwrapIOException(); } finally { - if (parsedMessage != null) { - mergeFrom(parsedMessage); - } - } + onChanged(); + } // finally return this; } private int bitField0_; - private long relativeTimestamp_ ; + private java.lang.Object macAddress_ = ""; /** - * optional int64 relative_timestamp = 1; + * string mac_address = 1; + * @return The macAddress. */ - public long getRelativeTimestamp() { - return relativeTimestamp_; + public java.lang.String getMacAddress() { + java.lang.Object ref = macAddress_; + if (!(ref instanceof java.lang.String)) { + com.google.protobuf.ByteString bs = + (com.google.protobuf.ByteString) ref; + java.lang.String s = bs.toStringUtf8(); + macAddress_ = s; + return s; + } else { + return (java.lang.String) ref; + } } /** - * optional int64 relative_timestamp = 1; + * string mac_address = 1; + * @return The bytes for macAddress. */ - public Builder setRelativeTimestamp(long value) { - - relativeTimestamp_ = value; + public com.google.protobuf.ByteString + getMacAddressBytes() { + java.lang.Object ref = macAddress_; + if (ref instanceof String) { + com.google.protobuf.ByteString b = + com.google.protobuf.ByteString.copyFromUtf8( + (java.lang.String) ref); + macAddress_ = b; + return b; + } else { + return (com.google.protobuf.ByteString) ref; + } + } + /** + * string mac_address = 1; + * @param value The macAddress to set. + * @return This builder for chaining. + */ + public Builder setMacAddress( + java.lang.String value) { + if (value == null) { throw new NullPointerException(); } + macAddress_ = value; + bitField0_ |= 0x00000001; onChanged(); return this; } /** - * optional int64 relative_timestamp = 1; + * string mac_address = 1; + * @return This builder for chaining. */ - public Builder clearRelativeTimestamp() { - - relativeTimestamp_ = 0L; + public Builder clearMacAddress() { + macAddress_ = getDefaultInstance().getMacAddress(); + bitField0_ = (bitField0_ & ~0x00000001); onChanged(); return this; } - - private java.util.List macScans_ = - java.util.Collections.emptyList(); - private void ensureMacScansIsMutable() { - if (!((bitField0_ & 0x00000002) == 0x00000002)) { - macScans_ = new java.util.ArrayList(macScans_); - bitField0_ |= 0x00000002; - } + /** + * string mac_address = 1; + * @param value The bytes for macAddress to set. + * @return This builder for chaining. + */ + public Builder setMacAddressBytes( + com.google.protobuf.ByteString value) { + if (value == null) { throw new NullPointerException(); } + checkByteStringIsUtf8(value); + macAddress_ = value; + bitField0_ |= 0x00000001; + onChanged(); + return this; } - private com.google.protobuf.RepeatedFieldBuilderV3< - Mac_Scan, Mac_Scan.Builder, Mac_ScanOrBuilder> macScansBuilder_; - + private java.lang.Object name_ = ""; /** - * repeated .Mac_Scan mac_scans = 2; + * string name = 2; + * @return The name. */ - public java.util.List getMacScansList() { - if (macScansBuilder_ == null) { - return java.util.Collections.unmodifiableList(macScans_); + public java.lang.String getName() { + java.lang.Object ref = name_; + if (!(ref instanceof java.lang.String)) { + com.google.protobuf.ByteString bs = + (com.google.protobuf.ByteString) ref; + java.lang.String s = bs.toStringUtf8(); + name_ = s; + return s; } else { - return macScansBuilder_.getMessageList(); + return (java.lang.String) ref; } } /** - * repeated .Mac_Scan mac_scans = 2; + * string name = 2; + * @return The bytes for name. */ - public int getMacScansCount() { - if (macScansBuilder_ == null) { - return macScans_.size(); + public com.google.protobuf.ByteString + getNameBytes() { + java.lang.Object ref = name_; + if (ref instanceof String) { + com.google.protobuf.ByteString b = + com.google.protobuf.ByteString.copyFromUtf8( + (java.lang.String) ref); + name_ = b; + return b; } else { - return macScansBuilder_.getCount(); + return (com.google.protobuf.ByteString) ref; } } /** - * repeated .Mac_Scan mac_scans = 2; + * string name = 2; + * @param value The name to set. + * @return This builder for chaining. */ - public Mac_Scan getMacScans(int index) { - if (macScansBuilder_ == null) { - return macScans_.get(index); - } else { - return macScansBuilder_.getMessage(index); - } + public Builder setName( + java.lang.String value) { + if (value == null) { throw new NullPointerException(); } + name_ = value; + bitField0_ |= 0x00000002; + onChanged(); + return this; } /** - * repeated .Mac_Scan mac_scans = 2; + * string name = 2; + * @return This builder for chaining. */ - public Builder setMacScans( - int index, Mac_Scan value) { - if (macScansBuilder_ == null) { - if (value == null) { - throw new NullPointerException(); - } - ensureMacScansIsMutable(); - macScans_.set(index, value); - onChanged(); - } else { - macScansBuilder_.setMessage(index, value); - } + public Builder clearName() { + name_ = getDefaultInstance().getName(); + bitField0_ = (bitField0_ & ~0x00000002); + onChanged(); return this; } /** - * repeated .Mac_Scan mac_scans = 2; + * string name = 2; + * @param value The bytes for name to set. + * @return This builder for chaining. */ - public Builder setMacScans( - int index, Mac_Scan.Builder builderForValue) { - if (macScansBuilder_ == null) { - ensureMacScansIsMutable(); - macScans_.set(index, builderForValue.build()); - onChanged(); - } else { - macScansBuilder_.setMessage(index, builderForValue.build()); - } + public Builder setNameBytes( + com.google.protobuf.ByteString value) { + if (value == null) { throw new NullPointerException(); } + checkByteStringIsUtf8(value); + name_ = value; + bitField0_ |= 0x00000002; + onChanged(); return this; } + + private int txPowerLevel_ ; /** - * repeated .Mac_Scan mac_scans = 2; + * int32 tx_power_level = 3; + * @return The txPowerLevel. */ - public Builder addMacScans(Mac_Scan value) { - if (macScansBuilder_ == null) { - if (value == null) { - throw new NullPointerException(); - } - ensureMacScansIsMutable(); - macScans_.add(value); - onChanged(); - } else { - macScansBuilder_.addMessage(value); - } - return this; + @java.lang.Override + public int getTxPowerLevel() { + return txPowerLevel_; } /** - * repeated .Mac_Scan mac_scans = 2; + * int32 tx_power_level = 3; + * @param value The txPowerLevel to set. + * @return This builder for chaining. */ - public Builder addMacScans( - int index, Mac_Scan value) { - if (macScansBuilder_ == null) { - if (value == null) { - throw new NullPointerException(); - } - ensureMacScansIsMutable(); - macScans_.add(index, value); - onChanged(); - } else { - macScansBuilder_.addMessage(index, value); - } + public Builder setTxPowerLevel(int value) { + + txPowerLevel_ = value; + bitField0_ |= 0x00000004; + onChanged(); return this; } /** - * repeated .Mac_Scan mac_scans = 2; + * int32 tx_power_level = 3; + * @return This builder for chaining. */ - public Builder addMacScans( - Mac_Scan.Builder builderForValue) { - if (macScansBuilder_ == null) { - ensureMacScansIsMutable(); - macScans_.add(builderForValue.build()); - onChanged(); - } else { - macScansBuilder_.addMessage(builderForValue.build()); - } + public Builder clearTxPowerLevel() { + bitField0_ = (bitField0_ & ~0x00000004); + txPowerLevel_ = 0; + onChanged(); return this; } + + private int advertiseFlags_ ; /** - * repeated .Mac_Scan mac_scans = 2; + * int32 advertise_flags = 4; + * @return The advertiseFlags. */ - public Builder addMacScans( - int index, Mac_Scan.Builder builderForValue) { - if (macScansBuilder_ == null) { - ensureMacScansIsMutable(); - macScans_.add(index, builderForValue.build()); - onChanged(); - } else { - macScansBuilder_.addMessage(index, builderForValue.build()); - } - return this; + @java.lang.Override + public int getAdvertiseFlags() { + return advertiseFlags_; } /** - * repeated .Mac_Scan mac_scans = 2; + * int32 advertise_flags = 4; + * @param value The advertiseFlags to set. + * @return This builder for chaining. */ - public Builder addAllMacScans( - Iterable values) { - if (macScansBuilder_ == null) { - ensureMacScansIsMutable(); - com.google.protobuf.AbstractMessageLite.Builder.addAll( - values, macScans_); - onChanged(); - } else { - macScansBuilder_.addAllMessages(values); - } + public Builder setAdvertiseFlags(int value) { + + advertiseFlags_ = value; + bitField0_ |= 0x00000008; + onChanged(); return this; } /** - * repeated .Mac_Scan mac_scans = 2; + * int32 advertise_flags = 4; + * @return This builder for chaining. */ - public Builder clearMacScans() { - if (macScansBuilder_ == null) { - macScans_ = java.util.Collections.emptyList(); - bitField0_ = (bitField0_ & ~0x00000002); - onChanged(); - } else { - macScansBuilder_.clear(); - } + public Builder clearAdvertiseFlags() { + bitField0_ = (bitField0_ & ~0x00000008); + advertiseFlags_ = 0; + onChanged(); return this; } + + private com.google.protobuf.LazyStringArrayList serviceUuids_ = + com.google.protobuf.LazyStringArrayList.emptyList(); + private void ensureServiceUuidsIsMutable() { + if (!serviceUuids_.isModifiable()) { + serviceUuids_ = new com.google.protobuf.LazyStringArrayList(serviceUuids_); + } + bitField0_ |= 0x00000010; + } /** - * repeated .Mac_Scan mac_scans = 2; + * repeated string service_uuids = 5; + * @return A list containing the serviceUuids. */ - public Builder removeMacScans(int index) { - if (macScansBuilder_ == null) { - ensureMacScansIsMutable(); - macScans_.remove(index); - onChanged(); - } else { - macScansBuilder_.remove(index); - } - return this; + public com.google.protobuf.ProtocolStringList + getServiceUuidsList() { + serviceUuids_.makeImmutable(); + return serviceUuids_; } /** - * repeated .Mac_Scan mac_scans = 2; + * repeated string service_uuids = 5; + * @return The count of serviceUuids. */ - public Mac_Scan.Builder getMacScansBuilder( - int index) { - return getMacScansFieldBuilder().getBuilder(index); + public int getServiceUuidsCount() { + return serviceUuids_.size(); } /** - * repeated .Mac_Scan mac_scans = 2; + * repeated string service_uuids = 5; + * @param index The index of the element to return. + * @return The serviceUuids at the given index. */ - public Mac_ScanOrBuilder getMacScansOrBuilder( - int index) { - if (macScansBuilder_ == null) { - return macScans_.get(index); } else { - return macScansBuilder_.getMessageOrBuilder(index); - } + public java.lang.String getServiceUuids(int index) { + return serviceUuids_.get(index); } /** - * repeated .Mac_Scan mac_scans = 2; + * repeated string service_uuids = 5; + * @param index The index of the value to return. + * @return The bytes of the serviceUuids at the given index. */ - public java.util.List - getMacScansOrBuilderList() { - if (macScansBuilder_ != null) { - return macScansBuilder_.getMessageOrBuilderList(); - } else { - return java.util.Collections.unmodifiableList(macScans_); - } + public com.google.protobuf.ByteString + getServiceUuidsBytes(int index) { + return serviceUuids_.getByteString(index); } /** - * repeated .Mac_Scan mac_scans = 2; + * repeated string service_uuids = 5; + * @param index The index to set the value at. + * @param value The serviceUuids to set. + * @return This builder for chaining. */ - public Mac_Scan.Builder addMacScansBuilder() { - return getMacScansFieldBuilder().addBuilder( - Mac_Scan.getDefaultInstance()); + public Builder setServiceUuids( + int index, java.lang.String value) { + if (value == null) { throw new NullPointerException(); } + ensureServiceUuidsIsMutable(); + serviceUuids_.set(index, value); + bitField0_ |= 0x00000010; + onChanged(); + return this; } /** - * repeated .Mac_Scan mac_scans = 2; + * repeated string service_uuids = 5; + * @param value The serviceUuids to add. + * @return This builder for chaining. */ - public Mac_Scan.Builder addMacScansBuilder( - int index) { - return getMacScansFieldBuilder().addBuilder( - index, Mac_Scan.getDefaultInstance()); + public Builder addServiceUuids( + java.lang.String value) { + if (value == null) { throw new NullPointerException(); } + ensureServiceUuidsIsMutable(); + serviceUuids_.add(value); + bitField0_ |= 0x00000010; + onChanged(); + return this; } /** - * repeated .Mac_Scan mac_scans = 2; + * repeated string service_uuids = 5; + * @param values The serviceUuids to add. + * @return This builder for chaining. */ - public java.util.List - getMacScansBuilderList() { - return getMacScansFieldBuilder().getBuilderList(); + public Builder addAllServiceUuids( + java.lang.Iterable values) { + ensureServiceUuidsIsMutable(); + com.google.protobuf.AbstractMessageLite.Builder.addAll( + values, serviceUuids_); + bitField0_ |= 0x00000010; + onChanged(); + return this; } - private com.google.protobuf.RepeatedFieldBuilderV3< - Mac_Scan, Mac_Scan.Builder, Mac_ScanOrBuilder> - getMacScansFieldBuilder() { - if (macScansBuilder_ == null) { - macScansBuilder_ = new com.google.protobuf.RepeatedFieldBuilderV3< - Mac_Scan, Mac_Scan.Builder, Mac_ScanOrBuilder>( - macScans_, - ((bitField0_ & 0x00000002) == 0x00000002), - getParentForChildren(), - isClean()); - macScans_ = null; - } - return macScansBuilder_; + /** + * repeated string service_uuids = 5; + * @return This builder for chaining. + */ + public Builder clearServiceUuids() { + serviceUuids_ = + com.google.protobuf.LazyStringArrayList.emptyList(); + bitField0_ = (bitField0_ & ~0x00000010);; + onChanged(); + return this; } - public final Builder setUnknownFields( - final com.google.protobuf.UnknownFieldSet unknownFields) { + /** + * repeated string service_uuids = 5; + * @param value The bytes of the serviceUuids to add. + * @return This builder for chaining. + */ + public Builder addServiceUuidsBytes( + com.google.protobuf.ByteString value) { + if (value == null) { throw new NullPointerException(); } + checkByteStringIsUtf8(value); + ensureServiceUuidsIsMutable(); + serviceUuids_.add(value); + bitField0_ |= 0x00000010; + onChanged(); return this; } - public final Builder mergeUnknownFields( - final com.google.protobuf.UnknownFieldSet unknownFields) { + private com.google.protobuf.ByteString manufacturerData_ = com.google.protobuf.ByteString.EMPTY; + /** + * bytes manufacturer_data = 6; + * @return The manufacturerData. + */ + @java.lang.Override + public com.google.protobuf.ByteString getManufacturerData() { + return manufacturerData_; + } + /** + * bytes manufacturer_data = 6; + * @param value The manufacturerData to set. + * @return This builder for chaining. + */ + public Builder setManufacturerData(com.google.protobuf.ByteString value) { + if (value == null) { throw new NullPointerException(); } + manufacturerData_ = value; + bitField0_ |= 0x00000020; + onChanged(); + return this; + } + /** + * bytes manufacturer_data = 6; + * @return This builder for chaining. + */ + public Builder clearManufacturerData() { + bitField0_ = (bitField0_ & ~0x00000020); + manufacturerData_ = getDefaultInstance().getManufacturerData(); + onChanged(); return this; } - - // @@protoc_insertion_point(builder_scope:WiFi_Sample) + // @@protoc_insertion_point(builder_scope:BleData) } - // @@protoc_insertion_point(class_scope:WiFi_Sample) - private static final WiFi_Sample DEFAULT_INSTANCE; + // @@protoc_insertion_point(class_scope:BleData) + private static final com.openpositioning.PositionMe.Traj.BleData DEFAULT_INSTANCE; static { - DEFAULT_INSTANCE = new WiFi_Sample(); + DEFAULT_INSTANCE = new com.openpositioning.PositionMe.Traj.BleData(); } - public static WiFi_Sample getDefaultInstance() { + public static com.openpositioning.PositionMe.Traj.BleData getDefaultInstance() { return DEFAULT_INSTANCE; } - private static final com.google.protobuf.Parser - PARSER = new com.google.protobuf.AbstractParser() { - public WiFi_Sample parsePartialFrom( - com.google.protobuf.CodedInputStream input, - com.google.protobuf.ExtensionRegistryLite extensionRegistry) - throws com.google.protobuf.InvalidProtocolBufferException { - return new WiFi_Sample(input, extensionRegistry); + private static final com.google.protobuf.Parser + PARSER = new com.google.protobuf.AbstractParser() { + @java.lang.Override + public BleData parsePartialFrom( + com.google.protobuf.CodedInputStream input, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + Builder builder = newBuilder(); + try { + builder.mergeFrom(input, extensionRegistry); + } catch (com.google.protobuf.InvalidProtocolBufferException e) { + throw e.setUnfinishedMessage(builder.buildPartial()); + } catch (com.google.protobuf.UninitializedMessageException e) { + throw e.asInvalidProtocolBufferException().setUnfinishedMessage(builder.buildPartial()); + } catch (java.io.IOException e) { + throw new com.google.protobuf.InvalidProtocolBufferException(e) + .setUnfinishedMessage(builder.buildPartial()); + } + return builder.buildPartial(); } }; - public static com.google.protobuf.Parser parser() { + public static com.google.protobuf.Parser parser() { return PARSER; } - @Override - public com.google.protobuf.Parser getParserForType() { + @java.lang.Override + public com.google.protobuf.Parser getParserForType() { return PARSER; } - public WiFi_Sample getDefaultInstanceForType() { + @java.lang.Override + public com.openpositioning.PositionMe.Traj.BleData getDefaultInstanceForType() { return DEFAULT_INSTANCE; } } - public interface Mac_ScanOrBuilder extends - // @@protoc_insertion_point(interface_extends:Mac_Scan) - com.google.protobuf.MessageOrBuilder { + public interface Vector3OrBuilder extends + // @@protoc_insertion_point(interface_extends:Vector3) + com.google.protobuf.MessageOrBuilder { /** - * optional int64 relative_timestamp = 1; + * float x = 1; + * @return The x. */ - long getRelativeTimestamp(); + float getX(); /** - *
-     * Integer encoding of the hex mac address
-     * e.g. 207394925843984
-     * 
- * - * optional int64 mac = 2; + * float y = 2; + * @return The y. */ - long getMac(); + float getY(); /** - *
-     * rssi integer in dBm.
-     * typically between -120 and -10
-     * 
- * - * optional int32 rssi = 3; + * float z = 3; + * @return The z. */ - int getRssi(); + float getZ(); } /** - * Protobuf type {@code Mac_Scan} + *
+   * --- Common Types ---
+   * 
+ * + * Protobuf type {@code Vector3} */ - public static final class Mac_Scan extends - com.google.protobuf.GeneratedMessageV3 implements - // @@protoc_insertion_point(message_implements:Mac_Scan) - Mac_ScanOrBuilder { - // Use Mac_Scan.newBuilder() to construct. - private Mac_Scan(com.google.protobuf.GeneratedMessageV3.Builder builder) { + public static final class Vector3 extends + com.google.protobuf.GeneratedMessage implements + // @@protoc_insertion_point(message_implements:Vector3) + Vector3OrBuilder { + private static final long serialVersionUID = 0L; + static { + com.google.protobuf.RuntimeVersion.validateProtobufGencodeVersion( + com.google.protobuf.RuntimeVersion.RuntimeDomain.PUBLIC, + /* major= */ 4, + /* minor= */ 29, + /* patch= */ 6, + /* suffix= */ "", + Vector3.class.getName()); + } + // Use Vector3.newBuilder() to construct. + private Vector3(com.google.protobuf.GeneratedMessage.Builder builder) { super(builder); } - private Mac_Scan() { - relativeTimestamp_ = 0L; - mac_ = 0L; - rssi_ = 0; - } - - @Override - public final com.google.protobuf.UnknownFieldSet - getUnknownFields() { - return com.google.protobuf.UnknownFieldSet.getDefaultInstance(); - } - private Mac_Scan( - com.google.protobuf.CodedInputStream input, - com.google.protobuf.ExtensionRegistryLite extensionRegistry) - throws com.google.protobuf.InvalidProtocolBufferException { - this(); - int mutable_bitField0_ = 0; - try { - boolean done = false; - while (!done) { - int tag = input.readTag(); - switch (tag) { - case 0: - done = true; - break; - default: { - if (!input.skipField(tag)) { - done = true; - } - break; - } - case 8: { - - relativeTimestamp_ = input.readInt64(); - break; - } - case 16: { - - mac_ = input.readInt64(); - break; - } - case 24: { - - rssi_ = input.readInt32(); - break; - } - } - } - } catch (com.google.protobuf.InvalidProtocolBufferException e) { - throw e.setUnfinishedMessage(this); - } catch (java.io.IOException e) { - throw new com.google.protobuf.InvalidProtocolBufferException( - e).setUnfinishedMessage(this); - } finally { - makeExtensionsImmutable(); - } + private Vector3() { } + public static final com.google.protobuf.Descriptors.Descriptor - getDescriptor() { - return Traj.internal_static_Mac_Scan_descriptor; + getDescriptor() { + return com.openpositioning.PositionMe.Traj.internal_static_Vector3_descriptor; } - protected com.google.protobuf.GeneratedMessageV3.FieldAccessorTable - internalGetFieldAccessorTable() { - return Traj.internal_static_Mac_Scan_fieldAccessorTable - .ensureFieldAccessorsInitialized( - Mac_Scan.class, Builder.class); + @java.lang.Override + protected com.google.protobuf.GeneratedMessage.FieldAccessorTable + internalGetFieldAccessorTable() { + return com.openpositioning.PositionMe.Traj.internal_static_Vector3_fieldAccessorTable + .ensureFieldAccessorsInitialized( + com.openpositioning.PositionMe.Traj.Vector3.class, com.openpositioning.PositionMe.Traj.Vector3.Builder.class); } - public static final int RELATIVE_TIMESTAMP_FIELD_NUMBER = 1; - private long relativeTimestamp_; + public static final int X_FIELD_NUMBER = 1; + private float x_ = 0F; /** - * optional int64 relative_timestamp = 1; + * float x = 1; + * @return The x. */ - public long getRelativeTimestamp() { - return relativeTimestamp_; + @java.lang.Override + public float getX() { + return x_; } - public static final int MAC_FIELD_NUMBER = 2; - private long mac_; + public static final int Y_FIELD_NUMBER = 2; + private float y_ = 0F; /** - *
-     * Integer encoding of the hex mac address
-     * e.g. 207394925843984
-     * 
- * - * optional int64 mac = 2; + * float y = 2; + * @return The y. */ - public long getMac() { - return mac_; + @java.lang.Override + public float getY() { + return y_; } - public static final int RSSI_FIELD_NUMBER = 3; - private int rssi_; + public static final int Z_FIELD_NUMBER = 3; + private float z_ = 0F; /** - *
-     * rssi integer in dBm.
-     * typically between -120 and -10
-     * 
- * - * optional int32 rssi = 3; + * float z = 3; + * @return The z. */ - public int getRssi() { - return rssi_; + @java.lang.Override + public float getZ() { + return z_; } private byte memoizedIsInitialized = -1; + @java.lang.Override public final boolean isInitialized() { byte isInitialized = memoizedIsInitialized; if (isInitialized == 1) return true; @@ -10412,649 +18594,602 @@ public final boolean isInitialized() { return true; } + @java.lang.Override public void writeTo(com.google.protobuf.CodedOutputStream output) - throws java.io.IOException { - if (relativeTimestamp_ != 0L) { - output.writeInt64(1, relativeTimestamp_); + throws java.io.IOException { + if (java.lang.Float.floatToRawIntBits(x_) != 0) { + output.writeFloat(1, x_); } - if (mac_ != 0L) { - output.writeInt64(2, mac_); + if (java.lang.Float.floatToRawIntBits(y_) != 0) { + output.writeFloat(2, y_); } - if (rssi_ != 0) { - output.writeInt32(3, rssi_); + if (java.lang.Float.floatToRawIntBits(z_) != 0) { + output.writeFloat(3, z_); } + getUnknownFields().writeTo(output); } + @java.lang.Override public int getSerializedSize() { int size = memoizedSize; if (size != -1) return size; size = 0; - if (relativeTimestamp_ != 0L) { + if (java.lang.Float.floatToRawIntBits(x_) != 0) { size += com.google.protobuf.CodedOutputStream - .computeInt64Size(1, relativeTimestamp_); + .computeFloatSize(1, x_); } - if (mac_ != 0L) { + if (java.lang.Float.floatToRawIntBits(y_) != 0) { size += com.google.protobuf.CodedOutputStream - .computeInt64Size(2, mac_); + .computeFloatSize(2, y_); } - if (rssi_ != 0) { + if (java.lang.Float.floatToRawIntBits(z_) != 0) { size += com.google.protobuf.CodedOutputStream - .computeInt32Size(3, rssi_); + .computeFloatSize(3, z_); } + size += getUnknownFields().getSerializedSize(); memoizedSize = size; return size; } - private static final long serialVersionUID = 0L; - @Override - public boolean equals(final Object obj) { + @java.lang.Override + public boolean equals(final java.lang.Object obj) { if (obj == this) { - return true; + return true; } - if (!(obj instanceof Mac_Scan)) { + if (!(obj instanceof com.openpositioning.PositionMe.Traj.Vector3)) { return super.equals(obj); } - Mac_Scan other = (Mac_Scan) obj; - - boolean result = true; - result = result && (getRelativeTimestamp() - == other.getRelativeTimestamp()); - result = result && (getMac() - == other.getMac()); - result = result && (getRssi() - == other.getRssi()); - return result; + com.openpositioning.PositionMe.Traj.Vector3 other = (com.openpositioning.PositionMe.Traj.Vector3) obj; + + if (java.lang.Float.floatToIntBits(getX()) + != java.lang.Float.floatToIntBits( + other.getX())) return false; + if (java.lang.Float.floatToIntBits(getY()) + != java.lang.Float.floatToIntBits( + other.getY())) return false; + if (java.lang.Float.floatToIntBits(getZ()) + != java.lang.Float.floatToIntBits( + other.getZ())) return false; + if (!getUnknownFields().equals(other.getUnknownFields())) return false; + return true; } - @Override + @java.lang.Override public int hashCode() { if (memoizedHashCode != 0) { return memoizedHashCode; } int hash = 41; - hash = (19 * hash) + getDescriptorForType().hashCode(); - hash = (37 * hash) + RELATIVE_TIMESTAMP_FIELD_NUMBER; - hash = (53 * hash) + com.google.protobuf.Internal.hashLong( - getRelativeTimestamp()); - hash = (37 * hash) + MAC_FIELD_NUMBER; - hash = (53 * hash) + com.google.protobuf.Internal.hashLong( - getMac()); - hash = (37 * hash) + RSSI_FIELD_NUMBER; - hash = (53 * hash) + getRssi(); - hash = (29 * hash) + unknownFields.hashCode(); + hash = (19 * hash) + getDescriptor().hashCode(); + hash = (37 * hash) + X_FIELD_NUMBER; + hash = (53 * hash) + java.lang.Float.floatToIntBits( + getX()); + hash = (37 * hash) + Y_FIELD_NUMBER; + hash = (53 * hash) + java.lang.Float.floatToIntBits( + getY()); + hash = (37 * hash) + Z_FIELD_NUMBER; + hash = (53 * hash) + java.lang.Float.floatToIntBits( + getZ()); + hash = (29 * hash) + getUnknownFields().hashCode(); memoizedHashCode = hash; return hash; } - public static Mac_Scan parseFrom( - com.google.protobuf.ByteString data) - throws com.google.protobuf.InvalidProtocolBufferException { + public static com.openpositioning.PositionMe.Traj.Vector3 parseFrom( + java.nio.ByteBuffer data) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + public static com.openpositioning.PositionMe.Traj.Vector3 parseFrom( + java.nio.ByteBuffer data, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data, extensionRegistry); + } + public static com.openpositioning.PositionMe.Traj.Vector3 parseFrom( + com.google.protobuf.ByteString data) + throws com.google.protobuf.InvalidProtocolBufferException { return PARSER.parseFrom(data); } - public static Mac_Scan parseFrom( - com.google.protobuf.ByteString data, - com.google.protobuf.ExtensionRegistryLite extensionRegistry) - throws com.google.protobuf.InvalidProtocolBufferException { + public static com.openpositioning.PositionMe.Traj.Vector3 parseFrom( + com.google.protobuf.ByteString data, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { return PARSER.parseFrom(data, extensionRegistry); } - public static Mac_Scan parseFrom(byte[] data) - throws com.google.protobuf.InvalidProtocolBufferException { + public static com.openpositioning.PositionMe.Traj.Vector3 parseFrom(byte[] data) + throws com.google.protobuf.InvalidProtocolBufferException { return PARSER.parseFrom(data); } - public static Mac_Scan parseFrom( - byte[] data, - com.google.protobuf.ExtensionRegistryLite extensionRegistry) - throws com.google.protobuf.InvalidProtocolBufferException { + public static com.openpositioning.PositionMe.Traj.Vector3 parseFrom( + byte[] data, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { return PARSER.parseFrom(data, extensionRegistry); } - public static Mac_Scan parseFrom(java.io.InputStream input) - throws java.io.IOException { - return com.google.protobuf.GeneratedMessageV3 - .parseWithIOException(PARSER, input); - } - public static Mac_Scan parseFrom( - java.io.InputStream input, - com.google.protobuf.ExtensionRegistryLite extensionRegistry) - throws java.io.IOException { - return com.google.protobuf.GeneratedMessageV3 - .parseWithIOException(PARSER, input, extensionRegistry); - } - public static Mac_Scan parseDelimitedFrom(java.io.InputStream input) - throws java.io.IOException { - return com.google.protobuf.GeneratedMessageV3 - .parseDelimitedWithIOException(PARSER, input); - } - public static Mac_Scan parseDelimitedFrom( - java.io.InputStream input, - com.google.protobuf.ExtensionRegistryLite extensionRegistry) - throws java.io.IOException { - return com.google.protobuf.GeneratedMessageV3 - .parseDelimitedWithIOException(PARSER, input, extensionRegistry); - } - public static Mac_Scan parseFrom( - com.google.protobuf.CodedInputStream input) - throws java.io.IOException { - return com.google.protobuf.GeneratedMessageV3 - .parseWithIOException(PARSER, input); - } - public static Mac_Scan parseFrom( - com.google.protobuf.CodedInputStream input, - com.google.protobuf.ExtensionRegistryLite extensionRegistry) - throws java.io.IOException { - return com.google.protobuf.GeneratedMessageV3 - .parseWithIOException(PARSER, input, extensionRegistry); + public static com.openpositioning.PositionMe.Traj.Vector3 parseFrom(java.io.InputStream input) + throws java.io.IOException { + return com.google.protobuf.GeneratedMessage + .parseWithIOException(PARSER, input); + } + public static com.openpositioning.PositionMe.Traj.Vector3 parseFrom( + java.io.InputStream input, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws java.io.IOException { + return com.google.protobuf.GeneratedMessage + .parseWithIOException(PARSER, input, extensionRegistry); + } + + public static com.openpositioning.PositionMe.Traj.Vector3 parseDelimitedFrom(java.io.InputStream input) + throws java.io.IOException { + return com.google.protobuf.GeneratedMessage + .parseDelimitedWithIOException(PARSER, input); + } + + public static com.openpositioning.PositionMe.Traj.Vector3 parseDelimitedFrom( + java.io.InputStream input, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws java.io.IOException { + return com.google.protobuf.GeneratedMessage + .parseDelimitedWithIOException(PARSER, input, extensionRegistry); + } + public static com.openpositioning.PositionMe.Traj.Vector3 parseFrom( + com.google.protobuf.CodedInputStream input) + throws java.io.IOException { + return com.google.protobuf.GeneratedMessage + .parseWithIOException(PARSER, input); + } + public static com.openpositioning.PositionMe.Traj.Vector3 parseFrom( + com.google.protobuf.CodedInputStream input, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws java.io.IOException { + return com.google.protobuf.GeneratedMessage + .parseWithIOException(PARSER, input, extensionRegistry); } + @java.lang.Override public Builder newBuilderForType() { return newBuilder(); } public static Builder newBuilder() { return DEFAULT_INSTANCE.toBuilder(); } - public static Builder newBuilder(Mac_Scan prototype) { + public static Builder newBuilder(com.openpositioning.PositionMe.Traj.Vector3 prototype) { return DEFAULT_INSTANCE.toBuilder().mergeFrom(prototype); } + @java.lang.Override public Builder toBuilder() { return this == DEFAULT_INSTANCE - ? new Builder() : new Builder().mergeFrom(this); + ? new Builder() : new Builder().mergeFrom(this); } - @Override + @java.lang.Override protected Builder newBuilderForType( - com.google.protobuf.GeneratedMessageV3.BuilderParent parent) { + com.google.protobuf.GeneratedMessage.BuilderParent parent) { Builder builder = new Builder(parent); return builder; } /** - * Protobuf type {@code Mac_Scan} + *
+     * --- Common Types ---
+     * 
+ * + * Protobuf type {@code Vector3} */ public static final class Builder extends - com.google.protobuf.GeneratedMessageV3.Builder implements - // @@protoc_insertion_point(builder_implements:Mac_Scan) - Mac_ScanOrBuilder { + com.google.protobuf.GeneratedMessage.Builder implements + // @@protoc_insertion_point(builder_implements:Vector3) + com.openpositioning.PositionMe.Traj.Vector3OrBuilder { public static final com.google.protobuf.Descriptors.Descriptor - getDescriptor() { - return Traj.internal_static_Mac_Scan_descriptor; + getDescriptor() { + return com.openpositioning.PositionMe.Traj.internal_static_Vector3_descriptor; } - protected com.google.protobuf.GeneratedMessageV3.FieldAccessorTable - internalGetFieldAccessorTable() { - return Traj.internal_static_Mac_Scan_fieldAccessorTable - .ensureFieldAccessorsInitialized( - Mac_Scan.class, Builder.class); + @java.lang.Override + protected com.google.protobuf.GeneratedMessage.FieldAccessorTable + internalGetFieldAccessorTable() { + return com.openpositioning.PositionMe.Traj.internal_static_Vector3_fieldAccessorTable + .ensureFieldAccessorsInitialized( + com.openpositioning.PositionMe.Traj.Vector3.class, com.openpositioning.PositionMe.Traj.Vector3.Builder.class); } - // Construct using Traj.Mac_Scan.newBuilder() + // Construct using com.openpositioning.PositionMe.Traj.Vector3.newBuilder() private Builder() { - maybeForceBuilderInitialization(); + } private Builder( - com.google.protobuf.GeneratedMessageV3.BuilderParent parent) { + com.google.protobuf.GeneratedMessage.BuilderParent parent) { super(parent); - maybeForceBuilderInitialization(); - } - private void maybeForceBuilderInitialization() { - if (com.google.protobuf.GeneratedMessageV3 - .alwaysUseFieldBuilders) { - } + } + @java.lang.Override public Builder clear() { super.clear(); - relativeTimestamp_ = 0L; - - mac_ = 0L; - - rssi_ = 0; - + bitField0_ = 0; + x_ = 0F; + y_ = 0F; + z_ = 0F; return this; } + @java.lang.Override public com.google.protobuf.Descriptors.Descriptor - getDescriptorForType() { - return Traj.internal_static_Mac_Scan_descriptor; + getDescriptorForType() { + return com.openpositioning.PositionMe.Traj.internal_static_Vector3_descriptor; } - public Mac_Scan getDefaultInstanceForType() { - return Mac_Scan.getDefaultInstance(); + @java.lang.Override + public com.openpositioning.PositionMe.Traj.Vector3 getDefaultInstanceForType() { + return com.openpositioning.PositionMe.Traj.Vector3.getDefaultInstance(); } - public Mac_Scan build() { - Mac_Scan result = buildPartial(); + @java.lang.Override + public com.openpositioning.PositionMe.Traj.Vector3 build() { + com.openpositioning.PositionMe.Traj.Vector3 result = buildPartial(); if (!result.isInitialized()) { throw newUninitializedMessageException(result); } return result; } - public Mac_Scan buildPartial() { - Mac_Scan result = new Mac_Scan(this); - result.relativeTimestamp_ = relativeTimestamp_; - result.mac_ = mac_; - result.rssi_ = rssi_; + @java.lang.Override + public com.openpositioning.PositionMe.Traj.Vector3 buildPartial() { + com.openpositioning.PositionMe.Traj.Vector3 result = new com.openpositioning.PositionMe.Traj.Vector3(this); + if (bitField0_ != 0) { buildPartial0(result); } onBuilt(); return result; } - public Builder clone() { - return (Builder) super.clone(); - } - public Builder setField( - com.google.protobuf.Descriptors.FieldDescriptor field, - Object value) { - return (Builder) super.setField(field, value); - } - public Builder clearField( - com.google.protobuf.Descriptors.FieldDescriptor field) { - return (Builder) super.clearField(field); - } - public Builder clearOneof( - com.google.protobuf.Descriptors.OneofDescriptor oneof) { - return (Builder) super.clearOneof(oneof); - } - public Builder setRepeatedField( - com.google.protobuf.Descriptors.FieldDescriptor field, - int index, Object value) { - return (Builder) super.setRepeatedField(field, index, value); - } - public Builder addRepeatedField( - com.google.protobuf.Descriptors.FieldDescriptor field, - Object value) { - return (Builder) super.addRepeatedField(field, value); + private void buildPartial0(com.openpositioning.PositionMe.Traj.Vector3 result) { + int from_bitField0_ = bitField0_; + if (((from_bitField0_ & 0x00000001) != 0)) { + result.x_ = x_; + } + if (((from_bitField0_ & 0x00000002) != 0)) { + result.y_ = y_; + } + if (((from_bitField0_ & 0x00000004) != 0)) { + result.z_ = z_; + } } + + @java.lang.Override public Builder mergeFrom(com.google.protobuf.Message other) { - if (other instanceof Mac_Scan) { - return mergeFrom((Mac_Scan)other); + if (other instanceof com.openpositioning.PositionMe.Traj.Vector3) { + return mergeFrom((com.openpositioning.PositionMe.Traj.Vector3)other); } else { super.mergeFrom(other); return this; } } - public Builder mergeFrom(Mac_Scan other) { - if (other == Mac_Scan.getDefaultInstance()) return this; - if (other.getRelativeTimestamp() != 0L) { - setRelativeTimestamp(other.getRelativeTimestamp()); + public Builder mergeFrom(com.openpositioning.PositionMe.Traj.Vector3 other) { + if (other == com.openpositioning.PositionMe.Traj.Vector3.getDefaultInstance()) return this; + if (other.getX() != 0F) { + setX(other.getX()); } - if (other.getMac() != 0L) { - setMac(other.getMac()); + if (other.getY() != 0F) { + setY(other.getY()); } - if (other.getRssi() != 0) { - setRssi(other.getRssi()); + if (other.getZ() != 0F) { + setZ(other.getZ()); } + this.mergeUnknownFields(other.getUnknownFields()); onChanged(); return this; } + @java.lang.Override public final boolean isInitialized() { return true; } + @java.lang.Override public Builder mergeFrom( - com.google.protobuf.CodedInputStream input, - com.google.protobuf.ExtensionRegistryLite extensionRegistry) - throws java.io.IOException { - Mac_Scan parsedMessage = null; + com.google.protobuf.CodedInputStream input, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws java.io.IOException { + if (extensionRegistry == null) { + throw new java.lang.NullPointerException(); + } try { - parsedMessage = PARSER.parsePartialFrom(input, extensionRegistry); + boolean done = false; + while (!done) { + int tag = input.readTag(); + switch (tag) { + case 0: + done = true; + break; + case 13: { + x_ = input.readFloat(); + bitField0_ |= 0x00000001; + break; + } // case 13 + case 21: { + y_ = input.readFloat(); + bitField0_ |= 0x00000002; + break; + } // case 21 + case 29: { + z_ = input.readFloat(); + bitField0_ |= 0x00000004; + break; + } // case 29 + default: { + if (!super.parseUnknownField(input, extensionRegistry, tag)) { + done = true; // was an endgroup tag + } + break; + } // default: + } // switch (tag) + } // while (!done) } catch (com.google.protobuf.InvalidProtocolBufferException e) { - parsedMessage = (Mac_Scan) e.getUnfinishedMessage(); throw e.unwrapIOException(); } finally { - if (parsedMessage != null) { - mergeFrom(parsedMessage); - } - } + onChanged(); + } // finally return this; } + private int bitField0_; - private long relativeTimestamp_ ; + private float x_ ; /** - * optional int64 relative_timestamp = 1; + * float x = 1; + * @return The x. */ - public long getRelativeTimestamp() { - return relativeTimestamp_; + @java.lang.Override + public float getX() { + return x_; } /** - * optional int64 relative_timestamp = 1; + * float x = 1; + * @param value The x to set. + * @return This builder for chaining. */ - public Builder setRelativeTimestamp(long value) { - - relativeTimestamp_ = value; + public Builder setX(float value) { + + x_ = value; + bitField0_ |= 0x00000001; onChanged(); return this; } /** - * optional int64 relative_timestamp = 1; + * float x = 1; + * @return This builder for chaining. */ - public Builder clearRelativeTimestamp() { - - relativeTimestamp_ = 0L; + public Builder clearX() { + bitField0_ = (bitField0_ & ~0x00000001); + x_ = 0F; onChanged(); return this; } - private long mac_ ; + private float y_ ; /** - *
-       * Integer encoding of the hex mac address
-       * e.g. 207394925843984
-       * 
- * - * optional int64 mac = 2; + * float y = 2; + * @return The y. */ - public long getMac() { - return mac_; + @java.lang.Override + public float getY() { + return y_; } /** - *
-       * Integer encoding of the hex mac address
-       * e.g. 207394925843984
-       * 
- * - * optional int64 mac = 2; + * float y = 2; + * @param value The y to set. + * @return This builder for chaining. */ - public Builder setMac(long value) { - - mac_ = value; + public Builder setY(float value) { + + y_ = value; + bitField0_ |= 0x00000002; onChanged(); return this; } /** - *
-       * Integer encoding of the hex mac address
-       * e.g. 207394925843984
-       * 
- * - * optional int64 mac = 2; + * float y = 2; + * @return This builder for chaining. */ - public Builder clearMac() { - - mac_ = 0L; + public Builder clearY() { + bitField0_ = (bitField0_ & ~0x00000002); + y_ = 0F; onChanged(); return this; } - private int rssi_ ; + private float z_ ; /** - *
-       * rssi integer in dBm.
-       * typically between -120 and -10
-       * 
- * - * optional int32 rssi = 3; + * float z = 3; + * @return The z. */ - public int getRssi() { - return rssi_; + @java.lang.Override + public float getZ() { + return z_; } /** - *
-       * rssi integer in dBm.
-       * typically between -120 and -10
-       * 
- * - * optional int32 rssi = 3; + * float z = 3; + * @param value The z to set. + * @return This builder for chaining. */ - public Builder setRssi(int value) { - - rssi_ = value; + public Builder setZ(float value) { + + z_ = value; + bitField0_ |= 0x00000004; onChanged(); return this; } /** - *
-       * rssi integer in dBm.
-       * typically between -120 and -10
-       * 
- * - * optional int32 rssi = 3; + * float z = 3; + * @return This builder for chaining. */ - public Builder clearRssi() { - - rssi_ = 0; + public Builder clearZ() { + bitField0_ = (bitField0_ & ~0x00000004); + z_ = 0F; onChanged(); return this; } - public final Builder setUnknownFields( - final com.google.protobuf.UnknownFieldSet unknownFields) { - return this; - } - - public final Builder mergeUnknownFields( - final com.google.protobuf.UnknownFieldSet unknownFields) { - return this; - } - - // @@protoc_insertion_point(builder_scope:Mac_Scan) + // @@protoc_insertion_point(builder_scope:Vector3) } - // @@protoc_insertion_point(class_scope:Mac_Scan) - private static final Mac_Scan DEFAULT_INSTANCE; + // @@protoc_insertion_point(class_scope:Vector3) + private static final com.openpositioning.PositionMe.Traj.Vector3 DEFAULT_INSTANCE; static { - DEFAULT_INSTANCE = new Mac_Scan(); + DEFAULT_INSTANCE = new com.openpositioning.PositionMe.Traj.Vector3(); } - public static Mac_Scan getDefaultInstance() { + public static com.openpositioning.PositionMe.Traj.Vector3 getDefaultInstance() { return DEFAULT_INSTANCE; } - private static final com.google.protobuf.Parser - PARSER = new com.google.protobuf.AbstractParser() { - public Mac_Scan parsePartialFrom( - com.google.protobuf.CodedInputStream input, - com.google.protobuf.ExtensionRegistryLite extensionRegistry) - throws com.google.protobuf.InvalidProtocolBufferException { - return new Mac_Scan(input, extensionRegistry); + private static final com.google.protobuf.Parser + PARSER = new com.google.protobuf.AbstractParser() { + @java.lang.Override + public Vector3 parsePartialFrom( + com.google.protobuf.CodedInputStream input, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + Builder builder = newBuilder(); + try { + builder.mergeFrom(input, extensionRegistry); + } catch (com.google.protobuf.InvalidProtocolBufferException e) { + throw e.setUnfinishedMessage(builder.buildPartial()); + } catch (com.google.protobuf.UninitializedMessageException e) { + throw e.asInvalidProtocolBufferException().setUnfinishedMessage(builder.buildPartial()); + } catch (java.io.IOException e) { + throw new com.google.protobuf.InvalidProtocolBufferException(e) + .setUnfinishedMessage(builder.buildPartial()); + } + return builder.buildPartial(); } }; - public static com.google.protobuf.Parser parser() { + public static com.google.protobuf.Parser parser() { return PARSER; } - @Override - public com.google.protobuf.Parser getParserForType() { + @java.lang.Override + public com.google.protobuf.Parser getParserForType() { return PARSER; } - public Mac_Scan getDefaultInstanceForType() { + @java.lang.Override + public com.openpositioning.PositionMe.Traj.Vector3 getDefaultInstanceForType() { return DEFAULT_INSTANCE; } } - public interface AP_DataOrBuilder extends - // @@protoc_insertion_point(interface_extends:AP_Data) - com.google.protobuf.MessageOrBuilder { + public interface QuaternionOrBuilder extends + // @@protoc_insertion_point(interface_extends:Quaternion) + com.google.protobuf.MessageOrBuilder { /** - *
-     * Integer encoding of the hex mac address
-     * e.g. 207394925843984
-     * 
- * - * optional int64 mac = 1; + * float x = 1; + * @return The x. */ - long getMac(); + float getX(); /** - *
-     * E.g. 'Eduroam' or 'Starbucks_free_wifi'
-     * 
- * - * optional string ssid = 2; + * float y = 2; + * @return The y. */ - String getSsid(); + float getY(); + /** - *
-     * E.g. 'Eduroam' or 'Starbucks_free_wifi'
-     * 
- * - * optional string ssid = 2; + * float z = 3; + * @return The z. */ - com.google.protobuf.ByteString - getSsidBytes(); + float getZ(); /** - *
-     * Typically 2.4GHz or 5GHz
-     * 
- * - * optional int64 frequency = 3; + * float w = 4; + * @return The w. */ - long getFrequency(); + float getW(); } /** - * Protobuf type {@code AP_Data} + * Protobuf type {@code Quaternion} */ - public static final class AP_Data extends - com.google.protobuf.GeneratedMessageV3 implements - // @@protoc_insertion_point(message_implements:AP_Data) - AP_DataOrBuilder { - // Use AP_Data.newBuilder() to construct. - private AP_Data(com.google.protobuf.GeneratedMessageV3.Builder builder) { + public static final class Quaternion extends + com.google.protobuf.GeneratedMessage implements + // @@protoc_insertion_point(message_implements:Quaternion) + QuaternionOrBuilder { + private static final long serialVersionUID = 0L; + static { + com.google.protobuf.RuntimeVersion.validateProtobufGencodeVersion( + com.google.protobuf.RuntimeVersion.RuntimeDomain.PUBLIC, + /* major= */ 4, + /* minor= */ 29, + /* patch= */ 6, + /* suffix= */ "", + Quaternion.class.getName()); + } + // Use Quaternion.newBuilder() to construct. + private Quaternion(com.google.protobuf.GeneratedMessage.Builder builder) { super(builder); } - private AP_Data() { - mac_ = 0L; - ssid_ = ""; - frequency_ = 0L; - } - - @Override - public final com.google.protobuf.UnknownFieldSet - getUnknownFields() { - return com.google.protobuf.UnknownFieldSet.getDefaultInstance(); - } - private AP_Data( - com.google.protobuf.CodedInputStream input, - com.google.protobuf.ExtensionRegistryLite extensionRegistry) - throws com.google.protobuf.InvalidProtocolBufferException { - this(); - int mutable_bitField0_ = 0; - try { - boolean done = false; - while (!done) { - int tag = input.readTag(); - switch (tag) { - case 0: - done = true; - break; - default: { - if (!input.skipField(tag)) { - done = true; - } - break; - } - case 8: { - - mac_ = input.readInt64(); - break; - } - case 18: { - String s = input.readStringRequireUtf8(); - - ssid_ = s; - break; - } - case 24: { - - frequency_ = input.readInt64(); - break; - } - } - } - } catch (com.google.protobuf.InvalidProtocolBufferException e) { - throw e.setUnfinishedMessage(this); - } catch (java.io.IOException e) { - throw new com.google.protobuf.InvalidProtocolBufferException( - e).setUnfinishedMessage(this); - } finally { - makeExtensionsImmutable(); - } + private Quaternion() { } + public static final com.google.protobuf.Descriptors.Descriptor - getDescriptor() { - return Traj.internal_static_AP_Data_descriptor; + getDescriptor() { + return com.openpositioning.PositionMe.Traj.internal_static_Quaternion_descriptor; } - protected com.google.protobuf.GeneratedMessageV3.FieldAccessorTable - internalGetFieldAccessorTable() { - return Traj.internal_static_AP_Data_fieldAccessorTable - .ensureFieldAccessorsInitialized( - AP_Data.class, Builder.class); + @java.lang.Override + protected com.google.protobuf.GeneratedMessage.FieldAccessorTable + internalGetFieldAccessorTable() { + return com.openpositioning.PositionMe.Traj.internal_static_Quaternion_fieldAccessorTable + .ensureFieldAccessorsInitialized( + com.openpositioning.PositionMe.Traj.Quaternion.class, com.openpositioning.PositionMe.Traj.Quaternion.Builder.class); } - public static final int MAC_FIELD_NUMBER = 1; - private long mac_; + public static final int X_FIELD_NUMBER = 1; + private float x_ = 0F; /** - *
-     * Integer encoding of the hex mac address
-     * e.g. 207394925843984
-     * 
- * - * optional int64 mac = 1; + * float x = 1; + * @return The x. */ - public long getMac() { - return mac_; + @java.lang.Override + public float getX() { + return x_; } - public static final int SSID_FIELD_NUMBER = 2; - private volatile Object ssid_; + public static final int Y_FIELD_NUMBER = 2; + private float y_ = 0F; /** - *
-     * E.g. 'Eduroam' or 'Starbucks_free_wifi'
-     * 
- * - * optional string ssid = 2; + * float y = 2; + * @return The y. */ - public String getSsid() { - Object ref = ssid_; - if (ref instanceof String) { - return (String) ref; - } else { - com.google.protobuf.ByteString bs = - (com.google.protobuf.ByteString) ref; - String s = bs.toStringUtf8(); - ssid_ = s; - return s; - } + @java.lang.Override + public float getY() { + return y_; } + + public static final int Z_FIELD_NUMBER = 3; + private float z_ = 0F; /** - *
-     * E.g. 'Eduroam' or 'Starbucks_free_wifi'
-     * 
- * - * optional string ssid = 2; + * float z = 3; + * @return The z. */ - public com.google.protobuf.ByteString - getSsidBytes() { - Object ref = ssid_; - if (ref instanceof String) { - com.google.protobuf.ByteString b = - com.google.protobuf.ByteString.copyFromUtf8( - (String) ref); - ssid_ = b; - return b; - } else { - return (com.google.protobuf.ByteString) ref; - } + @java.lang.Override + public float getZ() { + return z_; } - public static final int FREQUENCY_FIELD_NUMBER = 3; - private long frequency_; + public static final int W_FIELD_NUMBER = 4; + private float w_ = 0F; /** - *
-     * Typically 2.4GHz or 5GHz
-     * 
- * - * optional int64 frequency = 3; + * float w = 4; + * @return The w. */ - public long getFrequency() { - return frequency_; + @java.lang.Override + public float getW() { + return w_; } private byte memoizedIsInitialized = -1; + @java.lang.Override public final boolean isInitialized() { byte isInitialized = memoizedIsInitialized; if (isInitialized == 1) return true; @@ -11064,688 +19199,679 @@ public final boolean isInitialized() { return true; } + @java.lang.Override public void writeTo(com.google.protobuf.CodedOutputStream output) - throws java.io.IOException { - if (mac_ != 0L) { - output.writeInt64(1, mac_); + throws java.io.IOException { + if (java.lang.Float.floatToRawIntBits(x_) != 0) { + output.writeFloat(1, x_); } - if (!getSsidBytes().isEmpty()) { - com.google.protobuf.GeneratedMessageV3.writeString(output, 2, ssid_); + if (java.lang.Float.floatToRawIntBits(y_) != 0) { + output.writeFloat(2, y_); } - if (frequency_ != 0L) { - output.writeInt64(3, frequency_); + if (java.lang.Float.floatToRawIntBits(z_) != 0) { + output.writeFloat(3, z_); } + if (java.lang.Float.floatToRawIntBits(w_) != 0) { + output.writeFloat(4, w_); + } + getUnknownFields().writeTo(output); } + @java.lang.Override public int getSerializedSize() { int size = memoizedSize; if (size != -1) return size; size = 0; - if (mac_ != 0L) { + if (java.lang.Float.floatToRawIntBits(x_) != 0) { size += com.google.protobuf.CodedOutputStream - .computeInt64Size(1, mac_); + .computeFloatSize(1, x_); } - if (!getSsidBytes().isEmpty()) { - size += com.google.protobuf.GeneratedMessageV3.computeStringSize(2, ssid_); + if (java.lang.Float.floatToRawIntBits(y_) != 0) { + size += com.google.protobuf.CodedOutputStream + .computeFloatSize(2, y_); } - if (frequency_ != 0L) { + if (java.lang.Float.floatToRawIntBits(z_) != 0) { size += com.google.protobuf.CodedOutputStream - .computeInt64Size(3, frequency_); + .computeFloatSize(3, z_); } + if (java.lang.Float.floatToRawIntBits(w_) != 0) { + size += com.google.protobuf.CodedOutputStream + .computeFloatSize(4, w_); + } + size += getUnknownFields().getSerializedSize(); memoizedSize = size; return size; } - private static final long serialVersionUID = 0L; - @Override - public boolean equals(final Object obj) { + @java.lang.Override + public boolean equals(final java.lang.Object obj) { if (obj == this) { - return true; + return true; } - if (!(obj instanceof AP_Data)) { + if (!(obj instanceof com.openpositioning.PositionMe.Traj.Quaternion)) { return super.equals(obj); } - AP_Data other = (AP_Data) obj; - - boolean result = true; - result = result && (getMac() - == other.getMac()); - result = result && getSsid() - .equals(other.getSsid()); - result = result && (getFrequency() - == other.getFrequency()); - return result; + com.openpositioning.PositionMe.Traj.Quaternion other = (com.openpositioning.PositionMe.Traj.Quaternion) obj; + + if (java.lang.Float.floatToIntBits(getX()) + != java.lang.Float.floatToIntBits( + other.getX())) return false; + if (java.lang.Float.floatToIntBits(getY()) + != java.lang.Float.floatToIntBits( + other.getY())) return false; + if (java.lang.Float.floatToIntBits(getZ()) + != java.lang.Float.floatToIntBits( + other.getZ())) return false; + if (java.lang.Float.floatToIntBits(getW()) + != java.lang.Float.floatToIntBits( + other.getW())) return false; + if (!getUnknownFields().equals(other.getUnknownFields())) return false; + return true; } - @Override + @java.lang.Override public int hashCode() { if (memoizedHashCode != 0) { return memoizedHashCode; } int hash = 41; - hash = (19 * hash) + getDescriptorForType().hashCode(); - hash = (37 * hash) + MAC_FIELD_NUMBER; - hash = (53 * hash) + com.google.protobuf.Internal.hashLong( - getMac()); - hash = (37 * hash) + SSID_FIELD_NUMBER; - hash = (53 * hash) + getSsid().hashCode(); - hash = (37 * hash) + FREQUENCY_FIELD_NUMBER; - hash = (53 * hash) + com.google.protobuf.Internal.hashLong( - getFrequency()); - hash = (29 * hash) + unknownFields.hashCode(); + hash = (19 * hash) + getDescriptor().hashCode(); + hash = (37 * hash) + X_FIELD_NUMBER; + hash = (53 * hash) + java.lang.Float.floatToIntBits( + getX()); + hash = (37 * hash) + Y_FIELD_NUMBER; + hash = (53 * hash) + java.lang.Float.floatToIntBits( + getY()); + hash = (37 * hash) + Z_FIELD_NUMBER; + hash = (53 * hash) + java.lang.Float.floatToIntBits( + getZ()); + hash = (37 * hash) + W_FIELD_NUMBER; + hash = (53 * hash) + java.lang.Float.floatToIntBits( + getW()); + hash = (29 * hash) + getUnknownFields().hashCode(); memoizedHashCode = hash; return hash; } - public static AP_Data parseFrom( - com.google.protobuf.ByteString data) - throws com.google.protobuf.InvalidProtocolBufferException { + public static com.openpositioning.PositionMe.Traj.Quaternion parseFrom( + java.nio.ByteBuffer data) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + public static com.openpositioning.PositionMe.Traj.Quaternion parseFrom( + java.nio.ByteBuffer data, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data, extensionRegistry); + } + public static com.openpositioning.PositionMe.Traj.Quaternion parseFrom( + com.google.protobuf.ByteString data) + throws com.google.protobuf.InvalidProtocolBufferException { return PARSER.parseFrom(data); } - public static AP_Data parseFrom( - com.google.protobuf.ByteString data, - com.google.protobuf.ExtensionRegistryLite extensionRegistry) - throws com.google.protobuf.InvalidProtocolBufferException { + public static com.openpositioning.PositionMe.Traj.Quaternion parseFrom( + com.google.protobuf.ByteString data, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { return PARSER.parseFrom(data, extensionRegistry); } - public static AP_Data parseFrom(byte[] data) - throws com.google.protobuf.InvalidProtocolBufferException { + public static com.openpositioning.PositionMe.Traj.Quaternion parseFrom(byte[] data) + throws com.google.protobuf.InvalidProtocolBufferException { return PARSER.parseFrom(data); } - public static AP_Data parseFrom( - byte[] data, - com.google.protobuf.ExtensionRegistryLite extensionRegistry) - throws com.google.protobuf.InvalidProtocolBufferException { + public static com.openpositioning.PositionMe.Traj.Quaternion parseFrom( + byte[] data, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { return PARSER.parseFrom(data, extensionRegistry); } - public static AP_Data parseFrom(java.io.InputStream input) - throws java.io.IOException { - return com.google.protobuf.GeneratedMessageV3 - .parseWithIOException(PARSER, input); - } - public static AP_Data parseFrom( - java.io.InputStream input, - com.google.protobuf.ExtensionRegistryLite extensionRegistry) - throws java.io.IOException { - return com.google.protobuf.GeneratedMessageV3 - .parseWithIOException(PARSER, input, extensionRegistry); - } - public static AP_Data parseDelimitedFrom(java.io.InputStream input) - throws java.io.IOException { - return com.google.protobuf.GeneratedMessageV3 - .parseDelimitedWithIOException(PARSER, input); - } - public static AP_Data parseDelimitedFrom( - java.io.InputStream input, - com.google.protobuf.ExtensionRegistryLite extensionRegistry) - throws java.io.IOException { - return com.google.protobuf.GeneratedMessageV3 - .parseDelimitedWithIOException(PARSER, input, extensionRegistry); - } - public static AP_Data parseFrom( - com.google.protobuf.CodedInputStream input) - throws java.io.IOException { - return com.google.protobuf.GeneratedMessageV3 - .parseWithIOException(PARSER, input); - } - public static AP_Data parseFrom( - com.google.protobuf.CodedInputStream input, - com.google.protobuf.ExtensionRegistryLite extensionRegistry) - throws java.io.IOException { - return com.google.protobuf.GeneratedMessageV3 - .parseWithIOException(PARSER, input, extensionRegistry); + public static com.openpositioning.PositionMe.Traj.Quaternion parseFrom(java.io.InputStream input) + throws java.io.IOException { + return com.google.protobuf.GeneratedMessage + .parseWithIOException(PARSER, input); + } + public static com.openpositioning.PositionMe.Traj.Quaternion parseFrom( + java.io.InputStream input, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws java.io.IOException { + return com.google.protobuf.GeneratedMessage + .parseWithIOException(PARSER, input, extensionRegistry); + } + + public static com.openpositioning.PositionMe.Traj.Quaternion parseDelimitedFrom(java.io.InputStream input) + throws java.io.IOException { + return com.google.protobuf.GeneratedMessage + .parseDelimitedWithIOException(PARSER, input); + } + + public static com.openpositioning.PositionMe.Traj.Quaternion parseDelimitedFrom( + java.io.InputStream input, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws java.io.IOException { + return com.google.protobuf.GeneratedMessage + .parseDelimitedWithIOException(PARSER, input, extensionRegistry); + } + public static com.openpositioning.PositionMe.Traj.Quaternion parseFrom( + com.google.protobuf.CodedInputStream input) + throws java.io.IOException { + return com.google.protobuf.GeneratedMessage + .parseWithIOException(PARSER, input); + } + public static com.openpositioning.PositionMe.Traj.Quaternion parseFrom( + com.google.protobuf.CodedInputStream input, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws java.io.IOException { + return com.google.protobuf.GeneratedMessage + .parseWithIOException(PARSER, input, extensionRegistry); } + @java.lang.Override public Builder newBuilderForType() { return newBuilder(); } public static Builder newBuilder() { return DEFAULT_INSTANCE.toBuilder(); } - public static Builder newBuilder(AP_Data prototype) { + public static Builder newBuilder(com.openpositioning.PositionMe.Traj.Quaternion prototype) { return DEFAULT_INSTANCE.toBuilder().mergeFrom(prototype); } + @java.lang.Override public Builder toBuilder() { return this == DEFAULT_INSTANCE - ? new Builder() : new Builder().mergeFrom(this); + ? new Builder() : new Builder().mergeFrom(this); } - @Override + @java.lang.Override protected Builder newBuilderForType( - com.google.protobuf.GeneratedMessageV3.BuilderParent parent) { + com.google.protobuf.GeneratedMessage.BuilderParent parent) { Builder builder = new Builder(parent); return builder; } /** - * Protobuf type {@code AP_Data} + * Protobuf type {@code Quaternion} */ public static final class Builder extends - com.google.protobuf.GeneratedMessageV3.Builder implements - // @@protoc_insertion_point(builder_implements:AP_Data) - AP_DataOrBuilder { + com.google.protobuf.GeneratedMessage.Builder implements + // @@protoc_insertion_point(builder_implements:Quaternion) + com.openpositioning.PositionMe.Traj.QuaternionOrBuilder { public static final com.google.protobuf.Descriptors.Descriptor - getDescriptor() { - return Traj.internal_static_AP_Data_descriptor; + getDescriptor() { + return com.openpositioning.PositionMe.Traj.internal_static_Quaternion_descriptor; } - protected com.google.protobuf.GeneratedMessageV3.FieldAccessorTable - internalGetFieldAccessorTable() { - return Traj.internal_static_AP_Data_fieldAccessorTable - .ensureFieldAccessorsInitialized( - AP_Data.class, Builder.class); + @java.lang.Override + protected com.google.protobuf.GeneratedMessage.FieldAccessorTable + internalGetFieldAccessorTable() { + return com.openpositioning.PositionMe.Traj.internal_static_Quaternion_fieldAccessorTable + .ensureFieldAccessorsInitialized( + com.openpositioning.PositionMe.Traj.Quaternion.class, com.openpositioning.PositionMe.Traj.Quaternion.Builder.class); } - // Construct using Traj.AP_Data.newBuilder() + // Construct using com.openpositioning.PositionMe.Traj.Quaternion.newBuilder() private Builder() { - maybeForceBuilderInitialization(); + } private Builder( - com.google.protobuf.GeneratedMessageV3.BuilderParent parent) { + com.google.protobuf.GeneratedMessage.BuilderParent parent) { super(parent); - maybeForceBuilderInitialization(); - } - private void maybeForceBuilderInitialization() { - if (com.google.protobuf.GeneratedMessageV3 - .alwaysUseFieldBuilders) { - } + } + @java.lang.Override public Builder clear() { super.clear(); - mac_ = 0L; - - ssid_ = ""; - - frequency_ = 0L; - + bitField0_ = 0; + x_ = 0F; + y_ = 0F; + z_ = 0F; + w_ = 0F; return this; } + @java.lang.Override public com.google.protobuf.Descriptors.Descriptor - getDescriptorForType() { - return Traj.internal_static_AP_Data_descriptor; + getDescriptorForType() { + return com.openpositioning.PositionMe.Traj.internal_static_Quaternion_descriptor; } - public AP_Data getDefaultInstanceForType() { - return AP_Data.getDefaultInstance(); + @java.lang.Override + public com.openpositioning.PositionMe.Traj.Quaternion getDefaultInstanceForType() { + return com.openpositioning.PositionMe.Traj.Quaternion.getDefaultInstance(); } - public AP_Data build() { - AP_Data result = buildPartial(); + @java.lang.Override + public com.openpositioning.PositionMe.Traj.Quaternion build() { + com.openpositioning.PositionMe.Traj.Quaternion result = buildPartial(); if (!result.isInitialized()) { throw newUninitializedMessageException(result); } return result; } - public AP_Data buildPartial() { - AP_Data result = new AP_Data(this); - result.mac_ = mac_; - result.ssid_ = ssid_; - result.frequency_ = frequency_; + @java.lang.Override + public com.openpositioning.PositionMe.Traj.Quaternion buildPartial() { + com.openpositioning.PositionMe.Traj.Quaternion result = new com.openpositioning.PositionMe.Traj.Quaternion(this); + if (bitField0_ != 0) { buildPartial0(result); } onBuilt(); return result; } - public Builder clone() { - return (Builder) super.clone(); - } - public Builder setField( - com.google.protobuf.Descriptors.FieldDescriptor field, - Object value) { - return (Builder) super.setField(field, value); - } - public Builder clearField( - com.google.protobuf.Descriptors.FieldDescriptor field) { - return (Builder) super.clearField(field); - } - public Builder clearOneof( - com.google.protobuf.Descriptors.OneofDescriptor oneof) { - return (Builder) super.clearOneof(oneof); - } - public Builder setRepeatedField( - com.google.protobuf.Descriptors.FieldDescriptor field, - int index, Object value) { - return (Builder) super.setRepeatedField(field, index, value); - } - public Builder addRepeatedField( - com.google.protobuf.Descriptors.FieldDescriptor field, - Object value) { - return (Builder) super.addRepeatedField(field, value); + private void buildPartial0(com.openpositioning.PositionMe.Traj.Quaternion result) { + int from_bitField0_ = bitField0_; + if (((from_bitField0_ & 0x00000001) != 0)) { + result.x_ = x_; + } + if (((from_bitField0_ & 0x00000002) != 0)) { + result.y_ = y_; + } + if (((from_bitField0_ & 0x00000004) != 0)) { + result.z_ = z_; + } + if (((from_bitField0_ & 0x00000008) != 0)) { + result.w_ = w_; + } } + + @java.lang.Override public Builder mergeFrom(com.google.protobuf.Message other) { - if (other instanceof AP_Data) { - return mergeFrom((AP_Data)other); + if (other instanceof com.openpositioning.PositionMe.Traj.Quaternion) { + return mergeFrom((com.openpositioning.PositionMe.Traj.Quaternion)other); } else { super.mergeFrom(other); return this; } } - public Builder mergeFrom(AP_Data other) { - if (other == AP_Data.getDefaultInstance()) return this; - if (other.getMac() != 0L) { - setMac(other.getMac()); + public Builder mergeFrom(com.openpositioning.PositionMe.Traj.Quaternion other) { + if (other == com.openpositioning.PositionMe.Traj.Quaternion.getDefaultInstance()) return this; + if (other.getX() != 0F) { + setX(other.getX()); } - if (!other.getSsid().isEmpty()) { - ssid_ = other.ssid_; - onChanged(); + if (other.getY() != 0F) { + setY(other.getY()); } - if (other.getFrequency() != 0L) { - setFrequency(other.getFrequency()); + if (other.getZ() != 0F) { + setZ(other.getZ()); } + if (other.getW() != 0F) { + setW(other.getW()); + } + this.mergeUnknownFields(other.getUnknownFields()); onChanged(); return this; } + @java.lang.Override public final boolean isInitialized() { return true; } + @java.lang.Override public Builder mergeFrom( - com.google.protobuf.CodedInputStream input, - com.google.protobuf.ExtensionRegistryLite extensionRegistry) - throws java.io.IOException { - AP_Data parsedMessage = null; + com.google.protobuf.CodedInputStream input, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws java.io.IOException { + if (extensionRegistry == null) { + throw new java.lang.NullPointerException(); + } try { - parsedMessage = PARSER.parsePartialFrom(input, extensionRegistry); + boolean done = false; + while (!done) { + int tag = input.readTag(); + switch (tag) { + case 0: + done = true; + break; + case 13: { + x_ = input.readFloat(); + bitField0_ |= 0x00000001; + break; + } // case 13 + case 21: { + y_ = input.readFloat(); + bitField0_ |= 0x00000002; + break; + } // case 21 + case 29: { + z_ = input.readFloat(); + bitField0_ |= 0x00000004; + break; + } // case 29 + case 37: { + w_ = input.readFloat(); + bitField0_ |= 0x00000008; + break; + } // case 37 + default: { + if (!super.parseUnknownField(input, extensionRegistry, tag)) { + done = true; // was an endgroup tag + } + break; + } // default: + } // switch (tag) + } // while (!done) } catch (com.google.protobuf.InvalidProtocolBufferException e) { - parsedMessage = (AP_Data) e.getUnfinishedMessage(); throw e.unwrapIOException(); } finally { - if (parsedMessage != null) { - mergeFrom(parsedMessage); - } - } + onChanged(); + } // finally return this; } + private int bitField0_; - private long mac_ ; + private float x_ ; /** - *
-       * Integer encoding of the hex mac address
-       * e.g. 207394925843984
-       * 
- * - * optional int64 mac = 1; + * float x = 1; + * @return The x. */ - public long getMac() { - return mac_; + @java.lang.Override + public float getX() { + return x_; } /** - *
-       * Integer encoding of the hex mac address
-       * e.g. 207394925843984
-       * 
- * - * optional int64 mac = 1; + * float x = 1; + * @param value The x to set. + * @return This builder for chaining. */ - public Builder setMac(long value) { - - mac_ = value; + public Builder setX(float value) { + + x_ = value; + bitField0_ |= 0x00000001; onChanged(); return this; } /** - *
-       * Integer encoding of the hex mac address
-       * e.g. 207394925843984
-       * 
- * - * optional int64 mac = 1; + * float x = 1; + * @return This builder for chaining. */ - public Builder clearMac() { - - mac_ = 0L; + public Builder clearX() { + bitField0_ = (bitField0_ & ~0x00000001); + x_ = 0F; onChanged(); return this; } - private Object ssid_ = ""; + private float y_ ; /** - *
-       * E.g. 'Eduroam' or 'Starbucks_free_wifi'
-       * 
- * - * optional string ssid = 2; + * float y = 2; + * @return The y. */ - public String getSsid() { - Object ref = ssid_; - if (!(ref instanceof String)) { - com.google.protobuf.ByteString bs = - (com.google.protobuf.ByteString) ref; - String s = bs.toStringUtf8(); - ssid_ = s; - return s; - } else { - return (String) ref; - } + @java.lang.Override + public float getY() { + return y_; } /** - *
-       * E.g. 'Eduroam' or 'Starbucks_free_wifi'
-       * 
- * - * optional string ssid = 2; + * float y = 2; + * @param value The y to set. + * @return This builder for chaining. */ - public com.google.protobuf.ByteString - getSsidBytes() { - Object ref = ssid_; - if (ref instanceof String) { - com.google.protobuf.ByteString b = - com.google.protobuf.ByteString.copyFromUtf8( - (String) ref); - ssid_ = b; - return b; - } else { - return (com.google.protobuf.ByteString) ref; - } + public Builder setY(float value) { + + y_ = value; + bitField0_ |= 0x00000002; + onChanged(); + return this; } /** - *
-       * E.g. 'Eduroam' or 'Starbucks_free_wifi'
-       * 
- * - * optional string ssid = 2; + * float y = 2; + * @return This builder for chaining. */ - public Builder setSsid( - String value) { - if (value == null) { - throw new NullPointerException(); - } - - ssid_ = value; + public Builder clearY() { + bitField0_ = (bitField0_ & ~0x00000002); + y_ = 0F; onChanged(); return this; } + + private float z_ ; + /** + * float z = 3; + * @return The z. + */ + @java.lang.Override + public float getZ() { + return z_; + } /** - *
-       * E.g. 'Eduroam' or 'Starbucks_free_wifi'
-       * 
- * - * optional string ssid = 2; + * float z = 3; + * @param value The z to set. + * @return This builder for chaining. */ - public Builder clearSsid() { - - ssid_ = getDefaultInstance().getSsid(); + public Builder setZ(float value) { + + z_ = value; + bitField0_ |= 0x00000004; onChanged(); return this; } /** - *
-       * E.g. 'Eduroam' or 'Starbucks_free_wifi'
-       * 
- * - * optional string ssid = 2; + * float z = 3; + * @return This builder for chaining. */ - public Builder setSsidBytes( - com.google.protobuf.ByteString value) { - if (value == null) { - throw new NullPointerException(); - } - checkByteStringIsUtf8(value); - - ssid_ = value; + public Builder clearZ() { + bitField0_ = (bitField0_ & ~0x00000004); + z_ = 0F; onChanged(); return this; } - private long frequency_ ; + private float w_ ; /** - *
-       * Typically 2.4GHz or 5GHz
-       * 
- * - * optional int64 frequency = 3; + * float w = 4; + * @return The w. */ - public long getFrequency() { - return frequency_; + @java.lang.Override + public float getW() { + return w_; } /** - *
-       * Typically 2.4GHz or 5GHz
-       * 
- * - * optional int64 frequency = 3; + * float w = 4; + * @param value The w to set. + * @return This builder for chaining. */ - public Builder setFrequency(long value) { - - frequency_ = value; + public Builder setW(float value) { + + w_ = value; + bitField0_ |= 0x00000008; onChanged(); return this; } /** - *
-       * Typically 2.4GHz or 5GHz
-       * 
- * - * optional int64 frequency = 3; + * float w = 4; + * @return This builder for chaining. */ - public Builder clearFrequency() { - - frequency_ = 0L; + public Builder clearW() { + bitField0_ = (bitField0_ & ~0x00000008); + w_ = 0F; onChanged(); return this; } - public final Builder setUnknownFields( - final com.google.protobuf.UnknownFieldSet unknownFields) { - return this; - } - - public final Builder mergeUnknownFields( - final com.google.protobuf.UnknownFieldSet unknownFields) { - return this; - } - - // @@protoc_insertion_point(builder_scope:AP_Data) + // @@protoc_insertion_point(builder_scope:Quaternion) } - // @@protoc_insertion_point(class_scope:AP_Data) - private static final AP_Data DEFAULT_INSTANCE; + // @@protoc_insertion_point(class_scope:Quaternion) + private static final com.openpositioning.PositionMe.Traj.Quaternion DEFAULT_INSTANCE; static { - DEFAULT_INSTANCE = new AP_Data(); + DEFAULT_INSTANCE = new com.openpositioning.PositionMe.Traj.Quaternion(); } - public static AP_Data getDefaultInstance() { + public static com.openpositioning.PositionMe.Traj.Quaternion getDefaultInstance() { return DEFAULT_INSTANCE; } - private static final com.google.protobuf.Parser - PARSER = new com.google.protobuf.AbstractParser() { - public AP_Data parsePartialFrom( - com.google.protobuf.CodedInputStream input, - com.google.protobuf.ExtensionRegistryLite extensionRegistry) - throws com.google.protobuf.InvalidProtocolBufferException { - return new AP_Data(input, extensionRegistry); + private static final com.google.protobuf.Parser + PARSER = new com.google.protobuf.AbstractParser() { + @java.lang.Override + public Quaternion parsePartialFrom( + com.google.protobuf.CodedInputStream input, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + Builder builder = newBuilder(); + try { + builder.mergeFrom(input, extensionRegistry); + } catch (com.google.protobuf.InvalidProtocolBufferException e) { + throw e.setUnfinishedMessage(builder.buildPartial()); + } catch (com.google.protobuf.UninitializedMessageException e) { + throw e.asInvalidProtocolBufferException().setUnfinishedMessage(builder.buildPartial()); + } catch (java.io.IOException e) { + throw new com.google.protobuf.InvalidProtocolBufferException(e) + .setUnfinishedMessage(builder.buildPartial()); + } + return builder.buildPartial(); } }; - public static com.google.protobuf.Parser parser() { + public static com.google.protobuf.Parser parser() { return PARSER; } - @Override - public com.google.protobuf.Parser getParserForType() { + @java.lang.Override + public com.google.protobuf.Parser getParserForType() { return PARSER; } - public AP_Data getDefaultInstanceForType() { + @java.lang.Override + public com.openpositioning.PositionMe.Traj.Quaternion getDefaultInstanceForType() { return DEFAULT_INSTANCE; } } - public interface Sensor_InfoOrBuilder extends - // @@protoc_insertion_point(interface_extends:Sensor_Info) - com.google.protobuf.MessageOrBuilder { + public interface SensorInfoOrBuilder extends + // @@protoc_insertion_point(interface_extends:SensorInfo) + com.google.protobuf.MessageOrBuilder { /** - * optional string name = 1; + * string name = 1; + * @return The name. */ - String getName(); + java.lang.String getName(); /** - * optional string name = 1; + * string name = 1; + * @return The bytes for name. */ com.google.protobuf.ByteString - getNameBytes(); + getNameBytes(); /** - * optional string vendor = 2; + * string vendor = 2; + * @return The vendor. */ - String getVendor(); + java.lang.String getVendor(); /** - * optional string vendor = 2; + * string vendor = 2; + * @return The bytes for vendor. */ com.google.protobuf.ByteString - getVendorBytes(); + getVendorBytes(); /** - * optional float resolution = 3; + * float resolution = 3; + * @return The resolution. */ float getResolution(); /** - * optional float power = 4; + * float power = 4; + * @return The power. */ float getPower(); /** - * optional int32 version = 5; + * int32 version = 5; + * @return The version. */ int getVersion(); /** - * optional int32 type = 6; + * int32 type = 6; + * @return The type. */ int getType(); + + /** + * float max_range = 7; + * @return The maxRange. + */ + float getMaxRange(); + + /** + * float frequency = 8; + * @return The frequency. + */ + float getFrequency(); } /** - * Protobuf type {@code Sensor_Info} + * Protobuf type {@code SensorInfo} */ - public static final class Sensor_Info extends - com.google.protobuf.GeneratedMessageV3 implements - // @@protoc_insertion_point(message_implements:Sensor_Info) - Sensor_InfoOrBuilder { - // Use Sensor_Info.newBuilder() to construct. - private Sensor_Info(com.google.protobuf.GeneratedMessageV3.Builder builder) { + public static final class SensorInfo extends + com.google.protobuf.GeneratedMessage implements + // @@protoc_insertion_point(message_implements:SensorInfo) + SensorInfoOrBuilder { + private static final long serialVersionUID = 0L; + static { + com.google.protobuf.RuntimeVersion.validateProtobufGencodeVersion( + com.google.protobuf.RuntimeVersion.RuntimeDomain.PUBLIC, + /* major= */ 4, + /* minor= */ 29, + /* patch= */ 6, + /* suffix= */ "", + SensorInfo.class.getName()); + } + // Use SensorInfo.newBuilder() to construct. + private SensorInfo(com.google.protobuf.GeneratedMessage.Builder builder) { super(builder); } - private Sensor_Info() { + private SensorInfo() { name_ = ""; vendor_ = ""; - resolution_ = 0F; - power_ = 0F; - version_ = 0; - type_ = 0; - } - - @Override - public final com.google.protobuf.UnknownFieldSet - getUnknownFields() { - return com.google.protobuf.UnknownFieldSet.getDefaultInstance(); - } - private Sensor_Info( - com.google.protobuf.CodedInputStream input, - com.google.protobuf.ExtensionRegistryLite extensionRegistry) - throws com.google.protobuf.InvalidProtocolBufferException { - this(); - int mutable_bitField0_ = 0; - try { - boolean done = false; - while (!done) { - int tag = input.readTag(); - switch (tag) { - case 0: - done = true; - break; - default: { - if (!input.skipField(tag)) { - done = true; - } - break; - } - case 10: { - String s = input.readStringRequireUtf8(); - - name_ = s; - break; - } - case 18: { - String s = input.readStringRequireUtf8(); - - vendor_ = s; - break; - } - case 29: { - - resolution_ = input.readFloat(); - break; - } - case 37: { - - power_ = input.readFloat(); - break; - } - case 40: { - - version_ = input.readInt32(); - break; - } - case 48: { - - type_ = input.readInt32(); - break; - } - } - } - } catch (com.google.protobuf.InvalidProtocolBufferException e) { - throw e.setUnfinishedMessage(this); - } catch (java.io.IOException e) { - throw new com.google.protobuf.InvalidProtocolBufferException( - e).setUnfinishedMessage(this); - } finally { - makeExtensionsImmutable(); - } } + public static final com.google.protobuf.Descriptors.Descriptor - getDescriptor() { - return Traj.internal_static_Sensor_Info_descriptor; + getDescriptor() { + return com.openpositioning.PositionMe.Traj.internal_static_SensorInfo_descriptor; } - protected com.google.protobuf.GeneratedMessageV3.FieldAccessorTable - internalGetFieldAccessorTable() { - return Traj.internal_static_Sensor_Info_fieldAccessorTable - .ensureFieldAccessorsInitialized( - Sensor_Info.class, Builder.class); + @java.lang.Override + protected com.google.protobuf.GeneratedMessage.FieldAccessorTable + internalGetFieldAccessorTable() { + return com.openpositioning.PositionMe.Traj.internal_static_SensorInfo_fieldAccessorTable + .ensureFieldAccessorsInitialized( + com.openpositioning.PositionMe.Traj.SensorInfo.class, com.openpositioning.PositionMe.Traj.SensorInfo.Builder.class); } public static final int NAME_FIELD_NUMBER = 1; - private volatile Object name_; + @SuppressWarnings("serial") + private volatile java.lang.Object name_ = ""; /** - * optional string name = 1; + * string name = 1; + * @return The name. */ - public String getName() { - Object ref = name_; - if (ref instanceof String) { - return (String) ref; + @java.lang.Override + public java.lang.String getName() { + java.lang.Object ref = name_; + if (ref instanceof java.lang.String) { + return (java.lang.String) ref; } else { - com.google.protobuf.ByteString bs = - (com.google.protobuf.ByteString) ref; - String s = bs.toStringUtf8(); + com.google.protobuf.ByteString bs = + (com.google.protobuf.ByteString) ref; + java.lang.String s = bs.toStringUtf8(); name_ = s; return s; } } /** - * optional string name = 1; + * string name = 1; + * @return The bytes for name. */ + @java.lang.Override public com.google.protobuf.ByteString - getNameBytes() { - Object ref = name_; - if (ref instanceof String) { - com.google.protobuf.ByteString b = - com.google.protobuf.ByteString.copyFromUtf8( - (String) ref); + getNameBytes() { + java.lang.Object ref = name_; + if (ref instanceof java.lang.String) { + com.google.protobuf.ByteString b = + com.google.protobuf.ByteString.copyFromUtf8( + (java.lang.String) ref); name_ = b; return b; } else { @@ -11754,32 +19880,37 @@ public String getName() { } public static final int VENDOR_FIELD_NUMBER = 2; - private volatile Object vendor_; + @SuppressWarnings("serial") + private volatile java.lang.Object vendor_ = ""; /** - * optional string vendor = 2; + * string vendor = 2; + * @return The vendor. */ - public String getVendor() { - Object ref = vendor_; - if (ref instanceof String) { - return (String) ref; + @java.lang.Override + public java.lang.String getVendor() { + java.lang.Object ref = vendor_; + if (ref instanceof java.lang.String) { + return (java.lang.String) ref; } else { - com.google.protobuf.ByteString bs = - (com.google.protobuf.ByteString) ref; - String s = bs.toStringUtf8(); + com.google.protobuf.ByteString bs = + (com.google.protobuf.ByteString) ref; + java.lang.String s = bs.toStringUtf8(); vendor_ = s; return s; } } /** - * optional string vendor = 2; + * string vendor = 2; + * @return The bytes for vendor. */ + @java.lang.Override public com.google.protobuf.ByteString - getVendorBytes() { - Object ref = vendor_; - if (ref instanceof String) { - com.google.protobuf.ByteString b = - com.google.protobuf.ByteString.copyFromUtf8( - (String) ref); + getVendorBytes() { + java.lang.Object ref = vendor_; + if (ref instanceof java.lang.String) { + com.google.protobuf.ByteString b = + com.google.protobuf.ByteString.copyFromUtf8( + (java.lang.String) ref); vendor_ = b; return b; } else { @@ -11788,42 +19919,73 @@ public String getVendor() { } public static final int RESOLUTION_FIELD_NUMBER = 3; - private float resolution_; + private float resolution_ = 0F; /** - * optional float resolution = 3; + * float resolution = 3; + * @return The resolution. */ + @java.lang.Override public float getResolution() { return resolution_; } public static final int POWER_FIELD_NUMBER = 4; - private float power_; + private float power_ = 0F; /** - * optional float power = 4; + * float power = 4; + * @return The power. */ + @java.lang.Override public float getPower() { return power_; } public static final int VERSION_FIELD_NUMBER = 5; - private int version_; + private int version_ = 0; /** - * optional int32 version = 5; + * int32 version = 5; + * @return The version. */ + @java.lang.Override public int getVersion() { return version_; } public static final int TYPE_FIELD_NUMBER = 6; - private int type_; + private int type_ = 0; /** - * optional int32 type = 6; + * int32 type = 6; + * @return The type. */ + @java.lang.Override public int getType() { return type_; } + public static final int MAX_RANGE_FIELD_NUMBER = 7; + private float maxRange_ = 0F; + /** + * float max_range = 7; + * @return The maxRange. + */ + @java.lang.Override + public float getMaxRange() { + return maxRange_; + } + + public static final int FREQUENCY_FIELD_NUMBER = 8; + private float frequency_ = 0F; + /** + * float frequency = 8; + * @return The frequency. + */ + @java.lang.Override + public float getFrequency() { + return frequency_; + } + private byte memoizedIsInitialized = -1; + @java.lang.Override public final boolean isInitialized() { byte isInitialized = memoizedIsInitialized; if (isInitialized == 1) return true; @@ -11833,18 +19995,19 @@ public final boolean isInitialized() { return true; } + @java.lang.Override public void writeTo(com.google.protobuf.CodedOutputStream output) - throws java.io.IOException { - if (!getNameBytes().isEmpty()) { - com.google.protobuf.GeneratedMessageV3.writeString(output, 1, name_); + throws java.io.IOException { + if (!com.google.protobuf.GeneratedMessage.isStringEmpty(name_)) { + com.google.protobuf.GeneratedMessage.writeString(output, 1, name_); } - if (!getVendorBytes().isEmpty()) { - com.google.protobuf.GeneratedMessageV3.writeString(output, 2, vendor_); + if (!com.google.protobuf.GeneratedMessage.isStringEmpty(vendor_)) { + com.google.protobuf.GeneratedMessage.writeString(output, 2, vendor_); } - if (resolution_ != 0F) { + if (java.lang.Float.floatToRawIntBits(resolution_) != 0) { output.writeFloat(3, resolution_); } - if (power_ != 0F) { + if (java.lang.Float.floatToRawIntBits(power_) != 0) { output.writeFloat(4, power_); } if (version_ != 0) { @@ -11853,296 +20016,335 @@ public void writeTo(com.google.protobuf.CodedOutputStream output) if (type_ != 0) { output.writeInt32(6, type_); } + if (java.lang.Float.floatToRawIntBits(maxRange_) != 0) { + output.writeFloat(7, maxRange_); + } + if (java.lang.Float.floatToRawIntBits(frequency_) != 0) { + output.writeFloat(8, frequency_); + } + getUnknownFields().writeTo(output); } + @java.lang.Override public int getSerializedSize() { int size = memoizedSize; if (size != -1) return size; size = 0; - if (!getNameBytes().isEmpty()) { - size += com.google.protobuf.GeneratedMessageV3.computeStringSize(1, name_); + if (!com.google.protobuf.GeneratedMessage.isStringEmpty(name_)) { + size += com.google.protobuf.GeneratedMessage.computeStringSize(1, name_); } - if (!getVendorBytes().isEmpty()) { - size += com.google.protobuf.GeneratedMessageV3.computeStringSize(2, vendor_); + if (!com.google.protobuf.GeneratedMessage.isStringEmpty(vendor_)) { + size += com.google.protobuf.GeneratedMessage.computeStringSize(2, vendor_); } - if (resolution_ != 0F) { + if (java.lang.Float.floatToRawIntBits(resolution_) != 0) { size += com.google.protobuf.CodedOutputStream - .computeFloatSize(3, resolution_); + .computeFloatSize(3, resolution_); } - if (power_ != 0F) { + if (java.lang.Float.floatToRawIntBits(power_) != 0) { size += com.google.protobuf.CodedOutputStream - .computeFloatSize(4, power_); + .computeFloatSize(4, power_); } if (version_ != 0) { size += com.google.protobuf.CodedOutputStream - .computeInt32Size(5, version_); + .computeInt32Size(5, version_); } if (type_ != 0) { size += com.google.protobuf.CodedOutputStream - .computeInt32Size(6, type_); + .computeInt32Size(6, type_); + } + if (java.lang.Float.floatToRawIntBits(maxRange_) != 0) { + size += com.google.protobuf.CodedOutputStream + .computeFloatSize(7, maxRange_); + } + if (java.lang.Float.floatToRawIntBits(frequency_) != 0) { + size += com.google.protobuf.CodedOutputStream + .computeFloatSize(8, frequency_); } + size += getUnknownFields().getSerializedSize(); memoizedSize = size; return size; } - private static final long serialVersionUID = 0L; - @Override - public boolean equals(final Object obj) { + @java.lang.Override + public boolean equals(final java.lang.Object obj) { if (obj == this) { - return true; + return true; } - if (!(obj instanceof Sensor_Info)) { + if (!(obj instanceof com.openpositioning.PositionMe.Traj.SensorInfo)) { return super.equals(obj); } - Sensor_Info other = (Sensor_Info) obj; - - boolean result = true; - result = result && getName() - .equals(other.getName()); - result = result && getVendor() - .equals(other.getVendor()); - result = result && ( - Float.floatToIntBits(getResolution()) - == Float.floatToIntBits( - other.getResolution())); - result = result && ( - Float.floatToIntBits(getPower()) - == Float.floatToIntBits( - other.getPower())); - result = result && (getVersion() - == other.getVersion()); - result = result && (getType() - == other.getType()); - return result; - } - - @Override + com.openpositioning.PositionMe.Traj.SensorInfo other = (com.openpositioning.PositionMe.Traj.SensorInfo) obj; + + if (!getName() + .equals(other.getName())) return false; + if (!getVendor() + .equals(other.getVendor())) return false; + if (java.lang.Float.floatToIntBits(getResolution()) + != java.lang.Float.floatToIntBits( + other.getResolution())) return false; + if (java.lang.Float.floatToIntBits(getPower()) + != java.lang.Float.floatToIntBits( + other.getPower())) return false; + if (getVersion() + != other.getVersion()) return false; + if (getType() + != other.getType()) return false; + if (java.lang.Float.floatToIntBits(getMaxRange()) + != java.lang.Float.floatToIntBits( + other.getMaxRange())) return false; + if (java.lang.Float.floatToIntBits(getFrequency()) + != java.lang.Float.floatToIntBits( + other.getFrequency())) return false; + if (!getUnknownFields().equals(other.getUnknownFields())) return false; + return true; + } + + @java.lang.Override public int hashCode() { if (memoizedHashCode != 0) { return memoizedHashCode; } int hash = 41; - hash = (19 * hash) + getDescriptorForType().hashCode(); + hash = (19 * hash) + getDescriptor().hashCode(); hash = (37 * hash) + NAME_FIELD_NUMBER; hash = (53 * hash) + getName().hashCode(); hash = (37 * hash) + VENDOR_FIELD_NUMBER; hash = (53 * hash) + getVendor().hashCode(); hash = (37 * hash) + RESOLUTION_FIELD_NUMBER; - hash = (53 * hash) + Float.floatToIntBits( - getResolution()); + hash = (53 * hash) + java.lang.Float.floatToIntBits( + getResolution()); hash = (37 * hash) + POWER_FIELD_NUMBER; - hash = (53 * hash) + Float.floatToIntBits( - getPower()); + hash = (53 * hash) + java.lang.Float.floatToIntBits( + getPower()); hash = (37 * hash) + VERSION_FIELD_NUMBER; hash = (53 * hash) + getVersion(); hash = (37 * hash) + TYPE_FIELD_NUMBER; hash = (53 * hash) + getType(); - hash = (29 * hash) + unknownFields.hashCode(); + hash = (37 * hash) + MAX_RANGE_FIELD_NUMBER; + hash = (53 * hash) + java.lang.Float.floatToIntBits( + getMaxRange()); + hash = (37 * hash) + FREQUENCY_FIELD_NUMBER; + hash = (53 * hash) + java.lang.Float.floatToIntBits( + getFrequency()); + hash = (29 * hash) + getUnknownFields().hashCode(); memoizedHashCode = hash; return hash; } - public static Sensor_Info parseFrom( - com.google.protobuf.ByteString data) - throws com.google.protobuf.InvalidProtocolBufferException { + public static com.openpositioning.PositionMe.Traj.SensorInfo parseFrom( + java.nio.ByteBuffer data) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + public static com.openpositioning.PositionMe.Traj.SensorInfo parseFrom( + java.nio.ByteBuffer data, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data, extensionRegistry); + } + public static com.openpositioning.PositionMe.Traj.SensorInfo parseFrom( + com.google.protobuf.ByteString data) + throws com.google.protobuf.InvalidProtocolBufferException { return PARSER.parseFrom(data); } - public static Sensor_Info parseFrom( - com.google.protobuf.ByteString data, - com.google.protobuf.ExtensionRegistryLite extensionRegistry) - throws com.google.protobuf.InvalidProtocolBufferException { + public static com.openpositioning.PositionMe.Traj.SensorInfo parseFrom( + com.google.protobuf.ByteString data, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { return PARSER.parseFrom(data, extensionRegistry); } - public static Sensor_Info parseFrom(byte[] data) - throws com.google.protobuf.InvalidProtocolBufferException { + public static com.openpositioning.PositionMe.Traj.SensorInfo parseFrom(byte[] data) + throws com.google.protobuf.InvalidProtocolBufferException { return PARSER.parseFrom(data); } - public static Sensor_Info parseFrom( - byte[] data, - com.google.protobuf.ExtensionRegistryLite extensionRegistry) - throws com.google.protobuf.InvalidProtocolBufferException { + public static com.openpositioning.PositionMe.Traj.SensorInfo parseFrom( + byte[] data, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { return PARSER.parseFrom(data, extensionRegistry); } - public static Sensor_Info parseFrom(java.io.InputStream input) - throws java.io.IOException { - return com.google.protobuf.GeneratedMessageV3 - .parseWithIOException(PARSER, input); - } - public static Sensor_Info parseFrom( - java.io.InputStream input, - com.google.protobuf.ExtensionRegistryLite extensionRegistry) - throws java.io.IOException { - return com.google.protobuf.GeneratedMessageV3 - .parseWithIOException(PARSER, input, extensionRegistry); - } - public static Sensor_Info parseDelimitedFrom(java.io.InputStream input) - throws java.io.IOException { - return com.google.protobuf.GeneratedMessageV3 - .parseDelimitedWithIOException(PARSER, input); - } - public static Sensor_Info parseDelimitedFrom( - java.io.InputStream input, - com.google.protobuf.ExtensionRegistryLite extensionRegistry) - throws java.io.IOException { - return com.google.protobuf.GeneratedMessageV3 - .parseDelimitedWithIOException(PARSER, input, extensionRegistry); - } - public static Sensor_Info parseFrom( - com.google.protobuf.CodedInputStream input) - throws java.io.IOException { - return com.google.protobuf.GeneratedMessageV3 - .parseWithIOException(PARSER, input); - } - public static Sensor_Info parseFrom( - com.google.protobuf.CodedInputStream input, - com.google.protobuf.ExtensionRegistryLite extensionRegistry) - throws java.io.IOException { - return com.google.protobuf.GeneratedMessageV3 - .parseWithIOException(PARSER, input, extensionRegistry); + public static com.openpositioning.PositionMe.Traj.SensorInfo parseFrom(java.io.InputStream input) + throws java.io.IOException { + return com.google.protobuf.GeneratedMessage + .parseWithIOException(PARSER, input); + } + public static com.openpositioning.PositionMe.Traj.SensorInfo parseFrom( + java.io.InputStream input, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws java.io.IOException { + return com.google.protobuf.GeneratedMessage + .parseWithIOException(PARSER, input, extensionRegistry); + } + + public static com.openpositioning.PositionMe.Traj.SensorInfo parseDelimitedFrom(java.io.InputStream input) + throws java.io.IOException { + return com.google.protobuf.GeneratedMessage + .parseDelimitedWithIOException(PARSER, input); + } + + public static com.openpositioning.PositionMe.Traj.SensorInfo parseDelimitedFrom( + java.io.InputStream input, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws java.io.IOException { + return com.google.protobuf.GeneratedMessage + .parseDelimitedWithIOException(PARSER, input, extensionRegistry); + } + public static com.openpositioning.PositionMe.Traj.SensorInfo parseFrom( + com.google.protobuf.CodedInputStream input) + throws java.io.IOException { + return com.google.protobuf.GeneratedMessage + .parseWithIOException(PARSER, input); + } + public static com.openpositioning.PositionMe.Traj.SensorInfo parseFrom( + com.google.protobuf.CodedInputStream input, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws java.io.IOException { + return com.google.protobuf.GeneratedMessage + .parseWithIOException(PARSER, input, extensionRegistry); } + @java.lang.Override public Builder newBuilderForType() { return newBuilder(); } public static Builder newBuilder() { return DEFAULT_INSTANCE.toBuilder(); } - public static Builder newBuilder(Sensor_Info prototype) { + public static Builder newBuilder(com.openpositioning.PositionMe.Traj.SensorInfo prototype) { return DEFAULT_INSTANCE.toBuilder().mergeFrom(prototype); } + @java.lang.Override public Builder toBuilder() { return this == DEFAULT_INSTANCE - ? new Builder() : new Builder().mergeFrom(this); + ? new Builder() : new Builder().mergeFrom(this); } - @Override + @java.lang.Override protected Builder newBuilderForType( - com.google.protobuf.GeneratedMessageV3.BuilderParent parent) { + com.google.protobuf.GeneratedMessage.BuilderParent parent) { Builder builder = new Builder(parent); return builder; } /** - * Protobuf type {@code Sensor_Info} + * Protobuf type {@code SensorInfo} */ public static final class Builder extends - com.google.protobuf.GeneratedMessageV3.Builder implements - // @@protoc_insertion_point(builder_implements:Sensor_Info) - Sensor_InfoOrBuilder { + com.google.protobuf.GeneratedMessage.Builder implements + // @@protoc_insertion_point(builder_implements:SensorInfo) + com.openpositioning.PositionMe.Traj.SensorInfoOrBuilder { public static final com.google.protobuf.Descriptors.Descriptor - getDescriptor() { - return Traj.internal_static_Sensor_Info_descriptor; + getDescriptor() { + return com.openpositioning.PositionMe.Traj.internal_static_SensorInfo_descriptor; } - protected com.google.protobuf.GeneratedMessageV3.FieldAccessorTable - internalGetFieldAccessorTable() { - return Traj.internal_static_Sensor_Info_fieldAccessorTable - .ensureFieldAccessorsInitialized( - Sensor_Info.class, Builder.class); + @java.lang.Override + protected com.google.protobuf.GeneratedMessage.FieldAccessorTable + internalGetFieldAccessorTable() { + return com.openpositioning.PositionMe.Traj.internal_static_SensorInfo_fieldAccessorTable + .ensureFieldAccessorsInitialized( + com.openpositioning.PositionMe.Traj.SensorInfo.class, com.openpositioning.PositionMe.Traj.SensorInfo.Builder.class); } - // Construct using Traj.Sensor_Info.newBuilder() + // Construct using com.openpositioning.PositionMe.Traj.SensorInfo.newBuilder() private Builder() { - maybeForceBuilderInitialization(); + } private Builder( - com.google.protobuf.GeneratedMessageV3.BuilderParent parent) { + com.google.protobuf.GeneratedMessage.BuilderParent parent) { super(parent); - maybeForceBuilderInitialization(); - } - private void maybeForceBuilderInitialization() { - if (com.google.protobuf.GeneratedMessageV3 - .alwaysUseFieldBuilders) { - } + } + @java.lang.Override public Builder clear() { super.clear(); + bitField0_ = 0; name_ = ""; - vendor_ = ""; - resolution_ = 0F; - power_ = 0F; - version_ = 0; - type_ = 0; - + maxRange_ = 0F; + frequency_ = 0F; return this; } + @java.lang.Override public com.google.protobuf.Descriptors.Descriptor - getDescriptorForType() { - return Traj.internal_static_Sensor_Info_descriptor; + getDescriptorForType() { + return com.openpositioning.PositionMe.Traj.internal_static_SensorInfo_descriptor; } - public Sensor_Info getDefaultInstanceForType() { - return Sensor_Info.getDefaultInstance(); + @java.lang.Override + public com.openpositioning.PositionMe.Traj.SensorInfo getDefaultInstanceForType() { + return com.openpositioning.PositionMe.Traj.SensorInfo.getDefaultInstance(); } - public Sensor_Info build() { - Sensor_Info result = buildPartial(); + @java.lang.Override + public com.openpositioning.PositionMe.Traj.SensorInfo build() { + com.openpositioning.PositionMe.Traj.SensorInfo result = buildPartial(); if (!result.isInitialized()) { throw newUninitializedMessageException(result); } return result; } - public Sensor_Info buildPartial() { - Sensor_Info result = new Sensor_Info(this); - result.name_ = name_; - result.vendor_ = vendor_; - result.resolution_ = resolution_; - result.power_ = power_; - result.version_ = version_; - result.type_ = type_; + @java.lang.Override + public com.openpositioning.PositionMe.Traj.SensorInfo buildPartial() { + com.openpositioning.PositionMe.Traj.SensorInfo result = new com.openpositioning.PositionMe.Traj.SensorInfo(this); + if (bitField0_ != 0) { buildPartial0(result); } onBuilt(); return result; } - public Builder clone() { - return (Builder) super.clone(); - } - public Builder setField( - com.google.protobuf.Descriptors.FieldDescriptor field, - Object value) { - return (Builder) super.setField(field, value); - } - public Builder clearField( - com.google.protobuf.Descriptors.FieldDescriptor field) { - return (Builder) super.clearField(field); - } - public Builder clearOneof( - com.google.protobuf.Descriptors.OneofDescriptor oneof) { - return (Builder) super.clearOneof(oneof); - } - public Builder setRepeatedField( - com.google.protobuf.Descriptors.FieldDescriptor field, - int index, Object value) { - return (Builder) super.setRepeatedField(field, index, value); - } - public Builder addRepeatedField( - com.google.protobuf.Descriptors.FieldDescriptor field, - Object value) { - return (Builder) super.addRepeatedField(field, value); + private void buildPartial0(com.openpositioning.PositionMe.Traj.SensorInfo result) { + int from_bitField0_ = bitField0_; + if (((from_bitField0_ & 0x00000001) != 0)) { + result.name_ = name_; + } + if (((from_bitField0_ & 0x00000002) != 0)) { + result.vendor_ = vendor_; + } + if (((from_bitField0_ & 0x00000004) != 0)) { + result.resolution_ = resolution_; + } + if (((from_bitField0_ & 0x00000008) != 0)) { + result.power_ = power_; + } + if (((from_bitField0_ & 0x00000010) != 0)) { + result.version_ = version_; + } + if (((from_bitField0_ & 0x00000020) != 0)) { + result.type_ = type_; + } + if (((from_bitField0_ & 0x00000040) != 0)) { + result.maxRange_ = maxRange_; + } + if (((from_bitField0_ & 0x00000080) != 0)) { + result.frequency_ = frequency_; + } } + + @java.lang.Override public Builder mergeFrom(com.google.protobuf.Message other) { - if (other instanceof Sensor_Info) { - return mergeFrom((Sensor_Info)other); + if (other instanceof com.openpositioning.PositionMe.Traj.SensorInfo) { + return mergeFrom((com.openpositioning.PositionMe.Traj.SensorInfo)other); } else { super.mergeFrom(other); return this; } } - public Builder mergeFrom(Sensor_Info other) { - if (other == Sensor_Info.getDefaultInstance()) return this; + public Builder mergeFrom(com.openpositioning.PositionMe.Traj.SensorInfo other) { + if (other == com.openpositioning.PositionMe.Traj.SensorInfo.getDefaultInstance()) return this; if (!other.getName().isEmpty()) { name_ = other.name_; + bitField0_ |= 0x00000001; onChanged(); } if (!other.getVendor().isEmpty()) { vendor_ = other.vendor_; + bitField0_ |= 0x00000002; onChanged(); } if (other.getResolution() != 0F) { @@ -12157,58 +20359,123 @@ public Builder mergeFrom(Sensor_Info other) { if (other.getType() != 0) { setType(other.getType()); } + if (other.getMaxRange() != 0F) { + setMaxRange(other.getMaxRange()); + } + if (other.getFrequency() != 0F) { + setFrequency(other.getFrequency()); + } + this.mergeUnknownFields(other.getUnknownFields()); onChanged(); return this; } + @java.lang.Override public final boolean isInitialized() { return true; } + @java.lang.Override public Builder mergeFrom( - com.google.protobuf.CodedInputStream input, - com.google.protobuf.ExtensionRegistryLite extensionRegistry) - throws java.io.IOException { - Sensor_Info parsedMessage = null; + com.google.protobuf.CodedInputStream input, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws java.io.IOException { + if (extensionRegistry == null) { + throw new java.lang.NullPointerException(); + } try { - parsedMessage = PARSER.parsePartialFrom(input, extensionRegistry); + boolean done = false; + while (!done) { + int tag = input.readTag(); + switch (tag) { + case 0: + done = true; + break; + case 10: { + name_ = input.readStringRequireUtf8(); + bitField0_ |= 0x00000001; + break; + } // case 10 + case 18: { + vendor_ = input.readStringRequireUtf8(); + bitField0_ |= 0x00000002; + break; + } // case 18 + case 29: { + resolution_ = input.readFloat(); + bitField0_ |= 0x00000004; + break; + } // case 29 + case 37: { + power_ = input.readFloat(); + bitField0_ |= 0x00000008; + break; + } // case 37 + case 40: { + version_ = input.readInt32(); + bitField0_ |= 0x00000010; + break; + } // case 40 + case 48: { + type_ = input.readInt32(); + bitField0_ |= 0x00000020; + break; + } // case 48 + case 61: { + maxRange_ = input.readFloat(); + bitField0_ |= 0x00000040; + break; + } // case 61 + case 69: { + frequency_ = input.readFloat(); + bitField0_ |= 0x00000080; + break; + } // case 69 + default: { + if (!super.parseUnknownField(input, extensionRegistry, tag)) { + done = true; // was an endgroup tag + } + break; + } // default: + } // switch (tag) + } // while (!done) } catch (com.google.protobuf.InvalidProtocolBufferException e) { - parsedMessage = (Sensor_Info) e.getUnfinishedMessage(); throw e.unwrapIOException(); } finally { - if (parsedMessage != null) { - mergeFrom(parsedMessage); - } - } + onChanged(); + } // finally return this; } + private int bitField0_; - private Object name_ = ""; + private java.lang.Object name_ = ""; /** - * optional string name = 1; + * string name = 1; + * @return The name. */ - public String getName() { - Object ref = name_; - if (!(ref instanceof String)) { + public java.lang.String getName() { + java.lang.Object ref = name_; + if (!(ref instanceof java.lang.String)) { com.google.protobuf.ByteString bs = - (com.google.protobuf.ByteString) ref; - String s = bs.toStringUtf8(); + (com.google.protobuf.ByteString) ref; + java.lang.String s = bs.toStringUtf8(); name_ = s; return s; } else { - return (String) ref; + return (java.lang.String) ref; } } /** - * optional string name = 1; + * string name = 1; + * @return The bytes for name. */ public com.google.protobuf.ByteString - getNameBytes() { - Object ref = name_; + getNameBytes() { + java.lang.Object ref = name_; if (ref instanceof String) { - com.google.protobuf.ByteString b = - com.google.protobuf.ByteString.copyFromUtf8( - (String) ref); + com.google.protobuf.ByteString b = + com.google.protobuf.ByteString.copyFromUtf8( + (java.lang.String) ref); name_ = b; return b; } else { @@ -12216,68 +20483,71 @@ public String getName() { } } /** - * optional string name = 1; + * string name = 1; + * @param value The name to set. + * @return This builder for chaining. */ public Builder setName( - String value) { - if (value == null) { - throw new NullPointerException(); - } - + java.lang.String value) { + if (value == null) { throw new NullPointerException(); } name_ = value; + bitField0_ |= 0x00000001; onChanged(); return this; } /** - * optional string name = 1; + * string name = 1; + * @return This builder for chaining. */ public Builder clearName() { - name_ = getDefaultInstance().getName(); + bitField0_ = (bitField0_ & ~0x00000001); onChanged(); return this; } /** - * optional string name = 1; + * string name = 1; + * @param value The bytes for name to set. + * @return This builder for chaining. */ public Builder setNameBytes( - com.google.protobuf.ByteString value) { - if (value == null) { - throw new NullPointerException(); - } - checkByteStringIsUtf8(value); - + com.google.protobuf.ByteString value) { + if (value == null) { throw new NullPointerException(); } + checkByteStringIsUtf8(value); name_ = value; + bitField0_ |= 0x00000001; onChanged(); return this; } - private Object vendor_ = ""; + private java.lang.Object vendor_ = ""; /** - * optional string vendor = 2; + * string vendor = 2; + * @return The vendor. */ - public String getVendor() { - Object ref = vendor_; - if (!(ref instanceof String)) { + public java.lang.String getVendor() { + java.lang.Object ref = vendor_; + if (!(ref instanceof java.lang.String)) { com.google.protobuf.ByteString bs = - (com.google.protobuf.ByteString) ref; - String s = bs.toStringUtf8(); + (com.google.protobuf.ByteString) ref; + java.lang.String s = bs.toStringUtf8(); vendor_ = s; return s; } else { - return (String) ref; + return (java.lang.String) ref; } } /** - * optional string vendor = 2; + * string vendor = 2; + * @return The bytes for vendor. */ public com.google.protobuf.ByteString - getVendorBytes() { - Object ref = vendor_; + getVendorBytes() { + java.lang.Object ref = vendor_; if (ref instanceof String) { - com.google.protobuf.ByteString b = - com.google.protobuf.ByteString.copyFromUtf8( - (String) ref); + com.google.protobuf.ByteString b = + com.google.protobuf.ByteString.copyFromUtf8( + (java.lang.String) ref); vendor_ = b; return b; } else { @@ -12285,63 +20555,70 @@ public String getVendor() { } } /** - * optional string vendor = 2; + * string vendor = 2; + * @param value The vendor to set. + * @return This builder for chaining. */ public Builder setVendor( - String value) { - if (value == null) { - throw new NullPointerException(); - } - + java.lang.String value) { + if (value == null) { throw new NullPointerException(); } vendor_ = value; + bitField0_ |= 0x00000002; onChanged(); return this; } /** - * optional string vendor = 2; + * string vendor = 2; + * @return This builder for chaining. */ public Builder clearVendor() { - vendor_ = getDefaultInstance().getVendor(); + bitField0_ = (bitField0_ & ~0x00000002); onChanged(); return this; } /** - * optional string vendor = 2; + * string vendor = 2; + * @param value The bytes for vendor to set. + * @return This builder for chaining. */ public Builder setVendorBytes( - com.google.protobuf.ByteString value) { - if (value == null) { - throw new NullPointerException(); - } - checkByteStringIsUtf8(value); - + com.google.protobuf.ByteString value) { + if (value == null) { throw new NullPointerException(); } + checkByteStringIsUtf8(value); vendor_ = value; + bitField0_ |= 0x00000002; onChanged(); return this; } private float resolution_ ; /** - * optional float resolution = 3; + * float resolution = 3; + * @return The resolution. */ + @java.lang.Override public float getResolution() { return resolution_; } /** - * optional float resolution = 3; + * float resolution = 3; + * @param value The resolution to set. + * @return This builder for chaining. */ public Builder setResolution(float value) { - + resolution_ = value; + bitField0_ |= 0x00000004; onChanged(); return this; } /** - * optional float resolution = 3; + * float resolution = 3; + * @return This builder for chaining. */ public Builder clearResolution() { - + bitField0_ = (bitField0_ & ~0x00000004); resolution_ = 0F; onChanged(); return this; @@ -12349,25 +20626,31 @@ public Builder clearResolution() { private float power_ ; /** - * optional float power = 4; + * float power = 4; + * @return The power. */ + @java.lang.Override public float getPower() { return power_; } /** - * optional float power = 4; + * float power = 4; + * @param value The power to set. + * @return This builder for chaining. */ public Builder setPower(float value) { - + power_ = value; + bitField0_ |= 0x00000008; onChanged(); return this; } /** - * optional float power = 4; + * float power = 4; + * @return This builder for chaining. */ public Builder clearPower() { - + bitField0_ = (bitField0_ & ~0x00000008); power_ = 0F; onChanged(); return this; @@ -12375,25 +20658,31 @@ public Builder clearPower() { private int version_ ; /** - * optional int32 version = 5; + * int32 version = 5; + * @return The version. */ + @java.lang.Override public int getVersion() { return version_; } /** - * optional int32 version = 5; + * int32 version = 5; + * @param value The version to set. + * @return This builder for chaining. */ public Builder setVersion(int value) { - + version_ = value; + bitField0_ |= 0x00000010; onChanged(); return this; } /** - * optional int32 version = 5; + * int32 version = 5; + * @return This builder for chaining. */ public Builder clearVersion() { - + bitField0_ = (bitField0_ & ~0x00000010); version_ = 0; onChanged(); return this; @@ -12401,263 +20690,417 @@ public Builder clearVersion() { private int type_ ; /** - * optional int32 type = 6; + * int32 type = 6; + * @return The type. */ + @java.lang.Override public int getType() { return type_; } /** - * optional int32 type = 6; + * int32 type = 6; + * @param value The type to set. + * @return This builder for chaining. */ public Builder setType(int value) { - + type_ = value; + bitField0_ |= 0x00000020; onChanged(); return this; } /** - * optional int32 type = 6; + * int32 type = 6; + * @return This builder for chaining. */ public Builder clearType() { - + bitField0_ = (bitField0_ & ~0x00000020); type_ = 0; onChanged(); return this; } - public final Builder setUnknownFields( - final com.google.protobuf.UnknownFieldSet unknownFields) { - return this; + + private float maxRange_ ; + /** + * float max_range = 7; + * @return The maxRange. + */ + @java.lang.Override + public float getMaxRange() { + return maxRange_; } + /** + * float max_range = 7; + * @param value The maxRange to set. + * @return This builder for chaining. + */ + public Builder setMaxRange(float value) { - public final Builder mergeUnknownFields( - final com.google.protobuf.UnknownFieldSet unknownFields) { + maxRange_ = value; + bitField0_ |= 0x00000040; + onChanged(); + return this; + } + /** + * float max_range = 7; + * @return This builder for chaining. + */ + public Builder clearMaxRange() { + bitField0_ = (bitField0_ & ~0x00000040); + maxRange_ = 0F; + onChanged(); return this; } + private float frequency_ ; + /** + * float frequency = 8; + * @return The frequency. + */ + @java.lang.Override + public float getFrequency() { + return frequency_; + } + /** + * float frequency = 8; + * @param value The frequency to set. + * @return This builder for chaining. + */ + public Builder setFrequency(float value) { + + frequency_ = value; + bitField0_ |= 0x00000080; + onChanged(); + return this; + } + /** + * float frequency = 8; + * @return This builder for chaining. + */ + public Builder clearFrequency() { + bitField0_ = (bitField0_ & ~0x00000080); + frequency_ = 0F; + onChanged(); + return this; + } - // @@protoc_insertion_point(builder_scope:Sensor_Info) + // @@protoc_insertion_point(builder_scope:SensorInfo) } - // @@protoc_insertion_point(class_scope:Sensor_Info) - private static final Sensor_Info DEFAULT_INSTANCE; + // @@protoc_insertion_point(class_scope:SensorInfo) + private static final com.openpositioning.PositionMe.Traj.SensorInfo DEFAULT_INSTANCE; static { - DEFAULT_INSTANCE = new Sensor_Info(); + DEFAULT_INSTANCE = new com.openpositioning.PositionMe.Traj.SensorInfo(); } - public static Sensor_Info getDefaultInstance() { + public static com.openpositioning.PositionMe.Traj.SensorInfo getDefaultInstance() { return DEFAULT_INSTANCE; } - private static final com.google.protobuf.Parser - PARSER = new com.google.protobuf.AbstractParser() { - public Sensor_Info parsePartialFrom( - com.google.protobuf.CodedInputStream input, - com.google.protobuf.ExtensionRegistryLite extensionRegistry) - throws com.google.protobuf.InvalidProtocolBufferException { - return new Sensor_Info(input, extensionRegistry); + private static final com.google.protobuf.Parser + PARSER = new com.google.protobuf.AbstractParser() { + @java.lang.Override + public SensorInfo parsePartialFrom( + com.google.protobuf.CodedInputStream input, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + Builder builder = newBuilder(); + try { + builder.mergeFrom(input, extensionRegistry); + } catch (com.google.protobuf.InvalidProtocolBufferException e) { + throw e.setUnfinishedMessage(builder.buildPartial()); + } catch (com.google.protobuf.UninitializedMessageException e) { + throw e.asInvalidProtocolBufferException().setUnfinishedMessage(builder.buildPartial()); + } catch (java.io.IOException e) { + throw new com.google.protobuf.InvalidProtocolBufferException(e) + .setUnfinishedMessage(builder.buildPartial()); + } + return builder.buildPartial(); } }; - public static com.google.protobuf.Parser parser() { + public static com.google.protobuf.Parser parser() { return PARSER; } - @Override - public com.google.protobuf.Parser getParserForType() { + @java.lang.Override + public com.google.protobuf.Parser getParserForType() { return PARSER; } - public Sensor_Info getDefaultInstanceForType() { + @java.lang.Override + public com.openpositioning.PositionMe.Traj.SensorInfo getDefaultInstanceForType() { return DEFAULT_INSTANCE; } } private static final com.google.protobuf.Descriptors.Descriptor - internal_static_Trajectory_descriptor; - private static final - com.google.protobuf.GeneratedMessageV3.FieldAccessorTable - internal_static_Trajectory_fieldAccessorTable; + internal_static_Trajectory_descriptor; + private static final + com.google.protobuf.GeneratedMessage.FieldAccessorTable + internal_static_Trajectory_fieldAccessorTable; private static final com.google.protobuf.Descriptors.Descriptor - internal_static_Pdr_Sample_descriptor; - private static final - com.google.protobuf.GeneratedMessageV3.FieldAccessorTable - internal_static_Pdr_Sample_fieldAccessorTable; + internal_static_RelativePosition_descriptor; + private static final + com.google.protobuf.GeneratedMessage.FieldAccessorTable + internal_static_RelativePosition_fieldAccessorTable; private static final com.google.protobuf.Descriptors.Descriptor - internal_static_Motion_Sample_descriptor; - private static final - com.google.protobuf.GeneratedMessageV3.FieldAccessorTable - internal_static_Motion_Sample_fieldAccessorTable; + internal_static_IMUReading_descriptor; + private static final + com.google.protobuf.GeneratedMessage.FieldAccessorTable + internal_static_IMUReading_fieldAccessorTable; private static final com.google.protobuf.Descriptors.Descriptor - internal_static_Position_Sample_descriptor; - private static final - com.google.protobuf.GeneratedMessageV3.FieldAccessorTable - internal_static_Position_Sample_fieldAccessorTable; + internal_static_MagnetometerReading_descriptor; + private static final + com.google.protobuf.GeneratedMessage.FieldAccessorTable + internal_static_MagnetometerReading_fieldAccessorTable; private static final com.google.protobuf.Descriptors.Descriptor - internal_static_Pressure_Sample_descriptor; - private static final - com.google.protobuf.GeneratedMessageV3.FieldAccessorTable - internal_static_Pressure_Sample_fieldAccessorTable; + internal_static_BarometerReading_descriptor; + private static final + com.google.protobuf.GeneratedMessage.FieldAccessorTable + internal_static_BarometerReading_fieldAccessorTable; private static final com.google.protobuf.Descriptors.Descriptor - internal_static_Light_Sample_descriptor; - private static final - com.google.protobuf.GeneratedMessageV3.FieldAccessorTable - internal_static_Light_Sample_fieldAccessorTable; + internal_static_LightReading_descriptor; + private static final + com.google.protobuf.GeneratedMessage.FieldAccessorTable + internal_static_LightReading_fieldAccessorTable; private static final com.google.protobuf.Descriptors.Descriptor - internal_static_GNSS_Sample_descriptor; - private static final - com.google.protobuf.GeneratedMessageV3.FieldAccessorTable - internal_static_GNSS_Sample_fieldAccessorTable; + internal_static_ProximityReading_descriptor; + private static final + com.google.protobuf.GeneratedMessage.FieldAccessorTable + internal_static_ProximityReading_fieldAccessorTable; private static final com.google.protobuf.Descriptors.Descriptor - internal_static_WiFi_Sample_descriptor; - private static final - com.google.protobuf.GeneratedMessageV3.FieldAccessorTable - internal_static_WiFi_Sample_fieldAccessorTable; + internal_static_GNSSPosition_descriptor; + private static final + com.google.protobuf.GeneratedMessage.FieldAccessorTable + internal_static_GNSSPosition_fieldAccessorTable; private static final com.google.protobuf.Descriptors.Descriptor - internal_static_Mac_Scan_descriptor; - private static final - com.google.protobuf.GeneratedMessageV3.FieldAccessorTable - internal_static_Mac_Scan_fieldAccessorTable; + internal_static_GNSSReading_descriptor; + private static final + com.google.protobuf.GeneratedMessage.FieldAccessorTable + internal_static_GNSSReading_fieldAccessorTable; private static final com.google.protobuf.Descriptors.Descriptor - internal_static_AP_Data_descriptor; - private static final - com.google.protobuf.GeneratedMessageV3.FieldAccessorTable - internal_static_AP_Data_fieldAccessorTable; + internal_static_Fingerprint_descriptor; + private static final + com.google.protobuf.GeneratedMessage.FieldAccessorTable + internal_static_Fingerprint_fieldAccessorTable; private static final com.google.protobuf.Descriptors.Descriptor - internal_static_Sensor_Info_descriptor; - private static final - com.google.protobuf.GeneratedMessageV3.FieldAccessorTable - internal_static_Sensor_Info_fieldAccessorTable; + internal_static_RFScan_descriptor; + private static final + com.google.protobuf.GeneratedMessage.FieldAccessorTable + internal_static_RFScan_fieldAccessorTable; + private static final com.google.protobuf.Descriptors.Descriptor + internal_static_WiFiRTTReading_descriptor; + private static final + com.google.protobuf.GeneratedMessage.FieldAccessorTable + internal_static_WiFiRTTReading_fieldAccessorTable; + private static final com.google.protobuf.Descriptors.Descriptor + internal_static_WiFiAPData_descriptor; + private static final + com.google.protobuf.GeneratedMessage.FieldAccessorTable + internal_static_WiFiAPData_fieldAccessorTable; + private static final com.google.protobuf.Descriptors.Descriptor + internal_static_BleData_descriptor; + private static final + com.google.protobuf.GeneratedMessage.FieldAccessorTable + internal_static_BleData_fieldAccessorTable; + private static final com.google.protobuf.Descriptors.Descriptor + internal_static_Vector3_descriptor; + private static final + com.google.protobuf.GeneratedMessage.FieldAccessorTable + internal_static_Vector3_fieldAccessorTable; + private static final com.google.protobuf.Descriptors.Descriptor + internal_static_Quaternion_descriptor; + private static final + com.google.protobuf.GeneratedMessage.FieldAccessorTable + internal_static_Quaternion_fieldAccessorTable; + private static final com.google.protobuf.Descriptors.Descriptor + internal_static_SensorInfo_descriptor; + private static final + com.google.protobuf.GeneratedMessage.FieldAccessorTable + internal_static_SensorInfo_fieldAccessorTable; public static com.google.protobuf.Descriptors.FileDescriptor - getDescriptor() { + getDescriptor() { return descriptor; } private static com.google.protobuf.Descriptors.FileDescriptor - descriptor; + descriptor; static { - String[] descriptorData = { - "\n#Cloud/app/src/main/proto/traj.proto\"\337\004" + - "\n\nTrajectory\022\027\n\017android_version\030\001 \001(\t\022 \n" + - "\010imu_data\030\002 \003(\0132\016.Motion_Sample\022\035\n\010pdr_d" + - "ata\030\003 \003(\0132\013.Pdr_Sample\022\'\n\rposition_data\030" + - "\004 \003(\0132\020.Position_Sample\022\'\n\rpressure_data" + - "\030\005 \003(\0132\020.Pressure_Sample\022!\n\nlight_data\030\006" + - " \003(\0132\r.Light_Sample\022\037\n\tgnss_data\030\007 \003(\0132\014" + - ".GNSS_Sample\022\037\n\twifi_data\030\010 \003(\0132\014.WiFi_S" + - "ample\022\032\n\010aps_data\030\t \003(\0132\010.AP_Data\022\027\n\017sta" + - "rt_timestamp\030\n \001(\003\022\027\n\017data_identifier\030\013 ", - "\001(\t\022(\n\022accelerometer_info\030\014 \001(\0132\014.Sensor" + - "_Info\022$\n\016gyroscope_info\030\r \001(\0132\014.Sensor_I" + - "nfo\022*\n\024rotation_vector_info\030\016 \001(\0132\014.Sens" + - "or_Info\022\'\n\021magnetometer_info\030\017 \001(\0132\014.Sen" + - "sor_Info\022$\n\016barometer_info\030\020 \001(\0132\014.Senso" + - "r_Info\022\'\n\021light_sensor_info\030\021 \001(\0132\014.Sens" + - "or_Info\">\n\nPdr_Sample\022\032\n\022relative_timest" + - "amp\030\001 \001(\003\022\t\n\001x\030\002 \001(\002\022\t\n\001y\030\003 \001(\002\"\205\002\n\rMoti" + - "on_Sample\022\032\n\022relative_timestamp\030\001 \001(\003\022\r\n" + - "\005acc_x\030\002 \001(\002\022\r\n\005acc_y\030\003 \001(\002\022\r\n\005acc_z\030\004 \001", - "(\002\022\r\n\005gyr_x\030\005 \001(\002\022\r\n\005gyr_y\030\006 \001(\002\022\r\n\005gyr_" + - "z\030\007 \001(\002\022\031\n\021rotation_vector_x\030\010 \001(\002\022\031\n\021ro" + - "tation_vector_y\030\t \001(\002\022\031\n\021rotation_vector" + - "_z\030\n \001(\002\022\031\n\021rotation_vector_w\030\013 \001(\002\022\022\n\ns" + - "tep_count\030\014 \001(\005\"Z\n\017Position_Sample\022\032\n\022re" + - "lative_timestamp\030\001 \001(\003\022\r\n\005mag_x\030\002 \001(\002\022\r\n" + - "\005mag_y\030\003 \001(\002\022\r\n\005mag_z\030\004 \001(\002\"?\n\017Pressure_" + - "Sample\022\032\n\022relative_timestamp\030\001 \001(\003\022\020\n\010pr" + - "essure\030\002 \001(\002\"9\n\014Light_Sample\022\032\n\022relative" + - "_timestamp\030\001 \001(\003\022\r\n\005light\030\002 \001(\002\"\223\001\n\013GNSS", - "_Sample\022\032\n\022relative_timestamp\030\001 \001(\003\022\020\n\010l" + - "atitude\030\002 \001(\002\022\021\n\tlongitude\030\003 \001(\002\022\020\n\010alti" + - "tude\030\004 \001(\002\022\020\n\010accuracy\030\005 \001(\002\022\r\n\005speed\030\006 " + - "\001(\002\022\020\n\010provider\030\007 \001(\t\"G\n\013WiFi_Sample\022\032\n\022" + - "relative_timestamp\030\001 \001(\003\022\034\n\tmac_scans\030\002 " + - "\003(\0132\t.Mac_Scan\"A\n\010Mac_Scan\022\032\n\022relative_t" + - "imestamp\030\001 \001(\003\022\013\n\003mac\030\002 \001(\003\022\014\n\004rssi\030\003 \001(" + - "\005\"7\n\007AP_Data\022\013\n\003mac\030\001 \001(\003\022\014\n\004ssid\030\002 \001(\t\022" + - "\021\n\tfrequency\030\003 \001(\003\"m\n\013Sensor_Info\022\014\n\004nam" + - "e\030\001 \001(\t\022\016\n\006vendor\030\002 \001(\t\022\022\n\nresolution\030\003 ", - "\001(\002\022\r\n\005power\030\004 \001(\002\022\017\n\007version\030\005 \001(\005\022\014\n\004t" + - "ype\030\006 \001(\005b\006proto3" + java.lang.String[] descriptorData = { + "\n\ntraj.proto\"\277\007\n\nTrajectory\022\027\n\017android_v" + + "ersion\030\001 \001(\t\022\032\n\022trajectory_version\030\002 \001(\002" + + "\022\025\n\rtrajectory_id\030\003 \001(\t\022\035\n\010imu_data\030\004 \003(" + + "\0132\013.IMUReading\022#\n\010pdr_data\030\005 \003(\0132\021.Relat" + + "ivePosition\022/\n\021magnetometer_data\030\006 \003(\0132\024" + + ".MagnetometerReading\022(\n\rpressure_data\030\007 " + + "\003(\0132\021.BarometerReading\022!\n\nlight_data\030\010 \003" + + "(\0132\r.LightReading\022)\n\016proximity_data\030\t \003(" + + "\0132\021.ProximityReading\022\037\n\tgnss_data\030\n \003(\0132" + + "\014.GNSSReading\022\'\n\021wifi_fingerprints\030\013 \003(\013" + + "2\014.Fingerprint\022\035\n\010aps_data\030\014 \003(\0132\013.WiFiA" + + "PData\022&\n\rwifi_rtt_data\030\r \003(\0132\017.WiFiRTTRe" + + "ading\022&\n\020ble_fingerprints\030\016 \003(\0132\014.Finger" + + "print\022\032\n\010ble_data\030\017 \003(\0132\010.BleData\022\027\n\017sta" + + "rt_timestamp\030\020 \001(\003\022\'\n\020initial_position\030\021" + + " \001(\0132\r.GNSSPosition\022*\n\023corrected_positio" + + "ns\030\022 \003(\0132\r.GNSSPosition\022\'\n\022accelerometer" + + "_info\030\023 \001(\0132\013.SensorInfo\022#\n\016gyroscope_in" + + "fo\030\024 \001(\0132\013.SensorInfo\022)\n\024rotation_vector" + + "_info\030\025 \001(\0132\013.SensorInfo\022&\n\021magnetometer" + + "_info\030\026 \001(\0132\013.SensorInfo\022#\n\016barometer_in" + + "fo\030\027 \001(\0132\013.SensorInfo\022&\n\021light_sensor_in" + + "fo\030\030 \001(\0132\013.SensorInfo\022#\n\016proximity_info\030" + + "\031 \001(\0132\013.SensorInfo\022\"\n\013test_points\030\032 \003(\0132" + + "\r.GNSSPosition\"D\n\020RelativePosition\022\032\n\022re" + + "lative_timestamp\030\001 \001(\003\022\t\n\001x\030\002 \001(\002\022\t\n\001y\030\003" + + " \001(\002\"\220\001\n\nIMUReading\022\032\n\022relative_timestam" + + "p\030\001 \001(\003\022\025\n\003acc\030\002 \001(\0132\010.Vector3\022\025\n\003gyr\030\003 " + + "\001(\0132\010.Vector3\022$\n\017rotation_vector\030\004 \001(\0132\013" + + ".Quaternion\022\022\n\nstep_count\030\005 \001(\005\"H\n\023Magne" + + "tometerReading\022\032\n\022relative_timestamp\030\001 \001" + + "(\003\022\025\n\003mag\030\002 \001(\0132\010.Vector3\"@\n\020BarometerRe" + + "ading\022\032\n\022relative_timestamp\030\001 \001(\003\022\020\n\010pre" + + "ssure\030\002 \001(\002\"9\n\014LightReading\022\032\n\022relative_" + + "timestamp\030\001 \001(\003\022\r\n\005light\030\002 \001(\002\"@\n\020Proxim" + + "ityReading\022\032\n\022relative_timestamp\030\001 \001(\003\022\020" + + "\n\010distance\030\002 \001(\002\"\177\n\014GNSSPosition\022\032\n\022rela" + + "tive_timestamp\030\001 \001(\003\022\020\n\010latitude\030\002 \001(\001\022\021" + + "\n\tlongitude\030\003 \001(\001\022\020\n\010altitude\030\004 \001(\001\022\022\n\005f" + + "loor\030\005 \001(\tH\000\210\001\001B\010\n\006_floor\"r\n\013GNSSReading" + + "\022\037\n\010position\030\001 \001(\0132\r.GNSSPosition\022\020\n\010acc" + + "uracy\030\002 \001(\002\022\r\n\005speed\030\003 \001(\002\022\017\n\007bearing\030\004 " + + "\001(\002\022\020\n\010provider\030\005 \001(\t\"D\n\013Fingerprint\022\032\n\022" + + "relative_timestamp\030\001 \001(\003\022\031\n\010rf_scans\030\002 \003" + + "(\0132\007.RFScan\"r\n\006RFScan\022\032\n\022relative_timest" + + "amp\030\001 \001(\003\022\013\n\003mac\030\002 \001(\003\022\014\n\004rssi\030\003 \001(\005\022$\n\010" + + "position\030\004 \001(\0132\r.GNSSPositionH\000\210\001\001B\013\n\t_p" + + "osition\"o\n\016WiFiRTTReading\022\032\n\022relative_ti" + + "mestamp\030\001 \001(\003\022\013\n\003mac\030\002 \001(\003\022\020\n\010distance\030\003" + + " \001(\002\022\024\n\014distance_std\030\004 \001(\002\022\014\n\004rssi\030\005 \001(\005" + + "\"O\n\nWiFiAPData\022\013\n\003mac\030\001 \001(\003\022\014\n\004ssid\030\002 \001(" + + "\t\022\021\n\tfrequency\030\003 \001(\003\022\023\n\013rtt_enabled\030\004 \001(" + + "\010\"\217\001\n\007BleData\022\023\n\013mac_address\030\001 \001(\t\022\014\n\004na" + + "me\030\002 \001(\t\022\026\n\016tx_power_level\030\003 \001(\005\022\027\n\017adve" + + "rtise_flags\030\004 \001(\005\022\025\n\rservice_uuids\030\005 \003(\t" + + "\022\031\n\021manufacturer_data\030\006 \001(\014\"*\n\007Vector3\022\t" + + "\n\001x\030\001 \001(\002\022\t\n\001y\030\002 \001(\002\022\t\n\001z\030\003 \001(\002\"8\n\nQuate" + + "rnion\022\t\n\001x\030\001 \001(\002\022\t\n\001y\030\002 \001(\002\022\t\n\001z\030\003 \001(\002\022\t" + + "\n\001w\030\004 \001(\002\"\222\001\n\nSensorInfo\022\014\n\004name\030\001 \001(\t\022\016" + + "\n\006vendor\030\002 \001(\t\022\022\n\nresolution\030\003 \001(\002\022\r\n\005po" + + "wer\030\004 \001(\002\022\017\n\007version\030\005 \001(\005\022\014\n\004type\030\006 \001(\005" + + "\022\021\n\tmax_range\030\007 \001(\002\022\021\n\tfrequency\030\010 \001(\002B(" + + "\n\036com.openpositioning.PositionMeB\004TrajP\000" + + "b\006proto3" }; - com.google.protobuf.Descriptors.FileDescriptor.InternalDescriptorAssigner assigner = - new com.google.protobuf.Descriptors.FileDescriptor. InternalDescriptorAssigner() { - public com.google.protobuf.ExtensionRegistry assignDescriptors( - com.google.protobuf.Descriptors.FileDescriptor root) { - descriptor = root; - return null; - } - }; - com.google.protobuf.Descriptors.FileDescriptor - .internalBuildGeneratedFileFrom(descriptorData, - new com.google.protobuf.Descriptors.FileDescriptor[] { - }, assigner); + descriptor = com.google.protobuf.Descriptors.FileDescriptor + .internalBuildGeneratedFileFrom(descriptorData, + new com.google.protobuf.Descriptors.FileDescriptor[] { + }); internal_static_Trajectory_descriptor = - getDescriptor().getMessageTypes().get(0); + getDescriptor().getMessageTypes().get(0); internal_static_Trajectory_fieldAccessorTable = new - com.google.protobuf.GeneratedMessageV3.FieldAccessorTable( - internal_static_Trajectory_descriptor, - new String[] { "AndroidVersion", "ImuData", "PdrData", "PositionData", "PressureData", "LightData", "GnssData", "WifiData", "ApsData", "StartTimestamp", "DataIdentifier", "AccelerometerInfo", "GyroscopeInfo", "RotationVectorInfo", "MagnetometerInfo", "BarometerInfo", "LightSensorInfo", }); - internal_static_Pdr_Sample_descriptor = - getDescriptor().getMessageTypes().get(1); - internal_static_Pdr_Sample_fieldAccessorTable = new - com.google.protobuf.GeneratedMessageV3.FieldAccessorTable( - internal_static_Pdr_Sample_descriptor, - new String[] { "RelativeTimestamp", "X", "Y", }); - internal_static_Motion_Sample_descriptor = - getDescriptor().getMessageTypes().get(2); - internal_static_Motion_Sample_fieldAccessorTable = new - com.google.protobuf.GeneratedMessageV3.FieldAccessorTable( - internal_static_Motion_Sample_descriptor, - new String[] { "RelativeTimestamp", "AccX", "AccY", "AccZ", "GyrX", "GyrY", "GyrZ", "RotationVectorX", "RotationVectorY", "RotationVectorZ", "RotationVectorW", "StepCount", }); - internal_static_Position_Sample_descriptor = - getDescriptor().getMessageTypes().get(3); - internal_static_Position_Sample_fieldAccessorTable = new - com.google.protobuf.GeneratedMessageV3.FieldAccessorTable( - internal_static_Position_Sample_descriptor, - new String[] { "RelativeTimestamp", "MagX", "MagY", "MagZ", }); - internal_static_Pressure_Sample_descriptor = - getDescriptor().getMessageTypes().get(4); - internal_static_Pressure_Sample_fieldAccessorTable = new - com.google.protobuf.GeneratedMessageV3.FieldAccessorTable( - internal_static_Pressure_Sample_descriptor, - new String[] { "RelativeTimestamp", "Pressure", }); - internal_static_Light_Sample_descriptor = - getDescriptor().getMessageTypes().get(5); - internal_static_Light_Sample_fieldAccessorTable = new - com.google.protobuf.GeneratedMessageV3.FieldAccessorTable( - internal_static_Light_Sample_descriptor, - new String[] { "RelativeTimestamp", "Light", }); - internal_static_GNSS_Sample_descriptor = - getDescriptor().getMessageTypes().get(6); - internal_static_GNSS_Sample_fieldAccessorTable = new - com.google.protobuf.GeneratedMessageV3.FieldAccessorTable( - internal_static_GNSS_Sample_descriptor, - new String[] { "RelativeTimestamp", "Latitude", "Longitude", "Altitude", "Accuracy", "Speed", "Provider", }); - internal_static_WiFi_Sample_descriptor = - getDescriptor().getMessageTypes().get(7); - internal_static_WiFi_Sample_fieldAccessorTable = new - com.google.protobuf.GeneratedMessageV3.FieldAccessorTable( - internal_static_WiFi_Sample_descriptor, - new String[] { "RelativeTimestamp", "MacScans", }); - internal_static_Mac_Scan_descriptor = - getDescriptor().getMessageTypes().get(8); - internal_static_Mac_Scan_fieldAccessorTable = new - com.google.protobuf.GeneratedMessageV3.FieldAccessorTable( - internal_static_Mac_Scan_descriptor, - new String[] { "RelativeTimestamp", "Mac", "Rssi", }); - internal_static_AP_Data_descriptor = - getDescriptor().getMessageTypes().get(9); - internal_static_AP_Data_fieldAccessorTable = new - com.google.protobuf.GeneratedMessageV3.FieldAccessorTable( - internal_static_AP_Data_descriptor, - new String[] { "Mac", "Ssid", "Frequency", }); - internal_static_Sensor_Info_descriptor = - getDescriptor().getMessageTypes().get(10); - internal_static_Sensor_Info_fieldAccessorTable = new - com.google.protobuf.GeneratedMessageV3.FieldAccessorTable( - internal_static_Sensor_Info_descriptor, - new String[] { "Name", "Vendor", "Resolution", "Power", "Version", "Type", }); + com.google.protobuf.GeneratedMessage.FieldAccessorTable( + internal_static_Trajectory_descriptor, + new java.lang.String[] { "AndroidVersion", "TrajectoryVersion", "TrajectoryId", "ImuData", "PdrData", "MagnetometerData", "PressureData", "LightData", "ProximityData", "GnssData", "WifiFingerprints", "ApsData", "WifiRttData", "BleFingerprints", "BleData", "StartTimestamp", "InitialPosition", "CorrectedPositions", "AccelerometerInfo", "GyroscopeInfo", "RotationVectorInfo", "MagnetometerInfo", "BarometerInfo", "LightSensorInfo", "ProximityInfo", "TestPoints", }); + internal_static_RelativePosition_descriptor = + getDescriptor().getMessageTypes().get(1); + internal_static_RelativePosition_fieldAccessorTable = new + com.google.protobuf.GeneratedMessage.FieldAccessorTable( + internal_static_RelativePosition_descriptor, + new java.lang.String[] { "RelativeTimestamp", "X", "Y", }); + internal_static_IMUReading_descriptor = + getDescriptor().getMessageTypes().get(2); + internal_static_IMUReading_fieldAccessorTable = new + com.google.protobuf.GeneratedMessage.FieldAccessorTable( + internal_static_IMUReading_descriptor, + new java.lang.String[] { "RelativeTimestamp", "Acc", "Gyr", "RotationVector", "StepCount", }); + internal_static_MagnetometerReading_descriptor = + getDescriptor().getMessageTypes().get(3); + internal_static_MagnetometerReading_fieldAccessorTable = new + com.google.protobuf.GeneratedMessage.FieldAccessorTable( + internal_static_MagnetometerReading_descriptor, + new java.lang.String[] { "RelativeTimestamp", "Mag", }); + internal_static_BarometerReading_descriptor = + getDescriptor().getMessageTypes().get(4); + internal_static_BarometerReading_fieldAccessorTable = new + com.google.protobuf.GeneratedMessage.FieldAccessorTable( + internal_static_BarometerReading_descriptor, + new java.lang.String[] { "RelativeTimestamp", "Pressure", }); + internal_static_LightReading_descriptor = + getDescriptor().getMessageTypes().get(5); + internal_static_LightReading_fieldAccessorTable = new + com.google.protobuf.GeneratedMessage.FieldAccessorTable( + internal_static_LightReading_descriptor, + new java.lang.String[] { "RelativeTimestamp", "Light", }); + internal_static_ProximityReading_descriptor = + getDescriptor().getMessageTypes().get(6); + internal_static_ProximityReading_fieldAccessorTable = new + com.google.protobuf.GeneratedMessage.FieldAccessorTable( + internal_static_ProximityReading_descriptor, + new java.lang.String[] { "RelativeTimestamp", "Distance", }); + internal_static_GNSSPosition_descriptor = + getDescriptor().getMessageTypes().get(7); + internal_static_GNSSPosition_fieldAccessorTable = new + com.google.protobuf.GeneratedMessage.FieldAccessorTable( + internal_static_GNSSPosition_descriptor, + new java.lang.String[] { "RelativeTimestamp", "Latitude", "Longitude", "Altitude", "Floor", }); + internal_static_GNSSReading_descriptor = + getDescriptor().getMessageTypes().get(8); + internal_static_GNSSReading_fieldAccessorTable = new + com.google.protobuf.GeneratedMessage.FieldAccessorTable( + internal_static_GNSSReading_descriptor, + new java.lang.String[] { "Position", "Accuracy", "Speed", "Bearing", "Provider", }); + internal_static_Fingerprint_descriptor = + getDescriptor().getMessageTypes().get(9); + internal_static_Fingerprint_fieldAccessorTable = new + com.google.protobuf.GeneratedMessage.FieldAccessorTable( + internal_static_Fingerprint_descriptor, + new java.lang.String[] { "RelativeTimestamp", "RfScans", }); + internal_static_RFScan_descriptor = + getDescriptor().getMessageTypes().get(10); + internal_static_RFScan_fieldAccessorTable = new + com.google.protobuf.GeneratedMessage.FieldAccessorTable( + internal_static_RFScan_descriptor, + new java.lang.String[] { "RelativeTimestamp", "Mac", "Rssi", "Position", }); + internal_static_WiFiRTTReading_descriptor = + getDescriptor().getMessageTypes().get(11); + internal_static_WiFiRTTReading_fieldAccessorTable = new + com.google.protobuf.GeneratedMessage.FieldAccessorTable( + internal_static_WiFiRTTReading_descriptor, + new java.lang.String[] { "RelativeTimestamp", "Mac", "Distance", "DistanceStd", "Rssi", }); + internal_static_WiFiAPData_descriptor = + getDescriptor().getMessageTypes().get(12); + internal_static_WiFiAPData_fieldAccessorTable = new + com.google.protobuf.GeneratedMessage.FieldAccessorTable( + internal_static_WiFiAPData_descriptor, + new java.lang.String[] { "Mac", "Ssid", "Frequency", "RttEnabled", }); + internal_static_BleData_descriptor = + getDescriptor().getMessageTypes().get(13); + internal_static_BleData_fieldAccessorTable = new + com.google.protobuf.GeneratedMessage.FieldAccessorTable( + internal_static_BleData_descriptor, + new java.lang.String[] { "MacAddress", "Name", "TxPowerLevel", "AdvertiseFlags", "ServiceUuids", "ManufacturerData", }); + internal_static_Vector3_descriptor = + getDescriptor().getMessageTypes().get(14); + internal_static_Vector3_fieldAccessorTable = new + com.google.protobuf.GeneratedMessage.FieldAccessorTable( + internal_static_Vector3_descriptor, + new java.lang.String[] { "X", "Y", "Z", }); + internal_static_Quaternion_descriptor = + getDescriptor().getMessageTypes().get(15); + internal_static_Quaternion_fieldAccessorTable = new + com.google.protobuf.GeneratedMessage.FieldAccessorTable( + internal_static_Quaternion_descriptor, + new java.lang.String[] { "X", "Y", "Z", "W", }); + internal_static_SensorInfo_descriptor = + getDescriptor().getMessageTypes().get(16); + internal_static_SensorInfo_fieldAccessorTable = new + com.google.protobuf.GeneratedMessage.FieldAccessorTable( + internal_static_SensorInfo_descriptor, + new java.lang.String[] { "Name", "Vendor", "Resolution", "Power", "Version", "Type", "MaxRange", "Frequency", }); + descriptor.resolveAllFeaturesImmutable(); } // @@protoc_insertion_point(outer_class_scope) diff --git a/app/src/main/java/com/openpositioning/PositionMe/data/remote/ServerCommunications.java b/app/src/main/java/com/openpositioning/PositionMe/data/remote/ServerCommunications.java index 7f7e74b2..89b690b2 100644 --- a/app/src/main/java/com/openpositioning/PositionMe/data/remote/ServerCommunications.java +++ b/app/src/main/java/com/openpositioning/PositionMe/data/remote/ServerCommunications.java @@ -623,11 +623,11 @@ private void checkNetworkStatus() { private void logDataSize(Traj.Trajectory trajectory) { Log.i("ServerCommunications", "IMU Data size: " + trajectory.getImuDataCount()); - Log.i("ServerCommunications", "Position Data size: " + trajectory.getPositionDataCount()); + Log.i("ServerCommunications", "Position Data size: " + trajectory.getMagnetometerDataCount()); Log.i("ServerCommunications", "Pressure Data size: " + trajectory.getPressureDataCount()); Log.i("ServerCommunications", "Light Data size: " + trajectory.getLightDataCount()); Log.i("ServerCommunications", "GNSS Data size: " + trajectory.getGnssDataCount()); - Log.i("ServerCommunications", "WiFi Data size: " + trajectory.getWifiDataCount()); + Log.i("ServerCommunications", "WiFi Data size: " + trajectory.getWifiFingerprintsCount()); Log.i("ServerCommunications", "APS Data size: " + trajectory.getApsDataCount()); Log.i("ServerCommunications", "PDR Data size: " + trajectory.getPdrDataCount()); } diff --git a/app/src/main/java/com/openpositioning/PositionMe/sensors/SensorFusion.java b/app/src/main/java/com/openpositioning/PositionMe/sensors/SensorFusion.java index 6eca847c..a5a69ba9 100644 --- a/app/src/main/java/com/openpositioning/PositionMe/sensors/SensorFusion.java +++ b/app/src/main/java/com/openpositioning/PositionMe/sensors/SensorFusion.java @@ -406,7 +406,7 @@ public void onSensorChanged(SensorEvent sensorEvent) { if (saveRecording) { this.pathView.drawTrajectory(newCords); stepCounter++; - trajectory.addPdrData(Traj.Pdr_Sample.newBuilder() + trajectory.addPdrData(Traj.RelativePosition.newBuilder() .setRelativeTimestamp(SystemClock.uptimeMillis() - bootTime) .setX(newCords[0]) .setY(newCords[1])); @@ -446,14 +446,18 @@ public void onLocationChanged(@NonNull Location location) { float speed = (float) location.getSpeed(); String provider = location.getProvider(); if(saveRecording) { - trajectory.addGnssData(Traj.GNSS_Sample.newBuilder() + trajectory.addGnssData(Traj.GNSSReading.newBuilder() + .setPosition(Traj.GNSSPosition.newBuilder() + .setLatitude(latitude) + .setLongitude(longitude) + .setAltitude(altitude) + .setRelativeTimestamp(System.currentTimeMillis()-absoluteStartTime) + .build()) .setAccuracy(accuracy) - .setAltitude(altitude) - .setLatitude(latitude) - .setLongitude(longitude) .setSpeed(speed) + .setBearing(0) .setProvider(provider) - .setRelativeTimestamp(System.currentTimeMillis()-absoluteStartTime)); + .build()); } } } @@ -471,15 +475,15 @@ public void update(Object[] wifiList) { this.wifiList = Stream.of(wifiList).map(o -> (Wifi) o).collect(Collectors.toList()); if(this.saveRecording) { - Traj.WiFi_Sample.Builder wifiData = Traj.WiFi_Sample.newBuilder() + Traj.Fingerprint.Builder wifiData = Traj.Fingerprint.newBuilder() .setRelativeTimestamp(SystemClock.uptimeMillis()-bootTime); for (Wifi data : this.wifiList) { - wifiData.addMacScans(Traj.Mac_Scan.newBuilder() + wifiData.addRfScans(Traj.RFScan.newBuilder() .setRelativeTimestamp(SystemClock.uptimeMillis() - bootTime) .setMac(data.getBssid()).setRssi(data.getLevel())); } // Adding WiFi data to Trajectory - this.trajectory.addWifiData(wifiData); + this.trajectory.addWifiFingerprints(wifiData); } createWifiPositioningRequest(); } @@ -922,7 +926,7 @@ public void sendTrajectoryToCloud() { } /** - * Creates a {@link Traj.Sensor_Info} objects from the specified sensor's data. + * Creates a {@link Traj.SensorInfo} objects from the specified sensor's data. * * @param sensor MovementSensor objects with populated sensorInfo fields * @return Traj.SensorInfo object to be used in building the trajectory @@ -930,8 +934,8 @@ public void sendTrajectoryToCloud() { * @see Traj Trajectory object used for communication with the server * @see MovementSensor class abstracting SensorManager based sensors */ - private Traj.Sensor_Info.Builder createInfoBuilder(MovementSensor sensor) { - return Traj.Sensor_Info.newBuilder() + private Traj.SensorInfo.Builder createInfoBuilder(MovementSensor sensor) { + return Traj.SensorInfo.newBuilder() .setName(sensor.sensorInfo.getName()) .setVendor(sensor.sensorInfo.getVendor()) .setResolution(sensor.sensorInfo.getResolution()) @@ -949,40 +953,45 @@ private Traj.Sensor_Info.Builder createInfoBuilder(MovementSensor sensor) { private class storeDataInTrajectory extends TimerTask { public void run() { // Store IMU and magnetometer data in Trajectory class - trajectory.addImuData(Traj.Motion_Sample.newBuilder() + trajectory.addImuData(Traj.IMUReading.newBuilder() .setRelativeTimestamp(SystemClock.uptimeMillis()-bootTime) - .setAccX(acceleration[0]) - .setAccY(acceleration[1]) - .setAccZ(acceleration[2]) - .setGyrX(angularVelocity[0]) - .setGyrY(angularVelocity[1]) - .setGyrZ(angularVelocity[2]) - .setGyrZ(angularVelocity[2]) - .setRotationVectorX(rotation[0]) - .setRotationVectorY(rotation[1]) - .setRotationVectorZ(rotation[2]) - .setRotationVectorW(rotation[3]) - .setStepCount(stepCounter)) - .addPositionData(Traj.Position_Sample.newBuilder() - .setMagX(magneticField[0]) - .setMagY(magneticField[1]) - .setMagZ(magneticField[2]) - .setRelativeTimestamp(SystemClock.uptimeMillis()-bootTime)) -// .addGnssData(Traj.GNSS_Sample.newBuilder() -// .setLatitude(latitude) -// .setLongitude(longitude) -// .setRelativeTimestamp(SystemClock.uptimeMillis()-bootTime)) - ; + .setAcc(Traj.Vector3.newBuilder() + .setX(acceleration[0]) + .setY(acceleration[1]) + .setZ(acceleration[2]) + .build()) + .setGyr(Traj.Vector3.newBuilder() + .setX(angularVelocity[0]) + .setY(angularVelocity[1]) + .setZ(angularVelocity[2]) + .build()) + .setRotationVector(Traj.Quaternion.newBuilder() + .setX(rotation[0]) + .setY(rotation[1]) + .setZ(rotation[2]) + .setW(rotation[3]) + .build()) + .setStepCount(stepCounter) + .build()); + + trajectory.addMagnetometerData(Traj.MagnetometerReading.newBuilder() + .setMag(Traj.Vector3.newBuilder() + .setX(magneticField[0]) + .setY(magneticField[1]) + .setZ(magneticField[2]) + .build()) + .setRelativeTimestamp(SystemClock.uptimeMillis()-bootTime) + .build()); // Divide timer with a counter for storing data every 1 second if (counter == 99) { counter = 0; // Store pressure and light data if (barometerSensor.sensor != null) { - trajectory.addPressureData(Traj.Pressure_Sample.newBuilder() + trajectory.addPressureData(Traj.BarometerReading.newBuilder() .setPressure(pressure) .setRelativeTimestamp(SystemClock.uptimeMillis() - bootTime)) - .addLightData(Traj.Light_Sample.newBuilder() + .addLightData(Traj.LightReading.newBuilder() .setLight(light) .setRelativeTimestamp(SystemClock.uptimeMillis() - bootTime) .build()); @@ -993,7 +1002,7 @@ public void run() { secondCounter = 0; //Current Wifi Object Wifi currentWifi = wifiProcessor.getCurrentWifiData(); - trajectory.addApsData(Traj.AP_Data.newBuilder() + trajectory.addApsData(Traj.WiFiAPData.newBuilder() .setMac(currentWifi.getBssid()) .setSsid(currentWifi.getSsid()) .setFrequency(currentWifi.getFrequency())); diff --git a/app/src/main/proto/traj.proto b/app/src/main/proto/traj.proto index 95d8b0ac..13b9270b 100644 --- a/app/src/main/proto/traj.proto +++ b/app/src/main/proto/traj.proto @@ -1,134 +1,168 @@ syntax = "proto3"; +option java_outer_classname = "Traj"; +option java_multiple_files = false; +option java_package = "com.openpositioning.PositionMe"; + message Trajectory { -string android_version = 1; -repeated Motion_Sample imu_data = 2; -repeated Pdr_Sample pdr_data = 3; -repeated Position_Sample position_data = 4; -repeated Pressure_Sample pressure_data = 5; -repeated Light_Sample light_data = 6; - -repeated GNSS_Sample gnss_data = 7; -repeated WiFi_Sample wifi_data = 8; -repeated AP_Data aps_data = 9; - -// UNIX timestamp (in milliseconds) recorded from the start of this -// trajectory data collection event. All future -// timestamps in sub classes are to be RELATIVE timestamps -// (in milliseconds) to this start time. -// E.g. -// start_timestamp = 1674819807315 (UTC 27 Jan 2023 in the morning) -// relative_timestamp = 3000 (3s) -int64 start_timestamp = 10; -string data_identifier = 11; -Sensor_Info accelerometer_info = 12; -Sensor_Info gyroscope_info = 13; -Sensor_Info rotation_vector_info = 14; -Sensor_Info magnetometer_info = 15; -Sensor_Info barometer_info = 16; -Sensor_Info light_sensor_info = 17; - -} - -message Pdr_Sample { -// milliseconds from the start_timestamp -int64 relative_timestamp = 1; - -// Both in metres. You should implement an algorithm to estimate -// these values. The values are always relative to your start point -// so the first entry should always be x = 0.0, y = 0.0 -float x = 2; -float y = 3; -} - - -message Motion_Sample { + string android_version = 1; + // version 2.0 + float trajectory_version = 2; + // trajectory id/name for identification + string trajectory_id = 3; + repeated IMUReading imu_data = 4; + repeated RelativePosition pdr_data = 5; + repeated MagnetometerReading magnetometer_data = 6; + repeated BarometerReading pressure_data = 7; + repeated LightReading light_data = 8; + repeated ProximityReading proximity_data = 9; + + repeated GNSSReading gnss_data = 10; + repeated Fingerprint wifi_fingerprints = 11; + repeated WiFiAPData aps_data = 12; + repeated WiFiRTTReading wifi_rtt_data = 13; + repeated Fingerprint ble_fingerprints = 14; + repeated BleData ble_data = 15; + + // UNIX timestamp (in milliseconds) recorded from the start of this + // trajectory data collection event. All future + // timestamps in sub classes are to be RELATIVE timestamps + // (in milliseconds) to this start time. + // E.g. + // start_timestamp = 1674819807315 (UTC 27 Jan 2023 in the morning) + // relative_timestamp = 3000 (3s) + int64 start_timestamp = 16; + GNSSPosition initial_position = 17; + repeated GNSSPosition corrected_positions = 18; + + SensorInfo accelerometer_info = 19; + SensorInfo gyroscope_info = 20; + SensorInfo rotation_vector_info = 21; + SensorInfo magnetometer_info = 22; + SensorInfo barometer_info = 23; + SensorInfo light_SensorInfo = 24; + SensorInfo proximity_info = 25; + + repeated GNSSPosition test_points = 26; +} + +message RelativePosition { + // milliseconds from the start_timestamp + int64 relative_timestamp = 1; + + // Both in metres. You should implement an algorithm to estimate + // these values. The values are always relative to your start point + // so the first entry should always be x = 0.0, y = 0.0 + float x = 2; + float y = 3; +} + +message IMUReading { // milliseconds int64 relative_timestamp = 1; - // m/s^2 - float acc_x = 2; - float acc_y = 3; - float acc_z = 4; + // Accelerometer [m/s^2] + Vector3 acc = 2; - // radians/s - float gyr_x = 5; - float gyr_y = 6; - float gyr_z = 7; + // Gyroscope [radians/s] + Vector3 gyr = 3; - // unitless, 4 components should sum to ~1 - float rotation_vector_x = 8; - float rotation_vector_y = 9; - float rotation_vector_z = 10; - float rotation_vector_w = 11; + // Orientation [unitless], 4 components should square sum to ~1 + Quaternion rotation_vector = 4; - // Integer - int32 step_count = 12; + // Number of steps so far + int32 step_count = 5; } -message Position_Sample { +message MagnetometerReading { int64 relative_timestamp = 1; - // uT - float mag_x = 2; - float mag_y = 3; - float mag_z = 4; + // Magnetometer [uT] + Vector3 mag = 2; } -message Pressure_Sample { +message BarometerReading { int64 relative_timestamp = 1; // mbar float pressure = 2; - } -message Light_Sample { + +message LightReading { int64 relative_timestamp = 1; // lux float light = 2; } -message GNSS_Sample { + +message ProximityReading { + int64 relative_timestamp = 1; + // cm + float distance = 2; +} + +message GNSSPosition { int64 relative_timestamp = 1; // degrees (minimum 6 significant figures) // latitude between -90 and 90 - float latitude = 2; - + double latitude = 2; // longitude between -180 and 180 - float longitude = 3; - - //metres - float altitude = 4; - + double longitude = 3; // metres - float accuracy = 5; + double altitude = 4; + // floor name + optional string floor = 5; +} +message GNSSReading { + GNSSPosition position = 1; + // metres + float accuracy = 2; // m/s - float speed = 6; + float speed = 3; + // degrees + float bearing = 4; // e.g 'gps' or 'network' - string provider = 7; + string provider = 5; } -message WiFi_Sample { +message Fingerprint { int64 relative_timestamp = 1; - repeated Mac_Scan mac_scans = 2; - + repeated RFScan rf_scans = 2; } -message Mac_Scan { +message RFScan { int64 relative_timestamp = 1; - // Integer encoding of the hex mac address + // Integer encoding of the hex mac address (BSSID) // e.g. 207394925843984 int64 mac = 2; // rssi integer in dBm. // typically between -120 and -10 int32 rssi = 3; + + // returned position + optional GNSSPosition position = 4; } -message AP_Data { - // Integer encoding of the hex mac address +message WiFiRTTReading { + int64 relative_timestamp = 1; + // Integer encoding of the hex mac address (BSSID) + // e.g. 207394925843984 + int64 mac = 2; + + // in mm + float distance = 3; + // in mm + float distance_std = 4; + // rssi integer in dBm. + // typically between -120 and -10 + int32 rssi = 5; +} + +message WiFiAPData { + // Integer encoding of the hex mac address (BSSID) // e.g. 207394925843984 int64 mac = 1; @@ -137,13 +171,41 @@ message AP_Data { // Typically 2.4GHz or 5GHz int64 frequency = 3; + + // Flag to indicate if the AP supports RTT measurements + bool rtt_enabled = 4; +} + +message BleData { + string mac_address = 1; + string name = 2; + int32 tx_power_level = 3; + int32 advertise_flags = 4; + repeated string service_uuids = 5; + bytes manufacturer_data = 6; +} + +// --- Common Types --- +message Vector3 { + float x = 1; + float y = 2; + float z = 3; +} + +message Quaternion { + float x = 1; + float y = 2; + float z = 3; + float w = 4; } -message Sensor_Info { +message SensorInfo { string name = 1; string vendor = 2; float resolution = 3; float power = 4; int32 version = 5; int32 type = 6; + float max_range = 7; + float frequency = 8; } \ No newline at end of file From a838b0543c43720f5cc4593d5bec9764aa7837f5 Mon Sep 17 00:00:00 2001 From: Haoning Huang Date: Mon, 9 Feb 2026 13:15:49 +0000 Subject: [PATCH 02/82] Before adding trajectory name feature --- Change_by_haoning_0208.md | 18 +- .../com/openpositioning/PositionMe/Traj.java | 21107 ++++++++++++++++ 2 files changed, 21116 insertions(+), 9 deletions(-) create mode 100644 proto_gen/com/openpositioning/PositionMe/Traj.java diff --git a/Change_by_haoning_0208.md b/Change_by_haoning_0208.md index 1d37f21d..831401f5 100644 --- a/Change_by_haoning_0208.md +++ b/Change_by_haoning_0208.md @@ -23,17 +23,17 @@ ### Class Name Changes -| Old Name | New Name | -|----------|----------| -| `Pdr_Sample` | `RelativePosition` | -| `GNSS_Sample` | `GNSSReading` | -| `WiFi_Sample` | `Fingerprint` | -| `Mac_Scan` | `RFScan` | -| `Motion_Sample` | `IMUReading` | +| Old Name | New Name | +|-------------------|----------| +| `Pdr_Sample` | `RelativePosition` | +| `GNSS_Sample` | `GNSSReading` | +| `WiFi_Sample` | `Fingerprint` | +| `Mac_Scan` | `RFScan` | +| `Motion_Sampleq` | `IMUReading` | | `Position_Sample` | `MagnetometerReading` | | `Pressure_Sample` | `BarometerReading` | -| `Light_Sample` | `LightReading` | -| `AP_Data` | `WiFiAPData` | +| `Light_Sample` | `LightReading` | +| `AP_Data` | `WiFiAPData` | ### Method Name Changes diff --git a/proto_gen/com/openpositioning/PositionMe/Traj.java b/proto_gen/com/openpositioning/PositionMe/Traj.java new file mode 100644 index 00000000..7755fc84 --- /dev/null +++ b/proto_gen/com/openpositioning/PositionMe/Traj.java @@ -0,0 +1,21107 @@ +// Generated by the protocol buffer compiler. DO NOT EDIT! +// NO CHECKED-IN PROTOBUF GENCODE +// source: traj.proto +// Protobuf Java Version: 4.29.6 + +package com.openpositioning.PositionMe; + +public final class Traj { + private Traj() {} + static { + com.google.protobuf.RuntimeVersion.validateProtobufGencodeVersion( + com.google.protobuf.RuntimeVersion.RuntimeDomain.PUBLIC, + /* major= */ 4, + /* minor= */ 29, + /* patch= */ 6, + /* suffix= */ "", + Traj.class.getName()); + } + public static void registerAllExtensions( + com.google.protobuf.ExtensionRegistryLite registry) { + } + + public static void registerAllExtensions( + com.google.protobuf.ExtensionRegistry registry) { + registerAllExtensions( + (com.google.protobuf.ExtensionRegistryLite) registry); + } + public interface TrajectoryOrBuilder extends + // @@protoc_insertion_point(interface_extends:Trajectory) + com.google.protobuf.MessageOrBuilder { + + /** + * string android_version = 1; + * @return The androidVersion. + */ + java.lang.String getAndroidVersion(); + /** + * string android_version = 1; + * @return The bytes for androidVersion. + */ + com.google.protobuf.ByteString + getAndroidVersionBytes(); + + /** + *
+     * version 2.0
+     * 
+ * + * float trajectory_version = 2; + * @return The trajectoryVersion. + */ + float getTrajectoryVersion(); + + /** + *
+     * trajectory id/name for identification
+     * 
+ * + * string trajectory_id = 3; + * @return The trajectoryId. + */ + java.lang.String getTrajectoryId(); + /** + *
+     * trajectory id/name for identification
+     * 
+ * + * string trajectory_id = 3; + * @return The bytes for trajectoryId. + */ + com.google.protobuf.ByteString + getTrajectoryIdBytes(); + + /** + * repeated .IMUReading imu_data = 4; + */ + java.util.List + getImuDataList(); + /** + * repeated .IMUReading imu_data = 4; + */ + com.openpositioning.PositionMe.Traj.IMUReading getImuData(int index); + /** + * repeated .IMUReading imu_data = 4; + */ + int getImuDataCount(); + /** + * repeated .IMUReading imu_data = 4; + */ + java.util.List + getImuDataOrBuilderList(); + /** + * repeated .IMUReading imu_data = 4; + */ + com.openpositioning.PositionMe.Traj.IMUReadingOrBuilder getImuDataOrBuilder( + int index); + + /** + * repeated .RelativePosition pdr_data = 5; + */ + java.util.List + getPdrDataList(); + /** + * repeated .RelativePosition pdr_data = 5; + */ + com.openpositioning.PositionMe.Traj.RelativePosition getPdrData(int index); + /** + * repeated .RelativePosition pdr_data = 5; + */ + int getPdrDataCount(); + /** + * repeated .RelativePosition pdr_data = 5; + */ + java.util.List + getPdrDataOrBuilderList(); + /** + * repeated .RelativePosition pdr_data = 5; + */ + com.openpositioning.PositionMe.Traj.RelativePositionOrBuilder getPdrDataOrBuilder( + int index); + + /** + * repeated .MagnetometerReading magnetometer_data = 6; + */ + java.util.List + getMagnetometerDataList(); + /** + * repeated .MagnetometerReading magnetometer_data = 6; + */ + com.openpositioning.PositionMe.Traj.MagnetometerReading getMagnetometerData(int index); + /** + * repeated .MagnetometerReading magnetometer_data = 6; + */ + int getMagnetometerDataCount(); + /** + * repeated .MagnetometerReading magnetometer_data = 6; + */ + java.util.List + getMagnetometerDataOrBuilderList(); + /** + * repeated .MagnetometerReading magnetometer_data = 6; + */ + com.openpositioning.PositionMe.Traj.MagnetometerReadingOrBuilder getMagnetometerDataOrBuilder( + int index); + + /** + * repeated .BarometerReading pressure_data = 7; + */ + java.util.List + getPressureDataList(); + /** + * repeated .BarometerReading pressure_data = 7; + */ + com.openpositioning.PositionMe.Traj.BarometerReading getPressureData(int index); + /** + * repeated .BarometerReading pressure_data = 7; + */ + int getPressureDataCount(); + /** + * repeated .BarometerReading pressure_data = 7; + */ + java.util.List + getPressureDataOrBuilderList(); + /** + * repeated .BarometerReading pressure_data = 7; + */ + com.openpositioning.PositionMe.Traj.BarometerReadingOrBuilder getPressureDataOrBuilder( + int index); + + /** + * repeated .LightReading light_data = 8; + */ + java.util.List + getLightDataList(); + /** + * repeated .LightReading light_data = 8; + */ + com.openpositioning.PositionMe.Traj.LightReading getLightData(int index); + /** + * repeated .LightReading light_data = 8; + */ + int getLightDataCount(); + /** + * repeated .LightReading light_data = 8; + */ + java.util.List + getLightDataOrBuilderList(); + /** + * repeated .LightReading light_data = 8; + */ + com.openpositioning.PositionMe.Traj.LightReadingOrBuilder getLightDataOrBuilder( + int index); + + /** + * repeated .ProximityReading proximity_data = 9; + */ + java.util.List + getProximityDataList(); + /** + * repeated .ProximityReading proximity_data = 9; + */ + com.openpositioning.PositionMe.Traj.ProximityReading getProximityData(int index); + /** + * repeated .ProximityReading proximity_data = 9; + */ + int getProximityDataCount(); + /** + * repeated .ProximityReading proximity_data = 9; + */ + java.util.List + getProximityDataOrBuilderList(); + /** + * repeated .ProximityReading proximity_data = 9; + */ + com.openpositioning.PositionMe.Traj.ProximityReadingOrBuilder getProximityDataOrBuilder( + int index); + + /** + * repeated .GNSSReading gnss_data = 10; + */ + java.util.List + getGnssDataList(); + /** + * repeated .GNSSReading gnss_data = 10; + */ + com.openpositioning.PositionMe.Traj.GNSSReading getGnssData(int index); + /** + * repeated .GNSSReading gnss_data = 10; + */ + int getGnssDataCount(); + /** + * repeated .GNSSReading gnss_data = 10; + */ + java.util.List + getGnssDataOrBuilderList(); + /** + * repeated .GNSSReading gnss_data = 10; + */ + com.openpositioning.PositionMe.Traj.GNSSReadingOrBuilder getGnssDataOrBuilder( + int index); + + /** + * repeated .Fingerprint wifi_fingerprints = 11; + */ + java.util.List + getWifiFingerprintsList(); + /** + * repeated .Fingerprint wifi_fingerprints = 11; + */ + com.openpositioning.PositionMe.Traj.Fingerprint getWifiFingerprints(int index); + /** + * repeated .Fingerprint wifi_fingerprints = 11; + */ + int getWifiFingerprintsCount(); + /** + * repeated .Fingerprint wifi_fingerprints = 11; + */ + java.util.List + getWifiFingerprintsOrBuilderList(); + /** + * repeated .Fingerprint wifi_fingerprints = 11; + */ + com.openpositioning.PositionMe.Traj.FingerprintOrBuilder getWifiFingerprintsOrBuilder( + int index); + + /** + * repeated .WiFiAPData aps_data = 12; + */ + java.util.List + getApsDataList(); + /** + * repeated .WiFiAPData aps_data = 12; + */ + com.openpositioning.PositionMe.Traj.WiFiAPData getApsData(int index); + /** + * repeated .WiFiAPData aps_data = 12; + */ + int getApsDataCount(); + /** + * repeated .WiFiAPData aps_data = 12; + */ + java.util.List + getApsDataOrBuilderList(); + /** + * repeated .WiFiAPData aps_data = 12; + */ + com.openpositioning.PositionMe.Traj.WiFiAPDataOrBuilder getApsDataOrBuilder( + int index); + + /** + * repeated .WiFiRTTReading wifi_rtt_data = 13; + */ + java.util.List + getWifiRttDataList(); + /** + * repeated .WiFiRTTReading wifi_rtt_data = 13; + */ + com.openpositioning.PositionMe.Traj.WiFiRTTReading getWifiRttData(int index); + /** + * repeated .WiFiRTTReading wifi_rtt_data = 13; + */ + int getWifiRttDataCount(); + /** + * repeated .WiFiRTTReading wifi_rtt_data = 13; + */ + java.util.List + getWifiRttDataOrBuilderList(); + /** + * repeated .WiFiRTTReading wifi_rtt_data = 13; + */ + com.openpositioning.PositionMe.Traj.WiFiRTTReadingOrBuilder getWifiRttDataOrBuilder( + int index); + + /** + * repeated .Fingerprint ble_fingerprints = 14; + */ + java.util.List + getBleFingerprintsList(); + /** + * repeated .Fingerprint ble_fingerprints = 14; + */ + com.openpositioning.PositionMe.Traj.Fingerprint getBleFingerprints(int index); + /** + * repeated .Fingerprint ble_fingerprints = 14; + */ + int getBleFingerprintsCount(); + /** + * repeated .Fingerprint ble_fingerprints = 14; + */ + java.util.List + getBleFingerprintsOrBuilderList(); + /** + * repeated .Fingerprint ble_fingerprints = 14; + */ + com.openpositioning.PositionMe.Traj.FingerprintOrBuilder getBleFingerprintsOrBuilder( + int index); + + /** + * repeated .BleData ble_data = 15; + */ + java.util.List + getBleDataList(); + /** + * repeated .BleData ble_data = 15; + */ + com.openpositioning.PositionMe.Traj.BleData getBleData(int index); + /** + * repeated .BleData ble_data = 15; + */ + int getBleDataCount(); + /** + * repeated .BleData ble_data = 15; + */ + java.util.List + getBleDataOrBuilderList(); + /** + * repeated .BleData ble_data = 15; + */ + com.openpositioning.PositionMe.Traj.BleDataOrBuilder getBleDataOrBuilder( + int index); + + /** + *
+     * UNIX timestamp (in milliseconds) recorded from the start of this
+     * trajectory data collection event. All future
+     * timestamps in sub classes are to be RELATIVE timestamps
+     * (in milliseconds) to this start time.
+     * E.g.
+     * start_timestamp = 1674819807315 (UTC 27 Jan 2023 in the morning)
+     * relative_timestamp = 3000 (3s)
+     * 
+ * + * int64 start_timestamp = 16; + * @return The startTimestamp. + */ + long getStartTimestamp(); + + /** + * .GNSSPosition initial_position = 17; + * @return Whether the initialPosition field is set. + */ + boolean hasInitialPosition(); + /** + * .GNSSPosition initial_position = 17; + * @return The initialPosition. + */ + com.openpositioning.PositionMe.Traj.GNSSPosition getInitialPosition(); + /** + * .GNSSPosition initial_position = 17; + */ + com.openpositioning.PositionMe.Traj.GNSSPositionOrBuilder getInitialPositionOrBuilder(); + + /** + * repeated .GNSSPosition corrected_positions = 18; + */ + java.util.List + getCorrectedPositionsList(); + /** + * repeated .GNSSPosition corrected_positions = 18; + */ + com.openpositioning.PositionMe.Traj.GNSSPosition getCorrectedPositions(int index); + /** + * repeated .GNSSPosition corrected_positions = 18; + */ + int getCorrectedPositionsCount(); + /** + * repeated .GNSSPosition corrected_positions = 18; + */ + java.util.List + getCorrectedPositionsOrBuilderList(); + /** + * repeated .GNSSPosition corrected_positions = 18; + */ + com.openpositioning.PositionMe.Traj.GNSSPositionOrBuilder getCorrectedPositionsOrBuilder( + int index); + + /** + * .SensorInfo accelerometer_info = 19; + * @return Whether the accelerometerInfo field is set. + */ + boolean hasAccelerometerInfo(); + /** + * .SensorInfo accelerometer_info = 19; + * @return The accelerometerInfo. + */ + com.openpositioning.PositionMe.Traj.SensorInfo getAccelerometerInfo(); + /** + * .SensorInfo accelerometer_info = 19; + */ + com.openpositioning.PositionMe.Traj.SensorInfoOrBuilder getAccelerometerInfoOrBuilder(); + + /** + * .SensorInfo gyroscope_info = 20; + * @return Whether the gyroscopeInfo field is set. + */ + boolean hasGyroscopeInfo(); + /** + * .SensorInfo gyroscope_info = 20; + * @return The gyroscopeInfo. + */ + com.openpositioning.PositionMe.Traj.SensorInfo getGyroscopeInfo(); + /** + * .SensorInfo gyroscope_info = 20; + */ + com.openpositioning.PositionMe.Traj.SensorInfoOrBuilder getGyroscopeInfoOrBuilder(); + + /** + * .SensorInfo rotation_vector_info = 21; + * @return Whether the rotationVectorInfo field is set. + */ + boolean hasRotationVectorInfo(); + /** + * .SensorInfo rotation_vector_info = 21; + * @return The rotationVectorInfo. + */ + com.openpositioning.PositionMe.Traj.SensorInfo getRotationVectorInfo(); + /** + * .SensorInfo rotation_vector_info = 21; + */ + com.openpositioning.PositionMe.Traj.SensorInfoOrBuilder getRotationVectorInfoOrBuilder(); + + /** + * .SensorInfo magnetometer_info = 22; + * @return Whether the magnetometerInfo field is set. + */ + boolean hasMagnetometerInfo(); + /** + * .SensorInfo magnetometer_info = 22; + * @return The magnetometerInfo. + */ + com.openpositioning.PositionMe.Traj.SensorInfo getMagnetometerInfo(); + /** + * .SensorInfo magnetometer_info = 22; + */ + com.openpositioning.PositionMe.Traj.SensorInfoOrBuilder getMagnetometerInfoOrBuilder(); + + /** + * .SensorInfo barometer_info = 23; + * @return Whether the barometerInfo field is set. + */ + boolean hasBarometerInfo(); + /** + * .SensorInfo barometer_info = 23; + * @return The barometerInfo. + */ + com.openpositioning.PositionMe.Traj.SensorInfo getBarometerInfo(); + /** + * .SensorInfo barometer_info = 23; + */ + com.openpositioning.PositionMe.Traj.SensorInfoOrBuilder getBarometerInfoOrBuilder(); + + /** + * .SensorInfo light_SensorInfo = 24; + * @return Whether the lightSensorInfo field is set. + */ + boolean hasLightSensorInfo(); + /** + * .SensorInfo light_SensorInfo = 24; + * @return The lightSensorInfo. + */ + com.openpositioning.PositionMe.Traj.SensorInfo getLightSensorInfo(); + /** + * .SensorInfo light_SensorInfo = 24; + */ + com.openpositioning.PositionMe.Traj.SensorInfoOrBuilder getLightSensorInfoOrBuilder(); + + /** + * .SensorInfo proximity_info = 25; + * @return Whether the proximityInfo field is set. + */ + boolean hasProximityInfo(); + /** + * .SensorInfo proximity_info = 25; + * @return The proximityInfo. + */ + com.openpositioning.PositionMe.Traj.SensorInfo getProximityInfo(); + /** + * .SensorInfo proximity_info = 25; + */ + com.openpositioning.PositionMe.Traj.SensorInfoOrBuilder getProximityInfoOrBuilder(); + + /** + * repeated .GNSSPosition test_points = 26; + */ + java.util.List + getTestPointsList(); + /** + * repeated .GNSSPosition test_points = 26; + */ + com.openpositioning.PositionMe.Traj.GNSSPosition getTestPoints(int index); + /** + * repeated .GNSSPosition test_points = 26; + */ + int getTestPointsCount(); + /** + * repeated .GNSSPosition test_points = 26; + */ + java.util.List + getTestPointsOrBuilderList(); + /** + * repeated .GNSSPosition test_points = 26; + */ + com.openpositioning.PositionMe.Traj.GNSSPositionOrBuilder getTestPointsOrBuilder( + int index); + } + /** + * Protobuf type {@code Trajectory} + */ + public static final class Trajectory extends + com.google.protobuf.GeneratedMessage implements + // @@protoc_insertion_point(message_implements:Trajectory) + TrajectoryOrBuilder { + private static final long serialVersionUID = 0L; + static { + com.google.protobuf.RuntimeVersion.validateProtobufGencodeVersion( + com.google.protobuf.RuntimeVersion.RuntimeDomain.PUBLIC, + /* major= */ 4, + /* minor= */ 29, + /* patch= */ 6, + /* suffix= */ "", + Trajectory.class.getName()); + } + // Use Trajectory.newBuilder() to construct. + private Trajectory(com.google.protobuf.GeneratedMessage.Builder builder) { + super(builder); + } + private Trajectory() { + androidVersion_ = ""; + trajectoryId_ = ""; + imuData_ = java.util.Collections.emptyList(); + pdrData_ = java.util.Collections.emptyList(); + magnetometerData_ = java.util.Collections.emptyList(); + pressureData_ = java.util.Collections.emptyList(); + lightData_ = java.util.Collections.emptyList(); + proximityData_ = java.util.Collections.emptyList(); + gnssData_ = java.util.Collections.emptyList(); + wifiFingerprints_ = java.util.Collections.emptyList(); + apsData_ = java.util.Collections.emptyList(); + wifiRttData_ = java.util.Collections.emptyList(); + bleFingerprints_ = java.util.Collections.emptyList(); + bleData_ = java.util.Collections.emptyList(); + correctedPositions_ = java.util.Collections.emptyList(); + testPoints_ = java.util.Collections.emptyList(); + } + + public static final com.google.protobuf.Descriptors.Descriptor + getDescriptor() { + return com.openpositioning.PositionMe.Traj.internal_static_Trajectory_descriptor; + } + + @java.lang.Override + protected com.google.protobuf.GeneratedMessage.FieldAccessorTable + internalGetFieldAccessorTable() { + return com.openpositioning.PositionMe.Traj.internal_static_Trajectory_fieldAccessorTable + .ensureFieldAccessorsInitialized( + com.openpositioning.PositionMe.Traj.Trajectory.class, com.openpositioning.PositionMe.Traj.Trajectory.Builder.class); + } + + private int bitField0_; + public static final int ANDROID_VERSION_FIELD_NUMBER = 1; + @SuppressWarnings("serial") + private volatile java.lang.Object androidVersion_ = ""; + /** + * string android_version = 1; + * @return The androidVersion. + */ + @java.lang.Override + public java.lang.String getAndroidVersion() { + java.lang.Object ref = androidVersion_; + if (ref instanceof java.lang.String) { + return (java.lang.String) ref; + } else { + com.google.protobuf.ByteString bs = + (com.google.protobuf.ByteString) ref; + java.lang.String s = bs.toStringUtf8(); + androidVersion_ = s; + return s; + } + } + /** + * string android_version = 1; + * @return The bytes for androidVersion. + */ + @java.lang.Override + public com.google.protobuf.ByteString + getAndroidVersionBytes() { + java.lang.Object ref = androidVersion_; + if (ref instanceof java.lang.String) { + com.google.protobuf.ByteString b = + com.google.protobuf.ByteString.copyFromUtf8( + (java.lang.String) ref); + androidVersion_ = b; + return b; + } else { + return (com.google.protobuf.ByteString) ref; + } + } + + public static final int TRAJECTORY_VERSION_FIELD_NUMBER = 2; + private float trajectoryVersion_ = 0F; + /** + *
+     * version 2.0
+     * 
+ * + * float trajectory_version = 2; + * @return The trajectoryVersion. + */ + @java.lang.Override + public float getTrajectoryVersion() { + return trajectoryVersion_; + } + + public static final int TRAJECTORY_ID_FIELD_NUMBER = 3; + @SuppressWarnings("serial") + private volatile java.lang.Object trajectoryId_ = ""; + /** + *
+     * trajectory id/name for identification
+     * 
+ * + * string trajectory_id = 3; + * @return The trajectoryId. + */ + @java.lang.Override + public java.lang.String getTrajectoryId() { + java.lang.Object ref = trajectoryId_; + if (ref instanceof java.lang.String) { + return (java.lang.String) ref; + } else { + com.google.protobuf.ByteString bs = + (com.google.protobuf.ByteString) ref; + java.lang.String s = bs.toStringUtf8(); + trajectoryId_ = s; + return s; + } + } + /** + *
+     * trajectory id/name for identification
+     * 
+ * + * string trajectory_id = 3; + * @return The bytes for trajectoryId. + */ + @java.lang.Override + public com.google.protobuf.ByteString + getTrajectoryIdBytes() { + java.lang.Object ref = trajectoryId_; + if (ref instanceof java.lang.String) { + com.google.protobuf.ByteString b = + com.google.protobuf.ByteString.copyFromUtf8( + (java.lang.String) ref); + trajectoryId_ = b; + return b; + } else { + return (com.google.protobuf.ByteString) ref; + } + } + + public static final int IMU_DATA_FIELD_NUMBER = 4; + @SuppressWarnings("serial") + private java.util.List imuData_; + /** + * repeated .IMUReading imu_data = 4; + */ + @java.lang.Override + public java.util.List getImuDataList() { + return imuData_; + } + /** + * repeated .IMUReading imu_data = 4; + */ + @java.lang.Override + public java.util.List + getImuDataOrBuilderList() { + return imuData_; + } + /** + * repeated .IMUReading imu_data = 4; + */ + @java.lang.Override + public int getImuDataCount() { + return imuData_.size(); + } + /** + * repeated .IMUReading imu_data = 4; + */ + @java.lang.Override + public com.openpositioning.PositionMe.Traj.IMUReading getImuData(int index) { + return imuData_.get(index); + } + /** + * repeated .IMUReading imu_data = 4; + */ + @java.lang.Override + public com.openpositioning.PositionMe.Traj.IMUReadingOrBuilder getImuDataOrBuilder( + int index) { + return imuData_.get(index); + } + + public static final int PDR_DATA_FIELD_NUMBER = 5; + @SuppressWarnings("serial") + private java.util.List pdrData_; + /** + * repeated .RelativePosition pdr_data = 5; + */ + @java.lang.Override + public java.util.List getPdrDataList() { + return pdrData_; + } + /** + * repeated .RelativePosition pdr_data = 5; + */ + @java.lang.Override + public java.util.List + getPdrDataOrBuilderList() { + return pdrData_; + } + /** + * repeated .RelativePosition pdr_data = 5; + */ + @java.lang.Override + public int getPdrDataCount() { + return pdrData_.size(); + } + /** + * repeated .RelativePosition pdr_data = 5; + */ + @java.lang.Override + public com.openpositioning.PositionMe.Traj.RelativePosition getPdrData(int index) { + return pdrData_.get(index); + } + /** + * repeated .RelativePosition pdr_data = 5; + */ + @java.lang.Override + public com.openpositioning.PositionMe.Traj.RelativePositionOrBuilder getPdrDataOrBuilder( + int index) { + return pdrData_.get(index); + } + + public static final int MAGNETOMETER_DATA_FIELD_NUMBER = 6; + @SuppressWarnings("serial") + private java.util.List magnetometerData_; + /** + * repeated .MagnetometerReading magnetometer_data = 6; + */ + @java.lang.Override + public java.util.List getMagnetometerDataList() { + return magnetometerData_; + } + /** + * repeated .MagnetometerReading magnetometer_data = 6; + */ + @java.lang.Override + public java.util.List + getMagnetometerDataOrBuilderList() { + return magnetometerData_; + } + /** + * repeated .MagnetometerReading magnetometer_data = 6; + */ + @java.lang.Override + public int getMagnetometerDataCount() { + return magnetometerData_.size(); + } + /** + * repeated .MagnetometerReading magnetometer_data = 6; + */ + @java.lang.Override + public com.openpositioning.PositionMe.Traj.MagnetometerReading getMagnetometerData(int index) { + return magnetometerData_.get(index); + } + /** + * repeated .MagnetometerReading magnetometer_data = 6; + */ + @java.lang.Override + public com.openpositioning.PositionMe.Traj.MagnetometerReadingOrBuilder getMagnetometerDataOrBuilder( + int index) { + return magnetometerData_.get(index); + } + + public static final int PRESSURE_DATA_FIELD_NUMBER = 7; + @SuppressWarnings("serial") + private java.util.List pressureData_; + /** + * repeated .BarometerReading pressure_data = 7; + */ + @java.lang.Override + public java.util.List getPressureDataList() { + return pressureData_; + } + /** + * repeated .BarometerReading pressure_data = 7; + */ + @java.lang.Override + public java.util.List + getPressureDataOrBuilderList() { + return pressureData_; + } + /** + * repeated .BarometerReading pressure_data = 7; + */ + @java.lang.Override + public int getPressureDataCount() { + return pressureData_.size(); + } + /** + * repeated .BarometerReading pressure_data = 7; + */ + @java.lang.Override + public com.openpositioning.PositionMe.Traj.BarometerReading getPressureData(int index) { + return pressureData_.get(index); + } + /** + * repeated .BarometerReading pressure_data = 7; + */ + @java.lang.Override + public com.openpositioning.PositionMe.Traj.BarometerReadingOrBuilder getPressureDataOrBuilder( + int index) { + return pressureData_.get(index); + } + + public static final int LIGHT_DATA_FIELD_NUMBER = 8; + @SuppressWarnings("serial") + private java.util.List lightData_; + /** + * repeated .LightReading light_data = 8; + */ + @java.lang.Override + public java.util.List getLightDataList() { + return lightData_; + } + /** + * repeated .LightReading light_data = 8; + */ + @java.lang.Override + public java.util.List + getLightDataOrBuilderList() { + return lightData_; + } + /** + * repeated .LightReading light_data = 8; + */ + @java.lang.Override + public int getLightDataCount() { + return lightData_.size(); + } + /** + * repeated .LightReading light_data = 8; + */ + @java.lang.Override + public com.openpositioning.PositionMe.Traj.LightReading getLightData(int index) { + return lightData_.get(index); + } + /** + * repeated .LightReading light_data = 8; + */ + @java.lang.Override + public com.openpositioning.PositionMe.Traj.LightReadingOrBuilder getLightDataOrBuilder( + int index) { + return lightData_.get(index); + } + + public static final int PROXIMITY_DATA_FIELD_NUMBER = 9; + @SuppressWarnings("serial") + private java.util.List proximityData_; + /** + * repeated .ProximityReading proximity_data = 9; + */ + @java.lang.Override + public java.util.List getProximityDataList() { + return proximityData_; + } + /** + * repeated .ProximityReading proximity_data = 9; + */ + @java.lang.Override + public java.util.List + getProximityDataOrBuilderList() { + return proximityData_; + } + /** + * repeated .ProximityReading proximity_data = 9; + */ + @java.lang.Override + public int getProximityDataCount() { + return proximityData_.size(); + } + /** + * repeated .ProximityReading proximity_data = 9; + */ + @java.lang.Override + public com.openpositioning.PositionMe.Traj.ProximityReading getProximityData(int index) { + return proximityData_.get(index); + } + /** + * repeated .ProximityReading proximity_data = 9; + */ + @java.lang.Override + public com.openpositioning.PositionMe.Traj.ProximityReadingOrBuilder getProximityDataOrBuilder( + int index) { + return proximityData_.get(index); + } + + public static final int GNSS_DATA_FIELD_NUMBER = 10; + @SuppressWarnings("serial") + private java.util.List gnssData_; + /** + * repeated .GNSSReading gnss_data = 10; + */ + @java.lang.Override + public java.util.List getGnssDataList() { + return gnssData_; + } + /** + * repeated .GNSSReading gnss_data = 10; + */ + @java.lang.Override + public java.util.List + getGnssDataOrBuilderList() { + return gnssData_; + } + /** + * repeated .GNSSReading gnss_data = 10; + */ + @java.lang.Override + public int getGnssDataCount() { + return gnssData_.size(); + } + /** + * repeated .GNSSReading gnss_data = 10; + */ + @java.lang.Override + public com.openpositioning.PositionMe.Traj.GNSSReading getGnssData(int index) { + return gnssData_.get(index); + } + /** + * repeated .GNSSReading gnss_data = 10; + */ + @java.lang.Override + public com.openpositioning.PositionMe.Traj.GNSSReadingOrBuilder getGnssDataOrBuilder( + int index) { + return gnssData_.get(index); + } + + public static final int WIFI_FINGERPRINTS_FIELD_NUMBER = 11; + @SuppressWarnings("serial") + private java.util.List wifiFingerprints_; + /** + * repeated .Fingerprint wifi_fingerprints = 11; + */ + @java.lang.Override + public java.util.List getWifiFingerprintsList() { + return wifiFingerprints_; + } + /** + * repeated .Fingerprint wifi_fingerprints = 11; + */ + @java.lang.Override + public java.util.List + getWifiFingerprintsOrBuilderList() { + return wifiFingerprints_; + } + /** + * repeated .Fingerprint wifi_fingerprints = 11; + */ + @java.lang.Override + public int getWifiFingerprintsCount() { + return wifiFingerprints_.size(); + } + /** + * repeated .Fingerprint wifi_fingerprints = 11; + */ + @java.lang.Override + public com.openpositioning.PositionMe.Traj.Fingerprint getWifiFingerprints(int index) { + return wifiFingerprints_.get(index); + } + /** + * repeated .Fingerprint wifi_fingerprints = 11; + */ + @java.lang.Override + public com.openpositioning.PositionMe.Traj.FingerprintOrBuilder getWifiFingerprintsOrBuilder( + int index) { + return wifiFingerprints_.get(index); + } + + public static final int APS_DATA_FIELD_NUMBER = 12; + @SuppressWarnings("serial") + private java.util.List apsData_; + /** + * repeated .WiFiAPData aps_data = 12; + */ + @java.lang.Override + public java.util.List getApsDataList() { + return apsData_; + } + /** + * repeated .WiFiAPData aps_data = 12; + */ + @java.lang.Override + public java.util.List + getApsDataOrBuilderList() { + return apsData_; + } + /** + * repeated .WiFiAPData aps_data = 12; + */ + @java.lang.Override + public int getApsDataCount() { + return apsData_.size(); + } + /** + * repeated .WiFiAPData aps_data = 12; + */ + @java.lang.Override + public com.openpositioning.PositionMe.Traj.WiFiAPData getApsData(int index) { + return apsData_.get(index); + } + /** + * repeated .WiFiAPData aps_data = 12; + */ + @java.lang.Override + public com.openpositioning.PositionMe.Traj.WiFiAPDataOrBuilder getApsDataOrBuilder( + int index) { + return apsData_.get(index); + } + + public static final int WIFI_RTT_DATA_FIELD_NUMBER = 13; + @SuppressWarnings("serial") + private java.util.List wifiRttData_; + /** + * repeated .WiFiRTTReading wifi_rtt_data = 13; + */ + @java.lang.Override + public java.util.List getWifiRttDataList() { + return wifiRttData_; + } + /** + * repeated .WiFiRTTReading wifi_rtt_data = 13; + */ + @java.lang.Override + public java.util.List + getWifiRttDataOrBuilderList() { + return wifiRttData_; + } + /** + * repeated .WiFiRTTReading wifi_rtt_data = 13; + */ + @java.lang.Override + public int getWifiRttDataCount() { + return wifiRttData_.size(); + } + /** + * repeated .WiFiRTTReading wifi_rtt_data = 13; + */ + @java.lang.Override + public com.openpositioning.PositionMe.Traj.WiFiRTTReading getWifiRttData(int index) { + return wifiRttData_.get(index); + } + /** + * repeated .WiFiRTTReading wifi_rtt_data = 13; + */ + @java.lang.Override + public com.openpositioning.PositionMe.Traj.WiFiRTTReadingOrBuilder getWifiRttDataOrBuilder( + int index) { + return wifiRttData_.get(index); + } + + public static final int BLE_FINGERPRINTS_FIELD_NUMBER = 14; + @SuppressWarnings("serial") + private java.util.List bleFingerprints_; + /** + * repeated .Fingerprint ble_fingerprints = 14; + */ + @java.lang.Override + public java.util.List getBleFingerprintsList() { + return bleFingerprints_; + } + /** + * repeated .Fingerprint ble_fingerprints = 14; + */ + @java.lang.Override + public java.util.List + getBleFingerprintsOrBuilderList() { + return bleFingerprints_; + } + /** + * repeated .Fingerprint ble_fingerprints = 14; + */ + @java.lang.Override + public int getBleFingerprintsCount() { + return bleFingerprints_.size(); + } + /** + * repeated .Fingerprint ble_fingerprints = 14; + */ + @java.lang.Override + public com.openpositioning.PositionMe.Traj.Fingerprint getBleFingerprints(int index) { + return bleFingerprints_.get(index); + } + /** + * repeated .Fingerprint ble_fingerprints = 14; + */ + @java.lang.Override + public com.openpositioning.PositionMe.Traj.FingerprintOrBuilder getBleFingerprintsOrBuilder( + int index) { + return bleFingerprints_.get(index); + } + + public static final int BLE_DATA_FIELD_NUMBER = 15; + @SuppressWarnings("serial") + private java.util.List bleData_; + /** + * repeated .BleData ble_data = 15; + */ + @java.lang.Override + public java.util.List getBleDataList() { + return bleData_; + } + /** + * repeated .BleData ble_data = 15; + */ + @java.lang.Override + public java.util.List + getBleDataOrBuilderList() { + return bleData_; + } + /** + * repeated .BleData ble_data = 15; + */ + @java.lang.Override + public int getBleDataCount() { + return bleData_.size(); + } + /** + * repeated .BleData ble_data = 15; + */ + @java.lang.Override + public com.openpositioning.PositionMe.Traj.BleData getBleData(int index) { + return bleData_.get(index); + } + /** + * repeated .BleData ble_data = 15; + */ + @java.lang.Override + public com.openpositioning.PositionMe.Traj.BleDataOrBuilder getBleDataOrBuilder( + int index) { + return bleData_.get(index); + } + + public static final int START_TIMESTAMP_FIELD_NUMBER = 16; + private long startTimestamp_ = 0L; + /** + *
+     * UNIX timestamp (in milliseconds) recorded from the start of this
+     * trajectory data collection event. All future
+     * timestamps in sub classes are to be RELATIVE timestamps
+     * (in milliseconds) to this start time.
+     * E.g.
+     * start_timestamp = 1674819807315 (UTC 27 Jan 2023 in the morning)
+     * relative_timestamp = 3000 (3s)
+     * 
+ * + * int64 start_timestamp = 16; + * @return The startTimestamp. + */ + @java.lang.Override + public long getStartTimestamp() { + return startTimestamp_; + } + + public static final int INITIAL_POSITION_FIELD_NUMBER = 17; + private com.openpositioning.PositionMe.Traj.GNSSPosition initialPosition_; + /** + * .GNSSPosition initial_position = 17; + * @return Whether the initialPosition field is set. + */ + @java.lang.Override + public boolean hasInitialPosition() { + return ((bitField0_ & 0x00000001) != 0); + } + /** + * .GNSSPosition initial_position = 17; + * @return The initialPosition. + */ + @java.lang.Override + public com.openpositioning.PositionMe.Traj.GNSSPosition getInitialPosition() { + return initialPosition_ == null ? com.openpositioning.PositionMe.Traj.GNSSPosition.getDefaultInstance() : initialPosition_; + } + /** + * .GNSSPosition initial_position = 17; + */ + @java.lang.Override + public com.openpositioning.PositionMe.Traj.GNSSPositionOrBuilder getInitialPositionOrBuilder() { + return initialPosition_ == null ? com.openpositioning.PositionMe.Traj.GNSSPosition.getDefaultInstance() : initialPosition_; + } + + public static final int CORRECTED_POSITIONS_FIELD_NUMBER = 18; + @SuppressWarnings("serial") + private java.util.List correctedPositions_; + /** + * repeated .GNSSPosition corrected_positions = 18; + */ + @java.lang.Override + public java.util.List getCorrectedPositionsList() { + return correctedPositions_; + } + /** + * repeated .GNSSPosition corrected_positions = 18; + */ + @java.lang.Override + public java.util.List + getCorrectedPositionsOrBuilderList() { + return correctedPositions_; + } + /** + * repeated .GNSSPosition corrected_positions = 18; + */ + @java.lang.Override + public int getCorrectedPositionsCount() { + return correctedPositions_.size(); + } + /** + * repeated .GNSSPosition corrected_positions = 18; + */ + @java.lang.Override + public com.openpositioning.PositionMe.Traj.GNSSPosition getCorrectedPositions(int index) { + return correctedPositions_.get(index); + } + /** + * repeated .GNSSPosition corrected_positions = 18; + */ + @java.lang.Override + public com.openpositioning.PositionMe.Traj.GNSSPositionOrBuilder getCorrectedPositionsOrBuilder( + int index) { + return correctedPositions_.get(index); + } + + public static final int ACCELEROMETER_INFO_FIELD_NUMBER = 19; + private com.openpositioning.PositionMe.Traj.SensorInfo accelerometerInfo_; + /** + * .SensorInfo accelerometer_info = 19; + * @return Whether the accelerometerInfo field is set. + */ + @java.lang.Override + public boolean hasAccelerometerInfo() { + return ((bitField0_ & 0x00000002) != 0); + } + /** + * .SensorInfo accelerometer_info = 19; + * @return The accelerometerInfo. + */ + @java.lang.Override + public com.openpositioning.PositionMe.Traj.SensorInfo getAccelerometerInfo() { + return accelerometerInfo_ == null ? com.openpositioning.PositionMe.Traj.SensorInfo.getDefaultInstance() : accelerometerInfo_; + } + /** + * .SensorInfo accelerometer_info = 19; + */ + @java.lang.Override + public com.openpositioning.PositionMe.Traj.SensorInfoOrBuilder getAccelerometerInfoOrBuilder() { + return accelerometerInfo_ == null ? com.openpositioning.PositionMe.Traj.SensorInfo.getDefaultInstance() : accelerometerInfo_; + } + + public static final int GYROSCOPE_INFO_FIELD_NUMBER = 20; + private com.openpositioning.PositionMe.Traj.SensorInfo gyroscopeInfo_; + /** + * .SensorInfo gyroscope_info = 20; + * @return Whether the gyroscopeInfo field is set. + */ + @java.lang.Override + public boolean hasGyroscopeInfo() { + return ((bitField0_ & 0x00000004) != 0); + } + /** + * .SensorInfo gyroscope_info = 20; + * @return The gyroscopeInfo. + */ + @java.lang.Override + public com.openpositioning.PositionMe.Traj.SensorInfo getGyroscopeInfo() { + return gyroscopeInfo_ == null ? com.openpositioning.PositionMe.Traj.SensorInfo.getDefaultInstance() : gyroscopeInfo_; + } + /** + * .SensorInfo gyroscope_info = 20; + */ + @java.lang.Override + public com.openpositioning.PositionMe.Traj.SensorInfoOrBuilder getGyroscopeInfoOrBuilder() { + return gyroscopeInfo_ == null ? com.openpositioning.PositionMe.Traj.SensorInfo.getDefaultInstance() : gyroscopeInfo_; + } + + public static final int ROTATION_VECTOR_INFO_FIELD_NUMBER = 21; + private com.openpositioning.PositionMe.Traj.SensorInfo rotationVectorInfo_; + /** + * .SensorInfo rotation_vector_info = 21; + * @return Whether the rotationVectorInfo field is set. + */ + @java.lang.Override + public boolean hasRotationVectorInfo() { + return ((bitField0_ & 0x00000008) != 0); + } + /** + * .SensorInfo rotation_vector_info = 21; + * @return The rotationVectorInfo. + */ + @java.lang.Override + public com.openpositioning.PositionMe.Traj.SensorInfo getRotationVectorInfo() { + return rotationVectorInfo_ == null ? com.openpositioning.PositionMe.Traj.SensorInfo.getDefaultInstance() : rotationVectorInfo_; + } + /** + * .SensorInfo rotation_vector_info = 21; + */ + @java.lang.Override + public com.openpositioning.PositionMe.Traj.SensorInfoOrBuilder getRotationVectorInfoOrBuilder() { + return rotationVectorInfo_ == null ? com.openpositioning.PositionMe.Traj.SensorInfo.getDefaultInstance() : rotationVectorInfo_; + } + + public static final int MAGNETOMETER_INFO_FIELD_NUMBER = 22; + private com.openpositioning.PositionMe.Traj.SensorInfo magnetometerInfo_; + /** + * .SensorInfo magnetometer_info = 22; + * @return Whether the magnetometerInfo field is set. + */ + @java.lang.Override + public boolean hasMagnetometerInfo() { + return ((bitField0_ & 0x00000010) != 0); + } + /** + * .SensorInfo magnetometer_info = 22; + * @return The magnetometerInfo. + */ + @java.lang.Override + public com.openpositioning.PositionMe.Traj.SensorInfo getMagnetometerInfo() { + return magnetometerInfo_ == null ? com.openpositioning.PositionMe.Traj.SensorInfo.getDefaultInstance() : magnetometerInfo_; + } + /** + * .SensorInfo magnetometer_info = 22; + */ + @java.lang.Override + public com.openpositioning.PositionMe.Traj.SensorInfoOrBuilder getMagnetometerInfoOrBuilder() { + return magnetometerInfo_ == null ? com.openpositioning.PositionMe.Traj.SensorInfo.getDefaultInstance() : magnetometerInfo_; + } + + public static final int BAROMETER_INFO_FIELD_NUMBER = 23; + private com.openpositioning.PositionMe.Traj.SensorInfo barometerInfo_; + /** + * .SensorInfo barometer_info = 23; + * @return Whether the barometerInfo field is set. + */ + @java.lang.Override + public boolean hasBarometerInfo() { + return ((bitField0_ & 0x00000020) != 0); + } + /** + * .SensorInfo barometer_info = 23; + * @return The barometerInfo. + */ + @java.lang.Override + public com.openpositioning.PositionMe.Traj.SensorInfo getBarometerInfo() { + return barometerInfo_ == null ? com.openpositioning.PositionMe.Traj.SensorInfo.getDefaultInstance() : barometerInfo_; + } + /** + * .SensorInfo barometer_info = 23; + */ + @java.lang.Override + public com.openpositioning.PositionMe.Traj.SensorInfoOrBuilder getBarometerInfoOrBuilder() { + return barometerInfo_ == null ? com.openpositioning.PositionMe.Traj.SensorInfo.getDefaultInstance() : barometerInfo_; + } + + public static final int LIGHT_SensorInfo_FIELD_NUMBER = 24; + private com.openpositioning.PositionMe.Traj.SensorInfo lightSensorInfo_; + /** + * .SensorInfo light_SensorInfo = 24; + * @return Whether the lightSensorInfo field is set. + */ + @java.lang.Override + public boolean hasLightSensorInfo() { + return ((bitField0_ & 0x00000040) != 0); + } + /** + * .SensorInfo light_SensorInfo = 24; + * @return The lightSensorInfo. + */ + @java.lang.Override + public com.openpositioning.PositionMe.Traj.SensorInfo getLightSensorInfo() { + return lightSensorInfo_ == null ? com.openpositioning.PositionMe.Traj.SensorInfo.getDefaultInstance() : lightSensorInfo_; + } + /** + * .SensorInfo light_SensorInfo = 24; + */ + @java.lang.Override + public com.openpositioning.PositionMe.Traj.SensorInfoOrBuilder getLightSensorInfoOrBuilder() { + return lightSensorInfo_ == null ? com.openpositioning.PositionMe.Traj.SensorInfo.getDefaultInstance() : lightSensorInfo_; + } + + public static final int PROXIMITY_INFO_FIELD_NUMBER = 25; + private com.openpositioning.PositionMe.Traj.SensorInfo proximityInfo_; + /** + * .SensorInfo proximity_info = 25; + * @return Whether the proximityInfo field is set. + */ + @java.lang.Override + public boolean hasProximityInfo() { + return ((bitField0_ & 0x00000080) != 0); + } + /** + * .SensorInfo proximity_info = 25; + * @return The proximityInfo. + */ + @java.lang.Override + public com.openpositioning.PositionMe.Traj.SensorInfo getProximityInfo() { + return proximityInfo_ == null ? com.openpositioning.PositionMe.Traj.SensorInfo.getDefaultInstance() : proximityInfo_; + } + /** + * .SensorInfo proximity_info = 25; + */ + @java.lang.Override + public com.openpositioning.PositionMe.Traj.SensorInfoOrBuilder getProximityInfoOrBuilder() { + return proximityInfo_ == null ? com.openpositioning.PositionMe.Traj.SensorInfo.getDefaultInstance() : proximityInfo_; + } + + public static final int TEST_POINTS_FIELD_NUMBER = 26; + @SuppressWarnings("serial") + private java.util.List testPoints_; + /** + * repeated .GNSSPosition test_points = 26; + */ + @java.lang.Override + public java.util.List getTestPointsList() { + return testPoints_; + } + /** + * repeated .GNSSPosition test_points = 26; + */ + @java.lang.Override + public java.util.List + getTestPointsOrBuilderList() { + return testPoints_; + } + /** + * repeated .GNSSPosition test_points = 26; + */ + @java.lang.Override + public int getTestPointsCount() { + return testPoints_.size(); + } + /** + * repeated .GNSSPosition test_points = 26; + */ + @java.lang.Override + public com.openpositioning.PositionMe.Traj.GNSSPosition getTestPoints(int index) { + return testPoints_.get(index); + } + /** + * repeated .GNSSPosition test_points = 26; + */ + @java.lang.Override + public com.openpositioning.PositionMe.Traj.GNSSPositionOrBuilder getTestPointsOrBuilder( + int index) { + return testPoints_.get(index); + } + + private byte memoizedIsInitialized = -1; + @java.lang.Override + public final boolean isInitialized() { + byte isInitialized = memoizedIsInitialized; + if (isInitialized == 1) return true; + if (isInitialized == 0) return false; + + memoizedIsInitialized = 1; + return true; + } + + @java.lang.Override + public void writeTo(com.google.protobuf.CodedOutputStream output) + throws java.io.IOException { + if (!com.google.protobuf.GeneratedMessage.isStringEmpty(androidVersion_)) { + com.google.protobuf.GeneratedMessage.writeString(output, 1, androidVersion_); + } + if (java.lang.Float.floatToRawIntBits(trajectoryVersion_) != 0) { + output.writeFloat(2, trajectoryVersion_); + } + if (!com.google.protobuf.GeneratedMessage.isStringEmpty(trajectoryId_)) { + com.google.protobuf.GeneratedMessage.writeString(output, 3, trajectoryId_); + } + for (int i = 0; i < imuData_.size(); i++) { + output.writeMessage(4, imuData_.get(i)); + } + for (int i = 0; i < pdrData_.size(); i++) { + output.writeMessage(5, pdrData_.get(i)); + } + for (int i = 0; i < magnetometerData_.size(); i++) { + output.writeMessage(6, magnetometerData_.get(i)); + } + for (int i = 0; i < pressureData_.size(); i++) { + output.writeMessage(7, pressureData_.get(i)); + } + for (int i = 0; i < lightData_.size(); i++) { + output.writeMessage(8, lightData_.get(i)); + } + for (int i = 0; i < proximityData_.size(); i++) { + output.writeMessage(9, proximityData_.get(i)); + } + for (int i = 0; i < gnssData_.size(); i++) { + output.writeMessage(10, gnssData_.get(i)); + } + for (int i = 0; i < wifiFingerprints_.size(); i++) { + output.writeMessage(11, wifiFingerprints_.get(i)); + } + for (int i = 0; i < apsData_.size(); i++) { + output.writeMessage(12, apsData_.get(i)); + } + for (int i = 0; i < wifiRttData_.size(); i++) { + output.writeMessage(13, wifiRttData_.get(i)); + } + for (int i = 0; i < bleFingerprints_.size(); i++) { + output.writeMessage(14, bleFingerprints_.get(i)); + } + for (int i = 0; i < bleData_.size(); i++) { + output.writeMessage(15, bleData_.get(i)); + } + if (startTimestamp_ != 0L) { + output.writeInt64(16, startTimestamp_); + } + if (((bitField0_ & 0x00000001) != 0)) { + output.writeMessage(17, getInitialPosition()); + } + for (int i = 0; i < correctedPositions_.size(); i++) { + output.writeMessage(18, correctedPositions_.get(i)); + } + if (((bitField0_ & 0x00000002) != 0)) { + output.writeMessage(19, getAccelerometerInfo()); + } + if (((bitField0_ & 0x00000004) != 0)) { + output.writeMessage(20, getGyroscopeInfo()); + } + if (((bitField0_ & 0x00000008) != 0)) { + output.writeMessage(21, getRotationVectorInfo()); + } + if (((bitField0_ & 0x00000010) != 0)) { + output.writeMessage(22, getMagnetometerInfo()); + } + if (((bitField0_ & 0x00000020) != 0)) { + output.writeMessage(23, getBarometerInfo()); + } + if (((bitField0_ & 0x00000040) != 0)) { + output.writeMessage(24, getLightSensorInfo()); + } + if (((bitField0_ & 0x00000080) != 0)) { + output.writeMessage(25, getProximityInfo()); + } + for (int i = 0; i < testPoints_.size(); i++) { + output.writeMessage(26, testPoints_.get(i)); + } + getUnknownFields().writeTo(output); + } + + @java.lang.Override + public int getSerializedSize() { + int size = memoizedSize; + if (size != -1) return size; + + size = 0; + if (!com.google.protobuf.GeneratedMessage.isStringEmpty(androidVersion_)) { + size += com.google.protobuf.GeneratedMessage.computeStringSize(1, androidVersion_); + } + if (java.lang.Float.floatToRawIntBits(trajectoryVersion_) != 0) { + size += com.google.protobuf.CodedOutputStream + .computeFloatSize(2, trajectoryVersion_); + } + if (!com.google.protobuf.GeneratedMessage.isStringEmpty(trajectoryId_)) { + size += com.google.protobuf.GeneratedMessage.computeStringSize(3, trajectoryId_); + } + for (int i = 0; i < imuData_.size(); i++) { + size += com.google.protobuf.CodedOutputStream + .computeMessageSize(4, imuData_.get(i)); + } + for (int i = 0; i < pdrData_.size(); i++) { + size += com.google.protobuf.CodedOutputStream + .computeMessageSize(5, pdrData_.get(i)); + } + for (int i = 0; i < magnetometerData_.size(); i++) { + size += com.google.protobuf.CodedOutputStream + .computeMessageSize(6, magnetometerData_.get(i)); + } + for (int i = 0; i < pressureData_.size(); i++) { + size += com.google.protobuf.CodedOutputStream + .computeMessageSize(7, pressureData_.get(i)); + } + for (int i = 0; i < lightData_.size(); i++) { + size += com.google.protobuf.CodedOutputStream + .computeMessageSize(8, lightData_.get(i)); + } + for (int i = 0; i < proximityData_.size(); i++) { + size += com.google.protobuf.CodedOutputStream + .computeMessageSize(9, proximityData_.get(i)); + } + for (int i = 0; i < gnssData_.size(); i++) { + size += com.google.protobuf.CodedOutputStream + .computeMessageSize(10, gnssData_.get(i)); + } + for (int i = 0; i < wifiFingerprints_.size(); i++) { + size += com.google.protobuf.CodedOutputStream + .computeMessageSize(11, wifiFingerprints_.get(i)); + } + for (int i = 0; i < apsData_.size(); i++) { + size += com.google.protobuf.CodedOutputStream + .computeMessageSize(12, apsData_.get(i)); + } + for (int i = 0; i < wifiRttData_.size(); i++) { + size += com.google.protobuf.CodedOutputStream + .computeMessageSize(13, wifiRttData_.get(i)); + } + for (int i = 0; i < bleFingerprints_.size(); i++) { + size += com.google.protobuf.CodedOutputStream + .computeMessageSize(14, bleFingerprints_.get(i)); + } + for (int i = 0; i < bleData_.size(); i++) { + size += com.google.protobuf.CodedOutputStream + .computeMessageSize(15, bleData_.get(i)); + } + if (startTimestamp_ != 0L) { + size += com.google.protobuf.CodedOutputStream + .computeInt64Size(16, startTimestamp_); + } + if (((bitField0_ & 0x00000001) != 0)) { + size += com.google.protobuf.CodedOutputStream + .computeMessageSize(17, getInitialPosition()); + } + for (int i = 0; i < correctedPositions_.size(); i++) { + size += com.google.protobuf.CodedOutputStream + .computeMessageSize(18, correctedPositions_.get(i)); + } + if (((bitField0_ & 0x00000002) != 0)) { + size += com.google.protobuf.CodedOutputStream + .computeMessageSize(19, getAccelerometerInfo()); + } + if (((bitField0_ & 0x00000004) != 0)) { + size += com.google.protobuf.CodedOutputStream + .computeMessageSize(20, getGyroscopeInfo()); + } + if (((bitField0_ & 0x00000008) != 0)) { + size += com.google.protobuf.CodedOutputStream + .computeMessageSize(21, getRotationVectorInfo()); + } + if (((bitField0_ & 0x00000010) != 0)) { + size += com.google.protobuf.CodedOutputStream + .computeMessageSize(22, getMagnetometerInfo()); + } + if (((bitField0_ & 0x00000020) != 0)) { + size += com.google.protobuf.CodedOutputStream + .computeMessageSize(23, getBarometerInfo()); + } + if (((bitField0_ & 0x00000040) != 0)) { + size += com.google.protobuf.CodedOutputStream + .computeMessageSize(24, getLightSensorInfo()); + } + if (((bitField0_ & 0x00000080) != 0)) { + size += com.google.protobuf.CodedOutputStream + .computeMessageSize(25, getProximityInfo()); + } + for (int i = 0; i < testPoints_.size(); i++) { + size += com.google.protobuf.CodedOutputStream + .computeMessageSize(26, testPoints_.get(i)); + } + size += getUnknownFields().getSerializedSize(); + memoizedSize = size; + return size; + } + + @java.lang.Override + public boolean equals(final java.lang.Object obj) { + if (obj == this) { + return true; + } + if (!(obj instanceof com.openpositioning.PositionMe.Traj.Trajectory)) { + return super.equals(obj); + } + com.openpositioning.PositionMe.Traj.Trajectory other = (com.openpositioning.PositionMe.Traj.Trajectory) obj; + + if (!getAndroidVersion() + .equals(other.getAndroidVersion())) return false; + if (java.lang.Float.floatToIntBits(getTrajectoryVersion()) + != java.lang.Float.floatToIntBits( + other.getTrajectoryVersion())) return false; + if (!getTrajectoryId() + .equals(other.getTrajectoryId())) return false; + if (!getImuDataList() + .equals(other.getImuDataList())) return false; + if (!getPdrDataList() + .equals(other.getPdrDataList())) return false; + if (!getMagnetometerDataList() + .equals(other.getMagnetometerDataList())) return false; + if (!getPressureDataList() + .equals(other.getPressureDataList())) return false; + if (!getLightDataList() + .equals(other.getLightDataList())) return false; + if (!getProximityDataList() + .equals(other.getProximityDataList())) return false; + if (!getGnssDataList() + .equals(other.getGnssDataList())) return false; + if (!getWifiFingerprintsList() + .equals(other.getWifiFingerprintsList())) return false; + if (!getApsDataList() + .equals(other.getApsDataList())) return false; + if (!getWifiRttDataList() + .equals(other.getWifiRttDataList())) return false; + if (!getBleFingerprintsList() + .equals(other.getBleFingerprintsList())) return false; + if (!getBleDataList() + .equals(other.getBleDataList())) return false; + if (getStartTimestamp() + != other.getStartTimestamp()) return false; + if (hasInitialPosition() != other.hasInitialPosition()) return false; + if (hasInitialPosition()) { + if (!getInitialPosition() + .equals(other.getInitialPosition())) return false; + } + if (!getCorrectedPositionsList() + .equals(other.getCorrectedPositionsList())) return false; + if (hasAccelerometerInfo() != other.hasAccelerometerInfo()) return false; + if (hasAccelerometerInfo()) { + if (!getAccelerometerInfo() + .equals(other.getAccelerometerInfo())) return false; + } + if (hasGyroscopeInfo() != other.hasGyroscopeInfo()) return false; + if (hasGyroscopeInfo()) { + if (!getGyroscopeInfo() + .equals(other.getGyroscopeInfo())) return false; + } + if (hasRotationVectorInfo() != other.hasRotationVectorInfo()) return false; + if (hasRotationVectorInfo()) { + if (!getRotationVectorInfo() + .equals(other.getRotationVectorInfo())) return false; + } + if (hasMagnetometerInfo() != other.hasMagnetometerInfo()) return false; + if (hasMagnetometerInfo()) { + if (!getMagnetometerInfo() + .equals(other.getMagnetometerInfo())) return false; + } + if (hasBarometerInfo() != other.hasBarometerInfo()) return false; + if (hasBarometerInfo()) { + if (!getBarometerInfo() + .equals(other.getBarometerInfo())) return false; + } + if (hasLightSensorInfo() != other.hasLightSensorInfo()) return false; + if (hasLightSensorInfo()) { + if (!getLightSensorInfo() + .equals(other.getLightSensorInfo())) return false; + } + if (hasProximityInfo() != other.hasProximityInfo()) return false; + if (hasProximityInfo()) { + if (!getProximityInfo() + .equals(other.getProximityInfo())) return false; + } + if (!getTestPointsList() + .equals(other.getTestPointsList())) return false; + if (!getUnknownFields().equals(other.getUnknownFields())) return false; + return true; + } + + @java.lang.Override + public int hashCode() { + if (memoizedHashCode != 0) { + return memoizedHashCode; + } + int hash = 41; + hash = (19 * hash) + getDescriptor().hashCode(); + hash = (37 * hash) + ANDROID_VERSION_FIELD_NUMBER; + hash = (53 * hash) + getAndroidVersion().hashCode(); + hash = (37 * hash) + TRAJECTORY_VERSION_FIELD_NUMBER; + hash = (53 * hash) + java.lang.Float.floatToIntBits( + getTrajectoryVersion()); + hash = (37 * hash) + TRAJECTORY_ID_FIELD_NUMBER; + hash = (53 * hash) + getTrajectoryId().hashCode(); + if (getImuDataCount() > 0) { + hash = (37 * hash) + IMU_DATA_FIELD_NUMBER; + hash = (53 * hash) + getImuDataList().hashCode(); + } + if (getPdrDataCount() > 0) { + hash = (37 * hash) + PDR_DATA_FIELD_NUMBER; + hash = (53 * hash) + getPdrDataList().hashCode(); + } + if (getMagnetometerDataCount() > 0) { + hash = (37 * hash) + MAGNETOMETER_DATA_FIELD_NUMBER; + hash = (53 * hash) + getMagnetometerDataList().hashCode(); + } + if (getPressureDataCount() > 0) { + hash = (37 * hash) + PRESSURE_DATA_FIELD_NUMBER; + hash = (53 * hash) + getPressureDataList().hashCode(); + } + if (getLightDataCount() > 0) { + hash = (37 * hash) + LIGHT_DATA_FIELD_NUMBER; + hash = (53 * hash) + getLightDataList().hashCode(); + } + if (getProximityDataCount() > 0) { + hash = (37 * hash) + PROXIMITY_DATA_FIELD_NUMBER; + hash = (53 * hash) + getProximityDataList().hashCode(); + } + if (getGnssDataCount() > 0) { + hash = (37 * hash) + GNSS_DATA_FIELD_NUMBER; + hash = (53 * hash) + getGnssDataList().hashCode(); + } + if (getWifiFingerprintsCount() > 0) { + hash = (37 * hash) + WIFI_FINGERPRINTS_FIELD_NUMBER; + hash = (53 * hash) + getWifiFingerprintsList().hashCode(); + } + if (getApsDataCount() > 0) { + hash = (37 * hash) + APS_DATA_FIELD_NUMBER; + hash = (53 * hash) + getApsDataList().hashCode(); + } + if (getWifiRttDataCount() > 0) { + hash = (37 * hash) + WIFI_RTT_DATA_FIELD_NUMBER; + hash = (53 * hash) + getWifiRttDataList().hashCode(); + } + if (getBleFingerprintsCount() > 0) { + hash = (37 * hash) + BLE_FINGERPRINTS_FIELD_NUMBER; + hash = (53 * hash) + getBleFingerprintsList().hashCode(); + } + if (getBleDataCount() > 0) { + hash = (37 * hash) + BLE_DATA_FIELD_NUMBER; + hash = (53 * hash) + getBleDataList().hashCode(); + } + hash = (37 * hash) + START_TIMESTAMP_FIELD_NUMBER; + hash = (53 * hash) + com.google.protobuf.Internal.hashLong( + getStartTimestamp()); + if (hasInitialPosition()) { + hash = (37 * hash) + INITIAL_POSITION_FIELD_NUMBER; + hash = (53 * hash) + getInitialPosition().hashCode(); + } + if (getCorrectedPositionsCount() > 0) { + hash = (37 * hash) + CORRECTED_POSITIONS_FIELD_NUMBER; + hash = (53 * hash) + getCorrectedPositionsList().hashCode(); + } + if (hasAccelerometerInfo()) { + hash = (37 * hash) + ACCELEROMETER_INFO_FIELD_NUMBER; + hash = (53 * hash) + getAccelerometerInfo().hashCode(); + } + if (hasGyroscopeInfo()) { + hash = (37 * hash) + GYROSCOPE_INFO_FIELD_NUMBER; + hash = (53 * hash) + getGyroscopeInfo().hashCode(); + } + if (hasRotationVectorInfo()) { + hash = (37 * hash) + ROTATION_VECTOR_INFO_FIELD_NUMBER; + hash = (53 * hash) + getRotationVectorInfo().hashCode(); + } + if (hasMagnetometerInfo()) { + hash = (37 * hash) + MAGNETOMETER_INFO_FIELD_NUMBER; + hash = (53 * hash) + getMagnetometerInfo().hashCode(); + } + if (hasBarometerInfo()) { + hash = (37 * hash) + BAROMETER_INFO_FIELD_NUMBER; + hash = (53 * hash) + getBarometerInfo().hashCode(); + } + if (hasLightSensorInfo()) { + hash = (37 * hash) + LIGHT_SensorInfo_FIELD_NUMBER; + hash = (53 * hash) + getLightSensorInfo().hashCode(); + } + if (hasProximityInfo()) { + hash = (37 * hash) + PROXIMITY_INFO_FIELD_NUMBER; + hash = (53 * hash) + getProximityInfo().hashCode(); + } + if (getTestPointsCount() > 0) { + hash = (37 * hash) + TEST_POINTS_FIELD_NUMBER; + hash = (53 * hash) + getTestPointsList().hashCode(); + } + hash = (29 * hash) + getUnknownFields().hashCode(); + memoizedHashCode = hash; + return hash; + } + + public static com.openpositioning.PositionMe.Traj.Trajectory parseFrom( + java.nio.ByteBuffer data) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + public static com.openpositioning.PositionMe.Traj.Trajectory parseFrom( + java.nio.ByteBuffer data, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data, extensionRegistry); + } + public static com.openpositioning.PositionMe.Traj.Trajectory parseFrom( + com.google.protobuf.ByteString data) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + public static com.openpositioning.PositionMe.Traj.Trajectory parseFrom( + com.google.protobuf.ByteString data, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data, extensionRegistry); + } + public static com.openpositioning.PositionMe.Traj.Trajectory parseFrom(byte[] data) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + public static com.openpositioning.PositionMe.Traj.Trajectory parseFrom( + byte[] data, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data, extensionRegistry); + } + public static com.openpositioning.PositionMe.Traj.Trajectory parseFrom(java.io.InputStream input) + throws java.io.IOException { + return com.google.protobuf.GeneratedMessage + .parseWithIOException(PARSER, input); + } + public static com.openpositioning.PositionMe.Traj.Trajectory parseFrom( + java.io.InputStream input, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws java.io.IOException { + return com.google.protobuf.GeneratedMessage + .parseWithIOException(PARSER, input, extensionRegistry); + } + + public static com.openpositioning.PositionMe.Traj.Trajectory parseDelimitedFrom(java.io.InputStream input) + throws java.io.IOException { + return com.google.protobuf.GeneratedMessage + .parseDelimitedWithIOException(PARSER, input); + } + + public static com.openpositioning.PositionMe.Traj.Trajectory parseDelimitedFrom( + java.io.InputStream input, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws java.io.IOException { + return com.google.protobuf.GeneratedMessage + .parseDelimitedWithIOException(PARSER, input, extensionRegistry); + } + public static com.openpositioning.PositionMe.Traj.Trajectory parseFrom( + com.google.protobuf.CodedInputStream input) + throws java.io.IOException { + return com.google.protobuf.GeneratedMessage + .parseWithIOException(PARSER, input); + } + public static com.openpositioning.PositionMe.Traj.Trajectory parseFrom( + com.google.protobuf.CodedInputStream input, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws java.io.IOException { + return com.google.protobuf.GeneratedMessage + .parseWithIOException(PARSER, input, extensionRegistry); + } + + @java.lang.Override + public Builder newBuilderForType() { return newBuilder(); } + public static Builder newBuilder() { + return DEFAULT_INSTANCE.toBuilder(); + } + public static Builder newBuilder(com.openpositioning.PositionMe.Traj.Trajectory prototype) { + return DEFAULT_INSTANCE.toBuilder().mergeFrom(prototype); + } + @java.lang.Override + public Builder toBuilder() { + return this == DEFAULT_INSTANCE + ? new Builder() : new Builder().mergeFrom(this); + } + + @java.lang.Override + protected Builder newBuilderForType( + com.google.protobuf.GeneratedMessage.BuilderParent parent) { + Builder builder = new Builder(parent); + return builder; + } + /** + * Protobuf type {@code Trajectory} + */ + public static final class Builder extends + com.google.protobuf.GeneratedMessage.Builder implements + // @@protoc_insertion_point(builder_implements:Trajectory) + com.openpositioning.PositionMe.Traj.TrajectoryOrBuilder { + public static final com.google.protobuf.Descriptors.Descriptor + getDescriptor() { + return com.openpositioning.PositionMe.Traj.internal_static_Trajectory_descriptor; + } + + @java.lang.Override + protected com.google.protobuf.GeneratedMessage.FieldAccessorTable + internalGetFieldAccessorTable() { + return com.openpositioning.PositionMe.Traj.internal_static_Trajectory_fieldAccessorTable + .ensureFieldAccessorsInitialized( + com.openpositioning.PositionMe.Traj.Trajectory.class, com.openpositioning.PositionMe.Traj.Trajectory.Builder.class); + } + + // Construct using com.openpositioning.PositionMe.Traj.Trajectory.newBuilder() + private Builder() { + maybeForceBuilderInitialization(); + } + + private Builder( + com.google.protobuf.GeneratedMessage.BuilderParent parent) { + super(parent); + maybeForceBuilderInitialization(); + } + private void maybeForceBuilderInitialization() { + if (com.google.protobuf.GeneratedMessage + .alwaysUseFieldBuilders) { + getImuDataFieldBuilder(); + getPdrDataFieldBuilder(); + getMagnetometerDataFieldBuilder(); + getPressureDataFieldBuilder(); + getLightDataFieldBuilder(); + getProximityDataFieldBuilder(); + getGnssDataFieldBuilder(); + getWifiFingerprintsFieldBuilder(); + getApsDataFieldBuilder(); + getWifiRttDataFieldBuilder(); + getBleFingerprintsFieldBuilder(); + getBleDataFieldBuilder(); + getInitialPositionFieldBuilder(); + getCorrectedPositionsFieldBuilder(); + getAccelerometerInfoFieldBuilder(); + getGyroscopeInfoFieldBuilder(); + getRotationVectorInfoFieldBuilder(); + getMagnetometerInfoFieldBuilder(); + getBarometerInfoFieldBuilder(); + getLightSensorInfoFieldBuilder(); + getProximityInfoFieldBuilder(); + getTestPointsFieldBuilder(); + } + } + @java.lang.Override + public Builder clear() { + super.clear(); + bitField0_ = 0; + androidVersion_ = ""; + trajectoryVersion_ = 0F; + trajectoryId_ = ""; + if (imuDataBuilder_ == null) { + imuData_ = java.util.Collections.emptyList(); + } else { + imuData_ = null; + imuDataBuilder_.clear(); + } + bitField0_ = (bitField0_ & ~0x00000008); + if (pdrDataBuilder_ == null) { + pdrData_ = java.util.Collections.emptyList(); + } else { + pdrData_ = null; + pdrDataBuilder_.clear(); + } + bitField0_ = (bitField0_ & ~0x00000010); + if (magnetometerDataBuilder_ == null) { + magnetometerData_ = java.util.Collections.emptyList(); + } else { + magnetometerData_ = null; + magnetometerDataBuilder_.clear(); + } + bitField0_ = (bitField0_ & ~0x00000020); + if (pressureDataBuilder_ == null) { + pressureData_ = java.util.Collections.emptyList(); + } else { + pressureData_ = null; + pressureDataBuilder_.clear(); + } + bitField0_ = (bitField0_ & ~0x00000040); + if (lightDataBuilder_ == null) { + lightData_ = java.util.Collections.emptyList(); + } else { + lightData_ = null; + lightDataBuilder_.clear(); + } + bitField0_ = (bitField0_ & ~0x00000080); + if (proximityDataBuilder_ == null) { + proximityData_ = java.util.Collections.emptyList(); + } else { + proximityData_ = null; + proximityDataBuilder_.clear(); + } + bitField0_ = (bitField0_ & ~0x00000100); + if (gnssDataBuilder_ == null) { + gnssData_ = java.util.Collections.emptyList(); + } else { + gnssData_ = null; + gnssDataBuilder_.clear(); + } + bitField0_ = (bitField0_ & ~0x00000200); + if (wifiFingerprintsBuilder_ == null) { + wifiFingerprints_ = java.util.Collections.emptyList(); + } else { + wifiFingerprints_ = null; + wifiFingerprintsBuilder_.clear(); + } + bitField0_ = (bitField0_ & ~0x00000400); + if (apsDataBuilder_ == null) { + apsData_ = java.util.Collections.emptyList(); + } else { + apsData_ = null; + apsDataBuilder_.clear(); + } + bitField0_ = (bitField0_ & ~0x00000800); + if (wifiRttDataBuilder_ == null) { + wifiRttData_ = java.util.Collections.emptyList(); + } else { + wifiRttData_ = null; + wifiRttDataBuilder_.clear(); + } + bitField0_ = (bitField0_ & ~0x00001000); + if (bleFingerprintsBuilder_ == null) { + bleFingerprints_ = java.util.Collections.emptyList(); + } else { + bleFingerprints_ = null; + bleFingerprintsBuilder_.clear(); + } + bitField0_ = (bitField0_ & ~0x00002000); + if (bleDataBuilder_ == null) { + bleData_ = java.util.Collections.emptyList(); + } else { + bleData_ = null; + bleDataBuilder_.clear(); + } + bitField0_ = (bitField0_ & ~0x00004000); + startTimestamp_ = 0L; + initialPosition_ = null; + if (initialPositionBuilder_ != null) { + initialPositionBuilder_.dispose(); + initialPositionBuilder_ = null; + } + if (correctedPositionsBuilder_ == null) { + correctedPositions_ = java.util.Collections.emptyList(); + } else { + correctedPositions_ = null; + correctedPositionsBuilder_.clear(); + } + bitField0_ = (bitField0_ & ~0x00020000); + accelerometerInfo_ = null; + if (accelerometerInfoBuilder_ != null) { + accelerometerInfoBuilder_.dispose(); + accelerometerInfoBuilder_ = null; + } + gyroscopeInfo_ = null; + if (gyroscopeInfoBuilder_ != null) { + gyroscopeInfoBuilder_.dispose(); + gyroscopeInfoBuilder_ = null; + } + rotationVectorInfo_ = null; + if (rotationVectorInfoBuilder_ != null) { + rotationVectorInfoBuilder_.dispose(); + rotationVectorInfoBuilder_ = null; + } + magnetometerInfo_ = null; + if (magnetometerInfoBuilder_ != null) { + magnetometerInfoBuilder_.dispose(); + magnetometerInfoBuilder_ = null; + } + barometerInfo_ = null; + if (barometerInfoBuilder_ != null) { + barometerInfoBuilder_.dispose(); + barometerInfoBuilder_ = null; + } + lightSensorInfo_ = null; + if (lightSensorInfoBuilder_ != null) { + lightSensorInfoBuilder_.dispose(); + lightSensorInfoBuilder_ = null; + } + proximityInfo_ = null; + if (proximityInfoBuilder_ != null) { + proximityInfoBuilder_.dispose(); + proximityInfoBuilder_ = null; + } + if (testPointsBuilder_ == null) { + testPoints_ = java.util.Collections.emptyList(); + } else { + testPoints_ = null; + testPointsBuilder_.clear(); + } + bitField0_ = (bitField0_ & ~0x02000000); + return this; + } + + @java.lang.Override + public com.google.protobuf.Descriptors.Descriptor + getDescriptorForType() { + return com.openpositioning.PositionMe.Traj.internal_static_Trajectory_descriptor; + } + + @java.lang.Override + public com.openpositioning.PositionMe.Traj.Trajectory getDefaultInstanceForType() { + return com.openpositioning.PositionMe.Traj.Trajectory.getDefaultInstance(); + } + + @java.lang.Override + public com.openpositioning.PositionMe.Traj.Trajectory build() { + com.openpositioning.PositionMe.Traj.Trajectory result = buildPartial(); + if (!result.isInitialized()) { + throw newUninitializedMessageException(result); + } + return result; + } + + @java.lang.Override + public com.openpositioning.PositionMe.Traj.Trajectory buildPartial() { + com.openpositioning.PositionMe.Traj.Trajectory result = new com.openpositioning.PositionMe.Traj.Trajectory(this); + buildPartialRepeatedFields(result); + if (bitField0_ != 0) { buildPartial0(result); } + onBuilt(); + return result; + } + + private void buildPartialRepeatedFields(com.openpositioning.PositionMe.Traj.Trajectory result) { + if (imuDataBuilder_ == null) { + if (((bitField0_ & 0x00000008) != 0)) { + imuData_ = java.util.Collections.unmodifiableList(imuData_); + bitField0_ = (bitField0_ & ~0x00000008); + } + result.imuData_ = imuData_; + } else { + result.imuData_ = imuDataBuilder_.build(); + } + if (pdrDataBuilder_ == null) { + if (((bitField0_ & 0x00000010) != 0)) { + pdrData_ = java.util.Collections.unmodifiableList(pdrData_); + bitField0_ = (bitField0_ & ~0x00000010); + } + result.pdrData_ = pdrData_; + } else { + result.pdrData_ = pdrDataBuilder_.build(); + } + if (magnetometerDataBuilder_ == null) { + if (((bitField0_ & 0x00000020) != 0)) { + magnetometerData_ = java.util.Collections.unmodifiableList(magnetometerData_); + bitField0_ = (bitField0_ & ~0x00000020); + } + result.magnetometerData_ = magnetometerData_; + } else { + result.magnetometerData_ = magnetometerDataBuilder_.build(); + } + if (pressureDataBuilder_ == null) { + if (((bitField0_ & 0x00000040) != 0)) { + pressureData_ = java.util.Collections.unmodifiableList(pressureData_); + bitField0_ = (bitField0_ & ~0x00000040); + } + result.pressureData_ = pressureData_; + } else { + result.pressureData_ = pressureDataBuilder_.build(); + } + if (lightDataBuilder_ == null) { + if (((bitField0_ & 0x00000080) != 0)) { + lightData_ = java.util.Collections.unmodifiableList(lightData_); + bitField0_ = (bitField0_ & ~0x00000080); + } + result.lightData_ = lightData_; + } else { + result.lightData_ = lightDataBuilder_.build(); + } + if (proximityDataBuilder_ == null) { + if (((bitField0_ & 0x00000100) != 0)) { + proximityData_ = java.util.Collections.unmodifiableList(proximityData_); + bitField0_ = (bitField0_ & ~0x00000100); + } + result.proximityData_ = proximityData_; + } else { + result.proximityData_ = proximityDataBuilder_.build(); + } + if (gnssDataBuilder_ == null) { + if (((bitField0_ & 0x00000200) != 0)) { + gnssData_ = java.util.Collections.unmodifiableList(gnssData_); + bitField0_ = (bitField0_ & ~0x00000200); + } + result.gnssData_ = gnssData_; + } else { + result.gnssData_ = gnssDataBuilder_.build(); + } + if (wifiFingerprintsBuilder_ == null) { + if (((bitField0_ & 0x00000400) != 0)) { + wifiFingerprints_ = java.util.Collections.unmodifiableList(wifiFingerprints_); + bitField0_ = (bitField0_ & ~0x00000400); + } + result.wifiFingerprints_ = wifiFingerprints_; + } else { + result.wifiFingerprints_ = wifiFingerprintsBuilder_.build(); + } + if (apsDataBuilder_ == null) { + if (((bitField0_ & 0x00000800) != 0)) { + apsData_ = java.util.Collections.unmodifiableList(apsData_); + bitField0_ = (bitField0_ & ~0x00000800); + } + result.apsData_ = apsData_; + } else { + result.apsData_ = apsDataBuilder_.build(); + } + if (wifiRttDataBuilder_ == null) { + if (((bitField0_ & 0x00001000) != 0)) { + wifiRttData_ = java.util.Collections.unmodifiableList(wifiRttData_); + bitField0_ = (bitField0_ & ~0x00001000); + } + result.wifiRttData_ = wifiRttData_; + } else { + result.wifiRttData_ = wifiRttDataBuilder_.build(); + } + if (bleFingerprintsBuilder_ == null) { + if (((bitField0_ & 0x00002000) != 0)) { + bleFingerprints_ = java.util.Collections.unmodifiableList(bleFingerprints_); + bitField0_ = (bitField0_ & ~0x00002000); + } + result.bleFingerprints_ = bleFingerprints_; + } else { + result.bleFingerprints_ = bleFingerprintsBuilder_.build(); + } + if (bleDataBuilder_ == null) { + if (((bitField0_ & 0x00004000) != 0)) { + bleData_ = java.util.Collections.unmodifiableList(bleData_); + bitField0_ = (bitField0_ & ~0x00004000); + } + result.bleData_ = bleData_; + } else { + result.bleData_ = bleDataBuilder_.build(); + } + if (correctedPositionsBuilder_ == null) { + if (((bitField0_ & 0x00020000) != 0)) { + correctedPositions_ = java.util.Collections.unmodifiableList(correctedPositions_); + bitField0_ = (bitField0_ & ~0x00020000); + } + result.correctedPositions_ = correctedPositions_; + } else { + result.correctedPositions_ = correctedPositionsBuilder_.build(); + } + if (testPointsBuilder_ == null) { + if (((bitField0_ & 0x02000000) != 0)) { + testPoints_ = java.util.Collections.unmodifiableList(testPoints_); + bitField0_ = (bitField0_ & ~0x02000000); + } + result.testPoints_ = testPoints_; + } else { + result.testPoints_ = testPointsBuilder_.build(); + } + } + + private void buildPartial0(com.openpositioning.PositionMe.Traj.Trajectory result) { + int from_bitField0_ = bitField0_; + if (((from_bitField0_ & 0x00000001) != 0)) { + result.androidVersion_ = androidVersion_; + } + if (((from_bitField0_ & 0x00000002) != 0)) { + result.trajectoryVersion_ = trajectoryVersion_; + } + if (((from_bitField0_ & 0x00000004) != 0)) { + result.trajectoryId_ = trajectoryId_; + } + if (((from_bitField0_ & 0x00008000) != 0)) { + result.startTimestamp_ = startTimestamp_; + } + int to_bitField0_ = 0; + if (((from_bitField0_ & 0x00010000) != 0)) { + result.initialPosition_ = initialPositionBuilder_ == null + ? initialPosition_ + : initialPositionBuilder_.build(); + to_bitField0_ |= 0x00000001; + } + if (((from_bitField0_ & 0x00040000) != 0)) { + result.accelerometerInfo_ = accelerometerInfoBuilder_ == null + ? accelerometerInfo_ + : accelerometerInfoBuilder_.build(); + to_bitField0_ |= 0x00000002; + } + if (((from_bitField0_ & 0x00080000) != 0)) { + result.gyroscopeInfo_ = gyroscopeInfoBuilder_ == null + ? gyroscopeInfo_ + : gyroscopeInfoBuilder_.build(); + to_bitField0_ |= 0x00000004; + } + if (((from_bitField0_ & 0x00100000) != 0)) { + result.rotationVectorInfo_ = rotationVectorInfoBuilder_ == null + ? rotationVectorInfo_ + : rotationVectorInfoBuilder_.build(); + to_bitField0_ |= 0x00000008; + } + if (((from_bitField0_ & 0x00200000) != 0)) { + result.magnetometerInfo_ = magnetometerInfoBuilder_ == null + ? magnetometerInfo_ + : magnetometerInfoBuilder_.build(); + to_bitField0_ |= 0x00000010; + } + if (((from_bitField0_ & 0x00400000) != 0)) { + result.barometerInfo_ = barometerInfoBuilder_ == null + ? barometerInfo_ + : barometerInfoBuilder_.build(); + to_bitField0_ |= 0x00000020; + } + if (((from_bitField0_ & 0x00800000) != 0)) { + result.lightSensorInfo_ = lightSensorInfoBuilder_ == null + ? lightSensorInfo_ + : lightSensorInfoBuilder_.build(); + to_bitField0_ |= 0x00000040; + } + if (((from_bitField0_ & 0x01000000) != 0)) { + result.proximityInfo_ = proximityInfoBuilder_ == null + ? proximityInfo_ + : proximityInfoBuilder_.build(); + to_bitField0_ |= 0x00000080; + } + result.bitField0_ |= to_bitField0_; + } + + @java.lang.Override + public Builder mergeFrom(com.google.protobuf.Message other) { + if (other instanceof com.openpositioning.PositionMe.Traj.Trajectory) { + return mergeFrom((com.openpositioning.PositionMe.Traj.Trajectory)other); + } else { + super.mergeFrom(other); + return this; + } + } + + public Builder mergeFrom(com.openpositioning.PositionMe.Traj.Trajectory other) { + if (other == com.openpositioning.PositionMe.Traj.Trajectory.getDefaultInstance()) return this; + if (!other.getAndroidVersion().isEmpty()) { + androidVersion_ = other.androidVersion_; + bitField0_ |= 0x00000001; + onChanged(); + } + if (other.getTrajectoryVersion() != 0F) { + setTrajectoryVersion(other.getTrajectoryVersion()); + } + if (!other.getTrajectoryId().isEmpty()) { + trajectoryId_ = other.trajectoryId_; + bitField0_ |= 0x00000004; + onChanged(); + } + if (imuDataBuilder_ == null) { + if (!other.imuData_.isEmpty()) { + if (imuData_.isEmpty()) { + imuData_ = other.imuData_; + bitField0_ = (bitField0_ & ~0x00000008); + } else { + ensureImuDataIsMutable(); + imuData_.addAll(other.imuData_); + } + onChanged(); + } + } else { + if (!other.imuData_.isEmpty()) { + if (imuDataBuilder_.isEmpty()) { + imuDataBuilder_.dispose(); + imuDataBuilder_ = null; + imuData_ = other.imuData_; + bitField0_ = (bitField0_ & ~0x00000008); + imuDataBuilder_ = + com.google.protobuf.GeneratedMessage.alwaysUseFieldBuilders ? + getImuDataFieldBuilder() : null; + } else { + imuDataBuilder_.addAllMessages(other.imuData_); + } + } + } + if (pdrDataBuilder_ == null) { + if (!other.pdrData_.isEmpty()) { + if (pdrData_.isEmpty()) { + pdrData_ = other.pdrData_; + bitField0_ = (bitField0_ & ~0x00000010); + } else { + ensurePdrDataIsMutable(); + pdrData_.addAll(other.pdrData_); + } + onChanged(); + } + } else { + if (!other.pdrData_.isEmpty()) { + if (pdrDataBuilder_.isEmpty()) { + pdrDataBuilder_.dispose(); + pdrDataBuilder_ = null; + pdrData_ = other.pdrData_; + bitField0_ = (bitField0_ & ~0x00000010); + pdrDataBuilder_ = + com.google.protobuf.GeneratedMessage.alwaysUseFieldBuilders ? + getPdrDataFieldBuilder() : null; + } else { + pdrDataBuilder_.addAllMessages(other.pdrData_); + } + } + } + if (magnetometerDataBuilder_ == null) { + if (!other.magnetometerData_.isEmpty()) { + if (magnetometerData_.isEmpty()) { + magnetometerData_ = other.magnetometerData_; + bitField0_ = (bitField0_ & ~0x00000020); + } else { + ensureMagnetometerDataIsMutable(); + magnetometerData_.addAll(other.magnetometerData_); + } + onChanged(); + } + } else { + if (!other.magnetometerData_.isEmpty()) { + if (magnetometerDataBuilder_.isEmpty()) { + magnetometerDataBuilder_.dispose(); + magnetometerDataBuilder_ = null; + magnetometerData_ = other.magnetometerData_; + bitField0_ = (bitField0_ & ~0x00000020); + magnetometerDataBuilder_ = + com.google.protobuf.GeneratedMessage.alwaysUseFieldBuilders ? + getMagnetometerDataFieldBuilder() : null; + } else { + magnetometerDataBuilder_.addAllMessages(other.magnetometerData_); + } + } + } + if (pressureDataBuilder_ == null) { + if (!other.pressureData_.isEmpty()) { + if (pressureData_.isEmpty()) { + pressureData_ = other.pressureData_; + bitField0_ = (bitField0_ & ~0x00000040); + } else { + ensurePressureDataIsMutable(); + pressureData_.addAll(other.pressureData_); + } + onChanged(); + } + } else { + if (!other.pressureData_.isEmpty()) { + if (pressureDataBuilder_.isEmpty()) { + pressureDataBuilder_.dispose(); + pressureDataBuilder_ = null; + pressureData_ = other.pressureData_; + bitField0_ = (bitField0_ & ~0x00000040); + pressureDataBuilder_ = + com.google.protobuf.GeneratedMessage.alwaysUseFieldBuilders ? + getPressureDataFieldBuilder() : null; + } else { + pressureDataBuilder_.addAllMessages(other.pressureData_); + } + } + } + if (lightDataBuilder_ == null) { + if (!other.lightData_.isEmpty()) { + if (lightData_.isEmpty()) { + lightData_ = other.lightData_; + bitField0_ = (bitField0_ & ~0x00000080); + } else { + ensureLightDataIsMutable(); + lightData_.addAll(other.lightData_); + } + onChanged(); + } + } else { + if (!other.lightData_.isEmpty()) { + if (lightDataBuilder_.isEmpty()) { + lightDataBuilder_.dispose(); + lightDataBuilder_ = null; + lightData_ = other.lightData_; + bitField0_ = (bitField0_ & ~0x00000080); + lightDataBuilder_ = + com.google.protobuf.GeneratedMessage.alwaysUseFieldBuilders ? + getLightDataFieldBuilder() : null; + } else { + lightDataBuilder_.addAllMessages(other.lightData_); + } + } + } + if (proximityDataBuilder_ == null) { + if (!other.proximityData_.isEmpty()) { + if (proximityData_.isEmpty()) { + proximityData_ = other.proximityData_; + bitField0_ = (bitField0_ & ~0x00000100); + } else { + ensureProximityDataIsMutable(); + proximityData_.addAll(other.proximityData_); + } + onChanged(); + } + } else { + if (!other.proximityData_.isEmpty()) { + if (proximityDataBuilder_.isEmpty()) { + proximityDataBuilder_.dispose(); + proximityDataBuilder_ = null; + proximityData_ = other.proximityData_; + bitField0_ = (bitField0_ & ~0x00000100); + proximityDataBuilder_ = + com.google.protobuf.GeneratedMessage.alwaysUseFieldBuilders ? + getProximityDataFieldBuilder() : null; + } else { + proximityDataBuilder_.addAllMessages(other.proximityData_); + } + } + } + if (gnssDataBuilder_ == null) { + if (!other.gnssData_.isEmpty()) { + if (gnssData_.isEmpty()) { + gnssData_ = other.gnssData_; + bitField0_ = (bitField0_ & ~0x00000200); + } else { + ensureGnssDataIsMutable(); + gnssData_.addAll(other.gnssData_); + } + onChanged(); + } + } else { + if (!other.gnssData_.isEmpty()) { + if (gnssDataBuilder_.isEmpty()) { + gnssDataBuilder_.dispose(); + gnssDataBuilder_ = null; + gnssData_ = other.gnssData_; + bitField0_ = (bitField0_ & ~0x00000200); + gnssDataBuilder_ = + com.google.protobuf.GeneratedMessage.alwaysUseFieldBuilders ? + getGnssDataFieldBuilder() : null; + } else { + gnssDataBuilder_.addAllMessages(other.gnssData_); + } + } + } + if (wifiFingerprintsBuilder_ == null) { + if (!other.wifiFingerprints_.isEmpty()) { + if (wifiFingerprints_.isEmpty()) { + wifiFingerprints_ = other.wifiFingerprints_; + bitField0_ = (bitField0_ & ~0x00000400); + } else { + ensureWifiFingerprintsIsMutable(); + wifiFingerprints_.addAll(other.wifiFingerprints_); + } + onChanged(); + } + } else { + if (!other.wifiFingerprints_.isEmpty()) { + if (wifiFingerprintsBuilder_.isEmpty()) { + wifiFingerprintsBuilder_.dispose(); + wifiFingerprintsBuilder_ = null; + wifiFingerprints_ = other.wifiFingerprints_; + bitField0_ = (bitField0_ & ~0x00000400); + wifiFingerprintsBuilder_ = + com.google.protobuf.GeneratedMessage.alwaysUseFieldBuilders ? + getWifiFingerprintsFieldBuilder() : null; + } else { + wifiFingerprintsBuilder_.addAllMessages(other.wifiFingerprints_); + } + } + } + if (apsDataBuilder_ == null) { + if (!other.apsData_.isEmpty()) { + if (apsData_.isEmpty()) { + apsData_ = other.apsData_; + bitField0_ = (bitField0_ & ~0x00000800); + } else { + ensureApsDataIsMutable(); + apsData_.addAll(other.apsData_); + } + onChanged(); + } + } else { + if (!other.apsData_.isEmpty()) { + if (apsDataBuilder_.isEmpty()) { + apsDataBuilder_.dispose(); + apsDataBuilder_ = null; + apsData_ = other.apsData_; + bitField0_ = (bitField0_ & ~0x00000800); + apsDataBuilder_ = + com.google.protobuf.GeneratedMessage.alwaysUseFieldBuilders ? + getApsDataFieldBuilder() : null; + } else { + apsDataBuilder_.addAllMessages(other.apsData_); + } + } + } + if (wifiRttDataBuilder_ == null) { + if (!other.wifiRttData_.isEmpty()) { + if (wifiRttData_.isEmpty()) { + wifiRttData_ = other.wifiRttData_; + bitField0_ = (bitField0_ & ~0x00001000); + } else { + ensureWifiRttDataIsMutable(); + wifiRttData_.addAll(other.wifiRttData_); + } + onChanged(); + } + } else { + if (!other.wifiRttData_.isEmpty()) { + if (wifiRttDataBuilder_.isEmpty()) { + wifiRttDataBuilder_.dispose(); + wifiRttDataBuilder_ = null; + wifiRttData_ = other.wifiRttData_; + bitField0_ = (bitField0_ & ~0x00001000); + wifiRttDataBuilder_ = + com.google.protobuf.GeneratedMessage.alwaysUseFieldBuilders ? + getWifiRttDataFieldBuilder() : null; + } else { + wifiRttDataBuilder_.addAllMessages(other.wifiRttData_); + } + } + } + if (bleFingerprintsBuilder_ == null) { + if (!other.bleFingerprints_.isEmpty()) { + if (bleFingerprints_.isEmpty()) { + bleFingerprints_ = other.bleFingerprints_; + bitField0_ = (bitField0_ & ~0x00002000); + } else { + ensureBleFingerprintsIsMutable(); + bleFingerprints_.addAll(other.bleFingerprints_); + } + onChanged(); + } + } else { + if (!other.bleFingerprints_.isEmpty()) { + if (bleFingerprintsBuilder_.isEmpty()) { + bleFingerprintsBuilder_.dispose(); + bleFingerprintsBuilder_ = null; + bleFingerprints_ = other.bleFingerprints_; + bitField0_ = (bitField0_ & ~0x00002000); + bleFingerprintsBuilder_ = + com.google.protobuf.GeneratedMessage.alwaysUseFieldBuilders ? + getBleFingerprintsFieldBuilder() : null; + } else { + bleFingerprintsBuilder_.addAllMessages(other.bleFingerprints_); + } + } + } + if (bleDataBuilder_ == null) { + if (!other.bleData_.isEmpty()) { + if (bleData_.isEmpty()) { + bleData_ = other.bleData_; + bitField0_ = (bitField0_ & ~0x00004000); + } else { + ensureBleDataIsMutable(); + bleData_.addAll(other.bleData_); + } + onChanged(); + } + } else { + if (!other.bleData_.isEmpty()) { + if (bleDataBuilder_.isEmpty()) { + bleDataBuilder_.dispose(); + bleDataBuilder_ = null; + bleData_ = other.bleData_; + bitField0_ = (bitField0_ & ~0x00004000); + bleDataBuilder_ = + com.google.protobuf.GeneratedMessage.alwaysUseFieldBuilders ? + getBleDataFieldBuilder() : null; + } else { + bleDataBuilder_.addAllMessages(other.bleData_); + } + } + } + if (other.getStartTimestamp() != 0L) { + setStartTimestamp(other.getStartTimestamp()); + } + if (other.hasInitialPosition()) { + mergeInitialPosition(other.getInitialPosition()); + } + if (correctedPositionsBuilder_ == null) { + if (!other.correctedPositions_.isEmpty()) { + if (correctedPositions_.isEmpty()) { + correctedPositions_ = other.correctedPositions_; + bitField0_ = (bitField0_ & ~0x00020000); + } else { + ensureCorrectedPositionsIsMutable(); + correctedPositions_.addAll(other.correctedPositions_); + } + onChanged(); + } + } else { + if (!other.correctedPositions_.isEmpty()) { + if (correctedPositionsBuilder_.isEmpty()) { + correctedPositionsBuilder_.dispose(); + correctedPositionsBuilder_ = null; + correctedPositions_ = other.correctedPositions_; + bitField0_ = (bitField0_ & ~0x00020000); + correctedPositionsBuilder_ = + com.google.protobuf.GeneratedMessage.alwaysUseFieldBuilders ? + getCorrectedPositionsFieldBuilder() : null; + } else { + correctedPositionsBuilder_.addAllMessages(other.correctedPositions_); + } + } + } + if (other.hasAccelerometerInfo()) { + mergeAccelerometerInfo(other.getAccelerometerInfo()); + } + if (other.hasGyroscopeInfo()) { + mergeGyroscopeInfo(other.getGyroscopeInfo()); + } + if (other.hasRotationVectorInfo()) { + mergeRotationVectorInfo(other.getRotationVectorInfo()); + } + if (other.hasMagnetometerInfo()) { + mergeMagnetometerInfo(other.getMagnetometerInfo()); + } + if (other.hasBarometerInfo()) { + mergeBarometerInfo(other.getBarometerInfo()); + } + if (other.hasLightSensorInfo()) { + mergeLightSensorInfo(other.getLightSensorInfo()); + } + if (other.hasProximityInfo()) { + mergeProximityInfo(other.getProximityInfo()); + } + if (testPointsBuilder_ == null) { + if (!other.testPoints_.isEmpty()) { + if (testPoints_.isEmpty()) { + testPoints_ = other.testPoints_; + bitField0_ = (bitField0_ & ~0x02000000); + } else { + ensureTestPointsIsMutable(); + testPoints_.addAll(other.testPoints_); + } + onChanged(); + } + } else { + if (!other.testPoints_.isEmpty()) { + if (testPointsBuilder_.isEmpty()) { + testPointsBuilder_.dispose(); + testPointsBuilder_ = null; + testPoints_ = other.testPoints_; + bitField0_ = (bitField0_ & ~0x02000000); + testPointsBuilder_ = + com.google.protobuf.GeneratedMessage.alwaysUseFieldBuilders ? + getTestPointsFieldBuilder() : null; + } else { + testPointsBuilder_.addAllMessages(other.testPoints_); + } + } + } + this.mergeUnknownFields(other.getUnknownFields()); + onChanged(); + return this; + } + + @java.lang.Override + public final boolean isInitialized() { + return true; + } + + @java.lang.Override + public Builder mergeFrom( + com.google.protobuf.CodedInputStream input, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws java.io.IOException { + if (extensionRegistry == null) { + throw new java.lang.NullPointerException(); + } + try { + boolean done = false; + while (!done) { + int tag = input.readTag(); + switch (tag) { + case 0: + done = true; + break; + case 10: { + androidVersion_ = input.readStringRequireUtf8(); + bitField0_ |= 0x00000001; + break; + } // case 10 + case 21: { + trajectoryVersion_ = input.readFloat(); + bitField0_ |= 0x00000002; + break; + } // case 21 + case 26: { + trajectoryId_ = input.readStringRequireUtf8(); + bitField0_ |= 0x00000004; + break; + } // case 26 + case 34: { + com.openpositioning.PositionMe.Traj.IMUReading m = + input.readMessage( + com.openpositioning.PositionMe.Traj.IMUReading.parser(), + extensionRegistry); + if (imuDataBuilder_ == null) { + ensureImuDataIsMutable(); + imuData_.add(m); + } else { + imuDataBuilder_.addMessage(m); + } + break; + } // case 34 + case 42: { + com.openpositioning.PositionMe.Traj.RelativePosition m = + input.readMessage( + com.openpositioning.PositionMe.Traj.RelativePosition.parser(), + extensionRegistry); + if (pdrDataBuilder_ == null) { + ensurePdrDataIsMutable(); + pdrData_.add(m); + } else { + pdrDataBuilder_.addMessage(m); + } + break; + } // case 42 + case 50: { + com.openpositioning.PositionMe.Traj.MagnetometerReading m = + input.readMessage( + com.openpositioning.PositionMe.Traj.MagnetometerReading.parser(), + extensionRegistry); + if (magnetometerDataBuilder_ == null) { + ensureMagnetometerDataIsMutable(); + magnetometerData_.add(m); + } else { + magnetometerDataBuilder_.addMessage(m); + } + break; + } // case 50 + case 58: { + com.openpositioning.PositionMe.Traj.BarometerReading m = + input.readMessage( + com.openpositioning.PositionMe.Traj.BarometerReading.parser(), + extensionRegistry); + if (pressureDataBuilder_ == null) { + ensurePressureDataIsMutable(); + pressureData_.add(m); + } else { + pressureDataBuilder_.addMessage(m); + } + break; + } // case 58 + case 66: { + com.openpositioning.PositionMe.Traj.LightReading m = + input.readMessage( + com.openpositioning.PositionMe.Traj.LightReading.parser(), + extensionRegistry); + if (lightDataBuilder_ == null) { + ensureLightDataIsMutable(); + lightData_.add(m); + } else { + lightDataBuilder_.addMessage(m); + } + break; + } // case 66 + case 74: { + com.openpositioning.PositionMe.Traj.ProximityReading m = + input.readMessage( + com.openpositioning.PositionMe.Traj.ProximityReading.parser(), + extensionRegistry); + if (proximityDataBuilder_ == null) { + ensureProximityDataIsMutable(); + proximityData_.add(m); + } else { + proximityDataBuilder_.addMessage(m); + } + break; + } // case 74 + case 82: { + com.openpositioning.PositionMe.Traj.GNSSReading m = + input.readMessage( + com.openpositioning.PositionMe.Traj.GNSSReading.parser(), + extensionRegistry); + if (gnssDataBuilder_ == null) { + ensureGnssDataIsMutable(); + gnssData_.add(m); + } else { + gnssDataBuilder_.addMessage(m); + } + break; + } // case 82 + case 90: { + com.openpositioning.PositionMe.Traj.Fingerprint m = + input.readMessage( + com.openpositioning.PositionMe.Traj.Fingerprint.parser(), + extensionRegistry); + if (wifiFingerprintsBuilder_ == null) { + ensureWifiFingerprintsIsMutable(); + wifiFingerprints_.add(m); + } else { + wifiFingerprintsBuilder_.addMessage(m); + } + break; + } // case 90 + case 98: { + com.openpositioning.PositionMe.Traj.WiFiAPData m = + input.readMessage( + com.openpositioning.PositionMe.Traj.WiFiAPData.parser(), + extensionRegistry); + if (apsDataBuilder_ == null) { + ensureApsDataIsMutable(); + apsData_.add(m); + } else { + apsDataBuilder_.addMessage(m); + } + break; + } // case 98 + case 106: { + com.openpositioning.PositionMe.Traj.WiFiRTTReading m = + input.readMessage( + com.openpositioning.PositionMe.Traj.WiFiRTTReading.parser(), + extensionRegistry); + if (wifiRttDataBuilder_ == null) { + ensureWifiRttDataIsMutable(); + wifiRttData_.add(m); + } else { + wifiRttDataBuilder_.addMessage(m); + } + break; + } // case 106 + case 114: { + com.openpositioning.PositionMe.Traj.Fingerprint m = + input.readMessage( + com.openpositioning.PositionMe.Traj.Fingerprint.parser(), + extensionRegistry); + if (bleFingerprintsBuilder_ == null) { + ensureBleFingerprintsIsMutable(); + bleFingerprints_.add(m); + } else { + bleFingerprintsBuilder_.addMessage(m); + } + break; + } // case 114 + case 122: { + com.openpositioning.PositionMe.Traj.BleData m = + input.readMessage( + com.openpositioning.PositionMe.Traj.BleData.parser(), + extensionRegistry); + if (bleDataBuilder_ == null) { + ensureBleDataIsMutable(); + bleData_.add(m); + } else { + bleDataBuilder_.addMessage(m); + } + break; + } // case 122 + case 128: { + startTimestamp_ = input.readInt64(); + bitField0_ |= 0x00008000; + break; + } // case 128 + case 138: { + input.readMessage( + getInitialPositionFieldBuilder().getBuilder(), + extensionRegistry); + bitField0_ |= 0x00010000; + break; + } // case 138 + case 146: { + com.openpositioning.PositionMe.Traj.GNSSPosition m = + input.readMessage( + com.openpositioning.PositionMe.Traj.GNSSPosition.parser(), + extensionRegistry); + if (correctedPositionsBuilder_ == null) { + ensureCorrectedPositionsIsMutable(); + correctedPositions_.add(m); + } else { + correctedPositionsBuilder_.addMessage(m); + } + break; + } // case 146 + case 154: { + input.readMessage( + getAccelerometerInfoFieldBuilder().getBuilder(), + extensionRegistry); + bitField0_ |= 0x00040000; + break; + } // case 154 + case 162: { + input.readMessage( + getGyroscopeInfoFieldBuilder().getBuilder(), + extensionRegistry); + bitField0_ |= 0x00080000; + break; + } // case 162 + case 170: { + input.readMessage( + getRotationVectorInfoFieldBuilder().getBuilder(), + extensionRegistry); + bitField0_ |= 0x00100000; + break; + } // case 170 + case 178: { + input.readMessage( + getMagnetometerInfoFieldBuilder().getBuilder(), + extensionRegistry); + bitField0_ |= 0x00200000; + break; + } // case 178 + case 186: { + input.readMessage( + getBarometerInfoFieldBuilder().getBuilder(), + extensionRegistry); + bitField0_ |= 0x00400000; + break; + } // case 186 + case 194: { + input.readMessage( + getLightSensorInfoFieldBuilder().getBuilder(), + extensionRegistry); + bitField0_ |= 0x00800000; + break; + } // case 194 + case 202: { + input.readMessage( + getProximityInfoFieldBuilder().getBuilder(), + extensionRegistry); + bitField0_ |= 0x01000000; + break; + } // case 202 + case 210: { + com.openpositioning.PositionMe.Traj.GNSSPosition m = + input.readMessage( + com.openpositioning.PositionMe.Traj.GNSSPosition.parser(), + extensionRegistry); + if (testPointsBuilder_ == null) { + ensureTestPointsIsMutable(); + testPoints_.add(m); + } else { + testPointsBuilder_.addMessage(m); + } + break; + } // case 210 + default: { + if (!super.parseUnknownField(input, extensionRegistry, tag)) { + done = true; // was an endgroup tag + } + break; + } // default: + } // switch (tag) + } // while (!done) + } catch (com.google.protobuf.InvalidProtocolBufferException e) { + throw e.unwrapIOException(); + } finally { + onChanged(); + } // finally + return this; + } + private int bitField0_; + + private java.lang.Object androidVersion_ = ""; + /** + * string android_version = 1; + * @return The androidVersion. + */ + public java.lang.String getAndroidVersion() { + java.lang.Object ref = androidVersion_; + if (!(ref instanceof java.lang.String)) { + com.google.protobuf.ByteString bs = + (com.google.protobuf.ByteString) ref; + java.lang.String s = bs.toStringUtf8(); + androidVersion_ = s; + return s; + } else { + return (java.lang.String) ref; + } + } + /** + * string android_version = 1; + * @return The bytes for androidVersion. + */ + public com.google.protobuf.ByteString + getAndroidVersionBytes() { + java.lang.Object ref = androidVersion_; + if (ref instanceof String) { + com.google.protobuf.ByteString b = + com.google.protobuf.ByteString.copyFromUtf8( + (java.lang.String) ref); + androidVersion_ = b; + return b; + } else { + return (com.google.protobuf.ByteString) ref; + } + } + /** + * string android_version = 1; + * @param value The androidVersion to set. + * @return This builder for chaining. + */ + public Builder setAndroidVersion( + java.lang.String value) { + if (value == null) { throw new NullPointerException(); } + androidVersion_ = value; + bitField0_ |= 0x00000001; + onChanged(); + return this; + } + /** + * string android_version = 1; + * @return This builder for chaining. + */ + public Builder clearAndroidVersion() { + androidVersion_ = getDefaultInstance().getAndroidVersion(); + bitField0_ = (bitField0_ & ~0x00000001); + onChanged(); + return this; + } + /** + * string android_version = 1; + * @param value The bytes for androidVersion to set. + * @return This builder for chaining. + */ + public Builder setAndroidVersionBytes( + com.google.protobuf.ByteString value) { + if (value == null) { throw new NullPointerException(); } + checkByteStringIsUtf8(value); + androidVersion_ = value; + bitField0_ |= 0x00000001; + onChanged(); + return this; + } + + private float trajectoryVersion_ ; + /** + *
+       * version 2.0
+       * 
+ * + * float trajectory_version = 2; + * @return The trajectoryVersion. + */ + @java.lang.Override + public float getTrajectoryVersion() { + return trajectoryVersion_; + } + /** + *
+       * version 2.0
+       * 
+ * + * float trajectory_version = 2; + * @param value The trajectoryVersion to set. + * @return This builder for chaining. + */ + public Builder setTrajectoryVersion(float value) { + + trajectoryVersion_ = value; + bitField0_ |= 0x00000002; + onChanged(); + return this; + } + /** + *
+       * version 2.0
+       * 
+ * + * float trajectory_version = 2; + * @return This builder for chaining. + */ + public Builder clearTrajectoryVersion() { + bitField0_ = (bitField0_ & ~0x00000002); + trajectoryVersion_ = 0F; + onChanged(); + return this; + } + + private java.lang.Object trajectoryId_ = ""; + /** + *
+       * trajectory id/name for identification
+       * 
+ * + * string trajectory_id = 3; + * @return The trajectoryId. + */ + public java.lang.String getTrajectoryId() { + java.lang.Object ref = trajectoryId_; + if (!(ref instanceof java.lang.String)) { + com.google.protobuf.ByteString bs = + (com.google.protobuf.ByteString) ref; + java.lang.String s = bs.toStringUtf8(); + trajectoryId_ = s; + return s; + } else { + return (java.lang.String) ref; + } + } + /** + *
+       * trajectory id/name for identification
+       * 
+ * + * string trajectory_id = 3; + * @return The bytes for trajectoryId. + */ + public com.google.protobuf.ByteString + getTrajectoryIdBytes() { + java.lang.Object ref = trajectoryId_; + if (ref instanceof String) { + com.google.protobuf.ByteString b = + com.google.protobuf.ByteString.copyFromUtf8( + (java.lang.String) ref); + trajectoryId_ = b; + return b; + } else { + return (com.google.protobuf.ByteString) ref; + } + } + /** + *
+       * trajectory id/name for identification
+       * 
+ * + * string trajectory_id = 3; + * @param value The trajectoryId to set. + * @return This builder for chaining. + */ + public Builder setTrajectoryId( + java.lang.String value) { + if (value == null) { throw new NullPointerException(); } + trajectoryId_ = value; + bitField0_ |= 0x00000004; + onChanged(); + return this; + } + /** + *
+       * trajectory id/name for identification
+       * 
+ * + * string trajectory_id = 3; + * @return This builder for chaining. + */ + public Builder clearTrajectoryId() { + trajectoryId_ = getDefaultInstance().getTrajectoryId(); + bitField0_ = (bitField0_ & ~0x00000004); + onChanged(); + return this; + } + /** + *
+       * trajectory id/name for identification
+       * 
+ * + * string trajectory_id = 3; + * @param value The bytes for trajectoryId to set. + * @return This builder for chaining. + */ + public Builder setTrajectoryIdBytes( + com.google.protobuf.ByteString value) { + if (value == null) { throw new NullPointerException(); } + checkByteStringIsUtf8(value); + trajectoryId_ = value; + bitField0_ |= 0x00000004; + onChanged(); + return this; + } + + private java.util.List imuData_ = + java.util.Collections.emptyList(); + private void ensureImuDataIsMutable() { + if (!((bitField0_ & 0x00000008) != 0)) { + imuData_ = new java.util.ArrayList(imuData_); + bitField0_ |= 0x00000008; + } + } + + private com.google.protobuf.RepeatedFieldBuilder< + com.openpositioning.PositionMe.Traj.IMUReading, com.openpositioning.PositionMe.Traj.IMUReading.Builder, com.openpositioning.PositionMe.Traj.IMUReadingOrBuilder> imuDataBuilder_; + + /** + * repeated .IMUReading imu_data = 4; + */ + public java.util.List getImuDataList() { + if (imuDataBuilder_ == null) { + return java.util.Collections.unmodifiableList(imuData_); + } else { + return imuDataBuilder_.getMessageList(); + } + } + /** + * repeated .IMUReading imu_data = 4; + */ + public int getImuDataCount() { + if (imuDataBuilder_ == null) { + return imuData_.size(); + } else { + return imuDataBuilder_.getCount(); + } + } + /** + * repeated .IMUReading imu_data = 4; + */ + public com.openpositioning.PositionMe.Traj.IMUReading getImuData(int index) { + if (imuDataBuilder_ == null) { + return imuData_.get(index); + } else { + return imuDataBuilder_.getMessage(index); + } + } + /** + * repeated .IMUReading imu_data = 4; + */ + public Builder setImuData( + int index, com.openpositioning.PositionMe.Traj.IMUReading value) { + if (imuDataBuilder_ == null) { + if (value == null) { + throw new NullPointerException(); + } + ensureImuDataIsMutable(); + imuData_.set(index, value); + onChanged(); + } else { + imuDataBuilder_.setMessage(index, value); + } + return this; + } + /** + * repeated .IMUReading imu_data = 4; + */ + public Builder setImuData( + int index, com.openpositioning.PositionMe.Traj.IMUReading.Builder builderForValue) { + if (imuDataBuilder_ == null) { + ensureImuDataIsMutable(); + imuData_.set(index, builderForValue.build()); + onChanged(); + } else { + imuDataBuilder_.setMessage(index, builderForValue.build()); + } + return this; + } + /** + * repeated .IMUReading imu_data = 4; + */ + public Builder addImuData(com.openpositioning.PositionMe.Traj.IMUReading value) { + if (imuDataBuilder_ == null) { + if (value == null) { + throw new NullPointerException(); + } + ensureImuDataIsMutable(); + imuData_.add(value); + onChanged(); + } else { + imuDataBuilder_.addMessage(value); + } + return this; + } + /** + * repeated .IMUReading imu_data = 4; + */ + public Builder addImuData( + int index, com.openpositioning.PositionMe.Traj.IMUReading value) { + if (imuDataBuilder_ == null) { + if (value == null) { + throw new NullPointerException(); + } + ensureImuDataIsMutable(); + imuData_.add(index, value); + onChanged(); + } else { + imuDataBuilder_.addMessage(index, value); + } + return this; + } + /** + * repeated .IMUReading imu_data = 4; + */ + public Builder addImuData( + com.openpositioning.PositionMe.Traj.IMUReading.Builder builderForValue) { + if (imuDataBuilder_ == null) { + ensureImuDataIsMutable(); + imuData_.add(builderForValue.build()); + onChanged(); + } else { + imuDataBuilder_.addMessage(builderForValue.build()); + } + return this; + } + /** + * repeated .IMUReading imu_data = 4; + */ + public Builder addImuData( + int index, com.openpositioning.PositionMe.Traj.IMUReading.Builder builderForValue) { + if (imuDataBuilder_ == null) { + ensureImuDataIsMutable(); + imuData_.add(index, builderForValue.build()); + onChanged(); + } else { + imuDataBuilder_.addMessage(index, builderForValue.build()); + } + return this; + } + /** + * repeated .IMUReading imu_data = 4; + */ + public Builder addAllImuData( + java.lang.Iterable values) { + if (imuDataBuilder_ == null) { + ensureImuDataIsMutable(); + com.google.protobuf.AbstractMessageLite.Builder.addAll( + values, imuData_); + onChanged(); + } else { + imuDataBuilder_.addAllMessages(values); + } + return this; + } + /** + * repeated .IMUReading imu_data = 4; + */ + public Builder clearImuData() { + if (imuDataBuilder_ == null) { + imuData_ = java.util.Collections.emptyList(); + bitField0_ = (bitField0_ & ~0x00000008); + onChanged(); + } else { + imuDataBuilder_.clear(); + } + return this; + } + /** + * repeated .IMUReading imu_data = 4; + */ + public Builder removeImuData(int index) { + if (imuDataBuilder_ == null) { + ensureImuDataIsMutable(); + imuData_.remove(index); + onChanged(); + } else { + imuDataBuilder_.remove(index); + } + return this; + } + /** + * repeated .IMUReading imu_data = 4; + */ + public com.openpositioning.PositionMe.Traj.IMUReading.Builder getImuDataBuilder( + int index) { + return getImuDataFieldBuilder().getBuilder(index); + } + /** + * repeated .IMUReading imu_data = 4; + */ + public com.openpositioning.PositionMe.Traj.IMUReadingOrBuilder getImuDataOrBuilder( + int index) { + if (imuDataBuilder_ == null) { + return imuData_.get(index); } else { + return imuDataBuilder_.getMessageOrBuilder(index); + } + } + /** + * repeated .IMUReading imu_data = 4; + */ + public java.util.List + getImuDataOrBuilderList() { + if (imuDataBuilder_ != null) { + return imuDataBuilder_.getMessageOrBuilderList(); + } else { + return java.util.Collections.unmodifiableList(imuData_); + } + } + /** + * repeated .IMUReading imu_data = 4; + */ + public com.openpositioning.PositionMe.Traj.IMUReading.Builder addImuDataBuilder() { + return getImuDataFieldBuilder().addBuilder( + com.openpositioning.PositionMe.Traj.IMUReading.getDefaultInstance()); + } + /** + * repeated .IMUReading imu_data = 4; + */ + public com.openpositioning.PositionMe.Traj.IMUReading.Builder addImuDataBuilder( + int index) { + return getImuDataFieldBuilder().addBuilder( + index, com.openpositioning.PositionMe.Traj.IMUReading.getDefaultInstance()); + } + /** + * repeated .IMUReading imu_data = 4; + */ + public java.util.List + getImuDataBuilderList() { + return getImuDataFieldBuilder().getBuilderList(); + } + private com.google.protobuf.RepeatedFieldBuilder< + com.openpositioning.PositionMe.Traj.IMUReading, com.openpositioning.PositionMe.Traj.IMUReading.Builder, com.openpositioning.PositionMe.Traj.IMUReadingOrBuilder> + getImuDataFieldBuilder() { + if (imuDataBuilder_ == null) { + imuDataBuilder_ = new com.google.protobuf.RepeatedFieldBuilder< + com.openpositioning.PositionMe.Traj.IMUReading, com.openpositioning.PositionMe.Traj.IMUReading.Builder, com.openpositioning.PositionMe.Traj.IMUReadingOrBuilder>( + imuData_, + ((bitField0_ & 0x00000008) != 0), + getParentForChildren(), + isClean()); + imuData_ = null; + } + return imuDataBuilder_; + } + + private java.util.List pdrData_ = + java.util.Collections.emptyList(); + private void ensurePdrDataIsMutable() { + if (!((bitField0_ & 0x00000010) != 0)) { + pdrData_ = new java.util.ArrayList(pdrData_); + bitField0_ |= 0x00000010; + } + } + + private com.google.protobuf.RepeatedFieldBuilder< + com.openpositioning.PositionMe.Traj.RelativePosition, com.openpositioning.PositionMe.Traj.RelativePosition.Builder, com.openpositioning.PositionMe.Traj.RelativePositionOrBuilder> pdrDataBuilder_; + + /** + * repeated .RelativePosition pdr_data = 5; + */ + public java.util.List getPdrDataList() { + if (pdrDataBuilder_ == null) { + return java.util.Collections.unmodifiableList(pdrData_); + } else { + return pdrDataBuilder_.getMessageList(); + } + } + /** + * repeated .RelativePosition pdr_data = 5; + */ + public int getPdrDataCount() { + if (pdrDataBuilder_ == null) { + return pdrData_.size(); + } else { + return pdrDataBuilder_.getCount(); + } + } + /** + * repeated .RelativePosition pdr_data = 5; + */ + public com.openpositioning.PositionMe.Traj.RelativePosition getPdrData(int index) { + if (pdrDataBuilder_ == null) { + return pdrData_.get(index); + } else { + return pdrDataBuilder_.getMessage(index); + } + } + /** + * repeated .RelativePosition pdr_data = 5; + */ + public Builder setPdrData( + int index, com.openpositioning.PositionMe.Traj.RelativePosition value) { + if (pdrDataBuilder_ == null) { + if (value == null) { + throw new NullPointerException(); + } + ensurePdrDataIsMutable(); + pdrData_.set(index, value); + onChanged(); + } else { + pdrDataBuilder_.setMessage(index, value); + } + return this; + } + /** + * repeated .RelativePosition pdr_data = 5; + */ + public Builder setPdrData( + int index, com.openpositioning.PositionMe.Traj.RelativePosition.Builder builderForValue) { + if (pdrDataBuilder_ == null) { + ensurePdrDataIsMutable(); + pdrData_.set(index, builderForValue.build()); + onChanged(); + } else { + pdrDataBuilder_.setMessage(index, builderForValue.build()); + } + return this; + } + /** + * repeated .RelativePosition pdr_data = 5; + */ + public Builder addPdrData(com.openpositioning.PositionMe.Traj.RelativePosition value) { + if (pdrDataBuilder_ == null) { + if (value == null) { + throw new NullPointerException(); + } + ensurePdrDataIsMutable(); + pdrData_.add(value); + onChanged(); + } else { + pdrDataBuilder_.addMessage(value); + } + return this; + } + /** + * repeated .RelativePosition pdr_data = 5; + */ + public Builder addPdrData( + int index, com.openpositioning.PositionMe.Traj.RelativePosition value) { + if (pdrDataBuilder_ == null) { + if (value == null) { + throw new NullPointerException(); + } + ensurePdrDataIsMutable(); + pdrData_.add(index, value); + onChanged(); + } else { + pdrDataBuilder_.addMessage(index, value); + } + return this; + } + /** + * repeated .RelativePosition pdr_data = 5; + */ + public Builder addPdrData( + com.openpositioning.PositionMe.Traj.RelativePosition.Builder builderForValue) { + if (pdrDataBuilder_ == null) { + ensurePdrDataIsMutable(); + pdrData_.add(builderForValue.build()); + onChanged(); + } else { + pdrDataBuilder_.addMessage(builderForValue.build()); + } + return this; + } + /** + * repeated .RelativePosition pdr_data = 5; + */ + public Builder addPdrData( + int index, com.openpositioning.PositionMe.Traj.RelativePosition.Builder builderForValue) { + if (pdrDataBuilder_ == null) { + ensurePdrDataIsMutable(); + pdrData_.add(index, builderForValue.build()); + onChanged(); + } else { + pdrDataBuilder_.addMessage(index, builderForValue.build()); + } + return this; + } + /** + * repeated .RelativePosition pdr_data = 5; + */ + public Builder addAllPdrData( + java.lang.Iterable values) { + if (pdrDataBuilder_ == null) { + ensurePdrDataIsMutable(); + com.google.protobuf.AbstractMessageLite.Builder.addAll( + values, pdrData_); + onChanged(); + } else { + pdrDataBuilder_.addAllMessages(values); + } + return this; + } + /** + * repeated .RelativePosition pdr_data = 5; + */ + public Builder clearPdrData() { + if (pdrDataBuilder_ == null) { + pdrData_ = java.util.Collections.emptyList(); + bitField0_ = (bitField0_ & ~0x00000010); + onChanged(); + } else { + pdrDataBuilder_.clear(); + } + return this; + } + /** + * repeated .RelativePosition pdr_data = 5; + */ + public Builder removePdrData(int index) { + if (pdrDataBuilder_ == null) { + ensurePdrDataIsMutable(); + pdrData_.remove(index); + onChanged(); + } else { + pdrDataBuilder_.remove(index); + } + return this; + } + /** + * repeated .RelativePosition pdr_data = 5; + */ + public com.openpositioning.PositionMe.Traj.RelativePosition.Builder getPdrDataBuilder( + int index) { + return getPdrDataFieldBuilder().getBuilder(index); + } + /** + * repeated .RelativePosition pdr_data = 5; + */ + public com.openpositioning.PositionMe.Traj.RelativePositionOrBuilder getPdrDataOrBuilder( + int index) { + if (pdrDataBuilder_ == null) { + return pdrData_.get(index); } else { + return pdrDataBuilder_.getMessageOrBuilder(index); + } + } + /** + * repeated .RelativePosition pdr_data = 5; + */ + public java.util.List + getPdrDataOrBuilderList() { + if (pdrDataBuilder_ != null) { + return pdrDataBuilder_.getMessageOrBuilderList(); + } else { + return java.util.Collections.unmodifiableList(pdrData_); + } + } + /** + * repeated .RelativePosition pdr_data = 5; + */ + public com.openpositioning.PositionMe.Traj.RelativePosition.Builder addPdrDataBuilder() { + return getPdrDataFieldBuilder().addBuilder( + com.openpositioning.PositionMe.Traj.RelativePosition.getDefaultInstance()); + } + /** + * repeated .RelativePosition pdr_data = 5; + */ + public com.openpositioning.PositionMe.Traj.RelativePosition.Builder addPdrDataBuilder( + int index) { + return getPdrDataFieldBuilder().addBuilder( + index, com.openpositioning.PositionMe.Traj.RelativePosition.getDefaultInstance()); + } + /** + * repeated .RelativePosition pdr_data = 5; + */ + public java.util.List + getPdrDataBuilderList() { + return getPdrDataFieldBuilder().getBuilderList(); + } + private com.google.protobuf.RepeatedFieldBuilder< + com.openpositioning.PositionMe.Traj.RelativePosition, com.openpositioning.PositionMe.Traj.RelativePosition.Builder, com.openpositioning.PositionMe.Traj.RelativePositionOrBuilder> + getPdrDataFieldBuilder() { + if (pdrDataBuilder_ == null) { + pdrDataBuilder_ = new com.google.protobuf.RepeatedFieldBuilder< + com.openpositioning.PositionMe.Traj.RelativePosition, com.openpositioning.PositionMe.Traj.RelativePosition.Builder, com.openpositioning.PositionMe.Traj.RelativePositionOrBuilder>( + pdrData_, + ((bitField0_ & 0x00000010) != 0), + getParentForChildren(), + isClean()); + pdrData_ = null; + } + return pdrDataBuilder_; + } + + private java.util.List magnetometerData_ = + java.util.Collections.emptyList(); + private void ensureMagnetometerDataIsMutable() { + if (!((bitField0_ & 0x00000020) != 0)) { + magnetometerData_ = new java.util.ArrayList(magnetometerData_); + bitField0_ |= 0x00000020; + } + } + + private com.google.protobuf.RepeatedFieldBuilder< + com.openpositioning.PositionMe.Traj.MagnetometerReading, com.openpositioning.PositionMe.Traj.MagnetometerReading.Builder, com.openpositioning.PositionMe.Traj.MagnetometerReadingOrBuilder> magnetometerDataBuilder_; + + /** + * repeated .MagnetometerReading magnetometer_data = 6; + */ + public java.util.List getMagnetometerDataList() { + if (magnetometerDataBuilder_ == null) { + return java.util.Collections.unmodifiableList(magnetometerData_); + } else { + return magnetometerDataBuilder_.getMessageList(); + } + } + /** + * repeated .MagnetometerReading magnetometer_data = 6; + */ + public int getMagnetometerDataCount() { + if (magnetometerDataBuilder_ == null) { + return magnetometerData_.size(); + } else { + return magnetometerDataBuilder_.getCount(); + } + } + /** + * repeated .MagnetometerReading magnetometer_data = 6; + */ + public com.openpositioning.PositionMe.Traj.MagnetometerReading getMagnetometerData(int index) { + if (magnetometerDataBuilder_ == null) { + return magnetometerData_.get(index); + } else { + return magnetometerDataBuilder_.getMessage(index); + } + } + /** + * repeated .MagnetometerReading magnetometer_data = 6; + */ + public Builder setMagnetometerData( + int index, com.openpositioning.PositionMe.Traj.MagnetometerReading value) { + if (magnetometerDataBuilder_ == null) { + if (value == null) { + throw new NullPointerException(); + } + ensureMagnetometerDataIsMutable(); + magnetometerData_.set(index, value); + onChanged(); + } else { + magnetometerDataBuilder_.setMessage(index, value); + } + return this; + } + /** + * repeated .MagnetometerReading magnetometer_data = 6; + */ + public Builder setMagnetometerData( + int index, com.openpositioning.PositionMe.Traj.MagnetometerReading.Builder builderForValue) { + if (magnetometerDataBuilder_ == null) { + ensureMagnetometerDataIsMutable(); + magnetometerData_.set(index, builderForValue.build()); + onChanged(); + } else { + magnetometerDataBuilder_.setMessage(index, builderForValue.build()); + } + return this; + } + /** + * repeated .MagnetometerReading magnetometer_data = 6; + */ + public Builder addMagnetometerData(com.openpositioning.PositionMe.Traj.MagnetometerReading value) { + if (magnetometerDataBuilder_ == null) { + if (value == null) { + throw new NullPointerException(); + } + ensureMagnetometerDataIsMutable(); + magnetometerData_.add(value); + onChanged(); + } else { + magnetometerDataBuilder_.addMessage(value); + } + return this; + } + /** + * repeated .MagnetometerReading magnetometer_data = 6; + */ + public Builder addMagnetometerData( + int index, com.openpositioning.PositionMe.Traj.MagnetometerReading value) { + if (magnetometerDataBuilder_ == null) { + if (value == null) { + throw new NullPointerException(); + } + ensureMagnetometerDataIsMutable(); + magnetometerData_.add(index, value); + onChanged(); + } else { + magnetometerDataBuilder_.addMessage(index, value); + } + return this; + } + /** + * repeated .MagnetometerReading magnetometer_data = 6; + */ + public Builder addMagnetometerData( + com.openpositioning.PositionMe.Traj.MagnetometerReading.Builder builderForValue) { + if (magnetometerDataBuilder_ == null) { + ensureMagnetometerDataIsMutable(); + magnetometerData_.add(builderForValue.build()); + onChanged(); + } else { + magnetometerDataBuilder_.addMessage(builderForValue.build()); + } + return this; + } + /** + * repeated .MagnetometerReading magnetometer_data = 6; + */ + public Builder addMagnetometerData( + int index, com.openpositioning.PositionMe.Traj.MagnetometerReading.Builder builderForValue) { + if (magnetometerDataBuilder_ == null) { + ensureMagnetometerDataIsMutable(); + magnetometerData_.add(index, builderForValue.build()); + onChanged(); + } else { + magnetometerDataBuilder_.addMessage(index, builderForValue.build()); + } + return this; + } + /** + * repeated .MagnetometerReading magnetometer_data = 6; + */ + public Builder addAllMagnetometerData( + java.lang.Iterable values) { + if (magnetometerDataBuilder_ == null) { + ensureMagnetometerDataIsMutable(); + com.google.protobuf.AbstractMessageLite.Builder.addAll( + values, magnetometerData_); + onChanged(); + } else { + magnetometerDataBuilder_.addAllMessages(values); + } + return this; + } + /** + * repeated .MagnetometerReading magnetometer_data = 6; + */ + public Builder clearMagnetometerData() { + if (magnetometerDataBuilder_ == null) { + magnetometerData_ = java.util.Collections.emptyList(); + bitField0_ = (bitField0_ & ~0x00000020); + onChanged(); + } else { + magnetometerDataBuilder_.clear(); + } + return this; + } + /** + * repeated .MagnetometerReading magnetometer_data = 6; + */ + public Builder removeMagnetometerData(int index) { + if (magnetometerDataBuilder_ == null) { + ensureMagnetometerDataIsMutable(); + magnetometerData_.remove(index); + onChanged(); + } else { + magnetometerDataBuilder_.remove(index); + } + return this; + } + /** + * repeated .MagnetometerReading magnetometer_data = 6; + */ + public com.openpositioning.PositionMe.Traj.MagnetometerReading.Builder getMagnetometerDataBuilder( + int index) { + return getMagnetometerDataFieldBuilder().getBuilder(index); + } + /** + * repeated .MagnetometerReading magnetometer_data = 6; + */ + public com.openpositioning.PositionMe.Traj.MagnetometerReadingOrBuilder getMagnetometerDataOrBuilder( + int index) { + if (magnetometerDataBuilder_ == null) { + return magnetometerData_.get(index); } else { + return magnetometerDataBuilder_.getMessageOrBuilder(index); + } + } + /** + * repeated .MagnetometerReading magnetometer_data = 6; + */ + public java.util.List + getMagnetometerDataOrBuilderList() { + if (magnetometerDataBuilder_ != null) { + return magnetometerDataBuilder_.getMessageOrBuilderList(); + } else { + return java.util.Collections.unmodifiableList(magnetometerData_); + } + } + /** + * repeated .MagnetometerReading magnetometer_data = 6; + */ + public com.openpositioning.PositionMe.Traj.MagnetometerReading.Builder addMagnetometerDataBuilder() { + return getMagnetometerDataFieldBuilder().addBuilder( + com.openpositioning.PositionMe.Traj.MagnetometerReading.getDefaultInstance()); + } + /** + * repeated .MagnetometerReading magnetometer_data = 6; + */ + public com.openpositioning.PositionMe.Traj.MagnetometerReading.Builder addMagnetometerDataBuilder( + int index) { + return getMagnetometerDataFieldBuilder().addBuilder( + index, com.openpositioning.PositionMe.Traj.MagnetometerReading.getDefaultInstance()); + } + /** + * repeated .MagnetometerReading magnetometer_data = 6; + */ + public java.util.List + getMagnetometerDataBuilderList() { + return getMagnetometerDataFieldBuilder().getBuilderList(); + } + private com.google.protobuf.RepeatedFieldBuilder< + com.openpositioning.PositionMe.Traj.MagnetometerReading, com.openpositioning.PositionMe.Traj.MagnetometerReading.Builder, com.openpositioning.PositionMe.Traj.MagnetometerReadingOrBuilder> + getMagnetometerDataFieldBuilder() { + if (magnetometerDataBuilder_ == null) { + magnetometerDataBuilder_ = new com.google.protobuf.RepeatedFieldBuilder< + com.openpositioning.PositionMe.Traj.MagnetometerReading, com.openpositioning.PositionMe.Traj.MagnetometerReading.Builder, com.openpositioning.PositionMe.Traj.MagnetometerReadingOrBuilder>( + magnetometerData_, + ((bitField0_ & 0x00000020) != 0), + getParentForChildren(), + isClean()); + magnetometerData_ = null; + } + return magnetometerDataBuilder_; + } + + private java.util.List pressureData_ = + java.util.Collections.emptyList(); + private void ensurePressureDataIsMutable() { + if (!((bitField0_ & 0x00000040) != 0)) { + pressureData_ = new java.util.ArrayList(pressureData_); + bitField0_ |= 0x00000040; + } + } + + private com.google.protobuf.RepeatedFieldBuilder< + com.openpositioning.PositionMe.Traj.BarometerReading, com.openpositioning.PositionMe.Traj.BarometerReading.Builder, com.openpositioning.PositionMe.Traj.BarometerReadingOrBuilder> pressureDataBuilder_; + + /** + * repeated .BarometerReading pressure_data = 7; + */ + public java.util.List getPressureDataList() { + if (pressureDataBuilder_ == null) { + return java.util.Collections.unmodifiableList(pressureData_); + } else { + return pressureDataBuilder_.getMessageList(); + } + } + /** + * repeated .BarometerReading pressure_data = 7; + */ + public int getPressureDataCount() { + if (pressureDataBuilder_ == null) { + return pressureData_.size(); + } else { + return pressureDataBuilder_.getCount(); + } + } + /** + * repeated .BarometerReading pressure_data = 7; + */ + public com.openpositioning.PositionMe.Traj.BarometerReading getPressureData(int index) { + if (pressureDataBuilder_ == null) { + return pressureData_.get(index); + } else { + return pressureDataBuilder_.getMessage(index); + } + } + /** + * repeated .BarometerReading pressure_data = 7; + */ + public Builder setPressureData( + int index, com.openpositioning.PositionMe.Traj.BarometerReading value) { + if (pressureDataBuilder_ == null) { + if (value == null) { + throw new NullPointerException(); + } + ensurePressureDataIsMutable(); + pressureData_.set(index, value); + onChanged(); + } else { + pressureDataBuilder_.setMessage(index, value); + } + return this; + } + /** + * repeated .BarometerReading pressure_data = 7; + */ + public Builder setPressureData( + int index, com.openpositioning.PositionMe.Traj.BarometerReading.Builder builderForValue) { + if (pressureDataBuilder_ == null) { + ensurePressureDataIsMutable(); + pressureData_.set(index, builderForValue.build()); + onChanged(); + } else { + pressureDataBuilder_.setMessage(index, builderForValue.build()); + } + return this; + } + /** + * repeated .BarometerReading pressure_data = 7; + */ + public Builder addPressureData(com.openpositioning.PositionMe.Traj.BarometerReading value) { + if (pressureDataBuilder_ == null) { + if (value == null) { + throw new NullPointerException(); + } + ensurePressureDataIsMutable(); + pressureData_.add(value); + onChanged(); + } else { + pressureDataBuilder_.addMessage(value); + } + return this; + } + /** + * repeated .BarometerReading pressure_data = 7; + */ + public Builder addPressureData( + int index, com.openpositioning.PositionMe.Traj.BarometerReading value) { + if (pressureDataBuilder_ == null) { + if (value == null) { + throw new NullPointerException(); + } + ensurePressureDataIsMutable(); + pressureData_.add(index, value); + onChanged(); + } else { + pressureDataBuilder_.addMessage(index, value); + } + return this; + } + /** + * repeated .BarometerReading pressure_data = 7; + */ + public Builder addPressureData( + com.openpositioning.PositionMe.Traj.BarometerReading.Builder builderForValue) { + if (pressureDataBuilder_ == null) { + ensurePressureDataIsMutable(); + pressureData_.add(builderForValue.build()); + onChanged(); + } else { + pressureDataBuilder_.addMessage(builderForValue.build()); + } + return this; + } + /** + * repeated .BarometerReading pressure_data = 7; + */ + public Builder addPressureData( + int index, com.openpositioning.PositionMe.Traj.BarometerReading.Builder builderForValue) { + if (pressureDataBuilder_ == null) { + ensurePressureDataIsMutable(); + pressureData_.add(index, builderForValue.build()); + onChanged(); + } else { + pressureDataBuilder_.addMessage(index, builderForValue.build()); + } + return this; + } + /** + * repeated .BarometerReading pressure_data = 7; + */ + public Builder addAllPressureData( + java.lang.Iterable values) { + if (pressureDataBuilder_ == null) { + ensurePressureDataIsMutable(); + com.google.protobuf.AbstractMessageLite.Builder.addAll( + values, pressureData_); + onChanged(); + } else { + pressureDataBuilder_.addAllMessages(values); + } + return this; + } + /** + * repeated .BarometerReading pressure_data = 7; + */ + public Builder clearPressureData() { + if (pressureDataBuilder_ == null) { + pressureData_ = java.util.Collections.emptyList(); + bitField0_ = (bitField0_ & ~0x00000040); + onChanged(); + } else { + pressureDataBuilder_.clear(); + } + return this; + } + /** + * repeated .BarometerReading pressure_data = 7; + */ + public Builder removePressureData(int index) { + if (pressureDataBuilder_ == null) { + ensurePressureDataIsMutable(); + pressureData_.remove(index); + onChanged(); + } else { + pressureDataBuilder_.remove(index); + } + return this; + } + /** + * repeated .BarometerReading pressure_data = 7; + */ + public com.openpositioning.PositionMe.Traj.BarometerReading.Builder getPressureDataBuilder( + int index) { + return getPressureDataFieldBuilder().getBuilder(index); + } + /** + * repeated .BarometerReading pressure_data = 7; + */ + public com.openpositioning.PositionMe.Traj.BarometerReadingOrBuilder getPressureDataOrBuilder( + int index) { + if (pressureDataBuilder_ == null) { + return pressureData_.get(index); } else { + return pressureDataBuilder_.getMessageOrBuilder(index); + } + } + /** + * repeated .BarometerReading pressure_data = 7; + */ + public java.util.List + getPressureDataOrBuilderList() { + if (pressureDataBuilder_ != null) { + return pressureDataBuilder_.getMessageOrBuilderList(); + } else { + return java.util.Collections.unmodifiableList(pressureData_); + } + } + /** + * repeated .BarometerReading pressure_data = 7; + */ + public com.openpositioning.PositionMe.Traj.BarometerReading.Builder addPressureDataBuilder() { + return getPressureDataFieldBuilder().addBuilder( + com.openpositioning.PositionMe.Traj.BarometerReading.getDefaultInstance()); + } + /** + * repeated .BarometerReading pressure_data = 7; + */ + public com.openpositioning.PositionMe.Traj.BarometerReading.Builder addPressureDataBuilder( + int index) { + return getPressureDataFieldBuilder().addBuilder( + index, com.openpositioning.PositionMe.Traj.BarometerReading.getDefaultInstance()); + } + /** + * repeated .BarometerReading pressure_data = 7; + */ + public java.util.List + getPressureDataBuilderList() { + return getPressureDataFieldBuilder().getBuilderList(); + } + private com.google.protobuf.RepeatedFieldBuilder< + com.openpositioning.PositionMe.Traj.BarometerReading, com.openpositioning.PositionMe.Traj.BarometerReading.Builder, com.openpositioning.PositionMe.Traj.BarometerReadingOrBuilder> + getPressureDataFieldBuilder() { + if (pressureDataBuilder_ == null) { + pressureDataBuilder_ = new com.google.protobuf.RepeatedFieldBuilder< + com.openpositioning.PositionMe.Traj.BarometerReading, com.openpositioning.PositionMe.Traj.BarometerReading.Builder, com.openpositioning.PositionMe.Traj.BarometerReadingOrBuilder>( + pressureData_, + ((bitField0_ & 0x00000040) != 0), + getParentForChildren(), + isClean()); + pressureData_ = null; + } + return pressureDataBuilder_; + } + + private java.util.List lightData_ = + java.util.Collections.emptyList(); + private void ensureLightDataIsMutable() { + if (!((bitField0_ & 0x00000080) != 0)) { + lightData_ = new java.util.ArrayList(lightData_); + bitField0_ |= 0x00000080; + } + } + + private com.google.protobuf.RepeatedFieldBuilder< + com.openpositioning.PositionMe.Traj.LightReading, com.openpositioning.PositionMe.Traj.LightReading.Builder, com.openpositioning.PositionMe.Traj.LightReadingOrBuilder> lightDataBuilder_; + + /** + * repeated .LightReading light_data = 8; + */ + public java.util.List getLightDataList() { + if (lightDataBuilder_ == null) { + return java.util.Collections.unmodifiableList(lightData_); + } else { + return lightDataBuilder_.getMessageList(); + } + } + /** + * repeated .LightReading light_data = 8; + */ + public int getLightDataCount() { + if (lightDataBuilder_ == null) { + return lightData_.size(); + } else { + return lightDataBuilder_.getCount(); + } + } + /** + * repeated .LightReading light_data = 8; + */ + public com.openpositioning.PositionMe.Traj.LightReading getLightData(int index) { + if (lightDataBuilder_ == null) { + return lightData_.get(index); + } else { + return lightDataBuilder_.getMessage(index); + } + } + /** + * repeated .LightReading light_data = 8; + */ + public Builder setLightData( + int index, com.openpositioning.PositionMe.Traj.LightReading value) { + if (lightDataBuilder_ == null) { + if (value == null) { + throw new NullPointerException(); + } + ensureLightDataIsMutable(); + lightData_.set(index, value); + onChanged(); + } else { + lightDataBuilder_.setMessage(index, value); + } + return this; + } + /** + * repeated .LightReading light_data = 8; + */ + public Builder setLightData( + int index, com.openpositioning.PositionMe.Traj.LightReading.Builder builderForValue) { + if (lightDataBuilder_ == null) { + ensureLightDataIsMutable(); + lightData_.set(index, builderForValue.build()); + onChanged(); + } else { + lightDataBuilder_.setMessage(index, builderForValue.build()); + } + return this; + } + /** + * repeated .LightReading light_data = 8; + */ + public Builder addLightData(com.openpositioning.PositionMe.Traj.LightReading value) { + if (lightDataBuilder_ == null) { + if (value == null) { + throw new NullPointerException(); + } + ensureLightDataIsMutable(); + lightData_.add(value); + onChanged(); + } else { + lightDataBuilder_.addMessage(value); + } + return this; + } + /** + * repeated .LightReading light_data = 8; + */ + public Builder addLightData( + int index, com.openpositioning.PositionMe.Traj.LightReading value) { + if (lightDataBuilder_ == null) { + if (value == null) { + throw new NullPointerException(); + } + ensureLightDataIsMutable(); + lightData_.add(index, value); + onChanged(); + } else { + lightDataBuilder_.addMessage(index, value); + } + return this; + } + /** + * repeated .LightReading light_data = 8; + */ + public Builder addLightData( + com.openpositioning.PositionMe.Traj.LightReading.Builder builderForValue) { + if (lightDataBuilder_ == null) { + ensureLightDataIsMutable(); + lightData_.add(builderForValue.build()); + onChanged(); + } else { + lightDataBuilder_.addMessage(builderForValue.build()); + } + return this; + } + /** + * repeated .LightReading light_data = 8; + */ + public Builder addLightData( + int index, com.openpositioning.PositionMe.Traj.LightReading.Builder builderForValue) { + if (lightDataBuilder_ == null) { + ensureLightDataIsMutable(); + lightData_.add(index, builderForValue.build()); + onChanged(); + } else { + lightDataBuilder_.addMessage(index, builderForValue.build()); + } + return this; + } + /** + * repeated .LightReading light_data = 8; + */ + public Builder addAllLightData( + java.lang.Iterable values) { + if (lightDataBuilder_ == null) { + ensureLightDataIsMutable(); + com.google.protobuf.AbstractMessageLite.Builder.addAll( + values, lightData_); + onChanged(); + } else { + lightDataBuilder_.addAllMessages(values); + } + return this; + } + /** + * repeated .LightReading light_data = 8; + */ + public Builder clearLightData() { + if (lightDataBuilder_ == null) { + lightData_ = java.util.Collections.emptyList(); + bitField0_ = (bitField0_ & ~0x00000080); + onChanged(); + } else { + lightDataBuilder_.clear(); + } + return this; + } + /** + * repeated .LightReading light_data = 8; + */ + public Builder removeLightData(int index) { + if (lightDataBuilder_ == null) { + ensureLightDataIsMutable(); + lightData_.remove(index); + onChanged(); + } else { + lightDataBuilder_.remove(index); + } + return this; + } + /** + * repeated .LightReading light_data = 8; + */ + public com.openpositioning.PositionMe.Traj.LightReading.Builder getLightDataBuilder( + int index) { + return getLightDataFieldBuilder().getBuilder(index); + } + /** + * repeated .LightReading light_data = 8; + */ + public com.openpositioning.PositionMe.Traj.LightReadingOrBuilder getLightDataOrBuilder( + int index) { + if (lightDataBuilder_ == null) { + return lightData_.get(index); } else { + return lightDataBuilder_.getMessageOrBuilder(index); + } + } + /** + * repeated .LightReading light_data = 8; + */ + public java.util.List + getLightDataOrBuilderList() { + if (lightDataBuilder_ != null) { + return lightDataBuilder_.getMessageOrBuilderList(); + } else { + return java.util.Collections.unmodifiableList(lightData_); + } + } + /** + * repeated .LightReading light_data = 8; + */ + public com.openpositioning.PositionMe.Traj.LightReading.Builder addLightDataBuilder() { + return getLightDataFieldBuilder().addBuilder( + com.openpositioning.PositionMe.Traj.LightReading.getDefaultInstance()); + } + /** + * repeated .LightReading light_data = 8; + */ + public com.openpositioning.PositionMe.Traj.LightReading.Builder addLightDataBuilder( + int index) { + return getLightDataFieldBuilder().addBuilder( + index, com.openpositioning.PositionMe.Traj.LightReading.getDefaultInstance()); + } + /** + * repeated .LightReading light_data = 8; + */ + public java.util.List + getLightDataBuilderList() { + return getLightDataFieldBuilder().getBuilderList(); + } + private com.google.protobuf.RepeatedFieldBuilder< + com.openpositioning.PositionMe.Traj.LightReading, com.openpositioning.PositionMe.Traj.LightReading.Builder, com.openpositioning.PositionMe.Traj.LightReadingOrBuilder> + getLightDataFieldBuilder() { + if (lightDataBuilder_ == null) { + lightDataBuilder_ = new com.google.protobuf.RepeatedFieldBuilder< + com.openpositioning.PositionMe.Traj.LightReading, com.openpositioning.PositionMe.Traj.LightReading.Builder, com.openpositioning.PositionMe.Traj.LightReadingOrBuilder>( + lightData_, + ((bitField0_ & 0x00000080) != 0), + getParentForChildren(), + isClean()); + lightData_ = null; + } + return lightDataBuilder_; + } + + private java.util.List proximityData_ = + java.util.Collections.emptyList(); + private void ensureProximityDataIsMutable() { + if (!((bitField0_ & 0x00000100) != 0)) { + proximityData_ = new java.util.ArrayList(proximityData_); + bitField0_ |= 0x00000100; + } + } + + private com.google.protobuf.RepeatedFieldBuilder< + com.openpositioning.PositionMe.Traj.ProximityReading, com.openpositioning.PositionMe.Traj.ProximityReading.Builder, com.openpositioning.PositionMe.Traj.ProximityReadingOrBuilder> proximityDataBuilder_; + + /** + * repeated .ProximityReading proximity_data = 9; + */ + public java.util.List getProximityDataList() { + if (proximityDataBuilder_ == null) { + return java.util.Collections.unmodifiableList(proximityData_); + } else { + return proximityDataBuilder_.getMessageList(); + } + } + /** + * repeated .ProximityReading proximity_data = 9; + */ + public int getProximityDataCount() { + if (proximityDataBuilder_ == null) { + return proximityData_.size(); + } else { + return proximityDataBuilder_.getCount(); + } + } + /** + * repeated .ProximityReading proximity_data = 9; + */ + public com.openpositioning.PositionMe.Traj.ProximityReading getProximityData(int index) { + if (proximityDataBuilder_ == null) { + return proximityData_.get(index); + } else { + return proximityDataBuilder_.getMessage(index); + } + } + /** + * repeated .ProximityReading proximity_data = 9; + */ + public Builder setProximityData( + int index, com.openpositioning.PositionMe.Traj.ProximityReading value) { + if (proximityDataBuilder_ == null) { + if (value == null) { + throw new NullPointerException(); + } + ensureProximityDataIsMutable(); + proximityData_.set(index, value); + onChanged(); + } else { + proximityDataBuilder_.setMessage(index, value); + } + return this; + } + /** + * repeated .ProximityReading proximity_data = 9; + */ + public Builder setProximityData( + int index, com.openpositioning.PositionMe.Traj.ProximityReading.Builder builderForValue) { + if (proximityDataBuilder_ == null) { + ensureProximityDataIsMutable(); + proximityData_.set(index, builderForValue.build()); + onChanged(); + } else { + proximityDataBuilder_.setMessage(index, builderForValue.build()); + } + return this; + } + /** + * repeated .ProximityReading proximity_data = 9; + */ + public Builder addProximityData(com.openpositioning.PositionMe.Traj.ProximityReading value) { + if (proximityDataBuilder_ == null) { + if (value == null) { + throw new NullPointerException(); + } + ensureProximityDataIsMutable(); + proximityData_.add(value); + onChanged(); + } else { + proximityDataBuilder_.addMessage(value); + } + return this; + } + /** + * repeated .ProximityReading proximity_data = 9; + */ + public Builder addProximityData( + int index, com.openpositioning.PositionMe.Traj.ProximityReading value) { + if (proximityDataBuilder_ == null) { + if (value == null) { + throw new NullPointerException(); + } + ensureProximityDataIsMutable(); + proximityData_.add(index, value); + onChanged(); + } else { + proximityDataBuilder_.addMessage(index, value); + } + return this; + } + /** + * repeated .ProximityReading proximity_data = 9; + */ + public Builder addProximityData( + com.openpositioning.PositionMe.Traj.ProximityReading.Builder builderForValue) { + if (proximityDataBuilder_ == null) { + ensureProximityDataIsMutable(); + proximityData_.add(builderForValue.build()); + onChanged(); + } else { + proximityDataBuilder_.addMessage(builderForValue.build()); + } + return this; + } + /** + * repeated .ProximityReading proximity_data = 9; + */ + public Builder addProximityData( + int index, com.openpositioning.PositionMe.Traj.ProximityReading.Builder builderForValue) { + if (proximityDataBuilder_ == null) { + ensureProximityDataIsMutable(); + proximityData_.add(index, builderForValue.build()); + onChanged(); + } else { + proximityDataBuilder_.addMessage(index, builderForValue.build()); + } + return this; + } + /** + * repeated .ProximityReading proximity_data = 9; + */ + public Builder addAllProximityData( + java.lang.Iterable values) { + if (proximityDataBuilder_ == null) { + ensureProximityDataIsMutable(); + com.google.protobuf.AbstractMessageLite.Builder.addAll( + values, proximityData_); + onChanged(); + } else { + proximityDataBuilder_.addAllMessages(values); + } + return this; + } + /** + * repeated .ProximityReading proximity_data = 9; + */ + public Builder clearProximityData() { + if (proximityDataBuilder_ == null) { + proximityData_ = java.util.Collections.emptyList(); + bitField0_ = (bitField0_ & ~0x00000100); + onChanged(); + } else { + proximityDataBuilder_.clear(); + } + return this; + } + /** + * repeated .ProximityReading proximity_data = 9; + */ + public Builder removeProximityData(int index) { + if (proximityDataBuilder_ == null) { + ensureProximityDataIsMutable(); + proximityData_.remove(index); + onChanged(); + } else { + proximityDataBuilder_.remove(index); + } + return this; + } + /** + * repeated .ProximityReading proximity_data = 9; + */ + public com.openpositioning.PositionMe.Traj.ProximityReading.Builder getProximityDataBuilder( + int index) { + return getProximityDataFieldBuilder().getBuilder(index); + } + /** + * repeated .ProximityReading proximity_data = 9; + */ + public com.openpositioning.PositionMe.Traj.ProximityReadingOrBuilder getProximityDataOrBuilder( + int index) { + if (proximityDataBuilder_ == null) { + return proximityData_.get(index); } else { + return proximityDataBuilder_.getMessageOrBuilder(index); + } + } + /** + * repeated .ProximityReading proximity_data = 9; + */ + public java.util.List + getProximityDataOrBuilderList() { + if (proximityDataBuilder_ != null) { + return proximityDataBuilder_.getMessageOrBuilderList(); + } else { + return java.util.Collections.unmodifiableList(proximityData_); + } + } + /** + * repeated .ProximityReading proximity_data = 9; + */ + public com.openpositioning.PositionMe.Traj.ProximityReading.Builder addProximityDataBuilder() { + return getProximityDataFieldBuilder().addBuilder( + com.openpositioning.PositionMe.Traj.ProximityReading.getDefaultInstance()); + } + /** + * repeated .ProximityReading proximity_data = 9; + */ + public com.openpositioning.PositionMe.Traj.ProximityReading.Builder addProximityDataBuilder( + int index) { + return getProximityDataFieldBuilder().addBuilder( + index, com.openpositioning.PositionMe.Traj.ProximityReading.getDefaultInstance()); + } + /** + * repeated .ProximityReading proximity_data = 9; + */ + public java.util.List + getProximityDataBuilderList() { + return getProximityDataFieldBuilder().getBuilderList(); + } + private com.google.protobuf.RepeatedFieldBuilder< + com.openpositioning.PositionMe.Traj.ProximityReading, com.openpositioning.PositionMe.Traj.ProximityReading.Builder, com.openpositioning.PositionMe.Traj.ProximityReadingOrBuilder> + getProximityDataFieldBuilder() { + if (proximityDataBuilder_ == null) { + proximityDataBuilder_ = new com.google.protobuf.RepeatedFieldBuilder< + com.openpositioning.PositionMe.Traj.ProximityReading, com.openpositioning.PositionMe.Traj.ProximityReading.Builder, com.openpositioning.PositionMe.Traj.ProximityReadingOrBuilder>( + proximityData_, + ((bitField0_ & 0x00000100) != 0), + getParentForChildren(), + isClean()); + proximityData_ = null; + } + return proximityDataBuilder_; + } + + private java.util.List gnssData_ = + java.util.Collections.emptyList(); + private void ensureGnssDataIsMutable() { + if (!((bitField0_ & 0x00000200) != 0)) { + gnssData_ = new java.util.ArrayList(gnssData_); + bitField0_ |= 0x00000200; + } + } + + private com.google.protobuf.RepeatedFieldBuilder< + com.openpositioning.PositionMe.Traj.GNSSReading, com.openpositioning.PositionMe.Traj.GNSSReading.Builder, com.openpositioning.PositionMe.Traj.GNSSReadingOrBuilder> gnssDataBuilder_; + + /** + * repeated .GNSSReading gnss_data = 10; + */ + public java.util.List getGnssDataList() { + if (gnssDataBuilder_ == null) { + return java.util.Collections.unmodifiableList(gnssData_); + } else { + return gnssDataBuilder_.getMessageList(); + } + } + /** + * repeated .GNSSReading gnss_data = 10; + */ + public int getGnssDataCount() { + if (gnssDataBuilder_ == null) { + return gnssData_.size(); + } else { + return gnssDataBuilder_.getCount(); + } + } + /** + * repeated .GNSSReading gnss_data = 10; + */ + public com.openpositioning.PositionMe.Traj.GNSSReading getGnssData(int index) { + if (gnssDataBuilder_ == null) { + return gnssData_.get(index); + } else { + return gnssDataBuilder_.getMessage(index); + } + } + /** + * repeated .GNSSReading gnss_data = 10; + */ + public Builder setGnssData( + int index, com.openpositioning.PositionMe.Traj.GNSSReading value) { + if (gnssDataBuilder_ == null) { + if (value == null) { + throw new NullPointerException(); + } + ensureGnssDataIsMutable(); + gnssData_.set(index, value); + onChanged(); + } else { + gnssDataBuilder_.setMessage(index, value); + } + return this; + } + /** + * repeated .GNSSReading gnss_data = 10; + */ + public Builder setGnssData( + int index, com.openpositioning.PositionMe.Traj.GNSSReading.Builder builderForValue) { + if (gnssDataBuilder_ == null) { + ensureGnssDataIsMutable(); + gnssData_.set(index, builderForValue.build()); + onChanged(); + } else { + gnssDataBuilder_.setMessage(index, builderForValue.build()); + } + return this; + } + /** + * repeated .GNSSReading gnss_data = 10; + */ + public Builder addGnssData(com.openpositioning.PositionMe.Traj.GNSSReading value) { + if (gnssDataBuilder_ == null) { + if (value == null) { + throw new NullPointerException(); + } + ensureGnssDataIsMutable(); + gnssData_.add(value); + onChanged(); + } else { + gnssDataBuilder_.addMessage(value); + } + return this; + } + /** + * repeated .GNSSReading gnss_data = 10; + */ + public Builder addGnssData( + int index, com.openpositioning.PositionMe.Traj.GNSSReading value) { + if (gnssDataBuilder_ == null) { + if (value == null) { + throw new NullPointerException(); + } + ensureGnssDataIsMutable(); + gnssData_.add(index, value); + onChanged(); + } else { + gnssDataBuilder_.addMessage(index, value); + } + return this; + } + /** + * repeated .GNSSReading gnss_data = 10; + */ + public Builder addGnssData( + com.openpositioning.PositionMe.Traj.GNSSReading.Builder builderForValue) { + if (gnssDataBuilder_ == null) { + ensureGnssDataIsMutable(); + gnssData_.add(builderForValue.build()); + onChanged(); + } else { + gnssDataBuilder_.addMessage(builderForValue.build()); + } + return this; + } + /** + * repeated .GNSSReading gnss_data = 10; + */ + public Builder addGnssData( + int index, com.openpositioning.PositionMe.Traj.GNSSReading.Builder builderForValue) { + if (gnssDataBuilder_ == null) { + ensureGnssDataIsMutable(); + gnssData_.add(index, builderForValue.build()); + onChanged(); + } else { + gnssDataBuilder_.addMessage(index, builderForValue.build()); + } + return this; + } + /** + * repeated .GNSSReading gnss_data = 10; + */ + public Builder addAllGnssData( + java.lang.Iterable values) { + if (gnssDataBuilder_ == null) { + ensureGnssDataIsMutable(); + com.google.protobuf.AbstractMessageLite.Builder.addAll( + values, gnssData_); + onChanged(); + } else { + gnssDataBuilder_.addAllMessages(values); + } + return this; + } + /** + * repeated .GNSSReading gnss_data = 10; + */ + public Builder clearGnssData() { + if (gnssDataBuilder_ == null) { + gnssData_ = java.util.Collections.emptyList(); + bitField0_ = (bitField0_ & ~0x00000200); + onChanged(); + } else { + gnssDataBuilder_.clear(); + } + return this; + } + /** + * repeated .GNSSReading gnss_data = 10; + */ + public Builder removeGnssData(int index) { + if (gnssDataBuilder_ == null) { + ensureGnssDataIsMutable(); + gnssData_.remove(index); + onChanged(); + } else { + gnssDataBuilder_.remove(index); + } + return this; + } + /** + * repeated .GNSSReading gnss_data = 10; + */ + public com.openpositioning.PositionMe.Traj.GNSSReading.Builder getGnssDataBuilder( + int index) { + return getGnssDataFieldBuilder().getBuilder(index); + } + /** + * repeated .GNSSReading gnss_data = 10; + */ + public com.openpositioning.PositionMe.Traj.GNSSReadingOrBuilder getGnssDataOrBuilder( + int index) { + if (gnssDataBuilder_ == null) { + return gnssData_.get(index); } else { + return gnssDataBuilder_.getMessageOrBuilder(index); + } + } + /** + * repeated .GNSSReading gnss_data = 10; + */ + public java.util.List + getGnssDataOrBuilderList() { + if (gnssDataBuilder_ != null) { + return gnssDataBuilder_.getMessageOrBuilderList(); + } else { + return java.util.Collections.unmodifiableList(gnssData_); + } + } + /** + * repeated .GNSSReading gnss_data = 10; + */ + public com.openpositioning.PositionMe.Traj.GNSSReading.Builder addGnssDataBuilder() { + return getGnssDataFieldBuilder().addBuilder( + com.openpositioning.PositionMe.Traj.GNSSReading.getDefaultInstance()); + } + /** + * repeated .GNSSReading gnss_data = 10; + */ + public com.openpositioning.PositionMe.Traj.GNSSReading.Builder addGnssDataBuilder( + int index) { + return getGnssDataFieldBuilder().addBuilder( + index, com.openpositioning.PositionMe.Traj.GNSSReading.getDefaultInstance()); + } + /** + * repeated .GNSSReading gnss_data = 10; + */ + public java.util.List + getGnssDataBuilderList() { + return getGnssDataFieldBuilder().getBuilderList(); + } + private com.google.protobuf.RepeatedFieldBuilder< + com.openpositioning.PositionMe.Traj.GNSSReading, com.openpositioning.PositionMe.Traj.GNSSReading.Builder, com.openpositioning.PositionMe.Traj.GNSSReadingOrBuilder> + getGnssDataFieldBuilder() { + if (gnssDataBuilder_ == null) { + gnssDataBuilder_ = new com.google.protobuf.RepeatedFieldBuilder< + com.openpositioning.PositionMe.Traj.GNSSReading, com.openpositioning.PositionMe.Traj.GNSSReading.Builder, com.openpositioning.PositionMe.Traj.GNSSReadingOrBuilder>( + gnssData_, + ((bitField0_ & 0x00000200) != 0), + getParentForChildren(), + isClean()); + gnssData_ = null; + } + return gnssDataBuilder_; + } + + private java.util.List wifiFingerprints_ = + java.util.Collections.emptyList(); + private void ensureWifiFingerprintsIsMutable() { + if (!((bitField0_ & 0x00000400) != 0)) { + wifiFingerprints_ = new java.util.ArrayList(wifiFingerprints_); + bitField0_ |= 0x00000400; + } + } + + private com.google.protobuf.RepeatedFieldBuilder< + com.openpositioning.PositionMe.Traj.Fingerprint, com.openpositioning.PositionMe.Traj.Fingerprint.Builder, com.openpositioning.PositionMe.Traj.FingerprintOrBuilder> wifiFingerprintsBuilder_; + + /** + * repeated .Fingerprint wifi_fingerprints = 11; + */ + public java.util.List getWifiFingerprintsList() { + if (wifiFingerprintsBuilder_ == null) { + return java.util.Collections.unmodifiableList(wifiFingerprints_); + } else { + return wifiFingerprintsBuilder_.getMessageList(); + } + } + /** + * repeated .Fingerprint wifi_fingerprints = 11; + */ + public int getWifiFingerprintsCount() { + if (wifiFingerprintsBuilder_ == null) { + return wifiFingerprints_.size(); + } else { + return wifiFingerprintsBuilder_.getCount(); + } + } + /** + * repeated .Fingerprint wifi_fingerprints = 11; + */ + public com.openpositioning.PositionMe.Traj.Fingerprint getWifiFingerprints(int index) { + if (wifiFingerprintsBuilder_ == null) { + return wifiFingerprints_.get(index); + } else { + return wifiFingerprintsBuilder_.getMessage(index); + } + } + /** + * repeated .Fingerprint wifi_fingerprints = 11; + */ + public Builder setWifiFingerprints( + int index, com.openpositioning.PositionMe.Traj.Fingerprint value) { + if (wifiFingerprintsBuilder_ == null) { + if (value == null) { + throw new NullPointerException(); + } + ensureWifiFingerprintsIsMutable(); + wifiFingerprints_.set(index, value); + onChanged(); + } else { + wifiFingerprintsBuilder_.setMessage(index, value); + } + return this; + } + /** + * repeated .Fingerprint wifi_fingerprints = 11; + */ + public Builder setWifiFingerprints( + int index, com.openpositioning.PositionMe.Traj.Fingerprint.Builder builderForValue) { + if (wifiFingerprintsBuilder_ == null) { + ensureWifiFingerprintsIsMutable(); + wifiFingerprints_.set(index, builderForValue.build()); + onChanged(); + } else { + wifiFingerprintsBuilder_.setMessage(index, builderForValue.build()); + } + return this; + } + /** + * repeated .Fingerprint wifi_fingerprints = 11; + */ + public Builder addWifiFingerprints(com.openpositioning.PositionMe.Traj.Fingerprint value) { + if (wifiFingerprintsBuilder_ == null) { + if (value == null) { + throw new NullPointerException(); + } + ensureWifiFingerprintsIsMutable(); + wifiFingerprints_.add(value); + onChanged(); + } else { + wifiFingerprintsBuilder_.addMessage(value); + } + return this; + } + /** + * repeated .Fingerprint wifi_fingerprints = 11; + */ + public Builder addWifiFingerprints( + int index, com.openpositioning.PositionMe.Traj.Fingerprint value) { + if (wifiFingerprintsBuilder_ == null) { + if (value == null) { + throw new NullPointerException(); + } + ensureWifiFingerprintsIsMutable(); + wifiFingerprints_.add(index, value); + onChanged(); + } else { + wifiFingerprintsBuilder_.addMessage(index, value); + } + return this; + } + /** + * repeated .Fingerprint wifi_fingerprints = 11; + */ + public Builder addWifiFingerprints( + com.openpositioning.PositionMe.Traj.Fingerprint.Builder builderForValue) { + if (wifiFingerprintsBuilder_ == null) { + ensureWifiFingerprintsIsMutable(); + wifiFingerprints_.add(builderForValue.build()); + onChanged(); + } else { + wifiFingerprintsBuilder_.addMessage(builderForValue.build()); + } + return this; + } + /** + * repeated .Fingerprint wifi_fingerprints = 11; + */ + public Builder addWifiFingerprints( + int index, com.openpositioning.PositionMe.Traj.Fingerprint.Builder builderForValue) { + if (wifiFingerprintsBuilder_ == null) { + ensureWifiFingerprintsIsMutable(); + wifiFingerprints_.add(index, builderForValue.build()); + onChanged(); + } else { + wifiFingerprintsBuilder_.addMessage(index, builderForValue.build()); + } + return this; + } + /** + * repeated .Fingerprint wifi_fingerprints = 11; + */ + public Builder addAllWifiFingerprints( + java.lang.Iterable values) { + if (wifiFingerprintsBuilder_ == null) { + ensureWifiFingerprintsIsMutable(); + com.google.protobuf.AbstractMessageLite.Builder.addAll( + values, wifiFingerprints_); + onChanged(); + } else { + wifiFingerprintsBuilder_.addAllMessages(values); + } + return this; + } + /** + * repeated .Fingerprint wifi_fingerprints = 11; + */ + public Builder clearWifiFingerprints() { + if (wifiFingerprintsBuilder_ == null) { + wifiFingerprints_ = java.util.Collections.emptyList(); + bitField0_ = (bitField0_ & ~0x00000400); + onChanged(); + } else { + wifiFingerprintsBuilder_.clear(); + } + return this; + } + /** + * repeated .Fingerprint wifi_fingerprints = 11; + */ + public Builder removeWifiFingerprints(int index) { + if (wifiFingerprintsBuilder_ == null) { + ensureWifiFingerprintsIsMutable(); + wifiFingerprints_.remove(index); + onChanged(); + } else { + wifiFingerprintsBuilder_.remove(index); + } + return this; + } + /** + * repeated .Fingerprint wifi_fingerprints = 11; + */ + public com.openpositioning.PositionMe.Traj.Fingerprint.Builder getWifiFingerprintsBuilder( + int index) { + return getWifiFingerprintsFieldBuilder().getBuilder(index); + } + /** + * repeated .Fingerprint wifi_fingerprints = 11; + */ + public com.openpositioning.PositionMe.Traj.FingerprintOrBuilder getWifiFingerprintsOrBuilder( + int index) { + if (wifiFingerprintsBuilder_ == null) { + return wifiFingerprints_.get(index); } else { + return wifiFingerprintsBuilder_.getMessageOrBuilder(index); + } + } + /** + * repeated .Fingerprint wifi_fingerprints = 11; + */ + public java.util.List + getWifiFingerprintsOrBuilderList() { + if (wifiFingerprintsBuilder_ != null) { + return wifiFingerprintsBuilder_.getMessageOrBuilderList(); + } else { + return java.util.Collections.unmodifiableList(wifiFingerprints_); + } + } + /** + * repeated .Fingerprint wifi_fingerprints = 11; + */ + public com.openpositioning.PositionMe.Traj.Fingerprint.Builder addWifiFingerprintsBuilder() { + return getWifiFingerprintsFieldBuilder().addBuilder( + com.openpositioning.PositionMe.Traj.Fingerprint.getDefaultInstance()); + } + /** + * repeated .Fingerprint wifi_fingerprints = 11; + */ + public com.openpositioning.PositionMe.Traj.Fingerprint.Builder addWifiFingerprintsBuilder( + int index) { + return getWifiFingerprintsFieldBuilder().addBuilder( + index, com.openpositioning.PositionMe.Traj.Fingerprint.getDefaultInstance()); + } + /** + * repeated .Fingerprint wifi_fingerprints = 11; + */ + public java.util.List + getWifiFingerprintsBuilderList() { + return getWifiFingerprintsFieldBuilder().getBuilderList(); + } + private com.google.protobuf.RepeatedFieldBuilder< + com.openpositioning.PositionMe.Traj.Fingerprint, com.openpositioning.PositionMe.Traj.Fingerprint.Builder, com.openpositioning.PositionMe.Traj.FingerprintOrBuilder> + getWifiFingerprintsFieldBuilder() { + if (wifiFingerprintsBuilder_ == null) { + wifiFingerprintsBuilder_ = new com.google.protobuf.RepeatedFieldBuilder< + com.openpositioning.PositionMe.Traj.Fingerprint, com.openpositioning.PositionMe.Traj.Fingerprint.Builder, com.openpositioning.PositionMe.Traj.FingerprintOrBuilder>( + wifiFingerprints_, + ((bitField0_ & 0x00000400) != 0), + getParentForChildren(), + isClean()); + wifiFingerprints_ = null; + } + return wifiFingerprintsBuilder_; + } + + private java.util.List apsData_ = + java.util.Collections.emptyList(); + private void ensureApsDataIsMutable() { + if (!((bitField0_ & 0x00000800) != 0)) { + apsData_ = new java.util.ArrayList(apsData_); + bitField0_ |= 0x00000800; + } + } + + private com.google.protobuf.RepeatedFieldBuilder< + com.openpositioning.PositionMe.Traj.WiFiAPData, com.openpositioning.PositionMe.Traj.WiFiAPData.Builder, com.openpositioning.PositionMe.Traj.WiFiAPDataOrBuilder> apsDataBuilder_; + + /** + * repeated .WiFiAPData aps_data = 12; + */ + public java.util.List getApsDataList() { + if (apsDataBuilder_ == null) { + return java.util.Collections.unmodifiableList(apsData_); + } else { + return apsDataBuilder_.getMessageList(); + } + } + /** + * repeated .WiFiAPData aps_data = 12; + */ + public int getApsDataCount() { + if (apsDataBuilder_ == null) { + return apsData_.size(); + } else { + return apsDataBuilder_.getCount(); + } + } + /** + * repeated .WiFiAPData aps_data = 12; + */ + public com.openpositioning.PositionMe.Traj.WiFiAPData getApsData(int index) { + if (apsDataBuilder_ == null) { + return apsData_.get(index); + } else { + return apsDataBuilder_.getMessage(index); + } + } + /** + * repeated .WiFiAPData aps_data = 12; + */ + public Builder setApsData( + int index, com.openpositioning.PositionMe.Traj.WiFiAPData value) { + if (apsDataBuilder_ == null) { + if (value == null) { + throw new NullPointerException(); + } + ensureApsDataIsMutable(); + apsData_.set(index, value); + onChanged(); + } else { + apsDataBuilder_.setMessage(index, value); + } + return this; + } + /** + * repeated .WiFiAPData aps_data = 12; + */ + public Builder setApsData( + int index, com.openpositioning.PositionMe.Traj.WiFiAPData.Builder builderForValue) { + if (apsDataBuilder_ == null) { + ensureApsDataIsMutable(); + apsData_.set(index, builderForValue.build()); + onChanged(); + } else { + apsDataBuilder_.setMessage(index, builderForValue.build()); + } + return this; + } + /** + * repeated .WiFiAPData aps_data = 12; + */ + public Builder addApsData(com.openpositioning.PositionMe.Traj.WiFiAPData value) { + if (apsDataBuilder_ == null) { + if (value == null) { + throw new NullPointerException(); + } + ensureApsDataIsMutable(); + apsData_.add(value); + onChanged(); + } else { + apsDataBuilder_.addMessage(value); + } + return this; + } + /** + * repeated .WiFiAPData aps_data = 12; + */ + public Builder addApsData( + int index, com.openpositioning.PositionMe.Traj.WiFiAPData value) { + if (apsDataBuilder_ == null) { + if (value == null) { + throw new NullPointerException(); + } + ensureApsDataIsMutable(); + apsData_.add(index, value); + onChanged(); + } else { + apsDataBuilder_.addMessage(index, value); + } + return this; + } + /** + * repeated .WiFiAPData aps_data = 12; + */ + public Builder addApsData( + com.openpositioning.PositionMe.Traj.WiFiAPData.Builder builderForValue) { + if (apsDataBuilder_ == null) { + ensureApsDataIsMutable(); + apsData_.add(builderForValue.build()); + onChanged(); + } else { + apsDataBuilder_.addMessage(builderForValue.build()); + } + return this; + } + /** + * repeated .WiFiAPData aps_data = 12; + */ + public Builder addApsData( + int index, com.openpositioning.PositionMe.Traj.WiFiAPData.Builder builderForValue) { + if (apsDataBuilder_ == null) { + ensureApsDataIsMutable(); + apsData_.add(index, builderForValue.build()); + onChanged(); + } else { + apsDataBuilder_.addMessage(index, builderForValue.build()); + } + return this; + } + /** + * repeated .WiFiAPData aps_data = 12; + */ + public Builder addAllApsData( + java.lang.Iterable values) { + if (apsDataBuilder_ == null) { + ensureApsDataIsMutable(); + com.google.protobuf.AbstractMessageLite.Builder.addAll( + values, apsData_); + onChanged(); + } else { + apsDataBuilder_.addAllMessages(values); + } + return this; + } + /** + * repeated .WiFiAPData aps_data = 12; + */ + public Builder clearApsData() { + if (apsDataBuilder_ == null) { + apsData_ = java.util.Collections.emptyList(); + bitField0_ = (bitField0_ & ~0x00000800); + onChanged(); + } else { + apsDataBuilder_.clear(); + } + return this; + } + /** + * repeated .WiFiAPData aps_data = 12; + */ + public Builder removeApsData(int index) { + if (apsDataBuilder_ == null) { + ensureApsDataIsMutable(); + apsData_.remove(index); + onChanged(); + } else { + apsDataBuilder_.remove(index); + } + return this; + } + /** + * repeated .WiFiAPData aps_data = 12; + */ + public com.openpositioning.PositionMe.Traj.WiFiAPData.Builder getApsDataBuilder( + int index) { + return getApsDataFieldBuilder().getBuilder(index); + } + /** + * repeated .WiFiAPData aps_data = 12; + */ + public com.openpositioning.PositionMe.Traj.WiFiAPDataOrBuilder getApsDataOrBuilder( + int index) { + if (apsDataBuilder_ == null) { + return apsData_.get(index); } else { + return apsDataBuilder_.getMessageOrBuilder(index); + } + } + /** + * repeated .WiFiAPData aps_data = 12; + */ + public java.util.List + getApsDataOrBuilderList() { + if (apsDataBuilder_ != null) { + return apsDataBuilder_.getMessageOrBuilderList(); + } else { + return java.util.Collections.unmodifiableList(apsData_); + } + } + /** + * repeated .WiFiAPData aps_data = 12; + */ + public com.openpositioning.PositionMe.Traj.WiFiAPData.Builder addApsDataBuilder() { + return getApsDataFieldBuilder().addBuilder( + com.openpositioning.PositionMe.Traj.WiFiAPData.getDefaultInstance()); + } + /** + * repeated .WiFiAPData aps_data = 12; + */ + public com.openpositioning.PositionMe.Traj.WiFiAPData.Builder addApsDataBuilder( + int index) { + return getApsDataFieldBuilder().addBuilder( + index, com.openpositioning.PositionMe.Traj.WiFiAPData.getDefaultInstance()); + } + /** + * repeated .WiFiAPData aps_data = 12; + */ + public java.util.List + getApsDataBuilderList() { + return getApsDataFieldBuilder().getBuilderList(); + } + private com.google.protobuf.RepeatedFieldBuilder< + com.openpositioning.PositionMe.Traj.WiFiAPData, com.openpositioning.PositionMe.Traj.WiFiAPData.Builder, com.openpositioning.PositionMe.Traj.WiFiAPDataOrBuilder> + getApsDataFieldBuilder() { + if (apsDataBuilder_ == null) { + apsDataBuilder_ = new com.google.protobuf.RepeatedFieldBuilder< + com.openpositioning.PositionMe.Traj.WiFiAPData, com.openpositioning.PositionMe.Traj.WiFiAPData.Builder, com.openpositioning.PositionMe.Traj.WiFiAPDataOrBuilder>( + apsData_, + ((bitField0_ & 0x00000800) != 0), + getParentForChildren(), + isClean()); + apsData_ = null; + } + return apsDataBuilder_; + } + + private java.util.List wifiRttData_ = + java.util.Collections.emptyList(); + private void ensureWifiRttDataIsMutable() { + if (!((bitField0_ & 0x00001000) != 0)) { + wifiRttData_ = new java.util.ArrayList(wifiRttData_); + bitField0_ |= 0x00001000; + } + } + + private com.google.protobuf.RepeatedFieldBuilder< + com.openpositioning.PositionMe.Traj.WiFiRTTReading, com.openpositioning.PositionMe.Traj.WiFiRTTReading.Builder, com.openpositioning.PositionMe.Traj.WiFiRTTReadingOrBuilder> wifiRttDataBuilder_; + + /** + * repeated .WiFiRTTReading wifi_rtt_data = 13; + */ + public java.util.List getWifiRttDataList() { + if (wifiRttDataBuilder_ == null) { + return java.util.Collections.unmodifiableList(wifiRttData_); + } else { + return wifiRttDataBuilder_.getMessageList(); + } + } + /** + * repeated .WiFiRTTReading wifi_rtt_data = 13; + */ + public int getWifiRttDataCount() { + if (wifiRttDataBuilder_ == null) { + return wifiRttData_.size(); + } else { + return wifiRttDataBuilder_.getCount(); + } + } + /** + * repeated .WiFiRTTReading wifi_rtt_data = 13; + */ + public com.openpositioning.PositionMe.Traj.WiFiRTTReading getWifiRttData(int index) { + if (wifiRttDataBuilder_ == null) { + return wifiRttData_.get(index); + } else { + return wifiRttDataBuilder_.getMessage(index); + } + } + /** + * repeated .WiFiRTTReading wifi_rtt_data = 13; + */ + public Builder setWifiRttData( + int index, com.openpositioning.PositionMe.Traj.WiFiRTTReading value) { + if (wifiRttDataBuilder_ == null) { + if (value == null) { + throw new NullPointerException(); + } + ensureWifiRttDataIsMutable(); + wifiRttData_.set(index, value); + onChanged(); + } else { + wifiRttDataBuilder_.setMessage(index, value); + } + return this; + } + /** + * repeated .WiFiRTTReading wifi_rtt_data = 13; + */ + public Builder setWifiRttData( + int index, com.openpositioning.PositionMe.Traj.WiFiRTTReading.Builder builderForValue) { + if (wifiRttDataBuilder_ == null) { + ensureWifiRttDataIsMutable(); + wifiRttData_.set(index, builderForValue.build()); + onChanged(); + } else { + wifiRttDataBuilder_.setMessage(index, builderForValue.build()); + } + return this; + } + /** + * repeated .WiFiRTTReading wifi_rtt_data = 13; + */ + public Builder addWifiRttData(com.openpositioning.PositionMe.Traj.WiFiRTTReading value) { + if (wifiRttDataBuilder_ == null) { + if (value == null) { + throw new NullPointerException(); + } + ensureWifiRttDataIsMutable(); + wifiRttData_.add(value); + onChanged(); + } else { + wifiRttDataBuilder_.addMessage(value); + } + return this; + } + /** + * repeated .WiFiRTTReading wifi_rtt_data = 13; + */ + public Builder addWifiRttData( + int index, com.openpositioning.PositionMe.Traj.WiFiRTTReading value) { + if (wifiRttDataBuilder_ == null) { + if (value == null) { + throw new NullPointerException(); + } + ensureWifiRttDataIsMutable(); + wifiRttData_.add(index, value); + onChanged(); + } else { + wifiRttDataBuilder_.addMessage(index, value); + } + return this; + } + /** + * repeated .WiFiRTTReading wifi_rtt_data = 13; + */ + public Builder addWifiRttData( + com.openpositioning.PositionMe.Traj.WiFiRTTReading.Builder builderForValue) { + if (wifiRttDataBuilder_ == null) { + ensureWifiRttDataIsMutable(); + wifiRttData_.add(builderForValue.build()); + onChanged(); + } else { + wifiRttDataBuilder_.addMessage(builderForValue.build()); + } + return this; + } + /** + * repeated .WiFiRTTReading wifi_rtt_data = 13; + */ + public Builder addWifiRttData( + int index, com.openpositioning.PositionMe.Traj.WiFiRTTReading.Builder builderForValue) { + if (wifiRttDataBuilder_ == null) { + ensureWifiRttDataIsMutable(); + wifiRttData_.add(index, builderForValue.build()); + onChanged(); + } else { + wifiRttDataBuilder_.addMessage(index, builderForValue.build()); + } + return this; + } + /** + * repeated .WiFiRTTReading wifi_rtt_data = 13; + */ + public Builder addAllWifiRttData( + java.lang.Iterable values) { + if (wifiRttDataBuilder_ == null) { + ensureWifiRttDataIsMutable(); + com.google.protobuf.AbstractMessageLite.Builder.addAll( + values, wifiRttData_); + onChanged(); + } else { + wifiRttDataBuilder_.addAllMessages(values); + } + return this; + } + /** + * repeated .WiFiRTTReading wifi_rtt_data = 13; + */ + public Builder clearWifiRttData() { + if (wifiRttDataBuilder_ == null) { + wifiRttData_ = java.util.Collections.emptyList(); + bitField0_ = (bitField0_ & ~0x00001000); + onChanged(); + } else { + wifiRttDataBuilder_.clear(); + } + return this; + } + /** + * repeated .WiFiRTTReading wifi_rtt_data = 13; + */ + public Builder removeWifiRttData(int index) { + if (wifiRttDataBuilder_ == null) { + ensureWifiRttDataIsMutable(); + wifiRttData_.remove(index); + onChanged(); + } else { + wifiRttDataBuilder_.remove(index); + } + return this; + } + /** + * repeated .WiFiRTTReading wifi_rtt_data = 13; + */ + public com.openpositioning.PositionMe.Traj.WiFiRTTReading.Builder getWifiRttDataBuilder( + int index) { + return getWifiRttDataFieldBuilder().getBuilder(index); + } + /** + * repeated .WiFiRTTReading wifi_rtt_data = 13; + */ + public com.openpositioning.PositionMe.Traj.WiFiRTTReadingOrBuilder getWifiRttDataOrBuilder( + int index) { + if (wifiRttDataBuilder_ == null) { + return wifiRttData_.get(index); } else { + return wifiRttDataBuilder_.getMessageOrBuilder(index); + } + } + /** + * repeated .WiFiRTTReading wifi_rtt_data = 13; + */ + public java.util.List + getWifiRttDataOrBuilderList() { + if (wifiRttDataBuilder_ != null) { + return wifiRttDataBuilder_.getMessageOrBuilderList(); + } else { + return java.util.Collections.unmodifiableList(wifiRttData_); + } + } + /** + * repeated .WiFiRTTReading wifi_rtt_data = 13; + */ + public com.openpositioning.PositionMe.Traj.WiFiRTTReading.Builder addWifiRttDataBuilder() { + return getWifiRttDataFieldBuilder().addBuilder( + com.openpositioning.PositionMe.Traj.WiFiRTTReading.getDefaultInstance()); + } + /** + * repeated .WiFiRTTReading wifi_rtt_data = 13; + */ + public com.openpositioning.PositionMe.Traj.WiFiRTTReading.Builder addWifiRttDataBuilder( + int index) { + return getWifiRttDataFieldBuilder().addBuilder( + index, com.openpositioning.PositionMe.Traj.WiFiRTTReading.getDefaultInstance()); + } + /** + * repeated .WiFiRTTReading wifi_rtt_data = 13; + */ + public java.util.List + getWifiRttDataBuilderList() { + return getWifiRttDataFieldBuilder().getBuilderList(); + } + private com.google.protobuf.RepeatedFieldBuilder< + com.openpositioning.PositionMe.Traj.WiFiRTTReading, com.openpositioning.PositionMe.Traj.WiFiRTTReading.Builder, com.openpositioning.PositionMe.Traj.WiFiRTTReadingOrBuilder> + getWifiRttDataFieldBuilder() { + if (wifiRttDataBuilder_ == null) { + wifiRttDataBuilder_ = new com.google.protobuf.RepeatedFieldBuilder< + com.openpositioning.PositionMe.Traj.WiFiRTTReading, com.openpositioning.PositionMe.Traj.WiFiRTTReading.Builder, com.openpositioning.PositionMe.Traj.WiFiRTTReadingOrBuilder>( + wifiRttData_, + ((bitField0_ & 0x00001000) != 0), + getParentForChildren(), + isClean()); + wifiRttData_ = null; + } + return wifiRttDataBuilder_; + } + + private java.util.List bleFingerprints_ = + java.util.Collections.emptyList(); + private void ensureBleFingerprintsIsMutable() { + if (!((bitField0_ & 0x00002000) != 0)) { + bleFingerprints_ = new java.util.ArrayList(bleFingerprints_); + bitField0_ |= 0x00002000; + } + } + + private com.google.protobuf.RepeatedFieldBuilder< + com.openpositioning.PositionMe.Traj.Fingerprint, com.openpositioning.PositionMe.Traj.Fingerprint.Builder, com.openpositioning.PositionMe.Traj.FingerprintOrBuilder> bleFingerprintsBuilder_; + + /** + * repeated .Fingerprint ble_fingerprints = 14; + */ + public java.util.List getBleFingerprintsList() { + if (bleFingerprintsBuilder_ == null) { + return java.util.Collections.unmodifiableList(bleFingerprints_); + } else { + return bleFingerprintsBuilder_.getMessageList(); + } + } + /** + * repeated .Fingerprint ble_fingerprints = 14; + */ + public int getBleFingerprintsCount() { + if (bleFingerprintsBuilder_ == null) { + return bleFingerprints_.size(); + } else { + return bleFingerprintsBuilder_.getCount(); + } + } + /** + * repeated .Fingerprint ble_fingerprints = 14; + */ + public com.openpositioning.PositionMe.Traj.Fingerprint getBleFingerprints(int index) { + if (bleFingerprintsBuilder_ == null) { + return bleFingerprints_.get(index); + } else { + return bleFingerprintsBuilder_.getMessage(index); + } + } + /** + * repeated .Fingerprint ble_fingerprints = 14; + */ + public Builder setBleFingerprints( + int index, com.openpositioning.PositionMe.Traj.Fingerprint value) { + if (bleFingerprintsBuilder_ == null) { + if (value == null) { + throw new NullPointerException(); + } + ensureBleFingerprintsIsMutable(); + bleFingerprints_.set(index, value); + onChanged(); + } else { + bleFingerprintsBuilder_.setMessage(index, value); + } + return this; + } + /** + * repeated .Fingerprint ble_fingerprints = 14; + */ + public Builder setBleFingerprints( + int index, com.openpositioning.PositionMe.Traj.Fingerprint.Builder builderForValue) { + if (bleFingerprintsBuilder_ == null) { + ensureBleFingerprintsIsMutable(); + bleFingerprints_.set(index, builderForValue.build()); + onChanged(); + } else { + bleFingerprintsBuilder_.setMessage(index, builderForValue.build()); + } + return this; + } + /** + * repeated .Fingerprint ble_fingerprints = 14; + */ + public Builder addBleFingerprints(com.openpositioning.PositionMe.Traj.Fingerprint value) { + if (bleFingerprintsBuilder_ == null) { + if (value == null) { + throw new NullPointerException(); + } + ensureBleFingerprintsIsMutable(); + bleFingerprints_.add(value); + onChanged(); + } else { + bleFingerprintsBuilder_.addMessage(value); + } + return this; + } + /** + * repeated .Fingerprint ble_fingerprints = 14; + */ + public Builder addBleFingerprints( + int index, com.openpositioning.PositionMe.Traj.Fingerprint value) { + if (bleFingerprintsBuilder_ == null) { + if (value == null) { + throw new NullPointerException(); + } + ensureBleFingerprintsIsMutable(); + bleFingerprints_.add(index, value); + onChanged(); + } else { + bleFingerprintsBuilder_.addMessage(index, value); + } + return this; + } + /** + * repeated .Fingerprint ble_fingerprints = 14; + */ + public Builder addBleFingerprints( + com.openpositioning.PositionMe.Traj.Fingerprint.Builder builderForValue) { + if (bleFingerprintsBuilder_ == null) { + ensureBleFingerprintsIsMutable(); + bleFingerprints_.add(builderForValue.build()); + onChanged(); + } else { + bleFingerprintsBuilder_.addMessage(builderForValue.build()); + } + return this; + } + /** + * repeated .Fingerprint ble_fingerprints = 14; + */ + public Builder addBleFingerprints( + int index, com.openpositioning.PositionMe.Traj.Fingerprint.Builder builderForValue) { + if (bleFingerprintsBuilder_ == null) { + ensureBleFingerprintsIsMutable(); + bleFingerprints_.add(index, builderForValue.build()); + onChanged(); + } else { + bleFingerprintsBuilder_.addMessage(index, builderForValue.build()); + } + return this; + } + /** + * repeated .Fingerprint ble_fingerprints = 14; + */ + public Builder addAllBleFingerprints( + java.lang.Iterable values) { + if (bleFingerprintsBuilder_ == null) { + ensureBleFingerprintsIsMutable(); + com.google.protobuf.AbstractMessageLite.Builder.addAll( + values, bleFingerprints_); + onChanged(); + } else { + bleFingerprintsBuilder_.addAllMessages(values); + } + return this; + } + /** + * repeated .Fingerprint ble_fingerprints = 14; + */ + public Builder clearBleFingerprints() { + if (bleFingerprintsBuilder_ == null) { + bleFingerprints_ = java.util.Collections.emptyList(); + bitField0_ = (bitField0_ & ~0x00002000); + onChanged(); + } else { + bleFingerprintsBuilder_.clear(); + } + return this; + } + /** + * repeated .Fingerprint ble_fingerprints = 14; + */ + public Builder removeBleFingerprints(int index) { + if (bleFingerprintsBuilder_ == null) { + ensureBleFingerprintsIsMutable(); + bleFingerprints_.remove(index); + onChanged(); + } else { + bleFingerprintsBuilder_.remove(index); + } + return this; + } + /** + * repeated .Fingerprint ble_fingerprints = 14; + */ + public com.openpositioning.PositionMe.Traj.Fingerprint.Builder getBleFingerprintsBuilder( + int index) { + return getBleFingerprintsFieldBuilder().getBuilder(index); + } + /** + * repeated .Fingerprint ble_fingerprints = 14; + */ + public com.openpositioning.PositionMe.Traj.FingerprintOrBuilder getBleFingerprintsOrBuilder( + int index) { + if (bleFingerprintsBuilder_ == null) { + return bleFingerprints_.get(index); } else { + return bleFingerprintsBuilder_.getMessageOrBuilder(index); + } + } + /** + * repeated .Fingerprint ble_fingerprints = 14; + */ + public java.util.List + getBleFingerprintsOrBuilderList() { + if (bleFingerprintsBuilder_ != null) { + return bleFingerprintsBuilder_.getMessageOrBuilderList(); + } else { + return java.util.Collections.unmodifiableList(bleFingerprints_); + } + } + /** + * repeated .Fingerprint ble_fingerprints = 14; + */ + public com.openpositioning.PositionMe.Traj.Fingerprint.Builder addBleFingerprintsBuilder() { + return getBleFingerprintsFieldBuilder().addBuilder( + com.openpositioning.PositionMe.Traj.Fingerprint.getDefaultInstance()); + } + /** + * repeated .Fingerprint ble_fingerprints = 14; + */ + public com.openpositioning.PositionMe.Traj.Fingerprint.Builder addBleFingerprintsBuilder( + int index) { + return getBleFingerprintsFieldBuilder().addBuilder( + index, com.openpositioning.PositionMe.Traj.Fingerprint.getDefaultInstance()); + } + /** + * repeated .Fingerprint ble_fingerprints = 14; + */ + public java.util.List + getBleFingerprintsBuilderList() { + return getBleFingerprintsFieldBuilder().getBuilderList(); + } + private com.google.protobuf.RepeatedFieldBuilder< + com.openpositioning.PositionMe.Traj.Fingerprint, com.openpositioning.PositionMe.Traj.Fingerprint.Builder, com.openpositioning.PositionMe.Traj.FingerprintOrBuilder> + getBleFingerprintsFieldBuilder() { + if (bleFingerprintsBuilder_ == null) { + bleFingerprintsBuilder_ = new com.google.protobuf.RepeatedFieldBuilder< + com.openpositioning.PositionMe.Traj.Fingerprint, com.openpositioning.PositionMe.Traj.Fingerprint.Builder, com.openpositioning.PositionMe.Traj.FingerprintOrBuilder>( + bleFingerprints_, + ((bitField0_ & 0x00002000) != 0), + getParentForChildren(), + isClean()); + bleFingerprints_ = null; + } + return bleFingerprintsBuilder_; + } + + private java.util.List bleData_ = + java.util.Collections.emptyList(); + private void ensureBleDataIsMutable() { + if (!((bitField0_ & 0x00004000) != 0)) { + bleData_ = new java.util.ArrayList(bleData_); + bitField0_ |= 0x00004000; + } + } + + private com.google.protobuf.RepeatedFieldBuilder< + com.openpositioning.PositionMe.Traj.BleData, com.openpositioning.PositionMe.Traj.BleData.Builder, com.openpositioning.PositionMe.Traj.BleDataOrBuilder> bleDataBuilder_; + + /** + * repeated .BleData ble_data = 15; + */ + public java.util.List getBleDataList() { + if (bleDataBuilder_ == null) { + return java.util.Collections.unmodifiableList(bleData_); + } else { + return bleDataBuilder_.getMessageList(); + } + } + /** + * repeated .BleData ble_data = 15; + */ + public int getBleDataCount() { + if (bleDataBuilder_ == null) { + return bleData_.size(); + } else { + return bleDataBuilder_.getCount(); + } + } + /** + * repeated .BleData ble_data = 15; + */ + public com.openpositioning.PositionMe.Traj.BleData getBleData(int index) { + if (bleDataBuilder_ == null) { + return bleData_.get(index); + } else { + return bleDataBuilder_.getMessage(index); + } + } + /** + * repeated .BleData ble_data = 15; + */ + public Builder setBleData( + int index, com.openpositioning.PositionMe.Traj.BleData value) { + if (bleDataBuilder_ == null) { + if (value == null) { + throw new NullPointerException(); + } + ensureBleDataIsMutable(); + bleData_.set(index, value); + onChanged(); + } else { + bleDataBuilder_.setMessage(index, value); + } + return this; + } + /** + * repeated .BleData ble_data = 15; + */ + public Builder setBleData( + int index, com.openpositioning.PositionMe.Traj.BleData.Builder builderForValue) { + if (bleDataBuilder_ == null) { + ensureBleDataIsMutable(); + bleData_.set(index, builderForValue.build()); + onChanged(); + } else { + bleDataBuilder_.setMessage(index, builderForValue.build()); + } + return this; + } + /** + * repeated .BleData ble_data = 15; + */ + public Builder addBleData(com.openpositioning.PositionMe.Traj.BleData value) { + if (bleDataBuilder_ == null) { + if (value == null) { + throw new NullPointerException(); + } + ensureBleDataIsMutable(); + bleData_.add(value); + onChanged(); + } else { + bleDataBuilder_.addMessage(value); + } + return this; + } + /** + * repeated .BleData ble_data = 15; + */ + public Builder addBleData( + int index, com.openpositioning.PositionMe.Traj.BleData value) { + if (bleDataBuilder_ == null) { + if (value == null) { + throw new NullPointerException(); + } + ensureBleDataIsMutable(); + bleData_.add(index, value); + onChanged(); + } else { + bleDataBuilder_.addMessage(index, value); + } + return this; + } + /** + * repeated .BleData ble_data = 15; + */ + public Builder addBleData( + com.openpositioning.PositionMe.Traj.BleData.Builder builderForValue) { + if (bleDataBuilder_ == null) { + ensureBleDataIsMutable(); + bleData_.add(builderForValue.build()); + onChanged(); + } else { + bleDataBuilder_.addMessage(builderForValue.build()); + } + return this; + } + /** + * repeated .BleData ble_data = 15; + */ + public Builder addBleData( + int index, com.openpositioning.PositionMe.Traj.BleData.Builder builderForValue) { + if (bleDataBuilder_ == null) { + ensureBleDataIsMutable(); + bleData_.add(index, builderForValue.build()); + onChanged(); + } else { + bleDataBuilder_.addMessage(index, builderForValue.build()); + } + return this; + } + /** + * repeated .BleData ble_data = 15; + */ + public Builder addAllBleData( + java.lang.Iterable values) { + if (bleDataBuilder_ == null) { + ensureBleDataIsMutable(); + com.google.protobuf.AbstractMessageLite.Builder.addAll( + values, bleData_); + onChanged(); + } else { + bleDataBuilder_.addAllMessages(values); + } + return this; + } + /** + * repeated .BleData ble_data = 15; + */ + public Builder clearBleData() { + if (bleDataBuilder_ == null) { + bleData_ = java.util.Collections.emptyList(); + bitField0_ = (bitField0_ & ~0x00004000); + onChanged(); + } else { + bleDataBuilder_.clear(); + } + return this; + } + /** + * repeated .BleData ble_data = 15; + */ + public Builder removeBleData(int index) { + if (bleDataBuilder_ == null) { + ensureBleDataIsMutable(); + bleData_.remove(index); + onChanged(); + } else { + bleDataBuilder_.remove(index); + } + return this; + } + /** + * repeated .BleData ble_data = 15; + */ + public com.openpositioning.PositionMe.Traj.BleData.Builder getBleDataBuilder( + int index) { + return getBleDataFieldBuilder().getBuilder(index); + } + /** + * repeated .BleData ble_data = 15; + */ + public com.openpositioning.PositionMe.Traj.BleDataOrBuilder getBleDataOrBuilder( + int index) { + if (bleDataBuilder_ == null) { + return bleData_.get(index); } else { + return bleDataBuilder_.getMessageOrBuilder(index); + } + } + /** + * repeated .BleData ble_data = 15; + */ + public java.util.List + getBleDataOrBuilderList() { + if (bleDataBuilder_ != null) { + return bleDataBuilder_.getMessageOrBuilderList(); + } else { + return java.util.Collections.unmodifiableList(bleData_); + } + } + /** + * repeated .BleData ble_data = 15; + */ + public com.openpositioning.PositionMe.Traj.BleData.Builder addBleDataBuilder() { + return getBleDataFieldBuilder().addBuilder( + com.openpositioning.PositionMe.Traj.BleData.getDefaultInstance()); + } + /** + * repeated .BleData ble_data = 15; + */ + public com.openpositioning.PositionMe.Traj.BleData.Builder addBleDataBuilder( + int index) { + return getBleDataFieldBuilder().addBuilder( + index, com.openpositioning.PositionMe.Traj.BleData.getDefaultInstance()); + } + /** + * repeated .BleData ble_data = 15; + */ + public java.util.List + getBleDataBuilderList() { + return getBleDataFieldBuilder().getBuilderList(); + } + private com.google.protobuf.RepeatedFieldBuilder< + com.openpositioning.PositionMe.Traj.BleData, com.openpositioning.PositionMe.Traj.BleData.Builder, com.openpositioning.PositionMe.Traj.BleDataOrBuilder> + getBleDataFieldBuilder() { + if (bleDataBuilder_ == null) { + bleDataBuilder_ = new com.google.protobuf.RepeatedFieldBuilder< + com.openpositioning.PositionMe.Traj.BleData, com.openpositioning.PositionMe.Traj.BleData.Builder, com.openpositioning.PositionMe.Traj.BleDataOrBuilder>( + bleData_, + ((bitField0_ & 0x00004000) != 0), + getParentForChildren(), + isClean()); + bleData_ = null; + } + return bleDataBuilder_; + } + + private long startTimestamp_ ; + /** + *
+       * UNIX timestamp (in milliseconds) recorded from the start of this
+       * trajectory data collection event. All future
+       * timestamps in sub classes are to be RELATIVE timestamps
+       * (in milliseconds) to this start time.
+       * E.g.
+       * start_timestamp = 1674819807315 (UTC 27 Jan 2023 in the morning)
+       * relative_timestamp = 3000 (3s)
+       * 
+ * + * int64 start_timestamp = 16; + * @return The startTimestamp. + */ + @java.lang.Override + public long getStartTimestamp() { + return startTimestamp_; + } + /** + *
+       * UNIX timestamp (in milliseconds) recorded from the start of this
+       * trajectory data collection event. All future
+       * timestamps in sub classes are to be RELATIVE timestamps
+       * (in milliseconds) to this start time.
+       * E.g.
+       * start_timestamp = 1674819807315 (UTC 27 Jan 2023 in the morning)
+       * relative_timestamp = 3000 (3s)
+       * 
+ * + * int64 start_timestamp = 16; + * @param value The startTimestamp to set. + * @return This builder for chaining. + */ + public Builder setStartTimestamp(long value) { + + startTimestamp_ = value; + bitField0_ |= 0x00008000; + onChanged(); + return this; + } + /** + *
+       * UNIX timestamp (in milliseconds) recorded from the start of this
+       * trajectory data collection event. All future
+       * timestamps in sub classes are to be RELATIVE timestamps
+       * (in milliseconds) to this start time.
+       * E.g.
+       * start_timestamp = 1674819807315 (UTC 27 Jan 2023 in the morning)
+       * relative_timestamp = 3000 (3s)
+       * 
+ * + * int64 start_timestamp = 16; + * @return This builder for chaining. + */ + public Builder clearStartTimestamp() { + bitField0_ = (bitField0_ & ~0x00008000); + startTimestamp_ = 0L; + onChanged(); + return this; + } + + private com.openpositioning.PositionMe.Traj.GNSSPosition initialPosition_; + private com.google.protobuf.SingleFieldBuilder< + com.openpositioning.PositionMe.Traj.GNSSPosition, com.openpositioning.PositionMe.Traj.GNSSPosition.Builder, com.openpositioning.PositionMe.Traj.GNSSPositionOrBuilder> initialPositionBuilder_; + /** + * .GNSSPosition initial_position = 17; + * @return Whether the initialPosition field is set. + */ + public boolean hasInitialPosition() { + return ((bitField0_ & 0x00010000) != 0); + } + /** + * .GNSSPosition initial_position = 17; + * @return The initialPosition. + */ + public com.openpositioning.PositionMe.Traj.GNSSPosition getInitialPosition() { + if (initialPositionBuilder_ == null) { + return initialPosition_ == null ? com.openpositioning.PositionMe.Traj.GNSSPosition.getDefaultInstance() : initialPosition_; + } else { + return initialPositionBuilder_.getMessage(); + } + } + /** + * .GNSSPosition initial_position = 17; + */ + public Builder setInitialPosition(com.openpositioning.PositionMe.Traj.GNSSPosition value) { + if (initialPositionBuilder_ == null) { + if (value == null) { + throw new NullPointerException(); + } + initialPosition_ = value; + } else { + initialPositionBuilder_.setMessage(value); + } + bitField0_ |= 0x00010000; + onChanged(); + return this; + } + /** + * .GNSSPosition initial_position = 17; + */ + public Builder setInitialPosition( + com.openpositioning.PositionMe.Traj.GNSSPosition.Builder builderForValue) { + if (initialPositionBuilder_ == null) { + initialPosition_ = builderForValue.build(); + } else { + initialPositionBuilder_.setMessage(builderForValue.build()); + } + bitField0_ |= 0x00010000; + onChanged(); + return this; + } + /** + * .GNSSPosition initial_position = 17; + */ + public Builder mergeInitialPosition(com.openpositioning.PositionMe.Traj.GNSSPosition value) { + if (initialPositionBuilder_ == null) { + if (((bitField0_ & 0x00010000) != 0) && + initialPosition_ != null && + initialPosition_ != com.openpositioning.PositionMe.Traj.GNSSPosition.getDefaultInstance()) { + getInitialPositionBuilder().mergeFrom(value); + } else { + initialPosition_ = value; + } + } else { + initialPositionBuilder_.mergeFrom(value); + } + if (initialPosition_ != null) { + bitField0_ |= 0x00010000; + onChanged(); + } + return this; + } + /** + * .GNSSPosition initial_position = 17; + */ + public Builder clearInitialPosition() { + bitField0_ = (bitField0_ & ~0x00010000); + initialPosition_ = null; + if (initialPositionBuilder_ != null) { + initialPositionBuilder_.dispose(); + initialPositionBuilder_ = null; + } + onChanged(); + return this; + } + /** + * .GNSSPosition initial_position = 17; + */ + public com.openpositioning.PositionMe.Traj.GNSSPosition.Builder getInitialPositionBuilder() { + bitField0_ |= 0x00010000; + onChanged(); + return getInitialPositionFieldBuilder().getBuilder(); + } + /** + * .GNSSPosition initial_position = 17; + */ + public com.openpositioning.PositionMe.Traj.GNSSPositionOrBuilder getInitialPositionOrBuilder() { + if (initialPositionBuilder_ != null) { + return initialPositionBuilder_.getMessageOrBuilder(); + } else { + return initialPosition_ == null ? + com.openpositioning.PositionMe.Traj.GNSSPosition.getDefaultInstance() : initialPosition_; + } + } + /** + * .GNSSPosition initial_position = 17; + */ + private com.google.protobuf.SingleFieldBuilder< + com.openpositioning.PositionMe.Traj.GNSSPosition, com.openpositioning.PositionMe.Traj.GNSSPosition.Builder, com.openpositioning.PositionMe.Traj.GNSSPositionOrBuilder> + getInitialPositionFieldBuilder() { + if (initialPositionBuilder_ == null) { + initialPositionBuilder_ = new com.google.protobuf.SingleFieldBuilder< + com.openpositioning.PositionMe.Traj.GNSSPosition, com.openpositioning.PositionMe.Traj.GNSSPosition.Builder, com.openpositioning.PositionMe.Traj.GNSSPositionOrBuilder>( + getInitialPosition(), + getParentForChildren(), + isClean()); + initialPosition_ = null; + } + return initialPositionBuilder_; + } + + private java.util.List correctedPositions_ = + java.util.Collections.emptyList(); + private void ensureCorrectedPositionsIsMutable() { + if (!((bitField0_ & 0x00020000) != 0)) { + correctedPositions_ = new java.util.ArrayList(correctedPositions_); + bitField0_ |= 0x00020000; + } + } + + private com.google.protobuf.RepeatedFieldBuilder< + com.openpositioning.PositionMe.Traj.GNSSPosition, com.openpositioning.PositionMe.Traj.GNSSPosition.Builder, com.openpositioning.PositionMe.Traj.GNSSPositionOrBuilder> correctedPositionsBuilder_; + + /** + * repeated .GNSSPosition corrected_positions = 18; + */ + public java.util.List getCorrectedPositionsList() { + if (correctedPositionsBuilder_ == null) { + return java.util.Collections.unmodifiableList(correctedPositions_); + } else { + return correctedPositionsBuilder_.getMessageList(); + } + } + /** + * repeated .GNSSPosition corrected_positions = 18; + */ + public int getCorrectedPositionsCount() { + if (correctedPositionsBuilder_ == null) { + return correctedPositions_.size(); + } else { + return correctedPositionsBuilder_.getCount(); + } + } + /** + * repeated .GNSSPosition corrected_positions = 18; + */ + public com.openpositioning.PositionMe.Traj.GNSSPosition getCorrectedPositions(int index) { + if (correctedPositionsBuilder_ == null) { + return correctedPositions_.get(index); + } else { + return correctedPositionsBuilder_.getMessage(index); + } + } + /** + * repeated .GNSSPosition corrected_positions = 18; + */ + public Builder setCorrectedPositions( + int index, com.openpositioning.PositionMe.Traj.GNSSPosition value) { + if (correctedPositionsBuilder_ == null) { + if (value == null) { + throw new NullPointerException(); + } + ensureCorrectedPositionsIsMutable(); + correctedPositions_.set(index, value); + onChanged(); + } else { + correctedPositionsBuilder_.setMessage(index, value); + } + return this; + } + /** + * repeated .GNSSPosition corrected_positions = 18; + */ + public Builder setCorrectedPositions( + int index, com.openpositioning.PositionMe.Traj.GNSSPosition.Builder builderForValue) { + if (correctedPositionsBuilder_ == null) { + ensureCorrectedPositionsIsMutable(); + correctedPositions_.set(index, builderForValue.build()); + onChanged(); + } else { + correctedPositionsBuilder_.setMessage(index, builderForValue.build()); + } + return this; + } + /** + * repeated .GNSSPosition corrected_positions = 18; + */ + public Builder addCorrectedPositions(com.openpositioning.PositionMe.Traj.GNSSPosition value) { + if (correctedPositionsBuilder_ == null) { + if (value == null) { + throw new NullPointerException(); + } + ensureCorrectedPositionsIsMutable(); + correctedPositions_.add(value); + onChanged(); + } else { + correctedPositionsBuilder_.addMessage(value); + } + return this; + } + /** + * repeated .GNSSPosition corrected_positions = 18; + */ + public Builder addCorrectedPositions( + int index, com.openpositioning.PositionMe.Traj.GNSSPosition value) { + if (correctedPositionsBuilder_ == null) { + if (value == null) { + throw new NullPointerException(); + } + ensureCorrectedPositionsIsMutable(); + correctedPositions_.add(index, value); + onChanged(); + } else { + correctedPositionsBuilder_.addMessage(index, value); + } + return this; + } + /** + * repeated .GNSSPosition corrected_positions = 18; + */ + public Builder addCorrectedPositions( + com.openpositioning.PositionMe.Traj.GNSSPosition.Builder builderForValue) { + if (correctedPositionsBuilder_ == null) { + ensureCorrectedPositionsIsMutable(); + correctedPositions_.add(builderForValue.build()); + onChanged(); + } else { + correctedPositionsBuilder_.addMessage(builderForValue.build()); + } + return this; + } + /** + * repeated .GNSSPosition corrected_positions = 18; + */ + public Builder addCorrectedPositions( + int index, com.openpositioning.PositionMe.Traj.GNSSPosition.Builder builderForValue) { + if (correctedPositionsBuilder_ == null) { + ensureCorrectedPositionsIsMutable(); + correctedPositions_.add(index, builderForValue.build()); + onChanged(); + } else { + correctedPositionsBuilder_.addMessage(index, builderForValue.build()); + } + return this; + } + /** + * repeated .GNSSPosition corrected_positions = 18; + */ + public Builder addAllCorrectedPositions( + java.lang.Iterable values) { + if (correctedPositionsBuilder_ == null) { + ensureCorrectedPositionsIsMutable(); + com.google.protobuf.AbstractMessageLite.Builder.addAll( + values, correctedPositions_); + onChanged(); + } else { + correctedPositionsBuilder_.addAllMessages(values); + } + return this; + } + /** + * repeated .GNSSPosition corrected_positions = 18; + */ + public Builder clearCorrectedPositions() { + if (correctedPositionsBuilder_ == null) { + correctedPositions_ = java.util.Collections.emptyList(); + bitField0_ = (bitField0_ & ~0x00020000); + onChanged(); + } else { + correctedPositionsBuilder_.clear(); + } + return this; + } + /** + * repeated .GNSSPosition corrected_positions = 18; + */ + public Builder removeCorrectedPositions(int index) { + if (correctedPositionsBuilder_ == null) { + ensureCorrectedPositionsIsMutable(); + correctedPositions_.remove(index); + onChanged(); + } else { + correctedPositionsBuilder_.remove(index); + } + return this; + } + /** + * repeated .GNSSPosition corrected_positions = 18; + */ + public com.openpositioning.PositionMe.Traj.GNSSPosition.Builder getCorrectedPositionsBuilder( + int index) { + return getCorrectedPositionsFieldBuilder().getBuilder(index); + } + /** + * repeated .GNSSPosition corrected_positions = 18; + */ + public com.openpositioning.PositionMe.Traj.GNSSPositionOrBuilder getCorrectedPositionsOrBuilder( + int index) { + if (correctedPositionsBuilder_ == null) { + return correctedPositions_.get(index); } else { + return correctedPositionsBuilder_.getMessageOrBuilder(index); + } + } + /** + * repeated .GNSSPosition corrected_positions = 18; + */ + public java.util.List + getCorrectedPositionsOrBuilderList() { + if (correctedPositionsBuilder_ != null) { + return correctedPositionsBuilder_.getMessageOrBuilderList(); + } else { + return java.util.Collections.unmodifiableList(correctedPositions_); + } + } + /** + * repeated .GNSSPosition corrected_positions = 18; + */ + public com.openpositioning.PositionMe.Traj.GNSSPosition.Builder addCorrectedPositionsBuilder() { + return getCorrectedPositionsFieldBuilder().addBuilder( + com.openpositioning.PositionMe.Traj.GNSSPosition.getDefaultInstance()); + } + /** + * repeated .GNSSPosition corrected_positions = 18; + */ + public com.openpositioning.PositionMe.Traj.GNSSPosition.Builder addCorrectedPositionsBuilder( + int index) { + return getCorrectedPositionsFieldBuilder().addBuilder( + index, com.openpositioning.PositionMe.Traj.GNSSPosition.getDefaultInstance()); + } + /** + * repeated .GNSSPosition corrected_positions = 18; + */ + public java.util.List + getCorrectedPositionsBuilderList() { + return getCorrectedPositionsFieldBuilder().getBuilderList(); + } + private com.google.protobuf.RepeatedFieldBuilder< + com.openpositioning.PositionMe.Traj.GNSSPosition, com.openpositioning.PositionMe.Traj.GNSSPosition.Builder, com.openpositioning.PositionMe.Traj.GNSSPositionOrBuilder> + getCorrectedPositionsFieldBuilder() { + if (correctedPositionsBuilder_ == null) { + correctedPositionsBuilder_ = new com.google.protobuf.RepeatedFieldBuilder< + com.openpositioning.PositionMe.Traj.GNSSPosition, com.openpositioning.PositionMe.Traj.GNSSPosition.Builder, com.openpositioning.PositionMe.Traj.GNSSPositionOrBuilder>( + correctedPositions_, + ((bitField0_ & 0x00020000) != 0), + getParentForChildren(), + isClean()); + correctedPositions_ = null; + } + return correctedPositionsBuilder_; + } + + private com.openpositioning.PositionMe.Traj.SensorInfo accelerometerInfo_; + private com.google.protobuf.SingleFieldBuilder< + com.openpositioning.PositionMe.Traj.SensorInfo, com.openpositioning.PositionMe.Traj.SensorInfo.Builder, com.openpositioning.PositionMe.Traj.SensorInfoOrBuilder> accelerometerInfoBuilder_; + /** + * .SensorInfo accelerometer_info = 19; + * @return Whether the accelerometerInfo field is set. + */ + public boolean hasAccelerometerInfo() { + return ((bitField0_ & 0x00040000) != 0); + } + /** + * .SensorInfo accelerometer_info = 19; + * @return The accelerometerInfo. + */ + public com.openpositioning.PositionMe.Traj.SensorInfo getAccelerometerInfo() { + if (accelerometerInfoBuilder_ == null) { + return accelerometerInfo_ == null ? com.openpositioning.PositionMe.Traj.SensorInfo.getDefaultInstance() : accelerometerInfo_; + } else { + return accelerometerInfoBuilder_.getMessage(); + } + } + /** + * .SensorInfo accelerometer_info = 19; + */ + public Builder setAccelerometerInfo(com.openpositioning.PositionMe.Traj.SensorInfo value) { + if (accelerometerInfoBuilder_ == null) { + if (value == null) { + throw new NullPointerException(); + } + accelerometerInfo_ = value; + } else { + accelerometerInfoBuilder_.setMessage(value); + } + bitField0_ |= 0x00040000; + onChanged(); + return this; + } + /** + * .SensorInfo accelerometer_info = 19; + */ + public Builder setAccelerometerInfo( + com.openpositioning.PositionMe.Traj.SensorInfo.Builder builderForValue) { + if (accelerometerInfoBuilder_ == null) { + accelerometerInfo_ = builderForValue.build(); + } else { + accelerometerInfoBuilder_.setMessage(builderForValue.build()); + } + bitField0_ |= 0x00040000; + onChanged(); + return this; + } + /** + * .SensorInfo accelerometer_info = 19; + */ + public Builder mergeAccelerometerInfo(com.openpositioning.PositionMe.Traj.SensorInfo value) { + if (accelerometerInfoBuilder_ == null) { + if (((bitField0_ & 0x00040000) != 0) && + accelerometerInfo_ != null && + accelerometerInfo_ != com.openpositioning.PositionMe.Traj.SensorInfo.getDefaultInstance()) { + getAccelerometerInfoBuilder().mergeFrom(value); + } else { + accelerometerInfo_ = value; + } + } else { + accelerometerInfoBuilder_.mergeFrom(value); + } + if (accelerometerInfo_ != null) { + bitField0_ |= 0x00040000; + onChanged(); + } + return this; + } + /** + * .SensorInfo accelerometer_info = 19; + */ + public Builder clearAccelerometerInfo() { + bitField0_ = (bitField0_ & ~0x00040000); + accelerometerInfo_ = null; + if (accelerometerInfoBuilder_ != null) { + accelerometerInfoBuilder_.dispose(); + accelerometerInfoBuilder_ = null; + } + onChanged(); + return this; + } + /** + * .SensorInfo accelerometer_info = 19; + */ + public com.openpositioning.PositionMe.Traj.SensorInfo.Builder getAccelerometerInfoBuilder() { + bitField0_ |= 0x00040000; + onChanged(); + return getAccelerometerInfoFieldBuilder().getBuilder(); + } + /** + * .SensorInfo accelerometer_info = 19; + */ + public com.openpositioning.PositionMe.Traj.SensorInfoOrBuilder getAccelerometerInfoOrBuilder() { + if (accelerometerInfoBuilder_ != null) { + return accelerometerInfoBuilder_.getMessageOrBuilder(); + } else { + return accelerometerInfo_ == null ? + com.openpositioning.PositionMe.Traj.SensorInfo.getDefaultInstance() : accelerometerInfo_; + } + } + /** + * .SensorInfo accelerometer_info = 19; + */ + private com.google.protobuf.SingleFieldBuilder< + com.openpositioning.PositionMe.Traj.SensorInfo, com.openpositioning.PositionMe.Traj.SensorInfo.Builder, com.openpositioning.PositionMe.Traj.SensorInfoOrBuilder> + getAccelerometerInfoFieldBuilder() { + if (accelerometerInfoBuilder_ == null) { + accelerometerInfoBuilder_ = new com.google.protobuf.SingleFieldBuilder< + com.openpositioning.PositionMe.Traj.SensorInfo, com.openpositioning.PositionMe.Traj.SensorInfo.Builder, com.openpositioning.PositionMe.Traj.SensorInfoOrBuilder>( + getAccelerometerInfo(), + getParentForChildren(), + isClean()); + accelerometerInfo_ = null; + } + return accelerometerInfoBuilder_; + } + + private com.openpositioning.PositionMe.Traj.SensorInfo gyroscopeInfo_; + private com.google.protobuf.SingleFieldBuilder< + com.openpositioning.PositionMe.Traj.SensorInfo, com.openpositioning.PositionMe.Traj.SensorInfo.Builder, com.openpositioning.PositionMe.Traj.SensorInfoOrBuilder> gyroscopeInfoBuilder_; + /** + * .SensorInfo gyroscope_info = 20; + * @return Whether the gyroscopeInfo field is set. + */ + public boolean hasGyroscopeInfo() { + return ((bitField0_ & 0x00080000) != 0); + } + /** + * .SensorInfo gyroscope_info = 20; + * @return The gyroscopeInfo. + */ + public com.openpositioning.PositionMe.Traj.SensorInfo getGyroscopeInfo() { + if (gyroscopeInfoBuilder_ == null) { + return gyroscopeInfo_ == null ? com.openpositioning.PositionMe.Traj.SensorInfo.getDefaultInstance() : gyroscopeInfo_; + } else { + return gyroscopeInfoBuilder_.getMessage(); + } + } + /** + * .SensorInfo gyroscope_info = 20; + */ + public Builder setGyroscopeInfo(com.openpositioning.PositionMe.Traj.SensorInfo value) { + if (gyroscopeInfoBuilder_ == null) { + if (value == null) { + throw new NullPointerException(); + } + gyroscopeInfo_ = value; + } else { + gyroscopeInfoBuilder_.setMessage(value); + } + bitField0_ |= 0x00080000; + onChanged(); + return this; + } + /** + * .SensorInfo gyroscope_info = 20; + */ + public Builder setGyroscopeInfo( + com.openpositioning.PositionMe.Traj.SensorInfo.Builder builderForValue) { + if (gyroscopeInfoBuilder_ == null) { + gyroscopeInfo_ = builderForValue.build(); + } else { + gyroscopeInfoBuilder_.setMessage(builderForValue.build()); + } + bitField0_ |= 0x00080000; + onChanged(); + return this; + } + /** + * .SensorInfo gyroscope_info = 20; + */ + public Builder mergeGyroscopeInfo(com.openpositioning.PositionMe.Traj.SensorInfo value) { + if (gyroscopeInfoBuilder_ == null) { + if (((bitField0_ & 0x00080000) != 0) && + gyroscopeInfo_ != null && + gyroscopeInfo_ != com.openpositioning.PositionMe.Traj.SensorInfo.getDefaultInstance()) { + getGyroscopeInfoBuilder().mergeFrom(value); + } else { + gyroscopeInfo_ = value; + } + } else { + gyroscopeInfoBuilder_.mergeFrom(value); + } + if (gyroscopeInfo_ != null) { + bitField0_ |= 0x00080000; + onChanged(); + } + return this; + } + /** + * .SensorInfo gyroscope_info = 20; + */ + public Builder clearGyroscopeInfo() { + bitField0_ = (bitField0_ & ~0x00080000); + gyroscopeInfo_ = null; + if (gyroscopeInfoBuilder_ != null) { + gyroscopeInfoBuilder_.dispose(); + gyroscopeInfoBuilder_ = null; + } + onChanged(); + return this; + } + /** + * .SensorInfo gyroscope_info = 20; + */ + public com.openpositioning.PositionMe.Traj.SensorInfo.Builder getGyroscopeInfoBuilder() { + bitField0_ |= 0x00080000; + onChanged(); + return getGyroscopeInfoFieldBuilder().getBuilder(); + } + /** + * .SensorInfo gyroscope_info = 20; + */ + public com.openpositioning.PositionMe.Traj.SensorInfoOrBuilder getGyroscopeInfoOrBuilder() { + if (gyroscopeInfoBuilder_ != null) { + return gyroscopeInfoBuilder_.getMessageOrBuilder(); + } else { + return gyroscopeInfo_ == null ? + com.openpositioning.PositionMe.Traj.SensorInfo.getDefaultInstance() : gyroscopeInfo_; + } + } + /** + * .SensorInfo gyroscope_info = 20; + */ + private com.google.protobuf.SingleFieldBuilder< + com.openpositioning.PositionMe.Traj.SensorInfo, com.openpositioning.PositionMe.Traj.SensorInfo.Builder, com.openpositioning.PositionMe.Traj.SensorInfoOrBuilder> + getGyroscopeInfoFieldBuilder() { + if (gyroscopeInfoBuilder_ == null) { + gyroscopeInfoBuilder_ = new com.google.protobuf.SingleFieldBuilder< + com.openpositioning.PositionMe.Traj.SensorInfo, com.openpositioning.PositionMe.Traj.SensorInfo.Builder, com.openpositioning.PositionMe.Traj.SensorInfoOrBuilder>( + getGyroscopeInfo(), + getParentForChildren(), + isClean()); + gyroscopeInfo_ = null; + } + return gyroscopeInfoBuilder_; + } + + private com.openpositioning.PositionMe.Traj.SensorInfo rotationVectorInfo_; + private com.google.protobuf.SingleFieldBuilder< + com.openpositioning.PositionMe.Traj.SensorInfo, com.openpositioning.PositionMe.Traj.SensorInfo.Builder, com.openpositioning.PositionMe.Traj.SensorInfoOrBuilder> rotationVectorInfoBuilder_; + /** + * .SensorInfo rotation_vector_info = 21; + * @return Whether the rotationVectorInfo field is set. + */ + public boolean hasRotationVectorInfo() { + return ((bitField0_ & 0x00100000) != 0); + } + /** + * .SensorInfo rotation_vector_info = 21; + * @return The rotationVectorInfo. + */ + public com.openpositioning.PositionMe.Traj.SensorInfo getRotationVectorInfo() { + if (rotationVectorInfoBuilder_ == null) { + return rotationVectorInfo_ == null ? com.openpositioning.PositionMe.Traj.SensorInfo.getDefaultInstance() : rotationVectorInfo_; + } else { + return rotationVectorInfoBuilder_.getMessage(); + } + } + /** + * .SensorInfo rotation_vector_info = 21; + */ + public Builder setRotationVectorInfo(com.openpositioning.PositionMe.Traj.SensorInfo value) { + if (rotationVectorInfoBuilder_ == null) { + if (value == null) { + throw new NullPointerException(); + } + rotationVectorInfo_ = value; + } else { + rotationVectorInfoBuilder_.setMessage(value); + } + bitField0_ |= 0x00100000; + onChanged(); + return this; + } + /** + * .SensorInfo rotation_vector_info = 21; + */ + public Builder setRotationVectorInfo( + com.openpositioning.PositionMe.Traj.SensorInfo.Builder builderForValue) { + if (rotationVectorInfoBuilder_ == null) { + rotationVectorInfo_ = builderForValue.build(); + } else { + rotationVectorInfoBuilder_.setMessage(builderForValue.build()); + } + bitField0_ |= 0x00100000; + onChanged(); + return this; + } + /** + * .SensorInfo rotation_vector_info = 21; + */ + public Builder mergeRotationVectorInfo(com.openpositioning.PositionMe.Traj.SensorInfo value) { + if (rotationVectorInfoBuilder_ == null) { + if (((bitField0_ & 0x00100000) != 0) && + rotationVectorInfo_ != null && + rotationVectorInfo_ != com.openpositioning.PositionMe.Traj.SensorInfo.getDefaultInstance()) { + getRotationVectorInfoBuilder().mergeFrom(value); + } else { + rotationVectorInfo_ = value; + } + } else { + rotationVectorInfoBuilder_.mergeFrom(value); + } + if (rotationVectorInfo_ != null) { + bitField0_ |= 0x00100000; + onChanged(); + } + return this; + } + /** + * .SensorInfo rotation_vector_info = 21; + */ + public Builder clearRotationVectorInfo() { + bitField0_ = (bitField0_ & ~0x00100000); + rotationVectorInfo_ = null; + if (rotationVectorInfoBuilder_ != null) { + rotationVectorInfoBuilder_.dispose(); + rotationVectorInfoBuilder_ = null; + } + onChanged(); + return this; + } + /** + * .SensorInfo rotation_vector_info = 21; + */ + public com.openpositioning.PositionMe.Traj.SensorInfo.Builder getRotationVectorInfoBuilder() { + bitField0_ |= 0x00100000; + onChanged(); + return getRotationVectorInfoFieldBuilder().getBuilder(); + } + /** + * .SensorInfo rotation_vector_info = 21; + */ + public com.openpositioning.PositionMe.Traj.SensorInfoOrBuilder getRotationVectorInfoOrBuilder() { + if (rotationVectorInfoBuilder_ != null) { + return rotationVectorInfoBuilder_.getMessageOrBuilder(); + } else { + return rotationVectorInfo_ == null ? + com.openpositioning.PositionMe.Traj.SensorInfo.getDefaultInstance() : rotationVectorInfo_; + } + } + /** + * .SensorInfo rotation_vector_info = 21; + */ + private com.google.protobuf.SingleFieldBuilder< + com.openpositioning.PositionMe.Traj.SensorInfo, com.openpositioning.PositionMe.Traj.SensorInfo.Builder, com.openpositioning.PositionMe.Traj.SensorInfoOrBuilder> + getRotationVectorInfoFieldBuilder() { + if (rotationVectorInfoBuilder_ == null) { + rotationVectorInfoBuilder_ = new com.google.protobuf.SingleFieldBuilder< + com.openpositioning.PositionMe.Traj.SensorInfo, com.openpositioning.PositionMe.Traj.SensorInfo.Builder, com.openpositioning.PositionMe.Traj.SensorInfoOrBuilder>( + getRotationVectorInfo(), + getParentForChildren(), + isClean()); + rotationVectorInfo_ = null; + } + return rotationVectorInfoBuilder_; + } + + private com.openpositioning.PositionMe.Traj.SensorInfo magnetometerInfo_; + private com.google.protobuf.SingleFieldBuilder< + com.openpositioning.PositionMe.Traj.SensorInfo, com.openpositioning.PositionMe.Traj.SensorInfo.Builder, com.openpositioning.PositionMe.Traj.SensorInfoOrBuilder> magnetometerInfoBuilder_; + /** + * .SensorInfo magnetometer_info = 22; + * @return Whether the magnetometerInfo field is set. + */ + public boolean hasMagnetometerInfo() { + return ((bitField0_ & 0x00200000) != 0); + } + /** + * .SensorInfo magnetometer_info = 22; + * @return The magnetometerInfo. + */ + public com.openpositioning.PositionMe.Traj.SensorInfo getMagnetometerInfo() { + if (magnetometerInfoBuilder_ == null) { + return magnetometerInfo_ == null ? com.openpositioning.PositionMe.Traj.SensorInfo.getDefaultInstance() : magnetometerInfo_; + } else { + return magnetometerInfoBuilder_.getMessage(); + } + } + /** + * .SensorInfo magnetometer_info = 22; + */ + public Builder setMagnetometerInfo(com.openpositioning.PositionMe.Traj.SensorInfo value) { + if (magnetometerInfoBuilder_ == null) { + if (value == null) { + throw new NullPointerException(); + } + magnetometerInfo_ = value; + } else { + magnetometerInfoBuilder_.setMessage(value); + } + bitField0_ |= 0x00200000; + onChanged(); + return this; + } + /** + * .SensorInfo magnetometer_info = 22; + */ + public Builder setMagnetometerInfo( + com.openpositioning.PositionMe.Traj.SensorInfo.Builder builderForValue) { + if (magnetometerInfoBuilder_ == null) { + magnetometerInfo_ = builderForValue.build(); + } else { + magnetometerInfoBuilder_.setMessage(builderForValue.build()); + } + bitField0_ |= 0x00200000; + onChanged(); + return this; + } + /** + * .SensorInfo magnetometer_info = 22; + */ + public Builder mergeMagnetometerInfo(com.openpositioning.PositionMe.Traj.SensorInfo value) { + if (magnetometerInfoBuilder_ == null) { + if (((bitField0_ & 0x00200000) != 0) && + magnetometerInfo_ != null && + magnetometerInfo_ != com.openpositioning.PositionMe.Traj.SensorInfo.getDefaultInstance()) { + getMagnetometerInfoBuilder().mergeFrom(value); + } else { + magnetometerInfo_ = value; + } + } else { + magnetometerInfoBuilder_.mergeFrom(value); + } + if (magnetometerInfo_ != null) { + bitField0_ |= 0x00200000; + onChanged(); + } + return this; + } + /** + * .SensorInfo magnetometer_info = 22; + */ + public Builder clearMagnetometerInfo() { + bitField0_ = (bitField0_ & ~0x00200000); + magnetometerInfo_ = null; + if (magnetometerInfoBuilder_ != null) { + magnetometerInfoBuilder_.dispose(); + magnetometerInfoBuilder_ = null; + } + onChanged(); + return this; + } + /** + * .SensorInfo magnetometer_info = 22; + */ + public com.openpositioning.PositionMe.Traj.SensorInfo.Builder getMagnetometerInfoBuilder() { + bitField0_ |= 0x00200000; + onChanged(); + return getMagnetometerInfoFieldBuilder().getBuilder(); + } + /** + * .SensorInfo magnetometer_info = 22; + */ + public com.openpositioning.PositionMe.Traj.SensorInfoOrBuilder getMagnetometerInfoOrBuilder() { + if (magnetometerInfoBuilder_ != null) { + return magnetometerInfoBuilder_.getMessageOrBuilder(); + } else { + return magnetometerInfo_ == null ? + com.openpositioning.PositionMe.Traj.SensorInfo.getDefaultInstance() : magnetometerInfo_; + } + } + /** + * .SensorInfo magnetometer_info = 22; + */ + private com.google.protobuf.SingleFieldBuilder< + com.openpositioning.PositionMe.Traj.SensorInfo, com.openpositioning.PositionMe.Traj.SensorInfo.Builder, com.openpositioning.PositionMe.Traj.SensorInfoOrBuilder> + getMagnetometerInfoFieldBuilder() { + if (magnetometerInfoBuilder_ == null) { + magnetometerInfoBuilder_ = new com.google.protobuf.SingleFieldBuilder< + com.openpositioning.PositionMe.Traj.SensorInfo, com.openpositioning.PositionMe.Traj.SensorInfo.Builder, com.openpositioning.PositionMe.Traj.SensorInfoOrBuilder>( + getMagnetometerInfo(), + getParentForChildren(), + isClean()); + magnetometerInfo_ = null; + } + return magnetometerInfoBuilder_; + } + + private com.openpositioning.PositionMe.Traj.SensorInfo barometerInfo_; + private com.google.protobuf.SingleFieldBuilder< + com.openpositioning.PositionMe.Traj.SensorInfo, com.openpositioning.PositionMe.Traj.SensorInfo.Builder, com.openpositioning.PositionMe.Traj.SensorInfoOrBuilder> barometerInfoBuilder_; + /** + * .SensorInfo barometer_info = 23; + * @return Whether the barometerInfo field is set. + */ + public boolean hasBarometerInfo() { + return ((bitField0_ & 0x00400000) != 0); + } + /** + * .SensorInfo barometer_info = 23; + * @return The barometerInfo. + */ + public com.openpositioning.PositionMe.Traj.SensorInfo getBarometerInfo() { + if (barometerInfoBuilder_ == null) { + return barometerInfo_ == null ? com.openpositioning.PositionMe.Traj.SensorInfo.getDefaultInstance() : barometerInfo_; + } else { + return barometerInfoBuilder_.getMessage(); + } + } + /** + * .SensorInfo barometer_info = 23; + */ + public Builder setBarometerInfo(com.openpositioning.PositionMe.Traj.SensorInfo value) { + if (barometerInfoBuilder_ == null) { + if (value == null) { + throw new NullPointerException(); + } + barometerInfo_ = value; + } else { + barometerInfoBuilder_.setMessage(value); + } + bitField0_ |= 0x00400000; + onChanged(); + return this; + } + /** + * .SensorInfo barometer_info = 23; + */ + public Builder setBarometerInfo( + com.openpositioning.PositionMe.Traj.SensorInfo.Builder builderForValue) { + if (barometerInfoBuilder_ == null) { + barometerInfo_ = builderForValue.build(); + } else { + barometerInfoBuilder_.setMessage(builderForValue.build()); + } + bitField0_ |= 0x00400000; + onChanged(); + return this; + } + /** + * .SensorInfo barometer_info = 23; + */ + public Builder mergeBarometerInfo(com.openpositioning.PositionMe.Traj.SensorInfo value) { + if (barometerInfoBuilder_ == null) { + if (((bitField0_ & 0x00400000) != 0) && + barometerInfo_ != null && + barometerInfo_ != com.openpositioning.PositionMe.Traj.SensorInfo.getDefaultInstance()) { + getBarometerInfoBuilder().mergeFrom(value); + } else { + barometerInfo_ = value; + } + } else { + barometerInfoBuilder_.mergeFrom(value); + } + if (barometerInfo_ != null) { + bitField0_ |= 0x00400000; + onChanged(); + } + return this; + } + /** + * .SensorInfo barometer_info = 23; + */ + public Builder clearBarometerInfo() { + bitField0_ = (bitField0_ & ~0x00400000); + barometerInfo_ = null; + if (barometerInfoBuilder_ != null) { + barometerInfoBuilder_.dispose(); + barometerInfoBuilder_ = null; + } + onChanged(); + return this; + } + /** + * .SensorInfo barometer_info = 23; + */ + public com.openpositioning.PositionMe.Traj.SensorInfo.Builder getBarometerInfoBuilder() { + bitField0_ |= 0x00400000; + onChanged(); + return getBarometerInfoFieldBuilder().getBuilder(); + } + /** + * .SensorInfo barometer_info = 23; + */ + public com.openpositioning.PositionMe.Traj.SensorInfoOrBuilder getBarometerInfoOrBuilder() { + if (barometerInfoBuilder_ != null) { + return barometerInfoBuilder_.getMessageOrBuilder(); + } else { + return barometerInfo_ == null ? + com.openpositioning.PositionMe.Traj.SensorInfo.getDefaultInstance() : barometerInfo_; + } + } + /** + * .SensorInfo barometer_info = 23; + */ + private com.google.protobuf.SingleFieldBuilder< + com.openpositioning.PositionMe.Traj.SensorInfo, com.openpositioning.PositionMe.Traj.SensorInfo.Builder, com.openpositioning.PositionMe.Traj.SensorInfoOrBuilder> + getBarometerInfoFieldBuilder() { + if (barometerInfoBuilder_ == null) { + barometerInfoBuilder_ = new com.google.protobuf.SingleFieldBuilder< + com.openpositioning.PositionMe.Traj.SensorInfo, com.openpositioning.PositionMe.Traj.SensorInfo.Builder, com.openpositioning.PositionMe.Traj.SensorInfoOrBuilder>( + getBarometerInfo(), + getParentForChildren(), + isClean()); + barometerInfo_ = null; + } + return barometerInfoBuilder_; + } + + private com.openpositioning.PositionMe.Traj.SensorInfo lightSensorInfo_; + private com.google.protobuf.SingleFieldBuilder< + com.openpositioning.PositionMe.Traj.SensorInfo, com.openpositioning.PositionMe.Traj.SensorInfo.Builder, com.openpositioning.PositionMe.Traj.SensorInfoOrBuilder> lightSensorInfoBuilder_; + /** + * .SensorInfo light_SensorInfo = 24; + * @return Whether the lightSensorInfo field is set. + */ + public boolean hasLightSensorInfo() { + return ((bitField0_ & 0x00800000) != 0); + } + /** + * .SensorInfo light_SensorInfo = 24; + * @return The lightSensorInfo. + */ + public com.openpositioning.PositionMe.Traj.SensorInfo getLightSensorInfo() { + if (lightSensorInfoBuilder_ == null) { + return lightSensorInfo_ == null ? com.openpositioning.PositionMe.Traj.SensorInfo.getDefaultInstance() : lightSensorInfo_; + } else { + return lightSensorInfoBuilder_.getMessage(); + } + } + /** + * .SensorInfo light_SensorInfo = 24; + */ + public Builder setLightSensorInfo(com.openpositioning.PositionMe.Traj.SensorInfo value) { + if (lightSensorInfoBuilder_ == null) { + if (value == null) { + throw new NullPointerException(); + } + lightSensorInfo_ = value; + } else { + lightSensorInfoBuilder_.setMessage(value); + } + bitField0_ |= 0x00800000; + onChanged(); + return this; + } + /** + * .SensorInfo light_SensorInfo = 24; + */ + public Builder setLightSensorInfo( + com.openpositioning.PositionMe.Traj.SensorInfo.Builder builderForValue) { + if (lightSensorInfoBuilder_ == null) { + lightSensorInfo_ = builderForValue.build(); + } else { + lightSensorInfoBuilder_.setMessage(builderForValue.build()); + } + bitField0_ |= 0x00800000; + onChanged(); + return this; + } + /** + * .SensorInfo light_SensorInfo = 24; + */ + public Builder mergeLightSensorInfo(com.openpositioning.PositionMe.Traj.SensorInfo value) { + if (lightSensorInfoBuilder_ == null) { + if (((bitField0_ & 0x00800000) != 0) && + lightSensorInfo_ != null && + lightSensorInfo_ != com.openpositioning.PositionMe.Traj.SensorInfo.getDefaultInstance()) { + getLightSensorInfoBuilder().mergeFrom(value); + } else { + lightSensorInfo_ = value; + } + } else { + lightSensorInfoBuilder_.mergeFrom(value); + } + if (lightSensorInfo_ != null) { + bitField0_ |= 0x00800000; + onChanged(); + } + return this; + } + /** + * .SensorInfo light_SensorInfo = 24; + */ + public Builder clearLightSensorInfo() { + bitField0_ = (bitField0_ & ~0x00800000); + lightSensorInfo_ = null; + if (lightSensorInfoBuilder_ != null) { + lightSensorInfoBuilder_.dispose(); + lightSensorInfoBuilder_ = null; + } + onChanged(); + return this; + } + /** + * .SensorInfo light_SensorInfo = 24; + */ + public com.openpositioning.PositionMe.Traj.SensorInfo.Builder getLightSensorInfoBuilder() { + bitField0_ |= 0x00800000; + onChanged(); + return getLightSensorInfoFieldBuilder().getBuilder(); + } + /** + * .SensorInfo light_SensorInfo = 24; + */ + public com.openpositioning.PositionMe.Traj.SensorInfoOrBuilder getLightSensorInfoOrBuilder() { + if (lightSensorInfoBuilder_ != null) { + return lightSensorInfoBuilder_.getMessageOrBuilder(); + } else { + return lightSensorInfo_ == null ? + com.openpositioning.PositionMe.Traj.SensorInfo.getDefaultInstance() : lightSensorInfo_; + } + } + /** + * .SensorInfo light_SensorInfo = 24; + */ + private com.google.protobuf.SingleFieldBuilder< + com.openpositioning.PositionMe.Traj.SensorInfo, com.openpositioning.PositionMe.Traj.SensorInfo.Builder, com.openpositioning.PositionMe.Traj.SensorInfoOrBuilder> + getLightSensorInfoFieldBuilder() { + if (lightSensorInfoBuilder_ == null) { + lightSensorInfoBuilder_ = new com.google.protobuf.SingleFieldBuilder< + com.openpositioning.PositionMe.Traj.SensorInfo, com.openpositioning.PositionMe.Traj.SensorInfo.Builder, com.openpositioning.PositionMe.Traj.SensorInfoOrBuilder>( + getLightSensorInfo(), + getParentForChildren(), + isClean()); + lightSensorInfo_ = null; + } + return lightSensorInfoBuilder_; + } + + private com.openpositioning.PositionMe.Traj.SensorInfo proximityInfo_; + private com.google.protobuf.SingleFieldBuilder< + com.openpositioning.PositionMe.Traj.SensorInfo, com.openpositioning.PositionMe.Traj.SensorInfo.Builder, com.openpositioning.PositionMe.Traj.SensorInfoOrBuilder> proximityInfoBuilder_; + /** + * .SensorInfo proximity_info = 25; + * @return Whether the proximityInfo field is set. + */ + public boolean hasProximityInfo() { + return ((bitField0_ & 0x01000000) != 0); + } + /** + * .SensorInfo proximity_info = 25; + * @return The proximityInfo. + */ + public com.openpositioning.PositionMe.Traj.SensorInfo getProximityInfo() { + if (proximityInfoBuilder_ == null) { + return proximityInfo_ == null ? com.openpositioning.PositionMe.Traj.SensorInfo.getDefaultInstance() : proximityInfo_; + } else { + return proximityInfoBuilder_.getMessage(); + } + } + /** + * .SensorInfo proximity_info = 25; + */ + public Builder setProximityInfo(com.openpositioning.PositionMe.Traj.SensorInfo value) { + if (proximityInfoBuilder_ == null) { + if (value == null) { + throw new NullPointerException(); + } + proximityInfo_ = value; + } else { + proximityInfoBuilder_.setMessage(value); + } + bitField0_ |= 0x01000000; + onChanged(); + return this; + } + /** + * .SensorInfo proximity_info = 25; + */ + public Builder setProximityInfo( + com.openpositioning.PositionMe.Traj.SensorInfo.Builder builderForValue) { + if (proximityInfoBuilder_ == null) { + proximityInfo_ = builderForValue.build(); + } else { + proximityInfoBuilder_.setMessage(builderForValue.build()); + } + bitField0_ |= 0x01000000; + onChanged(); + return this; + } + /** + * .SensorInfo proximity_info = 25; + */ + public Builder mergeProximityInfo(com.openpositioning.PositionMe.Traj.SensorInfo value) { + if (proximityInfoBuilder_ == null) { + if (((bitField0_ & 0x01000000) != 0) && + proximityInfo_ != null && + proximityInfo_ != com.openpositioning.PositionMe.Traj.SensorInfo.getDefaultInstance()) { + getProximityInfoBuilder().mergeFrom(value); + } else { + proximityInfo_ = value; + } + } else { + proximityInfoBuilder_.mergeFrom(value); + } + if (proximityInfo_ != null) { + bitField0_ |= 0x01000000; + onChanged(); + } + return this; + } + /** + * .SensorInfo proximity_info = 25; + */ + public Builder clearProximityInfo() { + bitField0_ = (bitField0_ & ~0x01000000); + proximityInfo_ = null; + if (proximityInfoBuilder_ != null) { + proximityInfoBuilder_.dispose(); + proximityInfoBuilder_ = null; + } + onChanged(); + return this; + } + /** + * .SensorInfo proximity_info = 25; + */ + public com.openpositioning.PositionMe.Traj.SensorInfo.Builder getProximityInfoBuilder() { + bitField0_ |= 0x01000000; + onChanged(); + return getProximityInfoFieldBuilder().getBuilder(); + } + /** + * .SensorInfo proximity_info = 25; + */ + public com.openpositioning.PositionMe.Traj.SensorInfoOrBuilder getProximityInfoOrBuilder() { + if (proximityInfoBuilder_ != null) { + return proximityInfoBuilder_.getMessageOrBuilder(); + } else { + return proximityInfo_ == null ? + com.openpositioning.PositionMe.Traj.SensorInfo.getDefaultInstance() : proximityInfo_; + } + } + /** + * .SensorInfo proximity_info = 25; + */ + private com.google.protobuf.SingleFieldBuilder< + com.openpositioning.PositionMe.Traj.SensorInfo, com.openpositioning.PositionMe.Traj.SensorInfo.Builder, com.openpositioning.PositionMe.Traj.SensorInfoOrBuilder> + getProximityInfoFieldBuilder() { + if (proximityInfoBuilder_ == null) { + proximityInfoBuilder_ = new com.google.protobuf.SingleFieldBuilder< + com.openpositioning.PositionMe.Traj.SensorInfo, com.openpositioning.PositionMe.Traj.SensorInfo.Builder, com.openpositioning.PositionMe.Traj.SensorInfoOrBuilder>( + getProximityInfo(), + getParentForChildren(), + isClean()); + proximityInfo_ = null; + } + return proximityInfoBuilder_; + } + + private java.util.List testPoints_ = + java.util.Collections.emptyList(); + private void ensureTestPointsIsMutable() { + if (!((bitField0_ & 0x02000000) != 0)) { + testPoints_ = new java.util.ArrayList(testPoints_); + bitField0_ |= 0x02000000; + } + } + + private com.google.protobuf.RepeatedFieldBuilder< + com.openpositioning.PositionMe.Traj.GNSSPosition, com.openpositioning.PositionMe.Traj.GNSSPosition.Builder, com.openpositioning.PositionMe.Traj.GNSSPositionOrBuilder> testPointsBuilder_; + + /** + * repeated .GNSSPosition test_points = 26; + */ + public java.util.List getTestPointsList() { + if (testPointsBuilder_ == null) { + return java.util.Collections.unmodifiableList(testPoints_); + } else { + return testPointsBuilder_.getMessageList(); + } + } + /** + * repeated .GNSSPosition test_points = 26; + */ + public int getTestPointsCount() { + if (testPointsBuilder_ == null) { + return testPoints_.size(); + } else { + return testPointsBuilder_.getCount(); + } + } + /** + * repeated .GNSSPosition test_points = 26; + */ + public com.openpositioning.PositionMe.Traj.GNSSPosition getTestPoints(int index) { + if (testPointsBuilder_ == null) { + return testPoints_.get(index); + } else { + return testPointsBuilder_.getMessage(index); + } + } + /** + * repeated .GNSSPosition test_points = 26; + */ + public Builder setTestPoints( + int index, com.openpositioning.PositionMe.Traj.GNSSPosition value) { + if (testPointsBuilder_ == null) { + if (value == null) { + throw new NullPointerException(); + } + ensureTestPointsIsMutable(); + testPoints_.set(index, value); + onChanged(); + } else { + testPointsBuilder_.setMessage(index, value); + } + return this; + } + /** + * repeated .GNSSPosition test_points = 26; + */ + public Builder setTestPoints( + int index, com.openpositioning.PositionMe.Traj.GNSSPosition.Builder builderForValue) { + if (testPointsBuilder_ == null) { + ensureTestPointsIsMutable(); + testPoints_.set(index, builderForValue.build()); + onChanged(); + } else { + testPointsBuilder_.setMessage(index, builderForValue.build()); + } + return this; + } + /** + * repeated .GNSSPosition test_points = 26; + */ + public Builder addTestPoints(com.openpositioning.PositionMe.Traj.GNSSPosition value) { + if (testPointsBuilder_ == null) { + if (value == null) { + throw new NullPointerException(); + } + ensureTestPointsIsMutable(); + testPoints_.add(value); + onChanged(); + } else { + testPointsBuilder_.addMessage(value); + } + return this; + } + /** + * repeated .GNSSPosition test_points = 26; + */ + public Builder addTestPoints( + int index, com.openpositioning.PositionMe.Traj.GNSSPosition value) { + if (testPointsBuilder_ == null) { + if (value == null) { + throw new NullPointerException(); + } + ensureTestPointsIsMutable(); + testPoints_.add(index, value); + onChanged(); + } else { + testPointsBuilder_.addMessage(index, value); + } + return this; + } + /** + * repeated .GNSSPosition test_points = 26; + */ + public Builder addTestPoints( + com.openpositioning.PositionMe.Traj.GNSSPosition.Builder builderForValue) { + if (testPointsBuilder_ == null) { + ensureTestPointsIsMutable(); + testPoints_.add(builderForValue.build()); + onChanged(); + } else { + testPointsBuilder_.addMessage(builderForValue.build()); + } + return this; + } + /** + * repeated .GNSSPosition test_points = 26; + */ + public Builder addTestPoints( + int index, com.openpositioning.PositionMe.Traj.GNSSPosition.Builder builderForValue) { + if (testPointsBuilder_ == null) { + ensureTestPointsIsMutable(); + testPoints_.add(index, builderForValue.build()); + onChanged(); + } else { + testPointsBuilder_.addMessage(index, builderForValue.build()); + } + return this; + } + /** + * repeated .GNSSPosition test_points = 26; + */ + public Builder addAllTestPoints( + java.lang.Iterable values) { + if (testPointsBuilder_ == null) { + ensureTestPointsIsMutable(); + com.google.protobuf.AbstractMessageLite.Builder.addAll( + values, testPoints_); + onChanged(); + } else { + testPointsBuilder_.addAllMessages(values); + } + return this; + } + /** + * repeated .GNSSPosition test_points = 26; + */ + public Builder clearTestPoints() { + if (testPointsBuilder_ == null) { + testPoints_ = java.util.Collections.emptyList(); + bitField0_ = (bitField0_ & ~0x02000000); + onChanged(); + } else { + testPointsBuilder_.clear(); + } + return this; + } + /** + * repeated .GNSSPosition test_points = 26; + */ + public Builder removeTestPoints(int index) { + if (testPointsBuilder_ == null) { + ensureTestPointsIsMutable(); + testPoints_.remove(index); + onChanged(); + } else { + testPointsBuilder_.remove(index); + } + return this; + } + /** + * repeated .GNSSPosition test_points = 26; + */ + public com.openpositioning.PositionMe.Traj.GNSSPosition.Builder getTestPointsBuilder( + int index) { + return getTestPointsFieldBuilder().getBuilder(index); + } + /** + * repeated .GNSSPosition test_points = 26; + */ + public com.openpositioning.PositionMe.Traj.GNSSPositionOrBuilder getTestPointsOrBuilder( + int index) { + if (testPointsBuilder_ == null) { + return testPoints_.get(index); } else { + return testPointsBuilder_.getMessageOrBuilder(index); + } + } + /** + * repeated .GNSSPosition test_points = 26; + */ + public java.util.List + getTestPointsOrBuilderList() { + if (testPointsBuilder_ != null) { + return testPointsBuilder_.getMessageOrBuilderList(); + } else { + return java.util.Collections.unmodifiableList(testPoints_); + } + } + /** + * repeated .GNSSPosition test_points = 26; + */ + public com.openpositioning.PositionMe.Traj.GNSSPosition.Builder addTestPointsBuilder() { + return getTestPointsFieldBuilder().addBuilder( + com.openpositioning.PositionMe.Traj.GNSSPosition.getDefaultInstance()); + } + /** + * repeated .GNSSPosition test_points = 26; + */ + public com.openpositioning.PositionMe.Traj.GNSSPosition.Builder addTestPointsBuilder( + int index) { + return getTestPointsFieldBuilder().addBuilder( + index, com.openpositioning.PositionMe.Traj.GNSSPosition.getDefaultInstance()); + } + /** + * repeated .GNSSPosition test_points = 26; + */ + public java.util.List + getTestPointsBuilderList() { + return getTestPointsFieldBuilder().getBuilderList(); + } + private com.google.protobuf.RepeatedFieldBuilder< + com.openpositioning.PositionMe.Traj.GNSSPosition, com.openpositioning.PositionMe.Traj.GNSSPosition.Builder, com.openpositioning.PositionMe.Traj.GNSSPositionOrBuilder> + getTestPointsFieldBuilder() { + if (testPointsBuilder_ == null) { + testPointsBuilder_ = new com.google.protobuf.RepeatedFieldBuilder< + com.openpositioning.PositionMe.Traj.GNSSPosition, com.openpositioning.PositionMe.Traj.GNSSPosition.Builder, com.openpositioning.PositionMe.Traj.GNSSPositionOrBuilder>( + testPoints_, + ((bitField0_ & 0x02000000) != 0), + getParentForChildren(), + isClean()); + testPoints_ = null; + } + return testPointsBuilder_; + } + + // @@protoc_insertion_point(builder_scope:Trajectory) + } + + // @@protoc_insertion_point(class_scope:Trajectory) + private static final com.openpositioning.PositionMe.Traj.Trajectory DEFAULT_INSTANCE; + static { + DEFAULT_INSTANCE = new com.openpositioning.PositionMe.Traj.Trajectory(); + } + + public static com.openpositioning.PositionMe.Traj.Trajectory getDefaultInstance() { + return DEFAULT_INSTANCE; + } + + private static final com.google.protobuf.Parser + PARSER = new com.google.protobuf.AbstractParser() { + @java.lang.Override + public Trajectory parsePartialFrom( + com.google.protobuf.CodedInputStream input, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + Builder builder = newBuilder(); + try { + builder.mergeFrom(input, extensionRegistry); + } catch (com.google.protobuf.InvalidProtocolBufferException e) { + throw e.setUnfinishedMessage(builder.buildPartial()); + } catch (com.google.protobuf.UninitializedMessageException e) { + throw e.asInvalidProtocolBufferException().setUnfinishedMessage(builder.buildPartial()); + } catch (java.io.IOException e) { + throw new com.google.protobuf.InvalidProtocolBufferException(e) + .setUnfinishedMessage(builder.buildPartial()); + } + return builder.buildPartial(); + } + }; + + public static com.google.protobuf.Parser parser() { + return PARSER; + } + + @java.lang.Override + public com.google.protobuf.Parser getParserForType() { + return PARSER; + } + + @java.lang.Override + public com.openpositioning.PositionMe.Traj.Trajectory getDefaultInstanceForType() { + return DEFAULT_INSTANCE; + } + + } + + public interface RelativePositionOrBuilder extends + // @@protoc_insertion_point(interface_extends:RelativePosition) + com.google.protobuf.MessageOrBuilder { + + /** + *
+     * milliseconds from the start_timestamp
+     * 
+ * + * int64 relative_timestamp = 1; + * @return The relativeTimestamp. + */ + long getRelativeTimestamp(); + + /** + *
+     * Both in metres. You should implement an algorithm to estimate
+     * these values. The values are always relative to your start point
+     * so the first entry should always be x = 0.0, y = 0.0
+     * 
+ * + * float x = 2; + * @return The x. + */ + float getX(); + + /** + * float y = 3; + * @return The y. + */ + float getY(); + } + /** + * Protobuf type {@code RelativePosition} + */ + public static final class RelativePosition extends + com.google.protobuf.GeneratedMessage implements + // @@protoc_insertion_point(message_implements:RelativePosition) + RelativePositionOrBuilder { + private static final long serialVersionUID = 0L; + static { + com.google.protobuf.RuntimeVersion.validateProtobufGencodeVersion( + com.google.protobuf.RuntimeVersion.RuntimeDomain.PUBLIC, + /* major= */ 4, + /* minor= */ 29, + /* patch= */ 6, + /* suffix= */ "", + RelativePosition.class.getName()); + } + // Use RelativePosition.newBuilder() to construct. + private RelativePosition(com.google.protobuf.GeneratedMessage.Builder builder) { + super(builder); + } + private RelativePosition() { + } + + public static final com.google.protobuf.Descriptors.Descriptor + getDescriptor() { + return com.openpositioning.PositionMe.Traj.internal_static_RelativePosition_descriptor; + } + + @java.lang.Override + protected com.google.protobuf.GeneratedMessage.FieldAccessorTable + internalGetFieldAccessorTable() { + return com.openpositioning.PositionMe.Traj.internal_static_RelativePosition_fieldAccessorTable + .ensureFieldAccessorsInitialized( + com.openpositioning.PositionMe.Traj.RelativePosition.class, com.openpositioning.PositionMe.Traj.RelativePosition.Builder.class); + } + + public static final int RELATIVE_TIMESTAMP_FIELD_NUMBER = 1; + private long relativeTimestamp_ = 0L; + /** + *
+     * milliseconds from the start_timestamp
+     * 
+ * + * int64 relative_timestamp = 1; + * @return The relativeTimestamp. + */ + @java.lang.Override + public long getRelativeTimestamp() { + return relativeTimestamp_; + } + + public static final int X_FIELD_NUMBER = 2; + private float x_ = 0F; + /** + *
+     * Both in metres. You should implement an algorithm to estimate
+     * these values. The values are always relative to your start point
+     * so the first entry should always be x = 0.0, y = 0.0
+     * 
+ * + * float x = 2; + * @return The x. + */ + @java.lang.Override + public float getX() { + return x_; + } + + public static final int Y_FIELD_NUMBER = 3; + private float y_ = 0F; + /** + * float y = 3; + * @return The y. + */ + @java.lang.Override + public float getY() { + return y_; + } + + private byte memoizedIsInitialized = -1; + @java.lang.Override + public final boolean isInitialized() { + byte isInitialized = memoizedIsInitialized; + if (isInitialized == 1) return true; + if (isInitialized == 0) return false; + + memoizedIsInitialized = 1; + return true; + } + + @java.lang.Override + public void writeTo(com.google.protobuf.CodedOutputStream output) + throws java.io.IOException { + if (relativeTimestamp_ != 0L) { + output.writeInt64(1, relativeTimestamp_); + } + if (java.lang.Float.floatToRawIntBits(x_) != 0) { + output.writeFloat(2, x_); + } + if (java.lang.Float.floatToRawIntBits(y_) != 0) { + output.writeFloat(3, y_); + } + getUnknownFields().writeTo(output); + } + + @java.lang.Override + public int getSerializedSize() { + int size = memoizedSize; + if (size != -1) return size; + + size = 0; + if (relativeTimestamp_ != 0L) { + size += com.google.protobuf.CodedOutputStream + .computeInt64Size(1, relativeTimestamp_); + } + if (java.lang.Float.floatToRawIntBits(x_) != 0) { + size += com.google.protobuf.CodedOutputStream + .computeFloatSize(2, x_); + } + if (java.lang.Float.floatToRawIntBits(y_) != 0) { + size += com.google.protobuf.CodedOutputStream + .computeFloatSize(3, y_); + } + size += getUnknownFields().getSerializedSize(); + memoizedSize = size; + return size; + } + + @java.lang.Override + public boolean equals(final java.lang.Object obj) { + if (obj == this) { + return true; + } + if (!(obj instanceof com.openpositioning.PositionMe.Traj.RelativePosition)) { + return super.equals(obj); + } + com.openpositioning.PositionMe.Traj.RelativePosition other = (com.openpositioning.PositionMe.Traj.RelativePosition) obj; + + if (getRelativeTimestamp() + != other.getRelativeTimestamp()) return false; + if (java.lang.Float.floatToIntBits(getX()) + != java.lang.Float.floatToIntBits( + other.getX())) return false; + if (java.lang.Float.floatToIntBits(getY()) + != java.lang.Float.floatToIntBits( + other.getY())) return false; + if (!getUnknownFields().equals(other.getUnknownFields())) return false; + return true; + } + + @java.lang.Override + public int hashCode() { + if (memoizedHashCode != 0) { + return memoizedHashCode; + } + int hash = 41; + hash = (19 * hash) + getDescriptor().hashCode(); + hash = (37 * hash) + RELATIVE_TIMESTAMP_FIELD_NUMBER; + hash = (53 * hash) + com.google.protobuf.Internal.hashLong( + getRelativeTimestamp()); + hash = (37 * hash) + X_FIELD_NUMBER; + hash = (53 * hash) + java.lang.Float.floatToIntBits( + getX()); + hash = (37 * hash) + Y_FIELD_NUMBER; + hash = (53 * hash) + java.lang.Float.floatToIntBits( + getY()); + hash = (29 * hash) + getUnknownFields().hashCode(); + memoizedHashCode = hash; + return hash; + } + + public static com.openpositioning.PositionMe.Traj.RelativePosition parseFrom( + java.nio.ByteBuffer data) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + public static com.openpositioning.PositionMe.Traj.RelativePosition parseFrom( + java.nio.ByteBuffer data, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data, extensionRegistry); + } + public static com.openpositioning.PositionMe.Traj.RelativePosition parseFrom( + com.google.protobuf.ByteString data) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + public static com.openpositioning.PositionMe.Traj.RelativePosition parseFrom( + com.google.protobuf.ByteString data, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data, extensionRegistry); + } + public static com.openpositioning.PositionMe.Traj.RelativePosition parseFrom(byte[] data) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + public static com.openpositioning.PositionMe.Traj.RelativePosition parseFrom( + byte[] data, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data, extensionRegistry); + } + public static com.openpositioning.PositionMe.Traj.RelativePosition parseFrom(java.io.InputStream input) + throws java.io.IOException { + return com.google.protobuf.GeneratedMessage + .parseWithIOException(PARSER, input); + } + public static com.openpositioning.PositionMe.Traj.RelativePosition parseFrom( + java.io.InputStream input, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws java.io.IOException { + return com.google.protobuf.GeneratedMessage + .parseWithIOException(PARSER, input, extensionRegistry); + } + + public static com.openpositioning.PositionMe.Traj.RelativePosition parseDelimitedFrom(java.io.InputStream input) + throws java.io.IOException { + return com.google.protobuf.GeneratedMessage + .parseDelimitedWithIOException(PARSER, input); + } + + public static com.openpositioning.PositionMe.Traj.RelativePosition parseDelimitedFrom( + java.io.InputStream input, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws java.io.IOException { + return com.google.protobuf.GeneratedMessage + .parseDelimitedWithIOException(PARSER, input, extensionRegistry); + } + public static com.openpositioning.PositionMe.Traj.RelativePosition parseFrom( + com.google.protobuf.CodedInputStream input) + throws java.io.IOException { + return com.google.protobuf.GeneratedMessage + .parseWithIOException(PARSER, input); + } + public static com.openpositioning.PositionMe.Traj.RelativePosition parseFrom( + com.google.protobuf.CodedInputStream input, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws java.io.IOException { + return com.google.protobuf.GeneratedMessage + .parseWithIOException(PARSER, input, extensionRegistry); + } + + @java.lang.Override + public Builder newBuilderForType() { return newBuilder(); } + public static Builder newBuilder() { + return DEFAULT_INSTANCE.toBuilder(); + } + public static Builder newBuilder(com.openpositioning.PositionMe.Traj.RelativePosition prototype) { + return DEFAULT_INSTANCE.toBuilder().mergeFrom(prototype); + } + @java.lang.Override + public Builder toBuilder() { + return this == DEFAULT_INSTANCE + ? new Builder() : new Builder().mergeFrom(this); + } + + @java.lang.Override + protected Builder newBuilderForType( + com.google.protobuf.GeneratedMessage.BuilderParent parent) { + Builder builder = new Builder(parent); + return builder; + } + /** + * Protobuf type {@code RelativePosition} + */ + public static final class Builder extends + com.google.protobuf.GeneratedMessage.Builder implements + // @@protoc_insertion_point(builder_implements:RelativePosition) + com.openpositioning.PositionMe.Traj.RelativePositionOrBuilder { + public static final com.google.protobuf.Descriptors.Descriptor + getDescriptor() { + return com.openpositioning.PositionMe.Traj.internal_static_RelativePosition_descriptor; + } + + @java.lang.Override + protected com.google.protobuf.GeneratedMessage.FieldAccessorTable + internalGetFieldAccessorTable() { + return com.openpositioning.PositionMe.Traj.internal_static_RelativePosition_fieldAccessorTable + .ensureFieldAccessorsInitialized( + com.openpositioning.PositionMe.Traj.RelativePosition.class, com.openpositioning.PositionMe.Traj.RelativePosition.Builder.class); + } + + // Construct using com.openpositioning.PositionMe.Traj.RelativePosition.newBuilder() + private Builder() { + + } + + private Builder( + com.google.protobuf.GeneratedMessage.BuilderParent parent) { + super(parent); + + } + @java.lang.Override + public Builder clear() { + super.clear(); + bitField0_ = 0; + relativeTimestamp_ = 0L; + x_ = 0F; + y_ = 0F; + return this; + } + + @java.lang.Override + public com.google.protobuf.Descriptors.Descriptor + getDescriptorForType() { + return com.openpositioning.PositionMe.Traj.internal_static_RelativePosition_descriptor; + } + + @java.lang.Override + public com.openpositioning.PositionMe.Traj.RelativePosition getDefaultInstanceForType() { + return com.openpositioning.PositionMe.Traj.RelativePosition.getDefaultInstance(); + } + + @java.lang.Override + public com.openpositioning.PositionMe.Traj.RelativePosition build() { + com.openpositioning.PositionMe.Traj.RelativePosition result = buildPartial(); + if (!result.isInitialized()) { + throw newUninitializedMessageException(result); + } + return result; + } + + @java.lang.Override + public com.openpositioning.PositionMe.Traj.RelativePosition buildPartial() { + com.openpositioning.PositionMe.Traj.RelativePosition result = new com.openpositioning.PositionMe.Traj.RelativePosition(this); + if (bitField0_ != 0) { buildPartial0(result); } + onBuilt(); + return result; + } + + private void buildPartial0(com.openpositioning.PositionMe.Traj.RelativePosition result) { + int from_bitField0_ = bitField0_; + if (((from_bitField0_ & 0x00000001) != 0)) { + result.relativeTimestamp_ = relativeTimestamp_; + } + if (((from_bitField0_ & 0x00000002) != 0)) { + result.x_ = x_; + } + if (((from_bitField0_ & 0x00000004) != 0)) { + result.y_ = y_; + } + } + + @java.lang.Override + public Builder mergeFrom(com.google.protobuf.Message other) { + if (other instanceof com.openpositioning.PositionMe.Traj.RelativePosition) { + return mergeFrom((com.openpositioning.PositionMe.Traj.RelativePosition)other); + } else { + super.mergeFrom(other); + return this; + } + } + + public Builder mergeFrom(com.openpositioning.PositionMe.Traj.RelativePosition other) { + if (other == com.openpositioning.PositionMe.Traj.RelativePosition.getDefaultInstance()) return this; + if (other.getRelativeTimestamp() != 0L) { + setRelativeTimestamp(other.getRelativeTimestamp()); + } + if (other.getX() != 0F) { + setX(other.getX()); + } + if (other.getY() != 0F) { + setY(other.getY()); + } + this.mergeUnknownFields(other.getUnknownFields()); + onChanged(); + return this; + } + + @java.lang.Override + public final boolean isInitialized() { + return true; + } + + @java.lang.Override + public Builder mergeFrom( + com.google.protobuf.CodedInputStream input, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws java.io.IOException { + if (extensionRegistry == null) { + throw new java.lang.NullPointerException(); + } + try { + boolean done = false; + while (!done) { + int tag = input.readTag(); + switch (tag) { + case 0: + done = true; + break; + case 8: { + relativeTimestamp_ = input.readInt64(); + bitField0_ |= 0x00000001; + break; + } // case 8 + case 21: { + x_ = input.readFloat(); + bitField0_ |= 0x00000002; + break; + } // case 21 + case 29: { + y_ = input.readFloat(); + bitField0_ |= 0x00000004; + break; + } // case 29 + default: { + if (!super.parseUnknownField(input, extensionRegistry, tag)) { + done = true; // was an endgroup tag + } + break; + } // default: + } // switch (tag) + } // while (!done) + } catch (com.google.protobuf.InvalidProtocolBufferException e) { + throw e.unwrapIOException(); + } finally { + onChanged(); + } // finally + return this; + } + private int bitField0_; + + private long relativeTimestamp_ ; + /** + *
+       * milliseconds from the start_timestamp
+       * 
+ * + * int64 relative_timestamp = 1; + * @return The relativeTimestamp. + */ + @java.lang.Override + public long getRelativeTimestamp() { + return relativeTimestamp_; + } + /** + *
+       * milliseconds from the start_timestamp
+       * 
+ * + * int64 relative_timestamp = 1; + * @param value The relativeTimestamp to set. + * @return This builder for chaining. + */ + public Builder setRelativeTimestamp(long value) { + + relativeTimestamp_ = value; + bitField0_ |= 0x00000001; + onChanged(); + return this; + } + /** + *
+       * milliseconds from the start_timestamp
+       * 
+ * + * int64 relative_timestamp = 1; + * @return This builder for chaining. + */ + public Builder clearRelativeTimestamp() { + bitField0_ = (bitField0_ & ~0x00000001); + relativeTimestamp_ = 0L; + onChanged(); + return this; + } + + private float x_ ; + /** + *
+       * Both in metres. You should implement an algorithm to estimate
+       * these values. The values are always relative to your start point
+       * so the first entry should always be x = 0.0, y = 0.0
+       * 
+ * + * float x = 2; + * @return The x. + */ + @java.lang.Override + public float getX() { + return x_; + } + /** + *
+       * Both in metres. You should implement an algorithm to estimate
+       * these values. The values are always relative to your start point
+       * so the first entry should always be x = 0.0, y = 0.0
+       * 
+ * + * float x = 2; + * @param value The x to set. + * @return This builder for chaining. + */ + public Builder setX(float value) { + + x_ = value; + bitField0_ |= 0x00000002; + onChanged(); + return this; + } + /** + *
+       * Both in metres. You should implement an algorithm to estimate
+       * these values. The values are always relative to your start point
+       * so the first entry should always be x = 0.0, y = 0.0
+       * 
+ * + * float x = 2; + * @return This builder for chaining. + */ + public Builder clearX() { + bitField0_ = (bitField0_ & ~0x00000002); + x_ = 0F; + onChanged(); + return this; + } + + private float y_ ; + /** + * float y = 3; + * @return The y. + */ + @java.lang.Override + public float getY() { + return y_; + } + /** + * float y = 3; + * @param value The y to set. + * @return This builder for chaining. + */ + public Builder setY(float value) { + + y_ = value; + bitField0_ |= 0x00000004; + onChanged(); + return this; + } + /** + * float y = 3; + * @return This builder for chaining. + */ + public Builder clearY() { + bitField0_ = (bitField0_ & ~0x00000004); + y_ = 0F; + onChanged(); + return this; + } + + // @@protoc_insertion_point(builder_scope:RelativePosition) + } + + // @@protoc_insertion_point(class_scope:RelativePosition) + private static final com.openpositioning.PositionMe.Traj.RelativePosition DEFAULT_INSTANCE; + static { + DEFAULT_INSTANCE = new com.openpositioning.PositionMe.Traj.RelativePosition(); + } + + public static com.openpositioning.PositionMe.Traj.RelativePosition getDefaultInstance() { + return DEFAULT_INSTANCE; + } + + private static final com.google.protobuf.Parser + PARSER = new com.google.protobuf.AbstractParser() { + @java.lang.Override + public RelativePosition parsePartialFrom( + com.google.protobuf.CodedInputStream input, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + Builder builder = newBuilder(); + try { + builder.mergeFrom(input, extensionRegistry); + } catch (com.google.protobuf.InvalidProtocolBufferException e) { + throw e.setUnfinishedMessage(builder.buildPartial()); + } catch (com.google.protobuf.UninitializedMessageException e) { + throw e.asInvalidProtocolBufferException().setUnfinishedMessage(builder.buildPartial()); + } catch (java.io.IOException e) { + throw new com.google.protobuf.InvalidProtocolBufferException(e) + .setUnfinishedMessage(builder.buildPartial()); + } + return builder.buildPartial(); + } + }; + + public static com.google.protobuf.Parser parser() { + return PARSER; + } + + @java.lang.Override + public com.google.protobuf.Parser getParserForType() { + return PARSER; + } + + @java.lang.Override + public com.openpositioning.PositionMe.Traj.RelativePosition getDefaultInstanceForType() { + return DEFAULT_INSTANCE; + } + + } + + public interface IMUReadingOrBuilder extends + // @@protoc_insertion_point(interface_extends:IMUReading) + com.google.protobuf.MessageOrBuilder { + + /** + *
+     * milliseconds
+     * 
+ * + * int64 relative_timestamp = 1; + * @return The relativeTimestamp. + */ + long getRelativeTimestamp(); + + /** + *
+     * Accelerometer [m/s^2]
+     * 
+ * + * .Vector3 acc = 2; + * @return Whether the acc field is set. + */ + boolean hasAcc(); + /** + *
+     * Accelerometer [m/s^2]
+     * 
+ * + * .Vector3 acc = 2; + * @return The acc. + */ + com.openpositioning.PositionMe.Traj.Vector3 getAcc(); + /** + *
+     * Accelerometer [m/s^2]
+     * 
+ * + * .Vector3 acc = 2; + */ + com.openpositioning.PositionMe.Traj.Vector3OrBuilder getAccOrBuilder(); + + /** + *
+     * Gyroscope [radians/s]
+     * 
+ * + * .Vector3 gyr = 3; + * @return Whether the gyr field is set. + */ + boolean hasGyr(); + /** + *
+     * Gyroscope [radians/s]
+     * 
+ * + * .Vector3 gyr = 3; + * @return The gyr. + */ + com.openpositioning.PositionMe.Traj.Vector3 getGyr(); + /** + *
+     * Gyroscope [radians/s]
+     * 
+ * + * .Vector3 gyr = 3; + */ + com.openpositioning.PositionMe.Traj.Vector3OrBuilder getGyrOrBuilder(); + + /** + *
+     * Orientation [unitless], 4 components should square sum to ~1
+     * 
+ * + * .Quaternion rotation_vector = 4; + * @return Whether the rotationVector field is set. + */ + boolean hasRotationVector(); + /** + *
+     * Orientation [unitless], 4 components should square sum to ~1
+     * 
+ * + * .Quaternion rotation_vector = 4; + * @return The rotationVector. + */ + com.openpositioning.PositionMe.Traj.Quaternion getRotationVector(); + /** + *
+     * Orientation [unitless], 4 components should square sum to ~1
+     * 
+ * + * .Quaternion rotation_vector = 4; + */ + com.openpositioning.PositionMe.Traj.QuaternionOrBuilder getRotationVectorOrBuilder(); + + /** + *
+     * Number of steps so far
+     * 
+ * + * int32 step_count = 5; + * @return The stepCount. + */ + int getStepCount(); + } + /** + * Protobuf type {@code IMUReading} + */ + public static final class IMUReading extends + com.google.protobuf.GeneratedMessage implements + // @@protoc_insertion_point(message_implements:IMUReading) + IMUReadingOrBuilder { + private static final long serialVersionUID = 0L; + static { + com.google.protobuf.RuntimeVersion.validateProtobufGencodeVersion( + com.google.protobuf.RuntimeVersion.RuntimeDomain.PUBLIC, + /* major= */ 4, + /* minor= */ 29, + /* patch= */ 6, + /* suffix= */ "", + IMUReading.class.getName()); + } + // Use IMUReading.newBuilder() to construct. + private IMUReading(com.google.protobuf.GeneratedMessage.Builder builder) { + super(builder); + } + private IMUReading() { + } + + public static final com.google.protobuf.Descriptors.Descriptor + getDescriptor() { + return com.openpositioning.PositionMe.Traj.internal_static_IMUReading_descriptor; + } + + @java.lang.Override + protected com.google.protobuf.GeneratedMessage.FieldAccessorTable + internalGetFieldAccessorTable() { + return com.openpositioning.PositionMe.Traj.internal_static_IMUReading_fieldAccessorTable + .ensureFieldAccessorsInitialized( + com.openpositioning.PositionMe.Traj.IMUReading.class, com.openpositioning.PositionMe.Traj.IMUReading.Builder.class); + } + + private int bitField0_; + public static final int RELATIVE_TIMESTAMP_FIELD_NUMBER = 1; + private long relativeTimestamp_ = 0L; + /** + *
+     * milliseconds
+     * 
+ * + * int64 relative_timestamp = 1; + * @return The relativeTimestamp. + */ + @java.lang.Override + public long getRelativeTimestamp() { + return relativeTimestamp_; + } + + public static final int ACC_FIELD_NUMBER = 2; + private com.openpositioning.PositionMe.Traj.Vector3 acc_; + /** + *
+     * Accelerometer [m/s^2]
+     * 
+ * + * .Vector3 acc = 2; + * @return Whether the acc field is set. + */ + @java.lang.Override + public boolean hasAcc() { + return ((bitField0_ & 0x00000001) != 0); + } + /** + *
+     * Accelerometer [m/s^2]
+     * 
+ * + * .Vector3 acc = 2; + * @return The acc. + */ + @java.lang.Override + public com.openpositioning.PositionMe.Traj.Vector3 getAcc() { + return acc_ == null ? com.openpositioning.PositionMe.Traj.Vector3.getDefaultInstance() : acc_; + } + /** + *
+     * Accelerometer [m/s^2]
+     * 
+ * + * .Vector3 acc = 2; + */ + @java.lang.Override + public com.openpositioning.PositionMe.Traj.Vector3OrBuilder getAccOrBuilder() { + return acc_ == null ? com.openpositioning.PositionMe.Traj.Vector3.getDefaultInstance() : acc_; + } + + public static final int GYR_FIELD_NUMBER = 3; + private com.openpositioning.PositionMe.Traj.Vector3 gyr_; + /** + *
+     * Gyroscope [radians/s]
+     * 
+ * + * .Vector3 gyr = 3; + * @return Whether the gyr field is set. + */ + @java.lang.Override + public boolean hasGyr() { + return ((bitField0_ & 0x00000002) != 0); + } + /** + *
+     * Gyroscope [radians/s]
+     * 
+ * + * .Vector3 gyr = 3; + * @return The gyr. + */ + @java.lang.Override + public com.openpositioning.PositionMe.Traj.Vector3 getGyr() { + return gyr_ == null ? com.openpositioning.PositionMe.Traj.Vector3.getDefaultInstance() : gyr_; + } + /** + *
+     * Gyroscope [radians/s]
+     * 
+ * + * .Vector3 gyr = 3; + */ + @java.lang.Override + public com.openpositioning.PositionMe.Traj.Vector3OrBuilder getGyrOrBuilder() { + return gyr_ == null ? com.openpositioning.PositionMe.Traj.Vector3.getDefaultInstance() : gyr_; + } + + public static final int ROTATION_VECTOR_FIELD_NUMBER = 4; + private com.openpositioning.PositionMe.Traj.Quaternion rotationVector_; + /** + *
+     * Orientation [unitless], 4 components should square sum to ~1
+     * 
+ * + * .Quaternion rotation_vector = 4; + * @return Whether the rotationVector field is set. + */ + @java.lang.Override + public boolean hasRotationVector() { + return ((bitField0_ & 0x00000004) != 0); + } + /** + *
+     * Orientation [unitless], 4 components should square sum to ~1
+     * 
+ * + * .Quaternion rotation_vector = 4; + * @return The rotationVector. + */ + @java.lang.Override + public com.openpositioning.PositionMe.Traj.Quaternion getRotationVector() { + return rotationVector_ == null ? com.openpositioning.PositionMe.Traj.Quaternion.getDefaultInstance() : rotationVector_; + } + /** + *
+     * Orientation [unitless], 4 components should square sum to ~1
+     * 
+ * + * .Quaternion rotation_vector = 4; + */ + @java.lang.Override + public com.openpositioning.PositionMe.Traj.QuaternionOrBuilder getRotationVectorOrBuilder() { + return rotationVector_ == null ? com.openpositioning.PositionMe.Traj.Quaternion.getDefaultInstance() : rotationVector_; + } + + public static final int STEP_COUNT_FIELD_NUMBER = 5; + private int stepCount_ = 0; + /** + *
+     * Number of steps so far
+     * 
+ * + * int32 step_count = 5; + * @return The stepCount. + */ + @java.lang.Override + public int getStepCount() { + return stepCount_; + } + + private byte memoizedIsInitialized = -1; + @java.lang.Override + public final boolean isInitialized() { + byte isInitialized = memoizedIsInitialized; + if (isInitialized == 1) return true; + if (isInitialized == 0) return false; + + memoizedIsInitialized = 1; + return true; + } + + @java.lang.Override + public void writeTo(com.google.protobuf.CodedOutputStream output) + throws java.io.IOException { + if (relativeTimestamp_ != 0L) { + output.writeInt64(1, relativeTimestamp_); + } + if (((bitField0_ & 0x00000001) != 0)) { + output.writeMessage(2, getAcc()); + } + if (((bitField0_ & 0x00000002) != 0)) { + output.writeMessage(3, getGyr()); + } + if (((bitField0_ & 0x00000004) != 0)) { + output.writeMessage(4, getRotationVector()); + } + if (stepCount_ != 0) { + output.writeInt32(5, stepCount_); + } + getUnknownFields().writeTo(output); + } + + @java.lang.Override + public int getSerializedSize() { + int size = memoizedSize; + if (size != -1) return size; + + size = 0; + if (relativeTimestamp_ != 0L) { + size += com.google.protobuf.CodedOutputStream + .computeInt64Size(1, relativeTimestamp_); + } + if (((bitField0_ & 0x00000001) != 0)) { + size += com.google.protobuf.CodedOutputStream + .computeMessageSize(2, getAcc()); + } + if (((bitField0_ & 0x00000002) != 0)) { + size += com.google.protobuf.CodedOutputStream + .computeMessageSize(3, getGyr()); + } + if (((bitField0_ & 0x00000004) != 0)) { + size += com.google.protobuf.CodedOutputStream + .computeMessageSize(4, getRotationVector()); + } + if (stepCount_ != 0) { + size += com.google.protobuf.CodedOutputStream + .computeInt32Size(5, stepCount_); + } + size += getUnknownFields().getSerializedSize(); + memoizedSize = size; + return size; + } + + @java.lang.Override + public boolean equals(final java.lang.Object obj) { + if (obj == this) { + return true; + } + if (!(obj instanceof com.openpositioning.PositionMe.Traj.IMUReading)) { + return super.equals(obj); + } + com.openpositioning.PositionMe.Traj.IMUReading other = (com.openpositioning.PositionMe.Traj.IMUReading) obj; + + if (getRelativeTimestamp() + != other.getRelativeTimestamp()) return false; + if (hasAcc() != other.hasAcc()) return false; + if (hasAcc()) { + if (!getAcc() + .equals(other.getAcc())) return false; + } + if (hasGyr() != other.hasGyr()) return false; + if (hasGyr()) { + if (!getGyr() + .equals(other.getGyr())) return false; + } + if (hasRotationVector() != other.hasRotationVector()) return false; + if (hasRotationVector()) { + if (!getRotationVector() + .equals(other.getRotationVector())) return false; + } + if (getStepCount() + != other.getStepCount()) return false; + if (!getUnknownFields().equals(other.getUnknownFields())) return false; + return true; + } + + @java.lang.Override + public int hashCode() { + if (memoizedHashCode != 0) { + return memoizedHashCode; + } + int hash = 41; + hash = (19 * hash) + getDescriptor().hashCode(); + hash = (37 * hash) + RELATIVE_TIMESTAMP_FIELD_NUMBER; + hash = (53 * hash) + com.google.protobuf.Internal.hashLong( + getRelativeTimestamp()); + if (hasAcc()) { + hash = (37 * hash) + ACC_FIELD_NUMBER; + hash = (53 * hash) + getAcc().hashCode(); + } + if (hasGyr()) { + hash = (37 * hash) + GYR_FIELD_NUMBER; + hash = (53 * hash) + getGyr().hashCode(); + } + if (hasRotationVector()) { + hash = (37 * hash) + ROTATION_VECTOR_FIELD_NUMBER; + hash = (53 * hash) + getRotationVector().hashCode(); + } + hash = (37 * hash) + STEP_COUNT_FIELD_NUMBER; + hash = (53 * hash) + getStepCount(); + hash = (29 * hash) + getUnknownFields().hashCode(); + memoizedHashCode = hash; + return hash; + } + + public static com.openpositioning.PositionMe.Traj.IMUReading parseFrom( + java.nio.ByteBuffer data) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + public static com.openpositioning.PositionMe.Traj.IMUReading parseFrom( + java.nio.ByteBuffer data, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data, extensionRegistry); + } + public static com.openpositioning.PositionMe.Traj.IMUReading parseFrom( + com.google.protobuf.ByteString data) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + public static com.openpositioning.PositionMe.Traj.IMUReading parseFrom( + com.google.protobuf.ByteString data, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data, extensionRegistry); + } + public static com.openpositioning.PositionMe.Traj.IMUReading parseFrom(byte[] data) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + public static com.openpositioning.PositionMe.Traj.IMUReading parseFrom( + byte[] data, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data, extensionRegistry); + } + public static com.openpositioning.PositionMe.Traj.IMUReading parseFrom(java.io.InputStream input) + throws java.io.IOException { + return com.google.protobuf.GeneratedMessage + .parseWithIOException(PARSER, input); + } + public static com.openpositioning.PositionMe.Traj.IMUReading parseFrom( + java.io.InputStream input, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws java.io.IOException { + return com.google.protobuf.GeneratedMessage + .parseWithIOException(PARSER, input, extensionRegistry); + } + + public static com.openpositioning.PositionMe.Traj.IMUReading parseDelimitedFrom(java.io.InputStream input) + throws java.io.IOException { + return com.google.protobuf.GeneratedMessage + .parseDelimitedWithIOException(PARSER, input); + } + + public static com.openpositioning.PositionMe.Traj.IMUReading parseDelimitedFrom( + java.io.InputStream input, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws java.io.IOException { + return com.google.protobuf.GeneratedMessage + .parseDelimitedWithIOException(PARSER, input, extensionRegistry); + } + public static com.openpositioning.PositionMe.Traj.IMUReading parseFrom( + com.google.protobuf.CodedInputStream input) + throws java.io.IOException { + return com.google.protobuf.GeneratedMessage + .parseWithIOException(PARSER, input); + } + public static com.openpositioning.PositionMe.Traj.IMUReading parseFrom( + com.google.protobuf.CodedInputStream input, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws java.io.IOException { + return com.google.protobuf.GeneratedMessage + .parseWithIOException(PARSER, input, extensionRegistry); + } + + @java.lang.Override + public Builder newBuilderForType() { return newBuilder(); } + public static Builder newBuilder() { + return DEFAULT_INSTANCE.toBuilder(); + } + public static Builder newBuilder(com.openpositioning.PositionMe.Traj.IMUReading prototype) { + return DEFAULT_INSTANCE.toBuilder().mergeFrom(prototype); + } + @java.lang.Override + public Builder toBuilder() { + return this == DEFAULT_INSTANCE + ? new Builder() : new Builder().mergeFrom(this); + } + + @java.lang.Override + protected Builder newBuilderForType( + com.google.protobuf.GeneratedMessage.BuilderParent parent) { + Builder builder = new Builder(parent); + return builder; + } + /** + * Protobuf type {@code IMUReading} + */ + public static final class Builder extends + com.google.protobuf.GeneratedMessage.Builder implements + // @@protoc_insertion_point(builder_implements:IMUReading) + com.openpositioning.PositionMe.Traj.IMUReadingOrBuilder { + public static final com.google.protobuf.Descriptors.Descriptor + getDescriptor() { + return com.openpositioning.PositionMe.Traj.internal_static_IMUReading_descriptor; + } + + @java.lang.Override + protected com.google.protobuf.GeneratedMessage.FieldAccessorTable + internalGetFieldAccessorTable() { + return com.openpositioning.PositionMe.Traj.internal_static_IMUReading_fieldAccessorTable + .ensureFieldAccessorsInitialized( + com.openpositioning.PositionMe.Traj.IMUReading.class, com.openpositioning.PositionMe.Traj.IMUReading.Builder.class); + } + + // Construct using com.openpositioning.PositionMe.Traj.IMUReading.newBuilder() + private Builder() { + maybeForceBuilderInitialization(); + } + + private Builder( + com.google.protobuf.GeneratedMessage.BuilderParent parent) { + super(parent); + maybeForceBuilderInitialization(); + } + private void maybeForceBuilderInitialization() { + if (com.google.protobuf.GeneratedMessage + .alwaysUseFieldBuilders) { + getAccFieldBuilder(); + getGyrFieldBuilder(); + getRotationVectorFieldBuilder(); + } + } + @java.lang.Override + public Builder clear() { + super.clear(); + bitField0_ = 0; + relativeTimestamp_ = 0L; + acc_ = null; + if (accBuilder_ != null) { + accBuilder_.dispose(); + accBuilder_ = null; + } + gyr_ = null; + if (gyrBuilder_ != null) { + gyrBuilder_.dispose(); + gyrBuilder_ = null; + } + rotationVector_ = null; + if (rotationVectorBuilder_ != null) { + rotationVectorBuilder_.dispose(); + rotationVectorBuilder_ = null; + } + stepCount_ = 0; + return this; + } + + @java.lang.Override + public com.google.protobuf.Descriptors.Descriptor + getDescriptorForType() { + return com.openpositioning.PositionMe.Traj.internal_static_IMUReading_descriptor; + } + + @java.lang.Override + public com.openpositioning.PositionMe.Traj.IMUReading getDefaultInstanceForType() { + return com.openpositioning.PositionMe.Traj.IMUReading.getDefaultInstance(); + } + + @java.lang.Override + public com.openpositioning.PositionMe.Traj.IMUReading build() { + com.openpositioning.PositionMe.Traj.IMUReading result = buildPartial(); + if (!result.isInitialized()) { + throw newUninitializedMessageException(result); + } + return result; + } + + @java.lang.Override + public com.openpositioning.PositionMe.Traj.IMUReading buildPartial() { + com.openpositioning.PositionMe.Traj.IMUReading result = new com.openpositioning.PositionMe.Traj.IMUReading(this); + if (bitField0_ != 0) { buildPartial0(result); } + onBuilt(); + return result; + } + + private void buildPartial0(com.openpositioning.PositionMe.Traj.IMUReading result) { + int from_bitField0_ = bitField0_; + if (((from_bitField0_ & 0x00000001) != 0)) { + result.relativeTimestamp_ = relativeTimestamp_; + } + int to_bitField0_ = 0; + if (((from_bitField0_ & 0x00000002) != 0)) { + result.acc_ = accBuilder_ == null + ? acc_ + : accBuilder_.build(); + to_bitField0_ |= 0x00000001; + } + if (((from_bitField0_ & 0x00000004) != 0)) { + result.gyr_ = gyrBuilder_ == null + ? gyr_ + : gyrBuilder_.build(); + to_bitField0_ |= 0x00000002; + } + if (((from_bitField0_ & 0x00000008) != 0)) { + result.rotationVector_ = rotationVectorBuilder_ == null + ? rotationVector_ + : rotationVectorBuilder_.build(); + to_bitField0_ |= 0x00000004; + } + if (((from_bitField0_ & 0x00000010) != 0)) { + result.stepCount_ = stepCount_; + } + result.bitField0_ |= to_bitField0_; + } + + @java.lang.Override + public Builder mergeFrom(com.google.protobuf.Message other) { + if (other instanceof com.openpositioning.PositionMe.Traj.IMUReading) { + return mergeFrom((com.openpositioning.PositionMe.Traj.IMUReading)other); + } else { + super.mergeFrom(other); + return this; + } + } + + public Builder mergeFrom(com.openpositioning.PositionMe.Traj.IMUReading other) { + if (other == com.openpositioning.PositionMe.Traj.IMUReading.getDefaultInstance()) return this; + if (other.getRelativeTimestamp() != 0L) { + setRelativeTimestamp(other.getRelativeTimestamp()); + } + if (other.hasAcc()) { + mergeAcc(other.getAcc()); + } + if (other.hasGyr()) { + mergeGyr(other.getGyr()); + } + if (other.hasRotationVector()) { + mergeRotationVector(other.getRotationVector()); + } + if (other.getStepCount() != 0) { + setStepCount(other.getStepCount()); + } + this.mergeUnknownFields(other.getUnknownFields()); + onChanged(); + return this; + } + + @java.lang.Override + public final boolean isInitialized() { + return true; + } + + @java.lang.Override + public Builder mergeFrom( + com.google.protobuf.CodedInputStream input, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws java.io.IOException { + if (extensionRegistry == null) { + throw new java.lang.NullPointerException(); + } + try { + boolean done = false; + while (!done) { + int tag = input.readTag(); + switch (tag) { + case 0: + done = true; + break; + case 8: { + relativeTimestamp_ = input.readInt64(); + bitField0_ |= 0x00000001; + break; + } // case 8 + case 18: { + input.readMessage( + getAccFieldBuilder().getBuilder(), + extensionRegistry); + bitField0_ |= 0x00000002; + break; + } // case 18 + case 26: { + input.readMessage( + getGyrFieldBuilder().getBuilder(), + extensionRegistry); + bitField0_ |= 0x00000004; + break; + } // case 26 + case 34: { + input.readMessage( + getRotationVectorFieldBuilder().getBuilder(), + extensionRegistry); + bitField0_ |= 0x00000008; + break; + } // case 34 + case 40: { + stepCount_ = input.readInt32(); + bitField0_ |= 0x00000010; + break; + } // case 40 + default: { + if (!super.parseUnknownField(input, extensionRegistry, tag)) { + done = true; // was an endgroup tag + } + break; + } // default: + } // switch (tag) + } // while (!done) + } catch (com.google.protobuf.InvalidProtocolBufferException e) { + throw e.unwrapIOException(); + } finally { + onChanged(); + } // finally + return this; + } + private int bitField0_; + + private long relativeTimestamp_ ; + /** + *
+       * milliseconds
+       * 
+ * + * int64 relative_timestamp = 1; + * @return The relativeTimestamp. + */ + @java.lang.Override + public long getRelativeTimestamp() { + return relativeTimestamp_; + } + /** + *
+       * milliseconds
+       * 
+ * + * int64 relative_timestamp = 1; + * @param value The relativeTimestamp to set. + * @return This builder for chaining. + */ + public Builder setRelativeTimestamp(long value) { + + relativeTimestamp_ = value; + bitField0_ |= 0x00000001; + onChanged(); + return this; + } + /** + *
+       * milliseconds
+       * 
+ * + * int64 relative_timestamp = 1; + * @return This builder for chaining. + */ + public Builder clearRelativeTimestamp() { + bitField0_ = (bitField0_ & ~0x00000001); + relativeTimestamp_ = 0L; + onChanged(); + return this; + } + + private com.openpositioning.PositionMe.Traj.Vector3 acc_; + private com.google.protobuf.SingleFieldBuilder< + com.openpositioning.PositionMe.Traj.Vector3, com.openpositioning.PositionMe.Traj.Vector3.Builder, com.openpositioning.PositionMe.Traj.Vector3OrBuilder> accBuilder_; + /** + *
+       * Accelerometer [m/s^2]
+       * 
+ * + * .Vector3 acc = 2; + * @return Whether the acc field is set. + */ + public boolean hasAcc() { + return ((bitField0_ & 0x00000002) != 0); + } + /** + *
+       * Accelerometer [m/s^2]
+       * 
+ * + * .Vector3 acc = 2; + * @return The acc. + */ + public com.openpositioning.PositionMe.Traj.Vector3 getAcc() { + if (accBuilder_ == null) { + return acc_ == null ? com.openpositioning.PositionMe.Traj.Vector3.getDefaultInstance() : acc_; + } else { + return accBuilder_.getMessage(); + } + } + /** + *
+       * Accelerometer [m/s^2]
+       * 
+ * + * .Vector3 acc = 2; + */ + public Builder setAcc(com.openpositioning.PositionMe.Traj.Vector3 value) { + if (accBuilder_ == null) { + if (value == null) { + throw new NullPointerException(); + } + acc_ = value; + } else { + accBuilder_.setMessage(value); + } + bitField0_ |= 0x00000002; + onChanged(); + return this; + } + /** + *
+       * Accelerometer [m/s^2]
+       * 
+ * + * .Vector3 acc = 2; + */ + public Builder setAcc( + com.openpositioning.PositionMe.Traj.Vector3.Builder builderForValue) { + if (accBuilder_ == null) { + acc_ = builderForValue.build(); + } else { + accBuilder_.setMessage(builderForValue.build()); + } + bitField0_ |= 0x00000002; + onChanged(); + return this; + } + /** + *
+       * Accelerometer [m/s^2]
+       * 
+ * + * .Vector3 acc = 2; + */ + public Builder mergeAcc(com.openpositioning.PositionMe.Traj.Vector3 value) { + if (accBuilder_ == null) { + if (((bitField0_ & 0x00000002) != 0) && + acc_ != null && + acc_ != com.openpositioning.PositionMe.Traj.Vector3.getDefaultInstance()) { + getAccBuilder().mergeFrom(value); + } else { + acc_ = value; + } + } else { + accBuilder_.mergeFrom(value); + } + if (acc_ != null) { + bitField0_ |= 0x00000002; + onChanged(); + } + return this; + } + /** + *
+       * Accelerometer [m/s^2]
+       * 
+ * + * .Vector3 acc = 2; + */ + public Builder clearAcc() { + bitField0_ = (bitField0_ & ~0x00000002); + acc_ = null; + if (accBuilder_ != null) { + accBuilder_.dispose(); + accBuilder_ = null; + } + onChanged(); + return this; + } + /** + *
+       * Accelerometer [m/s^2]
+       * 
+ * + * .Vector3 acc = 2; + */ + public com.openpositioning.PositionMe.Traj.Vector3.Builder getAccBuilder() { + bitField0_ |= 0x00000002; + onChanged(); + return getAccFieldBuilder().getBuilder(); + } + /** + *
+       * Accelerometer [m/s^2]
+       * 
+ * + * .Vector3 acc = 2; + */ + public com.openpositioning.PositionMe.Traj.Vector3OrBuilder getAccOrBuilder() { + if (accBuilder_ != null) { + return accBuilder_.getMessageOrBuilder(); + } else { + return acc_ == null ? + com.openpositioning.PositionMe.Traj.Vector3.getDefaultInstance() : acc_; + } + } + /** + *
+       * Accelerometer [m/s^2]
+       * 
+ * + * .Vector3 acc = 2; + */ + private com.google.protobuf.SingleFieldBuilder< + com.openpositioning.PositionMe.Traj.Vector3, com.openpositioning.PositionMe.Traj.Vector3.Builder, com.openpositioning.PositionMe.Traj.Vector3OrBuilder> + getAccFieldBuilder() { + if (accBuilder_ == null) { + accBuilder_ = new com.google.protobuf.SingleFieldBuilder< + com.openpositioning.PositionMe.Traj.Vector3, com.openpositioning.PositionMe.Traj.Vector3.Builder, com.openpositioning.PositionMe.Traj.Vector3OrBuilder>( + getAcc(), + getParentForChildren(), + isClean()); + acc_ = null; + } + return accBuilder_; + } + + private com.openpositioning.PositionMe.Traj.Vector3 gyr_; + private com.google.protobuf.SingleFieldBuilder< + com.openpositioning.PositionMe.Traj.Vector3, com.openpositioning.PositionMe.Traj.Vector3.Builder, com.openpositioning.PositionMe.Traj.Vector3OrBuilder> gyrBuilder_; + /** + *
+       * Gyroscope [radians/s]
+       * 
+ * + * .Vector3 gyr = 3; + * @return Whether the gyr field is set. + */ + public boolean hasGyr() { + return ((bitField0_ & 0x00000004) != 0); + } + /** + *
+       * Gyroscope [radians/s]
+       * 
+ * + * .Vector3 gyr = 3; + * @return The gyr. + */ + public com.openpositioning.PositionMe.Traj.Vector3 getGyr() { + if (gyrBuilder_ == null) { + return gyr_ == null ? com.openpositioning.PositionMe.Traj.Vector3.getDefaultInstance() : gyr_; + } else { + return gyrBuilder_.getMessage(); + } + } + /** + *
+       * Gyroscope [radians/s]
+       * 
+ * + * .Vector3 gyr = 3; + */ + public Builder setGyr(com.openpositioning.PositionMe.Traj.Vector3 value) { + if (gyrBuilder_ == null) { + if (value == null) { + throw new NullPointerException(); + } + gyr_ = value; + } else { + gyrBuilder_.setMessage(value); + } + bitField0_ |= 0x00000004; + onChanged(); + return this; + } + /** + *
+       * Gyroscope [radians/s]
+       * 
+ * + * .Vector3 gyr = 3; + */ + public Builder setGyr( + com.openpositioning.PositionMe.Traj.Vector3.Builder builderForValue) { + if (gyrBuilder_ == null) { + gyr_ = builderForValue.build(); + } else { + gyrBuilder_.setMessage(builderForValue.build()); + } + bitField0_ |= 0x00000004; + onChanged(); + return this; + } + /** + *
+       * Gyroscope [radians/s]
+       * 
+ * + * .Vector3 gyr = 3; + */ + public Builder mergeGyr(com.openpositioning.PositionMe.Traj.Vector3 value) { + if (gyrBuilder_ == null) { + if (((bitField0_ & 0x00000004) != 0) && + gyr_ != null && + gyr_ != com.openpositioning.PositionMe.Traj.Vector3.getDefaultInstance()) { + getGyrBuilder().mergeFrom(value); + } else { + gyr_ = value; + } + } else { + gyrBuilder_.mergeFrom(value); + } + if (gyr_ != null) { + bitField0_ |= 0x00000004; + onChanged(); + } + return this; + } + /** + *
+       * Gyroscope [radians/s]
+       * 
+ * + * .Vector3 gyr = 3; + */ + public Builder clearGyr() { + bitField0_ = (bitField0_ & ~0x00000004); + gyr_ = null; + if (gyrBuilder_ != null) { + gyrBuilder_.dispose(); + gyrBuilder_ = null; + } + onChanged(); + return this; + } + /** + *
+       * Gyroscope [radians/s]
+       * 
+ * + * .Vector3 gyr = 3; + */ + public com.openpositioning.PositionMe.Traj.Vector3.Builder getGyrBuilder() { + bitField0_ |= 0x00000004; + onChanged(); + return getGyrFieldBuilder().getBuilder(); + } + /** + *
+       * Gyroscope [radians/s]
+       * 
+ * + * .Vector3 gyr = 3; + */ + public com.openpositioning.PositionMe.Traj.Vector3OrBuilder getGyrOrBuilder() { + if (gyrBuilder_ != null) { + return gyrBuilder_.getMessageOrBuilder(); + } else { + return gyr_ == null ? + com.openpositioning.PositionMe.Traj.Vector3.getDefaultInstance() : gyr_; + } + } + /** + *
+       * Gyroscope [radians/s]
+       * 
+ * + * .Vector3 gyr = 3; + */ + private com.google.protobuf.SingleFieldBuilder< + com.openpositioning.PositionMe.Traj.Vector3, com.openpositioning.PositionMe.Traj.Vector3.Builder, com.openpositioning.PositionMe.Traj.Vector3OrBuilder> + getGyrFieldBuilder() { + if (gyrBuilder_ == null) { + gyrBuilder_ = new com.google.protobuf.SingleFieldBuilder< + com.openpositioning.PositionMe.Traj.Vector3, com.openpositioning.PositionMe.Traj.Vector3.Builder, com.openpositioning.PositionMe.Traj.Vector3OrBuilder>( + getGyr(), + getParentForChildren(), + isClean()); + gyr_ = null; + } + return gyrBuilder_; + } + + private com.openpositioning.PositionMe.Traj.Quaternion rotationVector_; + private com.google.protobuf.SingleFieldBuilder< + com.openpositioning.PositionMe.Traj.Quaternion, com.openpositioning.PositionMe.Traj.Quaternion.Builder, com.openpositioning.PositionMe.Traj.QuaternionOrBuilder> rotationVectorBuilder_; + /** + *
+       * Orientation [unitless], 4 components should square sum to ~1
+       * 
+ * + * .Quaternion rotation_vector = 4; + * @return Whether the rotationVector field is set. + */ + public boolean hasRotationVector() { + return ((bitField0_ & 0x00000008) != 0); + } + /** + *
+       * Orientation [unitless], 4 components should square sum to ~1
+       * 
+ * + * .Quaternion rotation_vector = 4; + * @return The rotationVector. + */ + public com.openpositioning.PositionMe.Traj.Quaternion getRotationVector() { + if (rotationVectorBuilder_ == null) { + return rotationVector_ == null ? com.openpositioning.PositionMe.Traj.Quaternion.getDefaultInstance() : rotationVector_; + } else { + return rotationVectorBuilder_.getMessage(); + } + } + /** + *
+       * Orientation [unitless], 4 components should square sum to ~1
+       * 
+ * + * .Quaternion rotation_vector = 4; + */ + public Builder setRotationVector(com.openpositioning.PositionMe.Traj.Quaternion value) { + if (rotationVectorBuilder_ == null) { + if (value == null) { + throw new NullPointerException(); + } + rotationVector_ = value; + } else { + rotationVectorBuilder_.setMessage(value); + } + bitField0_ |= 0x00000008; + onChanged(); + return this; + } + /** + *
+       * Orientation [unitless], 4 components should square sum to ~1
+       * 
+ * + * .Quaternion rotation_vector = 4; + */ + public Builder setRotationVector( + com.openpositioning.PositionMe.Traj.Quaternion.Builder builderForValue) { + if (rotationVectorBuilder_ == null) { + rotationVector_ = builderForValue.build(); + } else { + rotationVectorBuilder_.setMessage(builderForValue.build()); + } + bitField0_ |= 0x00000008; + onChanged(); + return this; + } + /** + *
+       * Orientation [unitless], 4 components should square sum to ~1
+       * 
+ * + * .Quaternion rotation_vector = 4; + */ + public Builder mergeRotationVector(com.openpositioning.PositionMe.Traj.Quaternion value) { + if (rotationVectorBuilder_ == null) { + if (((bitField0_ & 0x00000008) != 0) && + rotationVector_ != null && + rotationVector_ != com.openpositioning.PositionMe.Traj.Quaternion.getDefaultInstance()) { + getRotationVectorBuilder().mergeFrom(value); + } else { + rotationVector_ = value; + } + } else { + rotationVectorBuilder_.mergeFrom(value); + } + if (rotationVector_ != null) { + bitField0_ |= 0x00000008; + onChanged(); + } + return this; + } + /** + *
+       * Orientation [unitless], 4 components should square sum to ~1
+       * 
+ * + * .Quaternion rotation_vector = 4; + */ + public Builder clearRotationVector() { + bitField0_ = (bitField0_ & ~0x00000008); + rotationVector_ = null; + if (rotationVectorBuilder_ != null) { + rotationVectorBuilder_.dispose(); + rotationVectorBuilder_ = null; + } + onChanged(); + return this; + } + /** + *
+       * Orientation [unitless], 4 components should square sum to ~1
+       * 
+ * + * .Quaternion rotation_vector = 4; + */ + public com.openpositioning.PositionMe.Traj.Quaternion.Builder getRotationVectorBuilder() { + bitField0_ |= 0x00000008; + onChanged(); + return getRotationVectorFieldBuilder().getBuilder(); + } + /** + *
+       * Orientation [unitless], 4 components should square sum to ~1
+       * 
+ * + * .Quaternion rotation_vector = 4; + */ + public com.openpositioning.PositionMe.Traj.QuaternionOrBuilder getRotationVectorOrBuilder() { + if (rotationVectorBuilder_ != null) { + return rotationVectorBuilder_.getMessageOrBuilder(); + } else { + return rotationVector_ == null ? + com.openpositioning.PositionMe.Traj.Quaternion.getDefaultInstance() : rotationVector_; + } + } + /** + *
+       * Orientation [unitless], 4 components should square sum to ~1
+       * 
+ * + * .Quaternion rotation_vector = 4; + */ + private com.google.protobuf.SingleFieldBuilder< + com.openpositioning.PositionMe.Traj.Quaternion, com.openpositioning.PositionMe.Traj.Quaternion.Builder, com.openpositioning.PositionMe.Traj.QuaternionOrBuilder> + getRotationVectorFieldBuilder() { + if (rotationVectorBuilder_ == null) { + rotationVectorBuilder_ = new com.google.protobuf.SingleFieldBuilder< + com.openpositioning.PositionMe.Traj.Quaternion, com.openpositioning.PositionMe.Traj.Quaternion.Builder, com.openpositioning.PositionMe.Traj.QuaternionOrBuilder>( + getRotationVector(), + getParentForChildren(), + isClean()); + rotationVector_ = null; + } + return rotationVectorBuilder_; + } + + private int stepCount_ ; + /** + *
+       * Number of steps so far
+       * 
+ * + * int32 step_count = 5; + * @return The stepCount. + */ + @java.lang.Override + public int getStepCount() { + return stepCount_; + } + /** + *
+       * Number of steps so far
+       * 
+ * + * int32 step_count = 5; + * @param value The stepCount to set. + * @return This builder for chaining. + */ + public Builder setStepCount(int value) { + + stepCount_ = value; + bitField0_ |= 0x00000010; + onChanged(); + return this; + } + /** + *
+       * Number of steps so far
+       * 
+ * + * int32 step_count = 5; + * @return This builder for chaining. + */ + public Builder clearStepCount() { + bitField0_ = (bitField0_ & ~0x00000010); + stepCount_ = 0; + onChanged(); + return this; + } + + // @@protoc_insertion_point(builder_scope:IMUReading) + } + + // @@protoc_insertion_point(class_scope:IMUReading) + private static final com.openpositioning.PositionMe.Traj.IMUReading DEFAULT_INSTANCE; + static { + DEFAULT_INSTANCE = new com.openpositioning.PositionMe.Traj.IMUReading(); + } + + public static com.openpositioning.PositionMe.Traj.IMUReading getDefaultInstance() { + return DEFAULT_INSTANCE; + } + + private static final com.google.protobuf.Parser + PARSER = new com.google.protobuf.AbstractParser() { + @java.lang.Override + public IMUReading parsePartialFrom( + com.google.protobuf.CodedInputStream input, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + Builder builder = newBuilder(); + try { + builder.mergeFrom(input, extensionRegistry); + } catch (com.google.protobuf.InvalidProtocolBufferException e) { + throw e.setUnfinishedMessage(builder.buildPartial()); + } catch (com.google.protobuf.UninitializedMessageException e) { + throw e.asInvalidProtocolBufferException().setUnfinishedMessage(builder.buildPartial()); + } catch (java.io.IOException e) { + throw new com.google.protobuf.InvalidProtocolBufferException(e) + .setUnfinishedMessage(builder.buildPartial()); + } + return builder.buildPartial(); + } + }; + + public static com.google.protobuf.Parser parser() { + return PARSER; + } + + @java.lang.Override + public com.google.protobuf.Parser getParserForType() { + return PARSER; + } + + @java.lang.Override + public com.openpositioning.PositionMe.Traj.IMUReading getDefaultInstanceForType() { + return DEFAULT_INSTANCE; + } + + } + + public interface MagnetometerReadingOrBuilder extends + // @@protoc_insertion_point(interface_extends:MagnetometerReading) + com.google.protobuf.MessageOrBuilder { + + /** + * int64 relative_timestamp = 1; + * @return The relativeTimestamp. + */ + long getRelativeTimestamp(); + + /** + *
+     * Magnetometer [uT]
+     * 
+ * + * .Vector3 mag = 2; + * @return Whether the mag field is set. + */ + boolean hasMag(); + /** + *
+     * Magnetometer [uT]
+     * 
+ * + * .Vector3 mag = 2; + * @return The mag. + */ + com.openpositioning.PositionMe.Traj.Vector3 getMag(); + /** + *
+     * Magnetometer [uT]
+     * 
+ * + * .Vector3 mag = 2; + */ + com.openpositioning.PositionMe.Traj.Vector3OrBuilder getMagOrBuilder(); + } + /** + * Protobuf type {@code MagnetometerReading} + */ + public static final class MagnetometerReading extends + com.google.protobuf.GeneratedMessage implements + // @@protoc_insertion_point(message_implements:MagnetometerReading) + MagnetometerReadingOrBuilder { + private static final long serialVersionUID = 0L; + static { + com.google.protobuf.RuntimeVersion.validateProtobufGencodeVersion( + com.google.protobuf.RuntimeVersion.RuntimeDomain.PUBLIC, + /* major= */ 4, + /* minor= */ 29, + /* patch= */ 6, + /* suffix= */ "", + MagnetometerReading.class.getName()); + } + // Use MagnetometerReading.newBuilder() to construct. + private MagnetometerReading(com.google.protobuf.GeneratedMessage.Builder builder) { + super(builder); + } + private MagnetometerReading() { + } + + public static final com.google.protobuf.Descriptors.Descriptor + getDescriptor() { + return com.openpositioning.PositionMe.Traj.internal_static_MagnetometerReading_descriptor; + } + + @java.lang.Override + protected com.google.protobuf.GeneratedMessage.FieldAccessorTable + internalGetFieldAccessorTable() { + return com.openpositioning.PositionMe.Traj.internal_static_MagnetometerReading_fieldAccessorTable + .ensureFieldAccessorsInitialized( + com.openpositioning.PositionMe.Traj.MagnetometerReading.class, com.openpositioning.PositionMe.Traj.MagnetometerReading.Builder.class); + } + + private int bitField0_; + public static final int RELATIVE_TIMESTAMP_FIELD_NUMBER = 1; + private long relativeTimestamp_ = 0L; + /** + * int64 relative_timestamp = 1; + * @return The relativeTimestamp. + */ + @java.lang.Override + public long getRelativeTimestamp() { + return relativeTimestamp_; + } + + public static final int MAG_FIELD_NUMBER = 2; + private com.openpositioning.PositionMe.Traj.Vector3 mag_; + /** + *
+     * Magnetometer [uT]
+     * 
+ * + * .Vector3 mag = 2; + * @return Whether the mag field is set. + */ + @java.lang.Override + public boolean hasMag() { + return ((bitField0_ & 0x00000001) != 0); + } + /** + *
+     * Magnetometer [uT]
+     * 
+ * + * .Vector3 mag = 2; + * @return The mag. + */ + @java.lang.Override + public com.openpositioning.PositionMe.Traj.Vector3 getMag() { + return mag_ == null ? com.openpositioning.PositionMe.Traj.Vector3.getDefaultInstance() : mag_; + } + /** + *
+     * Magnetometer [uT]
+     * 
+ * + * .Vector3 mag = 2; + */ + @java.lang.Override + public com.openpositioning.PositionMe.Traj.Vector3OrBuilder getMagOrBuilder() { + return mag_ == null ? com.openpositioning.PositionMe.Traj.Vector3.getDefaultInstance() : mag_; + } + + private byte memoizedIsInitialized = -1; + @java.lang.Override + public final boolean isInitialized() { + byte isInitialized = memoizedIsInitialized; + if (isInitialized == 1) return true; + if (isInitialized == 0) return false; + + memoizedIsInitialized = 1; + return true; + } + + @java.lang.Override + public void writeTo(com.google.protobuf.CodedOutputStream output) + throws java.io.IOException { + if (relativeTimestamp_ != 0L) { + output.writeInt64(1, relativeTimestamp_); + } + if (((bitField0_ & 0x00000001) != 0)) { + output.writeMessage(2, getMag()); + } + getUnknownFields().writeTo(output); + } + + @java.lang.Override + public int getSerializedSize() { + int size = memoizedSize; + if (size != -1) return size; + + size = 0; + if (relativeTimestamp_ != 0L) { + size += com.google.protobuf.CodedOutputStream + .computeInt64Size(1, relativeTimestamp_); + } + if (((bitField0_ & 0x00000001) != 0)) { + size += com.google.protobuf.CodedOutputStream + .computeMessageSize(2, getMag()); + } + size += getUnknownFields().getSerializedSize(); + memoizedSize = size; + return size; + } + + @java.lang.Override + public boolean equals(final java.lang.Object obj) { + if (obj == this) { + return true; + } + if (!(obj instanceof com.openpositioning.PositionMe.Traj.MagnetometerReading)) { + return super.equals(obj); + } + com.openpositioning.PositionMe.Traj.MagnetometerReading other = (com.openpositioning.PositionMe.Traj.MagnetometerReading) obj; + + if (getRelativeTimestamp() + != other.getRelativeTimestamp()) return false; + if (hasMag() != other.hasMag()) return false; + if (hasMag()) { + if (!getMag() + .equals(other.getMag())) return false; + } + if (!getUnknownFields().equals(other.getUnknownFields())) return false; + return true; + } + + @java.lang.Override + public int hashCode() { + if (memoizedHashCode != 0) { + return memoizedHashCode; + } + int hash = 41; + hash = (19 * hash) + getDescriptor().hashCode(); + hash = (37 * hash) + RELATIVE_TIMESTAMP_FIELD_NUMBER; + hash = (53 * hash) + com.google.protobuf.Internal.hashLong( + getRelativeTimestamp()); + if (hasMag()) { + hash = (37 * hash) + MAG_FIELD_NUMBER; + hash = (53 * hash) + getMag().hashCode(); + } + hash = (29 * hash) + getUnknownFields().hashCode(); + memoizedHashCode = hash; + return hash; + } + + public static com.openpositioning.PositionMe.Traj.MagnetometerReading parseFrom( + java.nio.ByteBuffer data) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + public static com.openpositioning.PositionMe.Traj.MagnetometerReading parseFrom( + java.nio.ByteBuffer data, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data, extensionRegistry); + } + public static com.openpositioning.PositionMe.Traj.MagnetometerReading parseFrom( + com.google.protobuf.ByteString data) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + public static com.openpositioning.PositionMe.Traj.MagnetometerReading parseFrom( + com.google.protobuf.ByteString data, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data, extensionRegistry); + } + public static com.openpositioning.PositionMe.Traj.MagnetometerReading parseFrom(byte[] data) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + public static com.openpositioning.PositionMe.Traj.MagnetometerReading parseFrom( + byte[] data, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data, extensionRegistry); + } + public static com.openpositioning.PositionMe.Traj.MagnetometerReading parseFrom(java.io.InputStream input) + throws java.io.IOException { + return com.google.protobuf.GeneratedMessage + .parseWithIOException(PARSER, input); + } + public static com.openpositioning.PositionMe.Traj.MagnetometerReading parseFrom( + java.io.InputStream input, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws java.io.IOException { + return com.google.protobuf.GeneratedMessage + .parseWithIOException(PARSER, input, extensionRegistry); + } + + public static com.openpositioning.PositionMe.Traj.MagnetometerReading parseDelimitedFrom(java.io.InputStream input) + throws java.io.IOException { + return com.google.protobuf.GeneratedMessage + .parseDelimitedWithIOException(PARSER, input); + } + + public static com.openpositioning.PositionMe.Traj.MagnetometerReading parseDelimitedFrom( + java.io.InputStream input, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws java.io.IOException { + return com.google.protobuf.GeneratedMessage + .parseDelimitedWithIOException(PARSER, input, extensionRegistry); + } + public static com.openpositioning.PositionMe.Traj.MagnetometerReading parseFrom( + com.google.protobuf.CodedInputStream input) + throws java.io.IOException { + return com.google.protobuf.GeneratedMessage + .parseWithIOException(PARSER, input); + } + public static com.openpositioning.PositionMe.Traj.MagnetometerReading parseFrom( + com.google.protobuf.CodedInputStream input, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws java.io.IOException { + return com.google.protobuf.GeneratedMessage + .parseWithIOException(PARSER, input, extensionRegistry); + } + + @java.lang.Override + public Builder newBuilderForType() { return newBuilder(); } + public static Builder newBuilder() { + return DEFAULT_INSTANCE.toBuilder(); + } + public static Builder newBuilder(com.openpositioning.PositionMe.Traj.MagnetometerReading prototype) { + return DEFAULT_INSTANCE.toBuilder().mergeFrom(prototype); + } + @java.lang.Override + public Builder toBuilder() { + return this == DEFAULT_INSTANCE + ? new Builder() : new Builder().mergeFrom(this); + } + + @java.lang.Override + protected Builder newBuilderForType( + com.google.protobuf.GeneratedMessage.BuilderParent parent) { + Builder builder = new Builder(parent); + return builder; + } + /** + * Protobuf type {@code MagnetometerReading} + */ + public static final class Builder extends + com.google.protobuf.GeneratedMessage.Builder implements + // @@protoc_insertion_point(builder_implements:MagnetometerReading) + com.openpositioning.PositionMe.Traj.MagnetometerReadingOrBuilder { + public static final com.google.protobuf.Descriptors.Descriptor + getDescriptor() { + return com.openpositioning.PositionMe.Traj.internal_static_MagnetometerReading_descriptor; + } + + @java.lang.Override + protected com.google.protobuf.GeneratedMessage.FieldAccessorTable + internalGetFieldAccessorTable() { + return com.openpositioning.PositionMe.Traj.internal_static_MagnetometerReading_fieldAccessorTable + .ensureFieldAccessorsInitialized( + com.openpositioning.PositionMe.Traj.MagnetometerReading.class, com.openpositioning.PositionMe.Traj.MagnetometerReading.Builder.class); + } + + // Construct using com.openpositioning.PositionMe.Traj.MagnetometerReading.newBuilder() + private Builder() { + maybeForceBuilderInitialization(); + } + + private Builder( + com.google.protobuf.GeneratedMessage.BuilderParent parent) { + super(parent); + maybeForceBuilderInitialization(); + } + private void maybeForceBuilderInitialization() { + if (com.google.protobuf.GeneratedMessage + .alwaysUseFieldBuilders) { + getMagFieldBuilder(); + } + } + @java.lang.Override + public Builder clear() { + super.clear(); + bitField0_ = 0; + relativeTimestamp_ = 0L; + mag_ = null; + if (magBuilder_ != null) { + magBuilder_.dispose(); + magBuilder_ = null; + } + return this; + } + + @java.lang.Override + public com.google.protobuf.Descriptors.Descriptor + getDescriptorForType() { + return com.openpositioning.PositionMe.Traj.internal_static_MagnetometerReading_descriptor; + } + + @java.lang.Override + public com.openpositioning.PositionMe.Traj.MagnetometerReading getDefaultInstanceForType() { + return com.openpositioning.PositionMe.Traj.MagnetometerReading.getDefaultInstance(); + } + + @java.lang.Override + public com.openpositioning.PositionMe.Traj.MagnetometerReading build() { + com.openpositioning.PositionMe.Traj.MagnetometerReading result = buildPartial(); + if (!result.isInitialized()) { + throw newUninitializedMessageException(result); + } + return result; + } + + @java.lang.Override + public com.openpositioning.PositionMe.Traj.MagnetometerReading buildPartial() { + com.openpositioning.PositionMe.Traj.MagnetometerReading result = new com.openpositioning.PositionMe.Traj.MagnetometerReading(this); + if (bitField0_ != 0) { buildPartial0(result); } + onBuilt(); + return result; + } + + private void buildPartial0(com.openpositioning.PositionMe.Traj.MagnetometerReading result) { + int from_bitField0_ = bitField0_; + if (((from_bitField0_ & 0x00000001) != 0)) { + result.relativeTimestamp_ = relativeTimestamp_; + } + int to_bitField0_ = 0; + if (((from_bitField0_ & 0x00000002) != 0)) { + result.mag_ = magBuilder_ == null + ? mag_ + : magBuilder_.build(); + to_bitField0_ |= 0x00000001; + } + result.bitField0_ |= to_bitField0_; + } + + @java.lang.Override + public Builder mergeFrom(com.google.protobuf.Message other) { + if (other instanceof com.openpositioning.PositionMe.Traj.MagnetometerReading) { + return mergeFrom((com.openpositioning.PositionMe.Traj.MagnetometerReading)other); + } else { + super.mergeFrom(other); + return this; + } + } + + public Builder mergeFrom(com.openpositioning.PositionMe.Traj.MagnetometerReading other) { + if (other == com.openpositioning.PositionMe.Traj.MagnetometerReading.getDefaultInstance()) return this; + if (other.getRelativeTimestamp() != 0L) { + setRelativeTimestamp(other.getRelativeTimestamp()); + } + if (other.hasMag()) { + mergeMag(other.getMag()); + } + this.mergeUnknownFields(other.getUnknownFields()); + onChanged(); + return this; + } + + @java.lang.Override + public final boolean isInitialized() { + return true; + } + + @java.lang.Override + public Builder mergeFrom( + com.google.protobuf.CodedInputStream input, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws java.io.IOException { + if (extensionRegistry == null) { + throw new java.lang.NullPointerException(); + } + try { + boolean done = false; + while (!done) { + int tag = input.readTag(); + switch (tag) { + case 0: + done = true; + break; + case 8: { + relativeTimestamp_ = input.readInt64(); + bitField0_ |= 0x00000001; + break; + } // case 8 + case 18: { + input.readMessage( + getMagFieldBuilder().getBuilder(), + extensionRegistry); + bitField0_ |= 0x00000002; + break; + } // case 18 + default: { + if (!super.parseUnknownField(input, extensionRegistry, tag)) { + done = true; // was an endgroup tag + } + break; + } // default: + } // switch (tag) + } // while (!done) + } catch (com.google.protobuf.InvalidProtocolBufferException e) { + throw e.unwrapIOException(); + } finally { + onChanged(); + } // finally + return this; + } + private int bitField0_; + + private long relativeTimestamp_ ; + /** + * int64 relative_timestamp = 1; + * @return The relativeTimestamp. + */ + @java.lang.Override + public long getRelativeTimestamp() { + return relativeTimestamp_; + } + /** + * int64 relative_timestamp = 1; + * @param value The relativeTimestamp to set. + * @return This builder for chaining. + */ + public Builder setRelativeTimestamp(long value) { + + relativeTimestamp_ = value; + bitField0_ |= 0x00000001; + onChanged(); + return this; + } + /** + * int64 relative_timestamp = 1; + * @return This builder for chaining. + */ + public Builder clearRelativeTimestamp() { + bitField0_ = (bitField0_ & ~0x00000001); + relativeTimestamp_ = 0L; + onChanged(); + return this; + } + + private com.openpositioning.PositionMe.Traj.Vector3 mag_; + private com.google.protobuf.SingleFieldBuilder< + com.openpositioning.PositionMe.Traj.Vector3, com.openpositioning.PositionMe.Traj.Vector3.Builder, com.openpositioning.PositionMe.Traj.Vector3OrBuilder> magBuilder_; + /** + *
+       * Magnetometer [uT]
+       * 
+ * + * .Vector3 mag = 2; + * @return Whether the mag field is set. + */ + public boolean hasMag() { + return ((bitField0_ & 0x00000002) != 0); + } + /** + *
+       * Magnetometer [uT]
+       * 
+ * + * .Vector3 mag = 2; + * @return The mag. + */ + public com.openpositioning.PositionMe.Traj.Vector3 getMag() { + if (magBuilder_ == null) { + return mag_ == null ? com.openpositioning.PositionMe.Traj.Vector3.getDefaultInstance() : mag_; + } else { + return magBuilder_.getMessage(); + } + } + /** + *
+       * Magnetometer [uT]
+       * 
+ * + * .Vector3 mag = 2; + */ + public Builder setMag(com.openpositioning.PositionMe.Traj.Vector3 value) { + if (magBuilder_ == null) { + if (value == null) { + throw new NullPointerException(); + } + mag_ = value; + } else { + magBuilder_.setMessage(value); + } + bitField0_ |= 0x00000002; + onChanged(); + return this; + } + /** + *
+       * Magnetometer [uT]
+       * 
+ * + * .Vector3 mag = 2; + */ + public Builder setMag( + com.openpositioning.PositionMe.Traj.Vector3.Builder builderForValue) { + if (magBuilder_ == null) { + mag_ = builderForValue.build(); + } else { + magBuilder_.setMessage(builderForValue.build()); + } + bitField0_ |= 0x00000002; + onChanged(); + return this; + } + /** + *
+       * Magnetometer [uT]
+       * 
+ * + * .Vector3 mag = 2; + */ + public Builder mergeMag(com.openpositioning.PositionMe.Traj.Vector3 value) { + if (magBuilder_ == null) { + if (((bitField0_ & 0x00000002) != 0) && + mag_ != null && + mag_ != com.openpositioning.PositionMe.Traj.Vector3.getDefaultInstance()) { + getMagBuilder().mergeFrom(value); + } else { + mag_ = value; + } + } else { + magBuilder_.mergeFrom(value); + } + if (mag_ != null) { + bitField0_ |= 0x00000002; + onChanged(); + } + return this; + } + /** + *
+       * Magnetometer [uT]
+       * 
+ * + * .Vector3 mag = 2; + */ + public Builder clearMag() { + bitField0_ = (bitField0_ & ~0x00000002); + mag_ = null; + if (magBuilder_ != null) { + magBuilder_.dispose(); + magBuilder_ = null; + } + onChanged(); + return this; + } + /** + *
+       * Magnetometer [uT]
+       * 
+ * + * .Vector3 mag = 2; + */ + public com.openpositioning.PositionMe.Traj.Vector3.Builder getMagBuilder() { + bitField0_ |= 0x00000002; + onChanged(); + return getMagFieldBuilder().getBuilder(); + } + /** + *
+       * Magnetometer [uT]
+       * 
+ * + * .Vector3 mag = 2; + */ + public com.openpositioning.PositionMe.Traj.Vector3OrBuilder getMagOrBuilder() { + if (magBuilder_ != null) { + return magBuilder_.getMessageOrBuilder(); + } else { + return mag_ == null ? + com.openpositioning.PositionMe.Traj.Vector3.getDefaultInstance() : mag_; + } + } + /** + *
+       * Magnetometer [uT]
+       * 
+ * + * .Vector3 mag = 2; + */ + private com.google.protobuf.SingleFieldBuilder< + com.openpositioning.PositionMe.Traj.Vector3, com.openpositioning.PositionMe.Traj.Vector3.Builder, com.openpositioning.PositionMe.Traj.Vector3OrBuilder> + getMagFieldBuilder() { + if (magBuilder_ == null) { + magBuilder_ = new com.google.protobuf.SingleFieldBuilder< + com.openpositioning.PositionMe.Traj.Vector3, com.openpositioning.PositionMe.Traj.Vector3.Builder, com.openpositioning.PositionMe.Traj.Vector3OrBuilder>( + getMag(), + getParentForChildren(), + isClean()); + mag_ = null; + } + return magBuilder_; + } + + // @@protoc_insertion_point(builder_scope:MagnetometerReading) + } + + // @@protoc_insertion_point(class_scope:MagnetometerReading) + private static final com.openpositioning.PositionMe.Traj.MagnetometerReading DEFAULT_INSTANCE; + static { + DEFAULT_INSTANCE = new com.openpositioning.PositionMe.Traj.MagnetometerReading(); + } + + public static com.openpositioning.PositionMe.Traj.MagnetometerReading getDefaultInstance() { + return DEFAULT_INSTANCE; + } + + private static final com.google.protobuf.Parser + PARSER = new com.google.protobuf.AbstractParser() { + @java.lang.Override + public MagnetometerReading parsePartialFrom( + com.google.protobuf.CodedInputStream input, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + Builder builder = newBuilder(); + try { + builder.mergeFrom(input, extensionRegistry); + } catch (com.google.protobuf.InvalidProtocolBufferException e) { + throw e.setUnfinishedMessage(builder.buildPartial()); + } catch (com.google.protobuf.UninitializedMessageException e) { + throw e.asInvalidProtocolBufferException().setUnfinishedMessage(builder.buildPartial()); + } catch (java.io.IOException e) { + throw new com.google.protobuf.InvalidProtocolBufferException(e) + .setUnfinishedMessage(builder.buildPartial()); + } + return builder.buildPartial(); + } + }; + + public static com.google.protobuf.Parser parser() { + return PARSER; + } + + @java.lang.Override + public com.google.protobuf.Parser getParserForType() { + return PARSER; + } + + @java.lang.Override + public com.openpositioning.PositionMe.Traj.MagnetometerReading getDefaultInstanceForType() { + return DEFAULT_INSTANCE; + } + + } + + public interface BarometerReadingOrBuilder extends + // @@protoc_insertion_point(interface_extends:BarometerReading) + com.google.protobuf.MessageOrBuilder { + + /** + * int64 relative_timestamp = 1; + * @return The relativeTimestamp. + */ + long getRelativeTimestamp(); + + /** + *
+     * mbar
+     * 
+ * + * float pressure = 2; + * @return The pressure. + */ + float getPressure(); + } + /** + * Protobuf type {@code BarometerReading} + */ + public static final class BarometerReading extends + com.google.protobuf.GeneratedMessage implements + // @@protoc_insertion_point(message_implements:BarometerReading) + BarometerReadingOrBuilder { + private static final long serialVersionUID = 0L; + static { + com.google.protobuf.RuntimeVersion.validateProtobufGencodeVersion( + com.google.protobuf.RuntimeVersion.RuntimeDomain.PUBLIC, + /* major= */ 4, + /* minor= */ 29, + /* patch= */ 6, + /* suffix= */ "", + BarometerReading.class.getName()); + } + // Use BarometerReading.newBuilder() to construct. + private BarometerReading(com.google.protobuf.GeneratedMessage.Builder builder) { + super(builder); + } + private BarometerReading() { + } + + public static final com.google.protobuf.Descriptors.Descriptor + getDescriptor() { + return com.openpositioning.PositionMe.Traj.internal_static_BarometerReading_descriptor; + } + + @java.lang.Override + protected com.google.protobuf.GeneratedMessage.FieldAccessorTable + internalGetFieldAccessorTable() { + return com.openpositioning.PositionMe.Traj.internal_static_BarometerReading_fieldAccessorTable + .ensureFieldAccessorsInitialized( + com.openpositioning.PositionMe.Traj.BarometerReading.class, com.openpositioning.PositionMe.Traj.BarometerReading.Builder.class); + } + + public static final int RELATIVE_TIMESTAMP_FIELD_NUMBER = 1; + private long relativeTimestamp_ = 0L; + /** + * int64 relative_timestamp = 1; + * @return The relativeTimestamp. + */ + @java.lang.Override + public long getRelativeTimestamp() { + return relativeTimestamp_; + } + + public static final int PRESSURE_FIELD_NUMBER = 2; + private float pressure_ = 0F; + /** + *
+     * mbar
+     * 
+ * + * float pressure = 2; + * @return The pressure. + */ + @java.lang.Override + public float getPressure() { + return pressure_; + } + + private byte memoizedIsInitialized = -1; + @java.lang.Override + public final boolean isInitialized() { + byte isInitialized = memoizedIsInitialized; + if (isInitialized == 1) return true; + if (isInitialized == 0) return false; + + memoizedIsInitialized = 1; + return true; + } + + @java.lang.Override + public void writeTo(com.google.protobuf.CodedOutputStream output) + throws java.io.IOException { + if (relativeTimestamp_ != 0L) { + output.writeInt64(1, relativeTimestamp_); + } + if (java.lang.Float.floatToRawIntBits(pressure_) != 0) { + output.writeFloat(2, pressure_); + } + getUnknownFields().writeTo(output); + } + + @java.lang.Override + public int getSerializedSize() { + int size = memoizedSize; + if (size != -1) return size; + + size = 0; + if (relativeTimestamp_ != 0L) { + size += com.google.protobuf.CodedOutputStream + .computeInt64Size(1, relativeTimestamp_); + } + if (java.lang.Float.floatToRawIntBits(pressure_) != 0) { + size += com.google.protobuf.CodedOutputStream + .computeFloatSize(2, pressure_); + } + size += getUnknownFields().getSerializedSize(); + memoizedSize = size; + return size; + } + + @java.lang.Override + public boolean equals(final java.lang.Object obj) { + if (obj == this) { + return true; + } + if (!(obj instanceof com.openpositioning.PositionMe.Traj.BarometerReading)) { + return super.equals(obj); + } + com.openpositioning.PositionMe.Traj.BarometerReading other = (com.openpositioning.PositionMe.Traj.BarometerReading) obj; + + if (getRelativeTimestamp() + != other.getRelativeTimestamp()) return false; + if (java.lang.Float.floatToIntBits(getPressure()) + != java.lang.Float.floatToIntBits( + other.getPressure())) return false; + if (!getUnknownFields().equals(other.getUnknownFields())) return false; + return true; + } + + @java.lang.Override + public int hashCode() { + if (memoizedHashCode != 0) { + return memoizedHashCode; + } + int hash = 41; + hash = (19 * hash) + getDescriptor().hashCode(); + hash = (37 * hash) + RELATIVE_TIMESTAMP_FIELD_NUMBER; + hash = (53 * hash) + com.google.protobuf.Internal.hashLong( + getRelativeTimestamp()); + hash = (37 * hash) + PRESSURE_FIELD_NUMBER; + hash = (53 * hash) + java.lang.Float.floatToIntBits( + getPressure()); + hash = (29 * hash) + getUnknownFields().hashCode(); + memoizedHashCode = hash; + return hash; + } + + public static com.openpositioning.PositionMe.Traj.BarometerReading parseFrom( + java.nio.ByteBuffer data) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + public static com.openpositioning.PositionMe.Traj.BarometerReading parseFrom( + java.nio.ByteBuffer data, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data, extensionRegistry); + } + public static com.openpositioning.PositionMe.Traj.BarometerReading parseFrom( + com.google.protobuf.ByteString data) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + public static com.openpositioning.PositionMe.Traj.BarometerReading parseFrom( + com.google.protobuf.ByteString data, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data, extensionRegistry); + } + public static com.openpositioning.PositionMe.Traj.BarometerReading parseFrom(byte[] data) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + public static com.openpositioning.PositionMe.Traj.BarometerReading parseFrom( + byte[] data, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data, extensionRegistry); + } + public static com.openpositioning.PositionMe.Traj.BarometerReading parseFrom(java.io.InputStream input) + throws java.io.IOException { + return com.google.protobuf.GeneratedMessage + .parseWithIOException(PARSER, input); + } + public static com.openpositioning.PositionMe.Traj.BarometerReading parseFrom( + java.io.InputStream input, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws java.io.IOException { + return com.google.protobuf.GeneratedMessage + .parseWithIOException(PARSER, input, extensionRegistry); + } + + public static com.openpositioning.PositionMe.Traj.BarometerReading parseDelimitedFrom(java.io.InputStream input) + throws java.io.IOException { + return com.google.protobuf.GeneratedMessage + .parseDelimitedWithIOException(PARSER, input); + } + + public static com.openpositioning.PositionMe.Traj.BarometerReading parseDelimitedFrom( + java.io.InputStream input, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws java.io.IOException { + return com.google.protobuf.GeneratedMessage + .parseDelimitedWithIOException(PARSER, input, extensionRegistry); + } + public static com.openpositioning.PositionMe.Traj.BarometerReading parseFrom( + com.google.protobuf.CodedInputStream input) + throws java.io.IOException { + return com.google.protobuf.GeneratedMessage + .parseWithIOException(PARSER, input); + } + public static com.openpositioning.PositionMe.Traj.BarometerReading parseFrom( + com.google.protobuf.CodedInputStream input, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws java.io.IOException { + return com.google.protobuf.GeneratedMessage + .parseWithIOException(PARSER, input, extensionRegistry); + } + + @java.lang.Override + public Builder newBuilderForType() { return newBuilder(); } + public static Builder newBuilder() { + return DEFAULT_INSTANCE.toBuilder(); + } + public static Builder newBuilder(com.openpositioning.PositionMe.Traj.BarometerReading prototype) { + return DEFAULT_INSTANCE.toBuilder().mergeFrom(prototype); + } + @java.lang.Override + public Builder toBuilder() { + return this == DEFAULT_INSTANCE + ? new Builder() : new Builder().mergeFrom(this); + } + + @java.lang.Override + protected Builder newBuilderForType( + com.google.protobuf.GeneratedMessage.BuilderParent parent) { + Builder builder = new Builder(parent); + return builder; + } + /** + * Protobuf type {@code BarometerReading} + */ + public static final class Builder extends + com.google.protobuf.GeneratedMessage.Builder implements + // @@protoc_insertion_point(builder_implements:BarometerReading) + com.openpositioning.PositionMe.Traj.BarometerReadingOrBuilder { + public static final com.google.protobuf.Descriptors.Descriptor + getDescriptor() { + return com.openpositioning.PositionMe.Traj.internal_static_BarometerReading_descriptor; + } + + @java.lang.Override + protected com.google.protobuf.GeneratedMessage.FieldAccessorTable + internalGetFieldAccessorTable() { + return com.openpositioning.PositionMe.Traj.internal_static_BarometerReading_fieldAccessorTable + .ensureFieldAccessorsInitialized( + com.openpositioning.PositionMe.Traj.BarometerReading.class, com.openpositioning.PositionMe.Traj.BarometerReading.Builder.class); + } + + // Construct using com.openpositioning.PositionMe.Traj.BarometerReading.newBuilder() + private Builder() { + + } + + private Builder( + com.google.protobuf.GeneratedMessage.BuilderParent parent) { + super(parent); + + } + @java.lang.Override + public Builder clear() { + super.clear(); + bitField0_ = 0; + relativeTimestamp_ = 0L; + pressure_ = 0F; + return this; + } + + @java.lang.Override + public com.google.protobuf.Descriptors.Descriptor + getDescriptorForType() { + return com.openpositioning.PositionMe.Traj.internal_static_BarometerReading_descriptor; + } + + @java.lang.Override + public com.openpositioning.PositionMe.Traj.BarometerReading getDefaultInstanceForType() { + return com.openpositioning.PositionMe.Traj.BarometerReading.getDefaultInstance(); + } + + @java.lang.Override + public com.openpositioning.PositionMe.Traj.BarometerReading build() { + com.openpositioning.PositionMe.Traj.BarometerReading result = buildPartial(); + if (!result.isInitialized()) { + throw newUninitializedMessageException(result); + } + return result; + } + + @java.lang.Override + public com.openpositioning.PositionMe.Traj.BarometerReading buildPartial() { + com.openpositioning.PositionMe.Traj.BarometerReading result = new com.openpositioning.PositionMe.Traj.BarometerReading(this); + if (bitField0_ != 0) { buildPartial0(result); } + onBuilt(); + return result; + } + + private void buildPartial0(com.openpositioning.PositionMe.Traj.BarometerReading result) { + int from_bitField0_ = bitField0_; + if (((from_bitField0_ & 0x00000001) != 0)) { + result.relativeTimestamp_ = relativeTimestamp_; + } + if (((from_bitField0_ & 0x00000002) != 0)) { + result.pressure_ = pressure_; + } + } + + @java.lang.Override + public Builder mergeFrom(com.google.protobuf.Message other) { + if (other instanceof com.openpositioning.PositionMe.Traj.BarometerReading) { + return mergeFrom((com.openpositioning.PositionMe.Traj.BarometerReading)other); + } else { + super.mergeFrom(other); + return this; + } + } + + public Builder mergeFrom(com.openpositioning.PositionMe.Traj.BarometerReading other) { + if (other == com.openpositioning.PositionMe.Traj.BarometerReading.getDefaultInstance()) return this; + if (other.getRelativeTimestamp() != 0L) { + setRelativeTimestamp(other.getRelativeTimestamp()); + } + if (other.getPressure() != 0F) { + setPressure(other.getPressure()); + } + this.mergeUnknownFields(other.getUnknownFields()); + onChanged(); + return this; + } + + @java.lang.Override + public final boolean isInitialized() { + return true; + } + + @java.lang.Override + public Builder mergeFrom( + com.google.protobuf.CodedInputStream input, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws java.io.IOException { + if (extensionRegistry == null) { + throw new java.lang.NullPointerException(); + } + try { + boolean done = false; + while (!done) { + int tag = input.readTag(); + switch (tag) { + case 0: + done = true; + break; + case 8: { + relativeTimestamp_ = input.readInt64(); + bitField0_ |= 0x00000001; + break; + } // case 8 + case 21: { + pressure_ = input.readFloat(); + bitField0_ |= 0x00000002; + break; + } // case 21 + default: { + if (!super.parseUnknownField(input, extensionRegistry, tag)) { + done = true; // was an endgroup tag + } + break; + } // default: + } // switch (tag) + } // while (!done) + } catch (com.google.protobuf.InvalidProtocolBufferException e) { + throw e.unwrapIOException(); + } finally { + onChanged(); + } // finally + return this; + } + private int bitField0_; + + private long relativeTimestamp_ ; + /** + * int64 relative_timestamp = 1; + * @return The relativeTimestamp. + */ + @java.lang.Override + public long getRelativeTimestamp() { + return relativeTimestamp_; + } + /** + * int64 relative_timestamp = 1; + * @param value The relativeTimestamp to set. + * @return This builder for chaining. + */ + public Builder setRelativeTimestamp(long value) { + + relativeTimestamp_ = value; + bitField0_ |= 0x00000001; + onChanged(); + return this; + } + /** + * int64 relative_timestamp = 1; + * @return This builder for chaining. + */ + public Builder clearRelativeTimestamp() { + bitField0_ = (bitField0_ & ~0x00000001); + relativeTimestamp_ = 0L; + onChanged(); + return this; + } + + private float pressure_ ; + /** + *
+       * mbar
+       * 
+ * + * float pressure = 2; + * @return The pressure. + */ + @java.lang.Override + public float getPressure() { + return pressure_; + } + /** + *
+       * mbar
+       * 
+ * + * float pressure = 2; + * @param value The pressure to set. + * @return This builder for chaining. + */ + public Builder setPressure(float value) { + + pressure_ = value; + bitField0_ |= 0x00000002; + onChanged(); + return this; + } + /** + *
+       * mbar
+       * 
+ * + * float pressure = 2; + * @return This builder for chaining. + */ + public Builder clearPressure() { + bitField0_ = (bitField0_ & ~0x00000002); + pressure_ = 0F; + onChanged(); + return this; + } + + // @@protoc_insertion_point(builder_scope:BarometerReading) + } + + // @@protoc_insertion_point(class_scope:BarometerReading) + private static final com.openpositioning.PositionMe.Traj.BarometerReading DEFAULT_INSTANCE; + static { + DEFAULT_INSTANCE = new com.openpositioning.PositionMe.Traj.BarometerReading(); + } + + public static com.openpositioning.PositionMe.Traj.BarometerReading getDefaultInstance() { + return DEFAULT_INSTANCE; + } + + private static final com.google.protobuf.Parser + PARSER = new com.google.protobuf.AbstractParser() { + @java.lang.Override + public BarometerReading parsePartialFrom( + com.google.protobuf.CodedInputStream input, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + Builder builder = newBuilder(); + try { + builder.mergeFrom(input, extensionRegistry); + } catch (com.google.protobuf.InvalidProtocolBufferException e) { + throw e.setUnfinishedMessage(builder.buildPartial()); + } catch (com.google.protobuf.UninitializedMessageException e) { + throw e.asInvalidProtocolBufferException().setUnfinishedMessage(builder.buildPartial()); + } catch (java.io.IOException e) { + throw new com.google.protobuf.InvalidProtocolBufferException(e) + .setUnfinishedMessage(builder.buildPartial()); + } + return builder.buildPartial(); + } + }; + + public static com.google.protobuf.Parser parser() { + return PARSER; + } + + @java.lang.Override + public com.google.protobuf.Parser getParserForType() { + return PARSER; + } + + @java.lang.Override + public com.openpositioning.PositionMe.Traj.BarometerReading getDefaultInstanceForType() { + return DEFAULT_INSTANCE; + } + + } + + public interface LightReadingOrBuilder extends + // @@protoc_insertion_point(interface_extends:LightReading) + com.google.protobuf.MessageOrBuilder { + + /** + * int64 relative_timestamp = 1; + * @return The relativeTimestamp. + */ + long getRelativeTimestamp(); + + /** + *
+     * lux
+     * 
+ * + * float light = 2; + * @return The light. + */ + float getLight(); + } + /** + * Protobuf type {@code LightReading} + */ + public static final class LightReading extends + com.google.protobuf.GeneratedMessage implements + // @@protoc_insertion_point(message_implements:LightReading) + LightReadingOrBuilder { + private static final long serialVersionUID = 0L; + static { + com.google.protobuf.RuntimeVersion.validateProtobufGencodeVersion( + com.google.protobuf.RuntimeVersion.RuntimeDomain.PUBLIC, + /* major= */ 4, + /* minor= */ 29, + /* patch= */ 6, + /* suffix= */ "", + LightReading.class.getName()); + } + // Use LightReading.newBuilder() to construct. + private LightReading(com.google.protobuf.GeneratedMessage.Builder builder) { + super(builder); + } + private LightReading() { + } + + public static final com.google.protobuf.Descriptors.Descriptor + getDescriptor() { + return com.openpositioning.PositionMe.Traj.internal_static_LightReading_descriptor; + } + + @java.lang.Override + protected com.google.protobuf.GeneratedMessage.FieldAccessorTable + internalGetFieldAccessorTable() { + return com.openpositioning.PositionMe.Traj.internal_static_LightReading_fieldAccessorTable + .ensureFieldAccessorsInitialized( + com.openpositioning.PositionMe.Traj.LightReading.class, com.openpositioning.PositionMe.Traj.LightReading.Builder.class); + } + + public static final int RELATIVE_TIMESTAMP_FIELD_NUMBER = 1; + private long relativeTimestamp_ = 0L; + /** + * int64 relative_timestamp = 1; + * @return The relativeTimestamp. + */ + @java.lang.Override + public long getRelativeTimestamp() { + return relativeTimestamp_; + } + + public static final int LIGHT_FIELD_NUMBER = 2; + private float light_ = 0F; + /** + *
+     * lux
+     * 
+ * + * float light = 2; + * @return The light. + */ + @java.lang.Override + public float getLight() { + return light_; + } + + private byte memoizedIsInitialized = -1; + @java.lang.Override + public final boolean isInitialized() { + byte isInitialized = memoizedIsInitialized; + if (isInitialized == 1) return true; + if (isInitialized == 0) return false; + + memoizedIsInitialized = 1; + return true; + } + + @java.lang.Override + public void writeTo(com.google.protobuf.CodedOutputStream output) + throws java.io.IOException { + if (relativeTimestamp_ != 0L) { + output.writeInt64(1, relativeTimestamp_); + } + if (java.lang.Float.floatToRawIntBits(light_) != 0) { + output.writeFloat(2, light_); + } + getUnknownFields().writeTo(output); + } + + @java.lang.Override + public int getSerializedSize() { + int size = memoizedSize; + if (size != -1) return size; + + size = 0; + if (relativeTimestamp_ != 0L) { + size += com.google.protobuf.CodedOutputStream + .computeInt64Size(1, relativeTimestamp_); + } + if (java.lang.Float.floatToRawIntBits(light_) != 0) { + size += com.google.protobuf.CodedOutputStream + .computeFloatSize(2, light_); + } + size += getUnknownFields().getSerializedSize(); + memoizedSize = size; + return size; + } + + @java.lang.Override + public boolean equals(final java.lang.Object obj) { + if (obj == this) { + return true; + } + if (!(obj instanceof com.openpositioning.PositionMe.Traj.LightReading)) { + return super.equals(obj); + } + com.openpositioning.PositionMe.Traj.LightReading other = (com.openpositioning.PositionMe.Traj.LightReading) obj; + + if (getRelativeTimestamp() + != other.getRelativeTimestamp()) return false; + if (java.lang.Float.floatToIntBits(getLight()) + != java.lang.Float.floatToIntBits( + other.getLight())) return false; + if (!getUnknownFields().equals(other.getUnknownFields())) return false; + return true; + } + + @java.lang.Override + public int hashCode() { + if (memoizedHashCode != 0) { + return memoizedHashCode; + } + int hash = 41; + hash = (19 * hash) + getDescriptor().hashCode(); + hash = (37 * hash) + RELATIVE_TIMESTAMP_FIELD_NUMBER; + hash = (53 * hash) + com.google.protobuf.Internal.hashLong( + getRelativeTimestamp()); + hash = (37 * hash) + LIGHT_FIELD_NUMBER; + hash = (53 * hash) + java.lang.Float.floatToIntBits( + getLight()); + hash = (29 * hash) + getUnknownFields().hashCode(); + memoizedHashCode = hash; + return hash; + } + + public static com.openpositioning.PositionMe.Traj.LightReading parseFrom( + java.nio.ByteBuffer data) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + public static com.openpositioning.PositionMe.Traj.LightReading parseFrom( + java.nio.ByteBuffer data, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data, extensionRegistry); + } + public static com.openpositioning.PositionMe.Traj.LightReading parseFrom( + com.google.protobuf.ByteString data) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + public static com.openpositioning.PositionMe.Traj.LightReading parseFrom( + com.google.protobuf.ByteString data, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data, extensionRegistry); + } + public static com.openpositioning.PositionMe.Traj.LightReading parseFrom(byte[] data) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + public static com.openpositioning.PositionMe.Traj.LightReading parseFrom( + byte[] data, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data, extensionRegistry); + } + public static com.openpositioning.PositionMe.Traj.LightReading parseFrom(java.io.InputStream input) + throws java.io.IOException { + return com.google.protobuf.GeneratedMessage + .parseWithIOException(PARSER, input); + } + public static com.openpositioning.PositionMe.Traj.LightReading parseFrom( + java.io.InputStream input, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws java.io.IOException { + return com.google.protobuf.GeneratedMessage + .parseWithIOException(PARSER, input, extensionRegistry); + } + + public static com.openpositioning.PositionMe.Traj.LightReading parseDelimitedFrom(java.io.InputStream input) + throws java.io.IOException { + return com.google.protobuf.GeneratedMessage + .parseDelimitedWithIOException(PARSER, input); + } + + public static com.openpositioning.PositionMe.Traj.LightReading parseDelimitedFrom( + java.io.InputStream input, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws java.io.IOException { + return com.google.protobuf.GeneratedMessage + .parseDelimitedWithIOException(PARSER, input, extensionRegistry); + } + public static com.openpositioning.PositionMe.Traj.LightReading parseFrom( + com.google.protobuf.CodedInputStream input) + throws java.io.IOException { + return com.google.protobuf.GeneratedMessage + .parseWithIOException(PARSER, input); + } + public static com.openpositioning.PositionMe.Traj.LightReading parseFrom( + com.google.protobuf.CodedInputStream input, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws java.io.IOException { + return com.google.protobuf.GeneratedMessage + .parseWithIOException(PARSER, input, extensionRegistry); + } + + @java.lang.Override + public Builder newBuilderForType() { return newBuilder(); } + public static Builder newBuilder() { + return DEFAULT_INSTANCE.toBuilder(); + } + public static Builder newBuilder(com.openpositioning.PositionMe.Traj.LightReading prototype) { + return DEFAULT_INSTANCE.toBuilder().mergeFrom(prototype); + } + @java.lang.Override + public Builder toBuilder() { + return this == DEFAULT_INSTANCE + ? new Builder() : new Builder().mergeFrom(this); + } + + @java.lang.Override + protected Builder newBuilderForType( + com.google.protobuf.GeneratedMessage.BuilderParent parent) { + Builder builder = new Builder(parent); + return builder; + } + /** + * Protobuf type {@code LightReading} + */ + public static final class Builder extends + com.google.protobuf.GeneratedMessage.Builder implements + // @@protoc_insertion_point(builder_implements:LightReading) + com.openpositioning.PositionMe.Traj.LightReadingOrBuilder { + public static final com.google.protobuf.Descriptors.Descriptor + getDescriptor() { + return com.openpositioning.PositionMe.Traj.internal_static_LightReading_descriptor; + } + + @java.lang.Override + protected com.google.protobuf.GeneratedMessage.FieldAccessorTable + internalGetFieldAccessorTable() { + return com.openpositioning.PositionMe.Traj.internal_static_LightReading_fieldAccessorTable + .ensureFieldAccessorsInitialized( + com.openpositioning.PositionMe.Traj.LightReading.class, com.openpositioning.PositionMe.Traj.LightReading.Builder.class); + } + + // Construct using com.openpositioning.PositionMe.Traj.LightReading.newBuilder() + private Builder() { + + } + + private Builder( + com.google.protobuf.GeneratedMessage.BuilderParent parent) { + super(parent); + + } + @java.lang.Override + public Builder clear() { + super.clear(); + bitField0_ = 0; + relativeTimestamp_ = 0L; + light_ = 0F; + return this; + } + + @java.lang.Override + public com.google.protobuf.Descriptors.Descriptor + getDescriptorForType() { + return com.openpositioning.PositionMe.Traj.internal_static_LightReading_descriptor; + } + + @java.lang.Override + public com.openpositioning.PositionMe.Traj.LightReading getDefaultInstanceForType() { + return com.openpositioning.PositionMe.Traj.LightReading.getDefaultInstance(); + } + + @java.lang.Override + public com.openpositioning.PositionMe.Traj.LightReading build() { + com.openpositioning.PositionMe.Traj.LightReading result = buildPartial(); + if (!result.isInitialized()) { + throw newUninitializedMessageException(result); + } + return result; + } + + @java.lang.Override + public com.openpositioning.PositionMe.Traj.LightReading buildPartial() { + com.openpositioning.PositionMe.Traj.LightReading result = new com.openpositioning.PositionMe.Traj.LightReading(this); + if (bitField0_ != 0) { buildPartial0(result); } + onBuilt(); + return result; + } + + private void buildPartial0(com.openpositioning.PositionMe.Traj.LightReading result) { + int from_bitField0_ = bitField0_; + if (((from_bitField0_ & 0x00000001) != 0)) { + result.relativeTimestamp_ = relativeTimestamp_; + } + if (((from_bitField0_ & 0x00000002) != 0)) { + result.light_ = light_; + } + } + + @java.lang.Override + public Builder mergeFrom(com.google.protobuf.Message other) { + if (other instanceof com.openpositioning.PositionMe.Traj.LightReading) { + return mergeFrom((com.openpositioning.PositionMe.Traj.LightReading)other); + } else { + super.mergeFrom(other); + return this; + } + } + + public Builder mergeFrom(com.openpositioning.PositionMe.Traj.LightReading other) { + if (other == com.openpositioning.PositionMe.Traj.LightReading.getDefaultInstance()) return this; + if (other.getRelativeTimestamp() != 0L) { + setRelativeTimestamp(other.getRelativeTimestamp()); + } + if (other.getLight() != 0F) { + setLight(other.getLight()); + } + this.mergeUnknownFields(other.getUnknownFields()); + onChanged(); + return this; + } + + @java.lang.Override + public final boolean isInitialized() { + return true; + } + + @java.lang.Override + public Builder mergeFrom( + com.google.protobuf.CodedInputStream input, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws java.io.IOException { + if (extensionRegistry == null) { + throw new java.lang.NullPointerException(); + } + try { + boolean done = false; + while (!done) { + int tag = input.readTag(); + switch (tag) { + case 0: + done = true; + break; + case 8: { + relativeTimestamp_ = input.readInt64(); + bitField0_ |= 0x00000001; + break; + } // case 8 + case 21: { + light_ = input.readFloat(); + bitField0_ |= 0x00000002; + break; + } // case 21 + default: { + if (!super.parseUnknownField(input, extensionRegistry, tag)) { + done = true; // was an endgroup tag + } + break; + } // default: + } // switch (tag) + } // while (!done) + } catch (com.google.protobuf.InvalidProtocolBufferException e) { + throw e.unwrapIOException(); + } finally { + onChanged(); + } // finally + return this; + } + private int bitField0_; + + private long relativeTimestamp_ ; + /** + * int64 relative_timestamp = 1; + * @return The relativeTimestamp. + */ + @java.lang.Override + public long getRelativeTimestamp() { + return relativeTimestamp_; + } + /** + * int64 relative_timestamp = 1; + * @param value The relativeTimestamp to set. + * @return This builder for chaining. + */ + public Builder setRelativeTimestamp(long value) { + + relativeTimestamp_ = value; + bitField0_ |= 0x00000001; + onChanged(); + return this; + } + /** + * int64 relative_timestamp = 1; + * @return This builder for chaining. + */ + public Builder clearRelativeTimestamp() { + bitField0_ = (bitField0_ & ~0x00000001); + relativeTimestamp_ = 0L; + onChanged(); + return this; + } + + private float light_ ; + /** + *
+       * lux
+       * 
+ * + * float light = 2; + * @return The light. + */ + @java.lang.Override + public float getLight() { + return light_; + } + /** + *
+       * lux
+       * 
+ * + * float light = 2; + * @param value The light to set. + * @return This builder for chaining. + */ + public Builder setLight(float value) { + + light_ = value; + bitField0_ |= 0x00000002; + onChanged(); + return this; + } + /** + *
+       * lux
+       * 
+ * + * float light = 2; + * @return This builder for chaining. + */ + public Builder clearLight() { + bitField0_ = (bitField0_ & ~0x00000002); + light_ = 0F; + onChanged(); + return this; + } + + // @@protoc_insertion_point(builder_scope:LightReading) + } + + // @@protoc_insertion_point(class_scope:LightReading) + private static final com.openpositioning.PositionMe.Traj.LightReading DEFAULT_INSTANCE; + static { + DEFAULT_INSTANCE = new com.openpositioning.PositionMe.Traj.LightReading(); + } + + public static com.openpositioning.PositionMe.Traj.LightReading getDefaultInstance() { + return DEFAULT_INSTANCE; + } + + private static final com.google.protobuf.Parser + PARSER = new com.google.protobuf.AbstractParser() { + @java.lang.Override + public LightReading parsePartialFrom( + com.google.protobuf.CodedInputStream input, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + Builder builder = newBuilder(); + try { + builder.mergeFrom(input, extensionRegistry); + } catch (com.google.protobuf.InvalidProtocolBufferException e) { + throw e.setUnfinishedMessage(builder.buildPartial()); + } catch (com.google.protobuf.UninitializedMessageException e) { + throw e.asInvalidProtocolBufferException().setUnfinishedMessage(builder.buildPartial()); + } catch (java.io.IOException e) { + throw new com.google.protobuf.InvalidProtocolBufferException(e) + .setUnfinishedMessage(builder.buildPartial()); + } + return builder.buildPartial(); + } + }; + + public static com.google.protobuf.Parser parser() { + return PARSER; + } + + @java.lang.Override + public com.google.protobuf.Parser getParserForType() { + return PARSER; + } + + @java.lang.Override + public com.openpositioning.PositionMe.Traj.LightReading getDefaultInstanceForType() { + return DEFAULT_INSTANCE; + } + + } + + public interface ProximityReadingOrBuilder extends + // @@protoc_insertion_point(interface_extends:ProximityReading) + com.google.protobuf.MessageOrBuilder { + + /** + * int64 relative_timestamp = 1; + * @return The relativeTimestamp. + */ + long getRelativeTimestamp(); + + /** + *
+     * cm
+     * 
+ * + * float distance = 2; + * @return The distance. + */ + float getDistance(); + } + /** + * Protobuf type {@code ProximityReading} + */ + public static final class ProximityReading extends + com.google.protobuf.GeneratedMessage implements + // @@protoc_insertion_point(message_implements:ProximityReading) + ProximityReadingOrBuilder { + private static final long serialVersionUID = 0L; + static { + com.google.protobuf.RuntimeVersion.validateProtobufGencodeVersion( + com.google.protobuf.RuntimeVersion.RuntimeDomain.PUBLIC, + /* major= */ 4, + /* minor= */ 29, + /* patch= */ 6, + /* suffix= */ "", + ProximityReading.class.getName()); + } + // Use ProximityReading.newBuilder() to construct. + private ProximityReading(com.google.protobuf.GeneratedMessage.Builder builder) { + super(builder); + } + private ProximityReading() { + } + + public static final com.google.protobuf.Descriptors.Descriptor + getDescriptor() { + return com.openpositioning.PositionMe.Traj.internal_static_ProximityReading_descriptor; + } + + @java.lang.Override + protected com.google.protobuf.GeneratedMessage.FieldAccessorTable + internalGetFieldAccessorTable() { + return com.openpositioning.PositionMe.Traj.internal_static_ProximityReading_fieldAccessorTable + .ensureFieldAccessorsInitialized( + com.openpositioning.PositionMe.Traj.ProximityReading.class, com.openpositioning.PositionMe.Traj.ProximityReading.Builder.class); + } + + public static final int RELATIVE_TIMESTAMP_FIELD_NUMBER = 1; + private long relativeTimestamp_ = 0L; + /** + * int64 relative_timestamp = 1; + * @return The relativeTimestamp. + */ + @java.lang.Override + public long getRelativeTimestamp() { + return relativeTimestamp_; + } + + public static final int DISTANCE_FIELD_NUMBER = 2; + private float distance_ = 0F; + /** + *
+     * cm
+     * 
+ * + * float distance = 2; + * @return The distance. + */ + @java.lang.Override + public float getDistance() { + return distance_; + } + + private byte memoizedIsInitialized = -1; + @java.lang.Override + public final boolean isInitialized() { + byte isInitialized = memoizedIsInitialized; + if (isInitialized == 1) return true; + if (isInitialized == 0) return false; + + memoizedIsInitialized = 1; + return true; + } + + @java.lang.Override + public void writeTo(com.google.protobuf.CodedOutputStream output) + throws java.io.IOException { + if (relativeTimestamp_ != 0L) { + output.writeInt64(1, relativeTimestamp_); + } + if (java.lang.Float.floatToRawIntBits(distance_) != 0) { + output.writeFloat(2, distance_); + } + getUnknownFields().writeTo(output); + } + + @java.lang.Override + public int getSerializedSize() { + int size = memoizedSize; + if (size != -1) return size; + + size = 0; + if (relativeTimestamp_ != 0L) { + size += com.google.protobuf.CodedOutputStream + .computeInt64Size(1, relativeTimestamp_); + } + if (java.lang.Float.floatToRawIntBits(distance_) != 0) { + size += com.google.protobuf.CodedOutputStream + .computeFloatSize(2, distance_); + } + size += getUnknownFields().getSerializedSize(); + memoizedSize = size; + return size; + } + + @java.lang.Override + public boolean equals(final java.lang.Object obj) { + if (obj == this) { + return true; + } + if (!(obj instanceof com.openpositioning.PositionMe.Traj.ProximityReading)) { + return super.equals(obj); + } + com.openpositioning.PositionMe.Traj.ProximityReading other = (com.openpositioning.PositionMe.Traj.ProximityReading) obj; + + if (getRelativeTimestamp() + != other.getRelativeTimestamp()) return false; + if (java.lang.Float.floatToIntBits(getDistance()) + != java.lang.Float.floatToIntBits( + other.getDistance())) return false; + if (!getUnknownFields().equals(other.getUnknownFields())) return false; + return true; + } + + @java.lang.Override + public int hashCode() { + if (memoizedHashCode != 0) { + return memoizedHashCode; + } + int hash = 41; + hash = (19 * hash) + getDescriptor().hashCode(); + hash = (37 * hash) + RELATIVE_TIMESTAMP_FIELD_NUMBER; + hash = (53 * hash) + com.google.protobuf.Internal.hashLong( + getRelativeTimestamp()); + hash = (37 * hash) + DISTANCE_FIELD_NUMBER; + hash = (53 * hash) + java.lang.Float.floatToIntBits( + getDistance()); + hash = (29 * hash) + getUnknownFields().hashCode(); + memoizedHashCode = hash; + return hash; + } + + public static com.openpositioning.PositionMe.Traj.ProximityReading parseFrom( + java.nio.ByteBuffer data) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + public static com.openpositioning.PositionMe.Traj.ProximityReading parseFrom( + java.nio.ByteBuffer data, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data, extensionRegistry); + } + public static com.openpositioning.PositionMe.Traj.ProximityReading parseFrom( + com.google.protobuf.ByteString data) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + public static com.openpositioning.PositionMe.Traj.ProximityReading parseFrom( + com.google.protobuf.ByteString data, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data, extensionRegistry); + } + public static com.openpositioning.PositionMe.Traj.ProximityReading parseFrom(byte[] data) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + public static com.openpositioning.PositionMe.Traj.ProximityReading parseFrom( + byte[] data, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data, extensionRegistry); + } + public static com.openpositioning.PositionMe.Traj.ProximityReading parseFrom(java.io.InputStream input) + throws java.io.IOException { + return com.google.protobuf.GeneratedMessage + .parseWithIOException(PARSER, input); + } + public static com.openpositioning.PositionMe.Traj.ProximityReading parseFrom( + java.io.InputStream input, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws java.io.IOException { + return com.google.protobuf.GeneratedMessage + .parseWithIOException(PARSER, input, extensionRegistry); + } + + public static com.openpositioning.PositionMe.Traj.ProximityReading parseDelimitedFrom(java.io.InputStream input) + throws java.io.IOException { + return com.google.protobuf.GeneratedMessage + .parseDelimitedWithIOException(PARSER, input); + } + + public static com.openpositioning.PositionMe.Traj.ProximityReading parseDelimitedFrom( + java.io.InputStream input, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws java.io.IOException { + return com.google.protobuf.GeneratedMessage + .parseDelimitedWithIOException(PARSER, input, extensionRegistry); + } + public static com.openpositioning.PositionMe.Traj.ProximityReading parseFrom( + com.google.protobuf.CodedInputStream input) + throws java.io.IOException { + return com.google.protobuf.GeneratedMessage + .parseWithIOException(PARSER, input); + } + public static com.openpositioning.PositionMe.Traj.ProximityReading parseFrom( + com.google.protobuf.CodedInputStream input, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws java.io.IOException { + return com.google.protobuf.GeneratedMessage + .parseWithIOException(PARSER, input, extensionRegistry); + } + + @java.lang.Override + public Builder newBuilderForType() { return newBuilder(); } + public static Builder newBuilder() { + return DEFAULT_INSTANCE.toBuilder(); + } + public static Builder newBuilder(com.openpositioning.PositionMe.Traj.ProximityReading prototype) { + return DEFAULT_INSTANCE.toBuilder().mergeFrom(prototype); + } + @java.lang.Override + public Builder toBuilder() { + return this == DEFAULT_INSTANCE + ? new Builder() : new Builder().mergeFrom(this); + } + + @java.lang.Override + protected Builder newBuilderForType( + com.google.protobuf.GeneratedMessage.BuilderParent parent) { + Builder builder = new Builder(parent); + return builder; + } + /** + * Protobuf type {@code ProximityReading} + */ + public static final class Builder extends + com.google.protobuf.GeneratedMessage.Builder implements + // @@protoc_insertion_point(builder_implements:ProximityReading) + com.openpositioning.PositionMe.Traj.ProximityReadingOrBuilder { + public static final com.google.protobuf.Descriptors.Descriptor + getDescriptor() { + return com.openpositioning.PositionMe.Traj.internal_static_ProximityReading_descriptor; + } + + @java.lang.Override + protected com.google.protobuf.GeneratedMessage.FieldAccessorTable + internalGetFieldAccessorTable() { + return com.openpositioning.PositionMe.Traj.internal_static_ProximityReading_fieldAccessorTable + .ensureFieldAccessorsInitialized( + com.openpositioning.PositionMe.Traj.ProximityReading.class, com.openpositioning.PositionMe.Traj.ProximityReading.Builder.class); + } + + // Construct using com.openpositioning.PositionMe.Traj.ProximityReading.newBuilder() + private Builder() { + + } + + private Builder( + com.google.protobuf.GeneratedMessage.BuilderParent parent) { + super(parent); + + } + @java.lang.Override + public Builder clear() { + super.clear(); + bitField0_ = 0; + relativeTimestamp_ = 0L; + distance_ = 0F; + return this; + } + + @java.lang.Override + public com.google.protobuf.Descriptors.Descriptor + getDescriptorForType() { + return com.openpositioning.PositionMe.Traj.internal_static_ProximityReading_descriptor; + } + + @java.lang.Override + public com.openpositioning.PositionMe.Traj.ProximityReading getDefaultInstanceForType() { + return com.openpositioning.PositionMe.Traj.ProximityReading.getDefaultInstance(); + } + + @java.lang.Override + public com.openpositioning.PositionMe.Traj.ProximityReading build() { + com.openpositioning.PositionMe.Traj.ProximityReading result = buildPartial(); + if (!result.isInitialized()) { + throw newUninitializedMessageException(result); + } + return result; + } + + @java.lang.Override + public com.openpositioning.PositionMe.Traj.ProximityReading buildPartial() { + com.openpositioning.PositionMe.Traj.ProximityReading result = new com.openpositioning.PositionMe.Traj.ProximityReading(this); + if (bitField0_ != 0) { buildPartial0(result); } + onBuilt(); + return result; + } + + private void buildPartial0(com.openpositioning.PositionMe.Traj.ProximityReading result) { + int from_bitField0_ = bitField0_; + if (((from_bitField0_ & 0x00000001) != 0)) { + result.relativeTimestamp_ = relativeTimestamp_; + } + if (((from_bitField0_ & 0x00000002) != 0)) { + result.distance_ = distance_; + } + } + + @java.lang.Override + public Builder mergeFrom(com.google.protobuf.Message other) { + if (other instanceof com.openpositioning.PositionMe.Traj.ProximityReading) { + return mergeFrom((com.openpositioning.PositionMe.Traj.ProximityReading)other); + } else { + super.mergeFrom(other); + return this; + } + } + + public Builder mergeFrom(com.openpositioning.PositionMe.Traj.ProximityReading other) { + if (other == com.openpositioning.PositionMe.Traj.ProximityReading.getDefaultInstance()) return this; + if (other.getRelativeTimestamp() != 0L) { + setRelativeTimestamp(other.getRelativeTimestamp()); + } + if (other.getDistance() != 0F) { + setDistance(other.getDistance()); + } + this.mergeUnknownFields(other.getUnknownFields()); + onChanged(); + return this; + } + + @java.lang.Override + public final boolean isInitialized() { + return true; + } + + @java.lang.Override + public Builder mergeFrom( + com.google.protobuf.CodedInputStream input, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws java.io.IOException { + if (extensionRegistry == null) { + throw new java.lang.NullPointerException(); + } + try { + boolean done = false; + while (!done) { + int tag = input.readTag(); + switch (tag) { + case 0: + done = true; + break; + case 8: { + relativeTimestamp_ = input.readInt64(); + bitField0_ |= 0x00000001; + break; + } // case 8 + case 21: { + distance_ = input.readFloat(); + bitField0_ |= 0x00000002; + break; + } // case 21 + default: { + if (!super.parseUnknownField(input, extensionRegistry, tag)) { + done = true; // was an endgroup tag + } + break; + } // default: + } // switch (tag) + } // while (!done) + } catch (com.google.protobuf.InvalidProtocolBufferException e) { + throw e.unwrapIOException(); + } finally { + onChanged(); + } // finally + return this; + } + private int bitField0_; + + private long relativeTimestamp_ ; + /** + * int64 relative_timestamp = 1; + * @return The relativeTimestamp. + */ + @java.lang.Override + public long getRelativeTimestamp() { + return relativeTimestamp_; + } + /** + * int64 relative_timestamp = 1; + * @param value The relativeTimestamp to set. + * @return This builder for chaining. + */ + public Builder setRelativeTimestamp(long value) { + + relativeTimestamp_ = value; + bitField0_ |= 0x00000001; + onChanged(); + return this; + } + /** + * int64 relative_timestamp = 1; + * @return This builder for chaining. + */ + public Builder clearRelativeTimestamp() { + bitField0_ = (bitField0_ & ~0x00000001); + relativeTimestamp_ = 0L; + onChanged(); + return this; + } + + private float distance_ ; + /** + *
+       * cm
+       * 
+ * + * float distance = 2; + * @return The distance. + */ + @java.lang.Override + public float getDistance() { + return distance_; + } + /** + *
+       * cm
+       * 
+ * + * float distance = 2; + * @param value The distance to set. + * @return This builder for chaining. + */ + public Builder setDistance(float value) { + + distance_ = value; + bitField0_ |= 0x00000002; + onChanged(); + return this; + } + /** + *
+       * cm
+       * 
+ * + * float distance = 2; + * @return This builder for chaining. + */ + public Builder clearDistance() { + bitField0_ = (bitField0_ & ~0x00000002); + distance_ = 0F; + onChanged(); + return this; + } + + // @@protoc_insertion_point(builder_scope:ProximityReading) + } + + // @@protoc_insertion_point(class_scope:ProximityReading) + private static final com.openpositioning.PositionMe.Traj.ProximityReading DEFAULT_INSTANCE; + static { + DEFAULT_INSTANCE = new com.openpositioning.PositionMe.Traj.ProximityReading(); + } + + public static com.openpositioning.PositionMe.Traj.ProximityReading getDefaultInstance() { + return DEFAULT_INSTANCE; + } + + private static final com.google.protobuf.Parser + PARSER = new com.google.protobuf.AbstractParser() { + @java.lang.Override + public ProximityReading parsePartialFrom( + com.google.protobuf.CodedInputStream input, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + Builder builder = newBuilder(); + try { + builder.mergeFrom(input, extensionRegistry); + } catch (com.google.protobuf.InvalidProtocolBufferException e) { + throw e.setUnfinishedMessage(builder.buildPartial()); + } catch (com.google.protobuf.UninitializedMessageException e) { + throw e.asInvalidProtocolBufferException().setUnfinishedMessage(builder.buildPartial()); + } catch (java.io.IOException e) { + throw new com.google.protobuf.InvalidProtocolBufferException(e) + .setUnfinishedMessage(builder.buildPartial()); + } + return builder.buildPartial(); + } + }; + + public static com.google.protobuf.Parser parser() { + return PARSER; + } + + @java.lang.Override + public com.google.protobuf.Parser getParserForType() { + return PARSER; + } + + @java.lang.Override + public com.openpositioning.PositionMe.Traj.ProximityReading getDefaultInstanceForType() { + return DEFAULT_INSTANCE; + } + + } + + public interface GNSSPositionOrBuilder extends + // @@protoc_insertion_point(interface_extends:GNSSPosition) + com.google.protobuf.MessageOrBuilder { + + /** + * int64 relative_timestamp = 1; + * @return The relativeTimestamp. + */ + long getRelativeTimestamp(); + + /** + *
+     * degrees (minimum 6 significant figures)
+     * latitude between -90 and 90
+     * 
+ * + * double latitude = 2; + * @return The latitude. + */ + double getLatitude(); + + /** + *
+     * longitude between -180 and 180
+     * 
+ * + * double longitude = 3; + * @return The longitude. + */ + double getLongitude(); + + /** + *
+     * metres
+     * 
+ * + * double altitude = 4; + * @return The altitude. + */ + double getAltitude(); + + /** + *
+     * floor name
+     * 
+ * + * optional string floor = 5; + * @return Whether the floor field is set. + */ + boolean hasFloor(); + /** + *
+     * floor name
+     * 
+ * + * optional string floor = 5; + * @return The floor. + */ + java.lang.String getFloor(); + /** + *
+     * floor name
+     * 
+ * + * optional string floor = 5; + * @return The bytes for floor. + */ + com.google.protobuf.ByteString + getFloorBytes(); + } + /** + * Protobuf type {@code GNSSPosition} + */ + public static final class GNSSPosition extends + com.google.protobuf.GeneratedMessage implements + // @@protoc_insertion_point(message_implements:GNSSPosition) + GNSSPositionOrBuilder { + private static final long serialVersionUID = 0L; + static { + com.google.protobuf.RuntimeVersion.validateProtobufGencodeVersion( + com.google.protobuf.RuntimeVersion.RuntimeDomain.PUBLIC, + /* major= */ 4, + /* minor= */ 29, + /* patch= */ 6, + /* suffix= */ "", + GNSSPosition.class.getName()); + } + // Use GNSSPosition.newBuilder() to construct. + private GNSSPosition(com.google.protobuf.GeneratedMessage.Builder builder) { + super(builder); + } + private GNSSPosition() { + floor_ = ""; + } + + public static final com.google.protobuf.Descriptors.Descriptor + getDescriptor() { + return com.openpositioning.PositionMe.Traj.internal_static_GNSSPosition_descriptor; + } + + @java.lang.Override + protected com.google.protobuf.GeneratedMessage.FieldAccessorTable + internalGetFieldAccessorTable() { + return com.openpositioning.PositionMe.Traj.internal_static_GNSSPosition_fieldAccessorTable + .ensureFieldAccessorsInitialized( + com.openpositioning.PositionMe.Traj.GNSSPosition.class, com.openpositioning.PositionMe.Traj.GNSSPosition.Builder.class); + } + + private int bitField0_; + public static final int RELATIVE_TIMESTAMP_FIELD_NUMBER = 1; + private long relativeTimestamp_ = 0L; + /** + * int64 relative_timestamp = 1; + * @return The relativeTimestamp. + */ + @java.lang.Override + public long getRelativeTimestamp() { + return relativeTimestamp_; + } + + public static final int LATITUDE_FIELD_NUMBER = 2; + private double latitude_ = 0D; + /** + *
+     * degrees (minimum 6 significant figures)
+     * latitude between -90 and 90
+     * 
+ * + * double latitude = 2; + * @return The latitude. + */ + @java.lang.Override + public double getLatitude() { + return latitude_; + } + + public static final int LONGITUDE_FIELD_NUMBER = 3; + private double longitude_ = 0D; + /** + *
+     * longitude between -180 and 180
+     * 
+ * + * double longitude = 3; + * @return The longitude. + */ + @java.lang.Override + public double getLongitude() { + return longitude_; + } + + public static final int ALTITUDE_FIELD_NUMBER = 4; + private double altitude_ = 0D; + /** + *
+     * metres
+     * 
+ * + * double altitude = 4; + * @return The altitude. + */ + @java.lang.Override + public double getAltitude() { + return altitude_; + } + + public static final int FLOOR_FIELD_NUMBER = 5; + @SuppressWarnings("serial") + private volatile java.lang.Object floor_ = ""; + /** + *
+     * floor name
+     * 
+ * + * optional string floor = 5; + * @return Whether the floor field is set. + */ + @java.lang.Override + public boolean hasFloor() { + return ((bitField0_ & 0x00000001) != 0); + } + /** + *
+     * floor name
+     * 
+ * + * optional string floor = 5; + * @return The floor. + */ + @java.lang.Override + public java.lang.String getFloor() { + java.lang.Object ref = floor_; + if (ref instanceof java.lang.String) { + return (java.lang.String) ref; + } else { + com.google.protobuf.ByteString bs = + (com.google.protobuf.ByteString) ref; + java.lang.String s = bs.toStringUtf8(); + floor_ = s; + return s; + } + } + /** + *
+     * floor name
+     * 
+ * + * optional string floor = 5; + * @return The bytes for floor. + */ + @java.lang.Override + public com.google.protobuf.ByteString + getFloorBytes() { + java.lang.Object ref = floor_; + if (ref instanceof java.lang.String) { + com.google.protobuf.ByteString b = + com.google.protobuf.ByteString.copyFromUtf8( + (java.lang.String) ref); + floor_ = b; + return b; + } else { + return (com.google.protobuf.ByteString) ref; + } + } + + private byte memoizedIsInitialized = -1; + @java.lang.Override + public final boolean isInitialized() { + byte isInitialized = memoizedIsInitialized; + if (isInitialized == 1) return true; + if (isInitialized == 0) return false; + + memoizedIsInitialized = 1; + return true; + } + + @java.lang.Override + public void writeTo(com.google.protobuf.CodedOutputStream output) + throws java.io.IOException { + if (relativeTimestamp_ != 0L) { + output.writeInt64(1, relativeTimestamp_); + } + if (java.lang.Double.doubleToRawLongBits(latitude_) != 0) { + output.writeDouble(2, latitude_); + } + if (java.lang.Double.doubleToRawLongBits(longitude_) != 0) { + output.writeDouble(3, longitude_); + } + if (java.lang.Double.doubleToRawLongBits(altitude_) != 0) { + output.writeDouble(4, altitude_); + } + if (((bitField0_ & 0x00000001) != 0)) { + com.google.protobuf.GeneratedMessage.writeString(output, 5, floor_); + } + getUnknownFields().writeTo(output); + } + + @java.lang.Override + public int getSerializedSize() { + int size = memoizedSize; + if (size != -1) return size; + + size = 0; + if (relativeTimestamp_ != 0L) { + size += com.google.protobuf.CodedOutputStream + .computeInt64Size(1, relativeTimestamp_); + } + if (java.lang.Double.doubleToRawLongBits(latitude_) != 0) { + size += com.google.protobuf.CodedOutputStream + .computeDoubleSize(2, latitude_); + } + if (java.lang.Double.doubleToRawLongBits(longitude_) != 0) { + size += com.google.protobuf.CodedOutputStream + .computeDoubleSize(3, longitude_); + } + if (java.lang.Double.doubleToRawLongBits(altitude_) != 0) { + size += com.google.protobuf.CodedOutputStream + .computeDoubleSize(4, altitude_); + } + if (((bitField0_ & 0x00000001) != 0)) { + size += com.google.protobuf.GeneratedMessage.computeStringSize(5, floor_); + } + size += getUnknownFields().getSerializedSize(); + memoizedSize = size; + return size; + } + + @java.lang.Override + public boolean equals(final java.lang.Object obj) { + if (obj == this) { + return true; + } + if (!(obj instanceof com.openpositioning.PositionMe.Traj.GNSSPosition)) { + return super.equals(obj); + } + com.openpositioning.PositionMe.Traj.GNSSPosition other = (com.openpositioning.PositionMe.Traj.GNSSPosition) obj; + + if (getRelativeTimestamp() + != other.getRelativeTimestamp()) return false; + if (java.lang.Double.doubleToLongBits(getLatitude()) + != java.lang.Double.doubleToLongBits( + other.getLatitude())) return false; + if (java.lang.Double.doubleToLongBits(getLongitude()) + != java.lang.Double.doubleToLongBits( + other.getLongitude())) return false; + if (java.lang.Double.doubleToLongBits(getAltitude()) + != java.lang.Double.doubleToLongBits( + other.getAltitude())) return false; + if (hasFloor() != other.hasFloor()) return false; + if (hasFloor()) { + if (!getFloor() + .equals(other.getFloor())) return false; + } + if (!getUnknownFields().equals(other.getUnknownFields())) return false; + return true; + } + + @java.lang.Override + public int hashCode() { + if (memoizedHashCode != 0) { + return memoizedHashCode; + } + int hash = 41; + hash = (19 * hash) + getDescriptor().hashCode(); + hash = (37 * hash) + RELATIVE_TIMESTAMP_FIELD_NUMBER; + hash = (53 * hash) + com.google.protobuf.Internal.hashLong( + getRelativeTimestamp()); + hash = (37 * hash) + LATITUDE_FIELD_NUMBER; + hash = (53 * hash) + com.google.protobuf.Internal.hashLong( + java.lang.Double.doubleToLongBits(getLatitude())); + hash = (37 * hash) + LONGITUDE_FIELD_NUMBER; + hash = (53 * hash) + com.google.protobuf.Internal.hashLong( + java.lang.Double.doubleToLongBits(getLongitude())); + hash = (37 * hash) + ALTITUDE_FIELD_NUMBER; + hash = (53 * hash) + com.google.protobuf.Internal.hashLong( + java.lang.Double.doubleToLongBits(getAltitude())); + if (hasFloor()) { + hash = (37 * hash) + FLOOR_FIELD_NUMBER; + hash = (53 * hash) + getFloor().hashCode(); + } + hash = (29 * hash) + getUnknownFields().hashCode(); + memoizedHashCode = hash; + return hash; + } + + public static com.openpositioning.PositionMe.Traj.GNSSPosition parseFrom( + java.nio.ByteBuffer data) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + public static com.openpositioning.PositionMe.Traj.GNSSPosition parseFrom( + java.nio.ByteBuffer data, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data, extensionRegistry); + } + public static com.openpositioning.PositionMe.Traj.GNSSPosition parseFrom( + com.google.protobuf.ByteString data) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + public static com.openpositioning.PositionMe.Traj.GNSSPosition parseFrom( + com.google.protobuf.ByteString data, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data, extensionRegistry); + } + public static com.openpositioning.PositionMe.Traj.GNSSPosition parseFrom(byte[] data) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + public static com.openpositioning.PositionMe.Traj.GNSSPosition parseFrom( + byte[] data, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data, extensionRegistry); + } + public static com.openpositioning.PositionMe.Traj.GNSSPosition parseFrom(java.io.InputStream input) + throws java.io.IOException { + return com.google.protobuf.GeneratedMessage + .parseWithIOException(PARSER, input); + } + public static com.openpositioning.PositionMe.Traj.GNSSPosition parseFrom( + java.io.InputStream input, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws java.io.IOException { + return com.google.protobuf.GeneratedMessage + .parseWithIOException(PARSER, input, extensionRegistry); + } + + public static com.openpositioning.PositionMe.Traj.GNSSPosition parseDelimitedFrom(java.io.InputStream input) + throws java.io.IOException { + return com.google.protobuf.GeneratedMessage + .parseDelimitedWithIOException(PARSER, input); + } + + public static com.openpositioning.PositionMe.Traj.GNSSPosition parseDelimitedFrom( + java.io.InputStream input, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws java.io.IOException { + return com.google.protobuf.GeneratedMessage + .parseDelimitedWithIOException(PARSER, input, extensionRegistry); + } + public static com.openpositioning.PositionMe.Traj.GNSSPosition parseFrom( + com.google.protobuf.CodedInputStream input) + throws java.io.IOException { + return com.google.protobuf.GeneratedMessage + .parseWithIOException(PARSER, input); + } + public static com.openpositioning.PositionMe.Traj.GNSSPosition parseFrom( + com.google.protobuf.CodedInputStream input, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws java.io.IOException { + return com.google.protobuf.GeneratedMessage + .parseWithIOException(PARSER, input, extensionRegistry); + } + + @java.lang.Override + public Builder newBuilderForType() { return newBuilder(); } + public static Builder newBuilder() { + return DEFAULT_INSTANCE.toBuilder(); + } + public static Builder newBuilder(com.openpositioning.PositionMe.Traj.GNSSPosition prototype) { + return DEFAULT_INSTANCE.toBuilder().mergeFrom(prototype); + } + @java.lang.Override + public Builder toBuilder() { + return this == DEFAULT_INSTANCE + ? new Builder() : new Builder().mergeFrom(this); + } + + @java.lang.Override + protected Builder newBuilderForType( + com.google.protobuf.GeneratedMessage.BuilderParent parent) { + Builder builder = new Builder(parent); + return builder; + } + /** + * Protobuf type {@code GNSSPosition} + */ + public static final class Builder extends + com.google.protobuf.GeneratedMessage.Builder implements + // @@protoc_insertion_point(builder_implements:GNSSPosition) + com.openpositioning.PositionMe.Traj.GNSSPositionOrBuilder { + public static final com.google.protobuf.Descriptors.Descriptor + getDescriptor() { + return com.openpositioning.PositionMe.Traj.internal_static_GNSSPosition_descriptor; + } + + @java.lang.Override + protected com.google.protobuf.GeneratedMessage.FieldAccessorTable + internalGetFieldAccessorTable() { + return com.openpositioning.PositionMe.Traj.internal_static_GNSSPosition_fieldAccessorTable + .ensureFieldAccessorsInitialized( + com.openpositioning.PositionMe.Traj.GNSSPosition.class, com.openpositioning.PositionMe.Traj.GNSSPosition.Builder.class); + } + + // Construct using com.openpositioning.PositionMe.Traj.GNSSPosition.newBuilder() + private Builder() { + + } + + private Builder( + com.google.protobuf.GeneratedMessage.BuilderParent parent) { + super(parent); + + } + @java.lang.Override + public Builder clear() { + super.clear(); + bitField0_ = 0; + relativeTimestamp_ = 0L; + latitude_ = 0D; + longitude_ = 0D; + altitude_ = 0D; + floor_ = ""; + return this; + } + + @java.lang.Override + public com.google.protobuf.Descriptors.Descriptor + getDescriptorForType() { + return com.openpositioning.PositionMe.Traj.internal_static_GNSSPosition_descriptor; + } + + @java.lang.Override + public com.openpositioning.PositionMe.Traj.GNSSPosition getDefaultInstanceForType() { + return com.openpositioning.PositionMe.Traj.GNSSPosition.getDefaultInstance(); + } + + @java.lang.Override + public com.openpositioning.PositionMe.Traj.GNSSPosition build() { + com.openpositioning.PositionMe.Traj.GNSSPosition result = buildPartial(); + if (!result.isInitialized()) { + throw newUninitializedMessageException(result); + } + return result; + } + + @java.lang.Override + public com.openpositioning.PositionMe.Traj.GNSSPosition buildPartial() { + com.openpositioning.PositionMe.Traj.GNSSPosition result = new com.openpositioning.PositionMe.Traj.GNSSPosition(this); + if (bitField0_ != 0) { buildPartial0(result); } + onBuilt(); + return result; + } + + private void buildPartial0(com.openpositioning.PositionMe.Traj.GNSSPosition result) { + int from_bitField0_ = bitField0_; + if (((from_bitField0_ & 0x00000001) != 0)) { + result.relativeTimestamp_ = relativeTimestamp_; + } + if (((from_bitField0_ & 0x00000002) != 0)) { + result.latitude_ = latitude_; + } + if (((from_bitField0_ & 0x00000004) != 0)) { + result.longitude_ = longitude_; + } + if (((from_bitField0_ & 0x00000008) != 0)) { + result.altitude_ = altitude_; + } + int to_bitField0_ = 0; + if (((from_bitField0_ & 0x00000010) != 0)) { + result.floor_ = floor_; + to_bitField0_ |= 0x00000001; + } + result.bitField0_ |= to_bitField0_; + } + + @java.lang.Override + public Builder mergeFrom(com.google.protobuf.Message other) { + if (other instanceof com.openpositioning.PositionMe.Traj.GNSSPosition) { + return mergeFrom((com.openpositioning.PositionMe.Traj.GNSSPosition)other); + } else { + super.mergeFrom(other); + return this; + } + } + + public Builder mergeFrom(com.openpositioning.PositionMe.Traj.GNSSPosition other) { + if (other == com.openpositioning.PositionMe.Traj.GNSSPosition.getDefaultInstance()) return this; + if (other.getRelativeTimestamp() != 0L) { + setRelativeTimestamp(other.getRelativeTimestamp()); + } + if (other.getLatitude() != 0D) { + setLatitude(other.getLatitude()); + } + if (other.getLongitude() != 0D) { + setLongitude(other.getLongitude()); + } + if (other.getAltitude() != 0D) { + setAltitude(other.getAltitude()); + } + if (other.hasFloor()) { + floor_ = other.floor_; + bitField0_ |= 0x00000010; + onChanged(); + } + this.mergeUnknownFields(other.getUnknownFields()); + onChanged(); + return this; + } + + @java.lang.Override + public final boolean isInitialized() { + return true; + } + + @java.lang.Override + public Builder mergeFrom( + com.google.protobuf.CodedInputStream input, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws java.io.IOException { + if (extensionRegistry == null) { + throw new java.lang.NullPointerException(); + } + try { + boolean done = false; + while (!done) { + int tag = input.readTag(); + switch (tag) { + case 0: + done = true; + break; + case 8: { + relativeTimestamp_ = input.readInt64(); + bitField0_ |= 0x00000001; + break; + } // case 8 + case 17: { + latitude_ = input.readDouble(); + bitField0_ |= 0x00000002; + break; + } // case 17 + case 25: { + longitude_ = input.readDouble(); + bitField0_ |= 0x00000004; + break; + } // case 25 + case 33: { + altitude_ = input.readDouble(); + bitField0_ |= 0x00000008; + break; + } // case 33 + case 42: { + floor_ = input.readStringRequireUtf8(); + bitField0_ |= 0x00000010; + break; + } // case 42 + default: { + if (!super.parseUnknownField(input, extensionRegistry, tag)) { + done = true; // was an endgroup tag + } + break; + } // default: + } // switch (tag) + } // while (!done) + } catch (com.google.protobuf.InvalidProtocolBufferException e) { + throw e.unwrapIOException(); + } finally { + onChanged(); + } // finally + return this; + } + private int bitField0_; + + private long relativeTimestamp_ ; + /** + * int64 relative_timestamp = 1; + * @return The relativeTimestamp. + */ + @java.lang.Override + public long getRelativeTimestamp() { + return relativeTimestamp_; + } + /** + * int64 relative_timestamp = 1; + * @param value The relativeTimestamp to set. + * @return This builder for chaining. + */ + public Builder setRelativeTimestamp(long value) { + + relativeTimestamp_ = value; + bitField0_ |= 0x00000001; + onChanged(); + return this; + } + /** + * int64 relative_timestamp = 1; + * @return This builder for chaining. + */ + public Builder clearRelativeTimestamp() { + bitField0_ = (bitField0_ & ~0x00000001); + relativeTimestamp_ = 0L; + onChanged(); + return this; + } + + private double latitude_ ; + /** + *
+       * degrees (minimum 6 significant figures)
+       * latitude between -90 and 90
+       * 
+ * + * double latitude = 2; + * @return The latitude. + */ + @java.lang.Override + public double getLatitude() { + return latitude_; + } + /** + *
+       * degrees (minimum 6 significant figures)
+       * latitude between -90 and 90
+       * 
+ * + * double latitude = 2; + * @param value The latitude to set. + * @return This builder for chaining. + */ + public Builder setLatitude(double value) { + + latitude_ = value; + bitField0_ |= 0x00000002; + onChanged(); + return this; + } + /** + *
+       * degrees (minimum 6 significant figures)
+       * latitude between -90 and 90
+       * 
+ * + * double latitude = 2; + * @return This builder for chaining. + */ + public Builder clearLatitude() { + bitField0_ = (bitField0_ & ~0x00000002); + latitude_ = 0D; + onChanged(); + return this; + } + + private double longitude_ ; + /** + *
+       * longitude between -180 and 180
+       * 
+ * + * double longitude = 3; + * @return The longitude. + */ + @java.lang.Override + public double getLongitude() { + return longitude_; + } + /** + *
+       * longitude between -180 and 180
+       * 
+ * + * double longitude = 3; + * @param value The longitude to set. + * @return This builder for chaining. + */ + public Builder setLongitude(double value) { + + longitude_ = value; + bitField0_ |= 0x00000004; + onChanged(); + return this; + } + /** + *
+       * longitude between -180 and 180
+       * 
+ * + * double longitude = 3; + * @return This builder for chaining. + */ + public Builder clearLongitude() { + bitField0_ = (bitField0_ & ~0x00000004); + longitude_ = 0D; + onChanged(); + return this; + } + + private double altitude_ ; + /** + *
+       * metres
+       * 
+ * + * double altitude = 4; + * @return The altitude. + */ + @java.lang.Override + public double getAltitude() { + return altitude_; + } + /** + *
+       * metres
+       * 
+ * + * double altitude = 4; + * @param value The altitude to set. + * @return This builder for chaining. + */ + public Builder setAltitude(double value) { + + altitude_ = value; + bitField0_ |= 0x00000008; + onChanged(); + return this; + } + /** + *
+       * metres
+       * 
+ * + * double altitude = 4; + * @return This builder for chaining. + */ + public Builder clearAltitude() { + bitField0_ = (bitField0_ & ~0x00000008); + altitude_ = 0D; + onChanged(); + return this; + } + + private java.lang.Object floor_ = ""; + /** + *
+       * floor name
+       * 
+ * + * optional string floor = 5; + * @return Whether the floor field is set. + */ + public boolean hasFloor() { + return ((bitField0_ & 0x00000010) != 0); + } + /** + *
+       * floor name
+       * 
+ * + * optional string floor = 5; + * @return The floor. + */ + public java.lang.String getFloor() { + java.lang.Object ref = floor_; + if (!(ref instanceof java.lang.String)) { + com.google.protobuf.ByteString bs = + (com.google.protobuf.ByteString) ref; + java.lang.String s = bs.toStringUtf8(); + floor_ = s; + return s; + } else { + return (java.lang.String) ref; + } + } + /** + *
+       * floor name
+       * 
+ * + * optional string floor = 5; + * @return The bytes for floor. + */ + public com.google.protobuf.ByteString + getFloorBytes() { + java.lang.Object ref = floor_; + if (ref instanceof String) { + com.google.protobuf.ByteString b = + com.google.protobuf.ByteString.copyFromUtf8( + (java.lang.String) ref); + floor_ = b; + return b; + } else { + return (com.google.protobuf.ByteString) ref; + } + } + /** + *
+       * floor name
+       * 
+ * + * optional string floor = 5; + * @param value The floor to set. + * @return This builder for chaining. + */ + public Builder setFloor( + java.lang.String value) { + if (value == null) { throw new NullPointerException(); } + floor_ = value; + bitField0_ |= 0x00000010; + onChanged(); + return this; + } + /** + *
+       * floor name
+       * 
+ * + * optional string floor = 5; + * @return This builder for chaining. + */ + public Builder clearFloor() { + floor_ = getDefaultInstance().getFloor(); + bitField0_ = (bitField0_ & ~0x00000010); + onChanged(); + return this; + } + /** + *
+       * floor name
+       * 
+ * + * optional string floor = 5; + * @param value The bytes for floor to set. + * @return This builder for chaining. + */ + public Builder setFloorBytes( + com.google.protobuf.ByteString value) { + if (value == null) { throw new NullPointerException(); } + checkByteStringIsUtf8(value); + floor_ = value; + bitField0_ |= 0x00000010; + onChanged(); + return this; + } + + // @@protoc_insertion_point(builder_scope:GNSSPosition) + } + + // @@protoc_insertion_point(class_scope:GNSSPosition) + private static final com.openpositioning.PositionMe.Traj.GNSSPosition DEFAULT_INSTANCE; + static { + DEFAULT_INSTANCE = new com.openpositioning.PositionMe.Traj.GNSSPosition(); + } + + public static com.openpositioning.PositionMe.Traj.GNSSPosition getDefaultInstance() { + return DEFAULT_INSTANCE; + } + + private static final com.google.protobuf.Parser + PARSER = new com.google.protobuf.AbstractParser() { + @java.lang.Override + public GNSSPosition parsePartialFrom( + com.google.protobuf.CodedInputStream input, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + Builder builder = newBuilder(); + try { + builder.mergeFrom(input, extensionRegistry); + } catch (com.google.protobuf.InvalidProtocolBufferException e) { + throw e.setUnfinishedMessage(builder.buildPartial()); + } catch (com.google.protobuf.UninitializedMessageException e) { + throw e.asInvalidProtocolBufferException().setUnfinishedMessage(builder.buildPartial()); + } catch (java.io.IOException e) { + throw new com.google.protobuf.InvalidProtocolBufferException(e) + .setUnfinishedMessage(builder.buildPartial()); + } + return builder.buildPartial(); + } + }; + + public static com.google.protobuf.Parser parser() { + return PARSER; + } + + @java.lang.Override + public com.google.protobuf.Parser getParserForType() { + return PARSER; + } + + @java.lang.Override + public com.openpositioning.PositionMe.Traj.GNSSPosition getDefaultInstanceForType() { + return DEFAULT_INSTANCE; + } + + } + + public interface GNSSReadingOrBuilder extends + // @@protoc_insertion_point(interface_extends:GNSSReading) + com.google.protobuf.MessageOrBuilder { + + /** + * .GNSSPosition position = 1; + * @return Whether the position field is set. + */ + boolean hasPosition(); + /** + * .GNSSPosition position = 1; + * @return The position. + */ + com.openpositioning.PositionMe.Traj.GNSSPosition getPosition(); + /** + * .GNSSPosition position = 1; + */ + com.openpositioning.PositionMe.Traj.GNSSPositionOrBuilder getPositionOrBuilder(); + + /** + *
+     * metres
+     * 
+ * + * float accuracy = 2; + * @return The accuracy. + */ + float getAccuracy(); + + /** + *
+     * m/s
+     * 
+ * + * float speed = 3; + * @return The speed. + */ + float getSpeed(); + + /** + *
+     * degrees
+     * 
+ * + * float bearing = 4; + * @return The bearing. + */ + float getBearing(); + + /** + *
+     * e.g 'gps' or 'network'
+     * 
+ * + * string provider = 5; + * @return The provider. + */ + java.lang.String getProvider(); + /** + *
+     * e.g 'gps' or 'network'
+     * 
+ * + * string provider = 5; + * @return The bytes for provider. + */ + com.google.protobuf.ByteString + getProviderBytes(); + } + /** + * Protobuf type {@code GNSSReading} + */ + public static final class GNSSReading extends + com.google.protobuf.GeneratedMessage implements + // @@protoc_insertion_point(message_implements:GNSSReading) + GNSSReadingOrBuilder { + private static final long serialVersionUID = 0L; + static { + com.google.protobuf.RuntimeVersion.validateProtobufGencodeVersion( + com.google.protobuf.RuntimeVersion.RuntimeDomain.PUBLIC, + /* major= */ 4, + /* minor= */ 29, + /* patch= */ 6, + /* suffix= */ "", + GNSSReading.class.getName()); + } + // Use GNSSReading.newBuilder() to construct. + private GNSSReading(com.google.protobuf.GeneratedMessage.Builder builder) { + super(builder); + } + private GNSSReading() { + provider_ = ""; + } + + public static final com.google.protobuf.Descriptors.Descriptor + getDescriptor() { + return com.openpositioning.PositionMe.Traj.internal_static_GNSSReading_descriptor; + } + + @java.lang.Override + protected com.google.protobuf.GeneratedMessage.FieldAccessorTable + internalGetFieldAccessorTable() { + return com.openpositioning.PositionMe.Traj.internal_static_GNSSReading_fieldAccessorTable + .ensureFieldAccessorsInitialized( + com.openpositioning.PositionMe.Traj.GNSSReading.class, com.openpositioning.PositionMe.Traj.GNSSReading.Builder.class); + } + + private int bitField0_; + public static final int POSITION_FIELD_NUMBER = 1; + private com.openpositioning.PositionMe.Traj.GNSSPosition position_; + /** + * .GNSSPosition position = 1; + * @return Whether the position field is set. + */ + @java.lang.Override + public boolean hasPosition() { + return ((bitField0_ & 0x00000001) != 0); + } + /** + * .GNSSPosition position = 1; + * @return The position. + */ + @java.lang.Override + public com.openpositioning.PositionMe.Traj.GNSSPosition getPosition() { + return position_ == null ? com.openpositioning.PositionMe.Traj.GNSSPosition.getDefaultInstance() : position_; + } + /** + * .GNSSPosition position = 1; + */ + @java.lang.Override + public com.openpositioning.PositionMe.Traj.GNSSPositionOrBuilder getPositionOrBuilder() { + return position_ == null ? com.openpositioning.PositionMe.Traj.GNSSPosition.getDefaultInstance() : position_; + } + + public static final int ACCURACY_FIELD_NUMBER = 2; + private float accuracy_ = 0F; + /** + *
+     * metres
+     * 
+ * + * float accuracy = 2; + * @return The accuracy. + */ + @java.lang.Override + public float getAccuracy() { + return accuracy_; + } + + public static final int SPEED_FIELD_NUMBER = 3; + private float speed_ = 0F; + /** + *
+     * m/s
+     * 
+ * + * float speed = 3; + * @return The speed. + */ + @java.lang.Override + public float getSpeed() { + return speed_; + } + + public static final int BEARING_FIELD_NUMBER = 4; + private float bearing_ = 0F; + /** + *
+     * degrees
+     * 
+ * + * float bearing = 4; + * @return The bearing. + */ + @java.lang.Override + public float getBearing() { + return bearing_; + } + + public static final int PROVIDER_FIELD_NUMBER = 5; + @SuppressWarnings("serial") + private volatile java.lang.Object provider_ = ""; + /** + *
+     * e.g 'gps' or 'network'
+     * 
+ * + * string provider = 5; + * @return The provider. + */ + @java.lang.Override + public java.lang.String getProvider() { + java.lang.Object ref = provider_; + if (ref instanceof java.lang.String) { + return (java.lang.String) ref; + } else { + com.google.protobuf.ByteString bs = + (com.google.protobuf.ByteString) ref; + java.lang.String s = bs.toStringUtf8(); + provider_ = s; + return s; + } + } + /** + *
+     * e.g 'gps' or 'network'
+     * 
+ * + * string provider = 5; + * @return The bytes for provider. + */ + @java.lang.Override + public com.google.protobuf.ByteString + getProviderBytes() { + java.lang.Object ref = provider_; + if (ref instanceof java.lang.String) { + com.google.protobuf.ByteString b = + com.google.protobuf.ByteString.copyFromUtf8( + (java.lang.String) ref); + provider_ = b; + return b; + } else { + return (com.google.protobuf.ByteString) ref; + } + } + + private byte memoizedIsInitialized = -1; + @java.lang.Override + public final boolean isInitialized() { + byte isInitialized = memoizedIsInitialized; + if (isInitialized == 1) return true; + if (isInitialized == 0) return false; + + memoizedIsInitialized = 1; + return true; + } + + @java.lang.Override + public void writeTo(com.google.protobuf.CodedOutputStream output) + throws java.io.IOException { + if (((bitField0_ & 0x00000001) != 0)) { + output.writeMessage(1, getPosition()); + } + if (java.lang.Float.floatToRawIntBits(accuracy_) != 0) { + output.writeFloat(2, accuracy_); + } + if (java.lang.Float.floatToRawIntBits(speed_) != 0) { + output.writeFloat(3, speed_); + } + if (java.lang.Float.floatToRawIntBits(bearing_) != 0) { + output.writeFloat(4, bearing_); + } + if (!com.google.protobuf.GeneratedMessage.isStringEmpty(provider_)) { + com.google.protobuf.GeneratedMessage.writeString(output, 5, provider_); + } + getUnknownFields().writeTo(output); + } + + @java.lang.Override + public int getSerializedSize() { + int size = memoizedSize; + if (size != -1) return size; + + size = 0; + if (((bitField0_ & 0x00000001) != 0)) { + size += com.google.protobuf.CodedOutputStream + .computeMessageSize(1, getPosition()); + } + if (java.lang.Float.floatToRawIntBits(accuracy_) != 0) { + size += com.google.protobuf.CodedOutputStream + .computeFloatSize(2, accuracy_); + } + if (java.lang.Float.floatToRawIntBits(speed_) != 0) { + size += com.google.protobuf.CodedOutputStream + .computeFloatSize(3, speed_); + } + if (java.lang.Float.floatToRawIntBits(bearing_) != 0) { + size += com.google.protobuf.CodedOutputStream + .computeFloatSize(4, bearing_); + } + if (!com.google.protobuf.GeneratedMessage.isStringEmpty(provider_)) { + size += com.google.protobuf.GeneratedMessage.computeStringSize(5, provider_); + } + size += getUnknownFields().getSerializedSize(); + memoizedSize = size; + return size; + } + + @java.lang.Override + public boolean equals(final java.lang.Object obj) { + if (obj == this) { + return true; + } + if (!(obj instanceof com.openpositioning.PositionMe.Traj.GNSSReading)) { + return super.equals(obj); + } + com.openpositioning.PositionMe.Traj.GNSSReading other = (com.openpositioning.PositionMe.Traj.GNSSReading) obj; + + if (hasPosition() != other.hasPosition()) return false; + if (hasPosition()) { + if (!getPosition() + .equals(other.getPosition())) return false; + } + if (java.lang.Float.floatToIntBits(getAccuracy()) + != java.lang.Float.floatToIntBits( + other.getAccuracy())) return false; + if (java.lang.Float.floatToIntBits(getSpeed()) + != java.lang.Float.floatToIntBits( + other.getSpeed())) return false; + if (java.lang.Float.floatToIntBits(getBearing()) + != java.lang.Float.floatToIntBits( + other.getBearing())) return false; + if (!getProvider() + .equals(other.getProvider())) return false; + if (!getUnknownFields().equals(other.getUnknownFields())) return false; + return true; + } + + @java.lang.Override + public int hashCode() { + if (memoizedHashCode != 0) { + return memoizedHashCode; + } + int hash = 41; + hash = (19 * hash) + getDescriptor().hashCode(); + if (hasPosition()) { + hash = (37 * hash) + POSITION_FIELD_NUMBER; + hash = (53 * hash) + getPosition().hashCode(); + } + hash = (37 * hash) + ACCURACY_FIELD_NUMBER; + hash = (53 * hash) + java.lang.Float.floatToIntBits( + getAccuracy()); + hash = (37 * hash) + SPEED_FIELD_NUMBER; + hash = (53 * hash) + java.lang.Float.floatToIntBits( + getSpeed()); + hash = (37 * hash) + BEARING_FIELD_NUMBER; + hash = (53 * hash) + java.lang.Float.floatToIntBits( + getBearing()); + hash = (37 * hash) + PROVIDER_FIELD_NUMBER; + hash = (53 * hash) + getProvider().hashCode(); + hash = (29 * hash) + getUnknownFields().hashCode(); + memoizedHashCode = hash; + return hash; + } + + public static com.openpositioning.PositionMe.Traj.GNSSReading parseFrom( + java.nio.ByteBuffer data) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + public static com.openpositioning.PositionMe.Traj.GNSSReading parseFrom( + java.nio.ByteBuffer data, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data, extensionRegistry); + } + public static com.openpositioning.PositionMe.Traj.GNSSReading parseFrom( + com.google.protobuf.ByteString data) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + public static com.openpositioning.PositionMe.Traj.GNSSReading parseFrom( + com.google.protobuf.ByteString data, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data, extensionRegistry); + } + public static com.openpositioning.PositionMe.Traj.GNSSReading parseFrom(byte[] data) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + public static com.openpositioning.PositionMe.Traj.GNSSReading parseFrom( + byte[] data, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data, extensionRegistry); + } + public static com.openpositioning.PositionMe.Traj.GNSSReading parseFrom(java.io.InputStream input) + throws java.io.IOException { + return com.google.protobuf.GeneratedMessage + .parseWithIOException(PARSER, input); + } + public static com.openpositioning.PositionMe.Traj.GNSSReading parseFrom( + java.io.InputStream input, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws java.io.IOException { + return com.google.protobuf.GeneratedMessage + .parseWithIOException(PARSER, input, extensionRegistry); + } + + public static com.openpositioning.PositionMe.Traj.GNSSReading parseDelimitedFrom(java.io.InputStream input) + throws java.io.IOException { + return com.google.protobuf.GeneratedMessage + .parseDelimitedWithIOException(PARSER, input); + } + + public static com.openpositioning.PositionMe.Traj.GNSSReading parseDelimitedFrom( + java.io.InputStream input, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws java.io.IOException { + return com.google.protobuf.GeneratedMessage + .parseDelimitedWithIOException(PARSER, input, extensionRegistry); + } + public static com.openpositioning.PositionMe.Traj.GNSSReading parseFrom( + com.google.protobuf.CodedInputStream input) + throws java.io.IOException { + return com.google.protobuf.GeneratedMessage + .parseWithIOException(PARSER, input); + } + public static com.openpositioning.PositionMe.Traj.GNSSReading parseFrom( + com.google.protobuf.CodedInputStream input, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws java.io.IOException { + return com.google.protobuf.GeneratedMessage + .parseWithIOException(PARSER, input, extensionRegistry); + } + + @java.lang.Override + public Builder newBuilderForType() { return newBuilder(); } + public static Builder newBuilder() { + return DEFAULT_INSTANCE.toBuilder(); + } + public static Builder newBuilder(com.openpositioning.PositionMe.Traj.GNSSReading prototype) { + return DEFAULT_INSTANCE.toBuilder().mergeFrom(prototype); + } + @java.lang.Override + public Builder toBuilder() { + return this == DEFAULT_INSTANCE + ? new Builder() : new Builder().mergeFrom(this); + } + + @java.lang.Override + protected Builder newBuilderForType( + com.google.protobuf.GeneratedMessage.BuilderParent parent) { + Builder builder = new Builder(parent); + return builder; + } + /** + * Protobuf type {@code GNSSReading} + */ + public static final class Builder extends + com.google.protobuf.GeneratedMessage.Builder implements + // @@protoc_insertion_point(builder_implements:GNSSReading) + com.openpositioning.PositionMe.Traj.GNSSReadingOrBuilder { + public static final com.google.protobuf.Descriptors.Descriptor + getDescriptor() { + return com.openpositioning.PositionMe.Traj.internal_static_GNSSReading_descriptor; + } + + @java.lang.Override + protected com.google.protobuf.GeneratedMessage.FieldAccessorTable + internalGetFieldAccessorTable() { + return com.openpositioning.PositionMe.Traj.internal_static_GNSSReading_fieldAccessorTable + .ensureFieldAccessorsInitialized( + com.openpositioning.PositionMe.Traj.GNSSReading.class, com.openpositioning.PositionMe.Traj.GNSSReading.Builder.class); + } + + // Construct using com.openpositioning.PositionMe.Traj.GNSSReading.newBuilder() + private Builder() { + maybeForceBuilderInitialization(); + } + + private Builder( + com.google.protobuf.GeneratedMessage.BuilderParent parent) { + super(parent); + maybeForceBuilderInitialization(); + } + private void maybeForceBuilderInitialization() { + if (com.google.protobuf.GeneratedMessage + .alwaysUseFieldBuilders) { + getPositionFieldBuilder(); + } + } + @java.lang.Override + public Builder clear() { + super.clear(); + bitField0_ = 0; + position_ = null; + if (positionBuilder_ != null) { + positionBuilder_.dispose(); + positionBuilder_ = null; + } + accuracy_ = 0F; + speed_ = 0F; + bearing_ = 0F; + provider_ = ""; + return this; + } + + @java.lang.Override + public com.google.protobuf.Descriptors.Descriptor + getDescriptorForType() { + return com.openpositioning.PositionMe.Traj.internal_static_GNSSReading_descriptor; + } + + @java.lang.Override + public com.openpositioning.PositionMe.Traj.GNSSReading getDefaultInstanceForType() { + return com.openpositioning.PositionMe.Traj.GNSSReading.getDefaultInstance(); + } + + @java.lang.Override + public com.openpositioning.PositionMe.Traj.GNSSReading build() { + com.openpositioning.PositionMe.Traj.GNSSReading result = buildPartial(); + if (!result.isInitialized()) { + throw newUninitializedMessageException(result); + } + return result; + } + + @java.lang.Override + public com.openpositioning.PositionMe.Traj.GNSSReading buildPartial() { + com.openpositioning.PositionMe.Traj.GNSSReading result = new com.openpositioning.PositionMe.Traj.GNSSReading(this); + if (bitField0_ != 0) { buildPartial0(result); } + onBuilt(); + return result; + } + + private void buildPartial0(com.openpositioning.PositionMe.Traj.GNSSReading result) { + int from_bitField0_ = bitField0_; + int to_bitField0_ = 0; + if (((from_bitField0_ & 0x00000001) != 0)) { + result.position_ = positionBuilder_ == null + ? position_ + : positionBuilder_.build(); + to_bitField0_ |= 0x00000001; + } + if (((from_bitField0_ & 0x00000002) != 0)) { + result.accuracy_ = accuracy_; + } + if (((from_bitField0_ & 0x00000004) != 0)) { + result.speed_ = speed_; + } + if (((from_bitField0_ & 0x00000008) != 0)) { + result.bearing_ = bearing_; + } + if (((from_bitField0_ & 0x00000010) != 0)) { + result.provider_ = provider_; + } + result.bitField0_ |= to_bitField0_; + } + + @java.lang.Override + public Builder mergeFrom(com.google.protobuf.Message other) { + if (other instanceof com.openpositioning.PositionMe.Traj.GNSSReading) { + return mergeFrom((com.openpositioning.PositionMe.Traj.GNSSReading)other); + } else { + super.mergeFrom(other); + return this; + } + } + + public Builder mergeFrom(com.openpositioning.PositionMe.Traj.GNSSReading other) { + if (other == com.openpositioning.PositionMe.Traj.GNSSReading.getDefaultInstance()) return this; + if (other.hasPosition()) { + mergePosition(other.getPosition()); + } + if (other.getAccuracy() != 0F) { + setAccuracy(other.getAccuracy()); + } + if (other.getSpeed() != 0F) { + setSpeed(other.getSpeed()); + } + if (other.getBearing() != 0F) { + setBearing(other.getBearing()); + } + if (!other.getProvider().isEmpty()) { + provider_ = other.provider_; + bitField0_ |= 0x00000010; + onChanged(); + } + this.mergeUnknownFields(other.getUnknownFields()); + onChanged(); + return this; + } + + @java.lang.Override + public final boolean isInitialized() { + return true; + } + + @java.lang.Override + public Builder mergeFrom( + com.google.protobuf.CodedInputStream input, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws java.io.IOException { + if (extensionRegistry == null) { + throw new java.lang.NullPointerException(); + } + try { + boolean done = false; + while (!done) { + int tag = input.readTag(); + switch (tag) { + case 0: + done = true; + break; + case 10: { + input.readMessage( + getPositionFieldBuilder().getBuilder(), + extensionRegistry); + bitField0_ |= 0x00000001; + break; + } // case 10 + case 21: { + accuracy_ = input.readFloat(); + bitField0_ |= 0x00000002; + break; + } // case 21 + case 29: { + speed_ = input.readFloat(); + bitField0_ |= 0x00000004; + break; + } // case 29 + case 37: { + bearing_ = input.readFloat(); + bitField0_ |= 0x00000008; + break; + } // case 37 + case 42: { + provider_ = input.readStringRequireUtf8(); + bitField0_ |= 0x00000010; + break; + } // case 42 + default: { + if (!super.parseUnknownField(input, extensionRegistry, tag)) { + done = true; // was an endgroup tag + } + break; + } // default: + } // switch (tag) + } // while (!done) + } catch (com.google.protobuf.InvalidProtocolBufferException e) { + throw e.unwrapIOException(); + } finally { + onChanged(); + } // finally + return this; + } + private int bitField0_; + + private com.openpositioning.PositionMe.Traj.GNSSPosition position_; + private com.google.protobuf.SingleFieldBuilder< + com.openpositioning.PositionMe.Traj.GNSSPosition, com.openpositioning.PositionMe.Traj.GNSSPosition.Builder, com.openpositioning.PositionMe.Traj.GNSSPositionOrBuilder> positionBuilder_; + /** + * .GNSSPosition position = 1; + * @return Whether the position field is set. + */ + public boolean hasPosition() { + return ((bitField0_ & 0x00000001) != 0); + } + /** + * .GNSSPosition position = 1; + * @return The position. + */ + public com.openpositioning.PositionMe.Traj.GNSSPosition getPosition() { + if (positionBuilder_ == null) { + return position_ == null ? com.openpositioning.PositionMe.Traj.GNSSPosition.getDefaultInstance() : position_; + } else { + return positionBuilder_.getMessage(); + } + } + /** + * .GNSSPosition position = 1; + */ + public Builder setPosition(com.openpositioning.PositionMe.Traj.GNSSPosition value) { + if (positionBuilder_ == null) { + if (value == null) { + throw new NullPointerException(); + } + position_ = value; + } else { + positionBuilder_.setMessage(value); + } + bitField0_ |= 0x00000001; + onChanged(); + return this; + } + /** + * .GNSSPosition position = 1; + */ + public Builder setPosition( + com.openpositioning.PositionMe.Traj.GNSSPosition.Builder builderForValue) { + if (positionBuilder_ == null) { + position_ = builderForValue.build(); + } else { + positionBuilder_.setMessage(builderForValue.build()); + } + bitField0_ |= 0x00000001; + onChanged(); + return this; + } + /** + * .GNSSPosition position = 1; + */ + public Builder mergePosition(com.openpositioning.PositionMe.Traj.GNSSPosition value) { + if (positionBuilder_ == null) { + if (((bitField0_ & 0x00000001) != 0) && + position_ != null && + position_ != com.openpositioning.PositionMe.Traj.GNSSPosition.getDefaultInstance()) { + getPositionBuilder().mergeFrom(value); + } else { + position_ = value; + } + } else { + positionBuilder_.mergeFrom(value); + } + if (position_ != null) { + bitField0_ |= 0x00000001; + onChanged(); + } + return this; + } + /** + * .GNSSPosition position = 1; + */ + public Builder clearPosition() { + bitField0_ = (bitField0_ & ~0x00000001); + position_ = null; + if (positionBuilder_ != null) { + positionBuilder_.dispose(); + positionBuilder_ = null; + } + onChanged(); + return this; + } + /** + * .GNSSPosition position = 1; + */ + public com.openpositioning.PositionMe.Traj.GNSSPosition.Builder getPositionBuilder() { + bitField0_ |= 0x00000001; + onChanged(); + return getPositionFieldBuilder().getBuilder(); + } + /** + * .GNSSPosition position = 1; + */ + public com.openpositioning.PositionMe.Traj.GNSSPositionOrBuilder getPositionOrBuilder() { + if (positionBuilder_ != null) { + return positionBuilder_.getMessageOrBuilder(); + } else { + return position_ == null ? + com.openpositioning.PositionMe.Traj.GNSSPosition.getDefaultInstance() : position_; + } + } + /** + * .GNSSPosition position = 1; + */ + private com.google.protobuf.SingleFieldBuilder< + com.openpositioning.PositionMe.Traj.GNSSPosition, com.openpositioning.PositionMe.Traj.GNSSPosition.Builder, com.openpositioning.PositionMe.Traj.GNSSPositionOrBuilder> + getPositionFieldBuilder() { + if (positionBuilder_ == null) { + positionBuilder_ = new com.google.protobuf.SingleFieldBuilder< + com.openpositioning.PositionMe.Traj.GNSSPosition, com.openpositioning.PositionMe.Traj.GNSSPosition.Builder, com.openpositioning.PositionMe.Traj.GNSSPositionOrBuilder>( + getPosition(), + getParentForChildren(), + isClean()); + position_ = null; + } + return positionBuilder_; + } + + private float accuracy_ ; + /** + *
+       * metres
+       * 
+ * + * float accuracy = 2; + * @return The accuracy. + */ + @java.lang.Override + public float getAccuracy() { + return accuracy_; + } + /** + *
+       * metres
+       * 
+ * + * float accuracy = 2; + * @param value The accuracy to set. + * @return This builder for chaining. + */ + public Builder setAccuracy(float value) { + + accuracy_ = value; + bitField0_ |= 0x00000002; + onChanged(); + return this; + } + /** + *
+       * metres
+       * 
+ * + * float accuracy = 2; + * @return This builder for chaining. + */ + public Builder clearAccuracy() { + bitField0_ = (bitField0_ & ~0x00000002); + accuracy_ = 0F; + onChanged(); + return this; + } + + private float speed_ ; + /** + *
+       * m/s
+       * 
+ * + * float speed = 3; + * @return The speed. + */ + @java.lang.Override + public float getSpeed() { + return speed_; + } + /** + *
+       * m/s
+       * 
+ * + * float speed = 3; + * @param value The speed to set. + * @return This builder for chaining. + */ + public Builder setSpeed(float value) { + + speed_ = value; + bitField0_ |= 0x00000004; + onChanged(); + return this; + } + /** + *
+       * m/s
+       * 
+ * + * float speed = 3; + * @return This builder for chaining. + */ + public Builder clearSpeed() { + bitField0_ = (bitField0_ & ~0x00000004); + speed_ = 0F; + onChanged(); + return this; + } + + private float bearing_ ; + /** + *
+       * degrees
+       * 
+ * + * float bearing = 4; + * @return The bearing. + */ + @java.lang.Override + public float getBearing() { + return bearing_; + } + /** + *
+       * degrees
+       * 
+ * + * float bearing = 4; + * @param value The bearing to set. + * @return This builder for chaining. + */ + public Builder setBearing(float value) { + + bearing_ = value; + bitField0_ |= 0x00000008; + onChanged(); + return this; + } + /** + *
+       * degrees
+       * 
+ * + * float bearing = 4; + * @return This builder for chaining. + */ + public Builder clearBearing() { + bitField0_ = (bitField0_ & ~0x00000008); + bearing_ = 0F; + onChanged(); + return this; + } + + private java.lang.Object provider_ = ""; + /** + *
+       * e.g 'gps' or 'network'
+       * 
+ * + * string provider = 5; + * @return The provider. + */ + public java.lang.String getProvider() { + java.lang.Object ref = provider_; + if (!(ref instanceof java.lang.String)) { + com.google.protobuf.ByteString bs = + (com.google.protobuf.ByteString) ref; + java.lang.String s = bs.toStringUtf8(); + provider_ = s; + return s; + } else { + return (java.lang.String) ref; + } + } + /** + *
+       * e.g 'gps' or 'network'
+       * 
+ * + * string provider = 5; + * @return The bytes for provider. + */ + public com.google.protobuf.ByteString + getProviderBytes() { + java.lang.Object ref = provider_; + if (ref instanceof String) { + com.google.protobuf.ByteString b = + com.google.protobuf.ByteString.copyFromUtf8( + (java.lang.String) ref); + provider_ = b; + return b; + } else { + return (com.google.protobuf.ByteString) ref; + } + } + /** + *
+       * e.g 'gps' or 'network'
+       * 
+ * + * string provider = 5; + * @param value The provider to set. + * @return This builder for chaining. + */ + public Builder setProvider( + java.lang.String value) { + if (value == null) { throw new NullPointerException(); } + provider_ = value; + bitField0_ |= 0x00000010; + onChanged(); + return this; + } + /** + *
+       * e.g 'gps' or 'network'
+       * 
+ * + * string provider = 5; + * @return This builder for chaining. + */ + public Builder clearProvider() { + provider_ = getDefaultInstance().getProvider(); + bitField0_ = (bitField0_ & ~0x00000010); + onChanged(); + return this; + } + /** + *
+       * e.g 'gps' or 'network'
+       * 
+ * + * string provider = 5; + * @param value The bytes for provider to set. + * @return This builder for chaining. + */ + public Builder setProviderBytes( + com.google.protobuf.ByteString value) { + if (value == null) { throw new NullPointerException(); } + checkByteStringIsUtf8(value); + provider_ = value; + bitField0_ |= 0x00000010; + onChanged(); + return this; + } + + // @@protoc_insertion_point(builder_scope:GNSSReading) + } + + // @@protoc_insertion_point(class_scope:GNSSReading) + private static final com.openpositioning.PositionMe.Traj.GNSSReading DEFAULT_INSTANCE; + static { + DEFAULT_INSTANCE = new com.openpositioning.PositionMe.Traj.GNSSReading(); + } + + public static com.openpositioning.PositionMe.Traj.GNSSReading getDefaultInstance() { + return DEFAULT_INSTANCE; + } + + private static final com.google.protobuf.Parser + PARSER = new com.google.protobuf.AbstractParser() { + @java.lang.Override + public GNSSReading parsePartialFrom( + com.google.protobuf.CodedInputStream input, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + Builder builder = newBuilder(); + try { + builder.mergeFrom(input, extensionRegistry); + } catch (com.google.protobuf.InvalidProtocolBufferException e) { + throw e.setUnfinishedMessage(builder.buildPartial()); + } catch (com.google.protobuf.UninitializedMessageException e) { + throw e.asInvalidProtocolBufferException().setUnfinishedMessage(builder.buildPartial()); + } catch (java.io.IOException e) { + throw new com.google.protobuf.InvalidProtocolBufferException(e) + .setUnfinishedMessage(builder.buildPartial()); + } + return builder.buildPartial(); + } + }; + + public static com.google.protobuf.Parser parser() { + return PARSER; + } + + @java.lang.Override + public com.google.protobuf.Parser getParserForType() { + return PARSER; + } + + @java.lang.Override + public com.openpositioning.PositionMe.Traj.GNSSReading getDefaultInstanceForType() { + return DEFAULT_INSTANCE; + } + + } + + public interface FingerprintOrBuilder extends + // @@protoc_insertion_point(interface_extends:Fingerprint) + com.google.protobuf.MessageOrBuilder { + + /** + * int64 relative_timestamp = 1; + * @return The relativeTimestamp. + */ + long getRelativeTimestamp(); + + /** + * repeated .RFScan rf_scans = 2; + */ + java.util.List + getRfScansList(); + /** + * repeated .RFScan rf_scans = 2; + */ + com.openpositioning.PositionMe.Traj.RFScan getRfScans(int index); + /** + * repeated .RFScan rf_scans = 2; + */ + int getRfScansCount(); + /** + * repeated .RFScan rf_scans = 2; + */ + java.util.List + getRfScansOrBuilderList(); + /** + * repeated .RFScan rf_scans = 2; + */ + com.openpositioning.PositionMe.Traj.RFScanOrBuilder getRfScansOrBuilder( + int index); + } + /** + * Protobuf type {@code Fingerprint} + */ + public static final class Fingerprint extends + com.google.protobuf.GeneratedMessage implements + // @@protoc_insertion_point(message_implements:Fingerprint) + FingerprintOrBuilder { + private static final long serialVersionUID = 0L; + static { + com.google.protobuf.RuntimeVersion.validateProtobufGencodeVersion( + com.google.protobuf.RuntimeVersion.RuntimeDomain.PUBLIC, + /* major= */ 4, + /* minor= */ 29, + /* patch= */ 6, + /* suffix= */ "", + Fingerprint.class.getName()); + } + // Use Fingerprint.newBuilder() to construct. + private Fingerprint(com.google.protobuf.GeneratedMessage.Builder builder) { + super(builder); + } + private Fingerprint() { + rfScans_ = java.util.Collections.emptyList(); + } + + public static final com.google.protobuf.Descriptors.Descriptor + getDescriptor() { + return com.openpositioning.PositionMe.Traj.internal_static_Fingerprint_descriptor; + } + + @java.lang.Override + protected com.google.protobuf.GeneratedMessage.FieldAccessorTable + internalGetFieldAccessorTable() { + return com.openpositioning.PositionMe.Traj.internal_static_Fingerprint_fieldAccessorTable + .ensureFieldAccessorsInitialized( + com.openpositioning.PositionMe.Traj.Fingerprint.class, com.openpositioning.PositionMe.Traj.Fingerprint.Builder.class); + } + + public static final int RELATIVE_TIMESTAMP_FIELD_NUMBER = 1; + private long relativeTimestamp_ = 0L; + /** + * int64 relative_timestamp = 1; + * @return The relativeTimestamp. + */ + @java.lang.Override + public long getRelativeTimestamp() { + return relativeTimestamp_; + } + + public static final int RF_SCANS_FIELD_NUMBER = 2; + @SuppressWarnings("serial") + private java.util.List rfScans_; + /** + * repeated .RFScan rf_scans = 2; + */ + @java.lang.Override + public java.util.List getRfScansList() { + return rfScans_; + } + /** + * repeated .RFScan rf_scans = 2; + */ + @java.lang.Override + public java.util.List + getRfScansOrBuilderList() { + return rfScans_; + } + /** + * repeated .RFScan rf_scans = 2; + */ + @java.lang.Override + public int getRfScansCount() { + return rfScans_.size(); + } + /** + * repeated .RFScan rf_scans = 2; + */ + @java.lang.Override + public com.openpositioning.PositionMe.Traj.RFScan getRfScans(int index) { + return rfScans_.get(index); + } + /** + * repeated .RFScan rf_scans = 2; + */ + @java.lang.Override + public com.openpositioning.PositionMe.Traj.RFScanOrBuilder getRfScansOrBuilder( + int index) { + return rfScans_.get(index); + } + + private byte memoizedIsInitialized = -1; + @java.lang.Override + public final boolean isInitialized() { + byte isInitialized = memoizedIsInitialized; + if (isInitialized == 1) return true; + if (isInitialized == 0) return false; + + memoizedIsInitialized = 1; + return true; + } + + @java.lang.Override + public void writeTo(com.google.protobuf.CodedOutputStream output) + throws java.io.IOException { + if (relativeTimestamp_ != 0L) { + output.writeInt64(1, relativeTimestamp_); + } + for (int i = 0; i < rfScans_.size(); i++) { + output.writeMessage(2, rfScans_.get(i)); + } + getUnknownFields().writeTo(output); + } + + @java.lang.Override + public int getSerializedSize() { + int size = memoizedSize; + if (size != -1) return size; + + size = 0; + if (relativeTimestamp_ != 0L) { + size += com.google.protobuf.CodedOutputStream + .computeInt64Size(1, relativeTimestamp_); + } + for (int i = 0; i < rfScans_.size(); i++) { + size += com.google.protobuf.CodedOutputStream + .computeMessageSize(2, rfScans_.get(i)); + } + size += getUnknownFields().getSerializedSize(); + memoizedSize = size; + return size; + } + + @java.lang.Override + public boolean equals(final java.lang.Object obj) { + if (obj == this) { + return true; + } + if (!(obj instanceof com.openpositioning.PositionMe.Traj.Fingerprint)) { + return super.equals(obj); + } + com.openpositioning.PositionMe.Traj.Fingerprint other = (com.openpositioning.PositionMe.Traj.Fingerprint) obj; + + if (getRelativeTimestamp() + != other.getRelativeTimestamp()) return false; + if (!getRfScansList() + .equals(other.getRfScansList())) return false; + if (!getUnknownFields().equals(other.getUnknownFields())) return false; + return true; + } + + @java.lang.Override + public int hashCode() { + if (memoizedHashCode != 0) { + return memoizedHashCode; + } + int hash = 41; + hash = (19 * hash) + getDescriptor().hashCode(); + hash = (37 * hash) + RELATIVE_TIMESTAMP_FIELD_NUMBER; + hash = (53 * hash) + com.google.protobuf.Internal.hashLong( + getRelativeTimestamp()); + if (getRfScansCount() > 0) { + hash = (37 * hash) + RF_SCANS_FIELD_NUMBER; + hash = (53 * hash) + getRfScansList().hashCode(); + } + hash = (29 * hash) + getUnknownFields().hashCode(); + memoizedHashCode = hash; + return hash; + } + + public static com.openpositioning.PositionMe.Traj.Fingerprint parseFrom( + java.nio.ByteBuffer data) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + public static com.openpositioning.PositionMe.Traj.Fingerprint parseFrom( + java.nio.ByteBuffer data, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data, extensionRegistry); + } + public static com.openpositioning.PositionMe.Traj.Fingerprint parseFrom( + com.google.protobuf.ByteString data) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + public static com.openpositioning.PositionMe.Traj.Fingerprint parseFrom( + com.google.protobuf.ByteString data, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data, extensionRegistry); + } + public static com.openpositioning.PositionMe.Traj.Fingerprint parseFrom(byte[] data) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + public static com.openpositioning.PositionMe.Traj.Fingerprint parseFrom( + byte[] data, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data, extensionRegistry); + } + public static com.openpositioning.PositionMe.Traj.Fingerprint parseFrom(java.io.InputStream input) + throws java.io.IOException { + return com.google.protobuf.GeneratedMessage + .parseWithIOException(PARSER, input); + } + public static com.openpositioning.PositionMe.Traj.Fingerprint parseFrom( + java.io.InputStream input, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws java.io.IOException { + return com.google.protobuf.GeneratedMessage + .parseWithIOException(PARSER, input, extensionRegistry); + } + + public static com.openpositioning.PositionMe.Traj.Fingerprint parseDelimitedFrom(java.io.InputStream input) + throws java.io.IOException { + return com.google.protobuf.GeneratedMessage + .parseDelimitedWithIOException(PARSER, input); + } + + public static com.openpositioning.PositionMe.Traj.Fingerprint parseDelimitedFrom( + java.io.InputStream input, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws java.io.IOException { + return com.google.protobuf.GeneratedMessage + .parseDelimitedWithIOException(PARSER, input, extensionRegistry); + } + public static com.openpositioning.PositionMe.Traj.Fingerprint parseFrom( + com.google.protobuf.CodedInputStream input) + throws java.io.IOException { + return com.google.protobuf.GeneratedMessage + .parseWithIOException(PARSER, input); + } + public static com.openpositioning.PositionMe.Traj.Fingerprint parseFrom( + com.google.protobuf.CodedInputStream input, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws java.io.IOException { + return com.google.protobuf.GeneratedMessage + .parseWithIOException(PARSER, input, extensionRegistry); + } + + @java.lang.Override + public Builder newBuilderForType() { return newBuilder(); } + public static Builder newBuilder() { + return DEFAULT_INSTANCE.toBuilder(); + } + public static Builder newBuilder(com.openpositioning.PositionMe.Traj.Fingerprint prototype) { + return DEFAULT_INSTANCE.toBuilder().mergeFrom(prototype); + } + @java.lang.Override + public Builder toBuilder() { + return this == DEFAULT_INSTANCE + ? new Builder() : new Builder().mergeFrom(this); + } + + @java.lang.Override + protected Builder newBuilderForType( + com.google.protobuf.GeneratedMessage.BuilderParent parent) { + Builder builder = new Builder(parent); + return builder; + } + /** + * Protobuf type {@code Fingerprint} + */ + public static final class Builder extends + com.google.protobuf.GeneratedMessage.Builder implements + // @@protoc_insertion_point(builder_implements:Fingerprint) + com.openpositioning.PositionMe.Traj.FingerprintOrBuilder { + public static final com.google.protobuf.Descriptors.Descriptor + getDescriptor() { + return com.openpositioning.PositionMe.Traj.internal_static_Fingerprint_descriptor; + } + + @java.lang.Override + protected com.google.protobuf.GeneratedMessage.FieldAccessorTable + internalGetFieldAccessorTable() { + return com.openpositioning.PositionMe.Traj.internal_static_Fingerprint_fieldAccessorTable + .ensureFieldAccessorsInitialized( + com.openpositioning.PositionMe.Traj.Fingerprint.class, com.openpositioning.PositionMe.Traj.Fingerprint.Builder.class); + } + + // Construct using com.openpositioning.PositionMe.Traj.Fingerprint.newBuilder() + private Builder() { + + } + + private Builder( + com.google.protobuf.GeneratedMessage.BuilderParent parent) { + super(parent); + + } + @java.lang.Override + public Builder clear() { + super.clear(); + bitField0_ = 0; + relativeTimestamp_ = 0L; + if (rfScansBuilder_ == null) { + rfScans_ = java.util.Collections.emptyList(); + } else { + rfScans_ = null; + rfScansBuilder_.clear(); + } + bitField0_ = (bitField0_ & ~0x00000002); + return this; + } + + @java.lang.Override + public com.google.protobuf.Descriptors.Descriptor + getDescriptorForType() { + return com.openpositioning.PositionMe.Traj.internal_static_Fingerprint_descriptor; + } + + @java.lang.Override + public com.openpositioning.PositionMe.Traj.Fingerprint getDefaultInstanceForType() { + return com.openpositioning.PositionMe.Traj.Fingerprint.getDefaultInstance(); + } + + @java.lang.Override + public com.openpositioning.PositionMe.Traj.Fingerprint build() { + com.openpositioning.PositionMe.Traj.Fingerprint result = buildPartial(); + if (!result.isInitialized()) { + throw newUninitializedMessageException(result); + } + return result; + } + + @java.lang.Override + public com.openpositioning.PositionMe.Traj.Fingerprint buildPartial() { + com.openpositioning.PositionMe.Traj.Fingerprint result = new com.openpositioning.PositionMe.Traj.Fingerprint(this); + buildPartialRepeatedFields(result); + if (bitField0_ != 0) { buildPartial0(result); } + onBuilt(); + return result; + } + + private void buildPartialRepeatedFields(com.openpositioning.PositionMe.Traj.Fingerprint result) { + if (rfScansBuilder_ == null) { + if (((bitField0_ & 0x00000002) != 0)) { + rfScans_ = java.util.Collections.unmodifiableList(rfScans_); + bitField0_ = (bitField0_ & ~0x00000002); + } + result.rfScans_ = rfScans_; + } else { + result.rfScans_ = rfScansBuilder_.build(); + } + } + + private void buildPartial0(com.openpositioning.PositionMe.Traj.Fingerprint result) { + int from_bitField0_ = bitField0_; + if (((from_bitField0_ & 0x00000001) != 0)) { + result.relativeTimestamp_ = relativeTimestamp_; + } + } + + @java.lang.Override + public Builder mergeFrom(com.google.protobuf.Message other) { + if (other instanceof com.openpositioning.PositionMe.Traj.Fingerprint) { + return mergeFrom((com.openpositioning.PositionMe.Traj.Fingerprint)other); + } else { + super.mergeFrom(other); + return this; + } + } + + public Builder mergeFrom(com.openpositioning.PositionMe.Traj.Fingerprint other) { + if (other == com.openpositioning.PositionMe.Traj.Fingerprint.getDefaultInstance()) return this; + if (other.getRelativeTimestamp() != 0L) { + setRelativeTimestamp(other.getRelativeTimestamp()); + } + if (rfScansBuilder_ == null) { + if (!other.rfScans_.isEmpty()) { + if (rfScans_.isEmpty()) { + rfScans_ = other.rfScans_; + bitField0_ = (bitField0_ & ~0x00000002); + } else { + ensureRfScansIsMutable(); + rfScans_.addAll(other.rfScans_); + } + onChanged(); + } + } else { + if (!other.rfScans_.isEmpty()) { + if (rfScansBuilder_.isEmpty()) { + rfScansBuilder_.dispose(); + rfScansBuilder_ = null; + rfScans_ = other.rfScans_; + bitField0_ = (bitField0_ & ~0x00000002); + rfScansBuilder_ = + com.google.protobuf.GeneratedMessage.alwaysUseFieldBuilders ? + getRfScansFieldBuilder() : null; + } else { + rfScansBuilder_.addAllMessages(other.rfScans_); + } + } + } + this.mergeUnknownFields(other.getUnknownFields()); + onChanged(); + return this; + } + + @java.lang.Override + public final boolean isInitialized() { + return true; + } + + @java.lang.Override + public Builder mergeFrom( + com.google.protobuf.CodedInputStream input, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws java.io.IOException { + if (extensionRegistry == null) { + throw new java.lang.NullPointerException(); + } + try { + boolean done = false; + while (!done) { + int tag = input.readTag(); + switch (tag) { + case 0: + done = true; + break; + case 8: { + relativeTimestamp_ = input.readInt64(); + bitField0_ |= 0x00000001; + break; + } // case 8 + case 18: { + com.openpositioning.PositionMe.Traj.RFScan m = + input.readMessage( + com.openpositioning.PositionMe.Traj.RFScan.parser(), + extensionRegistry); + if (rfScansBuilder_ == null) { + ensureRfScansIsMutable(); + rfScans_.add(m); + } else { + rfScansBuilder_.addMessage(m); + } + break; + } // case 18 + default: { + if (!super.parseUnknownField(input, extensionRegistry, tag)) { + done = true; // was an endgroup tag + } + break; + } // default: + } // switch (tag) + } // while (!done) + } catch (com.google.protobuf.InvalidProtocolBufferException e) { + throw e.unwrapIOException(); + } finally { + onChanged(); + } // finally + return this; + } + private int bitField0_; + + private long relativeTimestamp_ ; + /** + * int64 relative_timestamp = 1; + * @return The relativeTimestamp. + */ + @java.lang.Override + public long getRelativeTimestamp() { + return relativeTimestamp_; + } + /** + * int64 relative_timestamp = 1; + * @param value The relativeTimestamp to set. + * @return This builder for chaining. + */ + public Builder setRelativeTimestamp(long value) { + + relativeTimestamp_ = value; + bitField0_ |= 0x00000001; + onChanged(); + return this; + } + /** + * int64 relative_timestamp = 1; + * @return This builder for chaining. + */ + public Builder clearRelativeTimestamp() { + bitField0_ = (bitField0_ & ~0x00000001); + relativeTimestamp_ = 0L; + onChanged(); + return this; + } + + private java.util.List rfScans_ = + java.util.Collections.emptyList(); + private void ensureRfScansIsMutable() { + if (!((bitField0_ & 0x00000002) != 0)) { + rfScans_ = new java.util.ArrayList(rfScans_); + bitField0_ |= 0x00000002; + } + } + + private com.google.protobuf.RepeatedFieldBuilder< + com.openpositioning.PositionMe.Traj.RFScan, com.openpositioning.PositionMe.Traj.RFScan.Builder, com.openpositioning.PositionMe.Traj.RFScanOrBuilder> rfScansBuilder_; + + /** + * repeated .RFScan rf_scans = 2; + */ + public java.util.List getRfScansList() { + if (rfScansBuilder_ == null) { + return java.util.Collections.unmodifiableList(rfScans_); + } else { + return rfScansBuilder_.getMessageList(); + } + } + /** + * repeated .RFScan rf_scans = 2; + */ + public int getRfScansCount() { + if (rfScansBuilder_ == null) { + return rfScans_.size(); + } else { + return rfScansBuilder_.getCount(); + } + } + /** + * repeated .RFScan rf_scans = 2; + */ + public com.openpositioning.PositionMe.Traj.RFScan getRfScans(int index) { + if (rfScansBuilder_ == null) { + return rfScans_.get(index); + } else { + return rfScansBuilder_.getMessage(index); + } + } + /** + * repeated .RFScan rf_scans = 2; + */ + public Builder setRfScans( + int index, com.openpositioning.PositionMe.Traj.RFScan value) { + if (rfScansBuilder_ == null) { + if (value == null) { + throw new NullPointerException(); + } + ensureRfScansIsMutable(); + rfScans_.set(index, value); + onChanged(); + } else { + rfScansBuilder_.setMessage(index, value); + } + return this; + } + /** + * repeated .RFScan rf_scans = 2; + */ + public Builder setRfScans( + int index, com.openpositioning.PositionMe.Traj.RFScan.Builder builderForValue) { + if (rfScansBuilder_ == null) { + ensureRfScansIsMutable(); + rfScans_.set(index, builderForValue.build()); + onChanged(); + } else { + rfScansBuilder_.setMessage(index, builderForValue.build()); + } + return this; + } + /** + * repeated .RFScan rf_scans = 2; + */ + public Builder addRfScans(com.openpositioning.PositionMe.Traj.RFScan value) { + if (rfScansBuilder_ == null) { + if (value == null) { + throw new NullPointerException(); + } + ensureRfScansIsMutable(); + rfScans_.add(value); + onChanged(); + } else { + rfScansBuilder_.addMessage(value); + } + return this; + } + /** + * repeated .RFScan rf_scans = 2; + */ + public Builder addRfScans( + int index, com.openpositioning.PositionMe.Traj.RFScan value) { + if (rfScansBuilder_ == null) { + if (value == null) { + throw new NullPointerException(); + } + ensureRfScansIsMutable(); + rfScans_.add(index, value); + onChanged(); + } else { + rfScansBuilder_.addMessage(index, value); + } + return this; + } + /** + * repeated .RFScan rf_scans = 2; + */ + public Builder addRfScans( + com.openpositioning.PositionMe.Traj.RFScan.Builder builderForValue) { + if (rfScansBuilder_ == null) { + ensureRfScansIsMutable(); + rfScans_.add(builderForValue.build()); + onChanged(); + } else { + rfScansBuilder_.addMessage(builderForValue.build()); + } + return this; + } + /** + * repeated .RFScan rf_scans = 2; + */ + public Builder addRfScans( + int index, com.openpositioning.PositionMe.Traj.RFScan.Builder builderForValue) { + if (rfScansBuilder_ == null) { + ensureRfScansIsMutable(); + rfScans_.add(index, builderForValue.build()); + onChanged(); + } else { + rfScansBuilder_.addMessage(index, builderForValue.build()); + } + return this; + } + /** + * repeated .RFScan rf_scans = 2; + */ + public Builder addAllRfScans( + java.lang.Iterable values) { + if (rfScansBuilder_ == null) { + ensureRfScansIsMutable(); + com.google.protobuf.AbstractMessageLite.Builder.addAll( + values, rfScans_); + onChanged(); + } else { + rfScansBuilder_.addAllMessages(values); + } + return this; + } + /** + * repeated .RFScan rf_scans = 2; + */ + public Builder clearRfScans() { + if (rfScansBuilder_ == null) { + rfScans_ = java.util.Collections.emptyList(); + bitField0_ = (bitField0_ & ~0x00000002); + onChanged(); + } else { + rfScansBuilder_.clear(); + } + return this; + } + /** + * repeated .RFScan rf_scans = 2; + */ + public Builder removeRfScans(int index) { + if (rfScansBuilder_ == null) { + ensureRfScansIsMutable(); + rfScans_.remove(index); + onChanged(); + } else { + rfScansBuilder_.remove(index); + } + return this; + } + /** + * repeated .RFScan rf_scans = 2; + */ + public com.openpositioning.PositionMe.Traj.RFScan.Builder getRfScansBuilder( + int index) { + return getRfScansFieldBuilder().getBuilder(index); + } + /** + * repeated .RFScan rf_scans = 2; + */ + public com.openpositioning.PositionMe.Traj.RFScanOrBuilder getRfScansOrBuilder( + int index) { + if (rfScansBuilder_ == null) { + return rfScans_.get(index); } else { + return rfScansBuilder_.getMessageOrBuilder(index); + } + } + /** + * repeated .RFScan rf_scans = 2; + */ + public java.util.List + getRfScansOrBuilderList() { + if (rfScansBuilder_ != null) { + return rfScansBuilder_.getMessageOrBuilderList(); + } else { + return java.util.Collections.unmodifiableList(rfScans_); + } + } + /** + * repeated .RFScan rf_scans = 2; + */ + public com.openpositioning.PositionMe.Traj.RFScan.Builder addRfScansBuilder() { + return getRfScansFieldBuilder().addBuilder( + com.openpositioning.PositionMe.Traj.RFScan.getDefaultInstance()); + } + /** + * repeated .RFScan rf_scans = 2; + */ + public com.openpositioning.PositionMe.Traj.RFScan.Builder addRfScansBuilder( + int index) { + return getRfScansFieldBuilder().addBuilder( + index, com.openpositioning.PositionMe.Traj.RFScan.getDefaultInstance()); + } + /** + * repeated .RFScan rf_scans = 2; + */ + public java.util.List + getRfScansBuilderList() { + return getRfScansFieldBuilder().getBuilderList(); + } + private com.google.protobuf.RepeatedFieldBuilder< + com.openpositioning.PositionMe.Traj.RFScan, com.openpositioning.PositionMe.Traj.RFScan.Builder, com.openpositioning.PositionMe.Traj.RFScanOrBuilder> + getRfScansFieldBuilder() { + if (rfScansBuilder_ == null) { + rfScansBuilder_ = new com.google.protobuf.RepeatedFieldBuilder< + com.openpositioning.PositionMe.Traj.RFScan, com.openpositioning.PositionMe.Traj.RFScan.Builder, com.openpositioning.PositionMe.Traj.RFScanOrBuilder>( + rfScans_, + ((bitField0_ & 0x00000002) != 0), + getParentForChildren(), + isClean()); + rfScans_ = null; + } + return rfScansBuilder_; + } + + // @@protoc_insertion_point(builder_scope:Fingerprint) + } + + // @@protoc_insertion_point(class_scope:Fingerprint) + private static final com.openpositioning.PositionMe.Traj.Fingerprint DEFAULT_INSTANCE; + static { + DEFAULT_INSTANCE = new com.openpositioning.PositionMe.Traj.Fingerprint(); + } + + public static com.openpositioning.PositionMe.Traj.Fingerprint getDefaultInstance() { + return DEFAULT_INSTANCE; + } + + private static final com.google.protobuf.Parser + PARSER = new com.google.protobuf.AbstractParser() { + @java.lang.Override + public Fingerprint parsePartialFrom( + com.google.protobuf.CodedInputStream input, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + Builder builder = newBuilder(); + try { + builder.mergeFrom(input, extensionRegistry); + } catch (com.google.protobuf.InvalidProtocolBufferException e) { + throw e.setUnfinishedMessage(builder.buildPartial()); + } catch (com.google.protobuf.UninitializedMessageException e) { + throw e.asInvalidProtocolBufferException().setUnfinishedMessage(builder.buildPartial()); + } catch (java.io.IOException e) { + throw new com.google.protobuf.InvalidProtocolBufferException(e) + .setUnfinishedMessage(builder.buildPartial()); + } + return builder.buildPartial(); + } + }; + + public static com.google.protobuf.Parser parser() { + return PARSER; + } + + @java.lang.Override + public com.google.protobuf.Parser getParserForType() { + return PARSER; + } + + @java.lang.Override + public com.openpositioning.PositionMe.Traj.Fingerprint getDefaultInstanceForType() { + return DEFAULT_INSTANCE; + } + + } + + public interface RFScanOrBuilder extends + // @@protoc_insertion_point(interface_extends:RFScan) + com.google.protobuf.MessageOrBuilder { + + /** + * int64 relative_timestamp = 1; + * @return The relativeTimestamp. + */ + long getRelativeTimestamp(); + + /** + *
+     * Integer encoding of the hex mac address (BSSID)
+     * e.g. 207394925843984
+     * 
+ * + * int64 mac = 2; + * @return The mac. + */ + long getMac(); + + /** + *
+     * rssi integer in dBm.
+     * typically between -120 and -10
+     * 
+ * + * int32 rssi = 3; + * @return The rssi. + */ + int getRssi(); + + /** + *
+     * returned position
+     * 
+ * + * optional .GNSSPosition position = 4; + * @return Whether the position field is set. + */ + boolean hasPosition(); + /** + *
+     * returned position
+     * 
+ * + * optional .GNSSPosition position = 4; + * @return The position. + */ + com.openpositioning.PositionMe.Traj.GNSSPosition getPosition(); + /** + *
+     * returned position
+     * 
+ * + * optional .GNSSPosition position = 4; + */ + com.openpositioning.PositionMe.Traj.GNSSPositionOrBuilder getPositionOrBuilder(); + } + /** + * Protobuf type {@code RFScan} + */ + public static final class RFScan extends + com.google.protobuf.GeneratedMessage implements + // @@protoc_insertion_point(message_implements:RFScan) + RFScanOrBuilder { + private static final long serialVersionUID = 0L; + static { + com.google.protobuf.RuntimeVersion.validateProtobufGencodeVersion( + com.google.protobuf.RuntimeVersion.RuntimeDomain.PUBLIC, + /* major= */ 4, + /* minor= */ 29, + /* patch= */ 6, + /* suffix= */ "", + RFScan.class.getName()); + } + // Use RFScan.newBuilder() to construct. + private RFScan(com.google.protobuf.GeneratedMessage.Builder builder) { + super(builder); + } + private RFScan() { + } + + public static final com.google.protobuf.Descriptors.Descriptor + getDescriptor() { + return com.openpositioning.PositionMe.Traj.internal_static_RFScan_descriptor; + } + + @java.lang.Override + protected com.google.protobuf.GeneratedMessage.FieldAccessorTable + internalGetFieldAccessorTable() { + return com.openpositioning.PositionMe.Traj.internal_static_RFScan_fieldAccessorTable + .ensureFieldAccessorsInitialized( + com.openpositioning.PositionMe.Traj.RFScan.class, com.openpositioning.PositionMe.Traj.RFScan.Builder.class); + } + + private int bitField0_; + public static final int RELATIVE_TIMESTAMP_FIELD_NUMBER = 1; + private long relativeTimestamp_ = 0L; + /** + * int64 relative_timestamp = 1; + * @return The relativeTimestamp. + */ + @java.lang.Override + public long getRelativeTimestamp() { + return relativeTimestamp_; + } + + public static final int MAC_FIELD_NUMBER = 2; + private long mac_ = 0L; + /** + *
+     * Integer encoding of the hex mac address (BSSID)
+     * e.g. 207394925843984
+     * 
+ * + * int64 mac = 2; + * @return The mac. + */ + @java.lang.Override + public long getMac() { + return mac_; + } + + public static final int RSSI_FIELD_NUMBER = 3; + private int rssi_ = 0; + /** + *
+     * rssi integer in dBm.
+     * typically between -120 and -10
+     * 
+ * + * int32 rssi = 3; + * @return The rssi. + */ + @java.lang.Override + public int getRssi() { + return rssi_; + } + + public static final int POSITION_FIELD_NUMBER = 4; + private com.openpositioning.PositionMe.Traj.GNSSPosition position_; + /** + *
+     * returned position
+     * 
+ * + * optional .GNSSPosition position = 4; + * @return Whether the position field is set. + */ + @java.lang.Override + public boolean hasPosition() { + return ((bitField0_ & 0x00000001) != 0); + } + /** + *
+     * returned position
+     * 
+ * + * optional .GNSSPosition position = 4; + * @return The position. + */ + @java.lang.Override + public com.openpositioning.PositionMe.Traj.GNSSPosition getPosition() { + return position_ == null ? com.openpositioning.PositionMe.Traj.GNSSPosition.getDefaultInstance() : position_; + } + /** + *
+     * returned position
+     * 
+ * + * optional .GNSSPosition position = 4; + */ + @java.lang.Override + public com.openpositioning.PositionMe.Traj.GNSSPositionOrBuilder getPositionOrBuilder() { + return position_ == null ? com.openpositioning.PositionMe.Traj.GNSSPosition.getDefaultInstance() : position_; + } + + private byte memoizedIsInitialized = -1; + @java.lang.Override + public final boolean isInitialized() { + byte isInitialized = memoizedIsInitialized; + if (isInitialized == 1) return true; + if (isInitialized == 0) return false; + + memoizedIsInitialized = 1; + return true; + } + + @java.lang.Override + public void writeTo(com.google.protobuf.CodedOutputStream output) + throws java.io.IOException { + if (relativeTimestamp_ != 0L) { + output.writeInt64(1, relativeTimestamp_); + } + if (mac_ != 0L) { + output.writeInt64(2, mac_); + } + if (rssi_ != 0) { + output.writeInt32(3, rssi_); + } + if (((bitField0_ & 0x00000001) != 0)) { + output.writeMessage(4, getPosition()); + } + getUnknownFields().writeTo(output); + } + + @java.lang.Override + public int getSerializedSize() { + int size = memoizedSize; + if (size != -1) return size; + + size = 0; + if (relativeTimestamp_ != 0L) { + size += com.google.protobuf.CodedOutputStream + .computeInt64Size(1, relativeTimestamp_); + } + if (mac_ != 0L) { + size += com.google.protobuf.CodedOutputStream + .computeInt64Size(2, mac_); + } + if (rssi_ != 0) { + size += com.google.protobuf.CodedOutputStream + .computeInt32Size(3, rssi_); + } + if (((bitField0_ & 0x00000001) != 0)) { + size += com.google.protobuf.CodedOutputStream + .computeMessageSize(4, getPosition()); + } + size += getUnknownFields().getSerializedSize(); + memoizedSize = size; + return size; + } + + @java.lang.Override + public boolean equals(final java.lang.Object obj) { + if (obj == this) { + return true; + } + if (!(obj instanceof com.openpositioning.PositionMe.Traj.RFScan)) { + return super.equals(obj); + } + com.openpositioning.PositionMe.Traj.RFScan other = (com.openpositioning.PositionMe.Traj.RFScan) obj; + + if (getRelativeTimestamp() + != other.getRelativeTimestamp()) return false; + if (getMac() + != other.getMac()) return false; + if (getRssi() + != other.getRssi()) return false; + if (hasPosition() != other.hasPosition()) return false; + if (hasPosition()) { + if (!getPosition() + .equals(other.getPosition())) return false; + } + if (!getUnknownFields().equals(other.getUnknownFields())) return false; + return true; + } + + @java.lang.Override + public int hashCode() { + if (memoizedHashCode != 0) { + return memoizedHashCode; + } + int hash = 41; + hash = (19 * hash) + getDescriptor().hashCode(); + hash = (37 * hash) + RELATIVE_TIMESTAMP_FIELD_NUMBER; + hash = (53 * hash) + com.google.protobuf.Internal.hashLong( + getRelativeTimestamp()); + hash = (37 * hash) + MAC_FIELD_NUMBER; + hash = (53 * hash) + com.google.protobuf.Internal.hashLong( + getMac()); + hash = (37 * hash) + RSSI_FIELD_NUMBER; + hash = (53 * hash) + getRssi(); + if (hasPosition()) { + hash = (37 * hash) + POSITION_FIELD_NUMBER; + hash = (53 * hash) + getPosition().hashCode(); + } + hash = (29 * hash) + getUnknownFields().hashCode(); + memoizedHashCode = hash; + return hash; + } + + public static com.openpositioning.PositionMe.Traj.RFScan parseFrom( + java.nio.ByteBuffer data) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + public static com.openpositioning.PositionMe.Traj.RFScan parseFrom( + java.nio.ByteBuffer data, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data, extensionRegistry); + } + public static com.openpositioning.PositionMe.Traj.RFScan parseFrom( + com.google.protobuf.ByteString data) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + public static com.openpositioning.PositionMe.Traj.RFScan parseFrom( + com.google.protobuf.ByteString data, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data, extensionRegistry); + } + public static com.openpositioning.PositionMe.Traj.RFScan parseFrom(byte[] data) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + public static com.openpositioning.PositionMe.Traj.RFScan parseFrom( + byte[] data, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data, extensionRegistry); + } + public static com.openpositioning.PositionMe.Traj.RFScan parseFrom(java.io.InputStream input) + throws java.io.IOException { + return com.google.protobuf.GeneratedMessage + .parseWithIOException(PARSER, input); + } + public static com.openpositioning.PositionMe.Traj.RFScan parseFrom( + java.io.InputStream input, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws java.io.IOException { + return com.google.protobuf.GeneratedMessage + .parseWithIOException(PARSER, input, extensionRegistry); + } + + public static com.openpositioning.PositionMe.Traj.RFScan parseDelimitedFrom(java.io.InputStream input) + throws java.io.IOException { + return com.google.protobuf.GeneratedMessage + .parseDelimitedWithIOException(PARSER, input); + } + + public static com.openpositioning.PositionMe.Traj.RFScan parseDelimitedFrom( + java.io.InputStream input, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws java.io.IOException { + return com.google.protobuf.GeneratedMessage + .parseDelimitedWithIOException(PARSER, input, extensionRegistry); + } + public static com.openpositioning.PositionMe.Traj.RFScan parseFrom( + com.google.protobuf.CodedInputStream input) + throws java.io.IOException { + return com.google.protobuf.GeneratedMessage + .parseWithIOException(PARSER, input); + } + public static com.openpositioning.PositionMe.Traj.RFScan parseFrom( + com.google.protobuf.CodedInputStream input, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws java.io.IOException { + return com.google.protobuf.GeneratedMessage + .parseWithIOException(PARSER, input, extensionRegistry); + } + + @java.lang.Override + public Builder newBuilderForType() { return newBuilder(); } + public static Builder newBuilder() { + return DEFAULT_INSTANCE.toBuilder(); + } + public static Builder newBuilder(com.openpositioning.PositionMe.Traj.RFScan prototype) { + return DEFAULT_INSTANCE.toBuilder().mergeFrom(prototype); + } + @java.lang.Override + public Builder toBuilder() { + return this == DEFAULT_INSTANCE + ? new Builder() : new Builder().mergeFrom(this); + } + + @java.lang.Override + protected Builder newBuilderForType( + com.google.protobuf.GeneratedMessage.BuilderParent parent) { + Builder builder = new Builder(parent); + return builder; + } + /** + * Protobuf type {@code RFScan} + */ + public static final class Builder extends + com.google.protobuf.GeneratedMessage.Builder implements + // @@protoc_insertion_point(builder_implements:RFScan) + com.openpositioning.PositionMe.Traj.RFScanOrBuilder { + public static final com.google.protobuf.Descriptors.Descriptor + getDescriptor() { + return com.openpositioning.PositionMe.Traj.internal_static_RFScan_descriptor; + } + + @java.lang.Override + protected com.google.protobuf.GeneratedMessage.FieldAccessorTable + internalGetFieldAccessorTable() { + return com.openpositioning.PositionMe.Traj.internal_static_RFScan_fieldAccessorTable + .ensureFieldAccessorsInitialized( + com.openpositioning.PositionMe.Traj.RFScan.class, com.openpositioning.PositionMe.Traj.RFScan.Builder.class); + } + + // Construct using com.openpositioning.PositionMe.Traj.RFScan.newBuilder() + private Builder() { + maybeForceBuilderInitialization(); + } + + private Builder( + com.google.protobuf.GeneratedMessage.BuilderParent parent) { + super(parent); + maybeForceBuilderInitialization(); + } + private void maybeForceBuilderInitialization() { + if (com.google.protobuf.GeneratedMessage + .alwaysUseFieldBuilders) { + getPositionFieldBuilder(); + } + } + @java.lang.Override + public Builder clear() { + super.clear(); + bitField0_ = 0; + relativeTimestamp_ = 0L; + mac_ = 0L; + rssi_ = 0; + position_ = null; + if (positionBuilder_ != null) { + positionBuilder_.dispose(); + positionBuilder_ = null; + } + return this; + } + + @java.lang.Override + public com.google.protobuf.Descriptors.Descriptor + getDescriptorForType() { + return com.openpositioning.PositionMe.Traj.internal_static_RFScan_descriptor; + } + + @java.lang.Override + public com.openpositioning.PositionMe.Traj.RFScan getDefaultInstanceForType() { + return com.openpositioning.PositionMe.Traj.RFScan.getDefaultInstance(); + } + + @java.lang.Override + public com.openpositioning.PositionMe.Traj.RFScan build() { + com.openpositioning.PositionMe.Traj.RFScan result = buildPartial(); + if (!result.isInitialized()) { + throw newUninitializedMessageException(result); + } + return result; + } + + @java.lang.Override + public com.openpositioning.PositionMe.Traj.RFScan buildPartial() { + com.openpositioning.PositionMe.Traj.RFScan result = new com.openpositioning.PositionMe.Traj.RFScan(this); + if (bitField0_ != 0) { buildPartial0(result); } + onBuilt(); + return result; + } + + private void buildPartial0(com.openpositioning.PositionMe.Traj.RFScan result) { + int from_bitField0_ = bitField0_; + if (((from_bitField0_ & 0x00000001) != 0)) { + result.relativeTimestamp_ = relativeTimestamp_; + } + if (((from_bitField0_ & 0x00000002) != 0)) { + result.mac_ = mac_; + } + if (((from_bitField0_ & 0x00000004) != 0)) { + result.rssi_ = rssi_; + } + int to_bitField0_ = 0; + if (((from_bitField0_ & 0x00000008) != 0)) { + result.position_ = positionBuilder_ == null + ? position_ + : positionBuilder_.build(); + to_bitField0_ |= 0x00000001; + } + result.bitField0_ |= to_bitField0_; + } + + @java.lang.Override + public Builder mergeFrom(com.google.protobuf.Message other) { + if (other instanceof com.openpositioning.PositionMe.Traj.RFScan) { + return mergeFrom((com.openpositioning.PositionMe.Traj.RFScan)other); + } else { + super.mergeFrom(other); + return this; + } + } + + public Builder mergeFrom(com.openpositioning.PositionMe.Traj.RFScan other) { + if (other == com.openpositioning.PositionMe.Traj.RFScan.getDefaultInstance()) return this; + if (other.getRelativeTimestamp() != 0L) { + setRelativeTimestamp(other.getRelativeTimestamp()); + } + if (other.getMac() != 0L) { + setMac(other.getMac()); + } + if (other.getRssi() != 0) { + setRssi(other.getRssi()); + } + if (other.hasPosition()) { + mergePosition(other.getPosition()); + } + this.mergeUnknownFields(other.getUnknownFields()); + onChanged(); + return this; + } + + @java.lang.Override + public final boolean isInitialized() { + return true; + } + + @java.lang.Override + public Builder mergeFrom( + com.google.protobuf.CodedInputStream input, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws java.io.IOException { + if (extensionRegistry == null) { + throw new java.lang.NullPointerException(); + } + try { + boolean done = false; + while (!done) { + int tag = input.readTag(); + switch (tag) { + case 0: + done = true; + break; + case 8: { + relativeTimestamp_ = input.readInt64(); + bitField0_ |= 0x00000001; + break; + } // case 8 + case 16: { + mac_ = input.readInt64(); + bitField0_ |= 0x00000002; + break; + } // case 16 + case 24: { + rssi_ = input.readInt32(); + bitField0_ |= 0x00000004; + break; + } // case 24 + case 34: { + input.readMessage( + getPositionFieldBuilder().getBuilder(), + extensionRegistry); + bitField0_ |= 0x00000008; + break; + } // case 34 + default: { + if (!super.parseUnknownField(input, extensionRegistry, tag)) { + done = true; // was an endgroup tag + } + break; + } // default: + } // switch (tag) + } // while (!done) + } catch (com.google.protobuf.InvalidProtocolBufferException e) { + throw e.unwrapIOException(); + } finally { + onChanged(); + } // finally + return this; + } + private int bitField0_; + + private long relativeTimestamp_ ; + /** + * int64 relative_timestamp = 1; + * @return The relativeTimestamp. + */ + @java.lang.Override + public long getRelativeTimestamp() { + return relativeTimestamp_; + } + /** + * int64 relative_timestamp = 1; + * @param value The relativeTimestamp to set. + * @return This builder for chaining. + */ + public Builder setRelativeTimestamp(long value) { + + relativeTimestamp_ = value; + bitField0_ |= 0x00000001; + onChanged(); + return this; + } + /** + * int64 relative_timestamp = 1; + * @return This builder for chaining. + */ + public Builder clearRelativeTimestamp() { + bitField0_ = (bitField0_ & ~0x00000001); + relativeTimestamp_ = 0L; + onChanged(); + return this; + } + + private long mac_ ; + /** + *
+       * Integer encoding of the hex mac address (BSSID)
+       * e.g. 207394925843984
+       * 
+ * + * int64 mac = 2; + * @return The mac. + */ + @java.lang.Override + public long getMac() { + return mac_; + } + /** + *
+       * Integer encoding of the hex mac address (BSSID)
+       * e.g. 207394925843984
+       * 
+ * + * int64 mac = 2; + * @param value The mac to set. + * @return This builder for chaining. + */ + public Builder setMac(long value) { + + mac_ = value; + bitField0_ |= 0x00000002; + onChanged(); + return this; + } + /** + *
+       * Integer encoding of the hex mac address (BSSID)
+       * e.g. 207394925843984
+       * 
+ * + * int64 mac = 2; + * @return This builder for chaining. + */ + public Builder clearMac() { + bitField0_ = (bitField0_ & ~0x00000002); + mac_ = 0L; + onChanged(); + return this; + } + + private int rssi_ ; + /** + *
+       * rssi integer in dBm.
+       * typically between -120 and -10
+       * 
+ * + * int32 rssi = 3; + * @return The rssi. + */ + @java.lang.Override + public int getRssi() { + return rssi_; + } + /** + *
+       * rssi integer in dBm.
+       * typically between -120 and -10
+       * 
+ * + * int32 rssi = 3; + * @param value The rssi to set. + * @return This builder for chaining. + */ + public Builder setRssi(int value) { + + rssi_ = value; + bitField0_ |= 0x00000004; + onChanged(); + return this; + } + /** + *
+       * rssi integer in dBm.
+       * typically between -120 and -10
+       * 
+ * + * int32 rssi = 3; + * @return This builder for chaining. + */ + public Builder clearRssi() { + bitField0_ = (bitField0_ & ~0x00000004); + rssi_ = 0; + onChanged(); + return this; + } + + private com.openpositioning.PositionMe.Traj.GNSSPosition position_; + private com.google.protobuf.SingleFieldBuilder< + com.openpositioning.PositionMe.Traj.GNSSPosition, com.openpositioning.PositionMe.Traj.GNSSPosition.Builder, com.openpositioning.PositionMe.Traj.GNSSPositionOrBuilder> positionBuilder_; + /** + *
+       * returned position
+       * 
+ * + * optional .GNSSPosition position = 4; + * @return Whether the position field is set. + */ + public boolean hasPosition() { + return ((bitField0_ & 0x00000008) != 0); + } + /** + *
+       * returned position
+       * 
+ * + * optional .GNSSPosition position = 4; + * @return The position. + */ + public com.openpositioning.PositionMe.Traj.GNSSPosition getPosition() { + if (positionBuilder_ == null) { + return position_ == null ? com.openpositioning.PositionMe.Traj.GNSSPosition.getDefaultInstance() : position_; + } else { + return positionBuilder_.getMessage(); + } + } + /** + *
+       * returned position
+       * 
+ * + * optional .GNSSPosition position = 4; + */ + public Builder setPosition(com.openpositioning.PositionMe.Traj.GNSSPosition value) { + if (positionBuilder_ == null) { + if (value == null) { + throw new NullPointerException(); + } + position_ = value; + } else { + positionBuilder_.setMessage(value); + } + bitField0_ |= 0x00000008; + onChanged(); + return this; + } + /** + *
+       * returned position
+       * 
+ * + * optional .GNSSPosition position = 4; + */ + public Builder setPosition( + com.openpositioning.PositionMe.Traj.GNSSPosition.Builder builderForValue) { + if (positionBuilder_ == null) { + position_ = builderForValue.build(); + } else { + positionBuilder_.setMessage(builderForValue.build()); + } + bitField0_ |= 0x00000008; + onChanged(); + return this; + } + /** + *
+       * returned position
+       * 
+ * + * optional .GNSSPosition position = 4; + */ + public Builder mergePosition(com.openpositioning.PositionMe.Traj.GNSSPosition value) { + if (positionBuilder_ == null) { + if (((bitField0_ & 0x00000008) != 0) && + position_ != null && + position_ != com.openpositioning.PositionMe.Traj.GNSSPosition.getDefaultInstance()) { + getPositionBuilder().mergeFrom(value); + } else { + position_ = value; + } + } else { + positionBuilder_.mergeFrom(value); + } + if (position_ != null) { + bitField0_ |= 0x00000008; + onChanged(); + } + return this; + } + /** + *
+       * returned position
+       * 
+ * + * optional .GNSSPosition position = 4; + */ + public Builder clearPosition() { + bitField0_ = (bitField0_ & ~0x00000008); + position_ = null; + if (positionBuilder_ != null) { + positionBuilder_.dispose(); + positionBuilder_ = null; + } + onChanged(); + return this; + } + /** + *
+       * returned position
+       * 
+ * + * optional .GNSSPosition position = 4; + */ + public com.openpositioning.PositionMe.Traj.GNSSPosition.Builder getPositionBuilder() { + bitField0_ |= 0x00000008; + onChanged(); + return getPositionFieldBuilder().getBuilder(); + } + /** + *
+       * returned position
+       * 
+ * + * optional .GNSSPosition position = 4; + */ + public com.openpositioning.PositionMe.Traj.GNSSPositionOrBuilder getPositionOrBuilder() { + if (positionBuilder_ != null) { + return positionBuilder_.getMessageOrBuilder(); + } else { + return position_ == null ? + com.openpositioning.PositionMe.Traj.GNSSPosition.getDefaultInstance() : position_; + } + } + /** + *
+       * returned position
+       * 
+ * + * optional .GNSSPosition position = 4; + */ + private com.google.protobuf.SingleFieldBuilder< + com.openpositioning.PositionMe.Traj.GNSSPosition, com.openpositioning.PositionMe.Traj.GNSSPosition.Builder, com.openpositioning.PositionMe.Traj.GNSSPositionOrBuilder> + getPositionFieldBuilder() { + if (positionBuilder_ == null) { + positionBuilder_ = new com.google.protobuf.SingleFieldBuilder< + com.openpositioning.PositionMe.Traj.GNSSPosition, com.openpositioning.PositionMe.Traj.GNSSPosition.Builder, com.openpositioning.PositionMe.Traj.GNSSPositionOrBuilder>( + getPosition(), + getParentForChildren(), + isClean()); + position_ = null; + } + return positionBuilder_; + } + + // @@protoc_insertion_point(builder_scope:RFScan) + } + + // @@protoc_insertion_point(class_scope:RFScan) + private static final com.openpositioning.PositionMe.Traj.RFScan DEFAULT_INSTANCE; + static { + DEFAULT_INSTANCE = new com.openpositioning.PositionMe.Traj.RFScan(); + } + + public static com.openpositioning.PositionMe.Traj.RFScan getDefaultInstance() { + return DEFAULT_INSTANCE; + } + + private static final com.google.protobuf.Parser + PARSER = new com.google.protobuf.AbstractParser() { + @java.lang.Override + public RFScan parsePartialFrom( + com.google.protobuf.CodedInputStream input, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + Builder builder = newBuilder(); + try { + builder.mergeFrom(input, extensionRegistry); + } catch (com.google.protobuf.InvalidProtocolBufferException e) { + throw e.setUnfinishedMessage(builder.buildPartial()); + } catch (com.google.protobuf.UninitializedMessageException e) { + throw e.asInvalidProtocolBufferException().setUnfinishedMessage(builder.buildPartial()); + } catch (java.io.IOException e) { + throw new com.google.protobuf.InvalidProtocolBufferException(e) + .setUnfinishedMessage(builder.buildPartial()); + } + return builder.buildPartial(); + } + }; + + public static com.google.protobuf.Parser parser() { + return PARSER; + } + + @java.lang.Override + public com.google.protobuf.Parser getParserForType() { + return PARSER; + } + + @java.lang.Override + public com.openpositioning.PositionMe.Traj.RFScan getDefaultInstanceForType() { + return DEFAULT_INSTANCE; + } + + } + + public interface WiFiRTTReadingOrBuilder extends + // @@protoc_insertion_point(interface_extends:WiFiRTTReading) + com.google.protobuf.MessageOrBuilder { + + /** + * int64 relative_timestamp = 1; + * @return The relativeTimestamp. + */ + long getRelativeTimestamp(); + + /** + *
+     * Integer encoding of the hex mac address (BSSID)
+     * e.g. 207394925843984
+     * 
+ * + * int64 mac = 2; + * @return The mac. + */ + long getMac(); + + /** + *
+     * in mm
+     * 
+ * + * float distance = 3; + * @return The distance. + */ + float getDistance(); + + /** + *
+     * in mm
+     * 
+ * + * float distance_std = 4; + * @return The distanceStd. + */ + float getDistanceStd(); + + /** + *
+     * rssi integer in dBm.
+     * typically between -120 and -10
+     * 
+ * + * int32 rssi = 5; + * @return The rssi. + */ + int getRssi(); + } + /** + * Protobuf type {@code WiFiRTTReading} + */ + public static final class WiFiRTTReading extends + com.google.protobuf.GeneratedMessage implements + // @@protoc_insertion_point(message_implements:WiFiRTTReading) + WiFiRTTReadingOrBuilder { + private static final long serialVersionUID = 0L; + static { + com.google.protobuf.RuntimeVersion.validateProtobufGencodeVersion( + com.google.protobuf.RuntimeVersion.RuntimeDomain.PUBLIC, + /* major= */ 4, + /* minor= */ 29, + /* patch= */ 6, + /* suffix= */ "", + WiFiRTTReading.class.getName()); + } + // Use WiFiRTTReading.newBuilder() to construct. + private WiFiRTTReading(com.google.protobuf.GeneratedMessage.Builder builder) { + super(builder); + } + private WiFiRTTReading() { + } + + public static final com.google.protobuf.Descriptors.Descriptor + getDescriptor() { + return com.openpositioning.PositionMe.Traj.internal_static_WiFiRTTReading_descriptor; + } + + @java.lang.Override + protected com.google.protobuf.GeneratedMessage.FieldAccessorTable + internalGetFieldAccessorTable() { + return com.openpositioning.PositionMe.Traj.internal_static_WiFiRTTReading_fieldAccessorTable + .ensureFieldAccessorsInitialized( + com.openpositioning.PositionMe.Traj.WiFiRTTReading.class, com.openpositioning.PositionMe.Traj.WiFiRTTReading.Builder.class); + } + + public static final int RELATIVE_TIMESTAMP_FIELD_NUMBER = 1; + private long relativeTimestamp_ = 0L; + /** + * int64 relative_timestamp = 1; + * @return The relativeTimestamp. + */ + @java.lang.Override + public long getRelativeTimestamp() { + return relativeTimestamp_; + } + + public static final int MAC_FIELD_NUMBER = 2; + private long mac_ = 0L; + /** + *
+     * Integer encoding of the hex mac address (BSSID)
+     * e.g. 207394925843984
+     * 
+ * + * int64 mac = 2; + * @return The mac. + */ + @java.lang.Override + public long getMac() { + return mac_; + } + + public static final int DISTANCE_FIELD_NUMBER = 3; + private float distance_ = 0F; + /** + *
+     * in mm
+     * 
+ * + * float distance = 3; + * @return The distance. + */ + @java.lang.Override + public float getDistance() { + return distance_; + } + + public static final int DISTANCE_STD_FIELD_NUMBER = 4; + private float distanceStd_ = 0F; + /** + *
+     * in mm
+     * 
+ * + * float distance_std = 4; + * @return The distanceStd. + */ + @java.lang.Override + public float getDistanceStd() { + return distanceStd_; + } + + public static final int RSSI_FIELD_NUMBER = 5; + private int rssi_ = 0; + /** + *
+     * rssi integer in dBm.
+     * typically between -120 and -10
+     * 
+ * + * int32 rssi = 5; + * @return The rssi. + */ + @java.lang.Override + public int getRssi() { + return rssi_; + } + + private byte memoizedIsInitialized = -1; + @java.lang.Override + public final boolean isInitialized() { + byte isInitialized = memoizedIsInitialized; + if (isInitialized == 1) return true; + if (isInitialized == 0) return false; + + memoizedIsInitialized = 1; + return true; + } + + @java.lang.Override + public void writeTo(com.google.protobuf.CodedOutputStream output) + throws java.io.IOException { + if (relativeTimestamp_ != 0L) { + output.writeInt64(1, relativeTimestamp_); + } + if (mac_ != 0L) { + output.writeInt64(2, mac_); + } + if (java.lang.Float.floatToRawIntBits(distance_) != 0) { + output.writeFloat(3, distance_); + } + if (java.lang.Float.floatToRawIntBits(distanceStd_) != 0) { + output.writeFloat(4, distanceStd_); + } + if (rssi_ != 0) { + output.writeInt32(5, rssi_); + } + getUnknownFields().writeTo(output); + } + + @java.lang.Override + public int getSerializedSize() { + int size = memoizedSize; + if (size != -1) return size; + + size = 0; + if (relativeTimestamp_ != 0L) { + size += com.google.protobuf.CodedOutputStream + .computeInt64Size(1, relativeTimestamp_); + } + if (mac_ != 0L) { + size += com.google.protobuf.CodedOutputStream + .computeInt64Size(2, mac_); + } + if (java.lang.Float.floatToRawIntBits(distance_) != 0) { + size += com.google.protobuf.CodedOutputStream + .computeFloatSize(3, distance_); + } + if (java.lang.Float.floatToRawIntBits(distanceStd_) != 0) { + size += com.google.protobuf.CodedOutputStream + .computeFloatSize(4, distanceStd_); + } + if (rssi_ != 0) { + size += com.google.protobuf.CodedOutputStream + .computeInt32Size(5, rssi_); + } + size += getUnknownFields().getSerializedSize(); + memoizedSize = size; + return size; + } + + @java.lang.Override + public boolean equals(final java.lang.Object obj) { + if (obj == this) { + return true; + } + if (!(obj instanceof com.openpositioning.PositionMe.Traj.WiFiRTTReading)) { + return super.equals(obj); + } + com.openpositioning.PositionMe.Traj.WiFiRTTReading other = (com.openpositioning.PositionMe.Traj.WiFiRTTReading) obj; + + if (getRelativeTimestamp() + != other.getRelativeTimestamp()) return false; + if (getMac() + != other.getMac()) return false; + if (java.lang.Float.floatToIntBits(getDistance()) + != java.lang.Float.floatToIntBits( + other.getDistance())) return false; + if (java.lang.Float.floatToIntBits(getDistanceStd()) + != java.lang.Float.floatToIntBits( + other.getDistanceStd())) return false; + if (getRssi() + != other.getRssi()) return false; + if (!getUnknownFields().equals(other.getUnknownFields())) return false; + return true; + } + + @java.lang.Override + public int hashCode() { + if (memoizedHashCode != 0) { + return memoizedHashCode; + } + int hash = 41; + hash = (19 * hash) + getDescriptor().hashCode(); + hash = (37 * hash) + RELATIVE_TIMESTAMP_FIELD_NUMBER; + hash = (53 * hash) + com.google.protobuf.Internal.hashLong( + getRelativeTimestamp()); + hash = (37 * hash) + MAC_FIELD_NUMBER; + hash = (53 * hash) + com.google.protobuf.Internal.hashLong( + getMac()); + hash = (37 * hash) + DISTANCE_FIELD_NUMBER; + hash = (53 * hash) + java.lang.Float.floatToIntBits( + getDistance()); + hash = (37 * hash) + DISTANCE_STD_FIELD_NUMBER; + hash = (53 * hash) + java.lang.Float.floatToIntBits( + getDistanceStd()); + hash = (37 * hash) + RSSI_FIELD_NUMBER; + hash = (53 * hash) + getRssi(); + hash = (29 * hash) + getUnknownFields().hashCode(); + memoizedHashCode = hash; + return hash; + } + + public static com.openpositioning.PositionMe.Traj.WiFiRTTReading parseFrom( + java.nio.ByteBuffer data) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + public static com.openpositioning.PositionMe.Traj.WiFiRTTReading parseFrom( + java.nio.ByteBuffer data, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data, extensionRegistry); + } + public static com.openpositioning.PositionMe.Traj.WiFiRTTReading parseFrom( + com.google.protobuf.ByteString data) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + public static com.openpositioning.PositionMe.Traj.WiFiRTTReading parseFrom( + com.google.protobuf.ByteString data, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data, extensionRegistry); + } + public static com.openpositioning.PositionMe.Traj.WiFiRTTReading parseFrom(byte[] data) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + public static com.openpositioning.PositionMe.Traj.WiFiRTTReading parseFrom( + byte[] data, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data, extensionRegistry); + } + public static com.openpositioning.PositionMe.Traj.WiFiRTTReading parseFrom(java.io.InputStream input) + throws java.io.IOException { + return com.google.protobuf.GeneratedMessage + .parseWithIOException(PARSER, input); + } + public static com.openpositioning.PositionMe.Traj.WiFiRTTReading parseFrom( + java.io.InputStream input, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws java.io.IOException { + return com.google.protobuf.GeneratedMessage + .parseWithIOException(PARSER, input, extensionRegistry); + } + + public static com.openpositioning.PositionMe.Traj.WiFiRTTReading parseDelimitedFrom(java.io.InputStream input) + throws java.io.IOException { + return com.google.protobuf.GeneratedMessage + .parseDelimitedWithIOException(PARSER, input); + } + + public static com.openpositioning.PositionMe.Traj.WiFiRTTReading parseDelimitedFrom( + java.io.InputStream input, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws java.io.IOException { + return com.google.protobuf.GeneratedMessage + .parseDelimitedWithIOException(PARSER, input, extensionRegistry); + } + public static com.openpositioning.PositionMe.Traj.WiFiRTTReading parseFrom( + com.google.protobuf.CodedInputStream input) + throws java.io.IOException { + return com.google.protobuf.GeneratedMessage + .parseWithIOException(PARSER, input); + } + public static com.openpositioning.PositionMe.Traj.WiFiRTTReading parseFrom( + com.google.protobuf.CodedInputStream input, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws java.io.IOException { + return com.google.protobuf.GeneratedMessage + .parseWithIOException(PARSER, input, extensionRegistry); + } + + @java.lang.Override + public Builder newBuilderForType() { return newBuilder(); } + public static Builder newBuilder() { + return DEFAULT_INSTANCE.toBuilder(); + } + public static Builder newBuilder(com.openpositioning.PositionMe.Traj.WiFiRTTReading prototype) { + return DEFAULT_INSTANCE.toBuilder().mergeFrom(prototype); + } + @java.lang.Override + public Builder toBuilder() { + return this == DEFAULT_INSTANCE + ? new Builder() : new Builder().mergeFrom(this); + } + + @java.lang.Override + protected Builder newBuilderForType( + com.google.protobuf.GeneratedMessage.BuilderParent parent) { + Builder builder = new Builder(parent); + return builder; + } + /** + * Protobuf type {@code WiFiRTTReading} + */ + public static final class Builder extends + com.google.protobuf.GeneratedMessage.Builder implements + // @@protoc_insertion_point(builder_implements:WiFiRTTReading) + com.openpositioning.PositionMe.Traj.WiFiRTTReadingOrBuilder { + public static final com.google.protobuf.Descriptors.Descriptor + getDescriptor() { + return com.openpositioning.PositionMe.Traj.internal_static_WiFiRTTReading_descriptor; + } + + @java.lang.Override + protected com.google.protobuf.GeneratedMessage.FieldAccessorTable + internalGetFieldAccessorTable() { + return com.openpositioning.PositionMe.Traj.internal_static_WiFiRTTReading_fieldAccessorTable + .ensureFieldAccessorsInitialized( + com.openpositioning.PositionMe.Traj.WiFiRTTReading.class, com.openpositioning.PositionMe.Traj.WiFiRTTReading.Builder.class); + } + + // Construct using com.openpositioning.PositionMe.Traj.WiFiRTTReading.newBuilder() + private Builder() { + + } + + private Builder( + com.google.protobuf.GeneratedMessage.BuilderParent parent) { + super(parent); + + } + @java.lang.Override + public Builder clear() { + super.clear(); + bitField0_ = 0; + relativeTimestamp_ = 0L; + mac_ = 0L; + distance_ = 0F; + distanceStd_ = 0F; + rssi_ = 0; + return this; + } + + @java.lang.Override + public com.google.protobuf.Descriptors.Descriptor + getDescriptorForType() { + return com.openpositioning.PositionMe.Traj.internal_static_WiFiRTTReading_descriptor; + } + + @java.lang.Override + public com.openpositioning.PositionMe.Traj.WiFiRTTReading getDefaultInstanceForType() { + return com.openpositioning.PositionMe.Traj.WiFiRTTReading.getDefaultInstance(); + } + + @java.lang.Override + public com.openpositioning.PositionMe.Traj.WiFiRTTReading build() { + com.openpositioning.PositionMe.Traj.WiFiRTTReading result = buildPartial(); + if (!result.isInitialized()) { + throw newUninitializedMessageException(result); + } + return result; + } + + @java.lang.Override + public com.openpositioning.PositionMe.Traj.WiFiRTTReading buildPartial() { + com.openpositioning.PositionMe.Traj.WiFiRTTReading result = new com.openpositioning.PositionMe.Traj.WiFiRTTReading(this); + if (bitField0_ != 0) { buildPartial0(result); } + onBuilt(); + return result; + } + + private void buildPartial0(com.openpositioning.PositionMe.Traj.WiFiRTTReading result) { + int from_bitField0_ = bitField0_; + if (((from_bitField0_ & 0x00000001) != 0)) { + result.relativeTimestamp_ = relativeTimestamp_; + } + if (((from_bitField0_ & 0x00000002) != 0)) { + result.mac_ = mac_; + } + if (((from_bitField0_ & 0x00000004) != 0)) { + result.distance_ = distance_; + } + if (((from_bitField0_ & 0x00000008) != 0)) { + result.distanceStd_ = distanceStd_; + } + if (((from_bitField0_ & 0x00000010) != 0)) { + result.rssi_ = rssi_; + } + } + + @java.lang.Override + public Builder mergeFrom(com.google.protobuf.Message other) { + if (other instanceof com.openpositioning.PositionMe.Traj.WiFiRTTReading) { + return mergeFrom((com.openpositioning.PositionMe.Traj.WiFiRTTReading)other); + } else { + super.mergeFrom(other); + return this; + } + } + + public Builder mergeFrom(com.openpositioning.PositionMe.Traj.WiFiRTTReading other) { + if (other == com.openpositioning.PositionMe.Traj.WiFiRTTReading.getDefaultInstance()) return this; + if (other.getRelativeTimestamp() != 0L) { + setRelativeTimestamp(other.getRelativeTimestamp()); + } + if (other.getMac() != 0L) { + setMac(other.getMac()); + } + if (other.getDistance() != 0F) { + setDistance(other.getDistance()); + } + if (other.getDistanceStd() != 0F) { + setDistanceStd(other.getDistanceStd()); + } + if (other.getRssi() != 0) { + setRssi(other.getRssi()); + } + this.mergeUnknownFields(other.getUnknownFields()); + onChanged(); + return this; + } + + @java.lang.Override + public final boolean isInitialized() { + return true; + } + + @java.lang.Override + public Builder mergeFrom( + com.google.protobuf.CodedInputStream input, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws java.io.IOException { + if (extensionRegistry == null) { + throw new java.lang.NullPointerException(); + } + try { + boolean done = false; + while (!done) { + int tag = input.readTag(); + switch (tag) { + case 0: + done = true; + break; + case 8: { + relativeTimestamp_ = input.readInt64(); + bitField0_ |= 0x00000001; + break; + } // case 8 + case 16: { + mac_ = input.readInt64(); + bitField0_ |= 0x00000002; + break; + } // case 16 + case 29: { + distance_ = input.readFloat(); + bitField0_ |= 0x00000004; + break; + } // case 29 + case 37: { + distanceStd_ = input.readFloat(); + bitField0_ |= 0x00000008; + break; + } // case 37 + case 40: { + rssi_ = input.readInt32(); + bitField0_ |= 0x00000010; + break; + } // case 40 + default: { + if (!super.parseUnknownField(input, extensionRegistry, tag)) { + done = true; // was an endgroup tag + } + break; + } // default: + } // switch (tag) + } // while (!done) + } catch (com.google.protobuf.InvalidProtocolBufferException e) { + throw e.unwrapIOException(); + } finally { + onChanged(); + } // finally + return this; + } + private int bitField0_; + + private long relativeTimestamp_ ; + /** + * int64 relative_timestamp = 1; + * @return The relativeTimestamp. + */ + @java.lang.Override + public long getRelativeTimestamp() { + return relativeTimestamp_; + } + /** + * int64 relative_timestamp = 1; + * @param value The relativeTimestamp to set. + * @return This builder for chaining. + */ + public Builder setRelativeTimestamp(long value) { + + relativeTimestamp_ = value; + bitField0_ |= 0x00000001; + onChanged(); + return this; + } + /** + * int64 relative_timestamp = 1; + * @return This builder for chaining. + */ + public Builder clearRelativeTimestamp() { + bitField0_ = (bitField0_ & ~0x00000001); + relativeTimestamp_ = 0L; + onChanged(); + return this; + } + + private long mac_ ; + /** + *
+       * Integer encoding of the hex mac address (BSSID)
+       * e.g. 207394925843984
+       * 
+ * + * int64 mac = 2; + * @return The mac. + */ + @java.lang.Override + public long getMac() { + return mac_; + } + /** + *
+       * Integer encoding of the hex mac address (BSSID)
+       * e.g. 207394925843984
+       * 
+ * + * int64 mac = 2; + * @param value The mac to set. + * @return This builder for chaining. + */ + public Builder setMac(long value) { + + mac_ = value; + bitField0_ |= 0x00000002; + onChanged(); + return this; + } + /** + *
+       * Integer encoding of the hex mac address (BSSID)
+       * e.g. 207394925843984
+       * 
+ * + * int64 mac = 2; + * @return This builder for chaining. + */ + public Builder clearMac() { + bitField0_ = (bitField0_ & ~0x00000002); + mac_ = 0L; + onChanged(); + return this; + } + + private float distance_ ; + /** + *
+       * in mm
+       * 
+ * + * float distance = 3; + * @return The distance. + */ + @java.lang.Override + public float getDistance() { + return distance_; + } + /** + *
+       * in mm
+       * 
+ * + * float distance = 3; + * @param value The distance to set. + * @return This builder for chaining. + */ + public Builder setDistance(float value) { + + distance_ = value; + bitField0_ |= 0x00000004; + onChanged(); + return this; + } + /** + *
+       * in mm
+       * 
+ * + * float distance = 3; + * @return This builder for chaining. + */ + public Builder clearDistance() { + bitField0_ = (bitField0_ & ~0x00000004); + distance_ = 0F; + onChanged(); + return this; + } + + private float distanceStd_ ; + /** + *
+       * in mm
+       * 
+ * + * float distance_std = 4; + * @return The distanceStd. + */ + @java.lang.Override + public float getDistanceStd() { + return distanceStd_; + } + /** + *
+       * in mm
+       * 
+ * + * float distance_std = 4; + * @param value The distanceStd to set. + * @return This builder for chaining. + */ + public Builder setDistanceStd(float value) { + + distanceStd_ = value; + bitField0_ |= 0x00000008; + onChanged(); + return this; + } + /** + *
+       * in mm
+       * 
+ * + * float distance_std = 4; + * @return This builder for chaining. + */ + public Builder clearDistanceStd() { + bitField0_ = (bitField0_ & ~0x00000008); + distanceStd_ = 0F; + onChanged(); + return this; + } + + private int rssi_ ; + /** + *
+       * rssi integer in dBm.
+       * typically between -120 and -10
+       * 
+ * + * int32 rssi = 5; + * @return The rssi. + */ + @java.lang.Override + public int getRssi() { + return rssi_; + } + /** + *
+       * rssi integer in dBm.
+       * typically between -120 and -10
+       * 
+ * + * int32 rssi = 5; + * @param value The rssi to set. + * @return This builder for chaining. + */ + public Builder setRssi(int value) { + + rssi_ = value; + bitField0_ |= 0x00000010; + onChanged(); + return this; + } + /** + *
+       * rssi integer in dBm.
+       * typically between -120 and -10
+       * 
+ * + * int32 rssi = 5; + * @return This builder for chaining. + */ + public Builder clearRssi() { + bitField0_ = (bitField0_ & ~0x00000010); + rssi_ = 0; + onChanged(); + return this; + } + + // @@protoc_insertion_point(builder_scope:WiFiRTTReading) + } + + // @@protoc_insertion_point(class_scope:WiFiRTTReading) + private static final com.openpositioning.PositionMe.Traj.WiFiRTTReading DEFAULT_INSTANCE; + static { + DEFAULT_INSTANCE = new com.openpositioning.PositionMe.Traj.WiFiRTTReading(); + } + + public static com.openpositioning.PositionMe.Traj.WiFiRTTReading getDefaultInstance() { + return DEFAULT_INSTANCE; + } + + private static final com.google.protobuf.Parser + PARSER = new com.google.protobuf.AbstractParser() { + @java.lang.Override + public WiFiRTTReading parsePartialFrom( + com.google.protobuf.CodedInputStream input, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + Builder builder = newBuilder(); + try { + builder.mergeFrom(input, extensionRegistry); + } catch (com.google.protobuf.InvalidProtocolBufferException e) { + throw e.setUnfinishedMessage(builder.buildPartial()); + } catch (com.google.protobuf.UninitializedMessageException e) { + throw e.asInvalidProtocolBufferException().setUnfinishedMessage(builder.buildPartial()); + } catch (java.io.IOException e) { + throw new com.google.protobuf.InvalidProtocolBufferException(e) + .setUnfinishedMessage(builder.buildPartial()); + } + return builder.buildPartial(); + } + }; + + public static com.google.protobuf.Parser parser() { + return PARSER; + } + + @java.lang.Override + public com.google.protobuf.Parser getParserForType() { + return PARSER; + } + + @java.lang.Override + public com.openpositioning.PositionMe.Traj.WiFiRTTReading getDefaultInstanceForType() { + return DEFAULT_INSTANCE; + } + + } + + public interface WiFiAPDataOrBuilder extends + // @@protoc_insertion_point(interface_extends:WiFiAPData) + com.google.protobuf.MessageOrBuilder { + + /** + *
+     * Integer encoding of the hex mac address (BSSID)
+     * e.g. 207394925843984
+     * 
+ * + * int64 mac = 1; + * @return The mac. + */ + long getMac(); + + /** + *
+     * E.g. 'Eduroam' or 'Starbucks_free_wifi'
+     * 
+ * + * string ssid = 2; + * @return The ssid. + */ + java.lang.String getSsid(); + /** + *
+     * E.g. 'Eduroam' or 'Starbucks_free_wifi'
+     * 
+ * + * string ssid = 2; + * @return The bytes for ssid. + */ + com.google.protobuf.ByteString + getSsidBytes(); + + /** + *
+     * Typically 2.4GHz or 5GHz
+     * 
+ * + * int64 frequency = 3; + * @return The frequency. + */ + long getFrequency(); + + /** + *
+     * Flag to indicate if the AP supports RTT measurements
+     * 
+ * + * bool rtt_enabled = 4; + * @return The rttEnabled. + */ + boolean getRttEnabled(); + } + /** + * Protobuf type {@code WiFiAPData} + */ + public static final class WiFiAPData extends + com.google.protobuf.GeneratedMessage implements + // @@protoc_insertion_point(message_implements:WiFiAPData) + WiFiAPDataOrBuilder { + private static final long serialVersionUID = 0L; + static { + com.google.protobuf.RuntimeVersion.validateProtobufGencodeVersion( + com.google.protobuf.RuntimeVersion.RuntimeDomain.PUBLIC, + /* major= */ 4, + /* minor= */ 29, + /* patch= */ 6, + /* suffix= */ "", + WiFiAPData.class.getName()); + } + // Use WiFiAPData.newBuilder() to construct. + private WiFiAPData(com.google.protobuf.GeneratedMessage.Builder builder) { + super(builder); + } + private WiFiAPData() { + ssid_ = ""; + } + + public static final com.google.protobuf.Descriptors.Descriptor + getDescriptor() { + return com.openpositioning.PositionMe.Traj.internal_static_WiFiAPData_descriptor; + } + + @java.lang.Override + protected com.google.protobuf.GeneratedMessage.FieldAccessorTable + internalGetFieldAccessorTable() { + return com.openpositioning.PositionMe.Traj.internal_static_WiFiAPData_fieldAccessorTable + .ensureFieldAccessorsInitialized( + com.openpositioning.PositionMe.Traj.WiFiAPData.class, com.openpositioning.PositionMe.Traj.WiFiAPData.Builder.class); + } + + public static final int MAC_FIELD_NUMBER = 1; + private long mac_ = 0L; + /** + *
+     * Integer encoding of the hex mac address (BSSID)
+     * e.g. 207394925843984
+     * 
+ * + * int64 mac = 1; + * @return The mac. + */ + @java.lang.Override + public long getMac() { + return mac_; + } + + public static final int SSID_FIELD_NUMBER = 2; + @SuppressWarnings("serial") + private volatile java.lang.Object ssid_ = ""; + /** + *
+     * E.g. 'Eduroam' or 'Starbucks_free_wifi'
+     * 
+ * + * string ssid = 2; + * @return The ssid. + */ + @java.lang.Override + public java.lang.String getSsid() { + java.lang.Object ref = ssid_; + if (ref instanceof java.lang.String) { + return (java.lang.String) ref; + } else { + com.google.protobuf.ByteString bs = + (com.google.protobuf.ByteString) ref; + java.lang.String s = bs.toStringUtf8(); + ssid_ = s; + return s; + } + } + /** + *
+     * E.g. 'Eduroam' or 'Starbucks_free_wifi'
+     * 
+ * + * string ssid = 2; + * @return The bytes for ssid. + */ + @java.lang.Override + public com.google.protobuf.ByteString + getSsidBytes() { + java.lang.Object ref = ssid_; + if (ref instanceof java.lang.String) { + com.google.protobuf.ByteString b = + com.google.protobuf.ByteString.copyFromUtf8( + (java.lang.String) ref); + ssid_ = b; + return b; + } else { + return (com.google.protobuf.ByteString) ref; + } + } + + public static final int FREQUENCY_FIELD_NUMBER = 3; + private long frequency_ = 0L; + /** + *
+     * Typically 2.4GHz or 5GHz
+     * 
+ * + * int64 frequency = 3; + * @return The frequency. + */ + @java.lang.Override + public long getFrequency() { + return frequency_; + } + + public static final int RTT_ENABLED_FIELD_NUMBER = 4; + private boolean rttEnabled_ = false; + /** + *
+     * Flag to indicate if the AP supports RTT measurements
+     * 
+ * + * bool rtt_enabled = 4; + * @return The rttEnabled. + */ + @java.lang.Override + public boolean getRttEnabled() { + return rttEnabled_; + } + + private byte memoizedIsInitialized = -1; + @java.lang.Override + public final boolean isInitialized() { + byte isInitialized = memoizedIsInitialized; + if (isInitialized == 1) return true; + if (isInitialized == 0) return false; + + memoizedIsInitialized = 1; + return true; + } + + @java.lang.Override + public void writeTo(com.google.protobuf.CodedOutputStream output) + throws java.io.IOException { + if (mac_ != 0L) { + output.writeInt64(1, mac_); + } + if (!com.google.protobuf.GeneratedMessage.isStringEmpty(ssid_)) { + com.google.protobuf.GeneratedMessage.writeString(output, 2, ssid_); + } + if (frequency_ != 0L) { + output.writeInt64(3, frequency_); + } + if (rttEnabled_ != false) { + output.writeBool(4, rttEnabled_); + } + getUnknownFields().writeTo(output); + } + + @java.lang.Override + public int getSerializedSize() { + int size = memoizedSize; + if (size != -1) return size; + + size = 0; + if (mac_ != 0L) { + size += com.google.protobuf.CodedOutputStream + .computeInt64Size(1, mac_); + } + if (!com.google.protobuf.GeneratedMessage.isStringEmpty(ssid_)) { + size += com.google.protobuf.GeneratedMessage.computeStringSize(2, ssid_); + } + if (frequency_ != 0L) { + size += com.google.protobuf.CodedOutputStream + .computeInt64Size(3, frequency_); + } + if (rttEnabled_ != false) { + size += com.google.protobuf.CodedOutputStream + .computeBoolSize(4, rttEnabled_); + } + size += getUnknownFields().getSerializedSize(); + memoizedSize = size; + return size; + } + + @java.lang.Override + public boolean equals(final java.lang.Object obj) { + if (obj == this) { + return true; + } + if (!(obj instanceof com.openpositioning.PositionMe.Traj.WiFiAPData)) { + return super.equals(obj); + } + com.openpositioning.PositionMe.Traj.WiFiAPData other = (com.openpositioning.PositionMe.Traj.WiFiAPData) obj; + + if (getMac() + != other.getMac()) return false; + if (!getSsid() + .equals(other.getSsid())) return false; + if (getFrequency() + != other.getFrequency()) return false; + if (getRttEnabled() + != other.getRttEnabled()) return false; + if (!getUnknownFields().equals(other.getUnknownFields())) return false; + return true; + } + + @java.lang.Override + public int hashCode() { + if (memoizedHashCode != 0) { + return memoizedHashCode; + } + int hash = 41; + hash = (19 * hash) + getDescriptor().hashCode(); + hash = (37 * hash) + MAC_FIELD_NUMBER; + hash = (53 * hash) + com.google.protobuf.Internal.hashLong( + getMac()); + hash = (37 * hash) + SSID_FIELD_NUMBER; + hash = (53 * hash) + getSsid().hashCode(); + hash = (37 * hash) + FREQUENCY_FIELD_NUMBER; + hash = (53 * hash) + com.google.protobuf.Internal.hashLong( + getFrequency()); + hash = (37 * hash) + RTT_ENABLED_FIELD_NUMBER; + hash = (53 * hash) + com.google.protobuf.Internal.hashBoolean( + getRttEnabled()); + hash = (29 * hash) + getUnknownFields().hashCode(); + memoizedHashCode = hash; + return hash; + } + + public static com.openpositioning.PositionMe.Traj.WiFiAPData parseFrom( + java.nio.ByteBuffer data) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + public static com.openpositioning.PositionMe.Traj.WiFiAPData parseFrom( + java.nio.ByteBuffer data, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data, extensionRegistry); + } + public static com.openpositioning.PositionMe.Traj.WiFiAPData parseFrom( + com.google.protobuf.ByteString data) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + public static com.openpositioning.PositionMe.Traj.WiFiAPData parseFrom( + com.google.protobuf.ByteString data, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data, extensionRegistry); + } + public static com.openpositioning.PositionMe.Traj.WiFiAPData parseFrom(byte[] data) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + public static com.openpositioning.PositionMe.Traj.WiFiAPData parseFrom( + byte[] data, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data, extensionRegistry); + } + public static com.openpositioning.PositionMe.Traj.WiFiAPData parseFrom(java.io.InputStream input) + throws java.io.IOException { + return com.google.protobuf.GeneratedMessage + .parseWithIOException(PARSER, input); + } + public static com.openpositioning.PositionMe.Traj.WiFiAPData parseFrom( + java.io.InputStream input, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws java.io.IOException { + return com.google.protobuf.GeneratedMessage + .parseWithIOException(PARSER, input, extensionRegistry); + } + + public static com.openpositioning.PositionMe.Traj.WiFiAPData parseDelimitedFrom(java.io.InputStream input) + throws java.io.IOException { + return com.google.protobuf.GeneratedMessage + .parseDelimitedWithIOException(PARSER, input); + } + + public static com.openpositioning.PositionMe.Traj.WiFiAPData parseDelimitedFrom( + java.io.InputStream input, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws java.io.IOException { + return com.google.protobuf.GeneratedMessage + .parseDelimitedWithIOException(PARSER, input, extensionRegistry); + } + public static com.openpositioning.PositionMe.Traj.WiFiAPData parseFrom( + com.google.protobuf.CodedInputStream input) + throws java.io.IOException { + return com.google.protobuf.GeneratedMessage + .parseWithIOException(PARSER, input); + } + public static com.openpositioning.PositionMe.Traj.WiFiAPData parseFrom( + com.google.protobuf.CodedInputStream input, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws java.io.IOException { + return com.google.protobuf.GeneratedMessage + .parseWithIOException(PARSER, input, extensionRegistry); + } + + @java.lang.Override + public Builder newBuilderForType() { return newBuilder(); } + public static Builder newBuilder() { + return DEFAULT_INSTANCE.toBuilder(); + } + public static Builder newBuilder(com.openpositioning.PositionMe.Traj.WiFiAPData prototype) { + return DEFAULT_INSTANCE.toBuilder().mergeFrom(prototype); + } + @java.lang.Override + public Builder toBuilder() { + return this == DEFAULT_INSTANCE + ? new Builder() : new Builder().mergeFrom(this); + } + + @java.lang.Override + protected Builder newBuilderForType( + com.google.protobuf.GeneratedMessage.BuilderParent parent) { + Builder builder = new Builder(parent); + return builder; + } + /** + * Protobuf type {@code WiFiAPData} + */ + public static final class Builder extends + com.google.protobuf.GeneratedMessage.Builder implements + // @@protoc_insertion_point(builder_implements:WiFiAPData) + com.openpositioning.PositionMe.Traj.WiFiAPDataOrBuilder { + public static final com.google.protobuf.Descriptors.Descriptor + getDescriptor() { + return com.openpositioning.PositionMe.Traj.internal_static_WiFiAPData_descriptor; + } + + @java.lang.Override + protected com.google.protobuf.GeneratedMessage.FieldAccessorTable + internalGetFieldAccessorTable() { + return com.openpositioning.PositionMe.Traj.internal_static_WiFiAPData_fieldAccessorTable + .ensureFieldAccessorsInitialized( + com.openpositioning.PositionMe.Traj.WiFiAPData.class, com.openpositioning.PositionMe.Traj.WiFiAPData.Builder.class); + } + + // Construct using com.openpositioning.PositionMe.Traj.WiFiAPData.newBuilder() + private Builder() { + + } + + private Builder( + com.google.protobuf.GeneratedMessage.BuilderParent parent) { + super(parent); + + } + @java.lang.Override + public Builder clear() { + super.clear(); + bitField0_ = 0; + mac_ = 0L; + ssid_ = ""; + frequency_ = 0L; + rttEnabled_ = false; + return this; + } + + @java.lang.Override + public com.google.protobuf.Descriptors.Descriptor + getDescriptorForType() { + return com.openpositioning.PositionMe.Traj.internal_static_WiFiAPData_descriptor; + } + + @java.lang.Override + public com.openpositioning.PositionMe.Traj.WiFiAPData getDefaultInstanceForType() { + return com.openpositioning.PositionMe.Traj.WiFiAPData.getDefaultInstance(); + } + + @java.lang.Override + public com.openpositioning.PositionMe.Traj.WiFiAPData build() { + com.openpositioning.PositionMe.Traj.WiFiAPData result = buildPartial(); + if (!result.isInitialized()) { + throw newUninitializedMessageException(result); + } + return result; + } + + @java.lang.Override + public com.openpositioning.PositionMe.Traj.WiFiAPData buildPartial() { + com.openpositioning.PositionMe.Traj.WiFiAPData result = new com.openpositioning.PositionMe.Traj.WiFiAPData(this); + if (bitField0_ != 0) { buildPartial0(result); } + onBuilt(); + return result; + } + + private void buildPartial0(com.openpositioning.PositionMe.Traj.WiFiAPData result) { + int from_bitField0_ = bitField0_; + if (((from_bitField0_ & 0x00000001) != 0)) { + result.mac_ = mac_; + } + if (((from_bitField0_ & 0x00000002) != 0)) { + result.ssid_ = ssid_; + } + if (((from_bitField0_ & 0x00000004) != 0)) { + result.frequency_ = frequency_; + } + if (((from_bitField0_ & 0x00000008) != 0)) { + result.rttEnabled_ = rttEnabled_; + } + } + + @java.lang.Override + public Builder mergeFrom(com.google.protobuf.Message other) { + if (other instanceof com.openpositioning.PositionMe.Traj.WiFiAPData) { + return mergeFrom((com.openpositioning.PositionMe.Traj.WiFiAPData)other); + } else { + super.mergeFrom(other); + return this; + } + } + + public Builder mergeFrom(com.openpositioning.PositionMe.Traj.WiFiAPData other) { + if (other == com.openpositioning.PositionMe.Traj.WiFiAPData.getDefaultInstance()) return this; + if (other.getMac() != 0L) { + setMac(other.getMac()); + } + if (!other.getSsid().isEmpty()) { + ssid_ = other.ssid_; + bitField0_ |= 0x00000002; + onChanged(); + } + if (other.getFrequency() != 0L) { + setFrequency(other.getFrequency()); + } + if (other.getRttEnabled() != false) { + setRttEnabled(other.getRttEnabled()); + } + this.mergeUnknownFields(other.getUnknownFields()); + onChanged(); + return this; + } + + @java.lang.Override + public final boolean isInitialized() { + return true; + } + + @java.lang.Override + public Builder mergeFrom( + com.google.protobuf.CodedInputStream input, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws java.io.IOException { + if (extensionRegistry == null) { + throw new java.lang.NullPointerException(); + } + try { + boolean done = false; + while (!done) { + int tag = input.readTag(); + switch (tag) { + case 0: + done = true; + break; + case 8: { + mac_ = input.readInt64(); + bitField0_ |= 0x00000001; + break; + } // case 8 + case 18: { + ssid_ = input.readStringRequireUtf8(); + bitField0_ |= 0x00000002; + break; + } // case 18 + case 24: { + frequency_ = input.readInt64(); + bitField0_ |= 0x00000004; + break; + } // case 24 + case 32: { + rttEnabled_ = input.readBool(); + bitField0_ |= 0x00000008; + break; + } // case 32 + default: { + if (!super.parseUnknownField(input, extensionRegistry, tag)) { + done = true; // was an endgroup tag + } + break; + } // default: + } // switch (tag) + } // while (!done) + } catch (com.google.protobuf.InvalidProtocolBufferException e) { + throw e.unwrapIOException(); + } finally { + onChanged(); + } // finally + return this; + } + private int bitField0_; + + private long mac_ ; + /** + *
+       * Integer encoding of the hex mac address (BSSID)
+       * e.g. 207394925843984
+       * 
+ * + * int64 mac = 1; + * @return The mac. + */ + @java.lang.Override + public long getMac() { + return mac_; + } + /** + *
+       * Integer encoding of the hex mac address (BSSID)
+       * e.g. 207394925843984
+       * 
+ * + * int64 mac = 1; + * @param value The mac to set. + * @return This builder for chaining. + */ + public Builder setMac(long value) { + + mac_ = value; + bitField0_ |= 0x00000001; + onChanged(); + return this; + } + /** + *
+       * Integer encoding of the hex mac address (BSSID)
+       * e.g. 207394925843984
+       * 
+ * + * int64 mac = 1; + * @return This builder for chaining. + */ + public Builder clearMac() { + bitField0_ = (bitField0_ & ~0x00000001); + mac_ = 0L; + onChanged(); + return this; + } + + private java.lang.Object ssid_ = ""; + /** + *
+       * E.g. 'Eduroam' or 'Starbucks_free_wifi'
+       * 
+ * + * string ssid = 2; + * @return The ssid. + */ + public java.lang.String getSsid() { + java.lang.Object ref = ssid_; + if (!(ref instanceof java.lang.String)) { + com.google.protobuf.ByteString bs = + (com.google.protobuf.ByteString) ref; + java.lang.String s = bs.toStringUtf8(); + ssid_ = s; + return s; + } else { + return (java.lang.String) ref; + } + } + /** + *
+       * E.g. 'Eduroam' or 'Starbucks_free_wifi'
+       * 
+ * + * string ssid = 2; + * @return The bytes for ssid. + */ + public com.google.protobuf.ByteString + getSsidBytes() { + java.lang.Object ref = ssid_; + if (ref instanceof String) { + com.google.protobuf.ByteString b = + com.google.protobuf.ByteString.copyFromUtf8( + (java.lang.String) ref); + ssid_ = b; + return b; + } else { + return (com.google.protobuf.ByteString) ref; + } + } + /** + *
+       * E.g. 'Eduroam' or 'Starbucks_free_wifi'
+       * 
+ * + * string ssid = 2; + * @param value The ssid to set. + * @return This builder for chaining. + */ + public Builder setSsid( + java.lang.String value) { + if (value == null) { throw new NullPointerException(); } + ssid_ = value; + bitField0_ |= 0x00000002; + onChanged(); + return this; + } + /** + *
+       * E.g. 'Eduroam' or 'Starbucks_free_wifi'
+       * 
+ * + * string ssid = 2; + * @return This builder for chaining. + */ + public Builder clearSsid() { + ssid_ = getDefaultInstance().getSsid(); + bitField0_ = (bitField0_ & ~0x00000002); + onChanged(); + return this; + } + /** + *
+       * E.g. 'Eduroam' or 'Starbucks_free_wifi'
+       * 
+ * + * string ssid = 2; + * @param value The bytes for ssid to set. + * @return This builder for chaining. + */ + public Builder setSsidBytes( + com.google.protobuf.ByteString value) { + if (value == null) { throw new NullPointerException(); } + checkByteStringIsUtf8(value); + ssid_ = value; + bitField0_ |= 0x00000002; + onChanged(); + return this; + } + + private long frequency_ ; + /** + *
+       * Typically 2.4GHz or 5GHz
+       * 
+ * + * int64 frequency = 3; + * @return The frequency. + */ + @java.lang.Override + public long getFrequency() { + return frequency_; + } + /** + *
+       * Typically 2.4GHz or 5GHz
+       * 
+ * + * int64 frequency = 3; + * @param value The frequency to set. + * @return This builder for chaining. + */ + public Builder setFrequency(long value) { + + frequency_ = value; + bitField0_ |= 0x00000004; + onChanged(); + return this; + } + /** + *
+       * Typically 2.4GHz or 5GHz
+       * 
+ * + * int64 frequency = 3; + * @return This builder for chaining. + */ + public Builder clearFrequency() { + bitField0_ = (bitField0_ & ~0x00000004); + frequency_ = 0L; + onChanged(); + return this; + } + + private boolean rttEnabled_ ; + /** + *
+       * Flag to indicate if the AP supports RTT measurements
+       * 
+ * + * bool rtt_enabled = 4; + * @return The rttEnabled. + */ + @java.lang.Override + public boolean getRttEnabled() { + return rttEnabled_; + } + /** + *
+       * Flag to indicate if the AP supports RTT measurements
+       * 
+ * + * bool rtt_enabled = 4; + * @param value The rttEnabled to set. + * @return This builder for chaining. + */ + public Builder setRttEnabled(boolean value) { + + rttEnabled_ = value; + bitField0_ |= 0x00000008; + onChanged(); + return this; + } + /** + *
+       * Flag to indicate if the AP supports RTT measurements
+       * 
+ * + * bool rtt_enabled = 4; + * @return This builder for chaining. + */ + public Builder clearRttEnabled() { + bitField0_ = (bitField0_ & ~0x00000008); + rttEnabled_ = false; + onChanged(); + return this; + } + + // @@protoc_insertion_point(builder_scope:WiFiAPData) + } + + // @@protoc_insertion_point(class_scope:WiFiAPData) + private static final com.openpositioning.PositionMe.Traj.WiFiAPData DEFAULT_INSTANCE; + static { + DEFAULT_INSTANCE = new com.openpositioning.PositionMe.Traj.WiFiAPData(); + } + + public static com.openpositioning.PositionMe.Traj.WiFiAPData getDefaultInstance() { + return DEFAULT_INSTANCE; + } + + private static final com.google.protobuf.Parser + PARSER = new com.google.protobuf.AbstractParser() { + @java.lang.Override + public WiFiAPData parsePartialFrom( + com.google.protobuf.CodedInputStream input, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + Builder builder = newBuilder(); + try { + builder.mergeFrom(input, extensionRegistry); + } catch (com.google.protobuf.InvalidProtocolBufferException e) { + throw e.setUnfinishedMessage(builder.buildPartial()); + } catch (com.google.protobuf.UninitializedMessageException e) { + throw e.asInvalidProtocolBufferException().setUnfinishedMessage(builder.buildPartial()); + } catch (java.io.IOException e) { + throw new com.google.protobuf.InvalidProtocolBufferException(e) + .setUnfinishedMessage(builder.buildPartial()); + } + return builder.buildPartial(); + } + }; + + public static com.google.protobuf.Parser parser() { + return PARSER; + } + + @java.lang.Override + public com.google.protobuf.Parser getParserForType() { + return PARSER; + } + + @java.lang.Override + public com.openpositioning.PositionMe.Traj.WiFiAPData getDefaultInstanceForType() { + return DEFAULT_INSTANCE; + } + + } + + public interface BleDataOrBuilder extends + // @@protoc_insertion_point(interface_extends:BleData) + com.google.protobuf.MessageOrBuilder { + + /** + * string mac_address = 1; + * @return The macAddress. + */ + java.lang.String getMacAddress(); + /** + * string mac_address = 1; + * @return The bytes for macAddress. + */ + com.google.protobuf.ByteString + getMacAddressBytes(); + + /** + * string name = 2; + * @return The name. + */ + java.lang.String getName(); + /** + * string name = 2; + * @return The bytes for name. + */ + com.google.protobuf.ByteString + getNameBytes(); + + /** + * int32 tx_power_level = 3; + * @return The txPowerLevel. + */ + int getTxPowerLevel(); + + /** + * int32 advertise_flags = 4; + * @return The advertiseFlags. + */ + int getAdvertiseFlags(); + + /** + * repeated string service_uuids = 5; + * @return A list containing the serviceUuids. + */ + java.util.List + getServiceUuidsList(); + /** + * repeated string service_uuids = 5; + * @return The count of serviceUuids. + */ + int getServiceUuidsCount(); + /** + * repeated string service_uuids = 5; + * @param index The index of the element to return. + * @return The serviceUuids at the given index. + */ + java.lang.String getServiceUuids(int index); + /** + * repeated string service_uuids = 5; + * @param index The index of the value to return. + * @return The bytes of the serviceUuids at the given index. + */ + com.google.protobuf.ByteString + getServiceUuidsBytes(int index); + + /** + * bytes manufacturer_data = 6; + * @return The manufacturerData. + */ + com.google.protobuf.ByteString getManufacturerData(); + } + /** + * Protobuf type {@code BleData} + */ + public static final class BleData extends + com.google.protobuf.GeneratedMessage implements + // @@protoc_insertion_point(message_implements:BleData) + BleDataOrBuilder { + private static final long serialVersionUID = 0L; + static { + com.google.protobuf.RuntimeVersion.validateProtobufGencodeVersion( + com.google.protobuf.RuntimeVersion.RuntimeDomain.PUBLIC, + /* major= */ 4, + /* minor= */ 29, + /* patch= */ 6, + /* suffix= */ "", + BleData.class.getName()); + } + // Use BleData.newBuilder() to construct. + private BleData(com.google.protobuf.GeneratedMessage.Builder builder) { + super(builder); + } + private BleData() { + macAddress_ = ""; + name_ = ""; + serviceUuids_ = + com.google.protobuf.LazyStringArrayList.emptyList(); + manufacturerData_ = com.google.protobuf.ByteString.EMPTY; + } + + public static final com.google.protobuf.Descriptors.Descriptor + getDescriptor() { + return com.openpositioning.PositionMe.Traj.internal_static_BleData_descriptor; + } + + @java.lang.Override + protected com.google.protobuf.GeneratedMessage.FieldAccessorTable + internalGetFieldAccessorTable() { + return com.openpositioning.PositionMe.Traj.internal_static_BleData_fieldAccessorTable + .ensureFieldAccessorsInitialized( + com.openpositioning.PositionMe.Traj.BleData.class, com.openpositioning.PositionMe.Traj.BleData.Builder.class); + } + + public static final int MAC_ADDRESS_FIELD_NUMBER = 1; + @SuppressWarnings("serial") + private volatile java.lang.Object macAddress_ = ""; + /** + * string mac_address = 1; + * @return The macAddress. + */ + @java.lang.Override + public java.lang.String getMacAddress() { + java.lang.Object ref = macAddress_; + if (ref instanceof java.lang.String) { + return (java.lang.String) ref; + } else { + com.google.protobuf.ByteString bs = + (com.google.protobuf.ByteString) ref; + java.lang.String s = bs.toStringUtf8(); + macAddress_ = s; + return s; + } + } + /** + * string mac_address = 1; + * @return The bytes for macAddress. + */ + @java.lang.Override + public com.google.protobuf.ByteString + getMacAddressBytes() { + java.lang.Object ref = macAddress_; + if (ref instanceof java.lang.String) { + com.google.protobuf.ByteString b = + com.google.protobuf.ByteString.copyFromUtf8( + (java.lang.String) ref); + macAddress_ = b; + return b; + } else { + return (com.google.protobuf.ByteString) ref; + } + } + + public static final int NAME_FIELD_NUMBER = 2; + @SuppressWarnings("serial") + private volatile java.lang.Object name_ = ""; + /** + * string name = 2; + * @return The name. + */ + @java.lang.Override + public java.lang.String getName() { + java.lang.Object ref = name_; + if (ref instanceof java.lang.String) { + return (java.lang.String) ref; + } else { + com.google.protobuf.ByteString bs = + (com.google.protobuf.ByteString) ref; + java.lang.String s = bs.toStringUtf8(); + name_ = s; + return s; + } + } + /** + * string name = 2; + * @return The bytes for name. + */ + @java.lang.Override + public com.google.protobuf.ByteString + getNameBytes() { + java.lang.Object ref = name_; + if (ref instanceof java.lang.String) { + com.google.protobuf.ByteString b = + com.google.protobuf.ByteString.copyFromUtf8( + (java.lang.String) ref); + name_ = b; + return b; + } else { + return (com.google.protobuf.ByteString) ref; + } + } + + public static final int TX_POWER_LEVEL_FIELD_NUMBER = 3; + private int txPowerLevel_ = 0; + /** + * int32 tx_power_level = 3; + * @return The txPowerLevel. + */ + @java.lang.Override + public int getTxPowerLevel() { + return txPowerLevel_; + } + + public static final int ADVERTISE_FLAGS_FIELD_NUMBER = 4; + private int advertiseFlags_ = 0; + /** + * int32 advertise_flags = 4; + * @return The advertiseFlags. + */ + @java.lang.Override + public int getAdvertiseFlags() { + return advertiseFlags_; + } + + public static final int SERVICE_UUIDS_FIELD_NUMBER = 5; + @SuppressWarnings("serial") + private com.google.protobuf.LazyStringArrayList serviceUuids_ = + com.google.protobuf.LazyStringArrayList.emptyList(); + /** + * repeated string service_uuids = 5; + * @return A list containing the serviceUuids. + */ + public com.google.protobuf.ProtocolStringList + getServiceUuidsList() { + return serviceUuids_; + } + /** + * repeated string service_uuids = 5; + * @return The count of serviceUuids. + */ + public int getServiceUuidsCount() { + return serviceUuids_.size(); + } + /** + * repeated string service_uuids = 5; + * @param index The index of the element to return. + * @return The serviceUuids at the given index. + */ + public java.lang.String getServiceUuids(int index) { + return serviceUuids_.get(index); + } + /** + * repeated string service_uuids = 5; + * @param index The index of the value to return. + * @return The bytes of the serviceUuids at the given index. + */ + public com.google.protobuf.ByteString + getServiceUuidsBytes(int index) { + return serviceUuids_.getByteString(index); + } + + public static final int MANUFACTURER_DATA_FIELD_NUMBER = 6; + private com.google.protobuf.ByteString manufacturerData_ = com.google.protobuf.ByteString.EMPTY; + /** + * bytes manufacturer_data = 6; + * @return The manufacturerData. + */ + @java.lang.Override + public com.google.protobuf.ByteString getManufacturerData() { + return manufacturerData_; + } + + private byte memoizedIsInitialized = -1; + @java.lang.Override + public final boolean isInitialized() { + byte isInitialized = memoizedIsInitialized; + if (isInitialized == 1) return true; + if (isInitialized == 0) return false; + + memoizedIsInitialized = 1; + return true; + } + + @java.lang.Override + public void writeTo(com.google.protobuf.CodedOutputStream output) + throws java.io.IOException { + if (!com.google.protobuf.GeneratedMessage.isStringEmpty(macAddress_)) { + com.google.protobuf.GeneratedMessage.writeString(output, 1, macAddress_); + } + if (!com.google.protobuf.GeneratedMessage.isStringEmpty(name_)) { + com.google.protobuf.GeneratedMessage.writeString(output, 2, name_); + } + if (txPowerLevel_ != 0) { + output.writeInt32(3, txPowerLevel_); + } + if (advertiseFlags_ != 0) { + output.writeInt32(4, advertiseFlags_); + } + for (int i = 0; i < serviceUuids_.size(); i++) { + com.google.protobuf.GeneratedMessage.writeString(output, 5, serviceUuids_.getRaw(i)); + } + if (!manufacturerData_.isEmpty()) { + output.writeBytes(6, manufacturerData_); + } + getUnknownFields().writeTo(output); + } + + @java.lang.Override + public int getSerializedSize() { + int size = memoizedSize; + if (size != -1) return size; + + size = 0; + if (!com.google.protobuf.GeneratedMessage.isStringEmpty(macAddress_)) { + size += com.google.protobuf.GeneratedMessage.computeStringSize(1, macAddress_); + } + if (!com.google.protobuf.GeneratedMessage.isStringEmpty(name_)) { + size += com.google.protobuf.GeneratedMessage.computeStringSize(2, name_); + } + if (txPowerLevel_ != 0) { + size += com.google.protobuf.CodedOutputStream + .computeInt32Size(3, txPowerLevel_); + } + if (advertiseFlags_ != 0) { + size += com.google.protobuf.CodedOutputStream + .computeInt32Size(4, advertiseFlags_); + } + { + int dataSize = 0; + for (int i = 0; i < serviceUuids_.size(); i++) { + dataSize += computeStringSizeNoTag(serviceUuids_.getRaw(i)); + } + size += dataSize; + size += 1 * getServiceUuidsList().size(); + } + if (!manufacturerData_.isEmpty()) { + size += com.google.protobuf.CodedOutputStream + .computeBytesSize(6, manufacturerData_); + } + size += getUnknownFields().getSerializedSize(); + memoizedSize = size; + return size; + } + + @java.lang.Override + public boolean equals(final java.lang.Object obj) { + if (obj == this) { + return true; + } + if (!(obj instanceof com.openpositioning.PositionMe.Traj.BleData)) { + return super.equals(obj); + } + com.openpositioning.PositionMe.Traj.BleData other = (com.openpositioning.PositionMe.Traj.BleData) obj; + + if (!getMacAddress() + .equals(other.getMacAddress())) return false; + if (!getName() + .equals(other.getName())) return false; + if (getTxPowerLevel() + != other.getTxPowerLevel()) return false; + if (getAdvertiseFlags() + != other.getAdvertiseFlags()) return false; + if (!getServiceUuidsList() + .equals(other.getServiceUuidsList())) return false; + if (!getManufacturerData() + .equals(other.getManufacturerData())) return false; + if (!getUnknownFields().equals(other.getUnknownFields())) return false; + return true; + } + + @java.lang.Override + public int hashCode() { + if (memoizedHashCode != 0) { + return memoizedHashCode; + } + int hash = 41; + hash = (19 * hash) + getDescriptor().hashCode(); + hash = (37 * hash) + MAC_ADDRESS_FIELD_NUMBER; + hash = (53 * hash) + getMacAddress().hashCode(); + hash = (37 * hash) + NAME_FIELD_NUMBER; + hash = (53 * hash) + getName().hashCode(); + hash = (37 * hash) + TX_POWER_LEVEL_FIELD_NUMBER; + hash = (53 * hash) + getTxPowerLevel(); + hash = (37 * hash) + ADVERTISE_FLAGS_FIELD_NUMBER; + hash = (53 * hash) + getAdvertiseFlags(); + if (getServiceUuidsCount() > 0) { + hash = (37 * hash) + SERVICE_UUIDS_FIELD_NUMBER; + hash = (53 * hash) + getServiceUuidsList().hashCode(); + } + hash = (37 * hash) + MANUFACTURER_DATA_FIELD_NUMBER; + hash = (53 * hash) + getManufacturerData().hashCode(); + hash = (29 * hash) + getUnknownFields().hashCode(); + memoizedHashCode = hash; + return hash; + } + + public static com.openpositioning.PositionMe.Traj.BleData parseFrom( + java.nio.ByteBuffer data) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + public static com.openpositioning.PositionMe.Traj.BleData parseFrom( + java.nio.ByteBuffer data, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data, extensionRegistry); + } + public static com.openpositioning.PositionMe.Traj.BleData parseFrom( + com.google.protobuf.ByteString data) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + public static com.openpositioning.PositionMe.Traj.BleData parseFrom( + com.google.protobuf.ByteString data, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data, extensionRegistry); + } + public static com.openpositioning.PositionMe.Traj.BleData parseFrom(byte[] data) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + public static com.openpositioning.PositionMe.Traj.BleData parseFrom( + byte[] data, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data, extensionRegistry); + } + public static com.openpositioning.PositionMe.Traj.BleData parseFrom(java.io.InputStream input) + throws java.io.IOException { + return com.google.protobuf.GeneratedMessage + .parseWithIOException(PARSER, input); + } + public static com.openpositioning.PositionMe.Traj.BleData parseFrom( + java.io.InputStream input, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws java.io.IOException { + return com.google.protobuf.GeneratedMessage + .parseWithIOException(PARSER, input, extensionRegistry); + } + + public static com.openpositioning.PositionMe.Traj.BleData parseDelimitedFrom(java.io.InputStream input) + throws java.io.IOException { + return com.google.protobuf.GeneratedMessage + .parseDelimitedWithIOException(PARSER, input); + } + + public static com.openpositioning.PositionMe.Traj.BleData parseDelimitedFrom( + java.io.InputStream input, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws java.io.IOException { + return com.google.protobuf.GeneratedMessage + .parseDelimitedWithIOException(PARSER, input, extensionRegistry); + } + public static com.openpositioning.PositionMe.Traj.BleData parseFrom( + com.google.protobuf.CodedInputStream input) + throws java.io.IOException { + return com.google.protobuf.GeneratedMessage + .parseWithIOException(PARSER, input); + } + public static com.openpositioning.PositionMe.Traj.BleData parseFrom( + com.google.protobuf.CodedInputStream input, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws java.io.IOException { + return com.google.protobuf.GeneratedMessage + .parseWithIOException(PARSER, input, extensionRegistry); + } + + @java.lang.Override + public Builder newBuilderForType() { return newBuilder(); } + public static Builder newBuilder() { + return DEFAULT_INSTANCE.toBuilder(); + } + public static Builder newBuilder(com.openpositioning.PositionMe.Traj.BleData prototype) { + return DEFAULT_INSTANCE.toBuilder().mergeFrom(prototype); + } + @java.lang.Override + public Builder toBuilder() { + return this == DEFAULT_INSTANCE + ? new Builder() : new Builder().mergeFrom(this); + } + + @java.lang.Override + protected Builder newBuilderForType( + com.google.protobuf.GeneratedMessage.BuilderParent parent) { + Builder builder = new Builder(parent); + return builder; + } + /** + * Protobuf type {@code BleData} + */ + public static final class Builder extends + com.google.protobuf.GeneratedMessage.Builder implements + // @@protoc_insertion_point(builder_implements:BleData) + com.openpositioning.PositionMe.Traj.BleDataOrBuilder { + public static final com.google.protobuf.Descriptors.Descriptor + getDescriptor() { + return com.openpositioning.PositionMe.Traj.internal_static_BleData_descriptor; + } + + @java.lang.Override + protected com.google.protobuf.GeneratedMessage.FieldAccessorTable + internalGetFieldAccessorTable() { + return com.openpositioning.PositionMe.Traj.internal_static_BleData_fieldAccessorTable + .ensureFieldAccessorsInitialized( + com.openpositioning.PositionMe.Traj.BleData.class, com.openpositioning.PositionMe.Traj.BleData.Builder.class); + } + + // Construct using com.openpositioning.PositionMe.Traj.BleData.newBuilder() + private Builder() { + + } + + private Builder( + com.google.protobuf.GeneratedMessage.BuilderParent parent) { + super(parent); + + } + @java.lang.Override + public Builder clear() { + super.clear(); + bitField0_ = 0; + macAddress_ = ""; + name_ = ""; + txPowerLevel_ = 0; + advertiseFlags_ = 0; + serviceUuids_ = + com.google.protobuf.LazyStringArrayList.emptyList(); + manufacturerData_ = com.google.protobuf.ByteString.EMPTY; + return this; + } + + @java.lang.Override + public com.google.protobuf.Descriptors.Descriptor + getDescriptorForType() { + return com.openpositioning.PositionMe.Traj.internal_static_BleData_descriptor; + } + + @java.lang.Override + public com.openpositioning.PositionMe.Traj.BleData getDefaultInstanceForType() { + return com.openpositioning.PositionMe.Traj.BleData.getDefaultInstance(); + } + + @java.lang.Override + public com.openpositioning.PositionMe.Traj.BleData build() { + com.openpositioning.PositionMe.Traj.BleData result = buildPartial(); + if (!result.isInitialized()) { + throw newUninitializedMessageException(result); + } + return result; + } + + @java.lang.Override + public com.openpositioning.PositionMe.Traj.BleData buildPartial() { + com.openpositioning.PositionMe.Traj.BleData result = new com.openpositioning.PositionMe.Traj.BleData(this); + if (bitField0_ != 0) { buildPartial0(result); } + onBuilt(); + return result; + } + + private void buildPartial0(com.openpositioning.PositionMe.Traj.BleData result) { + int from_bitField0_ = bitField0_; + if (((from_bitField0_ & 0x00000001) != 0)) { + result.macAddress_ = macAddress_; + } + if (((from_bitField0_ & 0x00000002) != 0)) { + result.name_ = name_; + } + if (((from_bitField0_ & 0x00000004) != 0)) { + result.txPowerLevel_ = txPowerLevel_; + } + if (((from_bitField0_ & 0x00000008) != 0)) { + result.advertiseFlags_ = advertiseFlags_; + } + if (((from_bitField0_ & 0x00000010) != 0)) { + serviceUuids_.makeImmutable(); + result.serviceUuids_ = serviceUuids_; + } + if (((from_bitField0_ & 0x00000020) != 0)) { + result.manufacturerData_ = manufacturerData_; + } + } + + @java.lang.Override + public Builder mergeFrom(com.google.protobuf.Message other) { + if (other instanceof com.openpositioning.PositionMe.Traj.BleData) { + return mergeFrom((com.openpositioning.PositionMe.Traj.BleData)other); + } else { + super.mergeFrom(other); + return this; + } + } + + public Builder mergeFrom(com.openpositioning.PositionMe.Traj.BleData other) { + if (other == com.openpositioning.PositionMe.Traj.BleData.getDefaultInstance()) return this; + if (!other.getMacAddress().isEmpty()) { + macAddress_ = other.macAddress_; + bitField0_ |= 0x00000001; + onChanged(); + } + if (!other.getName().isEmpty()) { + name_ = other.name_; + bitField0_ |= 0x00000002; + onChanged(); + } + if (other.getTxPowerLevel() != 0) { + setTxPowerLevel(other.getTxPowerLevel()); + } + if (other.getAdvertiseFlags() != 0) { + setAdvertiseFlags(other.getAdvertiseFlags()); + } + if (!other.serviceUuids_.isEmpty()) { + if (serviceUuids_.isEmpty()) { + serviceUuids_ = other.serviceUuids_; + bitField0_ |= 0x00000010; + } else { + ensureServiceUuidsIsMutable(); + serviceUuids_.addAll(other.serviceUuids_); + } + onChanged(); + } + if (other.getManufacturerData() != com.google.protobuf.ByteString.EMPTY) { + setManufacturerData(other.getManufacturerData()); + } + this.mergeUnknownFields(other.getUnknownFields()); + onChanged(); + return this; + } + + @java.lang.Override + public final boolean isInitialized() { + return true; + } + + @java.lang.Override + public Builder mergeFrom( + com.google.protobuf.CodedInputStream input, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws java.io.IOException { + if (extensionRegistry == null) { + throw new java.lang.NullPointerException(); + } + try { + boolean done = false; + while (!done) { + int tag = input.readTag(); + switch (tag) { + case 0: + done = true; + break; + case 10: { + macAddress_ = input.readStringRequireUtf8(); + bitField0_ |= 0x00000001; + break; + } // case 10 + case 18: { + name_ = input.readStringRequireUtf8(); + bitField0_ |= 0x00000002; + break; + } // case 18 + case 24: { + txPowerLevel_ = input.readInt32(); + bitField0_ |= 0x00000004; + break; + } // case 24 + case 32: { + advertiseFlags_ = input.readInt32(); + bitField0_ |= 0x00000008; + break; + } // case 32 + case 42: { + java.lang.String s = input.readStringRequireUtf8(); + ensureServiceUuidsIsMutable(); + serviceUuids_.add(s); + break; + } // case 42 + case 50: { + manufacturerData_ = input.readBytes(); + bitField0_ |= 0x00000020; + break; + } // case 50 + default: { + if (!super.parseUnknownField(input, extensionRegistry, tag)) { + done = true; // was an endgroup tag + } + break; + } // default: + } // switch (tag) + } // while (!done) + } catch (com.google.protobuf.InvalidProtocolBufferException e) { + throw e.unwrapIOException(); + } finally { + onChanged(); + } // finally + return this; + } + private int bitField0_; + + private java.lang.Object macAddress_ = ""; + /** + * string mac_address = 1; + * @return The macAddress. + */ + public java.lang.String getMacAddress() { + java.lang.Object ref = macAddress_; + if (!(ref instanceof java.lang.String)) { + com.google.protobuf.ByteString bs = + (com.google.protobuf.ByteString) ref; + java.lang.String s = bs.toStringUtf8(); + macAddress_ = s; + return s; + } else { + return (java.lang.String) ref; + } + } + /** + * string mac_address = 1; + * @return The bytes for macAddress. + */ + public com.google.protobuf.ByteString + getMacAddressBytes() { + java.lang.Object ref = macAddress_; + if (ref instanceof String) { + com.google.protobuf.ByteString b = + com.google.protobuf.ByteString.copyFromUtf8( + (java.lang.String) ref); + macAddress_ = b; + return b; + } else { + return (com.google.protobuf.ByteString) ref; + } + } + /** + * string mac_address = 1; + * @param value The macAddress to set. + * @return This builder for chaining. + */ + public Builder setMacAddress( + java.lang.String value) { + if (value == null) { throw new NullPointerException(); } + macAddress_ = value; + bitField0_ |= 0x00000001; + onChanged(); + return this; + } + /** + * string mac_address = 1; + * @return This builder for chaining. + */ + public Builder clearMacAddress() { + macAddress_ = getDefaultInstance().getMacAddress(); + bitField0_ = (bitField0_ & ~0x00000001); + onChanged(); + return this; + } + /** + * string mac_address = 1; + * @param value The bytes for macAddress to set. + * @return This builder for chaining. + */ + public Builder setMacAddressBytes( + com.google.protobuf.ByteString value) { + if (value == null) { throw new NullPointerException(); } + checkByteStringIsUtf8(value); + macAddress_ = value; + bitField0_ |= 0x00000001; + onChanged(); + return this; + } + + private java.lang.Object name_ = ""; + /** + * string name = 2; + * @return The name. + */ + public java.lang.String getName() { + java.lang.Object ref = name_; + if (!(ref instanceof java.lang.String)) { + com.google.protobuf.ByteString bs = + (com.google.protobuf.ByteString) ref; + java.lang.String s = bs.toStringUtf8(); + name_ = s; + return s; + } else { + return (java.lang.String) ref; + } + } + /** + * string name = 2; + * @return The bytes for name. + */ + public com.google.protobuf.ByteString + getNameBytes() { + java.lang.Object ref = name_; + if (ref instanceof String) { + com.google.protobuf.ByteString b = + com.google.protobuf.ByteString.copyFromUtf8( + (java.lang.String) ref); + name_ = b; + return b; + } else { + return (com.google.protobuf.ByteString) ref; + } + } + /** + * string name = 2; + * @param value The name to set. + * @return This builder for chaining. + */ + public Builder setName( + java.lang.String value) { + if (value == null) { throw new NullPointerException(); } + name_ = value; + bitField0_ |= 0x00000002; + onChanged(); + return this; + } + /** + * string name = 2; + * @return This builder for chaining. + */ + public Builder clearName() { + name_ = getDefaultInstance().getName(); + bitField0_ = (bitField0_ & ~0x00000002); + onChanged(); + return this; + } + /** + * string name = 2; + * @param value The bytes for name to set. + * @return This builder for chaining. + */ + public Builder setNameBytes( + com.google.protobuf.ByteString value) { + if (value == null) { throw new NullPointerException(); } + checkByteStringIsUtf8(value); + name_ = value; + bitField0_ |= 0x00000002; + onChanged(); + return this; + } + + private int txPowerLevel_ ; + /** + * int32 tx_power_level = 3; + * @return The txPowerLevel. + */ + @java.lang.Override + public int getTxPowerLevel() { + return txPowerLevel_; + } + /** + * int32 tx_power_level = 3; + * @param value The txPowerLevel to set. + * @return This builder for chaining. + */ + public Builder setTxPowerLevel(int value) { + + txPowerLevel_ = value; + bitField0_ |= 0x00000004; + onChanged(); + return this; + } + /** + * int32 tx_power_level = 3; + * @return This builder for chaining. + */ + public Builder clearTxPowerLevel() { + bitField0_ = (bitField0_ & ~0x00000004); + txPowerLevel_ = 0; + onChanged(); + return this; + } + + private int advertiseFlags_ ; + /** + * int32 advertise_flags = 4; + * @return The advertiseFlags. + */ + @java.lang.Override + public int getAdvertiseFlags() { + return advertiseFlags_; + } + /** + * int32 advertise_flags = 4; + * @param value The advertiseFlags to set. + * @return This builder for chaining. + */ + public Builder setAdvertiseFlags(int value) { + + advertiseFlags_ = value; + bitField0_ |= 0x00000008; + onChanged(); + return this; + } + /** + * int32 advertise_flags = 4; + * @return This builder for chaining. + */ + public Builder clearAdvertiseFlags() { + bitField0_ = (bitField0_ & ~0x00000008); + advertiseFlags_ = 0; + onChanged(); + return this; + } + + private com.google.protobuf.LazyStringArrayList serviceUuids_ = + com.google.protobuf.LazyStringArrayList.emptyList(); + private void ensureServiceUuidsIsMutable() { + if (!serviceUuids_.isModifiable()) { + serviceUuids_ = new com.google.protobuf.LazyStringArrayList(serviceUuids_); + } + bitField0_ |= 0x00000010; + } + /** + * repeated string service_uuids = 5; + * @return A list containing the serviceUuids. + */ + public com.google.protobuf.ProtocolStringList + getServiceUuidsList() { + serviceUuids_.makeImmutable(); + return serviceUuids_; + } + /** + * repeated string service_uuids = 5; + * @return The count of serviceUuids. + */ + public int getServiceUuidsCount() { + return serviceUuids_.size(); + } + /** + * repeated string service_uuids = 5; + * @param index The index of the element to return. + * @return The serviceUuids at the given index. + */ + public java.lang.String getServiceUuids(int index) { + return serviceUuids_.get(index); + } + /** + * repeated string service_uuids = 5; + * @param index The index of the value to return. + * @return The bytes of the serviceUuids at the given index. + */ + public com.google.protobuf.ByteString + getServiceUuidsBytes(int index) { + return serviceUuids_.getByteString(index); + } + /** + * repeated string service_uuids = 5; + * @param index The index to set the value at. + * @param value The serviceUuids to set. + * @return This builder for chaining. + */ + public Builder setServiceUuids( + int index, java.lang.String value) { + if (value == null) { throw new NullPointerException(); } + ensureServiceUuidsIsMutable(); + serviceUuids_.set(index, value); + bitField0_ |= 0x00000010; + onChanged(); + return this; + } + /** + * repeated string service_uuids = 5; + * @param value The serviceUuids to add. + * @return This builder for chaining. + */ + public Builder addServiceUuids( + java.lang.String value) { + if (value == null) { throw new NullPointerException(); } + ensureServiceUuidsIsMutable(); + serviceUuids_.add(value); + bitField0_ |= 0x00000010; + onChanged(); + return this; + } + /** + * repeated string service_uuids = 5; + * @param values The serviceUuids to add. + * @return This builder for chaining. + */ + public Builder addAllServiceUuids( + java.lang.Iterable values) { + ensureServiceUuidsIsMutable(); + com.google.protobuf.AbstractMessageLite.Builder.addAll( + values, serviceUuids_); + bitField0_ |= 0x00000010; + onChanged(); + return this; + } + /** + * repeated string service_uuids = 5; + * @return This builder for chaining. + */ + public Builder clearServiceUuids() { + serviceUuids_ = + com.google.protobuf.LazyStringArrayList.emptyList(); + bitField0_ = (bitField0_ & ~0x00000010);; + onChanged(); + return this; + } + /** + * repeated string service_uuids = 5; + * @param value The bytes of the serviceUuids to add. + * @return This builder for chaining. + */ + public Builder addServiceUuidsBytes( + com.google.protobuf.ByteString value) { + if (value == null) { throw new NullPointerException(); } + checkByteStringIsUtf8(value); + ensureServiceUuidsIsMutable(); + serviceUuids_.add(value); + bitField0_ |= 0x00000010; + onChanged(); + return this; + } + + private com.google.protobuf.ByteString manufacturerData_ = com.google.protobuf.ByteString.EMPTY; + /** + * bytes manufacturer_data = 6; + * @return The manufacturerData. + */ + @java.lang.Override + public com.google.protobuf.ByteString getManufacturerData() { + return manufacturerData_; + } + /** + * bytes manufacturer_data = 6; + * @param value The manufacturerData to set. + * @return This builder for chaining. + */ + public Builder setManufacturerData(com.google.protobuf.ByteString value) { + if (value == null) { throw new NullPointerException(); } + manufacturerData_ = value; + bitField0_ |= 0x00000020; + onChanged(); + return this; + } + /** + * bytes manufacturer_data = 6; + * @return This builder for chaining. + */ + public Builder clearManufacturerData() { + bitField0_ = (bitField0_ & ~0x00000020); + manufacturerData_ = getDefaultInstance().getManufacturerData(); + onChanged(); + return this; + } + + // @@protoc_insertion_point(builder_scope:BleData) + } + + // @@protoc_insertion_point(class_scope:BleData) + private static final com.openpositioning.PositionMe.Traj.BleData DEFAULT_INSTANCE; + static { + DEFAULT_INSTANCE = new com.openpositioning.PositionMe.Traj.BleData(); + } + + public static com.openpositioning.PositionMe.Traj.BleData getDefaultInstance() { + return DEFAULT_INSTANCE; + } + + private static final com.google.protobuf.Parser + PARSER = new com.google.protobuf.AbstractParser() { + @java.lang.Override + public BleData parsePartialFrom( + com.google.protobuf.CodedInputStream input, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + Builder builder = newBuilder(); + try { + builder.mergeFrom(input, extensionRegistry); + } catch (com.google.protobuf.InvalidProtocolBufferException e) { + throw e.setUnfinishedMessage(builder.buildPartial()); + } catch (com.google.protobuf.UninitializedMessageException e) { + throw e.asInvalidProtocolBufferException().setUnfinishedMessage(builder.buildPartial()); + } catch (java.io.IOException e) { + throw new com.google.protobuf.InvalidProtocolBufferException(e) + .setUnfinishedMessage(builder.buildPartial()); + } + return builder.buildPartial(); + } + }; + + public static com.google.protobuf.Parser parser() { + return PARSER; + } + + @java.lang.Override + public com.google.protobuf.Parser getParserForType() { + return PARSER; + } + + @java.lang.Override + public com.openpositioning.PositionMe.Traj.BleData getDefaultInstanceForType() { + return DEFAULT_INSTANCE; + } + + } + + public interface Vector3OrBuilder extends + // @@protoc_insertion_point(interface_extends:Vector3) + com.google.protobuf.MessageOrBuilder { + + /** + * float x = 1; + * @return The x. + */ + float getX(); + + /** + * float y = 2; + * @return The y. + */ + float getY(); + + /** + * float z = 3; + * @return The z. + */ + float getZ(); + } + /** + *
+   * --- Common Types ---
+   * 
+ * + * Protobuf type {@code Vector3} + */ + public static final class Vector3 extends + com.google.protobuf.GeneratedMessage implements + // @@protoc_insertion_point(message_implements:Vector3) + Vector3OrBuilder { + private static final long serialVersionUID = 0L; + static { + com.google.protobuf.RuntimeVersion.validateProtobufGencodeVersion( + com.google.protobuf.RuntimeVersion.RuntimeDomain.PUBLIC, + /* major= */ 4, + /* minor= */ 29, + /* patch= */ 6, + /* suffix= */ "", + Vector3.class.getName()); + } + // Use Vector3.newBuilder() to construct. + private Vector3(com.google.protobuf.GeneratedMessage.Builder builder) { + super(builder); + } + private Vector3() { + } + + public static final com.google.protobuf.Descriptors.Descriptor + getDescriptor() { + return com.openpositioning.PositionMe.Traj.internal_static_Vector3_descriptor; + } + + @java.lang.Override + protected com.google.protobuf.GeneratedMessage.FieldAccessorTable + internalGetFieldAccessorTable() { + return com.openpositioning.PositionMe.Traj.internal_static_Vector3_fieldAccessorTable + .ensureFieldAccessorsInitialized( + com.openpositioning.PositionMe.Traj.Vector3.class, com.openpositioning.PositionMe.Traj.Vector3.Builder.class); + } + + public static final int X_FIELD_NUMBER = 1; + private float x_ = 0F; + /** + * float x = 1; + * @return The x. + */ + @java.lang.Override + public float getX() { + return x_; + } + + public static final int Y_FIELD_NUMBER = 2; + private float y_ = 0F; + /** + * float y = 2; + * @return The y. + */ + @java.lang.Override + public float getY() { + return y_; + } + + public static final int Z_FIELD_NUMBER = 3; + private float z_ = 0F; + /** + * float z = 3; + * @return The z. + */ + @java.lang.Override + public float getZ() { + return z_; + } + + private byte memoizedIsInitialized = -1; + @java.lang.Override + public final boolean isInitialized() { + byte isInitialized = memoizedIsInitialized; + if (isInitialized == 1) return true; + if (isInitialized == 0) return false; + + memoizedIsInitialized = 1; + return true; + } + + @java.lang.Override + public void writeTo(com.google.protobuf.CodedOutputStream output) + throws java.io.IOException { + if (java.lang.Float.floatToRawIntBits(x_) != 0) { + output.writeFloat(1, x_); + } + if (java.lang.Float.floatToRawIntBits(y_) != 0) { + output.writeFloat(2, y_); + } + if (java.lang.Float.floatToRawIntBits(z_) != 0) { + output.writeFloat(3, z_); + } + getUnknownFields().writeTo(output); + } + + @java.lang.Override + public int getSerializedSize() { + int size = memoizedSize; + if (size != -1) return size; + + size = 0; + if (java.lang.Float.floatToRawIntBits(x_) != 0) { + size += com.google.protobuf.CodedOutputStream + .computeFloatSize(1, x_); + } + if (java.lang.Float.floatToRawIntBits(y_) != 0) { + size += com.google.protobuf.CodedOutputStream + .computeFloatSize(2, y_); + } + if (java.lang.Float.floatToRawIntBits(z_) != 0) { + size += com.google.protobuf.CodedOutputStream + .computeFloatSize(3, z_); + } + size += getUnknownFields().getSerializedSize(); + memoizedSize = size; + return size; + } + + @java.lang.Override + public boolean equals(final java.lang.Object obj) { + if (obj == this) { + return true; + } + if (!(obj instanceof com.openpositioning.PositionMe.Traj.Vector3)) { + return super.equals(obj); + } + com.openpositioning.PositionMe.Traj.Vector3 other = (com.openpositioning.PositionMe.Traj.Vector3) obj; + + if (java.lang.Float.floatToIntBits(getX()) + != java.lang.Float.floatToIntBits( + other.getX())) return false; + if (java.lang.Float.floatToIntBits(getY()) + != java.lang.Float.floatToIntBits( + other.getY())) return false; + if (java.lang.Float.floatToIntBits(getZ()) + != java.lang.Float.floatToIntBits( + other.getZ())) return false; + if (!getUnknownFields().equals(other.getUnknownFields())) return false; + return true; + } + + @java.lang.Override + public int hashCode() { + if (memoizedHashCode != 0) { + return memoizedHashCode; + } + int hash = 41; + hash = (19 * hash) + getDescriptor().hashCode(); + hash = (37 * hash) + X_FIELD_NUMBER; + hash = (53 * hash) + java.lang.Float.floatToIntBits( + getX()); + hash = (37 * hash) + Y_FIELD_NUMBER; + hash = (53 * hash) + java.lang.Float.floatToIntBits( + getY()); + hash = (37 * hash) + Z_FIELD_NUMBER; + hash = (53 * hash) + java.lang.Float.floatToIntBits( + getZ()); + hash = (29 * hash) + getUnknownFields().hashCode(); + memoizedHashCode = hash; + return hash; + } + + public static com.openpositioning.PositionMe.Traj.Vector3 parseFrom( + java.nio.ByteBuffer data) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + public static com.openpositioning.PositionMe.Traj.Vector3 parseFrom( + java.nio.ByteBuffer data, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data, extensionRegistry); + } + public static com.openpositioning.PositionMe.Traj.Vector3 parseFrom( + com.google.protobuf.ByteString data) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + public static com.openpositioning.PositionMe.Traj.Vector3 parseFrom( + com.google.protobuf.ByteString data, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data, extensionRegistry); + } + public static com.openpositioning.PositionMe.Traj.Vector3 parseFrom(byte[] data) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + public static com.openpositioning.PositionMe.Traj.Vector3 parseFrom( + byte[] data, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data, extensionRegistry); + } + public static com.openpositioning.PositionMe.Traj.Vector3 parseFrom(java.io.InputStream input) + throws java.io.IOException { + return com.google.protobuf.GeneratedMessage + .parseWithIOException(PARSER, input); + } + public static com.openpositioning.PositionMe.Traj.Vector3 parseFrom( + java.io.InputStream input, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws java.io.IOException { + return com.google.protobuf.GeneratedMessage + .parseWithIOException(PARSER, input, extensionRegistry); + } + + public static com.openpositioning.PositionMe.Traj.Vector3 parseDelimitedFrom(java.io.InputStream input) + throws java.io.IOException { + return com.google.protobuf.GeneratedMessage + .parseDelimitedWithIOException(PARSER, input); + } + + public static com.openpositioning.PositionMe.Traj.Vector3 parseDelimitedFrom( + java.io.InputStream input, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws java.io.IOException { + return com.google.protobuf.GeneratedMessage + .parseDelimitedWithIOException(PARSER, input, extensionRegistry); + } + public static com.openpositioning.PositionMe.Traj.Vector3 parseFrom( + com.google.protobuf.CodedInputStream input) + throws java.io.IOException { + return com.google.protobuf.GeneratedMessage + .parseWithIOException(PARSER, input); + } + public static com.openpositioning.PositionMe.Traj.Vector3 parseFrom( + com.google.protobuf.CodedInputStream input, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws java.io.IOException { + return com.google.protobuf.GeneratedMessage + .parseWithIOException(PARSER, input, extensionRegistry); + } + + @java.lang.Override + public Builder newBuilderForType() { return newBuilder(); } + public static Builder newBuilder() { + return DEFAULT_INSTANCE.toBuilder(); + } + public static Builder newBuilder(com.openpositioning.PositionMe.Traj.Vector3 prototype) { + return DEFAULT_INSTANCE.toBuilder().mergeFrom(prototype); + } + @java.lang.Override + public Builder toBuilder() { + return this == DEFAULT_INSTANCE + ? new Builder() : new Builder().mergeFrom(this); + } + + @java.lang.Override + protected Builder newBuilderForType( + com.google.protobuf.GeneratedMessage.BuilderParent parent) { + Builder builder = new Builder(parent); + return builder; + } + /** + *
+     * --- Common Types ---
+     * 
+ * + * Protobuf type {@code Vector3} + */ + public static final class Builder extends + com.google.protobuf.GeneratedMessage.Builder implements + // @@protoc_insertion_point(builder_implements:Vector3) + com.openpositioning.PositionMe.Traj.Vector3OrBuilder { + public static final com.google.protobuf.Descriptors.Descriptor + getDescriptor() { + return com.openpositioning.PositionMe.Traj.internal_static_Vector3_descriptor; + } + + @java.lang.Override + protected com.google.protobuf.GeneratedMessage.FieldAccessorTable + internalGetFieldAccessorTable() { + return com.openpositioning.PositionMe.Traj.internal_static_Vector3_fieldAccessorTable + .ensureFieldAccessorsInitialized( + com.openpositioning.PositionMe.Traj.Vector3.class, com.openpositioning.PositionMe.Traj.Vector3.Builder.class); + } + + // Construct using com.openpositioning.PositionMe.Traj.Vector3.newBuilder() + private Builder() { + + } + + private Builder( + com.google.protobuf.GeneratedMessage.BuilderParent parent) { + super(parent); + + } + @java.lang.Override + public Builder clear() { + super.clear(); + bitField0_ = 0; + x_ = 0F; + y_ = 0F; + z_ = 0F; + return this; + } + + @java.lang.Override + public com.google.protobuf.Descriptors.Descriptor + getDescriptorForType() { + return com.openpositioning.PositionMe.Traj.internal_static_Vector3_descriptor; + } + + @java.lang.Override + public com.openpositioning.PositionMe.Traj.Vector3 getDefaultInstanceForType() { + return com.openpositioning.PositionMe.Traj.Vector3.getDefaultInstance(); + } + + @java.lang.Override + public com.openpositioning.PositionMe.Traj.Vector3 build() { + com.openpositioning.PositionMe.Traj.Vector3 result = buildPartial(); + if (!result.isInitialized()) { + throw newUninitializedMessageException(result); + } + return result; + } + + @java.lang.Override + public com.openpositioning.PositionMe.Traj.Vector3 buildPartial() { + com.openpositioning.PositionMe.Traj.Vector3 result = new com.openpositioning.PositionMe.Traj.Vector3(this); + if (bitField0_ != 0) { buildPartial0(result); } + onBuilt(); + return result; + } + + private void buildPartial0(com.openpositioning.PositionMe.Traj.Vector3 result) { + int from_bitField0_ = bitField0_; + if (((from_bitField0_ & 0x00000001) != 0)) { + result.x_ = x_; + } + if (((from_bitField0_ & 0x00000002) != 0)) { + result.y_ = y_; + } + if (((from_bitField0_ & 0x00000004) != 0)) { + result.z_ = z_; + } + } + + @java.lang.Override + public Builder mergeFrom(com.google.protobuf.Message other) { + if (other instanceof com.openpositioning.PositionMe.Traj.Vector3) { + return mergeFrom((com.openpositioning.PositionMe.Traj.Vector3)other); + } else { + super.mergeFrom(other); + return this; + } + } + + public Builder mergeFrom(com.openpositioning.PositionMe.Traj.Vector3 other) { + if (other == com.openpositioning.PositionMe.Traj.Vector3.getDefaultInstance()) return this; + if (other.getX() != 0F) { + setX(other.getX()); + } + if (other.getY() != 0F) { + setY(other.getY()); + } + if (other.getZ() != 0F) { + setZ(other.getZ()); + } + this.mergeUnknownFields(other.getUnknownFields()); + onChanged(); + return this; + } + + @java.lang.Override + public final boolean isInitialized() { + return true; + } + + @java.lang.Override + public Builder mergeFrom( + com.google.protobuf.CodedInputStream input, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws java.io.IOException { + if (extensionRegistry == null) { + throw new java.lang.NullPointerException(); + } + try { + boolean done = false; + while (!done) { + int tag = input.readTag(); + switch (tag) { + case 0: + done = true; + break; + case 13: { + x_ = input.readFloat(); + bitField0_ |= 0x00000001; + break; + } // case 13 + case 21: { + y_ = input.readFloat(); + bitField0_ |= 0x00000002; + break; + } // case 21 + case 29: { + z_ = input.readFloat(); + bitField0_ |= 0x00000004; + break; + } // case 29 + default: { + if (!super.parseUnknownField(input, extensionRegistry, tag)) { + done = true; // was an endgroup tag + } + break; + } // default: + } // switch (tag) + } // while (!done) + } catch (com.google.protobuf.InvalidProtocolBufferException e) { + throw e.unwrapIOException(); + } finally { + onChanged(); + } // finally + return this; + } + private int bitField0_; + + private float x_ ; + /** + * float x = 1; + * @return The x. + */ + @java.lang.Override + public float getX() { + return x_; + } + /** + * float x = 1; + * @param value The x to set. + * @return This builder for chaining. + */ + public Builder setX(float value) { + + x_ = value; + bitField0_ |= 0x00000001; + onChanged(); + return this; + } + /** + * float x = 1; + * @return This builder for chaining. + */ + public Builder clearX() { + bitField0_ = (bitField0_ & ~0x00000001); + x_ = 0F; + onChanged(); + return this; + } + + private float y_ ; + /** + * float y = 2; + * @return The y. + */ + @java.lang.Override + public float getY() { + return y_; + } + /** + * float y = 2; + * @param value The y to set. + * @return This builder for chaining. + */ + public Builder setY(float value) { + + y_ = value; + bitField0_ |= 0x00000002; + onChanged(); + return this; + } + /** + * float y = 2; + * @return This builder for chaining. + */ + public Builder clearY() { + bitField0_ = (bitField0_ & ~0x00000002); + y_ = 0F; + onChanged(); + return this; + } + + private float z_ ; + /** + * float z = 3; + * @return The z. + */ + @java.lang.Override + public float getZ() { + return z_; + } + /** + * float z = 3; + * @param value The z to set. + * @return This builder for chaining. + */ + public Builder setZ(float value) { + + z_ = value; + bitField0_ |= 0x00000004; + onChanged(); + return this; + } + /** + * float z = 3; + * @return This builder for chaining. + */ + public Builder clearZ() { + bitField0_ = (bitField0_ & ~0x00000004); + z_ = 0F; + onChanged(); + return this; + } + + // @@protoc_insertion_point(builder_scope:Vector3) + } + + // @@protoc_insertion_point(class_scope:Vector3) + private static final com.openpositioning.PositionMe.Traj.Vector3 DEFAULT_INSTANCE; + static { + DEFAULT_INSTANCE = new com.openpositioning.PositionMe.Traj.Vector3(); + } + + public static com.openpositioning.PositionMe.Traj.Vector3 getDefaultInstance() { + return DEFAULT_INSTANCE; + } + + private static final com.google.protobuf.Parser + PARSER = new com.google.protobuf.AbstractParser() { + @java.lang.Override + public Vector3 parsePartialFrom( + com.google.protobuf.CodedInputStream input, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + Builder builder = newBuilder(); + try { + builder.mergeFrom(input, extensionRegistry); + } catch (com.google.protobuf.InvalidProtocolBufferException e) { + throw e.setUnfinishedMessage(builder.buildPartial()); + } catch (com.google.protobuf.UninitializedMessageException e) { + throw e.asInvalidProtocolBufferException().setUnfinishedMessage(builder.buildPartial()); + } catch (java.io.IOException e) { + throw new com.google.protobuf.InvalidProtocolBufferException(e) + .setUnfinishedMessage(builder.buildPartial()); + } + return builder.buildPartial(); + } + }; + + public static com.google.protobuf.Parser parser() { + return PARSER; + } + + @java.lang.Override + public com.google.protobuf.Parser getParserForType() { + return PARSER; + } + + @java.lang.Override + public com.openpositioning.PositionMe.Traj.Vector3 getDefaultInstanceForType() { + return DEFAULT_INSTANCE; + } + + } + + public interface QuaternionOrBuilder extends + // @@protoc_insertion_point(interface_extends:Quaternion) + com.google.protobuf.MessageOrBuilder { + + /** + * float x = 1; + * @return The x. + */ + float getX(); + + /** + * float y = 2; + * @return The y. + */ + float getY(); + + /** + * float z = 3; + * @return The z. + */ + float getZ(); + + /** + * float w = 4; + * @return The w. + */ + float getW(); + } + /** + * Protobuf type {@code Quaternion} + */ + public static final class Quaternion extends + com.google.protobuf.GeneratedMessage implements + // @@protoc_insertion_point(message_implements:Quaternion) + QuaternionOrBuilder { + private static final long serialVersionUID = 0L; + static { + com.google.protobuf.RuntimeVersion.validateProtobufGencodeVersion( + com.google.protobuf.RuntimeVersion.RuntimeDomain.PUBLIC, + /* major= */ 4, + /* minor= */ 29, + /* patch= */ 6, + /* suffix= */ "", + Quaternion.class.getName()); + } + // Use Quaternion.newBuilder() to construct. + private Quaternion(com.google.protobuf.GeneratedMessage.Builder builder) { + super(builder); + } + private Quaternion() { + } + + public static final com.google.protobuf.Descriptors.Descriptor + getDescriptor() { + return com.openpositioning.PositionMe.Traj.internal_static_Quaternion_descriptor; + } + + @java.lang.Override + protected com.google.protobuf.GeneratedMessage.FieldAccessorTable + internalGetFieldAccessorTable() { + return com.openpositioning.PositionMe.Traj.internal_static_Quaternion_fieldAccessorTable + .ensureFieldAccessorsInitialized( + com.openpositioning.PositionMe.Traj.Quaternion.class, com.openpositioning.PositionMe.Traj.Quaternion.Builder.class); + } + + public static final int X_FIELD_NUMBER = 1; + private float x_ = 0F; + /** + * float x = 1; + * @return The x. + */ + @java.lang.Override + public float getX() { + return x_; + } + + public static final int Y_FIELD_NUMBER = 2; + private float y_ = 0F; + /** + * float y = 2; + * @return The y. + */ + @java.lang.Override + public float getY() { + return y_; + } + + public static final int Z_FIELD_NUMBER = 3; + private float z_ = 0F; + /** + * float z = 3; + * @return The z. + */ + @java.lang.Override + public float getZ() { + return z_; + } + + public static final int W_FIELD_NUMBER = 4; + private float w_ = 0F; + /** + * float w = 4; + * @return The w. + */ + @java.lang.Override + public float getW() { + return w_; + } + + private byte memoizedIsInitialized = -1; + @java.lang.Override + public final boolean isInitialized() { + byte isInitialized = memoizedIsInitialized; + if (isInitialized == 1) return true; + if (isInitialized == 0) return false; + + memoizedIsInitialized = 1; + return true; + } + + @java.lang.Override + public void writeTo(com.google.protobuf.CodedOutputStream output) + throws java.io.IOException { + if (java.lang.Float.floatToRawIntBits(x_) != 0) { + output.writeFloat(1, x_); + } + if (java.lang.Float.floatToRawIntBits(y_) != 0) { + output.writeFloat(2, y_); + } + if (java.lang.Float.floatToRawIntBits(z_) != 0) { + output.writeFloat(3, z_); + } + if (java.lang.Float.floatToRawIntBits(w_) != 0) { + output.writeFloat(4, w_); + } + getUnknownFields().writeTo(output); + } + + @java.lang.Override + public int getSerializedSize() { + int size = memoizedSize; + if (size != -1) return size; + + size = 0; + if (java.lang.Float.floatToRawIntBits(x_) != 0) { + size += com.google.protobuf.CodedOutputStream + .computeFloatSize(1, x_); + } + if (java.lang.Float.floatToRawIntBits(y_) != 0) { + size += com.google.protobuf.CodedOutputStream + .computeFloatSize(2, y_); + } + if (java.lang.Float.floatToRawIntBits(z_) != 0) { + size += com.google.protobuf.CodedOutputStream + .computeFloatSize(3, z_); + } + if (java.lang.Float.floatToRawIntBits(w_) != 0) { + size += com.google.protobuf.CodedOutputStream + .computeFloatSize(4, w_); + } + size += getUnknownFields().getSerializedSize(); + memoizedSize = size; + return size; + } + + @java.lang.Override + public boolean equals(final java.lang.Object obj) { + if (obj == this) { + return true; + } + if (!(obj instanceof com.openpositioning.PositionMe.Traj.Quaternion)) { + return super.equals(obj); + } + com.openpositioning.PositionMe.Traj.Quaternion other = (com.openpositioning.PositionMe.Traj.Quaternion) obj; + + if (java.lang.Float.floatToIntBits(getX()) + != java.lang.Float.floatToIntBits( + other.getX())) return false; + if (java.lang.Float.floatToIntBits(getY()) + != java.lang.Float.floatToIntBits( + other.getY())) return false; + if (java.lang.Float.floatToIntBits(getZ()) + != java.lang.Float.floatToIntBits( + other.getZ())) return false; + if (java.lang.Float.floatToIntBits(getW()) + != java.lang.Float.floatToIntBits( + other.getW())) return false; + if (!getUnknownFields().equals(other.getUnknownFields())) return false; + return true; + } + + @java.lang.Override + public int hashCode() { + if (memoizedHashCode != 0) { + return memoizedHashCode; + } + int hash = 41; + hash = (19 * hash) + getDescriptor().hashCode(); + hash = (37 * hash) + X_FIELD_NUMBER; + hash = (53 * hash) + java.lang.Float.floatToIntBits( + getX()); + hash = (37 * hash) + Y_FIELD_NUMBER; + hash = (53 * hash) + java.lang.Float.floatToIntBits( + getY()); + hash = (37 * hash) + Z_FIELD_NUMBER; + hash = (53 * hash) + java.lang.Float.floatToIntBits( + getZ()); + hash = (37 * hash) + W_FIELD_NUMBER; + hash = (53 * hash) + java.lang.Float.floatToIntBits( + getW()); + hash = (29 * hash) + getUnknownFields().hashCode(); + memoizedHashCode = hash; + return hash; + } + + public static com.openpositioning.PositionMe.Traj.Quaternion parseFrom( + java.nio.ByteBuffer data) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + public static com.openpositioning.PositionMe.Traj.Quaternion parseFrom( + java.nio.ByteBuffer data, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data, extensionRegistry); + } + public static com.openpositioning.PositionMe.Traj.Quaternion parseFrom( + com.google.protobuf.ByteString data) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + public static com.openpositioning.PositionMe.Traj.Quaternion parseFrom( + com.google.protobuf.ByteString data, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data, extensionRegistry); + } + public static com.openpositioning.PositionMe.Traj.Quaternion parseFrom(byte[] data) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + public static com.openpositioning.PositionMe.Traj.Quaternion parseFrom( + byte[] data, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data, extensionRegistry); + } + public static com.openpositioning.PositionMe.Traj.Quaternion parseFrom(java.io.InputStream input) + throws java.io.IOException { + return com.google.protobuf.GeneratedMessage + .parseWithIOException(PARSER, input); + } + public static com.openpositioning.PositionMe.Traj.Quaternion parseFrom( + java.io.InputStream input, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws java.io.IOException { + return com.google.protobuf.GeneratedMessage + .parseWithIOException(PARSER, input, extensionRegistry); + } + + public static com.openpositioning.PositionMe.Traj.Quaternion parseDelimitedFrom(java.io.InputStream input) + throws java.io.IOException { + return com.google.protobuf.GeneratedMessage + .parseDelimitedWithIOException(PARSER, input); + } + + public static com.openpositioning.PositionMe.Traj.Quaternion parseDelimitedFrom( + java.io.InputStream input, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws java.io.IOException { + return com.google.protobuf.GeneratedMessage + .parseDelimitedWithIOException(PARSER, input, extensionRegistry); + } + public static com.openpositioning.PositionMe.Traj.Quaternion parseFrom( + com.google.protobuf.CodedInputStream input) + throws java.io.IOException { + return com.google.protobuf.GeneratedMessage + .parseWithIOException(PARSER, input); + } + public static com.openpositioning.PositionMe.Traj.Quaternion parseFrom( + com.google.protobuf.CodedInputStream input, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws java.io.IOException { + return com.google.protobuf.GeneratedMessage + .parseWithIOException(PARSER, input, extensionRegistry); + } + + @java.lang.Override + public Builder newBuilderForType() { return newBuilder(); } + public static Builder newBuilder() { + return DEFAULT_INSTANCE.toBuilder(); + } + public static Builder newBuilder(com.openpositioning.PositionMe.Traj.Quaternion prototype) { + return DEFAULT_INSTANCE.toBuilder().mergeFrom(prototype); + } + @java.lang.Override + public Builder toBuilder() { + return this == DEFAULT_INSTANCE + ? new Builder() : new Builder().mergeFrom(this); + } + + @java.lang.Override + protected Builder newBuilderForType( + com.google.protobuf.GeneratedMessage.BuilderParent parent) { + Builder builder = new Builder(parent); + return builder; + } + /** + * Protobuf type {@code Quaternion} + */ + public static final class Builder extends + com.google.protobuf.GeneratedMessage.Builder implements + // @@protoc_insertion_point(builder_implements:Quaternion) + com.openpositioning.PositionMe.Traj.QuaternionOrBuilder { + public static final com.google.protobuf.Descriptors.Descriptor + getDescriptor() { + return com.openpositioning.PositionMe.Traj.internal_static_Quaternion_descriptor; + } + + @java.lang.Override + protected com.google.protobuf.GeneratedMessage.FieldAccessorTable + internalGetFieldAccessorTable() { + return com.openpositioning.PositionMe.Traj.internal_static_Quaternion_fieldAccessorTable + .ensureFieldAccessorsInitialized( + com.openpositioning.PositionMe.Traj.Quaternion.class, com.openpositioning.PositionMe.Traj.Quaternion.Builder.class); + } + + // Construct using com.openpositioning.PositionMe.Traj.Quaternion.newBuilder() + private Builder() { + + } + + private Builder( + com.google.protobuf.GeneratedMessage.BuilderParent parent) { + super(parent); + + } + @java.lang.Override + public Builder clear() { + super.clear(); + bitField0_ = 0; + x_ = 0F; + y_ = 0F; + z_ = 0F; + w_ = 0F; + return this; + } + + @java.lang.Override + public com.google.protobuf.Descriptors.Descriptor + getDescriptorForType() { + return com.openpositioning.PositionMe.Traj.internal_static_Quaternion_descriptor; + } + + @java.lang.Override + public com.openpositioning.PositionMe.Traj.Quaternion getDefaultInstanceForType() { + return com.openpositioning.PositionMe.Traj.Quaternion.getDefaultInstance(); + } + + @java.lang.Override + public com.openpositioning.PositionMe.Traj.Quaternion build() { + com.openpositioning.PositionMe.Traj.Quaternion result = buildPartial(); + if (!result.isInitialized()) { + throw newUninitializedMessageException(result); + } + return result; + } + + @java.lang.Override + public com.openpositioning.PositionMe.Traj.Quaternion buildPartial() { + com.openpositioning.PositionMe.Traj.Quaternion result = new com.openpositioning.PositionMe.Traj.Quaternion(this); + if (bitField0_ != 0) { buildPartial0(result); } + onBuilt(); + return result; + } + + private void buildPartial0(com.openpositioning.PositionMe.Traj.Quaternion result) { + int from_bitField0_ = bitField0_; + if (((from_bitField0_ & 0x00000001) != 0)) { + result.x_ = x_; + } + if (((from_bitField0_ & 0x00000002) != 0)) { + result.y_ = y_; + } + if (((from_bitField0_ & 0x00000004) != 0)) { + result.z_ = z_; + } + if (((from_bitField0_ & 0x00000008) != 0)) { + result.w_ = w_; + } + } + + @java.lang.Override + public Builder mergeFrom(com.google.protobuf.Message other) { + if (other instanceof com.openpositioning.PositionMe.Traj.Quaternion) { + return mergeFrom((com.openpositioning.PositionMe.Traj.Quaternion)other); + } else { + super.mergeFrom(other); + return this; + } + } + + public Builder mergeFrom(com.openpositioning.PositionMe.Traj.Quaternion other) { + if (other == com.openpositioning.PositionMe.Traj.Quaternion.getDefaultInstance()) return this; + if (other.getX() != 0F) { + setX(other.getX()); + } + if (other.getY() != 0F) { + setY(other.getY()); + } + if (other.getZ() != 0F) { + setZ(other.getZ()); + } + if (other.getW() != 0F) { + setW(other.getW()); + } + this.mergeUnknownFields(other.getUnknownFields()); + onChanged(); + return this; + } + + @java.lang.Override + public final boolean isInitialized() { + return true; + } + + @java.lang.Override + public Builder mergeFrom( + com.google.protobuf.CodedInputStream input, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws java.io.IOException { + if (extensionRegistry == null) { + throw new java.lang.NullPointerException(); + } + try { + boolean done = false; + while (!done) { + int tag = input.readTag(); + switch (tag) { + case 0: + done = true; + break; + case 13: { + x_ = input.readFloat(); + bitField0_ |= 0x00000001; + break; + } // case 13 + case 21: { + y_ = input.readFloat(); + bitField0_ |= 0x00000002; + break; + } // case 21 + case 29: { + z_ = input.readFloat(); + bitField0_ |= 0x00000004; + break; + } // case 29 + case 37: { + w_ = input.readFloat(); + bitField0_ |= 0x00000008; + break; + } // case 37 + default: { + if (!super.parseUnknownField(input, extensionRegistry, tag)) { + done = true; // was an endgroup tag + } + break; + } // default: + } // switch (tag) + } // while (!done) + } catch (com.google.protobuf.InvalidProtocolBufferException e) { + throw e.unwrapIOException(); + } finally { + onChanged(); + } // finally + return this; + } + private int bitField0_; + + private float x_ ; + /** + * float x = 1; + * @return The x. + */ + @java.lang.Override + public float getX() { + return x_; + } + /** + * float x = 1; + * @param value The x to set. + * @return This builder for chaining. + */ + public Builder setX(float value) { + + x_ = value; + bitField0_ |= 0x00000001; + onChanged(); + return this; + } + /** + * float x = 1; + * @return This builder for chaining. + */ + public Builder clearX() { + bitField0_ = (bitField0_ & ~0x00000001); + x_ = 0F; + onChanged(); + return this; + } + + private float y_ ; + /** + * float y = 2; + * @return The y. + */ + @java.lang.Override + public float getY() { + return y_; + } + /** + * float y = 2; + * @param value The y to set. + * @return This builder for chaining. + */ + public Builder setY(float value) { + + y_ = value; + bitField0_ |= 0x00000002; + onChanged(); + return this; + } + /** + * float y = 2; + * @return This builder for chaining. + */ + public Builder clearY() { + bitField0_ = (bitField0_ & ~0x00000002); + y_ = 0F; + onChanged(); + return this; + } + + private float z_ ; + /** + * float z = 3; + * @return The z. + */ + @java.lang.Override + public float getZ() { + return z_; + } + /** + * float z = 3; + * @param value The z to set. + * @return This builder for chaining. + */ + public Builder setZ(float value) { + + z_ = value; + bitField0_ |= 0x00000004; + onChanged(); + return this; + } + /** + * float z = 3; + * @return This builder for chaining. + */ + public Builder clearZ() { + bitField0_ = (bitField0_ & ~0x00000004); + z_ = 0F; + onChanged(); + return this; + } + + private float w_ ; + /** + * float w = 4; + * @return The w. + */ + @java.lang.Override + public float getW() { + return w_; + } + /** + * float w = 4; + * @param value The w to set. + * @return This builder for chaining. + */ + public Builder setW(float value) { + + w_ = value; + bitField0_ |= 0x00000008; + onChanged(); + return this; + } + /** + * float w = 4; + * @return This builder for chaining. + */ + public Builder clearW() { + bitField0_ = (bitField0_ & ~0x00000008); + w_ = 0F; + onChanged(); + return this; + } + + // @@protoc_insertion_point(builder_scope:Quaternion) + } + + // @@protoc_insertion_point(class_scope:Quaternion) + private static final com.openpositioning.PositionMe.Traj.Quaternion DEFAULT_INSTANCE; + static { + DEFAULT_INSTANCE = new com.openpositioning.PositionMe.Traj.Quaternion(); + } + + public static com.openpositioning.PositionMe.Traj.Quaternion getDefaultInstance() { + return DEFAULT_INSTANCE; + } + + private static final com.google.protobuf.Parser + PARSER = new com.google.protobuf.AbstractParser() { + @java.lang.Override + public Quaternion parsePartialFrom( + com.google.protobuf.CodedInputStream input, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + Builder builder = newBuilder(); + try { + builder.mergeFrom(input, extensionRegistry); + } catch (com.google.protobuf.InvalidProtocolBufferException e) { + throw e.setUnfinishedMessage(builder.buildPartial()); + } catch (com.google.protobuf.UninitializedMessageException e) { + throw e.asInvalidProtocolBufferException().setUnfinishedMessage(builder.buildPartial()); + } catch (java.io.IOException e) { + throw new com.google.protobuf.InvalidProtocolBufferException(e) + .setUnfinishedMessage(builder.buildPartial()); + } + return builder.buildPartial(); + } + }; + + public static com.google.protobuf.Parser parser() { + return PARSER; + } + + @java.lang.Override + public com.google.protobuf.Parser getParserForType() { + return PARSER; + } + + @java.lang.Override + public com.openpositioning.PositionMe.Traj.Quaternion getDefaultInstanceForType() { + return DEFAULT_INSTANCE; + } + + } + + public interface SensorInfoOrBuilder extends + // @@protoc_insertion_point(interface_extends:SensorInfo) + com.google.protobuf.MessageOrBuilder { + + /** + * string name = 1; + * @return The name. + */ + java.lang.String getName(); + /** + * string name = 1; + * @return The bytes for name. + */ + com.google.protobuf.ByteString + getNameBytes(); + + /** + * string vendor = 2; + * @return The vendor. + */ + java.lang.String getVendor(); + /** + * string vendor = 2; + * @return The bytes for vendor. + */ + com.google.protobuf.ByteString + getVendorBytes(); + + /** + * float resolution = 3; + * @return The resolution. + */ + float getResolution(); + + /** + * float power = 4; + * @return The power. + */ + float getPower(); + + /** + * int32 version = 5; + * @return The version. + */ + int getVersion(); + + /** + * int32 type = 6; + * @return The type. + */ + int getType(); + + /** + * float max_range = 7; + * @return The maxRange. + */ + float getMaxRange(); + + /** + * float frequency = 8; + * @return The frequency. + */ + float getFrequency(); + } + /** + * Protobuf type {@code SensorInfo} + */ + public static final class SensorInfo extends + com.google.protobuf.GeneratedMessage implements + // @@protoc_insertion_point(message_implements:SensorInfo) + SensorInfoOrBuilder { + private static final long serialVersionUID = 0L; + static { + com.google.protobuf.RuntimeVersion.validateProtobufGencodeVersion( + com.google.protobuf.RuntimeVersion.RuntimeDomain.PUBLIC, + /* major= */ 4, + /* minor= */ 29, + /* patch= */ 6, + /* suffix= */ "", + SensorInfo.class.getName()); + } + // Use SensorInfo.newBuilder() to construct. + private SensorInfo(com.google.protobuf.GeneratedMessage.Builder builder) { + super(builder); + } + private SensorInfo() { + name_ = ""; + vendor_ = ""; + } + + public static final com.google.protobuf.Descriptors.Descriptor + getDescriptor() { + return com.openpositioning.PositionMe.Traj.internal_static_SensorInfo_descriptor; + } + + @java.lang.Override + protected com.google.protobuf.GeneratedMessage.FieldAccessorTable + internalGetFieldAccessorTable() { + return com.openpositioning.PositionMe.Traj.internal_static_SensorInfo_fieldAccessorTable + .ensureFieldAccessorsInitialized( + com.openpositioning.PositionMe.Traj.SensorInfo.class, com.openpositioning.PositionMe.Traj.SensorInfo.Builder.class); + } + + public static final int NAME_FIELD_NUMBER = 1; + @SuppressWarnings("serial") + private volatile java.lang.Object name_ = ""; + /** + * string name = 1; + * @return The name. + */ + @java.lang.Override + public java.lang.String getName() { + java.lang.Object ref = name_; + if (ref instanceof java.lang.String) { + return (java.lang.String) ref; + } else { + com.google.protobuf.ByteString bs = + (com.google.protobuf.ByteString) ref; + java.lang.String s = bs.toStringUtf8(); + name_ = s; + return s; + } + } + /** + * string name = 1; + * @return The bytes for name. + */ + @java.lang.Override + public com.google.protobuf.ByteString + getNameBytes() { + java.lang.Object ref = name_; + if (ref instanceof java.lang.String) { + com.google.protobuf.ByteString b = + com.google.protobuf.ByteString.copyFromUtf8( + (java.lang.String) ref); + name_ = b; + return b; + } else { + return (com.google.protobuf.ByteString) ref; + } + } + + public static final int VENDOR_FIELD_NUMBER = 2; + @SuppressWarnings("serial") + private volatile java.lang.Object vendor_ = ""; + /** + * string vendor = 2; + * @return The vendor. + */ + @java.lang.Override + public java.lang.String getVendor() { + java.lang.Object ref = vendor_; + if (ref instanceof java.lang.String) { + return (java.lang.String) ref; + } else { + com.google.protobuf.ByteString bs = + (com.google.protobuf.ByteString) ref; + java.lang.String s = bs.toStringUtf8(); + vendor_ = s; + return s; + } + } + /** + * string vendor = 2; + * @return The bytes for vendor. + */ + @java.lang.Override + public com.google.protobuf.ByteString + getVendorBytes() { + java.lang.Object ref = vendor_; + if (ref instanceof java.lang.String) { + com.google.protobuf.ByteString b = + com.google.protobuf.ByteString.copyFromUtf8( + (java.lang.String) ref); + vendor_ = b; + return b; + } else { + return (com.google.protobuf.ByteString) ref; + } + } + + public static final int RESOLUTION_FIELD_NUMBER = 3; + private float resolution_ = 0F; + /** + * float resolution = 3; + * @return The resolution. + */ + @java.lang.Override + public float getResolution() { + return resolution_; + } + + public static final int POWER_FIELD_NUMBER = 4; + private float power_ = 0F; + /** + * float power = 4; + * @return The power. + */ + @java.lang.Override + public float getPower() { + return power_; + } + + public static final int VERSION_FIELD_NUMBER = 5; + private int version_ = 0; + /** + * int32 version = 5; + * @return The version. + */ + @java.lang.Override + public int getVersion() { + return version_; + } + + public static final int TYPE_FIELD_NUMBER = 6; + private int type_ = 0; + /** + * int32 type = 6; + * @return The type. + */ + @java.lang.Override + public int getType() { + return type_; + } + + public static final int MAX_RANGE_FIELD_NUMBER = 7; + private float maxRange_ = 0F; + /** + * float max_range = 7; + * @return The maxRange. + */ + @java.lang.Override + public float getMaxRange() { + return maxRange_; + } + + public static final int FREQUENCY_FIELD_NUMBER = 8; + private float frequency_ = 0F; + /** + * float frequency = 8; + * @return The frequency. + */ + @java.lang.Override + public float getFrequency() { + return frequency_; + } + + private byte memoizedIsInitialized = -1; + @java.lang.Override + public final boolean isInitialized() { + byte isInitialized = memoizedIsInitialized; + if (isInitialized == 1) return true; + if (isInitialized == 0) return false; + + memoizedIsInitialized = 1; + return true; + } + + @java.lang.Override + public void writeTo(com.google.protobuf.CodedOutputStream output) + throws java.io.IOException { + if (!com.google.protobuf.GeneratedMessage.isStringEmpty(name_)) { + com.google.protobuf.GeneratedMessage.writeString(output, 1, name_); + } + if (!com.google.protobuf.GeneratedMessage.isStringEmpty(vendor_)) { + com.google.protobuf.GeneratedMessage.writeString(output, 2, vendor_); + } + if (java.lang.Float.floatToRawIntBits(resolution_) != 0) { + output.writeFloat(3, resolution_); + } + if (java.lang.Float.floatToRawIntBits(power_) != 0) { + output.writeFloat(4, power_); + } + if (version_ != 0) { + output.writeInt32(5, version_); + } + if (type_ != 0) { + output.writeInt32(6, type_); + } + if (java.lang.Float.floatToRawIntBits(maxRange_) != 0) { + output.writeFloat(7, maxRange_); + } + if (java.lang.Float.floatToRawIntBits(frequency_) != 0) { + output.writeFloat(8, frequency_); + } + getUnknownFields().writeTo(output); + } + + @java.lang.Override + public int getSerializedSize() { + int size = memoizedSize; + if (size != -1) return size; + + size = 0; + if (!com.google.protobuf.GeneratedMessage.isStringEmpty(name_)) { + size += com.google.protobuf.GeneratedMessage.computeStringSize(1, name_); + } + if (!com.google.protobuf.GeneratedMessage.isStringEmpty(vendor_)) { + size += com.google.protobuf.GeneratedMessage.computeStringSize(2, vendor_); + } + if (java.lang.Float.floatToRawIntBits(resolution_) != 0) { + size += com.google.protobuf.CodedOutputStream + .computeFloatSize(3, resolution_); + } + if (java.lang.Float.floatToRawIntBits(power_) != 0) { + size += com.google.protobuf.CodedOutputStream + .computeFloatSize(4, power_); + } + if (version_ != 0) { + size += com.google.protobuf.CodedOutputStream + .computeInt32Size(5, version_); + } + if (type_ != 0) { + size += com.google.protobuf.CodedOutputStream + .computeInt32Size(6, type_); + } + if (java.lang.Float.floatToRawIntBits(maxRange_) != 0) { + size += com.google.protobuf.CodedOutputStream + .computeFloatSize(7, maxRange_); + } + if (java.lang.Float.floatToRawIntBits(frequency_) != 0) { + size += com.google.protobuf.CodedOutputStream + .computeFloatSize(8, frequency_); + } + size += getUnknownFields().getSerializedSize(); + memoizedSize = size; + return size; + } + + @java.lang.Override + public boolean equals(final java.lang.Object obj) { + if (obj == this) { + return true; + } + if (!(obj instanceof com.openpositioning.PositionMe.Traj.SensorInfo)) { + return super.equals(obj); + } + com.openpositioning.PositionMe.Traj.SensorInfo other = (com.openpositioning.PositionMe.Traj.SensorInfo) obj; + + if (!getName() + .equals(other.getName())) return false; + if (!getVendor() + .equals(other.getVendor())) return false; + if (java.lang.Float.floatToIntBits(getResolution()) + != java.lang.Float.floatToIntBits( + other.getResolution())) return false; + if (java.lang.Float.floatToIntBits(getPower()) + != java.lang.Float.floatToIntBits( + other.getPower())) return false; + if (getVersion() + != other.getVersion()) return false; + if (getType() + != other.getType()) return false; + if (java.lang.Float.floatToIntBits(getMaxRange()) + != java.lang.Float.floatToIntBits( + other.getMaxRange())) return false; + if (java.lang.Float.floatToIntBits(getFrequency()) + != java.lang.Float.floatToIntBits( + other.getFrequency())) return false; + if (!getUnknownFields().equals(other.getUnknownFields())) return false; + return true; + } + + @java.lang.Override + public int hashCode() { + if (memoizedHashCode != 0) { + return memoizedHashCode; + } + int hash = 41; + hash = (19 * hash) + getDescriptor().hashCode(); + hash = (37 * hash) + NAME_FIELD_NUMBER; + hash = (53 * hash) + getName().hashCode(); + hash = (37 * hash) + VENDOR_FIELD_NUMBER; + hash = (53 * hash) + getVendor().hashCode(); + hash = (37 * hash) + RESOLUTION_FIELD_NUMBER; + hash = (53 * hash) + java.lang.Float.floatToIntBits( + getResolution()); + hash = (37 * hash) + POWER_FIELD_NUMBER; + hash = (53 * hash) + java.lang.Float.floatToIntBits( + getPower()); + hash = (37 * hash) + VERSION_FIELD_NUMBER; + hash = (53 * hash) + getVersion(); + hash = (37 * hash) + TYPE_FIELD_NUMBER; + hash = (53 * hash) + getType(); + hash = (37 * hash) + MAX_RANGE_FIELD_NUMBER; + hash = (53 * hash) + java.lang.Float.floatToIntBits( + getMaxRange()); + hash = (37 * hash) + FREQUENCY_FIELD_NUMBER; + hash = (53 * hash) + java.lang.Float.floatToIntBits( + getFrequency()); + hash = (29 * hash) + getUnknownFields().hashCode(); + memoizedHashCode = hash; + return hash; + } + + public static com.openpositioning.PositionMe.Traj.SensorInfo parseFrom( + java.nio.ByteBuffer data) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + public static com.openpositioning.PositionMe.Traj.SensorInfo parseFrom( + java.nio.ByteBuffer data, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data, extensionRegistry); + } + public static com.openpositioning.PositionMe.Traj.SensorInfo parseFrom( + com.google.protobuf.ByteString data) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + public static com.openpositioning.PositionMe.Traj.SensorInfo parseFrom( + com.google.protobuf.ByteString data, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data, extensionRegistry); + } + public static com.openpositioning.PositionMe.Traj.SensorInfo parseFrom(byte[] data) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + public static com.openpositioning.PositionMe.Traj.SensorInfo parseFrom( + byte[] data, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data, extensionRegistry); + } + public static com.openpositioning.PositionMe.Traj.SensorInfo parseFrom(java.io.InputStream input) + throws java.io.IOException { + return com.google.protobuf.GeneratedMessage + .parseWithIOException(PARSER, input); + } + public static com.openpositioning.PositionMe.Traj.SensorInfo parseFrom( + java.io.InputStream input, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws java.io.IOException { + return com.google.protobuf.GeneratedMessage + .parseWithIOException(PARSER, input, extensionRegistry); + } + + public static com.openpositioning.PositionMe.Traj.SensorInfo parseDelimitedFrom(java.io.InputStream input) + throws java.io.IOException { + return com.google.protobuf.GeneratedMessage + .parseDelimitedWithIOException(PARSER, input); + } + + public static com.openpositioning.PositionMe.Traj.SensorInfo parseDelimitedFrom( + java.io.InputStream input, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws java.io.IOException { + return com.google.protobuf.GeneratedMessage + .parseDelimitedWithIOException(PARSER, input, extensionRegistry); + } + public static com.openpositioning.PositionMe.Traj.SensorInfo parseFrom( + com.google.protobuf.CodedInputStream input) + throws java.io.IOException { + return com.google.protobuf.GeneratedMessage + .parseWithIOException(PARSER, input); + } + public static com.openpositioning.PositionMe.Traj.SensorInfo parseFrom( + com.google.protobuf.CodedInputStream input, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws java.io.IOException { + return com.google.protobuf.GeneratedMessage + .parseWithIOException(PARSER, input, extensionRegistry); + } + + @java.lang.Override + public Builder newBuilderForType() { return newBuilder(); } + public static Builder newBuilder() { + return DEFAULT_INSTANCE.toBuilder(); + } + public static Builder newBuilder(com.openpositioning.PositionMe.Traj.SensorInfo prototype) { + return DEFAULT_INSTANCE.toBuilder().mergeFrom(prototype); + } + @java.lang.Override + public Builder toBuilder() { + return this == DEFAULT_INSTANCE + ? new Builder() : new Builder().mergeFrom(this); + } + + @java.lang.Override + protected Builder newBuilderForType( + com.google.protobuf.GeneratedMessage.BuilderParent parent) { + Builder builder = new Builder(parent); + return builder; + } + /** + * Protobuf type {@code SensorInfo} + */ + public static final class Builder extends + com.google.protobuf.GeneratedMessage.Builder implements + // @@protoc_insertion_point(builder_implements:SensorInfo) + com.openpositioning.PositionMe.Traj.SensorInfoOrBuilder { + public static final com.google.protobuf.Descriptors.Descriptor + getDescriptor() { + return com.openpositioning.PositionMe.Traj.internal_static_SensorInfo_descriptor; + } + + @java.lang.Override + protected com.google.protobuf.GeneratedMessage.FieldAccessorTable + internalGetFieldAccessorTable() { + return com.openpositioning.PositionMe.Traj.internal_static_SensorInfo_fieldAccessorTable + .ensureFieldAccessorsInitialized( + com.openpositioning.PositionMe.Traj.SensorInfo.class, com.openpositioning.PositionMe.Traj.SensorInfo.Builder.class); + } + + // Construct using com.openpositioning.PositionMe.Traj.SensorInfo.newBuilder() + private Builder() { + + } + + private Builder( + com.google.protobuf.GeneratedMessage.BuilderParent parent) { + super(parent); + + } + @java.lang.Override + public Builder clear() { + super.clear(); + bitField0_ = 0; + name_ = ""; + vendor_ = ""; + resolution_ = 0F; + power_ = 0F; + version_ = 0; + type_ = 0; + maxRange_ = 0F; + frequency_ = 0F; + return this; + } + + @java.lang.Override + public com.google.protobuf.Descriptors.Descriptor + getDescriptorForType() { + return com.openpositioning.PositionMe.Traj.internal_static_SensorInfo_descriptor; + } + + @java.lang.Override + public com.openpositioning.PositionMe.Traj.SensorInfo getDefaultInstanceForType() { + return com.openpositioning.PositionMe.Traj.SensorInfo.getDefaultInstance(); + } + + @java.lang.Override + public com.openpositioning.PositionMe.Traj.SensorInfo build() { + com.openpositioning.PositionMe.Traj.SensorInfo result = buildPartial(); + if (!result.isInitialized()) { + throw newUninitializedMessageException(result); + } + return result; + } + + @java.lang.Override + public com.openpositioning.PositionMe.Traj.SensorInfo buildPartial() { + com.openpositioning.PositionMe.Traj.SensorInfo result = new com.openpositioning.PositionMe.Traj.SensorInfo(this); + if (bitField0_ != 0) { buildPartial0(result); } + onBuilt(); + return result; + } + + private void buildPartial0(com.openpositioning.PositionMe.Traj.SensorInfo result) { + int from_bitField0_ = bitField0_; + if (((from_bitField0_ & 0x00000001) != 0)) { + result.name_ = name_; + } + if (((from_bitField0_ & 0x00000002) != 0)) { + result.vendor_ = vendor_; + } + if (((from_bitField0_ & 0x00000004) != 0)) { + result.resolution_ = resolution_; + } + if (((from_bitField0_ & 0x00000008) != 0)) { + result.power_ = power_; + } + if (((from_bitField0_ & 0x00000010) != 0)) { + result.version_ = version_; + } + if (((from_bitField0_ & 0x00000020) != 0)) { + result.type_ = type_; + } + if (((from_bitField0_ & 0x00000040) != 0)) { + result.maxRange_ = maxRange_; + } + if (((from_bitField0_ & 0x00000080) != 0)) { + result.frequency_ = frequency_; + } + } + + @java.lang.Override + public Builder mergeFrom(com.google.protobuf.Message other) { + if (other instanceof com.openpositioning.PositionMe.Traj.SensorInfo) { + return mergeFrom((com.openpositioning.PositionMe.Traj.SensorInfo)other); + } else { + super.mergeFrom(other); + return this; + } + } + + public Builder mergeFrom(com.openpositioning.PositionMe.Traj.SensorInfo other) { + if (other == com.openpositioning.PositionMe.Traj.SensorInfo.getDefaultInstance()) return this; + if (!other.getName().isEmpty()) { + name_ = other.name_; + bitField0_ |= 0x00000001; + onChanged(); + } + if (!other.getVendor().isEmpty()) { + vendor_ = other.vendor_; + bitField0_ |= 0x00000002; + onChanged(); + } + if (other.getResolution() != 0F) { + setResolution(other.getResolution()); + } + if (other.getPower() != 0F) { + setPower(other.getPower()); + } + if (other.getVersion() != 0) { + setVersion(other.getVersion()); + } + if (other.getType() != 0) { + setType(other.getType()); + } + if (other.getMaxRange() != 0F) { + setMaxRange(other.getMaxRange()); + } + if (other.getFrequency() != 0F) { + setFrequency(other.getFrequency()); + } + this.mergeUnknownFields(other.getUnknownFields()); + onChanged(); + return this; + } + + @java.lang.Override + public final boolean isInitialized() { + return true; + } + + @java.lang.Override + public Builder mergeFrom( + com.google.protobuf.CodedInputStream input, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws java.io.IOException { + if (extensionRegistry == null) { + throw new java.lang.NullPointerException(); + } + try { + boolean done = false; + while (!done) { + int tag = input.readTag(); + switch (tag) { + case 0: + done = true; + break; + case 10: { + name_ = input.readStringRequireUtf8(); + bitField0_ |= 0x00000001; + break; + } // case 10 + case 18: { + vendor_ = input.readStringRequireUtf8(); + bitField0_ |= 0x00000002; + break; + } // case 18 + case 29: { + resolution_ = input.readFloat(); + bitField0_ |= 0x00000004; + break; + } // case 29 + case 37: { + power_ = input.readFloat(); + bitField0_ |= 0x00000008; + break; + } // case 37 + case 40: { + version_ = input.readInt32(); + bitField0_ |= 0x00000010; + break; + } // case 40 + case 48: { + type_ = input.readInt32(); + bitField0_ |= 0x00000020; + break; + } // case 48 + case 61: { + maxRange_ = input.readFloat(); + bitField0_ |= 0x00000040; + break; + } // case 61 + case 69: { + frequency_ = input.readFloat(); + bitField0_ |= 0x00000080; + break; + } // case 69 + default: { + if (!super.parseUnknownField(input, extensionRegistry, tag)) { + done = true; // was an endgroup tag + } + break; + } // default: + } // switch (tag) + } // while (!done) + } catch (com.google.protobuf.InvalidProtocolBufferException e) { + throw e.unwrapIOException(); + } finally { + onChanged(); + } // finally + return this; + } + private int bitField0_; + + private java.lang.Object name_ = ""; + /** + * string name = 1; + * @return The name. + */ + public java.lang.String getName() { + java.lang.Object ref = name_; + if (!(ref instanceof java.lang.String)) { + com.google.protobuf.ByteString bs = + (com.google.protobuf.ByteString) ref; + java.lang.String s = bs.toStringUtf8(); + name_ = s; + return s; + } else { + return (java.lang.String) ref; + } + } + /** + * string name = 1; + * @return The bytes for name. + */ + public com.google.protobuf.ByteString + getNameBytes() { + java.lang.Object ref = name_; + if (ref instanceof String) { + com.google.protobuf.ByteString b = + com.google.protobuf.ByteString.copyFromUtf8( + (java.lang.String) ref); + name_ = b; + return b; + } else { + return (com.google.protobuf.ByteString) ref; + } + } + /** + * string name = 1; + * @param value The name to set. + * @return This builder for chaining. + */ + public Builder setName( + java.lang.String value) { + if (value == null) { throw new NullPointerException(); } + name_ = value; + bitField0_ |= 0x00000001; + onChanged(); + return this; + } + /** + * string name = 1; + * @return This builder for chaining. + */ + public Builder clearName() { + name_ = getDefaultInstance().getName(); + bitField0_ = (bitField0_ & ~0x00000001); + onChanged(); + return this; + } + /** + * string name = 1; + * @param value The bytes for name to set. + * @return This builder for chaining. + */ + public Builder setNameBytes( + com.google.protobuf.ByteString value) { + if (value == null) { throw new NullPointerException(); } + checkByteStringIsUtf8(value); + name_ = value; + bitField0_ |= 0x00000001; + onChanged(); + return this; + } + + private java.lang.Object vendor_ = ""; + /** + * string vendor = 2; + * @return The vendor. + */ + public java.lang.String getVendor() { + java.lang.Object ref = vendor_; + if (!(ref instanceof java.lang.String)) { + com.google.protobuf.ByteString bs = + (com.google.protobuf.ByteString) ref; + java.lang.String s = bs.toStringUtf8(); + vendor_ = s; + return s; + } else { + return (java.lang.String) ref; + } + } + /** + * string vendor = 2; + * @return The bytes for vendor. + */ + public com.google.protobuf.ByteString + getVendorBytes() { + java.lang.Object ref = vendor_; + if (ref instanceof String) { + com.google.protobuf.ByteString b = + com.google.protobuf.ByteString.copyFromUtf8( + (java.lang.String) ref); + vendor_ = b; + return b; + } else { + return (com.google.protobuf.ByteString) ref; + } + } + /** + * string vendor = 2; + * @param value The vendor to set. + * @return This builder for chaining. + */ + public Builder setVendor( + java.lang.String value) { + if (value == null) { throw new NullPointerException(); } + vendor_ = value; + bitField0_ |= 0x00000002; + onChanged(); + return this; + } + /** + * string vendor = 2; + * @return This builder for chaining. + */ + public Builder clearVendor() { + vendor_ = getDefaultInstance().getVendor(); + bitField0_ = (bitField0_ & ~0x00000002); + onChanged(); + return this; + } + /** + * string vendor = 2; + * @param value The bytes for vendor to set. + * @return This builder for chaining. + */ + public Builder setVendorBytes( + com.google.protobuf.ByteString value) { + if (value == null) { throw new NullPointerException(); } + checkByteStringIsUtf8(value); + vendor_ = value; + bitField0_ |= 0x00000002; + onChanged(); + return this; + } + + private float resolution_ ; + /** + * float resolution = 3; + * @return The resolution. + */ + @java.lang.Override + public float getResolution() { + return resolution_; + } + /** + * float resolution = 3; + * @param value The resolution to set. + * @return This builder for chaining. + */ + public Builder setResolution(float value) { + + resolution_ = value; + bitField0_ |= 0x00000004; + onChanged(); + return this; + } + /** + * float resolution = 3; + * @return This builder for chaining. + */ + public Builder clearResolution() { + bitField0_ = (bitField0_ & ~0x00000004); + resolution_ = 0F; + onChanged(); + return this; + } + + private float power_ ; + /** + * float power = 4; + * @return The power. + */ + @java.lang.Override + public float getPower() { + return power_; + } + /** + * float power = 4; + * @param value The power to set. + * @return This builder for chaining. + */ + public Builder setPower(float value) { + + power_ = value; + bitField0_ |= 0x00000008; + onChanged(); + return this; + } + /** + * float power = 4; + * @return This builder for chaining. + */ + public Builder clearPower() { + bitField0_ = (bitField0_ & ~0x00000008); + power_ = 0F; + onChanged(); + return this; + } + + private int version_ ; + /** + * int32 version = 5; + * @return The version. + */ + @java.lang.Override + public int getVersion() { + return version_; + } + /** + * int32 version = 5; + * @param value The version to set. + * @return This builder for chaining. + */ + public Builder setVersion(int value) { + + version_ = value; + bitField0_ |= 0x00000010; + onChanged(); + return this; + } + /** + * int32 version = 5; + * @return This builder for chaining. + */ + public Builder clearVersion() { + bitField0_ = (bitField0_ & ~0x00000010); + version_ = 0; + onChanged(); + return this; + } + + private int type_ ; + /** + * int32 type = 6; + * @return The type. + */ + @java.lang.Override + public int getType() { + return type_; + } + /** + * int32 type = 6; + * @param value The type to set. + * @return This builder for chaining. + */ + public Builder setType(int value) { + + type_ = value; + bitField0_ |= 0x00000020; + onChanged(); + return this; + } + /** + * int32 type = 6; + * @return This builder for chaining. + */ + public Builder clearType() { + bitField0_ = (bitField0_ & ~0x00000020); + type_ = 0; + onChanged(); + return this; + } + + private float maxRange_ ; + /** + * float max_range = 7; + * @return The maxRange. + */ + @java.lang.Override + public float getMaxRange() { + return maxRange_; + } + /** + * float max_range = 7; + * @param value The maxRange to set. + * @return This builder for chaining. + */ + public Builder setMaxRange(float value) { + + maxRange_ = value; + bitField0_ |= 0x00000040; + onChanged(); + return this; + } + /** + * float max_range = 7; + * @return This builder for chaining. + */ + public Builder clearMaxRange() { + bitField0_ = (bitField0_ & ~0x00000040); + maxRange_ = 0F; + onChanged(); + return this; + } + + private float frequency_ ; + /** + * float frequency = 8; + * @return The frequency. + */ + @java.lang.Override + public float getFrequency() { + return frequency_; + } + /** + * float frequency = 8; + * @param value The frequency to set. + * @return This builder for chaining. + */ + public Builder setFrequency(float value) { + + frequency_ = value; + bitField0_ |= 0x00000080; + onChanged(); + return this; + } + /** + * float frequency = 8; + * @return This builder for chaining. + */ + public Builder clearFrequency() { + bitField0_ = (bitField0_ & ~0x00000080); + frequency_ = 0F; + onChanged(); + return this; + } + + // @@protoc_insertion_point(builder_scope:SensorInfo) + } + + // @@protoc_insertion_point(class_scope:SensorInfo) + private static final com.openpositioning.PositionMe.Traj.SensorInfo DEFAULT_INSTANCE; + static { + DEFAULT_INSTANCE = new com.openpositioning.PositionMe.Traj.SensorInfo(); + } + + public static com.openpositioning.PositionMe.Traj.SensorInfo getDefaultInstance() { + return DEFAULT_INSTANCE; + } + + private static final com.google.protobuf.Parser + PARSER = new com.google.protobuf.AbstractParser() { + @java.lang.Override + public SensorInfo parsePartialFrom( + com.google.protobuf.CodedInputStream input, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + Builder builder = newBuilder(); + try { + builder.mergeFrom(input, extensionRegistry); + } catch (com.google.protobuf.InvalidProtocolBufferException e) { + throw e.setUnfinishedMessage(builder.buildPartial()); + } catch (com.google.protobuf.UninitializedMessageException e) { + throw e.asInvalidProtocolBufferException().setUnfinishedMessage(builder.buildPartial()); + } catch (java.io.IOException e) { + throw new com.google.protobuf.InvalidProtocolBufferException(e) + .setUnfinishedMessage(builder.buildPartial()); + } + return builder.buildPartial(); + } + }; + + public static com.google.protobuf.Parser parser() { + return PARSER; + } + + @java.lang.Override + public com.google.protobuf.Parser getParserForType() { + return PARSER; + } + + @java.lang.Override + public com.openpositioning.PositionMe.Traj.SensorInfo getDefaultInstanceForType() { + return DEFAULT_INSTANCE; + } + + } + + private static final com.google.protobuf.Descriptors.Descriptor + internal_static_Trajectory_descriptor; + private static final + com.google.protobuf.GeneratedMessage.FieldAccessorTable + internal_static_Trajectory_fieldAccessorTable; + private static final com.google.protobuf.Descriptors.Descriptor + internal_static_RelativePosition_descriptor; + private static final + com.google.protobuf.GeneratedMessage.FieldAccessorTable + internal_static_RelativePosition_fieldAccessorTable; + private static final com.google.protobuf.Descriptors.Descriptor + internal_static_IMUReading_descriptor; + private static final + com.google.protobuf.GeneratedMessage.FieldAccessorTable + internal_static_IMUReading_fieldAccessorTable; + private static final com.google.protobuf.Descriptors.Descriptor + internal_static_MagnetometerReading_descriptor; + private static final + com.google.protobuf.GeneratedMessage.FieldAccessorTable + internal_static_MagnetometerReading_fieldAccessorTable; + private static final com.google.protobuf.Descriptors.Descriptor + internal_static_BarometerReading_descriptor; + private static final + com.google.protobuf.GeneratedMessage.FieldAccessorTable + internal_static_BarometerReading_fieldAccessorTable; + private static final com.google.protobuf.Descriptors.Descriptor + internal_static_LightReading_descriptor; + private static final + com.google.protobuf.GeneratedMessage.FieldAccessorTable + internal_static_LightReading_fieldAccessorTable; + private static final com.google.protobuf.Descriptors.Descriptor + internal_static_ProximityReading_descriptor; + private static final + com.google.protobuf.GeneratedMessage.FieldAccessorTable + internal_static_ProximityReading_fieldAccessorTable; + private static final com.google.protobuf.Descriptors.Descriptor + internal_static_GNSSPosition_descriptor; + private static final + com.google.protobuf.GeneratedMessage.FieldAccessorTable + internal_static_GNSSPosition_fieldAccessorTable; + private static final com.google.protobuf.Descriptors.Descriptor + internal_static_GNSSReading_descriptor; + private static final + com.google.protobuf.GeneratedMessage.FieldAccessorTable + internal_static_GNSSReading_fieldAccessorTable; + private static final com.google.protobuf.Descriptors.Descriptor + internal_static_Fingerprint_descriptor; + private static final + com.google.protobuf.GeneratedMessage.FieldAccessorTable + internal_static_Fingerprint_fieldAccessorTable; + private static final com.google.protobuf.Descriptors.Descriptor + internal_static_RFScan_descriptor; + private static final + com.google.protobuf.GeneratedMessage.FieldAccessorTable + internal_static_RFScan_fieldAccessorTable; + private static final com.google.protobuf.Descriptors.Descriptor + internal_static_WiFiRTTReading_descriptor; + private static final + com.google.protobuf.GeneratedMessage.FieldAccessorTable + internal_static_WiFiRTTReading_fieldAccessorTable; + private static final com.google.protobuf.Descriptors.Descriptor + internal_static_WiFiAPData_descriptor; + private static final + com.google.protobuf.GeneratedMessage.FieldAccessorTable + internal_static_WiFiAPData_fieldAccessorTable; + private static final com.google.protobuf.Descriptors.Descriptor + internal_static_BleData_descriptor; + private static final + com.google.protobuf.GeneratedMessage.FieldAccessorTable + internal_static_BleData_fieldAccessorTable; + private static final com.google.protobuf.Descriptors.Descriptor + internal_static_Vector3_descriptor; + private static final + com.google.protobuf.GeneratedMessage.FieldAccessorTable + internal_static_Vector3_fieldAccessorTable; + private static final com.google.protobuf.Descriptors.Descriptor + internal_static_Quaternion_descriptor; + private static final + com.google.protobuf.GeneratedMessage.FieldAccessorTable + internal_static_Quaternion_fieldAccessorTable; + private static final com.google.protobuf.Descriptors.Descriptor + internal_static_SensorInfo_descriptor; + private static final + com.google.protobuf.GeneratedMessage.FieldAccessorTable + internal_static_SensorInfo_fieldAccessorTable; + + public static com.google.protobuf.Descriptors.FileDescriptor + getDescriptor() { + return descriptor; + } + private static com.google.protobuf.Descriptors.FileDescriptor + descriptor; + static { + java.lang.String[] descriptorData = { + "\n\ntraj.proto\"\277\007\n\nTrajectory\022\027\n\017android_v" + + "ersion\030\001 \001(\t\022\032\n\022trajectory_version\030\002 \001(\002" + + "\022\025\n\rtrajectory_id\030\003 \001(\t\022\035\n\010imu_data\030\004 \003(" + + "\0132\013.IMUReading\022#\n\010pdr_data\030\005 \003(\0132\021.Relat" + + "ivePosition\022/\n\021magnetometer_data\030\006 \003(\0132\024" + + ".MagnetometerReading\022(\n\rpressure_data\030\007 " + + "\003(\0132\021.BarometerReading\022!\n\nlight_data\030\010 \003" + + "(\0132\r.LightReading\022)\n\016proximity_data\030\t \003(" + + "\0132\021.ProximityReading\022\037\n\tgnss_data\030\n \003(\0132" + + "\014.GNSSReading\022\'\n\021wifi_fingerprints\030\013 \003(\013" + + "2\014.Fingerprint\022\035\n\010aps_data\030\014 \003(\0132\013.WiFiA" + + "PData\022&\n\rwifi_rtt_data\030\r \003(\0132\017.WiFiRTTRe" + + "ading\022&\n\020ble_fingerprints\030\016 \003(\0132\014.Finger" + + "print\022\032\n\010ble_data\030\017 \003(\0132\010.BleData\022\027\n\017sta" + + "rt_timestamp\030\020 \001(\003\022\'\n\020initial_position\030\021" + + " \001(\0132\r.GNSSPosition\022*\n\023corrected_positio" + + "ns\030\022 \003(\0132\r.GNSSPosition\022\'\n\022accelerometer" + + "_info\030\023 \001(\0132\013.SensorInfo\022#\n\016gyroscope_in" + + "fo\030\024 \001(\0132\013.SensorInfo\022)\n\024rotation_vector" + + "_info\030\025 \001(\0132\013.SensorInfo\022&\n\021magnetometer" + + "_info\030\026 \001(\0132\013.SensorInfo\022#\n\016barometer_in" + + "fo\030\027 \001(\0132\013.SensorInfo\022&\n\021light_sensor_in" + + "fo\030\030 \001(\0132\013.SensorInfo\022#\n\016proximity_info\030" + + "\031 \001(\0132\013.SensorInfo\022\"\n\013test_points\030\032 \003(\0132" + + "\r.GNSSPosition\"D\n\020RelativePosition\022\032\n\022re" + + "lative_timestamp\030\001 \001(\003\022\t\n\001x\030\002 \001(\002\022\t\n\001y\030\003" + + " \001(\002\"\220\001\n\nIMUReading\022\032\n\022relative_timestam" + + "p\030\001 \001(\003\022\025\n\003acc\030\002 \001(\0132\010.Vector3\022\025\n\003gyr\030\003 " + + "\001(\0132\010.Vector3\022$\n\017rotation_vector\030\004 \001(\0132\013" + + ".Quaternion\022\022\n\nstep_count\030\005 \001(\005\"H\n\023Magne" + + "tometerReading\022\032\n\022relative_timestamp\030\001 \001" + + "(\003\022\025\n\003mag\030\002 \001(\0132\010.Vector3\"@\n\020BarometerRe" + + "ading\022\032\n\022relative_timestamp\030\001 \001(\003\022\020\n\010pre" + + "ssure\030\002 \001(\002\"9\n\014LightReading\022\032\n\022relative_" + + "timestamp\030\001 \001(\003\022\r\n\005light\030\002 \001(\002\"@\n\020Proxim" + + "ityReading\022\032\n\022relative_timestamp\030\001 \001(\003\022\020" + + "\n\010distance\030\002 \001(\002\"\177\n\014GNSSPosition\022\032\n\022rela" + + "tive_timestamp\030\001 \001(\003\022\020\n\010latitude\030\002 \001(\001\022\021" + + "\n\tlongitude\030\003 \001(\001\022\020\n\010altitude\030\004 \001(\001\022\022\n\005f" + + "loor\030\005 \001(\tH\000\210\001\001B\010\n\006_floor\"r\n\013GNSSReading" + + "\022\037\n\010position\030\001 \001(\0132\r.GNSSPosition\022\020\n\010acc" + + "uracy\030\002 \001(\002\022\r\n\005speed\030\003 \001(\002\022\017\n\007bearing\030\004 " + + "\001(\002\022\020\n\010provider\030\005 \001(\t\"D\n\013Fingerprint\022\032\n\022" + + "relative_timestamp\030\001 \001(\003\022\031\n\010rf_scans\030\002 \003" + + "(\0132\007.RFScan\"r\n\006RFScan\022\032\n\022relative_timest" + + "amp\030\001 \001(\003\022\013\n\003mac\030\002 \001(\003\022\014\n\004rssi\030\003 \001(\005\022$\n\010" + + "position\030\004 \001(\0132\r.GNSSPositionH\000\210\001\001B\013\n\t_p" + + "osition\"o\n\016WiFiRTTReading\022\032\n\022relative_ti" + + "mestamp\030\001 \001(\003\022\013\n\003mac\030\002 \001(\003\022\020\n\010distance\030\003" + + " \001(\002\022\024\n\014distance_std\030\004 \001(\002\022\014\n\004rssi\030\005 \001(\005" + + "\"O\n\nWiFiAPData\022\013\n\003mac\030\001 \001(\003\022\014\n\004ssid\030\002 \001(" + + "\t\022\021\n\tfrequency\030\003 \001(\003\022\023\n\013rtt_enabled\030\004 \001(" + + "\010\"\217\001\n\007BleData\022\023\n\013mac_address\030\001 \001(\t\022\014\n\004na" + + "me\030\002 \001(\t\022\026\n\016tx_power_level\030\003 \001(\005\022\027\n\017adve" + + "rtise_flags\030\004 \001(\005\022\025\n\rservice_uuids\030\005 \003(\t" + + "\022\031\n\021manufacturer_data\030\006 \001(\014\"*\n\007Vector3\022\t" + + "\n\001x\030\001 \001(\002\022\t\n\001y\030\002 \001(\002\022\t\n\001z\030\003 \001(\002\"8\n\nQuate" + + "rnion\022\t\n\001x\030\001 \001(\002\022\t\n\001y\030\002 \001(\002\022\t\n\001z\030\003 \001(\002\022\t" + + "\n\001w\030\004 \001(\002\"\222\001\n\nSensorInfo\022\014\n\004name\030\001 \001(\t\022\016" + + "\n\006vendor\030\002 \001(\t\022\022\n\nresolution\030\003 \001(\002\022\r\n\005po" + + "wer\030\004 \001(\002\022\017\n\007version\030\005 \001(\005\022\014\n\004type\030\006 \001(\005" + + "\022\021\n\tmax_range\030\007 \001(\002\022\021\n\tfrequency\030\010 \001(\002B(" + + "\n\036com.openpositioning.PositionMeB\004TrajP\000" + + "b\006proto3" + }; + descriptor = com.google.protobuf.Descriptors.FileDescriptor + .internalBuildGeneratedFileFrom(descriptorData, + new com.google.protobuf.Descriptors.FileDescriptor[] { + }); + internal_static_Trajectory_descriptor = + getDescriptor().getMessageTypes().get(0); + internal_static_Trajectory_fieldAccessorTable = new + com.google.protobuf.GeneratedMessage.FieldAccessorTable( + internal_static_Trajectory_descriptor, + new java.lang.String[] { "AndroidVersion", "TrajectoryVersion", "TrajectoryId", "ImuData", "PdrData", "MagnetometerData", "PressureData", "LightData", "ProximityData", "GnssData", "WifiFingerprints", "ApsData", "WifiRttData", "BleFingerprints", "BleData", "StartTimestamp", "InitialPosition", "CorrectedPositions", "AccelerometerInfo", "GyroscopeInfo", "RotationVectorInfo", "MagnetometerInfo", "BarometerInfo", "LightSensorInfo", "ProximityInfo", "TestPoints", }); + internal_static_RelativePosition_descriptor = + getDescriptor().getMessageTypes().get(1); + internal_static_RelativePosition_fieldAccessorTable = new + com.google.protobuf.GeneratedMessage.FieldAccessorTable( + internal_static_RelativePosition_descriptor, + new java.lang.String[] { "RelativeTimestamp", "X", "Y", }); + internal_static_IMUReading_descriptor = + getDescriptor().getMessageTypes().get(2); + internal_static_IMUReading_fieldAccessorTable = new + com.google.protobuf.GeneratedMessage.FieldAccessorTable( + internal_static_IMUReading_descriptor, + new java.lang.String[] { "RelativeTimestamp", "Acc", "Gyr", "RotationVector", "StepCount", }); + internal_static_MagnetometerReading_descriptor = + getDescriptor().getMessageTypes().get(3); + internal_static_MagnetometerReading_fieldAccessorTable = new + com.google.protobuf.GeneratedMessage.FieldAccessorTable( + internal_static_MagnetometerReading_descriptor, + new java.lang.String[] { "RelativeTimestamp", "Mag", }); + internal_static_BarometerReading_descriptor = + getDescriptor().getMessageTypes().get(4); + internal_static_BarometerReading_fieldAccessorTable = new + com.google.protobuf.GeneratedMessage.FieldAccessorTable( + internal_static_BarometerReading_descriptor, + new java.lang.String[] { "RelativeTimestamp", "Pressure", }); + internal_static_LightReading_descriptor = + getDescriptor().getMessageTypes().get(5); + internal_static_LightReading_fieldAccessorTable = new + com.google.protobuf.GeneratedMessage.FieldAccessorTable( + internal_static_LightReading_descriptor, + new java.lang.String[] { "RelativeTimestamp", "Light", }); + internal_static_ProximityReading_descriptor = + getDescriptor().getMessageTypes().get(6); + internal_static_ProximityReading_fieldAccessorTable = new + com.google.protobuf.GeneratedMessage.FieldAccessorTable( + internal_static_ProximityReading_descriptor, + new java.lang.String[] { "RelativeTimestamp", "Distance", }); + internal_static_GNSSPosition_descriptor = + getDescriptor().getMessageTypes().get(7); + internal_static_GNSSPosition_fieldAccessorTable = new + com.google.protobuf.GeneratedMessage.FieldAccessorTable( + internal_static_GNSSPosition_descriptor, + new java.lang.String[] { "RelativeTimestamp", "Latitude", "Longitude", "Altitude", "Floor", }); + internal_static_GNSSReading_descriptor = + getDescriptor().getMessageTypes().get(8); + internal_static_GNSSReading_fieldAccessorTable = new + com.google.protobuf.GeneratedMessage.FieldAccessorTable( + internal_static_GNSSReading_descriptor, + new java.lang.String[] { "Position", "Accuracy", "Speed", "Bearing", "Provider", }); + internal_static_Fingerprint_descriptor = + getDescriptor().getMessageTypes().get(9); + internal_static_Fingerprint_fieldAccessorTable = new + com.google.protobuf.GeneratedMessage.FieldAccessorTable( + internal_static_Fingerprint_descriptor, + new java.lang.String[] { "RelativeTimestamp", "RfScans", }); + internal_static_RFScan_descriptor = + getDescriptor().getMessageTypes().get(10); + internal_static_RFScan_fieldAccessorTable = new + com.google.protobuf.GeneratedMessage.FieldAccessorTable( + internal_static_RFScan_descriptor, + new java.lang.String[] { "RelativeTimestamp", "Mac", "Rssi", "Position", }); + internal_static_WiFiRTTReading_descriptor = + getDescriptor().getMessageTypes().get(11); + internal_static_WiFiRTTReading_fieldAccessorTable = new + com.google.protobuf.GeneratedMessage.FieldAccessorTable( + internal_static_WiFiRTTReading_descriptor, + new java.lang.String[] { "RelativeTimestamp", "Mac", "Distance", "DistanceStd", "Rssi", }); + internal_static_WiFiAPData_descriptor = + getDescriptor().getMessageTypes().get(12); + internal_static_WiFiAPData_fieldAccessorTable = new + com.google.protobuf.GeneratedMessage.FieldAccessorTable( + internal_static_WiFiAPData_descriptor, + new java.lang.String[] { "Mac", "Ssid", "Frequency", "RttEnabled", }); + internal_static_BleData_descriptor = + getDescriptor().getMessageTypes().get(13); + internal_static_BleData_fieldAccessorTable = new + com.google.protobuf.GeneratedMessage.FieldAccessorTable( + internal_static_BleData_descriptor, + new java.lang.String[] { "MacAddress", "Name", "TxPowerLevel", "AdvertiseFlags", "ServiceUuids", "ManufacturerData", }); + internal_static_Vector3_descriptor = + getDescriptor().getMessageTypes().get(14); + internal_static_Vector3_fieldAccessorTable = new + com.google.protobuf.GeneratedMessage.FieldAccessorTable( + internal_static_Vector3_descriptor, + new java.lang.String[] { "X", "Y", "Z", }); + internal_static_Quaternion_descriptor = + getDescriptor().getMessageTypes().get(15); + internal_static_Quaternion_fieldAccessorTable = new + com.google.protobuf.GeneratedMessage.FieldAccessorTable( + internal_static_Quaternion_descriptor, + new java.lang.String[] { "X", "Y", "Z", "W", }); + internal_static_SensorInfo_descriptor = + getDescriptor().getMessageTypes().get(16); + internal_static_SensorInfo_fieldAccessorTable = new + com.google.protobuf.GeneratedMessage.FieldAccessorTable( + internal_static_SensorInfo_descriptor, + new java.lang.String[] { "Name", "Vendor", "Resolution", "Power", "Version", "Type", "MaxRange", "Frequency", }); + descriptor.resolveAllFeaturesImmutable(); + } + + // @@protoc_insertion_point(outer_class_scope) +} From cca343baa53c43cea2ad3b37be1af5ffad291423 Mon Sep 17 00:00:00 2001 From: Haoning Huang Date: Mon, 9 Feb 2026 14:54:36 +0000 Subject: [PATCH 03/82] feat: Add trajectory name input dialog Features: - Show input dialog when user clicks Set button - User enters trajectory name before recording starts - Name saved to trajectory_id field in Proto - Auto-generate name with timestamp if empty Implementation: - Added showTrajectoryNameDialog() in StartLocationFragment - Added setTrajectoryName() and getTrajectoryName() in SensorFusion - Set trajectoryId when creating Trajectory object --- .../fragment/StartLocationFragment.java | 99 ++++++++++++++----- .../PositionMe/sensors/SensorFusion.java | 21 ++++ build.gradle | 5 +- 3 files changed, 99 insertions(+), 26 deletions(-) diff --git a/app/src/main/java/com/openpositioning/PositionMe/presentation/fragment/StartLocationFragment.java b/app/src/main/java/com/openpositioning/PositionMe/presentation/fragment/StartLocationFragment.java index ee14f69f..78ede15f 100644 --- a/app/src/main/java/com/openpositioning/PositionMe/presentation/fragment/StartLocationFragment.java +++ b/app/src/main/java/com/openpositioning/PositionMe/presentation/fragment/StartLocationFragment.java @@ -6,6 +6,7 @@ import android.view.ViewGroup; import android.widget.Button; + import androidx.annotation.NonNull; import androidx.annotation.Nullable; import androidx.appcompat.app.AppCompatActivity; @@ -159,38 +160,86 @@ public void onViewCreated(@NonNull View view, @Nullable Bundle savedInstanceStat this.button.setOnClickListener(new View.OnClickListener() { /** * {@inheritDoc} - * When button clicked the PDR recording can start and the start position is stored for - * the {@link CorrectionFragment} to display. The {@link RecordingFragment} is loaded. + * When button clicked, first ask for trajectory name, then start PDR recording */ @Override public void onClick(View view) { - float chosenLat = startPosition[0]; - float chosenLon = startPosition[1]; - - // If the Activity is RecordingActivity - if (requireActivity() instanceof RecordingActivity) { - // Start sensor recording + set the start location - sensorFusion.startRecording(); - sensorFusion.setStartGNSSLatitude(startPosition); - - // Now switch to the recording screen - ((RecordingActivity) requireActivity()).showRecordingScreen(); - - // If the Activity is ReplayActivity - } else if (requireActivity() instanceof ReplayActivity) { - // *Do not* cast to RecordingActivity here - // Just call the Replay method - ((ReplayActivity) requireActivity()).onStartLocationChosen(chosenLat, chosenLon); - - // Otherwise (unexpected host) - } else { - // Optional: log or handle error - // Log.e("StartLocationFragment", "Unknown host Activity: " + requireActivity()); - } + // Show dialog to get trajectory name + showTrajectoryNameDialog(); } }); } + /** + * Show dialog to get trajectory name from user + */ + private void showTrajectoryNameDialog() { + // Create EditText for input + final android.widget.EditText input = new android.widget.EditText(requireContext()); + input.setHint("e.g., Building_A_Floor_1"); + input.setInputType(android.text.InputType.TYPE_CLASS_TEXT); + + // Set some padding for better UX + int padding = (int) (16 * getResources().getDisplayMetrics().density); + input.setPadding(padding, padding, padding, padding); + + // Create dialog + new androidx.appcompat.app.AlertDialog.Builder(requireContext()) + .setTitle("Enter Trajectory Name") + .setMessage("Please provide a name for this trajectory recording:") + .setView(input) + .setPositiveButton("Start Recording", new android.content.DialogInterface.OnClickListener() { + @Override + public void onClick(android.content.DialogInterface dialog, int which) { + String trajectoryName = input.getText().toString().trim(); + + // If empty, use default name with timestamp + if (trajectoryName.isEmpty()) { + trajectoryName = "Trajectory_" + System.currentTimeMillis(); + } + + // Start recording with the name + startRecordingWithName(trajectoryName); + } + }) + .setNegativeButton("Cancel", new android.content.DialogInterface.OnClickListener() { + @Override + public void onClick(android.content.DialogInterface dialog, int which) { + dialog.cancel(); + } + }) + .show(); + } + + /** + * Start recording with trajectory name + */ + private void startRecordingWithName(String trajectoryName) { + float chosenLat = startPosition[0]; + float chosenLon = startPosition[1]; + + // If the Activity is RecordingActivity + if (requireActivity() instanceof RecordingActivity) { + // Set trajectory name in SensorFusion + sensorFusion.setTrajectoryName(trajectoryName); + + // Start sensor recording + set the start location + sensorFusion.startRecording(); + sensorFusion.setStartGNSSLatitude(startPosition); + + // Now switch to the recording screen + ((RecordingActivity) requireActivity()).showRecordingScreen(); + + } else if (requireActivity() instanceof ReplayActivity) { + // For replay, just proceed without trajectory name + ((ReplayActivity) requireActivity()).onStartLocationChosen(chosenLat, chosenLon); + + } else { + // Optional: log or handle error + android.util.Log.e("StartLocationFragment", "Unknown host Activity: " + requireActivity()); + } + } + /** * Switches the indoor map to the specified floor. * diff --git a/app/src/main/java/com/openpositioning/PositionMe/sensors/SensorFusion.java b/app/src/main/java/com/openpositioning/PositionMe/sensors/SensorFusion.java index a5a69ba9..32a82ee4 100644 --- a/app/src/main/java/com/openpositioning/PositionMe/sensors/SensorFusion.java +++ b/app/src/main/java/com/openpositioning/PositionMe/sensors/SensorFusion.java @@ -86,6 +86,9 @@ public class SensorFusion implements SensorEventListener, Observer { private PowerManager.WakeLock wakeLock; private Context appContext; + //add trajectoryName + private String trajectoryName = ""; + // Settings private SharedPreferences settings; @@ -159,6 +162,7 @@ public class SensorFusion implements SensorEventListener, Observer { // WiFi positioning object private WiFiPositioning wiFiPositioning; + //region Initialisation /** * Private constructor for implementing singleton design pattern for SensorFusion. @@ -847,6 +851,21 @@ public void stopListening() { } } + /** + * Set trajectory name before recording starts + */ + public void setTrajectoryName(String name) { + this.trajectoryName = name; + android.util.Log.i("SensorFusion", "Trajectory name set: " + name); + } + + /** + * Get trajectory name + */ + public String getTrajectoryName() { + return this.trajectoryName; + } + /** * Enables saving sensor values to the trajectory object. * @@ -871,6 +890,7 @@ public void startRecording() { this.trajectory = Traj.Trajectory.newBuilder() .setAndroidVersion(Build.VERSION.RELEASE) .setStartTimestamp(absoluteStartTime) + .setTrajectoryId(trajectoryName) .setAccelerometerInfo(createInfoBuilder(accelerometerSensor)) .setGyroscopeInfo(createInfoBuilder(gyroscopeSensor)) .setMagnetometerInfo(createInfoBuilder(magnetometerSensor)) @@ -898,6 +918,7 @@ public void startRecording() { * @see Traj object for storing data. * @see SettingsFragment navigation that might cancel recording. */ + public void stopRecording() { // Only cancel if we are running if(this.saveRecording) { diff --git a/build.gradle b/build.gradle index e208c000..4b1a229d 100644 --- a/build.gradle +++ b/build.gradle @@ -1,12 +1,15 @@ // Top-level build file buildscript { + ext { + agp_version = '8.7.0' + } repositories { google() mavenCentral() } dependencies { // NOTE: Only classpath deps (plugins) go here - classpath 'com.android.tools.build:gradle:8.8.0' + classpath "com.android.tools.build:gradle:$agp_version" classpath 'com.google.gms:google-services:4.4.2' def nav_version = "2.5.3" classpath "androidx.navigation:navigation-safe-args-gradle-plugin:$nav_version" From 909059058e6034deb9a82a815e99ddf80369f2ee Mon Sep 17 00:00:00 2001 From: Haoning Huang Date: Mon, 9 Feb 2026 15:50:35 +0000 Subject: [PATCH 04/82] feat: Add initial position recording Features: - Capture initial GPS position when recording starts - Save latitude, longitude, altitude to initial_position field - Log initial position for verification Implementation: - Added altitude member variable in SensorFusion - Added initialLatitude, initialLongitude, initialAltitude variables - Added setInitialPositionData() method - Set initial_position in Trajectory.newBuilder() - Call setInitialPositionData() before startRecording() --- .../fragment/StartLocationFragment.java | 3 ++ .../PositionMe/sensors/SensorFusion.java | 35 ++++++++++++++++--- 2 files changed, 34 insertions(+), 4 deletions(-) diff --git a/app/src/main/java/com/openpositioning/PositionMe/presentation/fragment/StartLocationFragment.java b/app/src/main/java/com/openpositioning/PositionMe/presentation/fragment/StartLocationFragment.java index 78ede15f..12aee7af 100644 --- a/app/src/main/java/com/openpositioning/PositionMe/presentation/fragment/StartLocationFragment.java +++ b/app/src/main/java/com/openpositioning/PositionMe/presentation/fragment/StartLocationFragment.java @@ -223,6 +223,9 @@ private void startRecordingWithName(String trajectoryName) { // Set trajectory name in SensorFusion sensorFusion.setTrajectoryName(trajectoryName); + // Set initial position + sensorFusion.setInitialPositionData(chosenLat, chosenLon); + // Start sensor recording + set the start location sensorFusion.startRecording(); sensorFusion.setStartGNSSLatitude(startPosition); diff --git a/app/src/main/java/com/openpositioning/PositionMe/sensors/SensorFusion.java b/app/src/main/java/com/openpositioning/PositionMe/sensors/SensorFusion.java index 32a82ee4..1bae7d22 100644 --- a/app/src/main/java/com/openpositioning/PositionMe/sensors/SensorFusion.java +++ b/app/src/main/java/com/openpositioning/PositionMe/sensors/SensorFusion.java @@ -86,9 +86,6 @@ public class SensorFusion implements SensorEventListener, Observer { private PowerManager.WakeLock wakeLock; private Context appContext; - //add trajectoryName - private String trajectoryName = ""; - // Settings private SharedPreferences settings; @@ -146,6 +143,17 @@ public class SensorFusion implements SensorEventListener, Observer { // Location values private float latitude; private float longitude; + private float altitude = 0.0f; + + //add trajectoryName + private String trajectoryName = ""; + + // Initial position data + private float initialLatitude = 0.0f; + private float initialLongitude = 0.0f; + private float initialAltitude = 0.0f; + + private float[] startLocation; // Wifi values private List wifiList; @@ -445,7 +453,7 @@ public void onLocationChanged(@NonNull Location location) { //Toast.makeText(context, "Location Changed", Toast.LENGTH_SHORT).show(); latitude = (float) location.getLatitude(); longitude = (float) location.getLongitude(); - float altitude = (float) location.getAltitude(); + altitude = (float) location.getAltitude(); float accuracy = (float) location.getAccuracy(); float speed = (float) location.getSpeed(); String provider = location.getProvider(); @@ -866,6 +874,19 @@ public String getTrajectoryName() { return this.trajectoryName; } + /** + * Set initial position data before recording starts + */ + public void setInitialPositionData(float lat, float lon) { + this.initialLatitude = lat; + this.initialLongitude = lon; + this.initialAltitude = this.altitude; + + android.util.Log.i("SensorFusion", String.format( + "Initial position set: lat=%.6f, lon=%.6f, alt=%.2fm", + initialLatitude, initialLongitude, initialAltitude)); + } + /** * Enables saving sensor values to the trajectory object. * @@ -891,6 +912,12 @@ public void startRecording() { .setAndroidVersion(Build.VERSION.RELEASE) .setStartTimestamp(absoluteStartTime) .setTrajectoryId(trajectoryName) + .setInitialPosition(Traj.GNSSPosition.newBuilder() // ← 添加这4行! + .setLatitude(initialLatitude) + .setLongitude(initialLongitude) + .setAltitude(initialAltitude) + .setRelativeTimestamp(0) + .build()) .setAccelerometerInfo(createInfoBuilder(accelerometerSensor)) .setGyroscopeInfo(createInfoBuilder(gyroscopeSensor)) .setMagnetometerInfo(createInfoBuilder(magnetometerSensor)) From 7cbe9377939c59e1d9f0755827290bb412b5bbb1 Mon Sep 17 00:00:00 2001 From: Haoning Huang Date: Mon, 9 Feb 2026 17:08:39 +0000 Subject: [PATCH 05/82] feat: Add initial orientation recording Features: - Capture initial orientation (rotation vector) when recording starts - Save quaternion (x, y, z, w) as first IMU reading - Initial orientation has timestamp 0 (starting point) Implementation: - Added initialRotation[4] array to store initial quaternion - Modified setInitialPositionData() to capture rotation vector - Add first IMU reading with initial orientation in startRecording() - Log initial orientation for verification --- .../PositionMe/sensors/SensorFusion.java | 29 ++++++++++++++++++- 1 file changed, 28 insertions(+), 1 deletion(-) diff --git a/app/src/main/java/com/openpositioning/PositionMe/sensors/SensorFusion.java b/app/src/main/java/com/openpositioning/PositionMe/sensors/SensorFusion.java index 1bae7d22..061e4c3a 100644 --- a/app/src/main/java/com/openpositioning/PositionMe/sensors/SensorFusion.java +++ b/app/src/main/java/com/openpositioning/PositionMe/sensors/SensorFusion.java @@ -153,6 +153,8 @@ public class SensorFusion implements SensorEventListener, Observer { private float initialLongitude = 0.0f; private float initialAltitude = 0.0f; + // Initial orientation data (rotation vector - quaternion) + private float[] initialRotation = new float[4]; private float[] startLocation; // Wifi values @@ -882,9 +884,18 @@ public void setInitialPositionData(float lat, float lon) { this.initialLongitude = lon; this.initialAltitude = this.altitude; + // Save initial orientation (rotation vector) + this.initialRotation[0] = this.rotation[0]; + this.initialRotation[1] = this.rotation[1]; + this.initialRotation[2] = this.rotation[2]; + this.initialRotation[3] = this.rotation[3]; + android.util.Log.i("SensorFusion", String.format( "Initial position set: lat=%.6f, lon=%.6f, alt=%.2fm", initialLatitude, initialLongitude, initialAltitude)); + android.util.Log.i("SensorFusion", String.format( + "Initial orientation set: quat[%.3f, %.3f, %.3f, %.3f]", + initialRotation[0], initialRotation[1], initialRotation[2], initialRotation[3])); } /** @@ -924,7 +935,23 @@ public void startRecording() { .setBarometerInfo(createInfoBuilder(barometerSensor)) .setLightSensorInfo(createInfoBuilder(lightSensor)); - + // Add the initial orientation as the first IMU reading + this.trajectory.addImuData(Traj.IMUReading.newBuilder() + .setRelativeTimestamp(0) // 时间戳为0(起始点) + .setAcc(Traj.Vector3.newBuilder() + .setX(0).setY(0).setZ(0) // 初始加速度设为0 + .build()) + .setGyr(Traj.Vector3.newBuilder() + .setX(0).setY(0).setZ(0) // 初始陀螺仪设为0 + .build()) + .setRotationVector(Traj.Quaternion.newBuilder() + .setX(initialRotation[0]) + .setY(initialRotation[1]) + .setZ(initialRotation[2]) + .setW(initialRotation[3]) + .build()) + .setStepCount(0) + .build()); this.storeTrajectoryTimer = new Timer(); this.storeTrajectoryTimer.schedule(new storeDataInTrajectory(), 0, TIME_CONST); From 88cb8b17fddbf4fe88c95864922c9550584f6c14 Mon Sep 17 00:00:00 2001 From: Haoning Huang Date: Mon, 9 Feb 2026 17:20:00 +0000 Subject: [PATCH 06/82] feat: Complete all 7 sensor info fields MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Added missing sensor info: - rotation_vector_info - proximity_info All 7 sensor info fields now recorded: ✅ accelerometer_info ✅ gyroscope_info ✅ rotation_vector_info ✅ magnetometer_info ✅ barometer_info ✅ light_sensor_info ✅ proximity_info --- .../com/openpositioning/PositionMe/sensors/SensorFusion.java | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/app/src/main/java/com/openpositioning/PositionMe/sensors/SensorFusion.java b/app/src/main/java/com/openpositioning/PositionMe/sensors/SensorFusion.java index 061e4c3a..fb62d462 100644 --- a/app/src/main/java/com/openpositioning/PositionMe/sensors/SensorFusion.java +++ b/app/src/main/java/com/openpositioning/PositionMe/sensors/SensorFusion.java @@ -931,9 +931,11 @@ public void startRecording() { .build()) .setAccelerometerInfo(createInfoBuilder(accelerometerSensor)) .setGyroscopeInfo(createInfoBuilder(gyroscopeSensor)) + .setRotationVectorInfo(createInfoBuilder(rotationSensor)) .setMagnetometerInfo(createInfoBuilder(magnetometerSensor)) .setBarometerInfo(createInfoBuilder(barometerSensor)) - .setLightSensorInfo(createInfoBuilder(lightSensor)); + .setLightSensorInfo(createInfoBuilder(lightSensor)) + .setProximityInfo(createInfoBuilder(proximitySensor)); // Add the initial orientation as the first IMU reading this.trajectory.addImuData(Traj.IMUReading.newBuilder() From 56330445064e1aa10888cef8dcde304125576263 Mon Sep 17 00:00:00 2001 From: Haoning Huang Date: Mon, 9 Feb 2026 18:31:43 +0000 Subject: [PATCH 07/82] feat: Add WiFi fingerprint deduplication Features: - Prevent duplicate WiFi fingerprints when user is stationary - Use 80% overlap ratio instead of exact match - Handle unstable WiFi signals intelligently Implementation: - Added lastWifiFingerprint to store previous fingerprint - Added isSameFingerprintAs() to compare fingerprints - Modified update() to check for duplicates before adding - Reset lastWifiFingerprint in startRecording() Logic: - If overlap ratio >= 90%, skip duplicate - If WiFi count < 3, always record (need more data) - Calculate overlap based on common MAC addresses --- .../PositionMe/sensors/SensorFusion.java | 99 ++++++++++++++++++- 1 file changed, 96 insertions(+), 3 deletions(-) diff --git a/app/src/main/java/com/openpositioning/PositionMe/sensors/SensorFusion.java b/app/src/main/java/com/openpositioning/PositionMe/sensors/SensorFusion.java index fb62d462..f16628a1 100644 --- a/app/src/main/java/com/openpositioning/PositionMe/sensors/SensorFusion.java +++ b/app/src/main/java/com/openpositioning/PositionMe/sensors/SensorFusion.java @@ -63,6 +63,9 @@ public class SensorFusion implements SensorEventListener, Observer { private HashMap lastEventTimestamps = new HashMap<>(); private HashMap eventCounts = new HashMap<>(); + //Save the last WiFi fingerprint for deduplication. + private Traj.Fingerprint lastWifiFingerprint = null; + long maxReportLatencyNs = 0; // Disable batching to deliver events immediately // Define a threshold for large time gaps (in milliseconds) @@ -489,19 +492,108 @@ public void update(Object[] wifiList) { this.wifiList = Stream.of(wifiList).map(o -> (Wifi) o).collect(Collectors.toList()); if(this.saveRecording) { + // Building a new WiFi fingerprint Traj.Fingerprint.Builder wifiData = Traj.Fingerprint.newBuilder() .setRelativeTimestamp(SystemClock.uptimeMillis()-bootTime); for (Wifi data : this.wifiList) { wifiData.addRfScans(Traj.RFScan.newBuilder() .setRelativeTimestamp(SystemClock.uptimeMillis() - bootTime) - .setMac(data.getBssid()).setRssi(data.getLevel())); + .setMac(data.getBssid()) + .setRssi(data.getLevel()) + .build()); + } + + Traj.Fingerprint newFingerprint = wifiData.build(); + + if (!isSameFingerprintAs(newFingerprint, lastWifiFingerprint)) { + // Only add when the fingerprint changes + this.trajectory.addWifiFingerprints(newFingerprint); + lastWifiFingerprint = newFingerprint; // save this fingerprint for comparison + android.util.Log.i("SensorFusion", "New WiFi fingerprint added (" + + newFingerprint.getRfScansCount() + " APs)"); + } else { + android.util.Log.d("SensorFusion", "Duplicate WiFi fingerprint skipped"); } - // Adding WiFi data to Trajectory - this.trajectory.addWifiFingerprints(wifiData); } createWifiPositioningRequest(); } + + /** + * Check if two WiFi fingerprints are similar enough to be considered duplicates + * Uses overlap ratio instead of exact match to handle unstable WiFi signals + */ + private boolean isSameFingerprintAs(Traj.Fingerprint newFingerprint, Traj.Fingerprint oldFingerprint) { + if (oldFingerprint == null) { + return false; // The first scan will definitely not be repeated. + } + + // If the number of Wi-Fi networks detected in both scans is very low (<3), record each instance. + if (newFingerprint.getRfScansCount() < 3 || oldFingerprint.getRfScansCount() < 3) { + return false; + } + + // Create a set of MAC addresses for old fingerprints + java.util.Set oldMacs = new java.util.HashSet<>(); + for (Traj.RFScan scan : oldFingerprint.getRfScansList()) { + oldMacs.add(scan.getMac()); + } + + // Count how many MACs in the new fingerprint appeared in the old fingerprint. + int commonCount = 0; + for (Traj.RFScan newScan : newFingerprint.getRfScansList()) { + if (oldMacs.contains(newScan.getMac())) { + commonCount++; + } + } + + // Calculate the overlap rate (using the smaller quantity from the two scans as the baseline) + int minCount = Math.min(newFingerprint.getRfScansCount(), oldFingerprint.getRfScansCount()); + float overlapRatio = (float) commonCount / minCount; + + // If the overlap rate is 80% or higher, it is considered a duplicate fingerprint. + boolean isDuplicate = overlapRatio >= 0.90f; + + if (isDuplicate) { + android.util.Log.d("SensorFusion", String.format( + "Duplicate fingerprint: overlap %.0f%% (%d/%d common MACs)", + overlapRatio * 100, commonCount, minCount)); + } + + return isDuplicate; + } + +// /** +// * Check if two WiFi fingerprints are identical (same MACs and RSSIs) +// * Used to avoid recording duplicate fingerprints when user is stationary +// */ +// private boolean isSameFingerprintAs(Traj.Fingerprint newFingerprint, Traj.Fingerprint oldFingerprint) { +// if (oldFingerprint == null) { +// return false; // The first scan will definitely not be repeated. +// } +// +// // Check if the number of WiFi signals scanned is the same +// if (newFingerprint.getRfScansCount() != oldFingerprint.getRfScansCount()) { +// return false; // The different numbers indicate a change. +// } +// +// // The Set created for MAC addresses is used for quick comparison. +// java.util.Set oldMacs = new java.util.HashSet<>(); +// for (Traj.RFScan scan : oldFingerprint.getRfScansList()) { +// oldMacs.add(scan.getMac()); +// } +// +// // Check whether each MAC in the new fingerprint is present in the old fingerprint. +// for (Traj.RFScan newScan : newFingerprint.getRfScansList()) { +// if (!oldMacs.contains(newScan.getMac())) { +// return false; // A new WiFi has been scanned. +// } +// } +// +// // If the MAC addresses are the same, they are considered as duplicate fingerprints. +// return true; +// } + /** * Function to create a request to obtain a wifi location for the obtained wifi fingerprint * @@ -914,6 +1006,7 @@ public void startRecording() { } wakeLock.acquire(31 * 60 * 1000L /*31 minutes*/); + this.lastWifiFingerprint = null; this.saveRecording = true; this.stepCounter = 0; this.absoluteStartTime = System.currentTimeMillis(); From e1e78ad85872d945fd46ef55080f286b9bedeac6 Mon Sep 17 00:00:00 2001 From: Haoning Huang Date: Tue, 10 Feb 2026 00:16:17 +0000 Subject: [PATCH 08/82] feat: Complete BLE data collection implementation --- app/src/main/AndroidManifest.xml | 10 + .../presentation/activity/MainActivity.java | 77 +++- .../PositionMe/sensors/BleDataProcessor.java | 370 ++++++++++++++++++ .../PositionMe/sensors/SensorFusion.java | 79 +++- .../PositionMe/utils/PermissionManager.java | 20 + 5 files changed, 537 insertions(+), 19 deletions(-) create mode 100644 app/src/main/java/com/openpositioning/PositionMe/sensors/BleDataProcessor.java diff --git a/app/src/main/AndroidManifest.xml b/app/src/main/AndroidManifest.xml index 678711fd..ca4657f0 100644 --- a/app/src/main/AndroidManifest.xml +++ b/app/src/main/AndroidManifest.xml @@ -32,6 +32,16 @@ + + + + + + + diff --git a/app/src/main/java/com/openpositioning/PositionMe/presentation/activity/MainActivity.java b/app/src/main/java/com/openpositioning/PositionMe/presentation/activity/MainActivity.java index 995f010d..48bdd1d8 100644 --- a/app/src/main/java/com/openpositioning/PositionMe/presentation/activity/MainActivity.java +++ b/app/src/main/java/com/openpositioning/PositionMe/presentation/activity/MainActivity.java @@ -124,13 +124,28 @@ protected void onCreate(Bundle savedInstanceState) { boolean locationGranted = result.getOrDefault(Manifest.permission.ACCESS_FINE_LOCATION, false); boolean activityGranted = result.getOrDefault(Manifest.permission.ACTIVITY_RECOGNITION, false); - if (locationGranted && activityGranted) { - // Both permissions granted + // Check BLE permissions + boolean bleGranted; + if (Build.VERSION.SDK_INT >= Build.VERSION_CODES.S) { + bleGranted = result.getOrDefault(Manifest.permission.BLUETOOTH_SCAN, false) && + result.getOrDefault(Manifest.permission.BLUETOOTH_CONNECT, false); + } else { + bleGranted = result.getOrDefault(Manifest.permission.BLUETOOTH, false) && + result.getOrDefault(Manifest.permission.BLUETOOTH_ADMIN, false); + } + + if (locationGranted && activityGranted && bleGranted) { + // All permissions granted allPermissionsObtained(); } else { - // Permission denied + // Some permission denied + String deniedPerms = ""; + if (!locationGranted) deniedPerms += "Location "; + if (!activityGranted) deniedPerms += "Activity "; + if (!bleGranted) deniedPerms += "Bluetooth "; + Toast.makeText(this, - "Location or Physical Activity permission denied. Some features may not work.", + deniedPerms + "permission(s) denied. Some features may not work.", Toast.LENGTH_LONG).show(); } } @@ -175,7 +190,7 @@ public void onResume() { // Delay permission check slightly to ensure the Activity is in the foreground new Handler().postDelayed(() -> { if (isActivityVisible()) { - // Check if both permissions are granted + // Check if all permissions are granted boolean locationGranted = ContextCompat.checkSelfPermission( this, Manifest.permission.ACCESS_FINE_LOCATION ) == PackageManager.PERMISSION_GRANTED; @@ -184,16 +199,50 @@ public void onResume() { this, Manifest.permission.ACTIVITY_RECOGNITION ) == PackageManager.PERMISSION_GRANTED; - if (!locationGranted || !activityGranted) { - // Request both permissions using ActivityResultLauncher - multiplePermissionsLauncher.launch(new String[]{ - Manifest.permission.ACCESS_FINE_LOCATION - }); - multiplePermissionsLauncher.launch(new String[]{ - Manifest.permission.ACTIVITY_RECOGNITION - }); + // Check BLE permissions based on Android version + boolean bleGranted; + if (Build.VERSION.SDK_INT >= Build.VERSION_CODES.S) { + // Android 12+ (API 31+) + bleGranted = ContextCompat.checkSelfPermission( + this, Manifest.permission.BLUETOOTH_SCAN + ) == PackageManager.PERMISSION_GRANTED && + ContextCompat.checkSelfPermission( + this, Manifest.permission.BLUETOOTH_CONNECT + ) == PackageManager.PERMISSION_GRANTED; + } else { + // Android 11 and below + bleGranted = ContextCompat.checkSelfPermission( + this, Manifest.permission.BLUETOOTH + ) == PackageManager.PERMISSION_GRANTED && + ContextCompat.checkSelfPermission( + this, Manifest.permission.BLUETOOTH_ADMIN + ) == PackageManager.PERMISSION_GRANTED; + } + + if (!locationGranted || !activityGranted || !bleGranted) { + // Build list of permissions to request + java.util.ArrayList permissionsToRequest = new java.util.ArrayList<>(); + + if (!locationGranted) { + permissionsToRequest.add(Manifest.permission.ACCESS_FINE_LOCATION); + } + if (!activityGranted) { + permissionsToRequest.add(Manifest.permission.ACTIVITY_RECOGNITION); + } + if (!bleGranted) { + if (Build.VERSION.SDK_INT >= Build.VERSION_CODES.S) { + permissionsToRequest.add(Manifest.permission.BLUETOOTH_SCAN); + permissionsToRequest.add(Manifest.permission.BLUETOOTH_CONNECT); + } else { + permissionsToRequest.add(Manifest.permission.BLUETOOTH); + permissionsToRequest.add(Manifest.permission.BLUETOOTH_ADMIN); + } + } + + // Request all missing permissions at once + multiplePermissionsLauncher.launch(permissionsToRequest.toArray(new String[0])); } else { - // Both permissions are already granted + // All permissions are already granted allPermissionsObtained(); } } diff --git a/app/src/main/java/com/openpositioning/PositionMe/sensors/BleDataProcessor.java b/app/src/main/java/com/openpositioning/PositionMe/sensors/BleDataProcessor.java new file mode 100644 index 00000000..10535028 --- /dev/null +++ b/app/src/main/java/com/openpositioning/PositionMe/sensors/BleDataProcessor.java @@ -0,0 +1,370 @@ +package com.openpositioning.PositionMe.sensors; + +import android.Manifest; +import android.annotation.SuppressLint; +import android.bluetooth.BluetoothAdapter; +import android.bluetooth.BluetoothDevice; +import android.bluetooth.BluetoothManager; +import android.bluetooth.le.BluetoothLeScanner; +import android.bluetooth.le.ScanCallback; +import android.bluetooth.le.ScanResult; +import android.content.Context; +import android.content.pm.PackageManager; +import android.os.Build; +import android.util.Log; +import android.widget.Toast; + +import androidx.core.app.ActivityCompat; + +import java.util.ArrayList; +import java.util.HashMap; +import java.util.List; +import java.util.Map; +import java.util.Timer; +import java.util.TimerTask; + +/** + * BLE Data Processor for scanning and collecting Bluetooth Low Energy device information. + * Designed to work in background without UI, similar to WifiDataProcessor. + * Implements Observable pattern to notify SensorFusion of new BLE scan results. + * + * @author Generated for Proto v2.0 BLE data collection + */ +public class BleDataProcessor implements Observable { + + private static final String TAG = "BleDataProcessor"; + + // Scan interval (5 seconds, same as WiFi) + private static final long SCAN_INTERVAL = 5000; + + // BLE scan duration (4 seconds to complete before next scan) + private static final long SCAN_DURATION = 4000; + + // Application context + private final Context context; + + // Bluetooth components + private final BluetoothAdapter bluetoothAdapter; + private BluetoothLeScanner bleScanner; + + // Collected BLE devices (using Map to avoid duplicates in same scan) + private Map bleDevicesMap; + + // Observers list + private ArrayList observers; + + // Timer for periodic scanning + private Timer scanBleTimer; + + // Flag to track if currently scanning + private boolean isScanning = false; + + /** + * Constructor - Initialize BLE processor + */ + public BleDataProcessor(Context context) { + this.context = context; + this.observers = new ArrayList<>(); + this.bleDevicesMap = new HashMap<>(); + + Log.i(TAG, "Initializing BleDataProcessor..."); + + // Check if BLE is supported + if (!context.getPackageManager().hasSystemFeature(PackageManager.FEATURE_BLUETOOTH_LE)) { + Log.w(TAG, "BLE not supported on this device"); + Toast.makeText(context, "BLE not supported on this device", Toast.LENGTH_SHORT).show(); + this.bluetoothAdapter = null; + return; + } + Log.i(TAG, "BLE is supported on this device"); + + // Get Bluetooth adapter + BluetoothManager bluetoothManager = (BluetoothManager) context.getSystemService(Context.BLUETOOTH_SERVICE); + if (bluetoothManager == null) { + Log.e(TAG, "BluetoothManager is null"); + Toast.makeText(context, "Bluetooth manager not available", Toast.LENGTH_SHORT).show(); + this.bluetoothAdapter = null; + return; + } + + this.bluetoothAdapter = bluetoothManager.getAdapter(); + + // Check if Bluetooth adapter exists + if (bluetoothAdapter == null) { + Log.e(TAG, "BluetoothAdapter is null - device may not support Bluetooth"); + Toast.makeText(context, "Bluetooth not available", Toast.LENGTH_SHORT).show(); + return; + } + Log.i(TAG, "BluetoothAdapter obtained successfully"); + + // Check if Bluetooth is enabled + if (!bluetoothAdapter.isEnabled()) { + Log.w(TAG, "Bluetooth is not enabled - BLE scanning will not work"); + Toast.makeText(context, "Please enable Bluetooth for BLE scanning", Toast.LENGTH_LONG).show(); + return; + } + Log.i(TAG, "Bluetooth is enabled"); + + // Try to get BLE scanner immediately (with permission check) + if (checkBlePermissions()) { + try { + this.bleScanner = bluetoothAdapter.getBluetoothLeScanner(); + if (bleScanner == null) { + Log.e(TAG, "BluetoothLeScanner is null even though Bluetooth is enabled"); + Toast.makeText(context, "BLE scanner initialization failed - try toggling Bluetooth", Toast.LENGTH_LONG).show(); + } else { + Log.i(TAG, "BLE scanner initialized successfully"); + } + } catch (Exception e) { + Log.e(TAG, "Exception while getting BLE scanner: " + e.getMessage()); + this.bleScanner = null; + } + } else { + Log.w(TAG, "BLE permissions not granted yet - scanner will be initialized when permissions are granted"); + } + } + + /** + * BLE Scan Callback - receives scan results + */ + private final ScanCallback bleScanCallback = new ScanCallback() { + @SuppressLint("MissingPermission") + @Override + public void onScanResult(int callbackType, ScanResult result) { + super.onScanResult(callbackType, result); + + if (!checkBlePermissions()) { + return; + } + + try { + BluetoothDevice device = result.getDevice(); + String address = device.getAddress(); + + // Create BleDevice object + BleDevice bleDevice = new BleDevice(); + bleDevice.macAddress = address; + bleDevice.name = device.getName() != null ? device.getName() : "Unknown"; + bleDevice.rssi = result.getRssi(); + + // Get TX power level (if available) + if (result.getTxPower() != 127) { // 127 means not available + bleDevice.txPowerLevel = result.getTxPower(); + } + + // Get Service UUIDs + if (result.getScanRecord() != null) { + bleDevice.serviceUuids = new ArrayList<>(); + if (result.getScanRecord().getServiceUuids() != null) { + for (android.os.ParcelUuid uuid : result.getScanRecord().getServiceUuids()) { + bleDevice.serviceUuids.add(uuid.toString()); + } + } + + // Get manufacturer data + if (result.getScanRecord().getManufacturerSpecificData() != null + && result.getScanRecord().getManufacturerSpecificData().size() > 0) { + int manufacturerId = result.getScanRecord().getManufacturerSpecificData().keyAt(0); + bleDevice.manufacturerData = result.getScanRecord().getManufacturerSpecificData().get(manufacturerId); + } + + // Get advertise flags + bleDevice.advertiseFlags = result.getScanRecord().getAdvertiseFlags(); + } + + // Add to map (will replace if same device scanned again in this scan) + bleDevicesMap.put(address, bleDevice); + + } catch (Exception e) { + Log.e(TAG, "Error processing BLE scan result: " + e.getMessage()); + } + } + + @Override + public void onScanFailed(int errorCode) { + super.onScanFailed(errorCode); + Log.e(TAG, "BLE Scan failed with error code: " + errorCode); + isScanning = false; + } + }; + + /** + * Start BLE scanning + */ + @SuppressLint("MissingPermission") + private void startBleScan() { + if (!checkBlePermissions()) { + Log.w(TAG, "BLE permissions not granted - cannot scan"); + return; + } + + // Try to get scanner if not already obtained + if (bleScanner == null && bluetoothAdapter != null) { + Log.i(TAG, "Attempting to get BLE scanner..."); + try { + bleScanner = bluetoothAdapter.getBluetoothLeScanner(); + if (bleScanner == null) { + Log.e(TAG, "BLE scanner is still null - Bluetooth might need to be toggled"); + return; + } + Log.i(TAG, "BLE scanner obtained successfully"); + } catch (Exception e) { + Log.e(TAG, "Exception getting BLE scanner: " + e.getMessage()); + return; + } + } + + if (bleScanner == null) { + Log.w(TAG, "BLE scanner not available"); + return; + } + + if (isScanning) { + Log.d(TAG, "Already scanning, skip this round"); + return; + } + + // Clear previous scan results + bleDevicesMap.clear(); + + // Start scanning + try { + bleScanner.startScan(bleScanCallback); + isScanning = true; + Log.d(TAG, "BLE scan started"); + + // Stop scan after SCAN_DURATION + new Timer().schedule(new TimerTask() { + @Override + public void run() { + stopBleScan(); + } + }, SCAN_DURATION); + + } catch (SecurityException e) { + Log.e(TAG, "Security exception when starting BLE scan: " + e.getMessage()); + } catch (Exception e) { + Log.e(TAG, "Exception when starting BLE scan: " + e.getMessage()); + } + } + + /** + * Stop BLE scanning and notify observers + */ + @SuppressLint("MissingPermission") + private void stopBleScan() { + if (!isScanning) { + return; + } + + if (!checkBlePermissions()) { + return; + } + + try { + if (bleScanner != null) { + bleScanner.stopScan(bleScanCallback); + isScanning = false; + + Log.i(TAG, "BLE scan completed, found " + bleDevicesMap.size() + " devices"); + + // Notify observers with results + notifyObservers(0); + } + } catch (SecurityException e) { + Log.e(TAG, "Security exception when stopping BLE scan: " + e.getMessage()); + } catch (Exception e) { + Log.e(TAG, "Exception when stopping BLE scan: " + e.getMessage()); + } + } + + /** + * Start periodic BLE scanning + */ + public void startListening() { + if (!checkBlePermissions()) { + Log.w(TAG, "Cannot start BLE listening - permissions not granted"); + return; + } + + Log.i(TAG, "BLE periodic scanning started"); + + this.scanBleTimer = new Timer(); + this.scanBleTimer.scheduleAtFixedRate(new TimerTask() { + @Override + public void run() { + startBleScan(); + } + }, 0, SCAN_INTERVAL); + } + + /** + * Stop periodic BLE scanning + */ + public void stopListening() { + if (scanBleTimer != null) { + scanBleTimer.cancel(); + scanBleTimer = null; + } + + if (isScanning) { + stopBleScan(); + } + + Log.i(TAG, "BLE scanning stopped"); + } + + /** + * Check BLE permissions + */ + private boolean checkBlePermissions() { + if (Build.VERSION.SDK_INT >= Build.VERSION_CODES.S) { + // Android 12+ + return ActivityCompat.checkSelfPermission(context, Manifest.permission.BLUETOOTH_SCAN) + == PackageManager.PERMISSION_GRANTED && + ActivityCompat.checkSelfPermission(context, Manifest.permission.BLUETOOTH_CONNECT) + == PackageManager.PERMISSION_GRANTED; + } else { + // Below Android 12 + return ActivityCompat.checkSelfPermission(context, Manifest.permission.BLUETOOTH) + == PackageManager.PERMISSION_GRANTED && + ActivityCompat.checkSelfPermission(context, Manifest.permission.BLUETOOTH_ADMIN) + == PackageManager.PERMISSION_GRANTED && + ActivityCompat.checkSelfPermission(context, Manifest.permission.ACCESS_FINE_LOCATION) + == PackageManager.PERMISSION_GRANTED; + } + } + + /** + * Get collected BLE devices as array + */ + public BleDevice[] getBleDevices() { + return bleDevicesMap.values().toArray(new BleDevice[0]); + } + + @Override + public void registerObserver(Observer o) { + observers.add(o); + } + + @Override + public void notifyObservers(int idx) { + BleDevice[] devices = getBleDevices(); + for (Observer o : observers) { + o.update(devices); + } + } + + /** + * BLE Device data class + */ + public static class BleDevice { + public String macAddress; + public String name; + public int rssi; + public int txPowerLevel = 0; + public int advertiseFlags = 0; + public List serviceUuids; + public byte[] manufacturerData; + } +} \ No newline at end of file diff --git a/app/src/main/java/com/openpositioning/PositionMe/sensors/SensorFusion.java b/app/src/main/java/com/openpositioning/PositionMe/sensors/SensorFusion.java index f16628a1..57c1b3c9 100644 --- a/app/src/main/java/com/openpositioning/PositionMe/sensors/SensorFusion.java +++ b/app/src/main/java/com/openpositioning/PositionMe/sensors/SensorFusion.java @@ -105,6 +105,7 @@ public class SensorFusion implements SensorEventListener, Observer { private MovementSensor linearAccelerationSensor; // Other data recording private WifiDataProcessor wifiProcessor; + private BleDataProcessor bleProcessor; private GNSSDataProcessor gnssProcessor; // Data listener private final LocationListener locationListener; @@ -162,6 +163,7 @@ public class SensorFusion implements SensorEventListener, Observer { private float[] startLocation; // Wifi values private List wifiList; + private List bleDeviceList; // Over time accelerometer magnitude values since last step @@ -251,6 +253,8 @@ public void setContext(Context context) { // Listener based devices this.wifiProcessor = new WifiDataProcessor(context); wifiProcessor.registerObserver(this); + this.bleProcessor = new BleDataProcessor(context); + bleProcessor.registerObserver(this); this.gnssProcessor = new GNSSDataProcessor(context, locationListener); // Create object handling HTTPS communication this.serverCommunications = new ServerCommunications(context); @@ -483,16 +487,34 @@ public void onLocationChanged(@NonNull Location location) { * {@inheritDoc} * * Receives updates from {@link WifiDataProcessor}. - * + * Receives updates from {@link BleDataProcessor} * @see WifiDataProcessor object for wifi scanning. + * @see BleDataProcessor object for BLE scanning. */ + @Override - public void update(Object[] wifiList) { + public void update(Object[] dataArray) { + if (dataArray == null || dataArray.length == 0) { + return; + } + + // Check the type of the first element to determine if it's WiFi or BLE + if (dataArray[0] instanceof Wifi) { + // Handle WiFi data + updateWifiData(dataArray); + } else if (dataArray[0] instanceof BleDataProcessor.BleDevice) { + // Handle BLE data + updateBleData(dataArray); + } + } + + // Original WiFi update logic + private void updateWifiData(Object[] wifiList) { // Save newest wifi values to local variable this.wifiList = Stream.of(wifiList).map(o -> (Wifi) o).collect(Collectors.toList()); if(this.saveRecording) { - // Building a new WiFi fingerprint + // build new wifi fingerprint Traj.Fingerprint.Builder wifiData = Traj.Fingerprint.newBuilder() .setRelativeTimestamp(SystemClock.uptimeMillis()-bootTime); for (Wifi data : this.wifiList) { @@ -506,18 +528,56 @@ public void update(Object[] wifiList) { Traj.Fingerprint newFingerprint = wifiData.build(); if (!isSameFingerprintAs(newFingerprint, lastWifiFingerprint)) { - // Only add when the fingerprint changes this.trajectory.addWifiFingerprints(newFingerprint); - lastWifiFingerprint = newFingerprint; // save this fingerprint for comparison + lastWifiFingerprint = newFingerprint; android.util.Log.i("SensorFusion", "New WiFi fingerprint added (" + newFingerprint.getRfScansCount() + " APs)"); } else { android.util.Log.d("SensorFusion", "Duplicate WiFi fingerprint skipped"); } } + createWifiPositioningRequest(); } + // BLE update logic + private void updateBleData(Object[] bleArray) { + BleDataProcessor.BleDevice[] bleDevices = new BleDataProcessor.BleDevice[bleArray.length]; + for (int i = 0; i < bleArray.length; i++) { + bleDevices[i] = (BleDataProcessor.BleDevice) bleArray[i]; + } + + // Save BLE devices to local variable + this.bleDeviceList = java.util.Arrays.asList(bleDevices); + + if(this.saveRecording) { + // Add each BLE device to trajectory + for (BleDataProcessor.BleDevice device : bleDevices) { + Traj.BleData.Builder bleData = Traj.BleData.newBuilder() + .setMacAddress(device.macAddress) + .setName(device.name) + .setTxPowerLevel(device.txPowerLevel) + .setAdvertiseFlags(device.advertiseFlags); + + // Add service UUIDs if available + if (device.serviceUuids != null && !device.serviceUuids.isEmpty()) { + bleData.addAllServiceUuids(device.serviceUuids); + } + + // Add manufacturer data if available + if (device.manufacturerData != null) { + bleData.setManufacturerData(com.google.protobuf.ByteString.copyFrom(device.manufacturerData)); + } + + this.trajectory.addBleData(bleData.build()); + } + + if (bleDevices.length > 0) { + android.util.Log.i("SensorFusion", "Added " + bleDevices.length + " BLE devices to trajectory"); + } + } + } + /** * Check if two WiFi fingerprints are similar enough to be considered duplicates @@ -916,6 +976,7 @@ public void resumeListening() { stepDetectionSensor.sensorManager.registerListener(this, stepDetectionSensor.sensor, SensorManager.SENSOR_DELAY_NORMAL); rotationSensor.sensorManager.registerListener(this, rotationSensor.sensor, (int) 1e6); wifiProcessor.startListening(); + bleProcessor.startListening(); gnssProcessor.startLocationUpdates(); } @@ -948,6 +1009,14 @@ public void stopListening() { } catch (Exception e) { System.err.println("Wifi resumed before existing"); } + + // Stop BLE scanning + try { + this.bleProcessor.stopListening(); + } catch (Exception e) { + System.err.println("BLE stopped before existing"); + } + // Stop receiving location updates this.gnssProcessor.stopUpdating(); } diff --git a/app/src/main/java/com/openpositioning/PositionMe/utils/PermissionManager.java b/app/src/main/java/com/openpositioning/PositionMe/utils/PermissionManager.java index 40c937ab..22e41823 100644 --- a/app/src/main/java/com/openpositioning/PositionMe/utils/PermissionManager.java +++ b/app/src/main/java/com/openpositioning/PositionMe/utils/PermissionManager.java @@ -57,12 +57,32 @@ public PermissionManager(Activity activity, PermissionCallback callback) { requiredPermissions.add(Manifest.permission.ACCESS_COARSE_LOCATION); requiredPermissions.add(Manifest.permission.ACCESS_WIFI_STATE); requiredPermissions.add(Manifest.permission.CHANGE_WIFI_STATE); + + // Add BLE permissions based on Android version + if (Build.VERSION.SDK_INT >= Build.VERSION_CODES.S) { + // Android 12+ (API 31+) + requiredPermissions.add(Manifest.permission.BLUETOOTH_SCAN); + requiredPermissions.add(Manifest.permission.BLUETOOTH_CONNECT); + android.util.Log.i("PermissionManager", "Added Android 12+ BLE permissions"); + } else { + // Android 11 and below + requiredPermissions.add(Manifest.permission.BLUETOOTH); + requiredPermissions.add(Manifest.permission.BLUETOOTH_ADMIN); + android.util.Log.i("PermissionManager", "Added Android 11- BLE permissions"); + } + // For API < 29, also request broad storage permissions // For API >= 29, also request ACTIVITY_RECOGNITION // (We can do the check here or just always add them; the OS will skip as needed.) requiredPermissions.add(Manifest.permission.WRITE_EXTERNAL_STORAGE); requiredPermissions.add(Manifest.permission.READ_EXTERNAL_STORAGE); requiredPermissions.add(Manifest.permission.ACTIVITY_RECOGNITION); + + // Log all permissions + android.util.Log.i("PermissionManager", "Total permissions to request: " + requiredPermissions.size()); + for (String perm : requiredPermissions) { + android.util.Log.i("PermissionManager", " - " + perm); + } } /** From b46672d8749d951e37b33b99bb5a8c81816a1c05 Mon Sep 17 00:00:00 2001 From: Bhavyas15 Date: Tue, 10 Feb 2026 10:47:58 +0000 Subject: [PATCH 09/82] Test Points in Recording Fragment implemented --- .../fragment/RecordingFragment.java | 41 ++++++++++++- .../fragment/TrajectoryMapFragment.java | 57 +++++++++++++++++++ .../PositionMe/sensors/SensorFusion.java | 37 ++++++++++++ .../PositionMe/sensors/model/TestPoint.java | 14 +++++ .../res/drawable/baseline_add_location_24.xml | 5 ++ .../main/res/layout/fragment_recording.xml | 35 +++++++++--- app/src/main/res/values/strings.xml | 1 + build.gradle | 5 +- 8 files changed, 185 insertions(+), 10 deletions(-) create mode 100644 app/src/main/java/com/openpositioning/PositionMe/sensors/model/TestPoint.java create mode 100644 app/src/main/res/drawable/baseline_add_location_24.xml diff --git a/app/src/main/java/com/openpositioning/PositionMe/presentation/fragment/RecordingFragment.java b/app/src/main/java/com/openpositioning/PositionMe/presentation/fragment/RecordingFragment.java index 6362a971..320e5753 100644 --- a/app/src/main/java/com/openpositioning/PositionMe/presentation/fragment/RecordingFragment.java +++ b/app/src/main/java/com/openpositioning/PositionMe/presentation/fragment/RecordingFragment.java @@ -3,6 +3,7 @@ import android.app.AlertDialog; import android.content.Context; import android.content.SharedPreferences; +import android.graphics.Bitmap; import android.graphics.Color; import android.os.Bundle; import android.os.CountDownTimer; @@ -18,6 +19,10 @@ import android.widget.ImageView; import android.widget.ProgressBar; import android.widget.TextView; +import android.widget.Toast; + +import com.google.android.gms.maps.model.BitmapDescriptorFactory; +import com.google.android.gms.maps.model.MarkerOptions; import com.google.android.material.button.MaterialButton; import androidx.annotation.NonNull; @@ -59,7 +64,7 @@ public class RecordingFragment extends Fragment { // UI elements - private MaterialButton completeButton, cancelButton; + private MaterialButton completeButton, cancelButton, markTestPointButton; private ImageView recIcon; private ProgressBar timeRemaining; private TextView elevation, distanceTravelled, gnssError; @@ -76,6 +81,8 @@ public class RecordingFragment extends Fragment { private float distance = 0f; private float previousPosX = 0f; private float previousPosY = 0f; + private int testPointCounter = 0; + // References to the child map fragment private TrajectoryMapFragment trajectoryMapFragment; @@ -137,6 +144,7 @@ public void onViewCreated(@NonNull View view, completeButton = view.findViewById(R.id.stopButton); cancelButton = view.findViewById(R.id.cancelButton); + markTestPointButton= view.findViewById(R.id.markPointButton); recIcon = view.findViewById(R.id.redDot); timeRemaining = view.findViewById(R.id.timeRemainingBar); @@ -154,6 +162,37 @@ public void onViewCreated(@NonNull View view, ((RecordingActivity) requireActivity()).showCorrectionScreen(); }); + markTestPointButton.setOnClickListener(v -> { + long timestampMillis = System.currentTimeMillis(); + + SensorFusion.getInstance().addTestPoint(timestampMillis); + + float[] gnss = SensorFusion.getInstance().getGNSSLatitude(false); + if (gnss != null) { + double lat = gnss[0]; + double lon = gnss[1]; + + SensorFusion.getInstance().addTestPoint(timestampMillis, lat, lon); + + testPointCounter++; + + if (trajectoryMapFragment != null) { + trajectoryMapFragment.addTestPointMarker( + new LatLng(lat, lon), + testPointCounter + ); + } + + Toast.makeText(requireContext(), + "Test point " + testPointCounter + " marked", + Toast.LENGTH_SHORT).show(); + } else { + Toast.makeText(requireContext(), + "GNSS not available yet", + Toast.LENGTH_SHORT).show(); + } + }); + // Cancel button with confirmation dialog cancelButton.setOnClickListener(v -> { diff --git a/app/src/main/java/com/openpositioning/PositionMe/presentation/fragment/TrajectoryMapFragment.java b/app/src/main/java/com/openpositioning/PositionMe/presentation/fragment/TrajectoryMapFragment.java index eb0bad65..11dac91f 100644 --- a/app/src/main/java/com/openpositioning/PositionMe/presentation/fragment/TrajectoryMapFragment.java +++ b/app/src/main/java/com/openpositioning/PositionMe/presentation/fragment/TrajectoryMapFragment.java @@ -29,6 +29,17 @@ import java.util.ArrayList; import java.util.List; +import android.graphics.Bitmap; +import android.graphics.Canvas; +import android.graphics.Color; +import android.graphics.Paint; +import android.graphics.Rect; +import android.graphics.Typeface; + +import com.google.android.gms.maps.model.BitmapDescriptorFactory; +import com.google.android.gms.maps.model.MarkerOptions; + + /** * A fragment responsible for displaying a trajectory map using Google Maps. @@ -202,6 +213,52 @@ public void onMapReady(@NonNull GoogleMap googleMap) { * @param map */ + private Bitmap createNumberedMarkerBitmap(int number) { + int size = 100; // marker size in pixels + + Bitmap bitmap = Bitmap.createBitmap(size, size, Bitmap.Config.ARGB_8888); + Canvas canvas = new Canvas(bitmap); + + Paint circlePaint = new Paint(); + circlePaint.setColor(Color.RED); + circlePaint.setAntiAlias(true); + + Paint textPaint = new Paint(); + textPaint.setColor(Color.WHITE); + textPaint.setTextSize(40f); + textPaint.setTypeface(Typeface.DEFAULT_BOLD); + textPaint.setAntiAlias(true); + textPaint.setTextAlign(Paint.Align.CENTER); + + // Draw circle + canvas.drawCircle(size / 2f, size / 2f, size / 2f, circlePaint); + + // Draw number in center + Rect bounds = new Rect(); + String text = String.valueOf(number); + textPaint.getTextBounds(text, 0, text.length(), bounds); + + float x = size / 2f; + float y = size / 2f - bounds.centerY(); + + canvas.drawText(text, x, y, textPaint); + + return bitmap; + } + + public void addTestPointMarker(LatLng latLng, int number) { + Bitmap numberedMarker = createNumberedMarkerBitmap(number); + + MarkerOptions markerOptions = new MarkerOptions() + .position(latLng) + .icon(BitmapDescriptorFactory.fromBitmap(numberedMarker)) + .anchor(0.5f, 0.5f) // center anchor + .title("Test Point " + number); + + gMap.addMarker(markerOptions); + } + + private void initMapSettings(GoogleMap map) { // Basic map settings map.getUiSettings().setCompassEnabled(true); diff --git a/app/src/main/java/com/openpositioning/PositionMe/sensors/SensorFusion.java b/app/src/main/java/com/openpositioning/PositionMe/sensors/SensorFusion.java index a5a69ba9..6590e7ec 100644 --- a/app/src/main/java/com/openpositioning/PositionMe/sensors/SensorFusion.java +++ b/app/src/main/java/com/openpositioning/PositionMe/sensors/SensorFusion.java @@ -36,6 +36,10 @@ import java.util.stream.Collectors; import java.util.stream.Stream; +import java.util.ArrayList; +import java.util.List; +import com.openpositioning.PositionMe.sensors.model.TestPoint; + /** * The SensorFusion class is the main data gathering and processing class of the application. @@ -159,6 +163,8 @@ public class SensorFusion implements SensorEventListener, Observer { // WiFi positioning object private WiFiPositioning wiFiPositioning; + private final List testPoints = new ArrayList<>(); + //region Initialisation /** * Private constructor for implementing singleton design pattern for SensorFusion. @@ -217,6 +223,37 @@ public static SensorFusion getInstance() { * @see GNSSDataProcessor for location data processing. * @see WifiDataProcessor for network data processing. */ + + public void addTestPoint(long timestampMillis, double lat, double lon) { + testPoints.add(new TestPoint(timestampMillis, lat, lon)); + } + +// debugging- + public List getTestPoints() { + return testPoints; + } + + public void addTestPoint(long timestamp) { + Log.d("TestPoint", "Test point marked at: " + timestamp); + if (!saveRecording || trajectory == null) { + Log.w("SensorFusion", "Test point ignored: not recording"); + return; + } + + long relativeTs = System.currentTimeMillis() - absoluteStartTime; + + Traj.GNSSPosition testPoint = Traj.GNSSPosition.newBuilder() + .setRelativeTimestamp(relativeTs) + .setLatitude(latitude) + .setLongitude(longitude) + .setAltitude(elevation) // or GNSS altitude if you prefer + .build(); + + trajectory.addTestPoints(testPoint); + + Log.d("SensorFusion", "Test point added @ " + latitude + ", " + longitude); + } + public void setContext(Context context) { this.appContext = context.getApplicationContext(); // store app context for later use diff --git a/app/src/main/java/com/openpositioning/PositionMe/sensors/model/TestPoint.java b/app/src/main/java/com/openpositioning/PositionMe/sensors/model/TestPoint.java new file mode 100644 index 00000000..34b4e55a --- /dev/null +++ b/app/src/main/java/com/openpositioning/PositionMe/sensors/model/TestPoint.java @@ -0,0 +1,14 @@ +package com.openpositioning.PositionMe.sensors.model; + +public class TestPoint { + public final long timestampMillis; + public final double latitude; + public final double longitude; + + public TestPoint(long timestampMillis, double latitude, double longitude) { + this.timestampMillis = timestampMillis; + this.latitude = latitude; + this.longitude = longitude; + } + +} diff --git a/app/src/main/res/drawable/baseline_add_location_24.xml b/app/src/main/res/drawable/baseline_add_location_24.xml new file mode 100644 index 00000000..9e099e9d --- /dev/null +++ b/app/src/main/res/drawable/baseline_add_location_24.xml @@ -0,0 +1,5 @@ + + + + + diff --git a/app/src/main/res/layout/fragment_recording.xml b/app/src/main/res/layout/fragment_recording.xml index c04381a5..300ab5bc 100644 --- a/app/src/main/res/layout/fragment_recording.xml +++ b/app/src/main/res/layout/fragment_recording.xml @@ -114,27 +114,46 @@ + + + + app:iconSize="24dp" + app:iconTint="@color/md_theme_onSecondary" /> Play End Exit + Mark Point \ No newline at end of file diff --git a/build.gradle b/build.gradle index e208c000..e907071b 100644 --- a/build.gradle +++ b/build.gradle @@ -1,12 +1,15 @@ // Top-level build file buildscript { + ext { + agp_version = '8.7.1' + } repositories { google() mavenCentral() } dependencies { // NOTE: Only classpath deps (plugins) go here - classpath 'com.android.tools.build:gradle:8.8.0' + classpath "com.android.tools.build:gradle:$agp_version" classpath 'com.google.gms:google-services:4.4.2' def nav_version = "2.5.3" classpath "androidx.navigation:navigation-safe-args-gradle-plugin:$nav_version" From 8436af1ff80b89f9663e3dbf03033c2703119b21 Mon Sep 17 00:00:00 2001 From: Haoning Huang Date: Tue, 10 Feb 2026 16:11:36 +0000 Subject: [PATCH 10/82] feat: Add BLE deduplication and WiFi RSSI comparison MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Optimizations: ✅ BLE device list deduplication with dynamic thresholds ✅ WiFi fingerprint RSSI change detection BLE Deduplication: - Dynamic overlap thresholds based on device count: * Many devices (≥20): 50% overlap or 15+ common devices * Medium devices (≥10): 60% overlap or 8+ common devices * Few devices (<10): 70% overlap or 5+ common devices - Prevents recording identical BLE device lists when stationary - Adapts to different BLE environments automatically WiFi RSSI Comparison: - Added RSSI change detection (5 dBm threshold) - Considers fingerprint duplicate if: * MAC overlap ≥ 80% AND * RSSI changes < 30% (fewer than 30% of APs changed significantly) - More accurate duplicate detection for stationary users - Prevents false positives from minor signal fluctuations Implementation: - Modified SensorFusion.java: * Added lastBleDeviceList variable * Added isSameBleDeviceList() with dynamic thresholds * Enhanced isSameFingerprintAs() with RSSI comparison * Updated updateBleData() with deduplication logic * Reset deduplication state in startRecording() --- .../viewitems/UploadListAdapter.java | 57 ++++- .../viewitems/UploadViewHolder.java | 4 +- .../PositionMe/sensors/SensorFusion.java | 218 ++++++++++++------ .../main/res/layout/item_upload_card_view.xml | 33 ++- 4 files changed, 226 insertions(+), 86 deletions(-) diff --git a/app/src/main/java/com/openpositioning/PositionMe/presentation/viewitems/UploadListAdapter.java b/app/src/main/java/com/openpositioning/PositionMe/presentation/viewitems/UploadListAdapter.java index b564e231..f1ed38d7 100644 --- a/app/src/main/java/com/openpositioning/PositionMe/presentation/viewitems/UploadListAdapter.java +++ b/app/src/main/java/com/openpositioning/PositionMe/presentation/viewitems/UploadListAdapter.java @@ -2,6 +2,7 @@ import android.content.Context; import android.view.LayoutInflater; +import android.view.View; import android.view.ViewGroup; import android.widget.Toast; @@ -12,6 +13,7 @@ import com.openpositioning.PositionMe.presentation.fragment.UploadFragment; import java.io.File; +import java.io.FileInputStream; import java.util.List; import java.util.regex.Matcher; import java.util.regex.Pattern; @@ -66,15 +68,26 @@ public UploadViewHolder onCreateViewHolder(@NonNull ViewGroup parent, int viewTy @Override public void onBindViewHolder(@NonNull UploadViewHolder holder, int position) { holder.trajId.setText(String.valueOf(position)); + + // Extract date from filename Pattern datePattern = Pattern.compile("_(.*?)\\.txt"); Matcher dateMatcher = datePattern.matcher(uploadItems.get(position).getName()); String dateString = dateMatcher.find() ? dateMatcher.group(1) : "N/A"; System.err.println("UPLOAD - Date string: " + dateString); holder.trajDate.setText(dateString); + // Read and display Trajectory Name (NEW) + String trajectoryName = readTrajectoryName(uploadItems.get(position)); + if (trajectoryName != null && !trajectoryName.isEmpty()) { + holder.trajectoryNameText.setText(trajectoryName); + holder.trajectoryNameText.setVisibility(View.VISIBLE); + } else { + holder.trajectoryNameText.setText("No name"); + holder.trajectoryNameText.setVisibility(View.VISIBLE); + } + // Set click listener for the delete button holder.deletebutton.setOnClickListener(v -> deleteFileAtPosition(position)); - } /** @@ -86,23 +99,45 @@ public int getItemCount() { return uploadItems.size(); } - private void deleteFileAtPosition(int position) - { - if (position >= 0 && position < uploadItems.size()) - { + /** + * Delete trajectory file at specified position + */ + private void deleteFileAtPosition(int position) { + if (position >= 0 && position < uploadItems.size()) { File fileToDelete = uploadItems.get(position); - if (fileToDelete.exists() && fileToDelete.delete()) - { + if (fileToDelete.exists() && fileToDelete.delete()) { uploadItems.remove(position); notifyItemRemoved(position); notifyItemRangeChanged(position, uploadItems.size()); // Update subsequent items Toast.makeText(context, "File deleted successfully", Toast.LENGTH_SHORT).show(); - } - else - { + } else { Toast.makeText(context, "Failed to delete file", Toast.LENGTH_SHORT).show(); } } } -} + + /** + * Read trajectory name (trajectory_id) from the protobuf file + * + * @param file The trajectory .txt file containing protobuf data + * @return The trajectory_id string, or null if not found/error + */ + private String readTrajectoryName(File file) { + try { + FileInputStream fis = new FileInputStream(file); + com.openpositioning.PositionMe.Traj.Trajectory trajectory = + com.openpositioning.PositionMe.Traj.Trajectory.parseFrom(fis); + fis.close(); + + // Get trajectory_id from proto + String trajectoryId = trajectory.getTrajectoryId(); + return (trajectoryId != null && !trajectoryId.isEmpty()) ? trajectoryId : null; + + } catch (Exception e) { + android.util.Log.e("UploadListAdapter", "Error reading trajectory name from " + + file.getName() + ": " + e.getMessage()); + return null; + } + } +} \ No newline at end of file diff --git a/app/src/main/java/com/openpositioning/PositionMe/presentation/viewitems/UploadViewHolder.java b/app/src/main/java/com/openpositioning/PositionMe/presentation/viewitems/UploadViewHolder.java index e6068969..ebf9224e 100644 --- a/app/src/main/java/com/openpositioning/PositionMe/presentation/viewitems/UploadViewHolder.java +++ b/app/src/main/java/com/openpositioning/PositionMe/presentation/viewitems/UploadViewHolder.java @@ -25,6 +25,7 @@ public class UploadViewHolder extends RecyclerView.ViewHolder implements View.On TextView trajId; TextView trajDate; + TextView trajectoryNameText; // NEW: Trajectory name display MaterialButton uploadButton; // Correct reference to MaterialButton // Weak reference to the click listener to enable garbage collection on recyclerview items private WeakReference listenerReference; @@ -45,6 +46,7 @@ public UploadViewHolder(@NonNull View itemView, DownloadClickListener listener) this.listenerReference = new WeakReference<>(listener); this.trajId = itemView.findViewById(R.id.trajectoryIdItem); this.trajDate = itemView.findViewById(R.id.trajectoryDateItem); + this.trajectoryNameText = itemView.findViewById(R.id.trajectory_name_text); // NEW this.uploadButton = itemView.findViewById(R.id.uploadTrajectoryButton); this.uploadButton.setOnClickListener(this); @@ -59,4 +61,4 @@ public UploadViewHolder(@NonNull View itemView, DownloadClickListener listener) public void onClick(View view) { listenerReference.get().onPositionClicked(getAdapterPosition()); } -} +} \ No newline at end of file diff --git a/app/src/main/java/com/openpositioning/PositionMe/sensors/SensorFusion.java b/app/src/main/java/com/openpositioning/PositionMe/sensors/SensorFusion.java index 57c1b3c9..f8f98681 100644 --- a/app/src/main/java/com/openpositioning/PositionMe/sensors/SensorFusion.java +++ b/app/src/main/java/com/openpositioning/PositionMe/sensors/SensorFusion.java @@ -65,6 +65,8 @@ public class SensorFusion implements SensorEventListener, Observer { //Save the last WiFi fingerprint for deduplication. private Traj.Fingerprint lastWifiFingerprint = null; + private List lastBleDeviceList = null; + long maxReportLatencyNs = 0; // Disable batching to deliver events immediately @@ -535,12 +537,17 @@ private void updateWifiData(Object[] wifiList) { } else { android.util.Log.d("SensorFusion", "Duplicate WiFi fingerprint skipped"); } + + } createWifiPositioningRequest(); } // BLE update logic + /** + * Update BLE data with deduplication + */ private void updateBleData(Object[] bleArray) { BleDataProcessor.BleDevice[] bleDevices = new BleDataProcessor.BleDevice[bleArray.length]; for (int i = 0; i < bleArray.length; i++) { @@ -548,32 +555,37 @@ private void updateBleData(Object[] bleArray) { } // Save BLE devices to local variable - this.bleDeviceList = java.util.Arrays.asList(bleDevices); + List newBleDeviceList = java.util.Arrays.asList(bleDevices); + this.bleDeviceList = newBleDeviceList; if(this.saveRecording) { - // Add each BLE device to trajectory - for (BleDataProcessor.BleDevice device : bleDevices) { - Traj.BleData.Builder bleData = Traj.BleData.newBuilder() - .setMacAddress(device.macAddress) - .setName(device.name) - .setTxPowerLevel(device.txPowerLevel) - .setAdvertiseFlags(device.advertiseFlags); - - // Add service UUIDs if available - if (device.serviceUuids != null && !device.serviceUuids.isEmpty()) { - bleData.addAllServiceUuids(device.serviceUuids); - } + // Check for duplicate BLE device list + if (!isSameBleDeviceList(newBleDeviceList, lastBleDeviceList)) { + // Add each BLE device to trajectory + for (BleDataProcessor.BleDevice device : bleDevices) { + Traj.BleData.Builder bleData = Traj.BleData.newBuilder() + .setMacAddress(device.macAddress) + .setName(device.name) + .setTxPowerLevel(device.txPowerLevel) + .setAdvertiseFlags(device.advertiseFlags); + + // Add service UUIDs if available + if (device.serviceUuids != null && !device.serviceUuids.isEmpty()) { + bleData.addAllServiceUuids(device.serviceUuids); + } - // Add manufacturer data if available - if (device.manufacturerData != null) { - bleData.setManufacturerData(com.google.protobuf.ByteString.copyFrom(device.manufacturerData)); - } + // Add manufacturer data if available + if (device.manufacturerData != null) { + bleData.setManufacturerData(com.google.protobuf.ByteString.copyFrom(device.manufacturerData)); + } - this.trajectory.addBleData(bleData.build()); - } + this.trajectory.addBleData(bleData.build()); + } - if (bleDevices.length > 0) { - android.util.Log.i("SensorFusion", "Added " + bleDevices.length + " BLE devices to trajectory"); + lastBleDeviceList = newBleDeviceList; + android.util.Log.i("SensorFusion", "New BLE device list added (" + bleDevices.length + " devices)"); + } else { + android.util.Log.d("SensorFusion", "Duplicate BLE device list skipped"); } } } @@ -583,76 +595,141 @@ private void updateBleData(Object[] bleArray) { * Check if two WiFi fingerprints are similar enough to be considered duplicates * Uses overlap ratio instead of exact match to handle unstable WiFi signals */ + /** + * Check if two WiFi fingerprints are similar (for deduplication) + * Uses both MAC address overlap and RSSI change to determine similarity + * + * @param newFingerprint New WiFi fingerprint + * @param oldFingerprint Previous WiFi fingerprint + * @return true if fingerprints are similar, false otherwise + */ private boolean isSameFingerprintAs(Traj.Fingerprint newFingerprint, Traj.Fingerprint oldFingerprint) { - if (oldFingerprint == null) { - return false; // The first scan will definitely not be repeated. - } + if (oldFingerprint == null) return false; + if (newFingerprint.getRfScansCount() < 3 || oldFingerprint.getRfScansCount() < 3) return false; - // If the number of Wi-Fi networks detected in both scans is very low (<3), record each instance. - if (newFingerprint.getRfScansCount() < 3 || oldFingerprint.getRfScansCount() < 3) { - return false; + // Build maps of MAC -> RSSI for both fingerprints + java.util.Map oldMacRssi = new java.util.HashMap<>(); + for (Traj.RFScan scan : oldFingerprint.getRfScansList()) { + oldMacRssi.put(scan.getMac(), scan.getRssi()); } - // Create a set of MAC addresses for old fingerprints - java.util.Set oldMacs = new java.util.HashSet<>(); - for (Traj.RFScan scan : oldFingerprint.getRfScansList()) { - oldMacs.add(scan.getMac()); + java.util.Map newMacRssi = new java.util.HashMap<>(); + for (Traj.RFScan scan : newFingerprint.getRfScansList()) { + newMacRssi.put(scan.getMac(), scan.getRssi()); } - // Count how many MACs in the new fingerprint appeared in the old fingerprint. + // Count common MACs and check RSSI changes int commonCount = 0; + int significantRssiChanges = 0; + final int RSSI_THRESHOLD = 5; // dBm threshold for "significant" change + for (Traj.RFScan newScan : newFingerprint.getRfScansList()) { - if (oldMacs.contains(newScan.getMac())) { + Long mac = newScan.getMac(); + if (oldMacRssi.containsKey(mac)) { commonCount++; + + // Check if RSSI changed significantly + int oldRssi = oldMacRssi.get(mac); + int newRssi = newScan.getRssi(); + int rssiDiff = Math.abs(newRssi - oldRssi); + + if (rssiDiff >= RSSI_THRESHOLD) { + significantRssiChanges++; + } } } - // Calculate the overlap rate (using the smaller quantity from the two scans as the baseline) int minCount = Math.min(newFingerprint.getRfScansCount(), oldFingerprint.getRfScansCount()); float overlapRatio = (float) commonCount / minCount; + float rssiChangeRatio = commonCount > 0 ? (float) significantRssiChanges / commonCount : 0; + + android.util.Log.d("SensorFusion", String.format( + "WiFi comparison: overlap %.0f%% (%d/%d MACs), RSSI changes %.0f%% (%d/%d APs)", + overlapRatio * 100, commonCount, minCount, + rssiChangeRatio * 100, significantRssiChanges, commonCount + )); + + // Consider duplicate if: + // 1. High overlap (≥90%) AND + // 2. Few RSSI changes (<30% of common APs changed significantly) + return overlapRatio >= 0.9f && rssiChangeRatio < 0.3f; + } - // If the overlap rate is 80% or higher, it is considered a duplicate fingerprint. - boolean isDuplicate = overlapRatio >= 0.90f; + /** + * Check if two BLE device lists are similar (for deduplication) + * Uses MAC address overlap ratio to determine similarity + * + * @param newList New BLE device list + * @param oldList Previous BLE device list + * @return true if lists are similar (overlap >= 80%), false otherwise + */ + /** + * Check if two BLE device lists are similar (for deduplication) + * Uses dynamic threshold based on device count: + * - Many devices (≥20): 50% overlap or 15+ common devices + * - Medium devices (≥10): 60% overlap or 8+ common devices + * - Few devices (<10): 70% overlap or 5+ common devices + * + * @param newList New BLE device list + * @param oldList Previous BLE device list + * @return true if lists are similar, false otherwise + */ + private boolean isSameBleDeviceList(List newList, + List oldList) { + if (oldList == null || oldList.isEmpty()) { + return false; + } + + if (newList.isEmpty()) { + return false; + } + + // Create set of MAC addresses from old list + java.util.Set oldMacs = new java.util.HashSet<>(); + for (BleDataProcessor.BleDevice device : oldList) { + oldMacs.add(device.macAddress); + } + + // Count common MAC addresses + int commonCount = 0; + for (BleDataProcessor.BleDevice device : newList) { + if (oldMacs.contains(device.macAddress)) { + commonCount++; + } + } - if (isDuplicate) { - android.util.Log.d("SensorFusion", String.format( - "Duplicate fingerprint: overlap %.0f%% (%d/%d common MACs)", - overlapRatio * 100, commonCount, minCount)); + // Calculate overlap ratio + int minCount = Math.min(newList.size(), oldList.size()); + float overlapRatio = (float) commonCount / minCount; + + // Determine if duplicate based on dynamic threshold + boolean isDuplicate; + String thresholdInfo; + + if (minCount >= 20) { + // Many devices: use 50% threshold + isDuplicate = overlapRatio >= 0.5f || commonCount >= 15; + thresholdInfo = "threshold=50% or 15+ devices"; + } else if (minCount >= 10) { + // Medium devices: use 60% threshold + isDuplicate = overlapRatio >= 0.6f || commonCount >= 8; + thresholdInfo = "threshold=60% or 8+ devices"; + } else { + // Few devices: use 70% threshold + isDuplicate = overlapRatio >= 0.7f || commonCount >= 5; + thresholdInfo = "threshold=70% or 5+ devices"; } + android.util.Log.d("SensorFusion", String.format( + "BLE comparison: overlap %.0f%% (%d/%d common MACs), common: %d, %s → %s", + overlapRatio * 100, commonCount, minCount, commonCount, + thresholdInfo, isDuplicate ? "DUPLICATE" : "NEW" + )); + return isDuplicate; } -// /** -// * Check if two WiFi fingerprints are identical (same MACs and RSSIs) -// * Used to avoid recording duplicate fingerprints when user is stationary -// */ -// private boolean isSameFingerprintAs(Traj.Fingerprint newFingerprint, Traj.Fingerprint oldFingerprint) { -// if (oldFingerprint == null) { -// return false; // The first scan will definitely not be repeated. -// } -// -// // Check if the number of WiFi signals scanned is the same -// if (newFingerprint.getRfScansCount() != oldFingerprint.getRfScansCount()) { -// return false; // The different numbers indicate a change. -// } -// -// // The Set created for MAC addresses is used for quick comparison. -// java.util.Set oldMacs = new java.util.HashSet<>(); -// for (Traj.RFScan scan : oldFingerprint.getRfScansList()) { -// oldMacs.add(scan.getMac()); -// } -// -// // Check whether each MAC in the new fingerprint is present in the old fingerprint. -// for (Traj.RFScan newScan : newFingerprint.getRfScansList()) { -// if (!oldMacs.contains(newScan.getMac())) { -// return false; // A new WiFi has been scanned. -// } -// } -// -// // If the MAC addresses are the same, they are considered as duplicate fingerprints. -// return true; -// } + /** * Function to create a request to obtain a wifi location for the obtained wifi fingerprint @@ -1076,6 +1153,7 @@ public void startRecording() { wakeLock.acquire(31 * 60 * 1000L /*31 minutes*/); this.lastWifiFingerprint = null; + this.lastBleDeviceList = null; this.saveRecording = true; this.stepCounter = 0; this.absoluteStartTime = System.currentTimeMillis(); diff --git a/app/src/main/res/layout/item_upload_card_view.xml b/app/src/main/res/layout/item_upload_card_view.xml index 465ea27f..d9859049 100644 --- a/app/src/main/res/layout/item_upload_card_view.xml +++ b/app/src/main/res/layout/item_upload_card_view.xml @@ -8,6 +8,7 @@ + app:strokeColor="@color/md_theme_outlineVariant" + app:layout_constraintTop_toTopOf="parent" + app:layout_constraintStart_toStartOf="parent" + app:layout_constraintEnd_toEndOf="parent"> + + app:layout_constraintEnd_toStartOf="@id/deletebutton" + app:layout_constraintTop_toTopOf="parent" /> + + + Date: Tue, 10 Feb 2026 19:16:23 +0000 Subject: [PATCH 11/82] feat: Add live data display card in recording interface MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Features: ✅ Real-time trajectory info card with collapse/expand functionality ✅ Display trajectory name in card header ✅ Show initial position (Lat, Lon, Alt) - single line format ✅ Show initial orientation (quaternion) ✅ Live data counters: WiFi Fingerprints, BLE Devices, IMU Readings ✅ Card defaults to collapsed state to maximize map view ✅ Click header to toggle card expansion Implementation: - Modified fragment_recording.xml: Added collapsible trajectoryInfoCard - Modified RecordingFragment.java: * Added card UI bindings and collapse functionality * Added updateInitialPosition/Orientation methods with delayed updates * Added live data tracking (WiFi/BLE/IMU counts) * Integrated with SensorFusion to get real-time data - Added getter methods in SensorFusion.java: * getBleDeviceList() * getTrajectory() UI Design: - Collapsed: Shows only trajectory name and expand arrow - Expanded: Shows all initial data and live statistics - Uses text arrows (▶/▼) for expand/collapse indicator - Compact single-line format for position data - Monospace font for better number alignment Data Tracking: - WiFi Fingerprints: Actual recorded fingerprints (cumulative) - BLE Devices: Actual recorded device lists (cumulative) - IMU Readings: Total sensor readings count - All counters update in real-time during recording --- .../fragment/RecordingFragment.java | 177 ++++++++++++++- .../PositionMe/sensors/SensorFusion.java | 24 ++- .../main/res/layout/fragment_recording.xml | 201 +++++++++++++++++- 3 files changed, 396 insertions(+), 6 deletions(-) diff --git a/app/src/main/java/com/openpositioning/PositionMe/presentation/fragment/RecordingFragment.java b/app/src/main/java/com/openpositioning/PositionMe/presentation/fragment/RecordingFragment.java index 6362a971..f3c91a92 100644 --- a/app/src/main/java/com/openpositioning/PositionMe/presentation/fragment/RecordingFragment.java +++ b/app/src/main/java/com/openpositioning/PositionMe/presentation/fragment/RecordingFragment.java @@ -16,6 +16,7 @@ import android.view.animation.LinearInterpolator; import android.widget.Button; import android.widget.ImageView; +import android.widget.LinearLayout; import android.widget.ProgressBar; import android.widget.TextView; import com.google.android.material.button.MaterialButton; @@ -64,6 +65,26 @@ public class RecordingFragment extends Fragment { private ProgressBar timeRemaining; private TextView elevation, distanceTravelled, gnssError; + // Trajectory Info Card (merged collapsible card) + private TextView trajectoryNameText; + private TextView initialPositionText; + private TextView initialOrientationText; + private TextView wifiCountText; + private TextView bleCountText; + private TextView imuCountText; + private LinearLayout trajectoryInfoContent; + private TextView collapseIcon; // 使用 TextView 显示 ▼ ▶ + private boolean isCardExpanded = false; + + // Counters + private int wifiFingerprints = 0; + private int bleDeviceLists = 0; + + // Counters for live data + private int totalWifiScans = 0; + private int totalBleScans = 0; + private int totalImuReadings = 0; + // App settings private SharedPreferences settings; @@ -135,6 +156,16 @@ public void onViewCreated(@NonNull View view, distanceTravelled = view.findViewById(R.id.currentDistanceTraveled); gnssError = view.findViewById(R.id.gnssError); + // Bind Trajectory Info Card (NEW - 合并后的卡片) + trajectoryNameText = view.findViewById(R.id.trajectoryNameText); + initialPositionText = view.findViewById(R.id.initialPositionText); + initialOrientationText = view.findViewById(R.id.initialOrientationText); + wifiCountText = view.findViewById(R.id.wifiCountText); + bleCountText = view.findViewById(R.id.bleCountText); + imuCountText = view.findViewById(R.id.imuCountText); + trajectoryInfoContent = view.findViewById(R.id.trajectoryInfoContent); + collapseIcon = view.findViewById(R.id.collapseIcon); + completeButton = view.findViewById(R.id.stopButton); cancelButton = view.findViewById(R.id.cancelButton); recIcon = view.findViewById(R.id.redDot); @@ -154,7 +185,6 @@ public void onViewCreated(@NonNull View view, ((RecordingActivity) requireActivity()).showCorrectionScreen(); }); - // Cancel button with confirmation dialog cancelButton.setOnClickListener(v -> { AlertDialog dialog = new AlertDialog.Builder(requireActivity()) @@ -209,6 +239,49 @@ public void onFinish() { // No set time limit, just keep refreshing refreshDataHandler.post(refreshDataTask); } + + // Set up collapse/expand functionality + View trajectoryInfoHeader = view.findViewById(R.id.trajectoryInfoHeader); + if (trajectoryInfoHeader != null) { + trajectoryInfoHeader.setOnClickListener(v -> toggleCardExpansion()); + } + + // Set initial trajectory name + if (trajectoryNameText != null) { + trajectoryNameText.setText("📝 Recording..."); + + // Update trajectory name after recording starts (with delay) + new Handler().postDelayed(() -> { + if (sensorFusion != null && sensorFusion.getTrajectory() != null) { + String trajName = sensorFusion.getTrajectory().getTrajectoryId(); + if (trajName != null && !trajName.isEmpty() && getActivity() != null) { + getActivity().runOnUiThread(() -> + trajectoryNameText.setText("📝 " + trajName)); + } + } + }, 1000); // 1 second delay to ensure trajectory is initialized + } + + // Update initial position and orientation after recording starts + new Handler().postDelayed(() -> { + if (sensorFusion != null) { + // Update initial position + float[] latLng = sensorFusion.getGNSSLatitude(false); + if (latLng != null && latLng.length >= 2) { + double lat = latLng[0]; + double lon = latLng[1]; + double alt = sensorFusion.getElevation(); + updateInitialPosition(lat, lon, alt); + } + + // Update initial orientation + float[] initialRotation = sensorFusion.getInitialRotation(); + if (initialRotation != null) { + updateInitialOrientation(initialRotation); + } + } + }, 1500); // 1.5 second delay to ensure GPS data is available + } /** @@ -268,6 +341,28 @@ private void updateUIandPosition() { // Update previous previousPosX = pdrValues[0]; previousPosY = pdrValues[1]; + + // Update live data counts - track actual recorded data + if (sensorFusion != null && sensorFusion.getTrajectory() != null) { + try { + // WiFi fingerprints (actual recorded) + int wifiFpCount = sensorFusion.getTrajectory().getWifiFingerprintsCount(); + android.util.Log.d("RecordingUI", "WiFi Fingerprints: " + wifiFpCount); + updateWifiCount(wifiFpCount); + + // BLE data (actual recorded) + int bleCount = sensorFusion.getTrajectory().getBleDataCount(); + android.util.Log.d("RecordingUI", "BLE Devices: " + bleCount); + updateBleCount(bleCount); + + // IMU readings + int imuCount = sensorFusion.getTrajectory().getImuDataList().size(); + android.util.Log.d("RecordingUI", "IMU Readings: " + imuCount); + updateImuCount(imuCount); + } catch (Exception e) { + android.util.Log.e("RecordingUI", "Error updating counts: " + e.getMessage()); + } + } } /** @@ -295,4 +390,84 @@ public void onResume() { refreshDataHandler.postDelayed(refreshDataTask, 500); } } + + /** + * Toggle card expansion/collapse + */ + private void toggleCardExpansion() { + isCardExpanded = !isCardExpanded; + + if (isCardExpanded) { + trajectoryInfoContent.setVisibility(View.VISIBLE); + collapseIcon.setText("▼"); + } else { + trajectoryInfoContent.setVisibility(View.GONE); + collapseIcon.setText("▶"); + } + } + + /** + * Update initial position display + * Called when recording starts with initial GPS position + */ + public void updateInitialPosition(double lat, double lon, double alt) { + if (initialPositionText != null && getActivity() != null) { + getActivity().runOnUiThread(() -> { + // Format: Lat: 55.920, Lon: -3.168, Alt: 112m + String posText = String.format(java.util.Locale.US, + "Lat: %.6f, Lon: %.6f, Alt: %.1fm", lat, lon, alt); + initialPositionText.setText(posText); + }); + } + } + + /** + * Update initial orientation display + * Called when recording starts with initial sensor orientation + */ + public void updateInitialOrientation(float[] quaternion) { + if (initialOrientationText != null && getActivity() != null && quaternion != null && quaternion.length >= 4) { + getActivity().runOnUiThread(() -> { + // Convert quaternion to Euler angles (simplified) + // For display purposes, just show quaternion values + String oriText = String.format(java.util.Locale.US, + "Q: [%.2f, %.2f, %.2f, %.2f]", + quaternion[0], quaternion[1], quaternion[2], quaternion[3]); + initialOrientationText.setText(oriText); + }); + } + } + + /** + * Update WiFi count display + */ + public void updateWifiCount(int count) { + if (wifiCountText != null && getActivity() != null) { + totalWifiScans = count; + getActivity().runOnUiThread(() -> + wifiCountText.setText(String.valueOf(totalWifiScans))); + } + } + + /** + * Update BLE count display + */ + public void updateBleCount(int count) { + if (bleCountText != null && getActivity() != null) { + totalBleScans = count; + getActivity().runOnUiThread(() -> + bleCountText.setText(String.valueOf(totalBleScans))); + } + } + + /** + * Update IMU count display + */ + public void updateImuCount(int count) { + if (imuCountText != null && getActivity() != null) { + totalImuReadings = count; + getActivity().runOnUiThread(() -> + imuCountText.setText(String.valueOf(totalImuReadings))); + } + } } diff --git a/app/src/main/java/com/openpositioning/PositionMe/sensors/SensorFusion.java b/app/src/main/java/com/openpositioning/PositionMe/sensors/SensorFusion.java index f8f98681..64b82eb6 100644 --- a/app/src/main/java/com/openpositioning/PositionMe/sensors/SensorFusion.java +++ b/app/src/main/java/com/openpositioning/PositionMe/sensors/SensorFusion.java @@ -214,6 +214,22 @@ private SensorFusion() { this.startLocation = new float[2]; } + /** + * Get current BLE device list + * @return List of BLE devices from last scan + */ + public List getBleDeviceList() { + return this.bleDeviceList; + } + + /** + * Get current trajectory being recorded + * @return Trajectory protobuf builder + */ + public Traj.Trajectory.Builder getTrajectory() { + return this.trajectory; + } + /** * Static function to access singleton instance of SensorFusion. @@ -224,6 +240,10 @@ public static SensorFusion getInstance() { return sensorFusion; } + public float[] getInitialRotation() { + return this.initialRotation; + } + /** * Initialisation function for the SensorFusion instance. * @@ -650,9 +670,9 @@ private boolean isSameFingerprintAs(Traj.Fingerprint newFingerprint, Traj.Finger )); // Consider duplicate if: - // 1. High overlap (≥90%) AND + // 1. High overlap (≥70%) AND // 2. Few RSSI changes (<30% of common APs changed significantly) - return overlapRatio >= 0.9f && rssiChangeRatio < 0.3f; + return overlapRatio >= 0.7f && rssiChangeRatio < 0.3f; } /** diff --git a/app/src/main/res/layout/fragment_recording.xml b/app/src/main/res/layout/fragment_recording.xml index c04381a5..fd799f3e 100644 --- a/app/src/main/res/layout/fragment_recording.xml +++ b/app/src/main/res/layout/fragment_recording.xml @@ -58,7 +58,6 @@ android:layout_marginStart="16dp" android:layout_marginEnd="16dp" /> - + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + @@ -142,4 +337,4 @@ app:cornerRadius="16dp" /> - + \ No newline at end of file From 21473c677b36103a44824c614f73dba3e6bc4d37 Mon Sep 17 00:00:00 2001 From: Bhavyas15 Date: Tue, 10 Feb 2026 10:47:58 +0000 Subject: [PATCH 12/82] merge sensor data and test points --- .../fragment/RecordingFragment.java | 42 +++++++++++++- .../fragment/TrajectoryMapFragment.java | 57 +++++++++++++++++++ .../PositionMe/sensors/SensorFusion.java | 37 ++++++++++++ .../PositionMe/sensors/model/TestPoint.java | 14 +++++ .../res/drawable/baseline_add_location_24.xml | 5 ++ .../main/res/layout/fragment_recording.xml | 35 +++++++++--- app/src/main/res/values/strings.xml | 1 + build.gradle | 2 +- 8 files changed, 183 insertions(+), 10 deletions(-) create mode 100644 app/src/main/java/com/openpositioning/PositionMe/sensors/model/TestPoint.java create mode 100644 app/src/main/res/drawable/baseline_add_location_24.xml diff --git a/app/src/main/java/com/openpositioning/PositionMe/presentation/fragment/RecordingFragment.java b/app/src/main/java/com/openpositioning/PositionMe/presentation/fragment/RecordingFragment.java index f3c91a92..29c6349b 100644 --- a/app/src/main/java/com/openpositioning/PositionMe/presentation/fragment/RecordingFragment.java +++ b/app/src/main/java/com/openpositioning/PositionMe/presentation/fragment/RecordingFragment.java @@ -3,6 +3,7 @@ import android.app.AlertDialog; import android.content.Context; import android.content.SharedPreferences; +import android.graphics.Bitmap; import android.graphics.Color; import android.os.Bundle; import android.os.CountDownTimer; @@ -19,6 +20,10 @@ import android.widget.LinearLayout; import android.widget.ProgressBar; import android.widget.TextView; +import android.widget.Toast; + +import com.google.android.gms.maps.model.BitmapDescriptorFactory; +import com.google.android.gms.maps.model.MarkerOptions; import com.google.android.material.button.MaterialButton; import androidx.annotation.NonNull; @@ -60,7 +65,7 @@ public class RecordingFragment extends Fragment { // UI elements - private MaterialButton completeButton, cancelButton; + private MaterialButton completeButton, cancelButton, markTestPointButton; private ImageView recIcon; private ProgressBar timeRemaining; private TextView elevation, distanceTravelled, gnssError; @@ -97,6 +102,8 @@ public class RecordingFragment extends Fragment { private float distance = 0f; private float previousPosX = 0f; private float previousPosY = 0f; + private int testPointCounter = 0; + // References to the child map fragment private TrajectoryMapFragment trajectoryMapFragment; @@ -168,6 +175,7 @@ public void onViewCreated(@NonNull View view, completeButton = view.findViewById(R.id.stopButton); cancelButton = view.findViewById(R.id.cancelButton); + markTestPointButton= view.findViewById(R.id.markPointButton); recIcon = view.findViewById(R.id.redDot); timeRemaining = view.findViewById(R.id.timeRemainingBar); @@ -185,6 +193,38 @@ public void onViewCreated(@NonNull View view, ((RecordingActivity) requireActivity()).showCorrectionScreen(); }); + markTestPointButton.setOnClickListener(v -> { + long timestampMillis = System.currentTimeMillis(); + + SensorFusion.getInstance().addTestPoint(timestampMillis); + + float[] gnss = SensorFusion.getInstance().getGNSSLatitude(false); + if (gnss != null) { + double lat = gnss[0]; + double lon = gnss[1]; + + SensorFusion.getInstance().addTestPoint(timestampMillis, lat, lon); + + testPointCounter++; + + if (trajectoryMapFragment != null) { + trajectoryMapFragment.addTestPointMarker( + new LatLng(lat, lon), + testPointCounter + ); + } + + Toast.makeText(requireContext(), + "Test point " + testPointCounter + " marked", + Toast.LENGTH_SHORT).show(); + } else { + Toast.makeText(requireContext(), + "GNSS not available yet", + Toast.LENGTH_SHORT).show(); + } + }); + + // Cancel button with confirmation dialog cancelButton.setOnClickListener(v -> { AlertDialog dialog = new AlertDialog.Builder(requireActivity()) diff --git a/app/src/main/java/com/openpositioning/PositionMe/presentation/fragment/TrajectoryMapFragment.java b/app/src/main/java/com/openpositioning/PositionMe/presentation/fragment/TrajectoryMapFragment.java index eb0bad65..11dac91f 100644 --- a/app/src/main/java/com/openpositioning/PositionMe/presentation/fragment/TrajectoryMapFragment.java +++ b/app/src/main/java/com/openpositioning/PositionMe/presentation/fragment/TrajectoryMapFragment.java @@ -29,6 +29,17 @@ import java.util.ArrayList; import java.util.List; +import android.graphics.Bitmap; +import android.graphics.Canvas; +import android.graphics.Color; +import android.graphics.Paint; +import android.graphics.Rect; +import android.graphics.Typeface; + +import com.google.android.gms.maps.model.BitmapDescriptorFactory; +import com.google.android.gms.maps.model.MarkerOptions; + + /** * A fragment responsible for displaying a trajectory map using Google Maps. @@ -202,6 +213,52 @@ public void onMapReady(@NonNull GoogleMap googleMap) { * @param map */ + private Bitmap createNumberedMarkerBitmap(int number) { + int size = 100; // marker size in pixels + + Bitmap bitmap = Bitmap.createBitmap(size, size, Bitmap.Config.ARGB_8888); + Canvas canvas = new Canvas(bitmap); + + Paint circlePaint = new Paint(); + circlePaint.setColor(Color.RED); + circlePaint.setAntiAlias(true); + + Paint textPaint = new Paint(); + textPaint.setColor(Color.WHITE); + textPaint.setTextSize(40f); + textPaint.setTypeface(Typeface.DEFAULT_BOLD); + textPaint.setAntiAlias(true); + textPaint.setTextAlign(Paint.Align.CENTER); + + // Draw circle + canvas.drawCircle(size / 2f, size / 2f, size / 2f, circlePaint); + + // Draw number in center + Rect bounds = new Rect(); + String text = String.valueOf(number); + textPaint.getTextBounds(text, 0, text.length(), bounds); + + float x = size / 2f; + float y = size / 2f - bounds.centerY(); + + canvas.drawText(text, x, y, textPaint); + + return bitmap; + } + + public void addTestPointMarker(LatLng latLng, int number) { + Bitmap numberedMarker = createNumberedMarkerBitmap(number); + + MarkerOptions markerOptions = new MarkerOptions() + .position(latLng) + .icon(BitmapDescriptorFactory.fromBitmap(numberedMarker)) + .anchor(0.5f, 0.5f) // center anchor + .title("Test Point " + number); + + gMap.addMarker(markerOptions); + } + + private void initMapSettings(GoogleMap map) { // Basic map settings map.getUiSettings().setCompassEnabled(true); diff --git a/app/src/main/java/com/openpositioning/PositionMe/sensors/SensorFusion.java b/app/src/main/java/com/openpositioning/PositionMe/sensors/SensorFusion.java index 64b82eb6..b2b305d5 100644 --- a/app/src/main/java/com/openpositioning/PositionMe/sensors/SensorFusion.java +++ b/app/src/main/java/com/openpositioning/PositionMe/sensors/SensorFusion.java @@ -36,6 +36,10 @@ import java.util.stream.Collectors; import java.util.stream.Stream; +import java.util.ArrayList; +import java.util.List; +import com.openpositioning.PositionMe.sensors.model.TestPoint; + /** * The SensorFusion class is the main data gathering and processing class of the application. @@ -179,6 +183,8 @@ public class SensorFusion implements SensorEventListener, Observer { // WiFi positioning object private WiFiPositioning wiFiPositioning; + private final List testPoints = new ArrayList<>(); + //region Initialisation /** @@ -258,6 +264,37 @@ public float[] getInitialRotation() { * @see GNSSDataProcessor for location data processing. * @see WifiDataProcessor for network data processing. */ + + public void addTestPoint(long timestampMillis, double lat, double lon) { + testPoints.add(new TestPoint(timestampMillis, lat, lon)); + } + +// debugging- + public List getTestPoints() { + return testPoints; + } + + public void addTestPoint(long timestamp) { + Log.d("TestPoint", "Test point marked at: " + timestamp); + if (!saveRecording || trajectory == null) { + Log.w("SensorFusion", "Test point ignored: not recording"); + return; + } + + long relativeTs = System.currentTimeMillis() - absoluteStartTime; + + Traj.GNSSPosition testPoint = Traj.GNSSPosition.newBuilder() + .setRelativeTimestamp(relativeTs) + .setLatitude(latitude) + .setLongitude(longitude) + .setAltitude(elevation) // or GNSS altitude if you prefer + .build(); + + trajectory.addTestPoints(testPoint); + + Log.d("SensorFusion", "Test point added @ " + latitude + ", " + longitude); + } + public void setContext(Context context) { this.appContext = context.getApplicationContext(); // store app context for later use diff --git a/app/src/main/java/com/openpositioning/PositionMe/sensors/model/TestPoint.java b/app/src/main/java/com/openpositioning/PositionMe/sensors/model/TestPoint.java new file mode 100644 index 00000000..34b4e55a --- /dev/null +++ b/app/src/main/java/com/openpositioning/PositionMe/sensors/model/TestPoint.java @@ -0,0 +1,14 @@ +package com.openpositioning.PositionMe.sensors.model; + +public class TestPoint { + public final long timestampMillis; + public final double latitude; + public final double longitude; + + public TestPoint(long timestampMillis, double latitude, double longitude) { + this.timestampMillis = timestampMillis; + this.latitude = latitude; + this.longitude = longitude; + } + +} diff --git a/app/src/main/res/drawable/baseline_add_location_24.xml b/app/src/main/res/drawable/baseline_add_location_24.xml new file mode 100644 index 00000000..9e099e9d --- /dev/null +++ b/app/src/main/res/drawable/baseline_add_location_24.xml @@ -0,0 +1,5 @@ + + + + + diff --git a/app/src/main/res/layout/fragment_recording.xml b/app/src/main/res/layout/fragment_recording.xml index fd799f3e..61c87dd0 100644 --- a/app/src/main/res/layout/fragment_recording.xml +++ b/app/src/main/res/layout/fragment_recording.xml @@ -309,27 +309,46 @@ + + + + app:iconSize="24dp" + app:iconTint="@color/md_theme_onSecondary" /> Play End Exit + Mark Point \ No newline at end of file diff --git a/build.gradle b/build.gradle index 4b1a229d..bce5298f 100644 --- a/build.gradle +++ b/build.gradle @@ -9,7 +9,7 @@ buildscript { } dependencies { // NOTE: Only classpath deps (plugins) go here - classpath "com.android.tools.build:gradle:$agp_version" + classpath 'com.android.tools.build:gradle:8.8.0' classpath 'com.google.gms:google-services:4.4.2' def nav_version = "2.5.3" classpath "androidx.navigation:navigation-safe-args-gradle-plugin:$nav_version" From a3ffd086772b81fef5ababea32da7d8ce935f0f1 Mon Sep 17 00:00:00 2001 From: Bhavyas15 Date: Wed, 11 Feb 2026 18:25:47 +0000 Subject: [PATCH 13/82] Uploads page and xml files updated --- .../PositionMe/data/model/TestPointInfo.java | 15 +++ .../data/remote/ServerCommunications.java | 9 +- .../data/utils/TestPointParser.java | 37 ++++++ .../fragment/RecordingFragment.java | 6 +- .../viewitems/TestPointListAdapter.java | 60 +++++++++ .../viewitems/UploadListAdapter.java | 112 ++++++++++++++++ .../viewitems/UploadViewHolder.java | 18 ++- app/src/main/res/drawable/down_arrow.png | Bin 0 -> 9872 bytes app/src/main/res/drawable/up_arrow.png | Bin 0 -> 15325 bytes .../main/res/layout/item_testpoint_row.xml | 28 ++++ .../main/res/layout/item_upload_card_view.xml | 121 +++++++++++------- build.gradle | 3 +- 12 files changed, 352 insertions(+), 57 deletions(-) create mode 100644 app/src/main/java/com/openpositioning/PositionMe/data/model/TestPointInfo.java create mode 100644 app/src/main/java/com/openpositioning/PositionMe/data/utils/TestPointParser.java create mode 100644 app/src/main/java/com/openpositioning/PositionMe/presentation/viewitems/TestPointListAdapter.java create mode 100644 app/src/main/res/drawable/down_arrow.png create mode 100644 app/src/main/res/drawable/up_arrow.png create mode 100644 app/src/main/res/layout/item_testpoint_row.xml diff --git a/app/src/main/java/com/openpositioning/PositionMe/data/model/TestPointInfo.java b/app/src/main/java/com/openpositioning/PositionMe/data/model/TestPointInfo.java new file mode 100644 index 00000000..7ed95d41 --- /dev/null +++ b/app/src/main/java/com/openpositioning/PositionMe/data/model/TestPointInfo.java @@ -0,0 +1,15 @@ +package com.openpositioning.PositionMe.data.model; + +public class TestPointInfo { + public int number; + public double latitude; + public double longitude; + public long timestamp; + + public TestPointInfo(int number, double latitude, double longitude, long timestamp) { + this.number = number; + this.latitude = latitude; + this.longitude = longitude; + this.timestamp = timestamp; + } +} diff --git a/app/src/main/java/com/openpositioning/PositionMe/data/remote/ServerCommunications.java b/app/src/main/java/com/openpositioning/PositionMe/data/remote/ServerCommunications.java index 89b690b2..d54a0400 100644 --- a/app/src/main/java/com/openpositioning/PositionMe/data/remote/ServerCommunications.java +++ b/app/src/main/java/com/openpositioning/PositionMe/data/remote/ServerCommunications.java @@ -218,7 +218,8 @@ private void copyFile(File src, File dst) throws IOException { // System.err.println("POST error response: " + responseBody.string()); String errorBody = responseBody.string(); - infoResponse = "Upload failed: " + errorBody; +// infoResponse = "Upload failed: " + errorBody; + infoResponse = ""; new Handler(Looper.getMainLooper()).post(() -> Toast.makeText(context, infoResponse, Toast.LENGTH_SHORT).show()); // show error message to users @@ -313,7 +314,8 @@ public void onFailure(Call call, IOException e) { success = false; System.err.println("UPLOAD: Failure to get response"); notifyObservers(1); - infoResponse = "Upload failed: " + e.getMessage(); // Store error message +// infoResponse = "Upload failed: " + e.getMessage(); // Store error message + infoResponse = ""; new Handler(Looper.getMainLooper()).post(() -> Toast.makeText(context, infoResponse, Toast.LENGTH_SHORT).show()); // show error message to users } @@ -330,7 +332,8 @@ public void onResponse(Call call, Response response) throws IOException { assert responseBody != null; String errorBody = responseBody.string(); System.err.println("UPLOAD unsuccessful: " + errorBody); - infoResponse = "Upload failed: " + errorBody; +// infoResponse = "Upload failed: " + errorBody; + infoResponse = ""; new Handler(Looper.getMainLooper()).post(() -> Toast.makeText(context, infoResponse, Toast.LENGTH_SHORT).show()); throw new IOException("UPLOAD failed with code " + response); diff --git a/app/src/main/java/com/openpositioning/PositionMe/data/utils/TestPointParser.java b/app/src/main/java/com/openpositioning/PositionMe/data/utils/TestPointParser.java new file mode 100644 index 00000000..f7f53e99 --- /dev/null +++ b/app/src/main/java/com/openpositioning/PositionMe/data/utils/TestPointParser.java @@ -0,0 +1,37 @@ +package com.openpositioning.PositionMe.data.utils; + +import com.openpositioning.PositionMe.Traj; +import com.openpositioning.PositionMe.data.model.TestPointInfo; + +import java.io.File; +import java.io.FileInputStream; +import java.util.ArrayList; +import java.util.List; + +public class TestPointParser { + + public static List parseFromFile(File file) { + List list = new ArrayList<>(); + + try (FileInputStream fis = new FileInputStream(file)) { + + Traj.Trajectory trajectory = Traj.Trajectory.parseFrom(fis); + + int counter = 1; + for (Traj.GNSSPosition tp : trajectory.getTestPointsList()) { + + list.add(new TestPointInfo( + counter++, + tp.getLatitude(), + tp.getLongitude(), + tp.getRelativeTimestamp() // <-- correct field + )); + } + + } catch (Exception e) { + e.printStackTrace(); + } + + return list; + } +} diff --git a/app/src/main/java/com/openpositioning/PositionMe/presentation/fragment/RecordingFragment.java b/app/src/main/java/com/openpositioning/PositionMe/presentation/fragment/RecordingFragment.java index 29c6349b..c1998b02 100644 --- a/app/src/main/java/com/openpositioning/PositionMe/presentation/fragment/RecordingFragment.java +++ b/app/src/main/java/com/openpositioning/PositionMe/presentation/fragment/RecordingFragment.java @@ -214,9 +214,9 @@ public void onViewCreated(@NonNull View view, ); } - Toast.makeText(requireContext(), - "Test point " + testPointCounter + " marked", - Toast.LENGTH_SHORT).show(); +// Toast.makeText(requireContext(), +// "Test point " + testPointCounter + " marked", +// Toast.LENGTH_SHORT).show(); } else { Toast.makeText(requireContext(), "GNSS not available yet", diff --git a/app/src/main/java/com/openpositioning/PositionMe/presentation/viewitems/TestPointListAdapter.java b/app/src/main/java/com/openpositioning/PositionMe/presentation/viewitems/TestPointListAdapter.java new file mode 100644 index 00000000..e3c2af42 --- /dev/null +++ b/app/src/main/java/com/openpositioning/PositionMe/presentation/viewitems/TestPointListAdapter.java @@ -0,0 +1,60 @@ +package com.openpositioning.PositionMe.presentation.viewitems; + +import android.content.Context; +import android.view.LayoutInflater; +import android.view.View; +import android.view.ViewGroup; +import android.widget.TextView; +import androidx.annotation.NonNull; +import androidx.recyclerview.widget.RecyclerView; + +import com.openpositioning.PositionMe.R; +import com.openpositioning.PositionMe.data.model.TestPointInfo; + +import java.text.SimpleDateFormat; +import java.util.List; +import java.util.Locale; + +public class TestPointListAdapter extends RecyclerView.Adapter { + + private final Context context; + private final List testPoints; + + public TestPointListAdapter(Context context, List testPoints) { + this.context = context; + this.testPoints = testPoints; + } + + @NonNull + @Override + public TestPointViewHolder onCreateViewHolder(@NonNull ViewGroup parent, int viewType) { + View view = LayoutInflater.from(context).inflate(R.layout.item_testpoint_row, parent, false); + return new TestPointViewHolder(view); + } + + @Override + public void onBindViewHolder(@NonNull TestPointViewHolder holder, int position) { + TestPointInfo tp = testPoints.get(position); + holder.tvNumber.setText(String.valueOf(tp.number)); + holder.tvLatLon.setText(String.format(Locale.US, "(%.6f, %.6f)", tp.latitude, tp.longitude)); + + SimpleDateFormat sdf = new SimpleDateFormat("yyyy-MM-dd HH:mm:ss", Locale.US); + holder.tvTimestamp.setText(sdf.format(tp.timestamp)); + } + + @Override + public int getItemCount() { + return testPoints.size(); + } + + public static class TestPointViewHolder extends RecyclerView.ViewHolder { + TextView tvNumber, tvLatLon, tvTimestamp; + + public TestPointViewHolder(@NonNull View itemView) { + super(itemView); + tvNumber = itemView.findViewById(R.id.tvTestPointNumber); + tvLatLon = itemView.findViewById(R.id.tvLatLon); + tvTimestamp = itemView.findViewById(R.id.tvTimestamp); + } + } +} diff --git a/app/src/main/java/com/openpositioning/PositionMe/presentation/viewitems/UploadListAdapter.java b/app/src/main/java/com/openpositioning/PositionMe/presentation/viewitems/UploadListAdapter.java index f1ed38d7..3ca553dd 100644 --- a/app/src/main/java/com/openpositioning/PositionMe/presentation/viewitems/UploadListAdapter.java +++ b/app/src/main/java/com/openpositioning/PositionMe/presentation/viewitems/UploadListAdapter.java @@ -17,6 +17,20 @@ import java.util.List; import java.util.regex.Matcher; import java.util.regex.Pattern; +import java.util.ArrayList; + +import androidx.recyclerview.widget.LinearLayoutManager; + +import com.openpositioning.PositionMe.data.model.TestPointInfo; +import com.openpositioning.PositionMe.data.utils.TestPointParser; + +import androidx.core.content.ContextCompat; + +import com.openpositioning.PositionMe.data.remote.ServerCommunications; + +import android.os.Handler; +import android.os.Looper; + /** * Adapter used for displaying local Trajectory file data @@ -32,6 +46,13 @@ public class UploadListAdapter extends RecyclerView.Adapter { private final List uploadItems; private final DownloadClickListener listener; + List testPoints; + + private final List expandedState; + + private final ServerCommunications serverCommunications; + + /** * Default public constructor with context for inflating views and list to be displayed. * @@ -45,6 +66,12 @@ public UploadListAdapter(Context context, List uploadItems, DownloadClickL this.context = context; this.uploadItems = uploadItems; this.listener = listener; + this.serverCommunications = new ServerCommunications(context); + + expandedState = new ArrayList<>(); + for (int i = 0; i < uploadItems.size(); i++) { + expandedState.add(false); // collapsed by default + } } /** @@ -67,6 +94,8 @@ public UploadViewHolder onCreateViewHolder(@NonNull ViewGroup parent, int viewTy */ @Override public void onBindViewHolder(@NonNull UploadViewHolder holder, int position) { + File trajectoryFile = uploadItems.get(position); + holder.trajId.setText(String.valueOf(position)); // Extract date from filename @@ -86,8 +115,91 @@ public void onBindViewHolder(@NonNull UploadViewHolder holder, int position) { holder.trajectoryNameText.setVisibility(View.VISIBLE); } + // --------------------------- + // 🔽 Setup test point dropdown + // --------------------------- + // Parse test points from protobuf file + +// List testPoints = +// TestPointParser.parseFromFile(trajectoryFile); + + try { + testPoints = TestPointParser.parseFromFile(trajectoryFile); + } catch (Exception e) { + testPoints = java.util.Collections.emptyList(); + android.util.Log.e("UploadListAdapter", + "Failed to parse test points from " + trajectoryFile.getName(), e); + } + + + // Setup nested RecyclerView + TestPointListAdapter testPointListAdapter = + new TestPointListAdapter(context, testPoints); + + holder.testPointRecyclerView.setLayoutManager( + new LinearLayoutManager(context)); + + holder.testPointRecyclerView.setAdapter(testPointListAdapter); + + // Initially collapsed + holder.testPointRecyclerView.setVisibility(android.view.View.GONE); + + boolean isExpanded = expandedState.get(position); + + // Apply state when binding (IMPORTANT for RecyclerView recycling) + holder.testPointRecyclerView.setVisibility(isExpanded ? View.VISIBLE : View.GONE); + holder.toggleTestPointsButton.setIcon( + ContextCompat.getDrawable(context, + isExpanded ? R.drawable.up_arrow : R.drawable.down_arrow) + ); + + // Toggle expand/collapse + holder.toggleTestPointsButton.setOnClickListener(v -> { + boolean newState = !expandedState.get(position); + expandedState.set(position, newState); + + holder.testPointRecyclerView.setVisibility(newState ? View.VISIBLE : View.GONE); + holder.toggleTestPointsButton.setIcon( + ContextCompat.getDrawable(context, + newState ? R.drawable.up_arrow : R.drawable.down_arrow) + ); + }); + + // Set click listener for the delete button holder.deletebutton.setOnClickListener(v -> deleteFileAtPosition(position)); + + // --------------------------- + // ⬆ Upload button + // --------------------------- + holder.uploadButton.setOnClickListener(v -> { + File fileToUpload = uploadItems.get(position); + + if (!fileToUpload.exists()) { + Toast.makeText(context, "File not found", Toast.LENGTH_SHORT).show(); + return; + } + + holder.uploadButton.setEnabled(false); + + String name = readTrajectoryName(fileToUpload); + String displayName = (name != null && !name.isEmpty()) + + ? name + : fileToUpload.getName(); + + Toast.makeText(context, + "Uploading trajectory: " + displayName, + Toast.LENGTH_LONG).show(); + + serverCommunications.uploadLocalTrajectory(fileToUpload); + + new Handler(Looper.getMainLooper()).postDelayed(() -> { + holder.uploadButton.setEnabled(true); + }, 3000); // re-enable after 3 seconds + }); + + } /** diff --git a/app/src/main/java/com/openpositioning/PositionMe/presentation/viewitems/UploadViewHolder.java b/app/src/main/java/com/openpositioning/PositionMe/presentation/viewitems/UploadViewHolder.java index ebf9224e..be28a60c 100644 --- a/app/src/main/java/com/openpositioning/PositionMe/presentation/viewitems/UploadViewHolder.java +++ b/app/src/main/java/com/openpositioning/PositionMe/presentation/viewitems/UploadViewHolder.java @@ -30,6 +30,9 @@ public class UploadViewHolder extends RecyclerView.ViewHolder implements View.On // Weak reference to the click listener to enable garbage collection on recyclerview items private WeakReference listenerReference; public Button deletebutton; + public RecyclerView testPointRecyclerView; + public MaterialButton toggleTestPointsButton; + /** * {@inheritDoc} @@ -44,15 +47,16 @@ public UploadViewHolder(@NonNull View itemView, DownloadClickListener listener) super(itemView); this.listenerReference = new WeakReference<>(listener); - this.trajId = itemView.findViewById(R.id.trajectoryIdItem); - this.trajDate = itemView.findViewById(R.id.trajectoryDateItem); - this.trajectoryNameText = itemView.findViewById(R.id.trajectory_name_text); // NEW - this.uploadButton = itemView.findViewById(R.id.uploadTrajectoryButton); - - this.uploadButton.setOnClickListener(this); - this.deletebutton = itemView.findViewById(R.id.deletebutton); + trajId = itemView.findViewById(R.id.trajectoryIdItem); + trajDate = itemView.findViewById(R.id.trajectoryDateItem); + trajectoryNameText = itemView.findViewById(R.id.trajectory_name_text); // ✅ ADD THIS + uploadButton = itemView.findViewById(R.id.uploadTrajectoryButton); + toggleTestPointsButton = itemView.findViewById(R.id.toggleTestPointsButton); + testPointRecyclerView = itemView.findViewById(R.id.rvTestPoints); + deletebutton = itemView.findViewById(R.id.deletebutton); } + /** * {@inheritDoc} * Calls the onPositionClick function on the listenerReference object. diff --git a/app/src/main/res/drawable/down_arrow.png b/app/src/main/res/drawable/down_arrow.png new file mode 100644 index 0000000000000000000000000000000000000000..efbc9e509967b8a4499ecb9d9b67ecd071cc4cb9 GIT binary patch literal 9872 zcmc(k3v^V~xyQeA&OA;glSx7bh#|ls2@vFw@J>QZ4q(E|h7m1VsWeJND~P-<43Ddu z$OUxQA{1yVf5Sr_*~~tL?qk zyVh^5eEWaC@7sHSd!ISy?5y%tjY)B3xriub+}JxO5!oAvl%=Wz%H{(deo55pzHxVs zyw`vJYSXdwXY@2>zxg<0yB|yQs9U4qjb0ua#eDeq^wmUF77U+VSbO zqS>BqF!dG463H%w$=plQ!=Yk7OzQKKoR`xrmq$X=ZR=i{=EQ}-!|D5PTb8@>8Q!S5 zpIxm8hdvDR-unEcJ3{6bEr6}BKGA@X>~&qukU#C?A!hux`~5R35z-V7>6#Eykr;9^ zF=TdPNSB0=6ZO0ob0UF%_*k#Kwli#`46*{KQ60V&mS##+`|c zA&HH=#D+JqVM}N%T^!UsX5~UpRFsXV)=XHY|Su}W!6iR zE(9hfWrlF)yIbhs6QM_KX66-h*x3P*4B5dmA1~4$?|kh~q!eRh4`m07JR;TWPmU_< z63&!~c&a6ViH@RY5rF86-6HcOPmUR&{lLGZ| z5y_C&<;DXJNH!w$(DIq%`imS2%M^5aEpPImBB8xdxg*&t<4 zFb5rMY;O6H@X%*{9xEn3xA+XqGR57~_F?w%95E}0sKT^2x^9)tGGc~vFRXiy%(e;H-L3IaOOZJ@EJby;Q+tv6x~I7}@`vZn%B-iH{RI;Y%2w zrrAl;edK8CxK$NB&V6h3d$#|c<_^2Dcl-74$4j(M76WYZk*mwD!Mg z=6n`pu*j@S?@Q+3mn7-43Su|n3$WX!9sKe2MgZa$# z;EJ<+C~M%26kKtX7qc;VQJm?fVUFiJQ?~-5z5S`FQ|ZIx51}?&sCr_nA%#a`(j#Qn z_1JL-TbV-iXNkU4QnRUB5z$o#HMvU{kpC)zJ5qJu)~FOdqfoGt*mJ=aC*$v&7x3(n zp4X@w)?%hiO}5e%Rt@(2JZW{$1#8QGSDr-n5`eS#!tsxhs!>VlVu7BJx zEr~V2ez3cKuHm($@EH`lYj?e&p(QDd8(Kf$)DJY|y29yp(swxZ9Szf5;eoI>I`xeW zueri^!(QpsS2nb`!gF9Rbm|M+LUMRL>_?sYqis!ccpvQhoceujQ8|1D_86x=rtP{M zj=>)8)Q7jJN;us?dT(dr$ylZm9tgX$v++bMUkTq0+v#jP7AsQ1a~#xoL~1+|8>@uZ z!#*fA9*o_ug!jSzjnw#?*kelg4D5YU<*HNGk}z8ZT|@n3|!S!&!I3n~5x>`l`A>8(wQ|0?VsOYZUK4LyRbQHxq9WTPdglr($*MBe~vIsq!_&#IE^Y$V%>bxSrHYO5tyEs^nCIr>YjngESm zN{jodSp?Wo7m%F~q87pODWo@;r zy$JWMK+PvWi+h7w7XfxOi5*=Plvxn&kIKk&~j|1x#~lcq=*NrJG*utfc-6F^}CCEvXBst}7WMq-YfjH~~fP zqLK{lssz{`8&Ln1fRQVKy6yy`m4KzGfJ)MV=9U2)U<2yE5ik@9)b$_`Edwl|0xC%b zT0a@EJql2tBVe>}>T)^JVRR^kr6mC>Nnurrc9#s;0L3^>>W?|mLQY*zHam$9B?A^n z(rRS(E=QXwt1pwWi=%F)QN1ae&#CLpTH(&omdk)uan#oc7;8AA`f#EeV6$C-4msIp zlD16->|M#2M=FvcH5N6CM)l>CH~?#Pab`(Cds_y^Jp|NWaiSeKqxy47Y=F&9=6ps# zi^#wjOhA2$6LoP$6>v&qz*>{FcA3p0qYG&^MLkAF21RY89;Z5#LZ(ARqXsgcn|ZLV z#Ads-Y(@JsM?Fa()Xu3J#Mxg4SfiV>HWg^43g-exJwqV$1*dKZ$wO&wDPYwpoOTb; zsuj)wj(VOz=n7pcA$d4wZV7wE!@?;*+p2IFCv=&BdWmzbh$9yRmhItGbF`-wj-jYg z3jL9zenPb+bZr<%9>Ibh_DTw;)uX+sXj4qyR@4}U&T{HXIs1pOekshC%5kS?qZRF< z$p|I%E~z&-g9dZz$^d)a&1p;pTCT!r=Y;ABcQ+;~ngGF3x@lXuD)!%qI}~IVZn6XMZ2gcond_T%18N(ALPIpOUeG z6EbK}KIQl3?C;I4Cee5o(B{d2?dODEB4GTQGpH9QzW}hANr1+?fp(7!*dPUjULatc zC8LS1<#O_i0K2FHTJ2#!RkQ*busX$PrO+z!pCLUa`Ib^-G~GxeA0w|u2h;QcHuCnM z3N_%AfZjs}5uJcM6zJ<@K;97`u$2JWQ$eH`0sV{u79|nzT?cxV49Hs!0?!j5 zdm4!35YW?YV3A6|r%FC`q(|00a32i^7fQTIAH5CGurT-par{ z0^}V-C(mj+pF{z?_icCx)JOzqdnP~%pcgyz;`$4z>_B&n-Jy@Ge>s&6hy6W={=NDs(7TcT zLx=vu`YzC6FLLOM>MwZMfvy<5Ltj<@vM2l{F8ORLr4-Q((U<`QD9vDThDBYW`mG{XX`Q9R99CzCTF5 zKg9kZ`)6R;&P%@Yv3l7*4R*8SYd*4@{8M0Gl6;qr>?Hp^us@P~A063F{t2)@k$j&V zd6oR5VSgt1T93R;{^78{kbGYp*+~8Z*w-cB^&>wbe{b0BlCS;9^W^U?Q6auMsda!H zeh^XoYn6X=*OVXK5N`s)v`5zl|v9qw4(DW+{9G z-&@thjs-_J*+LIaIwV@5eBOncha*^}%(TNZ$bSyOc~m{Nb&C|f0|5qlI5xt;7GjGX zmuZFl^Ul|Lu!4eN^l)s1J-itQJI663=jR!$4O_*H zA!&yvP%}1S;hof&mD4_#nsd+?Pl2qS?GIBk-s20a(CFPhiJEatS~v-fKJBBZ8J`=4 zlhNqgK8TvL(0Bli{_Q!`oQXz231k(tccA7@w;BW6Woq``Y7Abwh@Qj%a9%L>xvZl_ zY&ic0kI=UIlpkaTFJR~5*kV%d$^v)z9m0Q5ifQM*;~VX*lZkL%z|KZLTqFB)QAgdQ zKi=NjQ#y=~TO3PhLu;?sQZtg70~o!un4Uy3vzwfwnK)g#)lK>jTsT0$m2v21Re_C{ ziPrW+H*as0aDYHmnZeFJc4>`SObkGOyfoI6pBeB0Aj#Jn;v9t!CGPWg8^?>x3GlP7 zf3{&xoDVEs0ldh63x-)!emwL|82n7j%=7gIUmWwm>02=Pa+!Vo4a3|u+~*rG%;n;F z{>cX4BW9VuCBs}U-q$~F@SSBw{k?{{T-^CvG|c7VKSpr_oA(kcJ z8#VZ*GZX%mVHTb%rV;esg9jHLL8P6`lg*!88awDYer%30zHnDw{36S{Ckg+HfTW$Q zvD`LWZuyp*OSs{y`62xFBHM1ut)JzVEZicN+Y!sH&~kGNw>(8;d&hDcV!5RVx0>Vc zuj~3g9yNvTmiHDv+2gL&DLG?kZG7N|q+onj{j!C0%96SY>AWR%6VfM^)Llq7ElCrS zOBU&S&@?`C?PQi*$V*Ev^ve;_?Us})q!LTY6ViA~>M5iLEUA}}9=D|4LRxG|`9fN4 zNqvO$k|o_Pq+eK4Um+c`q<%s=Wl8;obl#E%2^rI<^F zdJPiN?UpoHNF|muL`dT;X{eAMu%ux^dfbwR3u&<>6$xpzB^3+lB}*z1(l0D&gpdwd zQmK$mS<)RsI&Vp3Li)s#%7t{(l5`=tY@#?L^(4Nl#_o3;DNT)5y zBc$YX;nhJ%6D+Bdkk(jImXJ_FG{KT82b#Ad>g6@>P?T`IkWO1tm5`D<3a?4Gq<&L6 z-otNg1l}*ac3EEE7t$3=suoh;P9j&0kY-rYV?x?xNi&6X#gb+Vsc&bIYrc?XSdw2z zyDVv`kgiw~6H?zyk!!h-W;B_*3Uhq+IsVH@EN_=3trgN0O9}|7?*}4qgOFxe(u+dc zWl66H>53&8Lh5^7oH*M)S&lJ*Lz?*)Z=lZ{1zu;%9cz@$6 Ms_xt~s=D^S0G7l}=>Px# literal 0 HcmV?d00001 diff --git a/app/src/main/res/drawable/up_arrow.png b/app/src/main/res/drawable/up_arrow.png new file mode 100644 index 0000000000000000000000000000000000000000..9220c24845132fe130e247b6a07bc7e9967f55b9 GIT binary patch literal 15325 zcmXY22|Sct+rRGFhcR|W21AjgY)@I!Akm_fO~x6 z+DpauT%em*&jd(||KZ0MnkHG5R}dln~TqtXP1v#YU^f5j3AAL$pt{YP=t! zajRnxDMiCa5;T~FX!NAqnEhx*>6Kv$^hu-UpZ4_>l#Fd;gR%}t)F#BykI@G}7VzEN}O2vT9j{`~+B+h2{?MDlrx z6^xT^()v@bBug`S8v(?{qW&4AZ9gjrz<1*M0*#)&e_wzF1FnubKx`Uj=mWjYsJY)H z^w*xR;(~{V~O{$8f$=!IdQu}NKJHwII}?N za(k*#3xLm-W&r!EPe@#lp$D?~+~m|l=&Z5GnFp!?S3HPHsvVC3bAw%ks|f1s$3ip` z5sBkd5U`+eZJan-g95vl(6~BI?5jZm?TF|&alQumwKBneoQv>1soIZ*T{x8|t*>2- zQN2deb%Vyx1-vG^#Q|)TI6bPplytr z8#HRdY9T1$ipP45nqLVMc!xzfUr9f^SzbWPa+9|QVL}uk+p+1OD5sk=Rj@pPmgXjh z=b&pzfgTt1(Aj^a_FD9t05a{b#zqlmjy2{W@}ovCz!?!{vXd+};aRvWI`2S4db)kQgbCYmbbb-No3`sI7+WmjlD>WC z#Q_-FU(I+$&_W)rh*<-!X6z-XnU5G;Bl33z{}wB(@>a6jwSg0$>A5J|b936?`mR!9Mc(0(&;fWi2+?w7vTY-x5Cbug35g& z?nF{=FAWO;qC?j+KM;Ta@<#)VM}H0k-QkY{7>;N*L8}ZE097bCh3Hio<^%i*auH5G zj2^lIoEd;k=EOm-jS&UUCaq^)AjrOsqHke;qEL%|!4ClSS)*ok8(LJ~W?6%5Ol~qA zLr~dj3CO$=eIY2Hg=iq6_XN#fZ3QxOL_Y}{$3moyD4w9ft1Ut4bHzjLiIpnjGISwy zXPmgH53W6-yH!lsa!|xACv`j7t`)#`z*Xugsm&>TPmp?|k+Wz-8pserXl|TXsY}#0 z$WaY5)JitA$u^CsW`C8ss!`(&0V(koj^31v3=XV4B;sxlK*0lsi9m;=#R_84)eoBv zh`8Zo`w6za43KQp40A|I*0Dq&L1(fMv?1Bh&Vb99yV4M}(NBLm&^)vuAWds<^K=~V zB2)yDCcSW=4`TSPB$E&M13`_uIFLF~UuPMEY!s^XA?WC8Bao4^G@r_1H`vIIoEl z(_~HA9?YX48^^nSD?xsM2#d6RJt9#Eu7cSU5akmz3KzF*?5lh=L4i0P=TT3dO^_e1 zMdwjZz6Mci2qyhJ>dA?R)=>?JP_H4Apul>7ov7EanIJzkBGhXjiB1YBM}&F}WM@wr zr9y;y&O|RMumoT}>Nyj=BtIo0lyoL~><6ZrgGj!MAlYlC zG#T|g$ky>Aq7yLbuuK0vmlREijS?3Dr!g3#uh))WX{! z6n6*c!8sxwWa14*I0flHL@no_5ZE{cWn!Wx+sBl8V3OD4(nGH(^aK|6P3?mTsZZR* zl;U0lrGEHOyu(ory!}R8`UlptWaC>M@WY5zgV9F9iE>JUn-4r9HpGQPfrVuv6_O^E zijtAe)Z^wu|A=@5DrdCVf}4-}spD)2--2r2aI|Gnh5vvfF1fH6?aM+;5aG@W#G7nb zp&K}kAZ8iRvL3Q`oG)2$^f@*8n z^lgG75VhVp$)@uOnnKWxVm3XFAo4uWTDO@^3lT|)&DPpXHhq<#If#<(q_F91f}9At z5yz%S5=0_Ps+-8BNolC<399vH(?tX&Au7M)%BIZ;awMqEhE3-YG?$>;25efJAhP+$ zH?Xy!KUNC;5YyS@bHfnE;RwMoG7O$3{XvXLf~jQmnjJ&HgQW8SNvDg69jw4z5$+K^ zw;KlVlIR^lo9%l7`QU_QL@z>rX}31B=>F(WYE01WOcrfL&=5pjMQ?c!LnMz9z1>%M z@E4~b9L0)OTNT>iBPB&|AP!8m_36(f%om8Ho2E|ZW5Tt2K=%!T01T7?O@n0#G4nfNaiu*vR*aW!{6#JSA-GlYlL?(i_ z>J!+9V8`VfGR5>qM=!XJYY05Yx>dT45z?D66qtu`m0ZtcD#d6-It`6DoO}-UxPU$T4zi zf+wXiB5h=Aof_{#sRRVgBPebFr6TUsmc(X_KSSn4P&7emSBA`ipgo9gChAkp8%V!N zJtv-A4cp1wRpSz=9$}&fwK(3;H5!qiP!|FSO2dP;I>|&AYDw?X@Nq*OTquM9f;@0- zR@<8h;RTWOAXa#VIuJ!rIkrg`nCQR@B3X`Y((#1?h$1M7B-6=60QmTX2oJ_m-9l|3 zOE>O%h~}7R!!07&O4`O0YC#A=BGNX{L<`OlNfBw&F66^G(zYGj)KMmU*hbp6W1HHd zkO$jHTR3h$^f5<07)M4~MK+(Xa7);QI}ykNF%!2>dVmL6snpjoOS@ucft;+@Gz;7E zPdY;vSqr5^FDTpuDsj;V2_C%Y@s3&$P0B-o$2GNgAq&P6?{U=>;6Lf4_> zOh+zMX%Nxd>&SsWWZEgoK{6&n3w$iG3ScM}V3WHxg-0QLA%d%BduTqBOnF%lM&ihz zHxToUxKGIz6oUE?sUtkJHtt}9%9`l(qJhSO*Sab*4Z;U6l~tCNtS>R1Mv!TMl?;!_ z09_cdN|$LRV-n`zpmtYaiAZpG;jZ-U@?7}3& zRa|;n-0G=J(l?nU+fzC;KrA795xgT!u4;;*X|g~YW3%0*8fT?giHf==4i5*hqSLE@GZnrqLq|_KixFCP?B3;4lzv#sl?}=sqJFc* z78b8?7;|$4?d5xG1-x@Bp-c|-qe_~SM#Xh9A0#j8WIE?q>!|GC@}w3sZ|Hl2GXE4F zT$2S!Gq>dl}0gC-nFJO=NV|})D3|*TbcjFn=K3CIH{$h1+>@H0WP0R@XwP$ zaKU*I#hDNd4^Bibjjh8!PxGmgn`*X5I*SUeJ9= zrzOljGS#PX5;i@X1gAuY@Z>2*F4Chh47nF!(AVq$o?a3hs!RB1#ww~qMl+@>!=YrxxwvXeCjJ@5X~=!emv8o`l!Z~+>|X->^V3Xi!RfE& z=d$R?R40Q^L-5b5IWW^~CvXSo!R!f=-ndKD1N@0+${1p$2b2URx9=Xt4b28q*WU|3zbesmeqt z!)Koejk(D4hw;!DuYK2RUVD~5F{U2UX^qCL)vp92X(v3Mp0Q`NoiL?l!E(@H6<`yHNYFSSUuSGh6u8aMB^R0@NBi&F<6H9$46R<|)f z9;v$C>8TD#IjH((={Dx}B~rb8K24>)K24RmXIrXt>b#{E`9IGzo`A)TC)DEvJ~Hk6 zRN71YdCti>)JN5vj3`m6bZP!#r2d<8Y9Ue!Gb}`lq_grDA@#xRQ#9I&R(b^p?QbLt zLvxya@+<_QITnJ+iE7H$^E&lWzGddgJk-m}I4W>git9Yk;n%sTt{9eU=%#AUmNz_Z zNv(c#)(g~oA($LrLe21~LcJA_ofA5t zIq?^UdYdbS-sUB03A5PqBxQ7e|1LJZM!nZkSEgWXO9{44 zxY+-KSSh?94xW)lC5!LFVvj>V6Az=m!_0Mp!IIp*eK1%5=w7f;8eOmmj!&Xo#CK3= zPxtkF3^$*L$itMlj1tGmG2qAffD>pO_Wk&QjC}nUfaLZiU6fB0>ZbxW;xcmU`pb*dnYhx zuLOoHkYlJa3UWqcvPgvvd{pSr4@INZuHs8*Y~`#`BhlDMdvPsr`j!34EmZGLu@a=(Y<|@r64Qw2;!0ak99g>-xl2p>e$lEUq_ECuIwr z*Ebtu2@V{%$pvF|p*IP{GG5R?41em>eskb~^&HqQ8Y*3qKLtnjSn1ez82&pL>6}ED ziH~59CXSLUN2%qwRJcmr^CzLy;eMO^(3T&)M<7ya2Vu46Pc*n@gC1?9PTATGyW)+| zqy4o61B}Z+$<1OXUDwybxVC5|7$Rk;91_4zy84xmeJmKAV1$&B(w50is=15Q{({^D zW2B6g#?jznTc?^@SA48Z(tR5f?Mn=(|vw|6# zwSu{8MiS(BimBOhkD6C4V!BU@xJkfddR(sNg=S^xM;9zX^GoRc0_~>0IW}lMuxo4^ zRpQr19-f`gWkH=+|aCA-KPZw zs98Y&D_}K!mA6w{UN>c}Y_UZLwoUG}AaA9NUN>a@X|Y4bu4$i`D^A0>+GXNyKE}m& zX364(-smsYd5@SKnk8m0cLUiZp%+q%oHzO)<-`8OloDh#j)KpcUZyAI!3~J2L z^`5KV#|g~}(0SB<3H3m-q}p;t!#)pgAJqJ(-g*^MtNhY^TSB+j3UDCJS~k_9{aWQv zE4lr3KUB;Tq+E-KA@%X0+jQNHTJ$gqYfg8IE1GvLxyB{045jigHP*LW?<$2kVQO`SR3TNB<>Px=@A7LL<63^#sM|>0&T{ls>D5#tmBmjBe2LV{ zEU|B?o_Zfr0sO8JZAi6c34BXb9$W*o-ml5NTNj5>_tEdoz=otzgE^ z^Hr+sxmYkln4l6m58f{ViKisH;Q%ZJ!%f% zYbSRBCX9+KFhnuK*g?Ju6_2ZnVwOtNrTS=1|IzDOp0>Od#Tuw(1?DJb9;@TK)_DgL zOP(uq&h5q8?&W>&)~gvIG^bbO_mP=I7)bUy@)vePO}~6Iq|9VPcOW&E|Glfdnw2j? zN+dHrX)E=8V(_lLI;&dj1l?jM_3VVP^a@wI_3s0?OwUO8<{3#(xwaF!6GB8cxI#{H zDYPssg<}Pt)VFK9obz?f1x>+J{rg~QV*MVJ8ZWBl>Ub^Og;Kj;o50J0rD&{DzDrkI+!Tz)g7My<6OH|iOz^}^viFnVQkO(E?6sw2uUyx;P@tn2pUrveQDpd$`o{kO3+wM; zzGkJqXR6PxUW$f%)YDyuprM_+mv%kbtcMY-#h3GQQSEGEnB|JIHs#C*l1gT2;B5|0 zz(jY;w6oSKq*Tn(Q7@5tnb_Yl^{k`>sS@0sP_y+KDA)Q|xDdVi zqz)K2E7Mb|gFh2bJivMG`smZN#a4lO3TDFQI-DGJM{d@JjLP&tArI-$3KXi?b=0SE zOJ5p=$Zs$CP1=;Rb0TX2-3Nb>EsJo?S#;<8O!u2NZWG?dX=~Tng`?4M=BGe>Lh{S+zni-~oPqg>?IT;@ zIt=r&C&4n>hJP2jS0{nx$zf9d$zex)$}j8h!F1k%6}HXHmV&RNTK3uIHsBB?ahl8` zaL7u>_tAB9Sv><2>ZWKlk{V@7;dIK{5!c=LIpKh*T1cfM7}dbW?kF`yCa_YPw ziv+f(k&2|kH%&uoTGm}3xu9<;Qd6n$9YshLWo`1AE3iI*)I`imCw8b)W~AHa1^+O1 zdlGCe_rpy1iK+uehWQV`d>PRr=Ihfd=Ibx}PT$?&tfd$)VoP=uvC!1&JwDSHS+7P@ z{#1#29z$_wp1+f&<4!|gOxIqR{AMJsgd_KHb&W&#yV3eMa7a0ZNj=uElbf5kIs{X1 z2U{y5&|yTP?K7Y) zDrO)xqx=T*@{F2(SXwAmF$<|#<+Zi7w*E+28^H6SU|c@0{CZaHteU=PN+15nn=yuF z`I?;UNvlWFEAXR$-do3+IEu9qmLj2{2?n2sw-7~K>|&0akE7V8A9m3IU+dtoR~G2WgkNP4fWbKR!_1QZ~h-wti!n0 zrPb9|Px6;wTzb&9(44~Z`kKqly2M+B$r+BXvNy04cQ#yhv(&26?}2apbZFQ!jgP~) zZm*ACZ%`u>%Zri@pKpgQ?W(>xx2N%zf-U|U_C7Iu%ABK|^2isxpSOv4*uAWk_Xmg1~6ND!Z6=%H3LtR0BwI zerZdJe$BCZ*{Z`!geNRFsBacB>)#2VWw}>)WC$chQVvu+kB2AE<9{s8(l)#dC;4$W zo1!?1TTxSs+|SulCTz&^bzw`0iRg->cXuJ}XmP`6bhc1Z>dHEoYg`OFv@ZfDU z8jn6!XCAp$$yS6kFzBA=^U(ObGih#ldMY#?4l3QB=F*`*r&+wLXRxrVna1#`&VsAB zWf7L;?y^gYdP)YJUhy9Nz5lk9nT0pvPgn!+iUMV#w%sZ+9ZfUp?eHr6QpFdP`I54< znZX~2GX0^c{}M}#DcWv9q$qE(@P9c>$X415dFMk>2@AQ2?RJC4NzfnO2!>T~sgo7l$M1C_w@Xk; zj{$8drYL1vcB|-=J;lRJvEcL@UsnA)-|5@j6a6xEr9-Q^kaTM|PjPE^x!r>6aV$&p zs0$5w%k?Ei%aez_RIK57Vel59bYIdJgKv(kG|SVIW3KS!w0&C;j%nTEw7w>iMo2K6 z3-sORn=txKbK333+BG1R1a!pn0;CGQFJ;;pB%q=z-mkQcM#bwDm0blqXEZMYnQ_|~ zq;4#&Y&YZ$M#>aqL)yk7buY5blkb2OUNbLl8;8{G6P1lw zJbR>!@SggYA?9nL*r@|D`PfGm1UC!WSXdUddCzx98Hx}I1rsZRFkeBxzB88eTZ@s7 z0D4i|L^O4;sB?Xh;&qs&z=iSJAvX-V4A$TdA`g$c&E9cc|KcQtv;f-r* zb3Rh}^J??b3Z#^RT>7TIKg6zod+6dF?X)aCq}Jj~-z)R96*uNB-)Q>9<~1eR)(&_D zWNs?iX8zO5={eh*9^z<4A-q_5Krl-$;`MpxspT~!a z)hwXnpI70Ws(PPxLTDg_6h0T=eR&3zQjxLoyT66R2wDuZ0LqfJnJp>WR?UGuQW4bK z3ILur+i~jO+Wony-I1*aiZMKZq}q7`46JvL>3jAKE6KLESUH8}W*Aua5T~1lg}&0k zW2``_d(IUD`?fH8iUz^9wXg^FVzk4Lu^ot#UhOo=*+ zHwAAJx%E@NCOZAli8u)r4ukQFpFi(Xk^7wL^!-+N85$mhU;4aUSj%iVx~O(r*GR`H z^z^NT4ghr(Z_!G{+vZFB8%C0_tuyeezajIN(bJ9R_p~lh8=%|RbqtX2eP$^M>zQZu z>&mn}P;qZtf4sD-_)4YNzUtZ(Q+|-I7`Sv60~$6?vyy~;JZ|+fa9SZ$Ox$KmhOisO zUiMCiQQ4wc@+by4?|Ft|Pd{6IzY>{`)(ZRLcTpbzQfwE4eoVbIU0;Qdd*IFN+-_g8h8Ch-|9qr)=+O2@l{V$P5GvL{ZrzcK62^n7E2 zBrhK%kFQ%)Z;si1kgJ&U_8=FegQF;E*^~>JZ>#KY2qlk?-Vg%aXAuXUO#M%%ushDt zgPwbA5Z->wzGnpq(~b-ef1`b(5l$XI-3U-Jej_O6ZMBT;F^%0vB}|)vvrA=~&XArp z?pb{#h7RN?=B%;B4}Z_&G&^-+&8$lmZ`q1Do!=Nh|GP*46^W^WNh{;WXiFa7Jjlkc zm|FWl%B_!mvi}|`G?tb{+`tKz-{1)?JMVf5e(MYxKu>oo#7`x59b69eL(VT3brwa8 zgNl((nECPmE~S{0z;$VHKe+``HcTIl_cytN8Is2(gNuJHh%=*F`kYyh_etE{ENPkk z?h%h)sSOzQL*n=pUVoqG)6*|rSU3Mt`CF#q*w1ei(3=(+LB+CEqo|d!W4MyAI|rHg z;b^M^r2P2ku=8(mp^mgH`UduGs`3=nKiq#RsYg4~6*U~q0Kzx4F(hICwG}^cO00mE z*%$H4G}#O<0X=EVm4Vd?Ef)_+bpK;Z5O?7sR{ z!fg7fP-p3?iCT)lwfN<9YKIL(upmBcMb)Pqu==`p3T59?--L_l z?SeDZ$EDtlzmM2Ug|QX@J@>alOV@*~UDuLnhOf?Y94nnC=F0qS%olrCGZOS}P(6hzy?t0Rvp4^s9_>eK zt5vv%oVnHu-_w8J$@}~2&LvQ%`Mcr>`E_!`bI||xv3OdiFXD0R5xU#MI1smS| zdjER(F^2Ol30mkqw2cz|x5TL#)4(D3!VpuT5AX28RnV^k3+PU{FG9gP@cwIE{Mce)fnG<$3TN^~!@q1f>+<*Aj@NJVaBQhEnBid+VCNcKv*{>hJIF z;n2RTosT0l@*GqC{LB2h@%c>h!6k~eOr<==dkWE`4|PipPz3| zKi<*|!^wBkQrr1r`aPl;-Uc!==UdR1(#_ZZ@t&-{y*dy}+v|m{>eSvB8!_8yu40^& z4k^Fzep}2vi-#ecqRC9E_uFIVj(;D6x4srG6;U5(dbiJibZ?7?>iEn6eOysY=iA7Z zTu+vb@t5G-e8y{hcAsjEIYv1c{=qp{b)QXbz4$ScC~OU@)kB4u^KE58PTal2U06r; zJ5lE4eJ=H|^1m!1vt~&a%Fr>-$En9f7dB^Ghpt(Q6I{N_T&wZQjTEtxu@CRPn|#h0 zg;pPq= zYss~{^XqXm4vH;SqL%pmBZh;QPh&6NTICgsvqnT^aiY+3RB;hrnsx?@7|XfsS- zm3iz`>%HL}?ftXVBf_|rNT;{1qa)fnMjT#+Gx3l&Qx`k!`+T;vcv{wty;_XE4%&8Ye3zliDzC)`sJKA#3|9OL=9wk3D zqB`eon%3$^P5Ak$DYlieS}#h)SW5%KSe0%^2ln|^-6HJ6?_GBvPv z<^G&~++OFDMogc|GD^SwVQX1Z>w-@7_1A3JCo~XVP{vCe`!P5BZ#Mcm>mIKW#jrlj zn;Q1dTlaL)GS%^j|5^QzD;w{2p?KD%ueA+XpKppa0gMl0E#L9NIOO*&t8B};@tq`A zNmd!JQ{^A_&u{HC(X!B&S{i-vd7F}XTg#HxIlYN(^@}*BNz2LBT;-vy=Zj}lDKONx zrT>ti>h}-KjGX#kZedTHWwzy(6HhfpG1A%LCk95gX)hBk(_3&Q7Uw@c?&v2>J2Noy zTOJ|jJk*dwk&LVu7}=@49Lbq)HKZ?+5f=wW_T&*V{)dLdq}D4Mj0gQ?`wE7IN7oQX zN*uq^K?euscG+N;90$%IDGALh<2~B)!1&6FeVC`h0!^GHL1C;pqyEb+u4=^KZv>l@ zj666nFmp)1)WGDJc1+U;gB;unVKL^e>_M6Rx4f02WzHcVHGVM6o12~+Us?GYO=gd= z)My_bn0eyfh2mDHKe4UV&L1?H8`hdDTdx&0q1PSDRC(cl=}gDW{p%1lVci0fPWLI< z#Lx1(#(q|qPS;oU==`074yn>kOy}97ivtfg%6M%@o*HlMJ%ov$K6SCC8r-Awr%$RF=JIs!jQV-AQ{`3QV+-C9XVKI!^fKjf|aYSX(hBPftV(mDOGQ?X6@U90G|P68hX z7mb)NinZod;b~3QG$F%}bn$a*UWqiO!`-RgkYjmG;DuDu_?Qu{>38wyXDaY9Fe8C9 zY^+*4qNn(ArSk$&T0f03?z-MZLM$D(jX6gYauiM&-Gc)Q&YkY1WA9HzhMhI8 zZSLBhbWM}*6+JeQ_e{^cy)yTvdOurZ>|=xJ-OQ?zVNOY0j^z>&Nl_@K$h#vjJ#B)w zOM7{ZM)Q0};Pib?AM3QAZOW)K(+tal!%lAm=@Vk2pWhbvocq~8@qxA+Ns_Gl6=i|Mi1bJui3^BT)~b@M=tScB=;tyM{mPMtE2rLKnQ z@{hS35cAI((-jQnf(06v?FCgy3wnz2l}v#sZMh~vbXZ5=@_VMYn%C^DS3k?sRKkj4 zr>A*UNrRpKBye6@Y7*3BpMDp!fp39KWK9nf$>71v4|%iin;x$&Qt_Do+G%{2kB*s) zJ}h3YT_Z|6qsfLks;4-zBXG{wM8~V@W7Q-Z5P8@1q0%XGqkDoMCwizxGbtoyOGwOV ze2Y~qs2r<_wjr;|9*sr4+`h&vEkYB9(mj2GN&4NVm7aNS?XLf`Z{Jfa=qbiGj0{oQ z9L*%4@1no^rZd{@);PC6(o`BAlJXuMaJv3_gH~MA@hh4r5;6F|m@QX|jIXMT?kGrL zQ}?^=96xhQow-T9s;KUN)IqnMK{K~pD>AvRGXH<6!)|?0>V~=LO_lloq$akmzk1hf z#`kw?+&=ZVwV)~bAFus?7LDw#%wUUBe~VI(k~-|3Fx+c@pUQQCqSVi38p><;gymlQ zy(%}YLF#`}#$NkV7mXxuHC;Zn{m<6yMI(QHSpV^Bwn;)`)J*(8%m7UJu)gfR*~6BQ zK{wUj{|n;iebe3hosQlrnzk$B=MHN!sXvXJ*|FnxiSL4Tj^M&$fhSV3Ft7cO7mZxr zZnxmF`d2MY`rQ>cvm@trlGDpiI-h;pHDdIaj=-K`3w$knrdh3t0-wvwP8creeU~aq z`gMIy=C;k*dngi- zbN21E4nAV>$u|vd&k@7BduE$%X4TlbarRc@lO3pr?$#gW + + + + + + + + diff --git a/app/src/main/res/layout/item_upload_card_view.xml b/app/src/main/res/layout/item_upload_card_view.xml index d9859049..9c7d2b06 100644 --- a/app/src/main/res/layout/item_upload_card_view.xml +++ b/app/src/main/res/layout/item_upload_card_view.xml @@ -11,16 +11,14 @@ android:id="@+id/cardView" android:layout_width="match_parent" android:layout_height="wrap_content" - android:layout_marginStart="8dp" - android:layout_marginTop="15dp" - android:layout_marginEnd="8dp" - android:layout_marginBottom="5dp" - app:cardBackgroundColor="@color/md_theme_tertiaryContainer" + android:layout_margin="8dp" app:cardCornerRadius="16dp" - app:strokeColor="@color/md_theme_outlineVariant" - app:layout_constraintTop_toTopOf="parent" - app:layout_constraintStart_toStartOf="parent" - app:layout_constraintEnd_toEndOf="parent"> + app:cardBackgroundColor="@color/md_theme_tertiaryContainer"> + + + + + + + + + + + + app:layout_constraintVertical_bias="0.571" /> - - + app:layout_constraintHorizontal_bias="0.0" + app:layout_constraintStart_toEndOf="@id/trajectoryIdItem" + app:layout_constraintTop_toBottomOf="@id/trajectoryDateItem" + app:layout_constraintVertical_bias="0.0" /> - + app:layout_constraintVertical_bias="0.0" /> + + - + + + app:layout_constraintVertical_bias="1.0" /> + + + + + - + \ No newline at end of file diff --git a/build.gradle b/build.gradle index bce5298f..34d23873 100644 --- a/build.gradle +++ b/build.gradle @@ -2,6 +2,7 @@ buildscript { ext { agp_version = '8.7.0' + agp_version1 = '8.7.1' } repositories { google() @@ -9,7 +10,7 @@ buildscript { } dependencies { // NOTE: Only classpath deps (plugins) go here - classpath 'com.android.tools.build:gradle:8.8.0' + classpath "com.android.tools.build:gradle:$agp_version1" classpath 'com.google.gms:google-services:4.4.2' def nav_version = "2.5.3" classpath "androidx.navigation:navigation-safe-args-gradle-plugin:$nav_version" From 8d13c06c26ae5a3da668c1f811865f7c85252027 Mon Sep 17 00:00:00 2001 From: sydneysavarese Date: Wed, 11 Feb 2026 18:40:50 +0000 Subject: [PATCH 14/82] indoor map and floor plan capabilities --- .../PositionMe/data/remote/FloorPlanData.java | 143 ++++++ .../data/remote/ServerCommunications.java | 4 +- .../activity/RecordingActivity.java | 29 +- .../presentation/fragment/HomeFragment.java | 9 + .../fragment/RecordingFragment.java | 76 ++- .../fragment/TrajectoryMapFragment.java | 233 ++++++--- .../PositionMe/sensors/SensorFusion.java | 143 +++--- .../PositionMe/sensors/WifiDataProcessor.java | 112 ++++- .../PositionMe/utils/BuildingPolygon.java | 2 +- .../PositionMe/utils/IndoorMapManager.java | 453 +++++++++++++----- .../PositionMe/utils/VenueMapper.java | 102 ++++ .../main/res/layout/fragment_recording.xml | 43 +- .../res/layout/fragment_trajectory_map.xml | 45 +- 13 files changed, 1038 insertions(+), 356 deletions(-) create mode 100644 app/src/main/java/com/openpositioning/PositionMe/data/remote/FloorPlanData.java create mode 100644 app/src/main/java/com/openpositioning/PositionMe/utils/VenueMapper.java diff --git a/app/src/main/java/com/openpositioning/PositionMe/data/remote/FloorPlanData.java b/app/src/main/java/com/openpositioning/PositionMe/data/remote/FloorPlanData.java new file mode 100644 index 00000000..877e0625 --- /dev/null +++ b/app/src/main/java/com/openpositioning/PositionMe/data/remote/FloorPlanData.java @@ -0,0 +1,143 @@ +//call from TrajectoryMapFragment when we have LatLng currentLocation and List observedMacs +package com.openpositioning.PositionMe.data.remote; +import com.openpositioning.PositionMe.BuildConfig; +import com.openpositioning.PositionMe.utils.IndoorMapManager; + +import android.util.Log; + +import androidx.annotation.NonNull; + +import org.json.JSONArray; +import org.json.JSONException; +import org.json.JSONObject; + +import java.io.IOException; +import java.util.ArrayList; +import java.util.List; + +import okhttp3.Call; +import okhttp3.Callback; +import okhttp3.MediaType; +import okhttp3.OkHttpClient; +import okhttp3.Request; +import okhttp3.RequestBody; +import okhttp3.Response; + +/** + * Calls OpenPositioning floorplan API to fetch nearby indoor venues. + * Networking + JSON parsing only. No map/UI code here. + */ +public class FloorPlanData{ + + // Static constants necessary for communications + private static final String API_KEY_PATH = BuildConfig.OPENPOSITIONING_API_KEY; + private static final String MASTER_KEY = BuildConfig.OPENPOSITIONING_MASTER_KEY; + private static final String BASE_URL = "https://openpositioning.org/api/live/floorplan/request/"; + + + + + private static final MediaType JSON = MediaType.get("application/json; charset=utf-8"); + + private final OkHttpClient client; + + public FloorPlanData(OkHttpClient client) { + this.client = client; + } + + /** DTO matching the API response fields */ + public static class VenueDto { + public final String name; + public final String outline; // raw string from API + public final String mapShapes; // raw string from API + + public VenueDto(String name, String outline, String mapShapes) { + this.name = name; + this.outline = outline; + this.mapShapes = mapShapes; + } + } + + public interface VenueCallback { + void onSuccess(List venues); + void onError(Exception e); + } + + public void requestNearbyVenues( + double lat, + double lon, + @NonNull List macs, + @NonNull VenueCallback callback + ) { + String url = BASE_URL + API_KEY_PATH + "?key=" + MASTER_KEY; + + JSONObject body = new JSONObject(); + try { + body.put("lat", lat); + body.put("lon", lon); + + JSONArray macArr = new JSONArray(); + for (String m : macs) macArr.put(m); + body.put("macs", macArr); + + } catch (JSONException e) { + callback.onError(e); + return; + } + + Request req = new Request.Builder() + .url(url) + .post(RequestBody.create(body.toString(), JSON)) + .build(); + + client.newCall(req).enqueue(new Callback() { + + @Override + public void onFailure(@NonNull Call call, @NonNull IOException e) { + Log.e("FloorplanAPI", "Request failed", e); + callback.onError(e); + } + + @Override + public void onResponse(@NonNull Call call, @NonNull Response response) throws IOException { + + Log.d("FloorplanAPI", "HTTP response code=" + response.code()); + + if (!response.isSuccessful()) { + Log.e("FloorplanAPI", "Unsuccessful response"); + callback.onError(new IOException("HTTP " + response.code())); + return; + } + + String respBody = response.body() != null ? response.body().string() : "[]"; + Log.d("FloorplanAPI", "Raw response=" + respBody); + + try { + JSONArray arr = new JSONArray(respBody); + List venues = new ArrayList<>(); + + for (int i = 0; i < arr.length(); i++) { + JSONObject v = arr.getJSONObject(i); + String name = v.optString("name", ""); + String outline = v.optString("outline", ""); + String mapShapes = v.optString("map_shapes", ""); + venues.add(new VenueDto(name, outline, mapShapes)); + } + + Log.d("FloorplanAPI", "Parsed venues=" + venues.size()); + for (VenueDto v: venues) { + Log.d("IndoorDebug", "MapShapes raw=" + v.mapShapes); + } + + callback.onSuccess(venues); + + } catch (JSONException e) { + Log.e("FloorplanAPI", "Bad JSON: " + respBody); + callback.onError(e); + } + } + }); + + } +} + diff --git a/app/src/main/java/com/openpositioning/PositionMe/data/remote/ServerCommunications.java b/app/src/main/java/com/openpositioning/PositionMe/data/remote/ServerCommunications.java index 89b690b2..7f7e74b2 100644 --- a/app/src/main/java/com/openpositioning/PositionMe/data/remote/ServerCommunications.java +++ b/app/src/main/java/com/openpositioning/PositionMe/data/remote/ServerCommunications.java @@ -623,11 +623,11 @@ private void checkNetworkStatus() { private void logDataSize(Traj.Trajectory trajectory) { Log.i("ServerCommunications", "IMU Data size: " + trajectory.getImuDataCount()); - Log.i("ServerCommunications", "Position Data size: " + trajectory.getMagnetometerDataCount()); + Log.i("ServerCommunications", "Position Data size: " + trajectory.getPositionDataCount()); Log.i("ServerCommunications", "Pressure Data size: " + trajectory.getPressureDataCount()); Log.i("ServerCommunications", "Light Data size: " + trajectory.getLightDataCount()); Log.i("ServerCommunications", "GNSS Data size: " + trajectory.getGnssDataCount()); - Log.i("ServerCommunications", "WiFi Data size: " + trajectory.getWifiFingerprintsCount()); + Log.i("ServerCommunications", "WiFi Data size: " + trajectory.getWifiDataCount()); Log.i("ServerCommunications", "APS Data size: " + trajectory.getApsDataCount()); Log.i("ServerCommunications", "PDR Data size: " + trajectory.getPdrDataCount()); } diff --git a/app/src/main/java/com/openpositioning/PositionMe/presentation/activity/RecordingActivity.java b/app/src/main/java/com/openpositioning/PositionMe/presentation/activity/RecordingActivity.java index c0d82ae2..b84b2a97 100644 --- a/app/src/main/java/com/openpositioning/PositionMe/presentation/activity/RecordingActivity.java +++ b/app/src/main/java/com/openpositioning/PositionMe/presentation/activity/RecordingActivity.java @@ -11,6 +11,7 @@ import com.openpositioning.PositionMe.presentation.fragment.StartLocationFragment; import com.openpositioning.PositionMe.presentation.fragment.RecordingFragment; import com.openpositioning.PositionMe.presentation.fragment.CorrectionFragment; +import com.openpositioning.PositionMe.presentation.fragment.TrajectoryMapFragment; /** @@ -38,7 +39,25 @@ * @author ShuGu */ -public class RecordingActivity extends AppCompatActivity { +public class RecordingActivity extends AppCompatActivity + implements TrajectoryMapFragment.VenueSelectionListener { + private String selectedVenueIdOrName = null; + private String selectedFloorId = null; + + + @Override + public void onVenueSelected(String venueIdOrName){ + selectedVenueIdOrName = venueIdOrName; + } + + @Override + public void onVenueCleared() { + selectedVenueIdOrName = null; + } + + public String getSelectedVenueIdOrName() { + return selectedVenueIdOrName; + } @Override protected void onCreate(@Nullable Bundle savedInstanceState) { @@ -89,4 +108,12 @@ public void finishFlow() { getWindow().clearFlags(WindowManager.LayoutParams.FLAG_KEEP_SCREEN_ON); finish(); } + + public void onFloorChanged(String floorId) { + selectedFloorId = floorId; + } + + public String getSelectedFloorId() { + return selectedFloorId; + } } diff --git a/app/src/main/java/com/openpositioning/PositionMe/presentation/fragment/HomeFragment.java b/app/src/main/java/com/openpositioning/PositionMe/presentation/fragment/HomeFragment.java index 8371b04e..c8be036b 100644 --- a/app/src/main/java/com/openpositioning/PositionMe/presentation/fragment/HomeFragment.java +++ b/app/src/main/java/com/openpositioning/PositionMe/presentation/fragment/HomeFragment.java @@ -116,6 +116,15 @@ public void onViewCreated(@NonNull View view, @Nullable Bundle savedInstanceStat Navigation.findNavController(v).navigate(action); }); + Button indoorButton = view.findViewById(R.id.indoorButton); + indoorButton.setOnClickListener(v -> { + Intent intent = new Intent(requireContext(), RecordingActivity.class); + startActivity(intent); + ((AppCompatActivity) getActivity()).getSupportActionBar().hide(); + }); + + + // TextView to display GNSS disabled message gnssStatusTextView = view.findViewById(R.id.gnssStatusTextView); diff --git a/app/src/main/java/com/openpositioning/PositionMe/presentation/fragment/RecordingFragment.java b/app/src/main/java/com/openpositioning/PositionMe/presentation/fragment/RecordingFragment.java index 320e5753..181348c2 100644 --- a/app/src/main/java/com/openpositioning/PositionMe/presentation/fragment/RecordingFragment.java +++ b/app/src/main/java/com/openpositioning/PositionMe/presentation/fragment/RecordingFragment.java @@ -3,11 +3,11 @@ import android.app.AlertDialog; import android.content.Context; import android.content.SharedPreferences; -import android.graphics.Bitmap; import android.graphics.Color; import android.os.Bundle; import android.os.CountDownTimer; import android.os.Handler; +import android.util.Log; import android.view.LayoutInflater; import android.view.View; import android.view.ViewGroup; @@ -19,10 +19,6 @@ import android.widget.ImageView; import android.widget.ProgressBar; import android.widget.TextView; -import android.widget.Toast; - -import com.google.android.gms.maps.model.BitmapDescriptorFactory; -import com.google.android.gms.maps.model.MarkerOptions; import com.google.android.material.button.MaterialButton; import androidx.annotation.NonNull; @@ -36,6 +32,8 @@ import com.openpositioning.PositionMe.sensors.SensorTypes; import com.openpositioning.PositionMe.utils.UtilFunctions; import com.google.android.gms.maps.model.LatLng; +import java.util.ArrayList; +import java.util.List; /** @@ -63,8 +61,19 @@ public class RecordingFragment extends Fragment { + private List observedMacs = new ArrayList<>(); + private TextView selectedVenueText; + + public void updateObservedMacs(@NonNull List macs) { + observedMacs = new ArrayList<>(macs); + } + + private List getObservedMacsOrEmpty() { + return observedMacs == null ? new ArrayList<>() : new ArrayList<>(observedMacs); + } + // UI elements - private MaterialButton completeButton, cancelButton, markTestPointButton; + private MaterialButton completeButton, cancelButton; private ImageView recIcon; private ProgressBar timeRemaining; private TextView elevation, distanceTravelled, gnssError; @@ -81,8 +90,6 @@ public class RecordingFragment extends Fragment { private float distance = 0f; private float previousPosX = 0f; private float previousPosY = 0f; - private int testPointCounter = 0; - // References to the child map fragment private TrajectoryMapFragment trajectoryMapFragment; @@ -123,6 +130,10 @@ public void onViewCreated(@NonNull View view, @Nullable Bundle savedInstanceState) { super.onViewCreated(view, savedInstanceState); + selectedVenueText = view.findViewById(R.id.selectedVenueText); + selectedVenueText.setText("Venue: none"); + + // Child Fragment: the container in fragment_recording.xml // where TrajectoryMapFragment is placed trajectoryMapFragment = (TrajectoryMapFragment) @@ -144,7 +155,6 @@ public void onViewCreated(@NonNull View view, completeButton = view.findViewById(R.id.stopButton); cancelButton = view.findViewById(R.id.cancelButton); - markTestPointButton= view.findViewById(R.id.markPointButton); recIcon = view.findViewById(R.id.redDot); timeRemaining = view.findViewById(R.id.timeRemainingBar); @@ -162,37 +172,6 @@ public void onViewCreated(@NonNull View view, ((RecordingActivity) requireActivity()).showCorrectionScreen(); }); - markTestPointButton.setOnClickListener(v -> { - long timestampMillis = System.currentTimeMillis(); - - SensorFusion.getInstance().addTestPoint(timestampMillis); - - float[] gnss = SensorFusion.getInstance().getGNSSLatitude(false); - if (gnss != null) { - double lat = gnss[0]; - double lon = gnss[1]; - - SensorFusion.getInstance().addTestPoint(timestampMillis, lat, lon); - - testPointCounter++; - - if (trajectoryMapFragment != null) { - trajectoryMapFragment.addTestPointMarker( - new LatLng(lat, lon), - testPointCounter - ); - } - - Toast.makeText(requireContext(), - "Test point " + testPointCounter + " marked", - Toast.LENGTH_SHORT).show(); - } else { - Toast.makeText(requireContext(), - "GNSS not available yet", - Toast.LENGTH_SHORT).show(); - } - }); - // Cancel button with confirmation dialog cancelButton.setOnClickListener(v -> { @@ -279,8 +258,17 @@ private void updateUIandPosition() { ); // Pass the location + orientation to the map - if (trajectoryMapFragment != null) { - trajectoryMapFragment.updateUserLocation(newLocation, + TrajectoryMapFragment mapFrag = (TrajectoryMapFragment) + getChildFragmentManager().findFragmentById(R.id.trajectoryMapFragmentContainer); + + if (mapFrag != null) { + + List macs = sensorFusion.getLatestBssids(); + Log.d("RecordingFragment", "passing macs size=" + macs.size()); + mapFrag.updateObservedMacs(macs); + +// trajectoryMapFragment.updateObservedMacs(sensorFusion.getLatestBssids()); + mapFrag.updateUserLocation(newLocation, (float) Math.toDegrees(sensorFusion.passOrientation())); } } @@ -303,6 +291,10 @@ private void updateUIandPosition() { trajectoryMapFragment.clearGNSS(); } } + RecordingActivity act = (RecordingActivity) requireActivity(); + String v = act.getSelectedVenueIdOrName(); + selectedVenueText.setText("Venue: " + (v == null ? "none" : v)); + // Update previous previousPosX = pdrValues[0]; diff --git a/app/src/main/java/com/openpositioning/PositionMe/presentation/fragment/TrajectoryMapFragment.java b/app/src/main/java/com/openpositioning/PositionMe/presentation/fragment/TrajectoryMapFragment.java index 11dac91f..026d113c 100644 --- a/app/src/main/java/com/openpositioning/PositionMe/presentation/fragment/TrajectoryMapFragment.java +++ b/app/src/main/java/com/openpositioning/PositionMe/presentation/fragment/TrajectoryMapFragment.java @@ -10,6 +10,8 @@ import android.widget.ArrayAdapter; import android.widget.Button; import android.widget.Spinner; +import android.widget.TextView; + import com.google.android.material.switchmaterial.SwitchMaterial; import androidx.annotation.NonNull; @@ -28,16 +30,10 @@ import java.util.ArrayList; import java.util.List; +import com.openpositioning.PositionMe.data.remote.FloorPlanData; +import com.openpositioning.PositionMe.utils.VenueMapper; -import android.graphics.Bitmap; -import android.graphics.Canvas; -import android.graphics.Color; -import android.graphics.Paint; -import android.graphics.Rect; -import android.graphics.Typeface; - -import com.google.android.gms.maps.model.BitmapDescriptorFactory; -import com.google.android.gms.maps.model.MarkerOptions; +import okhttp3.OkHttpClient; @@ -62,8 +58,13 @@ * @author Mate Stodulka */ +//request nearby indoor maps + //draw venue polygons + //handle venue click + public class TrajectoryMapFragment extends Fragment { + private static final boolean USE_MOCK_FLOORPLAN = true; private GoogleMap gMap; // Google Maps instance private LatLng currentLocation; // Stores the user's current location private Marker orientationMarker; // Marker representing user's heading @@ -80,6 +81,9 @@ public class TrajectoryMapFragment extends Fragment { private IndoorMapManager indoorMapManager; // Manages indoor mapping private SensorFusion sensorFusion; + private TextView floorLabel; + + // UI @@ -92,6 +96,19 @@ public class TrajectoryMapFragment extends Fragment { private Button switchColorButton; private Polygon buildingPolygon; + private List selectedVenue; +// private IndoorMapManager.IndoorFloor selectedFloor; + private FloorPlanData floorplanRemote; + private long lastVenueQueryMs = 0; + private LatLng lastVenueQueryLoc = null; + + private final Object macLock = new Object(); + private List observedMacs = new ArrayList<>(); + + // cache venues if they arrive before map/manager is ready (optional) + private List lastFetchedVenues = null; + + public TrajectoryMapFragment() { // Required empty public constructor @@ -116,11 +133,16 @@ public void onViewCreated(@NonNull View view, gnssSwitch = view.findViewById(R.id.gnssSwitch); autoFloorSwitch = view.findViewById(R.id.autoFloor); floorUpButton = view.findViewById(R.id.floorUpButton); + floorUpButton.setOnClickListener(v -> indoorMapManager.increaseFloor()); floorDownButton = view.findViewById(R.id.floorDownButton); + floorDownButton.setOnClickListener(v -> indoorMapManager.decreaseFloor()); switchColorButton = view.findViewById(R.id.lineColorButton); + floorLabel = view.findViewById(R.id.floorLabel); + floorLabel.setText("Floor: -"); + // Setup floor up/down UI hidden initially until we know there's an indoor map - setFloorControlsVisibility(View.GONE); +// setFloorControlsVisibility(View.GONE); // Initialize the map asynchronously SupportMapFragment mapFragment = (SupportMapFragment) @@ -133,6 +155,8 @@ public void onMapReady(@NonNull GoogleMap googleMap) { gMap = googleMap; // Initialize map settings with the now non-null gMap initMapSettings(gMap); + floorplanRemote = new FloorPlanData(new OkHttpClient()); + // If we had a pending camera move, apply it now if (hasPendingCameraMove && pendingCameraPosition != null) { @@ -141,7 +165,37 @@ public void onMapReady(@NonNull GoogleMap googleMap) { pendingCameraPosition = null; } - drawBuildingPolygon(); +// drawBuildingPolygon(); + indoorMapManager = new IndoorMapManager(gMap); + // 1) Handle user clicking a venue outline polygon + gMap.setOnPolygonClickListener(polygon -> { + IndoorMapManager.IndoorVenue v = indoorMapManager.getVenueForPolygon(polygon); + + if (v != null) { + Log.d("IndoorDebug", "Clicked venue=" + v.name); + + Log.d("IndoorDebug", "mapShapes length=" + + (v.rawMapShapes == null ? "null" : v.rawMapShapes.length())); + + Log.d("IndoorDebug", "mapShapes preview=" + + (v.rawMapShapes == null ? "null" : + v.rawMapShapes.substring(0, + Math.min(400, v.rawMapShapes.length())))); + + indoorMapManager.selectVenue(v); + + if(getActivity() instanceof VenueSelectionListener) { + ((VenueSelectionListener) getActivity()).onVenueSelected( + v.venueId != null ? v.venueId : v.name + ); + } + setFloorControlsVisibility(View.VISIBLE); + + String fk = indoorMapManager.getCurrentFloorKey(); + if (floorLabel != null) floorLabel.setText("Floor: " + (fk == null ? "-" : fk)); + + } + }); Log.d("TrajectoryMapFragment", "onMapReady: Map is ready!"); @@ -191,14 +245,22 @@ public void onMapReady(@NonNull GoogleMap googleMap) { autoFloorSwitch.setChecked(false); if (indoorMapManager != null) { indoorMapManager.increaseFloor(); + String fk = indoorMapManager.getCurrentFloorKey(); + if (floorLabel != null) floorLabel.setText("Floor: " + (fk == null ? "-" : fk)); + } + }); floorDownButton.setOnClickListener(v -> { autoFloorSwitch.setChecked(false); if (indoorMapManager != null) { indoorMapManager.decreaseFloor(); + String fk = indoorMapManager.getCurrentFloorKey(); + if (floorLabel != null) floorLabel.setText("Floor: " + (fk == null ? "-" : fk)); + } + }); } @@ -213,52 +275,6 @@ public void onMapReady(@NonNull GoogleMap googleMap) { * @param map */ - private Bitmap createNumberedMarkerBitmap(int number) { - int size = 100; // marker size in pixels - - Bitmap bitmap = Bitmap.createBitmap(size, size, Bitmap.Config.ARGB_8888); - Canvas canvas = new Canvas(bitmap); - - Paint circlePaint = new Paint(); - circlePaint.setColor(Color.RED); - circlePaint.setAntiAlias(true); - - Paint textPaint = new Paint(); - textPaint.setColor(Color.WHITE); - textPaint.setTextSize(40f); - textPaint.setTypeface(Typeface.DEFAULT_BOLD); - textPaint.setAntiAlias(true); - textPaint.setTextAlign(Paint.Align.CENTER); - - // Draw circle - canvas.drawCircle(size / 2f, size / 2f, size / 2f, circlePaint); - - // Draw number in center - Rect bounds = new Rect(); - String text = String.valueOf(number); - textPaint.getTextBounds(text, 0, text.length(), bounds); - - float x = size / 2f; - float y = size / 2f - bounds.centerY(); - - canvas.drawText(text, x, y, textPaint); - - return bitmap; - } - - public void addTestPointMarker(LatLng latLng, int number) { - Bitmap numberedMarker = createNumberedMarkerBitmap(number); - - MarkerOptions markerOptions = new MarkerOptions() - .position(latLng) - .icon(BitmapDescriptorFactory.fromBitmap(numberedMarker)) - .anchor(0.5f, 0.5f) // center anchor - .title("Test Point " + number); - - gMap.addMarker(markerOptions); - } - - private void initMapSettings(GoogleMap map) { // Basic map settings map.getUiSettings().setCompassEnabled(true); @@ -285,6 +301,78 @@ private void initMapSettings(GoogleMap map) { ); } + private void maybeRequestNearbyVenues(@NonNull LatLng loc) { + if (indoorMapManager != null && indoorMapManager.getIsIndoorMapSet()) return; + + long now = System.currentTimeMillis(); + if (now - lastVenueQueryMs < 15000) return; // 15s throttle + + if (lastVenueQueryLoc != null && distanceMeters(loc, lastVenueQueryLoc) < 25) return; // 25m threshold + + lastVenueQueryMs = now; + lastVenueQueryLoc = loc; + + + List macs = getObservedMacsOrEmpty(); + Log.d("TrajectoryMapFragment", "maybeRequestNearbyVenues instance=" + System.identityHashCode(this) + + " observedMacs=" + macs.size()); + + if (macs.isEmpty()) { + Log.d("TrajectoryMapFragment", "Skipping floorplan request: no MACs yet"); + return; + } + + Log.d("TrajectoryMapFragment", "Floorplan request @ " + + loc.latitude + "," + loc.longitude + " macs=" + macs.size()); + if (floorplanRemote == null) { + Log.w("TrajectoryMapFragment", "floorplanRemote not initialized"); + return; + } + + floorplanRemote.requestNearbyVenues( + loc.latitude, loc.longitude, macs, + new FloorPlanData.VenueCallback() { + @Override public void onSuccess(List dtos) { + requireActivity().runOnUiThread(() -> { + Log.d("TrajectoryMapFragment", "Floorplan response venues=" + dtos.size()); + + List venues = VenueMapper.toIndoorVenues(dtos); + Log.d("TrajectoryMapFragment", "Mapped venues=" + venues.size()); + + if (indoorMapManager != null) { + indoorMapManager.showVenueOutlines(venues); + } + }); + } + +// requireActivity().runOnUiThread(() -> { +// Log.d("TrajectoryMapFragment", "Floorplan response venues=" + dtos.size()); +// // temporarily: if empty, clear outlines or do nothing +// List venues = VenueMapper.toIndoorVenues(dtos); +// if (dtos.isEmpty()) return; // nothing to draw yet +// +//// TEMP: just log first venue strings +// FloorPlanData.VenueDto v0 = dtos.get(0); +// Log.d("TrajectoryMapFragment", "First venue name=" + v0.name); +// Log.d("TrajectoryMapFragment", "Outline raw=" + v0.outline); +// Log.d("TrajectoryMapFragment", "Map_shapes raw=" + v0.mapShapes); +// +// lastFetchedVenues = venues; +// +// if (indoorMapManager != null) { +// indoorMapManager.showVenueOutlines(venues); +// } +// }); +// } + + @Override public void onError(Exception e) { + Log.d("TrajectoryMapFragment", "floorplan request failed", e); + } + } + ); + } + + /** * Initialize the map type spinner with the available map types. @@ -377,11 +465,17 @@ public void updateUserLocation(@NonNull LatLng newLocation, float orientation) { polyline.setPoints(points); } + // Update indoor map overlay if (indoorMapManager != null) { indoorMapManager.setCurrentLocation(newLocation); setFloorControlsVisibility(indoorMapManager.getIsIndoorMapSet() ? View.VISIBLE : View.GONE); } + + // call api + if (floorplanRemote != null) { + maybeRequestNearbyVenues(newLocation); + } } @@ -593,6 +687,31 @@ private void drawBuildingPolygon() { gMap.addPolygon(buildingPolygonOptions4); Log.d("TrajectoryMapFragment", "Building polygon added, vertex count: " + buildingPolygon.getPoints().size()); } + public interface VenueSelectionListener { + void onVenueSelected(String venueIdOrName); + void onVenueCleared(); + } + + private static float distanceMeters(LatLng a, LatLng b) { + float[] out = new float[1]; + android.location.Location.distanceBetween( + a.latitude, a.longitude, b.latitude, b.longitude, out + ); + return out[0]; + } + private List getObservedMacsOrEmpty() { + return observedMacs == null ? new ArrayList<>() : new ArrayList<>(observedMacs); + } + + + public void updateObservedMacs(@NonNull List macs) { + Log.d("TrajectoryMapFragment", "Observed macs updated size=" + macs.size()+ " instance=" + System.identityHashCode(this)); + synchronized (macLock) { + observedMacs = new ArrayList<>(macs); + } + } + + } diff --git a/app/src/main/java/com/openpositioning/PositionMe/sensors/SensorFusion.java b/app/src/main/java/com/openpositioning/PositionMe/sensors/SensorFusion.java index 6590e7ec..4f9c0b60 100644 --- a/app/src/main/java/com/openpositioning/PositionMe/sensors/SensorFusion.java +++ b/app/src/main/java/com/openpositioning/PositionMe/sensors/SensorFusion.java @@ -36,10 +36,6 @@ import java.util.stream.Collectors; import java.util.stream.Stream; -import java.util.ArrayList; -import java.util.List; -import com.openpositioning.PositionMe.sensors.model.TestPoint; - /** * The SensorFusion class is the main data gathering and processing class of the application. @@ -106,6 +102,8 @@ public class SensorFusion implements SensorEventListener, Observer { private MovementSensor linearAccelerationSensor; // Other data recording private WifiDataProcessor wifiProcessor; + private volatile List latestBssids = new ArrayList<>(); + private GNSSDataProcessor gnssProcessor; // Data listener private final LocationListener locationListener; @@ -163,8 +161,6 @@ public class SensorFusion implements SensorEventListener, Observer { // WiFi positioning object private WiFiPositioning wiFiPositioning; - private final List testPoints = new ArrayList<>(); - //region Initialisation /** * Private constructor for implementing singleton design pattern for SensorFusion. @@ -223,37 +219,6 @@ public static SensorFusion getInstance() { * @see GNSSDataProcessor for location data processing. * @see WifiDataProcessor for network data processing. */ - - public void addTestPoint(long timestampMillis, double lat, double lon) { - testPoints.add(new TestPoint(timestampMillis, lat, lon)); - } - -// debugging- - public List getTestPoints() { - return testPoints; - } - - public void addTestPoint(long timestamp) { - Log.d("TestPoint", "Test point marked at: " + timestamp); - if (!saveRecording || trajectory == null) { - Log.w("SensorFusion", "Test point ignored: not recording"); - return; - } - - long relativeTs = System.currentTimeMillis() - absoluteStartTime; - - Traj.GNSSPosition testPoint = Traj.GNSSPosition.newBuilder() - .setRelativeTimestamp(relativeTs) - .setLatitude(latitude) - .setLongitude(longitude) - .setAltitude(elevation) // or GNSS altitude if you prefer - .build(); - - trajectory.addTestPoints(testPoint); - - Log.d("SensorFusion", "Test point added @ " + latitude + ", " + longitude); - } - public void setContext(Context context) { this.appContext = context.getApplicationContext(); // store app context for later use @@ -270,6 +235,7 @@ public void setContext(Context context) { this.linearAccelerationSensor = new MovementSensor(context, Sensor.TYPE_LINEAR_ACCELERATION); // Listener based devices this.wifiProcessor = new WifiDataProcessor(context); + wifiProcessor.registerObserver(this); this.gnssProcessor = new GNSSDataProcessor(context, locationListener); // Create object handling HTTPS communication @@ -296,6 +262,8 @@ public void setContext(Context context) { // Keep app awake during the recording (using stored appContext) PowerManager powerManager = (PowerManager) this.appContext.getSystemService(Context.POWER_SERVICE); wakeLock = powerManager.newWakeLock(PowerManager.PARTIAL_WAKE_LOCK, "MyApp::MyWakelockTag"); + wifiProcessor.startListening(); + } //endregion @@ -443,7 +411,7 @@ public void onSensorChanged(SensorEvent sensorEvent) { if (saveRecording) { this.pathView.drawTrajectory(newCords); stepCounter++; - trajectory.addPdrData(Traj.RelativePosition.newBuilder() + trajectory.addPdrData(Traj.Pdr_Sample.newBuilder() .setRelativeTimestamp(SystemClock.uptimeMillis() - bootTime) .setX(newCords[0]) .setY(newCords[1])); @@ -483,18 +451,14 @@ public void onLocationChanged(@NonNull Location location) { float speed = (float) location.getSpeed(); String provider = location.getProvider(); if(saveRecording) { - trajectory.addGnssData(Traj.GNSSReading.newBuilder() - .setPosition(Traj.GNSSPosition.newBuilder() - .setLatitude(latitude) - .setLongitude(longitude) - .setAltitude(altitude) - .setRelativeTimestamp(System.currentTimeMillis()-absoluteStartTime) - .build()) + trajectory.addGnssData(Traj.GNSS_Sample.newBuilder() .setAccuracy(accuracy) + .setAltitude(altitude) + .setLatitude(latitude) + .setLongitude(longitude) .setSpeed(speed) - .setBearing(0) .setProvider(provider) - .build()); + .setRelativeTimestamp(System.currentTimeMillis()-absoluteStartTime)); } } } @@ -512,17 +476,21 @@ public void update(Object[] wifiList) { this.wifiList = Stream.of(wifiList).map(o -> (Wifi) o).collect(Collectors.toList()); if(this.saveRecording) { - Traj.Fingerprint.Builder wifiData = Traj.Fingerprint.newBuilder() + Traj.WiFi_Sample.Builder wifiData = Traj.WiFi_Sample.newBuilder() .setRelativeTimestamp(SystemClock.uptimeMillis()-bootTime); for (Wifi data : this.wifiList) { - wifiData.addRfScans(Traj.RFScan.newBuilder() + wifiData.addMacScans(Traj.Mac_Scan.newBuilder() .setRelativeTimestamp(SystemClock.uptimeMillis() - bootTime) .setMac(data.getBssid()).setRssi(data.getLevel())); } // Adding WiFi data to Trajectory - this.trajectory.addWifiFingerprints(wifiData); + this.trajectory.addWifiData(wifiData); } createWifiPositioningRequest(); + Log.d("SensorFusion", "wifiList length = " + + (wifiList == null ? 0 : wifiList.length)); + + } /** @@ -963,7 +931,7 @@ public void sendTrajectoryToCloud() { } /** - * Creates a {@link Traj.SensorInfo} objects from the specified sensor's data. + * Creates a {@link Traj.Sensor_Info} objects from the specified sensor's data. * * @param sensor MovementSensor objects with populated sensorInfo fields * @return Traj.SensorInfo object to be used in building the trajectory @@ -971,8 +939,8 @@ public void sendTrajectoryToCloud() { * @see Traj Trajectory object used for communication with the server * @see MovementSensor class abstracting SensorManager based sensors */ - private Traj.SensorInfo.Builder createInfoBuilder(MovementSensor sensor) { - return Traj.SensorInfo.newBuilder() + private Traj.Sensor_Info.Builder createInfoBuilder(MovementSensor sensor) { + return Traj.Sensor_Info.newBuilder() .setName(sensor.sensorInfo.getName()) .setVendor(sensor.sensorInfo.getVendor()) .setResolution(sensor.sensorInfo.getResolution()) @@ -990,45 +958,40 @@ private Traj.SensorInfo.Builder createInfoBuilder(MovementSensor sensor) { private class storeDataInTrajectory extends TimerTask { public void run() { // Store IMU and magnetometer data in Trajectory class - trajectory.addImuData(Traj.IMUReading.newBuilder() - .setRelativeTimestamp(SystemClock.uptimeMillis()-bootTime) - .setAcc(Traj.Vector3.newBuilder() - .setX(acceleration[0]) - .setY(acceleration[1]) - .setZ(acceleration[2]) - .build()) - .setGyr(Traj.Vector3.newBuilder() - .setX(angularVelocity[0]) - .setY(angularVelocity[1]) - .setZ(angularVelocity[2]) - .build()) - .setRotationVector(Traj.Quaternion.newBuilder() - .setX(rotation[0]) - .setY(rotation[1]) - .setZ(rotation[2]) - .setW(rotation[3]) - .build()) - .setStepCount(stepCounter) - .build()); - - trajectory.addMagnetometerData(Traj.MagnetometerReading.newBuilder() - .setMag(Traj.Vector3.newBuilder() - .setX(magneticField[0]) - .setY(magneticField[1]) - .setZ(magneticField[2]) - .build()) + trajectory.addImuData(Traj.Motion_Sample.newBuilder() .setRelativeTimestamp(SystemClock.uptimeMillis()-bootTime) - .build()); + .setAccX(acceleration[0]) + .setAccY(acceleration[1]) + .setAccZ(acceleration[2]) + .setGyrX(angularVelocity[0]) + .setGyrY(angularVelocity[1]) + .setGyrZ(angularVelocity[2]) + .setGyrZ(angularVelocity[2]) + .setRotationVectorX(rotation[0]) + .setRotationVectorY(rotation[1]) + .setRotationVectorZ(rotation[2]) + .setRotationVectorW(rotation[3]) + .setStepCount(stepCounter)) + .addPositionData(Traj.Position_Sample.newBuilder() + .setMagX(magneticField[0]) + .setMagY(magneticField[1]) + .setMagZ(magneticField[2]) + .setRelativeTimestamp(SystemClock.uptimeMillis()-bootTime)) +// .addGnssData(Traj.GNSS_Sample.newBuilder() +// .setLatitude(latitude) +// .setLongitude(longitude) +// .setRelativeTimestamp(SystemClock.uptimeMillis()-bootTime)) + ; // Divide timer with a counter for storing data every 1 second if (counter == 99) { counter = 0; // Store pressure and light data if (barometerSensor.sensor != null) { - trajectory.addPressureData(Traj.BarometerReading.newBuilder() + trajectory.addPressureData(Traj.Pressure_Sample.newBuilder() .setPressure(pressure) .setRelativeTimestamp(SystemClock.uptimeMillis() - bootTime)) - .addLightData(Traj.LightReading.newBuilder() + .addLightData(Traj.Light_Sample.newBuilder() .setLight(light) .setRelativeTimestamp(SystemClock.uptimeMillis() - bootTime) .build()); @@ -1039,7 +1002,7 @@ public void run() { secondCounter = 0; //Current Wifi Object Wifi currentWifi = wifiProcessor.getCurrentWifiData(); - trajectory.addApsData(Traj.WiFiAPData.newBuilder() + trajectory.addApsData(Traj.AP_Data.newBuilder() .setMac(currentWifi.getBssid()) .setSsid(currentWifi.getSsid()) .setFrequency(currentWifi.getFrequency())); @@ -1055,6 +1018,18 @@ public void run() { } } + public List getLatestBssids() { + if (wifiProcessor == null) { + Log.w("SensorFusion", "getLatestBssids(): wifiProcessor is null"); + return new ArrayList<>(); + } + List macs = wifiProcessor.getLastObservedBssids(); + Log.d("SensorFusion", "getLatestBssids(): macs=" + macs.size()); + return macs; + } + + + //endregion } diff --git a/app/src/main/java/com/openpositioning/PositionMe/sensors/WifiDataProcessor.java b/app/src/main/java/com/openpositioning/PositionMe/sensors/WifiDataProcessor.java index fa8a17dd..f24cfd83 100644 --- a/app/src/main/java/com/openpositioning/PositionMe/sensors/WifiDataProcessor.java +++ b/app/src/main/java/com/openpositioning/PositionMe/sensors/WifiDataProcessor.java @@ -1,5 +1,6 @@ package com.openpositioning.PositionMe.sensors; +import android.util.Log; import android.Manifest; import android.content.BroadcastReceiver; import android.content.Context; @@ -41,7 +42,7 @@ public class WifiDataProcessor implements Observable { //Time over which a new scan will be initiated - private static final long scanInterval = 5000; + private static final long scanInterval = 15000; // Application context for handling permissions and WifiManager instances private final Context context; @@ -57,6 +58,10 @@ public class WifiDataProcessor implements Observable { // Timer object private Timer scanWifiDataTimer; + // Raw BSSIDs from the most recent scan (colon-separated MAC strings) + private final List lastObservedBssids = new ArrayList<>(); + + /** * Public default constructor of the WifiDataProcessor class. * The constructor saves the context, checks for permissions to use the location services, @@ -73,29 +78,64 @@ public class WifiDataProcessor implements Observable { * @author Mate Stodulka */ public WifiDataProcessor(Context context) { - this.context = context; - // Check for permissions - boolean permissionsGranted = checkWifiPermissions(); - this.wifiManager = (WifiManager) context.getSystemService(Context.WIFI_SERVICE); + + Log.d("WifiDataProcessor", + "constructed instance=" + System.identityHashCode(this)); + + this.context = context.getApplicationContext(); + this.wifiManager = (WifiManager) this.context.getSystemService(Context.WIFI_SERVICE); this.scanWifiDataTimer = new Timer(); this.observers = new ArrayList<>(); + this.wifiData = new Wifi[0]; + } - // Decreapted method after API 29 - // Turn on wifi if it is currently disabled - // TODO - turn it to a notification toward user -// // if(permissionsGranted && wifiManager.getWifiState()== WifiManager.WIFI_STATE_DISABLED) { -// // wifiManager.setWifiEnabled(true); -// // } + public void startListening() { - // Start wifi scan and return results via broadcast - if(permissionsGranted) { - this.scanWifiDataTimer.schedule(new scheduledWifiScan(), 0, scanInterval); + if (!checkWifiPermissions()) { + Log.w("WifiDataProcessor", "Permissions not granted, not starting WiFi scan"); + return; } - //Inform the user if wifi throttling is enabled on their device - checkWifiThrottling(); + // Immediately process cached results + List initialResults = wifiManager.getScanResults(); + processScanResults(initialResults); + + scanWifiDataTimer.scheduleAtFixedRate( + new scheduledWifiScan(), + 0, + 15000 + ); } + private void processScanResults(List wifiScanList) { + + if (wifiScanList == null) return; + + lastObservedBssids.clear(); + + for (ScanResult r : wifiScanList) { + if (r.BSSID != null && !r.BSSID.isEmpty()) { + lastObservedBssids.add(r.BSSID.toLowerCase()); + } + } + + wifiData = new Wifi[wifiScanList.size()]; + + for (int i = 0; i < wifiScanList.size(); i++) { + wifiData[i] = new Wifi(); + String mac = wifiScanList.get(i).BSSID; + long intMacAddress = convertBssidToLong(mac); + wifiData[i].setBssid(intMacAddress); + wifiData[i].setLevel(wifiScanList.get(i).level); + } + + Log.d("WifiDataProcessor", + "Processed scan results, BSSIDs=" + lastObservedBssids.size()); + + notifyObservers(0); + } + + /** * Broadcast receiver to receive updates from the wifi manager. * Receives updates when a wifi scan is complete. Observers are notified when the broadcast is @@ -114,6 +154,7 @@ public WifiDataProcessor(Context context) { */ @Override public void onReceive(Context context, Intent intent) { + Log.d("WifiDataProcessor", "Scan complete, BSSIDs=" + lastObservedBssids.size()); if (ActivityCompat.checkSelfPermission(context, Manifest.permission.ACCESS_FINE_LOCATION) != PackageManager.PERMISSION_GRANTED) { // Unregister this listener @@ -125,6 +166,14 @@ public void onReceive(Context context, Intent intent) { List wifiScanList = wifiManager.getScanResults(); //Stop receiver as scan is complete context.unregisterReceiver(this); + // Collect raw BSSIDs for floorplan API + lastObservedBssids.clear(); + for (ScanResult r : wifiScanList) { + if (r.BSSID != null && !r.BSSID.isEmpty()) { + lastObservedBssids.add(r.BSSID.toLowerCase()); + } + } + //Loop though each item in wifi list wifiData = new Wifi[wifiScanList.size()]; @@ -138,6 +187,7 @@ public void onReceive(Context context, Intent intent) { wifiData[i].setLevel(wifiScanList.get(i).level); } + //Notify observers of change in wifiData variable notifyObservers(0); } @@ -224,10 +274,8 @@ private void startWifiScan() { * Initiate scans for nearby networks every 5 seconds. * The method declares a new timer instance to schedule a scan for nearby wifis every 5 seconds. */ - public void startListening() { - this.scanWifiDataTimer = new Timer(); - this.scanWifiDataTimer.scheduleAtFixedRate(new scheduledWifiScan(), 0, scanInterval); - } + + /** * Cancel wifi scans. @@ -287,13 +335,22 @@ public void notifyObservers(int idx) { * calling wifi scans every 5 seconds. */ private class scheduledWifiScan extends TimerTask { - @Override public void run() { - startWifiScan(); + + if (!checkWifiPermissions()) return; + + // Always read cached results first + List cached = wifiManager.getScanResults(); + processScanResults(cached); + + // Best-effort request a new scan (may be throttled) + boolean ok = wifiManager.startScan(); + Log.d("WifiDataProcessor", "startScan() returned=" + ok); } } + /** * Obtains required information about wifi in which the device is currently connected. * @@ -329,4 +386,15 @@ public Wifi getCurrentWifiData(){ } return currentWifi; } + + + + public List getLastObservedBssids() { + Log.d("WifiDataProcessor", "getLastObservedBssids() size=" + lastObservedBssids.size() + + " instance=" + System.identityHashCode(this)); + return new ArrayList<>(lastObservedBssids); + } + + + } diff --git a/app/src/main/java/com/openpositioning/PositionMe/utils/BuildingPolygon.java b/app/src/main/java/com/openpositioning/PositionMe/utils/BuildingPolygon.java index 2d0a3265..fcbb327c 100644 --- a/app/src/main/java/com/openpositioning/PositionMe/utils/BuildingPolygon.java +++ b/app/src/main/java/com/openpositioning/PositionMe/utils/BuildingPolygon.java @@ -62,7 +62,7 @@ public static boolean inLibrary(LatLng point){ * @return True if point in polygon * False otherwise */ - private static boolean pointInPolygon(LatLng point, List polygon) { + public static boolean pointInPolygon(LatLng point, List polygon) { int numCrossings = 0; List path=polygon; // For each edge diff --git a/app/src/main/java/com/openpositioning/PositionMe/utils/IndoorMapManager.java b/app/src/main/java/com/openpositioning/PositionMe/utils/IndoorMapManager.java index 9d7167df..7babbf4f 100644 --- a/app/src/main/java/com/openpositioning/PositionMe/utils/IndoorMapManager.java +++ b/app/src/main/java/com/openpositioning/PositionMe/utils/IndoorMapManager.java @@ -12,9 +12,21 @@ import com.google.android.gms.maps.model.PolylineOptions; import com.openpositioning.PositionMe.R; +import java.util.ArrayList; import java.util.Arrays; +import java.util.Iterator; import java.util.List; +import com.google.android.gms.maps.model.BitmapDescriptor; +import com.google.android.gms.maps.model.LatLngBounds; +import com.google.android.gms.maps.model.Polygon; +import com.google.android.gms.maps.model.PolygonOptions; + +import org.json.JSONArray; +import org.json.JSONException; +import org.json.JSONObject; +import java.util.Map; +import java.util.HashMap; /** * Class used to manage indoor floor map overlays * Currently used by RecordingFragment @@ -22,172 +34,381 @@ * in the building * @author Arun Gopalakrishnan */ +/** + * Class used to manage indoor floor map overlays + * Currently used by RecordingFragment + * @see BuildingPolygon Describes the bounds of buildings and the methods to check if point is + * in the building + * + * UPDATED: + * - Replaced bitmap GroundOverlay indoor floors with vector GeoJSON floor rendering + * - Floors are now drawn using polygons from map_shapes + */ public class IndoorMapManager { + // To store the map instance - private GoogleMap gMap; - //Stores the overlay of the indoor maps - private GroundOverlay groundOverlay; + private final GoogleMap gMap; + // Stores the current Location of user private LatLng currentLocation; + // Stores if indoor map overlay is currently set - private boolean isIndoorMapSet=false; - //Stores the current floor in building - private int currentFloor; - // Floor height of current building - private float floorHeight; - //Images of the Nucleus Building and Library indoor floor maps - private final List NUCLEUS_MAPS =Arrays.asList( - R.drawable.nucleuslg, R.drawable.nucleusg, R.drawable.nucleus1, - R.drawable.nucleus2,R.drawable.nucleus3); - private final List LIBRARY_MAPS =Arrays.asList( - R.drawable.libraryg, R.drawable.library1, R.drawable.library2, - R.drawable.library3); - // South-west and north east Bounds of Nucleus building and library to set the Overlay - LatLngBounds NUCLEUS=new LatLngBounds( - BuildingPolygon.NUCLEUS_SW, - BuildingPolygon.NUCLEUS_NE - ); - LatLngBounds LIBRARY=new LatLngBounds( - BuildingPolygon.LIBRARY_SW, - BuildingPolygon.LIBRARY_NE - ); - //Average Floor Heights of the Buildings - public static final float NUCLEUS_FLOOR_HEIGHT=4.2F; - public static final float LIBRARY_FLOOR_HEIGHT=3.6F; + private boolean isIndoorMapSet = false; + + // Stores the current venue selected + private IndoorVenue currentVenue; + + // Stores the currently displayed floor key (e.g., "B1", "G", "1") + private String currentFloorKey; + + // Map polygon (outline) → venue mapping + private final Map polygonToVenue = new HashMap<>(); + + // List of currently drawn indoor floor polygons + private final List activeFloorPolygons = new ArrayList<>(); + + + /** + * Venue model used for storing API floorplan data + */ + public static class IndoorVenue{ + public String venueId; + public String name; + public LatLngBounds bounds; + public List outline; + + // Raw GeoJSON floor data from API + public String rawMapShapes; + } + /** * Constructor to set the map instance * @param map The map on which the indoor floor map overlays are set */ public IndoorMapManager(GoogleMap map){ - this.gMap=map; + this.gMap = map; } + /** - * Function to update the current location of user and display the indoor map - * if user in building with indoor map available + * Function to update the current location of user * @param currentLocation new location of user */ public void setCurrentLocation(LatLng currentLocation){ - this.currentLocation=currentLocation; - setBuildingOverlay(); + this.currentLocation = currentLocation; } + /** - * Function to obtain the current building's floor height - * @return the floor height of the current building the user is in + * Draw available indoor venues as clickable green polygons. */ - public float getFloorHeight() { - return floorHeight; + public void showVenueOutlines(List venues) { + + polygonToVenue.clear(); + + for (IndoorVenue venue : venues) { + Polygon poly = gMap.addPolygon( + new PolygonOptions() + .addAll(venue.outline) + .strokeColor(Color.GREEN) + .strokeWidth(4f) + .fillColor(0x2200FF00) + .clickable(true) + ); + + polygonToVenue.put(poly, venue); + } } + /** - * Getter to obtain if currently an indoor floor map is being displayed - * @return true if an indoor map is visible to the user, false otherwise + * Returns the IndoorVenue corresponding to a clicked polygon. */ - public boolean getIsIndoorMapSet(){ - return isIndoorMapSet; + public IndoorVenue getVenueForPolygon(Polygon polygon) { + return polygonToVenue.get(polygon); } + /** - * Setting the new floor of a user and displaying the indoor floor map accordingly - * (if floor exists in building) - * @param newFloor the floor the user is at - * @param autoFloor flag if function called by auto-floor feature + * Called when user selects a venue. + * Parses GeoJSON floor data and renders first available floor. */ - public void setCurrentFloor(int newFloor, boolean autoFloor) { - if (BuildingPolygon.inNucleus(currentLocation)){ - //Special case for nucleus when auto-floor is being used - if (autoFloor) { - // If nucleus add bias floor as lower-ground floor referred to as floor 0 - newFloor += 1; - } - // If within bounds and different from floor map currently being shown - if (newFloor>=0 && newFloor=0 && newFloor keys = floorsObj.keys(); + if (!keys.hasNext()) { + Log.w("IndoorMapManager", "No floors found for venue: " + venue.name); + return; } - } + // Default to first floor + currentFloorKey = keys.next(); + drawFloor(floorsObj.getJSONObject(currentFloorKey)); + + isIndoorMapSet = true; + + Log.d("IndoorMapManager", "Selected floor: " + currentFloorKey); + + } catch (JSONException e) { + Log.e("IndoorMapManager", "Failed parsing floor GeoJSON", e); + } } + /** - * Increments the Current Floor and changes to higher floor's map (if a higher floor exists) + * Increase floor within the current venue. */ - public void increaseFloor(){ - this.setCurrentFloor(currentFloor+1,false); + public void increaseFloor() { + switchFloor(+1); } + /** - * Decrements the Current Floor and changes to the lower floor's map (if a lower floor exists) + * Decrease floor within the current venue. */ - public void decreaseFloor(){ - this.setCurrentFloor(currentFloor-1,false); + public void decreaseFloor() { + switchFloor(-1); } + /** - * Sets the map overlay for the building if user's current - * location is in building and is not already set - * Removes the overlay if user no longer in building + * Switch floor based on direction (+1 or -1) */ - private void setBuildingOverlay() { - // Try catch block to prevent fatal crashes + private void switchFloor(int direction) { + + if (currentVenue == null || currentVenue.rawMapShapes == null) return; + try { - // Setting overlay if in Nucleus and not already set - if (BuildingPolygon.inNucleus(currentLocation) && !isIndoorMapSet) { - groundOverlay = gMap.addGroundOverlay(new GroundOverlayOptions() - .image(BitmapDescriptorFactory.fromResource(R.drawable.nucleusg)) - .positionFromBounds(NUCLEUS)); - isIndoorMapSet = true; - // Nucleus has an LG floor so G floor is at index 1 - currentFloor=1; - floorHeight=NUCLEUS_FLOOR_HEIGHT; + JSONObject floorsObj = new JSONObject(currentVenue.rawMapShapes); + List floorKeys = getSortedFloorKeys(floorsObj); + Iterator keys = floorsObj.keys(); + while (keys.hasNext()) { + floorKeys.add(keys.next()); } - // Setting overlay if in Library and not already set - else if (BuildingPolygon.inLibrary(currentLocation) && !isIndoorMapSet) { - groundOverlay = gMap.addGroundOverlay(new GroundOverlayOptions() - .image(BitmapDescriptorFactory.fromResource(R.drawable.libraryg)) - .positionFromBounds(LIBRARY)); - isIndoorMapSet = true; - currentFloor=0; - floorHeight=LIBRARY_FLOOR_HEIGHT; + + int idx = floorKeys.indexOf(currentFloorKey); + if (idx < 0) return; + + int next = idx + direction; + if (next >= 0 && next < floorKeys.size()) { + + currentFloorKey = floorKeys.get(next); + + clearIndoorFloor(); + drawFloor(floorsObj.getJSONObject(currentFloorKey)); + isIndoorMapSet = true; + + Log.d("IndoorMapManager", "Switched to floor: " + currentFloorKey); } - // Removing overlay if user no longer in area with indoor maps available - else if (!BuildingPolygon.inLibrary(currentLocation) && - !BuildingPolygon.inNucleus(currentLocation)&& isIndoorMapSet){ - groundOverlay.remove(); - isIndoorMapSet = false; - currentFloor=0; - } - } catch (Exception ex) { - Log.e("Error with overlay, Exception:", ex.toString()); + + } catch (JSONException e) { + Log.e("IndoorMapManager", "Floor switch failed", e); } } + /** - * Function used to set the indication of available floor maps for building using green Polylines - * along the building's boundaries. + * Draw a single floor from GeoJSON FeatureCollection. */ - public void setIndicationOfIndoorMap(){ - //Indicator for Nucleus Building - List points=BuildingPolygon.NUCLEUS_POLYGON; - // Closing Boundary - points.add(BuildingPolygon.NUCLEUS_POLYGON.get(0)); - gMap.addPolyline(new PolylineOptions().color(Color.GREEN) - .addAll(points)); - - // Indicator for the Library Building - points=BuildingPolygon.LIBRARY_POLYGON; - // Closing Boundary - points.add(BuildingPolygon.LIBRARY_POLYGON.get(0)); - gMap.addPolyline(new PolylineOptions().color(Color.GREEN) - .addAll(points)); + private void drawFloor(JSONObject floorGeoJson) throws JSONException { + + JSONArray features = floorGeoJson.getJSONArray("features"); + + + for (int i = 0; i < features.length(); i++) { + + JSONObject feature = features.getJSONObject(i); + + // ----- Read indoor_type for styling ----- + JSONObject props = feature.optJSONObject("properties"); + String indoorType = props != null ? props.optString("indoor_type", "") : ""; + String t = indoorType == null ? "" : indoorType.toLowerCase(); + + JSONObject geometry = feature.getJSONObject("geometry"); + String geomType = geometry.optString("type", ""); + + if (!"MultiPolygon".equalsIgnoreCase(geomType)) continue; + + JSONArray multiPoly = geometry.getJSONArray("coordinates"); + + // Style defaults + int strokeColor = Color.argb(220, 20, 20, 20); // dark grey + int fillColor = Color.argb(25, 60, 130, 255); // subtle blue-ish + float strokeWidth = 2.0f; + + // Style by indoor_type + if (t.contains("wall")) { + fillColor = Color.argb(0, 0, 0, 0); // no fill + strokeWidth = 3.5f; + } else if (t.contains("door")) { + fillColor = Color.argb(0, 0, 0, 0); + strokeWidth = 4.5f; + } else if (t.contains("corridor") || t.contains("hall")) { + fillColor = Color.argb(35, 60, 130, 255); + strokeWidth = 1.5f; + } else if (t.contains("room") || t.contains("area")) { + fillColor = Color.argb(30, 60, 130, 255); + strokeWidth = 1.2f; + } else { + // keep unknown types subtle + fillColor = Color.argb(15, 60, 130, 255); + strokeWidth = 1.0f; + } + + for (int j = 0; j < multiPoly.length(); j++) { + + // MultiPolygon -> polygon -> rings + JSONArray polygon = multiPoly.getJSONArray(j); + if (polygon.length() == 0) continue; + + // ---- outer ring ---- + JSONArray outerRing = polygon.getJSONArray(0); + List outerPoints = toLatLngList(outerRing); + + // Optional: skip tiny polygons (reduces clutter) + if (outerPoints.size() < 3) continue; + if (isTiny(outerPoints)) continue; + + PolygonOptions opts = new PolygonOptions() + .addAll(outerPoints) + .strokeColor(strokeColor) + .strokeWidth(strokeWidth) + .fillColor(fillColor); + + // ---- holes (rings 1..n) ---- + for (int k = 1; k < polygon.length(); k++) { + JSONArray holeRing = polygon.getJSONArray(k); + List holePoints = toLatLngList(holeRing); + if (holePoints.size() >= 3) { + opts.addHole(holePoints); + } + } + + Polygon polyObj = gMap.addPolygon(opts); + activeFloorPolygons.add(polyObj); +// JSONObject props = feature.optJSONObject("properties"); + if (props != null) { +// String indoorType = props.optString("indoor_type", "NONE"); + Log.d("IndoorTypes", "Found indoor_type=" + indoorType); + } + + } + } + } + + /** + * Convert a GeoJSON ring ([[lon,lat], ...]) into List. + * GeoJSON uses [lon,lat] order. + */ + private List toLatLngList(JSONArray ring) throws JSONException { + List points = new ArrayList<>(ring.length()); + for (int m = 0; m < ring.length(); m++) { + JSONArray coord = ring.getJSONArray(m); + double lon = coord.getDouble(0); + double lat = coord.getDouble(1); + points.add(new LatLng(lat, lon)); + } + return points; + } + + /** + * Heuristic to drop tiny polygons that clutter the view. + * Adjust thresholds if needed. + */ + private boolean isTiny(List pts) { + double minLat = Double.POSITIVE_INFINITY, minLon = Double.POSITIVE_INFINITY; + double maxLat = Double.NEGATIVE_INFINITY, maxLon = Double.NEGATIVE_INFINITY; + + for (LatLng p : pts) { + minLat = Math.min(minLat, p.latitude); + minLon = Math.min(minLon, p.longitude); + maxLat = Math.max(maxLat, p.latitude); + maxLon = Math.max(maxLon, p.longitude); + } + + double dLat = maxLat - minLat; + double dLon = maxLon - minLon; + + // ~1e-6 deg is ~0.11m lat-wise; tune as needed + return (dLat * dLon) < 2e-12; + } + + + + private List getSortedFloorKeys(JSONObject floorsObj) throws JSONException { + List keys = new ArrayList<>(); + Iterator it = floorsObj.keys(); + while (it.hasNext()) keys.add(it.next()); + + keys.sort((a, b) -> Integer.compare(floorOrderValue(a), floorOrderValue(b))); + return keys; + } + + private int floorOrderValue(String key) { + // Basement floors: B3 < B2 < B1 + if (key == null) return 9999; + key = key.trim().toUpperCase(); + + if (key.startsWith("B")) { + try { + int n = Integer.parseInt(key.substring(1)); + return -100 - n; // B3 -> -103, B1 -> -101 + } catch (Exception ignored) { + return -150; + } + } + + // Ground floor + if (key.equals("G") || key.equals("GF") || key.equals("GROUND")) return 0; + + // Numeric floors + try { + return Integer.parseInt(key); + } catch (Exception ignored) { + return 1000; + } } + + /** + * Removes currently drawn indoor floor polygons. + */ + private void clearIndoorFloor() { + for (Polygon p : activeFloorPolygons) { + p.remove(); + } + activeFloorPolygons.clear(); + + } + + public void clearSelection() { + clearIndoorFloor(); + currentVenue = null; + currentFloorKey = null; + isIndoorMapSet = false; + } + + + + /** + * Getter to obtain if currently an indoor floor map is being displayed + */ + public boolean getIsIndoorMapSet() { + return isIndoorMapSet; + } + + public String getCurrentFloorKey() { + return currentFloorKey; + } + + } diff --git a/app/src/main/java/com/openpositioning/PositionMe/utils/VenueMapper.java b/app/src/main/java/com/openpositioning/PositionMe/utils/VenueMapper.java new file mode 100644 index 00000000..24c4b1f4 --- /dev/null +++ b/app/src/main/java/com/openpositioning/PositionMe/utils/VenueMapper.java @@ -0,0 +1,102 @@ +//package com.openpositioning.PositionMe.presentation.fragment; +package com.openpositioning.PositionMe.utils; + + +import android.util.Log; + +import com.google.android.gms.maps.model.LatLng; +import com.google.android.gms.maps.model.LatLngBounds; +import com.openpositioning.PositionMe.data.remote.FloorPlanData; + +import org.json.JSONArray; +import org.json.JSONObject; + +import java.util.ArrayList; +import java.util.List; + +public class VenueMapper { + + public static List toIndoorVenues(List dtos) { + List out = new ArrayList<>(); + + for (FloorPlanData.VenueDto dto : dtos) { + try { + List outline = parseOutlineGeoJson(dto.outline); + if (outline.isEmpty()) continue; + + IndoorMapManager.IndoorVenue v = new IndoorMapManager.IndoorVenue(); + v.name = dto.name; + v.venueId = dto.name; // placeholder (API may provide an id field later) + v.outline = outline; + v.bounds = computeBounds(outline); + v.rawMapShapes = dto.mapShapes; + + + out.add(v); + + } catch (Exception e) { + Log.e("VenueMapper", "Failed mapping venue " + dto.name, e); + } + } + + return out; + } + + /** + * dto.outline is a STRING that itself contains GeoJSON. + * Coordinates in GeoJSON are [lon, lat]. + * We take the first polygon ring from the MultiPolygon. + */ + private static List parseOutlineGeoJson(String outlineJsonString) throws Exception { + List pts = new ArrayList<>(); + if (outlineJsonString == null || outlineJsonString.isEmpty()) return pts; + + JSONObject fc = new JSONObject(outlineJsonString); + JSONArray features = fc.optJSONArray("features"); + if (features == null || features.length() == 0) return pts; + + JSONObject geom = features.getJSONObject(0).getJSONObject("geometry"); + String type = geom.optString("type", ""); + + JSONArray coords = geom.getJSONArray("coordinates"); + + // MultiPolygon: coordinates[ polygon ][ ring ][ point ][ lon/lat ] + // Polygon: coordinates[ ring ][ point ][ lon/lat ] + JSONArray ring; + + if ("MultiPolygon".equalsIgnoreCase(type)) { + ring = coords.getJSONArray(0).getJSONArray(0); + } else if ("Polygon".equalsIgnoreCase(type)) { + ring = coords.getJSONArray(0); + } else { + return pts; + } + + for (int i = 0; i < ring.length(); i++) { + JSONArray p = ring.getJSONArray(i); + double lon = p.getDouble(0); + double lat = p.getDouble(1); + pts.add(new LatLng(lat, lon)); + } + + return pts; + } + + private static LatLngBounds computeBounds(List pts) { + double minLat = Double.POSITIVE_INFINITY, minLon = Double.POSITIVE_INFINITY; + double maxLat = Double.NEGATIVE_INFINITY, maxLon = Double.NEGATIVE_INFINITY; + + for (LatLng p : pts) { + minLat = Math.min(minLat, p.latitude); + minLon = Math.min(minLon, p.longitude); + maxLat = Math.max(maxLat, p.latitude); + maxLon = Math.max(maxLon, p.longitude); + } + + return new LatLngBounds( + new LatLng(minLat, minLon), + new LatLng(maxLat, maxLon) + ); + } +} + diff --git a/app/src/main/res/layout/fragment_recording.xml b/app/src/main/res/layout/fragment_recording.xml index 300ab5bc..af88907e 100644 --- a/app/src/main/res/layout/fragment_recording.xml +++ b/app/src/main/res/layout/fragment_recording.xml @@ -6,6 +6,14 @@ android:layout_height="match_parent"> + + - - - + app:iconTint="@color/md_theme_onError" + app:backgroundTint="@color/md_theme_error" + app:cornerRadius="16dp" /> @@ -76,24 +77,60 @@ android:layout_width="wrap_content" android:layout_height="wrap_content" android:layout_margin="16dp" + android:contentDescription="@string/floor_down" android:src="@android:drawable/arrow_down_float" app:backgroundTint="@color/md_theme_primary" - app:tint="@color/md_theme_onPrimary" app:layout_constraintBottom_toBottomOf="parent" app:layout_constraintEnd_toEndOf="parent" - android:contentDescription="@string/floor_down" /> + app:tint="@color/md_theme_onPrimary" /> + + + + + + + app:tint="@color/md_theme_onPrimary" /> + + From 3d12855cfb8060391cc312e35a68f8dc31b99885 Mon Sep 17 00:00:00 2001 From: Sydney Savarese <113381007+sydneysavarese@users.noreply.github.com> Date: Wed, 11 Feb 2026 20:03:50 +0000 Subject: [PATCH 15/82] commented FloorPlanData.java --- .../PositionMe/data/remote/FloorPlanData.java | 15 ++++++++++++++- 1 file changed, 14 insertions(+), 1 deletion(-) diff --git a/app/src/main/java/com/openpositioning/PositionMe/data/remote/FloorPlanData.java b/app/src/main/java/com/openpositioning/PositionMe/data/remote/FloorPlanData.java index 877e0625..55d5a898 100644 --- a/app/src/main/java/com/openpositioning/PositionMe/data/remote/FloorPlanData.java +++ b/app/src/main/java/com/openpositioning/PositionMe/data/remote/FloorPlanData.java @@ -1,4 +1,17 @@ -//call from TrajectoryMapFragment when we have LatLng currentLocation and List observedMacs +/** + * FloorPlanData is responsible for communicating with the OpenPositioning + * live floorplan API to retrieve nearby indoor venues. + * + * This class performs asynchronous HTTP POST requests using OkHttp, + * sending the user's current latitude, longitude, and observed Wi-Fi + * BSSID values to the server. The API response is parsed into + * lightweight VenueDto objects containing: + * - Venue name (identifier) + * - Building outline (GeoJSON) + * - Floor map geometry (GeoJSON map_shapes) + * + */ + package com.openpositioning.PositionMe.data.remote; import com.openpositioning.PositionMe.BuildConfig; import com.openpositioning.PositionMe.utils.IndoorMapManager; From 8551d656be95d915227f119adcc8de22e94c841a Mon Sep 17 00:00:00 2001 From: Sydney Savarese <113381007+sydneysavarese@users.noreply.github.com> Date: Wed, 11 Feb 2026 20:14:29 +0000 Subject: [PATCH 16/82] comment VenueMapper.java --- .../PositionMe/utils/VenueMapper.java | 16 +++++++++++++++- 1 file changed, 15 insertions(+), 1 deletion(-) diff --git a/app/src/main/java/com/openpositioning/PositionMe/utils/VenueMapper.java b/app/src/main/java/com/openpositioning/PositionMe/utils/VenueMapper.java index 24c4b1f4..be9292d6 100644 --- a/app/src/main/java/com/openpositioning/PositionMe/utils/VenueMapper.java +++ b/app/src/main/java/com/openpositioning/PositionMe/utils/VenueMapper.java @@ -1,4 +1,18 @@ -//package com.openpositioning.PositionMe.presentation.fragment; +/** + * VenueMapper is responsible for converting raw API response objects + * (FloorPlanData.VenueDto) into IndoorMapManager.IndoorVenue objects + * that can be rendered and managed by the map layer. + * + * It parses the GeoJSON building outline into a list of LatLng points, + * computes bounding boxes for overlay placement, and stores raw + * floor map (mapShapes) data for later floor rendering. + * + * This class isolates data transformation logic from both the + * networking layer (FloorPlanData) and the UI layer + * (TrajectoryMapFragment / IndoorMapManager), maintaining a clear + * separation of concerns and improving maintainability. + */ + package com.openpositioning.PositionMe.utils; From e1111d2c24ff06256bda9f688d4b96e339e23d06 Mon Sep 17 00:00:00 2001 From: Sydney Savarese <113381007+sydneysavarese@users.noreply.github.com> Date: Wed, 11 Feb 2026 20:18:45 +0000 Subject: [PATCH 17/82] commented TrajectoryMapFragment.java --- .../fragment/TrajectoryMapFragment.java | 26 +------------------ 1 file changed, 1 insertion(+), 25 deletions(-) diff --git a/app/src/main/java/com/openpositioning/PositionMe/presentation/fragment/TrajectoryMapFragment.java b/app/src/main/java/com/openpositioning/PositionMe/presentation/fragment/TrajectoryMapFragment.java index 025531ed..34089b5c 100644 --- a/app/src/main/java/com/openpositioning/PositionMe/presentation/fragment/TrajectoryMapFragment.java +++ b/app/src/main/java/com/openpositioning/PositionMe/presentation/fragment/TrajectoryMapFragment.java @@ -244,11 +244,6 @@ public void onMapReady(@NonNull GoogleMap googleMap) { // Floor up/down logic autoFloorSwitch.setOnCheckedChangeListener((compoundButton, isChecked) -> { - - //TODO - fix the sensor fusion method to get the elevation (cannot get it from the current method) -// float elevationVal = sensorFusion.getElevation(); -// indoorMapManager.setCurrentFloor((int)(elevationVal/indoorMapManager.getFloorHeight()) -// ,true); }); floorUpButton.setOnClickListener(v -> { @@ -402,25 +397,7 @@ private void maybeRequestNearbyVenues(@NonNull LatLng loc) { }); } -// requireActivity().runOnUiThread(() -> { -// Log.d("TrajectoryMapFragment", "Floorplan response venues=" + dtos.size()); -// // temporarily: if empty, clear outlines or do nothing -// List venues = VenueMapper.toIndoorVenues(dtos); -// if (dtos.isEmpty()) return; // nothing to draw yet -// -//// TEMP: just log first venue strings -// FloorPlanData.VenueDto v0 = dtos.get(0); -// Log.d("TrajectoryMapFragment", "First venue name=" + v0.name); -// Log.d("TrajectoryMapFragment", "Outline raw=" + v0.outline); -// Log.d("TrajectoryMapFragment", "Map_shapes raw=" + v0.mapShapes); -// -// lastFetchedVenues = venues; -// -// if (indoorMapManager != null) { -// indoorMapManager.showVenueOutlines(venues); -// } -// }); -// } + @Override public void onError(Exception e) { Log.d("TrajectoryMapFragment", "floorplan request failed", e); @@ -706,7 +683,6 @@ private void drawBuildingPolygon() { .add(nucleus1, nucleus2, nucleus3, nucleus4, nucleus5) .strokeColor(Color.RED) // Red border .strokeWidth(10f) // Border width - //.fillColor(Color.argb(50, 255, 0, 0)) // Semi-transparent red fill .zIndex(1); // Set a higher zIndex to ensure it appears above other overlays // Options for the new polygon From 28141c875b8451cbaac1348f1f79079c20225fe0 Mon Sep 17 00:00:00 2001 From: Bhavyas15 Date: Thu, 12 Feb 2026 00:10:51 +0000 Subject: [PATCH 18/82] Describe what you changed --- Change_by_haoning_0208.md | 2 +- app/build.gradle | 3 + app/src/main/AndroidManifest.xml | 2 +- .../data/remote/ServerCommunications.java | 4 +- .../fragment/RecordingFragment.java | 4 +- .../PositionMe/sensors/SensorFusion.java | 83 ++++++++++--------- .../main/res/layout/fragment_recording.xml | 4 +- .../res/layout/fragment_trajectory_map.xml | 71 +++++++--------- build.gradle | 1 + secrets.properties | 9 +- 10 files changed, 96 insertions(+), 87 deletions(-) diff --git a/Change_by_haoning_0208.md b/Change_by_haoning_0208.md index 831401f5..cc161e7f 100644 --- a/Change_by_haoning_0208.md +++ b/Change_by_haoning_0208.md @@ -39,7 +39,7 @@ | Old Method | New Method | |------------|------------| -| `addMacScans()` | `addRfScans()` | +| `addRfScans()` | `addRfScans()` | | `addWifiData()` | `addWifiFingerprints()` | | `addPositionData()` | `addMagnetometerData()` | | `getPositionDataCount()` | `getMagnetometerDataCount()` | diff --git a/app/build.gradle b/app/build.gradle index 49b253ef..21b89d1f 100644 --- a/app/build.gradle +++ b/app/build.gradle @@ -25,6 +25,9 @@ android { testInstrumentationRunner "androidx.test.runner.AndroidJUnitRunner" + manifestPlaceholders = [ + MAPS_API_KEY: localProperties['MAPS_API_KEY'] ?: '' + ] // Example of referencing secrets (if you use secrets.properties): buildConfigField "String", "MAPS_API_KEY", "\"${localProperties['MAPS_API_KEY'] ?: ''}\"" diff --git a/app/src/main/AndroidManifest.xml b/app/src/main/AndroidManifest.xml index ca4657f0..54a9f15f 100644 --- a/app/src/main/AndroidManifest.xml +++ b/app/src/main/AndroidManifest.xml @@ -94,7 +94,7 @@ + android:value="${MAPS_API_KEY}"/> getObservedMacsOrEmpty() { private TextView bleCountText; private TextView imuCountText; private LinearLayout trajectoryInfoContent; - private TextView collapseIcon; // 使用 TextView 显示 ▼ ▶ + private TextView collapseIcon; private boolean isCardExpanded = false; // Counters @@ -181,7 +181,7 @@ public void onViewCreated(@NonNull View view, distanceTravelled = view.findViewById(R.id.currentDistanceTraveled); gnssError = view.findViewById(R.id.gnssError); - // Bind Trajectory Info Card (NEW - 合并后的卡片) + // Bind Trajectory Info Card trajectoryNameText = view.findViewById(R.id.trajectoryNameText); initialPositionText = view.findViewById(R.id.initialPositionText); initialOrientationText = view.findViewById(R.id.initialOrientationText); diff --git a/app/src/main/java/com/openpositioning/PositionMe/sensors/SensorFusion.java b/app/src/main/java/com/openpositioning/PositionMe/sensors/SensorFusion.java index 6457744b..9a2ee5f1 100644 --- a/app/src/main/java/com/openpositioning/PositionMe/sensors/SensorFusion.java +++ b/app/src/main/java/com/openpositioning/PositionMe/sensors/SensorFusion.java @@ -491,7 +491,7 @@ public void onSensorChanged(SensorEvent sensorEvent) { if (saveRecording) { this.pathView.drawTrajectory(newCords); stepCounter++; - trajectory.addPdrData(Traj.Pdr_Sample.newBuilder() + trajectory.addPdrData(Traj.RelativePosition.newBuilder() .setRelativeTimestamp(SystemClock.uptimeMillis() - bootTime) .setX(newCords[0]) .setY(newCords[1])); @@ -531,14 +531,18 @@ public void onLocationChanged(@NonNull Location location) { float speed = (float) location.getSpeed(); String provider = location.getProvider(); if(saveRecording) { - trajectory.addGnssData(Traj.GNSS_Sample.newBuilder() + trajectory.addGnssData(Traj.GNSSReading.newBuilder() + .setPosition(Traj.GNSSPosition.newBuilder() + .setLatitude(latitude) + .setLongitude(longitude) + .setAltitude(altitude) + .setRelativeTimestamp(System.currentTimeMillis()-absoluteStartTime) + .build()) .setAccuracy(accuracy) - .setAltitude(altitude) - .setLatitude(latitude) - .setLongitude(longitude) .setSpeed(speed) + .setBearing(0) .setProvider(provider) - .setRelativeTimestamp(System.currentTimeMillis()-absoluteStartTime)); + .build()); } } } @@ -578,7 +582,7 @@ private void updateWifiData(Object[] wifiList) { Traj.Fingerprint.Builder wifiData = Traj.Fingerprint.newBuilder() .setRelativeTimestamp(SystemClock.uptimeMillis()-bootTime); for (Wifi data : this.wifiList) { - wifiData.addMacScans(Traj.Mac_Scan.newBuilder() + wifiData.addRfScans(Traj.RFScan.newBuilder() .setRelativeTimestamp(SystemClock.uptimeMillis() - bootTime) .setMac(data.getBssid()) .setRssi(data.getLevel()) @@ -596,7 +600,7 @@ private void updateWifiData(Object[] wifiList) { android.util.Log.d("SensorFusion", "Duplicate WiFi fingerprint skipped"); } // Adding WiFi data to Trajectory - this.trajectory.addWifiData(wifiData); + this.trajectory.addWifiFingerprints(wifiData); } @@ -1307,7 +1311,7 @@ public void sendTrajectoryToCloud() { } /** - * Creates a {@link Traj.Sensor_Info} objects from the specified sensor's data. + * Creates a {@link Traj.SensorInfo} objects from the specified sensor's data. * * @param sensor MovementSensor objects with populated sensorInfo fields * @return Traj.SensorInfo object to be used in building the trajectory @@ -1315,8 +1319,8 @@ public void sendTrajectoryToCloud() { * @see Traj Trajectory object used for communication with the server * @see MovementSensor class abstracting SensorManager based sensors */ - private Traj.Sensor_Info.Builder createInfoBuilder(MovementSensor sensor) { - return Traj.Sensor_Info.newBuilder() + private Traj.SensorInfo.Builder createInfoBuilder(MovementSensor sensor) { + return Traj.SensorInfo.newBuilder() .setName(sensor.sensorInfo.getName()) .setVendor(sensor.sensorInfo.getVendor()) .setResolution(sensor.sensorInfo.getResolution()) @@ -1334,40 +1338,45 @@ private Traj.Sensor_Info.Builder createInfoBuilder(MovementSensor sensor) { private class storeDataInTrajectory extends TimerTask { public void run() { // Store IMU and magnetometer data in Trajectory class - trajectory.addImuData(Traj.Motion_Sample.newBuilder() + trajectory.addImuData(Traj.IMUReading.newBuilder() + .setRelativeTimestamp(SystemClock.uptimeMillis()-bootTime) + .setAcc(Traj.Vector3.newBuilder() + .setX(acceleration[0]) + .setY(acceleration[1]) + .setZ(acceleration[2]) + .build()) + .setGyr(Traj.Vector3.newBuilder() + .setX(angularVelocity[0]) + .setY(angularVelocity[1]) + .setZ(angularVelocity[2]) + .build()) + .setRotationVector(Traj.Quaternion.newBuilder() + .setX(rotation[0]) + .setY(rotation[1]) + .setZ(rotation[2]) + .setW(rotation[3]) + .build()) + .setStepCount(stepCounter) + .build()); + + trajectory.addMagnetometerData(Traj.MagnetometerReading.newBuilder() + .setMag(Traj.Vector3.newBuilder() + .setX(magneticField[0]) + .setY(magneticField[1]) + .setZ(magneticField[2]) + .build()) .setRelativeTimestamp(SystemClock.uptimeMillis()-bootTime) - .setAccX(acceleration[0]) - .setAccY(acceleration[1]) - .setAccZ(acceleration[2]) - .setGyrX(angularVelocity[0]) - .setGyrY(angularVelocity[1]) - .setGyrZ(angularVelocity[2]) - .setGyrZ(angularVelocity[2]) - .setRotationVectorX(rotation[0]) - .setRotationVectorY(rotation[1]) - .setRotationVectorZ(rotation[2]) - .setRotationVectorW(rotation[3]) - .setStepCount(stepCounter)) - .addPositionData(Traj.Position_Sample.newBuilder() - .setMagX(magneticField[0]) - .setMagY(magneticField[1]) - .setMagZ(magneticField[2]) - .setRelativeTimestamp(SystemClock.uptimeMillis()-bootTime)) -// .addGnssData(Traj.GNSS_Sample.newBuilder() -// .setLatitude(latitude) -// .setLongitude(longitude) -// .setRelativeTimestamp(SystemClock.uptimeMillis()-bootTime)) - ; + .build()); // Divide timer with a counter for storing data every 1 second if (counter == 99) { counter = 0; // Store pressure and light data if (barometerSensor.sensor != null) { - trajectory.addPressureData(Traj.Pressure_Sample.newBuilder() + trajectory.addPressureData(Traj.BarometerReading.newBuilder() .setPressure(pressure) .setRelativeTimestamp(SystemClock.uptimeMillis() - bootTime)) - .addLightData(Traj.Light_Sample.newBuilder() + .addLightData(Traj.LightReading.newBuilder() .setLight(light) .setRelativeTimestamp(SystemClock.uptimeMillis() - bootTime) .build()); @@ -1378,7 +1387,7 @@ public void run() { secondCounter = 0; //Current Wifi Object Wifi currentWifi = wifiProcessor.getCurrentWifiData(); - trajectory.addApsData(Traj.AP_Data.newBuilder() + trajectory.addApsData(Traj.WiFiAPData.newBuilder() .setMac(currentWifi.getBssid()) .setSsid(currentWifi.getSsid()) .setFrequency(currentWifi.getFrequency())); diff --git a/app/src/main/res/layout/fragment_recording.xml b/app/src/main/res/layout/fragment_recording.xml index ee41f4fd..15372615 100644 --- a/app/src/main/res/layout/fragment_recording.xml +++ b/app/src/main/res/layout/fragment_recording.xml @@ -128,7 +128,7 @@ android:id="@+id/collapseIcon" android:layout_width="24dp" android:layout_height="24dp" - android:text="▼" + android:text="▶" android:gravity="center" android:textSize="16sp" android:textColor="@color/md_theme_primary"/> @@ -143,7 +143,7 @@ android:paddingStart="12dp" android:paddingEnd="12dp" android:paddingBottom="12dp" - android:visibility="visible"> + android:visibility="gone"> + + + + + + - - - - - - - - + app:tint="@android:color/black" /> + + + app:tint="@android:color/black" /> + + diff --git a/build.gradle b/build.gradle index ff38cbe6..5bc60f64 100644 --- a/build.gradle +++ b/build.gradle @@ -3,6 +3,7 @@ buildscript { ext { agp_version = '8.7.1' + agp_version = '8.7.1' } repositories { diff --git a/secrets.properties b/secrets.properties index f0dc54fd..6c43e021 100644 --- a/secrets.properties +++ b/secrets.properties @@ -1,6 +1,9 @@ # # Modify the variables to set your keys # -MAPS_API_KEY= -OPENPOSITIONING_API_KEY= -OPENPOSITIONING_MASTER_KEY= +MAPS_API_KEY=AIzaSyAvjMvVwzGjloC-_hyQQENC0zs8xzw-6cM + +OPENPOSITIONING_API_KEY=oOqpxxPKjfS-u76oln_1Kg + +OPENPOSITIONING_MASTER_KEY=ewireless + From 919d7da7de93c81f7af1fc2e88bfee5064722fd4 Mon Sep 17 00:00:00 2001 From: sydneysavarese Date: Thu, 12 Feb 2026 15:11:55 +0000 Subject: [PATCH 19/82] added secrets.properties to gitignore --- .gitignore | 1 + 1 file changed, 1 insertion(+) diff --git a/.gitignore b/.gitignore index d4c3a57e..55e62e88 100644 --- a/.gitignore +++ b/.gitignore @@ -14,3 +14,4 @@ .cxx local.properties /.idea/ +secrets.properties From 72f4e370c47e2743ec0fa52945d5ecf90308d3c0 Mon Sep 17 00:00:00 2001 From: sydneysavarese Date: Thu, 12 Feb 2026 15:23:43 +0000 Subject: [PATCH 20/82] deleted secrets --- secrets.properties | 9 --------- 1 file changed, 9 deletions(-) delete mode 100644 secrets.properties diff --git a/secrets.properties b/secrets.properties deleted file mode 100644 index 6c43e021..00000000 --- a/secrets.properties +++ /dev/null @@ -1,9 +0,0 @@ -# -# Modify the variables to set your keys -# -MAPS_API_KEY=AIzaSyAvjMvVwzGjloC-_hyQQENC0zs8xzw-6cM - -OPENPOSITIONING_API_KEY=oOqpxxPKjfS-u76oln_1Kg - -OPENPOSITIONING_MASTER_KEY=ewireless - From e3894bb99189db03e156c7b58d679761b8f76705 Mon Sep 17 00:00:00 2001 From: Haoning Huang Date: Mon, 16 Mar 2026 00:29:45 +0000 Subject: [PATCH 21/82] feat: add WiFi RTT ranging support with rtt_enabled flag and WiFiRTTReading recording --- .../PositionMe/sensors/SensorFusion.java | 72 ++++++++++++++ .../PositionMe/sensors/WifiDataProcessor.java | 97 ++++++++++++++++++- 2 files changed, 168 insertions(+), 1 deletion(-) diff --git a/app/src/main/java/com/openpositioning/PositionMe/sensors/SensorFusion.java b/app/src/main/java/com/openpositioning/PositionMe/sensors/SensorFusion.java index 9a2ee5f1..03f9b003 100644 --- a/app/src/main/java/com/openpositioning/PositionMe/sensors/SensorFusion.java +++ b/app/src/main/java/com/openpositioning/PositionMe/sensors/SensorFusion.java @@ -14,8 +14,12 @@ import android.util.Log; import androidx.annotation.NonNull; +import androidx.annotation.RequiresApi; import androidx.preference.PreferenceManager; +import android.net.wifi.ScanResult; +import android.net.wifi.rtt.RangingResult; + import com.google.android.gms.maps.model.LatLng; import com.openpositioning.PositionMe.presentation.activity.MainActivity; import com.openpositioning.PositionMe.utils.PathView; @@ -315,6 +319,13 @@ public void setContext(Context context) { this.wifiProcessor = new WifiDataProcessor(context); wifiProcessor.registerObserver(this); + // Register RTT result listener to receive ranging data from WiFi RTT + wifiProcessor.setRttResultListener((results, associatedScans) -> { + if (saveRecording) { + recordRttResults(results, associatedScans); + } + }); + this.bleProcessor = new BleDataProcessor(context); bleProcessor.registerObserver(this); this.gnssProcessor = new GNSSDataProcessor(context, locationListener); @@ -612,6 +623,67 @@ private void updateWifiData(Object[] wifiList) { } + /** + * Records WiFi RTT ranging results and AP metadata into the trajectory protobuf. + * Called by the RttResultListener when new ranging results arrive. + * + * WiFiAPData stores per-AP metadata including the rtt_enabled flag. + * WiFiRTTReading stores the actual measured distance for each RTT-capable AP. + * + * @param results List of RTT ranging results from WifiRttManager + * @param associatedScans List of ScanResults corresponding to the ranging request + */ + private void recordRttResults(List results, + List associatedScans) { + long relativeTimestamp = SystemClock.uptimeMillis() - bootTime; + + for (RangingResult result : results) { + // Convert MAC address to long integer (same format as BSSID elsewhere) + String macString = result.getMacAddress().toString(); + long macLong = bssidStringToLong(macString); + + // Record AP metadata with rtt_enabled = true (these are RTT-capable APs) + Traj.WiFiAPData apData = Traj.WiFiAPData.newBuilder() + .setMac(macLong) + .setRttEnabled(true) + .build(); + this.trajectory.addApsData(apData); + + // Only record distance measurement if ranging succeeded + if (result.getStatus() == RangingResult.STATUS_SUCCESS) { + Traj.WiFiRTTReading rttReading = Traj.WiFiRTTReading.newBuilder() + .setRelativeTimestamp(relativeTimestamp) + .setMac(macLong) + .setDistance(result.getDistanceMm()) // distance in mm + .setDistanceStd(result.getDistanceStdDevMm()) // std deviation in mm + .setRssi(result.getRssi()) + .build(); + this.trajectory.addWifiRttData(rttReading); + Log.i("SensorFusion", "RTT result: mac=" + macString + + " dist=" + result.getDistanceMm() + "mm"); + } else { + Log.d("SensorFusion", "RTT ranging failed for AP: " + macString + + " status=" + result.getStatus()); + } + } + } + + /** + * Converts a MAC address string (e.g. "aa:bb:cc:dd:ee:ff") to a long integer. + * Replicates the same conversion logic used for WiFi BSSID in WifiDataProcessor. + * + * @param mac MAC address string with colon separators + * @return Long integer representation of the MAC address + */ + private long bssidStringToLong(String mac) { + try { + return Long.parseLong(mac.replace(":", ""), 16); + } catch (NumberFormatException e) { + Log.w("SensorFusion", "Failed to convert MAC: " + mac); + return 0L; + } + } + // BLE update logic /** * Update BLE data with deduplication diff --git a/app/src/main/java/com/openpositioning/PositionMe/sensors/WifiDataProcessor.java b/app/src/main/java/com/openpositioning/PositionMe/sensors/WifiDataProcessor.java index f24cfd83..447cfb12 100644 --- a/app/src/main/java/com/openpositioning/PositionMe/sensors/WifiDataProcessor.java +++ b/app/src/main/java/com/openpositioning/PositionMe/sensors/WifiDataProcessor.java @@ -11,6 +11,14 @@ import android.net.NetworkInfo; import android.net.wifi.ScanResult; import android.net.wifi.WifiManager; +import android.net.wifi.rtt.RangingRequest; +import android.net.wifi.rtt.RangingResult; +import android.net.wifi.rtt.RangingResultCallback; +import android.net.wifi.rtt.WifiRttManager; +import android.annotation.SuppressLint; +import androidx.annotation.RequiresApi; +import android.os.Build; +import java.util.concurrent.Executor; import android.provider.Settings; import android.widget.Toast; @@ -49,6 +57,18 @@ public class WifiDataProcessor implements Observable { // Locations manager to enable access to Wifi data via the android system private final WifiManager wifiManager; + // WiFi RTT manager for distance measurement (API 28+) + private final WifiRttManager wifiRttManager; + + // Listener to deliver RTT results back to SensorFusion + private RttResultListener rttResultListener; + + // Interface for RTT result callbacks + public interface RttResultListener { + void onRttResults(List results, List associatedScans); + } + + //List of nearby networks private Wifi[] wifiData; @@ -84,11 +104,24 @@ public WifiDataProcessor(Context context) { this.context = context.getApplicationContext(); this.wifiManager = (WifiManager) this.context.getSystemService(Context.WIFI_SERVICE); + this.wifiRttManager = (WifiRttManager) this.context.getSystemService(Context.WIFI_RTT_RANGING_SERVICE); this.scanWifiDataTimer = new Timer(); this.observers = new ArrayList<>(); this.wifiData = new Wifi[0]; } + /** + * Set the listener that will receive WiFi RTT ranging results. + * Called by SensorFusion to receive RTT data for trajectory recording. + * + * @param listener Callback to receive RTT results + */ + @RequiresApi(api = Build.VERSION_CODES.P) + public void setRttResultListener(RttResultListener listener) { + this.rttResultListener = listener; + } + + @SuppressLint("MissingPermission") public void startListening() { if (!checkWifiPermissions()) { @@ -132,6 +165,9 @@ private void processScanResults(List wifiScanList) { Log.d("WifiDataProcessor", "Processed scan results, BSSIDs=" + lastObservedBssids.size()); + // Attempt RTT ranging for APs that support it + performRttRanging(wifiScanList); + notifyObservers(0); } @@ -306,6 +342,64 @@ public void checkWifiThrottling(){ } } + + /** + * Checks which APs in the scan list support WiFi RTT (802.11mc), + * then initiates a ranging request for those APs. + * Results are delivered asynchronously via RttResultListener. + * Requires Android API 28+ and CHANGE_WIFI_STATE permission. + * + * @param scanResults The current list of scanned WiFi access points + */ + @RequiresApi(api = Build.VERSION_CODES.P) + @SuppressLint("MissingPermission") + private void performRttRanging(List scanResults) { + // RTT requires Android P (API 28) or higher + if (Build.VERSION.SDK_INT < Build.VERSION_CODES.P) { + return; + } + // Check device supports RTT + if (wifiRttManager == null || !wifiRttManager.isAvailable()) { + Log.d("WifiDataProcessor", "WiFi RTT not available on this device"); + return; + } + // Filter to APs that advertise 802.11mc support + List rttCapableAps = new ArrayList<>(); + for (ScanResult result : scanResults) { + if (result.is80211mcResponder()) { + rttCapableAps.add(result); + } + } + if (rttCapableAps.isEmpty()) { + Log.d("WifiDataProcessor", "No RTT-capable APs found in scan"); + return; + } + Log.d("WifiDataProcessor", "Starting RTT ranging for " + rttCapableAps.size() + " APs"); + // Build ranging request for all RTT-capable APs + RangingRequest request = new RangingRequest.Builder() + .addAccessPoints(rttCapableAps) + .build(); + // Store reference for use inside callback + final List scansForCallback = rttCapableAps; + // Execute ranging on main thread executor + Executor executor = context.getMainExecutor(); + wifiRttManager.startRanging(request, executor, new RangingResultCallback() { + @Override + public void onRangingFailure(int code) { + Log.w("WifiDataProcessor", "RTT ranging failed, code=" + code); + } + @Override + public void onRangingResults(List results) { + Log.d("WifiDataProcessor", "RTT ranging results received: " + results.size()); + // Deliver results to SensorFusion via listener + if (rttResultListener != null) { + rttResultListener.onRttResults(results, scansForCallback); + } + } + }); + } + + /** * Implement default method from Observable Interface to add new observers to the class. * @@ -335,6 +429,7 @@ public void notifyObservers(int idx) { * calling wifi scans every 5 seconds. */ private class scheduledWifiScan extends TimerTask { + @SuppressLint("MissingPermission") @Override public void run() { @@ -344,7 +439,7 @@ public void run() { List cached = wifiManager.getScanResults(); processScanResults(cached); - // Best-effort request a new scan (may be throttled) + // Best-effort request a new scan (maybe throttled) boolean ok = wifiManager.startScan(); Log.d("WifiDataProcessor", "startScan() returned=" + ok); } From 10c9bb5244544823e9b661aebfd420a2c10402d4 Mon Sep 17 00:00:00 2001 From: Haoning Huang Date: Mon, 16 Mar 2026 15:40:54 +0000 Subject: [PATCH 22/82] feat: add particle filter positioning fusion and coordinate converter --- .../PositionMe/sensors/ParticleFilter.java | 219 ++++++++++++++++++ .../PositionMe/sensors/SensorFusion.java | 74 +++++- .../PositionMe/utils/CoordinateConverter.java | 65 ++++++ 3 files changed, 354 insertions(+), 4 deletions(-) create mode 100644 app/src/main/java/com/openpositioning/PositionMe/sensors/ParticleFilter.java create mode 100644 app/src/main/java/com/openpositioning/PositionMe/utils/CoordinateConverter.java diff --git a/app/src/main/java/com/openpositioning/PositionMe/sensors/ParticleFilter.java b/app/src/main/java/com/openpositioning/PositionMe/sensors/ParticleFilter.java new file mode 100644 index 00000000..417d037c --- /dev/null +++ b/app/src/main/java/com/openpositioning/PositionMe/sensors/ParticleFilter.java @@ -0,0 +1,219 @@ +package com.openpositioning.PositionMe.sensors; + +import android.util.Log; +import java.util.Random; + +/** + * The filter maintains a set of NUM_PARTICLES weighted hypotheses (particles) that each + * represent a possible user position in the local East-North coordinate frame (metres East and + * North from a reference point set. + * + * Three-step cycle: + * 1. predict() — move every particle using the PDR displacement + Gaussian noise + * 2. updateWithGnss() — reweight particles by distance to the GNSS observation + * updateWithWifi() — reweight particles by distance to the WiFi observation + * 3. resample() — called inside each update step + * + * @author Haoning Huang + */ +public class ParticleFilter { + + private static final String TAG = "ParticleFilter"; + + /** Number of particles.*/ + private static final int NUM_PARTICLES = 300; + + /** + * Standard deviation of Gaussian noise added to each particle during the predict step (metres). + * Represents uncertainty in PDR step length / heading. + */ + private static final float MOTION_NOISE_STD = 0.3f; + + /** + * Standard deviation of the GNSS observation model (metres). + * Reflects typical outdoor GNSS horizontal accuracy. + */ + private static final float GNSS_NOISE_STD = 5.0f; + + /** + * Standard deviation of the WiFi observation model (metres). + * WiFi fingerprinting is less accurate than GNSS, so a larger value is used. + */ + private static final float WIFI_NOISE_STD = 15.0f; + + /** East coordinate of each particle in East-North metres */ + private float[] particlesX; + + /** North coordinate of each particle in East-North metres */ + private float[] particlesY; + + /** Normalised importance weight of each particle (sum = 1) */ + private float[] weights; + + private final Random random = new Random(); + + private boolean initialized = false; + + /** Default constructor — allocates arrays but does not initialise positions. */ + public ParticleFilter() { + particlesX = new float[NUM_PARTICLES]; + particlesY = new float[NUM_PARTICLES]; + weights = new float[NUM_PARTICLES]; + } + + /** + * Spreads all particles as a Gaussian cloud centred on the given East-North position. + * + * @param initX Initial East position in East-North metres + * @param initY Initial North position in East-North metres + * @param uncertainty Spread radius + */ + public void initParticles(float initX, float initY, float uncertainty) { + for (int i = 0; i < NUM_PARTICLES; i++) { + particlesX[i] = initX + (float) (random.nextGaussian() * uncertainty); + particlesY[i] = initY + (float) (random.nextGaussian() * uncertainty); + weights[i] = 1.0f / NUM_PARTICLES; + } + initialized = true; + Log.i(TAG, "Initialised " + NUM_PARTICLES + " particles at (" + + initX + ", " + initY + ") ± " + uncertainty + " m"); + } + + /** + * Prediction step: translates every particle by the PDR displacement and + * adds Gaussian noise to model uncertainty in step length and heading. + * + * @param dx PDR displacement in East direction (metres) since last call + * @param dy PDR displacement in North direction (metres) since last call + */ + public void predict(float dx, float dy) { + if (!initialized) return; + for (int i = 0; i < NUM_PARTICLES; i++) { + particlesX[i] += dx + (float) (random.nextGaussian() * MOTION_NOISE_STD); + particlesY[i] += dy + (float) (random.nextGaussian() * MOTION_NOISE_STD); + } + } + + /** + * Update step using a GNSS position observation. + * Reweights particles by a Gaussian likelihood centred on the measurement. + * Resamples to remove low-weight particles. + * + * @param measX Observed East position in East-North metres (converted from WGS84) + * @param measY Observed North position in East-North metres (converted from WGS84) + */ + public void updateWithGnss(float measX, float measY) { + if (!initialized) return; + updateWeights(measX, measY, GNSS_NOISE_STD); + resample(); + Log.d(TAG, "GNSS update applied. Best estimate: " + java.util.Arrays.toString(getBestEstimate())); + } + + /** + * Update step using a WiFi positioning observation. + * + * @param measX Observed East position in East-North metres + * @param measY Observed North position in East-North metres + */ + public void updateWithWifi(float measX, float measY) { + if (!initialized) return; + updateWeights(measX, measY, WIFI_NOISE_STD); + resample(); + Log.d(TAG, "WiFi update applied. Best estimate: " + java.util.Arrays.toString(getBestEstimate())); + } + + /** + * Returns the current best position estimate as the weighted mean of all particles. + * + * @return float array {east, north} in East-North metres. + */ + public float[] getBestEstimate() { + if (!initialized) return new float[]{0f, 0f}; + float x = 0f, y = 0f; + for (int i = 0; i < NUM_PARTICLES; i++) { + x += weights[i] * particlesX[i]; + y += weights[i] * particlesY[i]; + } + return new float[]{x, y}; + } + + public boolean isInitialized() { + return initialized; + } + + /** + * Multiplies each particle's weight by the Gaussian likelihood of the given observation. + * Normalizes the weight array, sum = 1. + * + * Likelihood: w_i *= exp( -distance^2 / (2 * std^2) ) + * + * If all weights collapse to zero, weights are reset to uniform to allow recovery. + * + * @param measX Observed East position (East-North metres) + * @param measY Observed North position (East-North metres) + * @param noiseStd Standard deviation of the observation model (metres) + */ + private void updateWeights(float measX, float measY, float noiseStd) { + float totalWeight = 0f; + float twoSigmaSq = 2.0f * noiseStd * noiseStd; + + for (int i = 0; i < NUM_PARTICLES; i++) { + float dx = particlesX[i] - measX; + float dy = particlesY[i] - measY; + float distSq = dx * dx + dy * dy; + weights[i] *= (float) Math.exp(-distSq / twoSigmaSq); + totalWeight += weights[i]; + } + + // Normalise + if (totalWeight > 1e-10f) { + for (int i = 0; i < NUM_PARTICLES; i++) { + weights[i] /= totalWeight; + } + } else { + // Weight collapse: reset to uniform so the filter can recover + Log.w(TAG, "Weight collapse detected — resetting to uniform weights"); + float uniform = 1.0f / NUM_PARTICLES; + for (int i = 0; i < NUM_PARTICLES; i++) { + weights[i] = uniform; + } + } + } + + /** + * Resampling: draws new particles from the current weighted distribution, then resets weights to uniform. + */ + private void resample() { + float[] newX = new float[NUM_PARTICLES]; + float[] newY = new float[NUM_PARTICLES]; + + // Build cumulative weight array + float[] cdf = new float[NUM_PARTICLES]; + cdf[0] = weights[0]; + for (int i = 1; i < NUM_PARTICLES; i++) { + cdf[i] = cdf[i - 1] + weights[i]; + } + + // evenly spaced starting point + float step = 1.0f / NUM_PARTICLES; + float u = random.nextFloat() * step; // random offset in [0, step) + int j = 0; + + for (int i = 0; i < NUM_PARTICLES; i++) { + while (j < NUM_PARTICLES - 1 && u > cdf[j]) { + j++; + } + newX[i] = particlesX[j]; + newY[i] = particlesY[j]; + u += step; + } + + // Replace old particles and reset to uniform weights + particlesX = newX; + particlesY = newY; + float uniform = 1.0f / NUM_PARTICLES; + for (int i = 0; i < NUM_PARTICLES; i++) { + weights[i] = uniform; + } + } +} diff --git a/app/src/main/java/com/openpositioning/PositionMe/sensors/SensorFusion.java b/app/src/main/java/com/openpositioning/PositionMe/sensors/SensorFusion.java index 03f9b003..464ea9f9 100644 --- a/app/src/main/java/com/openpositioning/PositionMe/sensors/SensorFusion.java +++ b/app/src/main/java/com/openpositioning/PositionMe/sensors/SensorFusion.java @@ -40,10 +40,10 @@ import java.util.stream.Collectors; import java.util.stream.Stream; -import java.util.ArrayList; -import java.util.List; import com.openpositioning.PositionMe.sensors.model.TestPoint; +import com.openpositioning.PositionMe.sensors.ParticleFilter; +import com.openpositioning.PositionMe.utils.CoordinateConverter; /** * The SensorFusion class is the main data gathering and processing class of the application. @@ -189,6 +189,16 @@ public class SensorFusion implements SensorEventListener, Observer { // WiFi positioning object private WiFiPositioning wiFiPositioning; + // Particle filter for sensor fusion positioning + private ParticleFilter particleFilter; + + // Coordinate converter for WGS84 ↔ East-North transformation + private CoordinateConverter coordinateConverter; + + // Previous PDR cumulative position, used to compute per-step displacement + private float prevPdrX = 0f; + private float prevPdrY = 0f; + private final List testPoints = new ArrayList<>(); @@ -340,6 +350,7 @@ public void setContext(Context context) { // Other initialisations... this.accelMagnitude = new ArrayList<>(); this.pdrProcessing = new PdrProcessing(context); + this.particleFilter = new ParticleFilter(); this.settings = PreferenceManager.getDefaultSharedPreferences(context); this.pathView = new PathView(context, null); this.wiFiPositioning = new WiFiPositioning(context); @@ -495,6 +506,15 @@ public void onSensorChanged(SensorEvent sensorEvent) { this.orientation[0] ); + // Feed PDR displacement to particle filter + if (particleFilter.isInitialized()) { + float dx = newCords[0] - prevPdrX; + float dy = newCords[1] - prevPdrY; + particleFilter.predict(dx, dy); + prevPdrX = newCords[0]; + prevPdrY = newCords[1]; + } + // Clear the accelMagnitude after using it this.accelMagnitude.clear(); @@ -541,6 +561,24 @@ public void onLocationChanged(@NonNull Location location) { float accuracy = (float) location.getAccuracy(); float speed = (float) location.getSpeed(); String provider = location.getProvider(); + // Initialize coordinate converter and particle filter on first GNSS fix during recording + if (saveRecording) { + if (!particleFilter.isInitialized()) { + // First fix: set East-North origin, spread particles around (0,0) + coordinateConverter = new CoordinateConverter( + location.getLatitude(), location.getLongitude()); + particleFilter.initParticles(0f, 0f, Math.max(accuracy, 5f)); + prevPdrX = 0f; + prevPdrY = 0f; + Log.i("SensorFusion", "ParticleFilter initialised at lat=" + + latitude + " lon=" + longitude); + } else { + // Subsequent fixes: convert to East-North space and update particle weights + float[] enu = coordinateConverter.toEnu( + location.getLatitude(), location.getLongitude()); + particleFilter.updateWithGnss(enu[0], enu[1]); + } + } if(saveRecording) { trajectory.addGnssData(Traj.GNSSReading.newBuilder() .setPosition(Traj.GNSSPosition.newBuilder() @@ -616,7 +654,7 @@ private void updateWifiData(Object[] wifiList) { } - createWifiPositioningRequest(); + createWifiPositionRequestCallback(); Log.d("SensorFusion", "wifiList length = " + (wifiList == null ? 0 : wifiList.length)); @@ -911,9 +949,16 @@ private void createWifiPositionRequestCallback(){ this.wiFiPositioning.request(wifiFingerPrint, new WiFiPositioning.VolleyCallback() { @Override public void onSuccess(LatLng wifiLocation, int floor) { - // Handle the success response + // Update particle filter with WiFi position observation + if (saveRecording && particleFilter.isInitialized() + && coordinateConverter != null) { + float[] enu = coordinateConverter.toEnu( + wifiLocation.latitude, wifiLocation.longitude); + particleFilter.updateWithWifi(enu[0], enu[1]); + } } + @Override public void onError(String message) { // Handle the error response @@ -934,6 +979,22 @@ public void onError(String message) { */ public LatLng getLatLngWifiPositioning(){return this.wiFiPositioning.getWifiLocation();} + /** + * Returns the particle filter's best estimated position in WGS84 coordinates. + * Used by the map display fragment to show the fused position marker. + * + * @return double[]{latitude, longitude}, or null(if filter is not initialized) + */ + public double[] getFusedLatLon() { + if (particleFilter != null && particleFilter.isInitialized() + && coordinateConverter != null) { + float[] enu = particleFilter.getBestEstimate(); + return coordinateConverter.toLatLon(enu[0], enu[1]); + } + return null; + } + + /** * Method to get current floor the user is at, obtained using WiFiPositioning * @see WiFiPositioning for WiFi positioning @@ -1338,6 +1399,11 @@ public void startRecording() { this.storeTrajectoryTimer = new Timer(); this.storeTrajectoryTimer.schedule(new storeDataInTrajectory(), 0, TIME_CONST); this.pdrProcessing.resetPDR(); + // Reset particle filter state for new recording session + particleFilter = new ParticleFilter(); + coordinateConverter = null; + prevPdrX = 0f; + prevPdrY = 0f; if(settings.getBoolean("overwrite_constants", false)) { this.filter_coefficient = Float.parseFloat(settings.getString("accel_filter", "0.96")); } else { diff --git a/app/src/main/java/com/openpositioning/PositionMe/utils/CoordinateConverter.java b/app/src/main/java/com/openpositioning/PositionMe/utils/CoordinateConverter.java new file mode 100644 index 00000000..afc7dd90 --- /dev/null +++ b/app/src/main/java/com/openpositioning/PositionMe/utils/CoordinateConverter.java @@ -0,0 +1,65 @@ +package com.openpositioning.PositionMe.utils; + +/** + * Converts between WGS84 geographic coordinates (latitude/longitude) and local + * East-North Cartesian coordinates in metres. + * + * A reference point (East-North origin) should be set via the constructor before any + * conversion can be performed. This origin is the first reliable GNSS at the start of a recording session. + * + * @author Haoning Huang + */ +public class CoordinateConverter { + + // Number of metres corresponding to one degree of latitude (constant at all latitudes) + private static final double METRES_PER_DEGREE = 111320.0; + + // Reference point stored in degrees and radians + private final double refLat; // reference latitude in degrees + private final double refLon; // reference longitude in degrees + private final double cosRefLat; // cos(refLat) precomputed to avoid repeated calls + + /** + * Constructs a converter with the given WGS84 reference point as the East-North origin. + * + * @param refLat Reference latitude in decimal degrees + * @param refLon Reference longitude in decimal degrees + */ + public CoordinateConverter(double refLat, double refLon) { + this.refLat = refLat; + this.refLon = refLon; + this.cosRefLat = Math.cos(Math.toRadians(refLat)); + } + + /** + * Converts a WGS84 position to local East-North coordinates in metres. + * + * @param lat Latitude of the point to convert, in decimal degrees + * @param lon Longitude of the point to convert, in decimal degrees + * @return float array {east, north} in metres relative to the reference point + */ + public float[] toEnu(double lat, double lon) { + float north = (float) ((lat - refLat) * METRES_PER_DEGREE); + float east = (float) ((lon - refLon) * METRES_PER_DEGREE * cosRefLat); + return new float[]{east, north}; + } + + /** + * Converts a local East-North position back to WGS84 latitude and longitude. + * + * @param east East displacement in metres from the reference point + * @param north North displacement in metres from the reference point + * @return double array {latitude, longitude} in decimal degrees + */ + public double[] toLatLon(float east, float north) { + double lat = refLat + north / METRES_PER_DEGREE; + double lon = refLon + east / (METRES_PER_DEGREE * cosRefLat); + return new double[]{lat, lon}; + } + + /** @return Reference latitude in decimal degrees */ + public double getRefLat() { return refLat; } + + /** @return Reference longitude in decimal degrees */ + public double getRefLon() { return refLon; } +} From c70a0365118769846409d52e96da3571d14d02c6 Mon Sep 17 00:00:00 2001 From: Haoning Huang Date: Mon, 16 Mar 2026 16:26:38 +0000 Subject: [PATCH 23/82] feat: expose per-source raw positions for colour-coded display Add lastGnssLatLon, lastWifiLatLon, lastPdrLatLon fields and getters so Data Display can show colour-coded dots for GNSS, WiFi and PDR. Fix lastPdrLatLon off-by-one-step bug. Null all three on reset. --- .../PositionMe/sensors/SensorFusion.java | 28 +++++++++++++++++++ 1 file changed, 28 insertions(+) diff --git a/app/src/main/java/com/openpositioning/PositionMe/sensors/SensorFusion.java b/app/src/main/java/com/openpositioning/PositionMe/sensors/SensorFusion.java index 464ea9f9..f467f39d 100644 --- a/app/src/main/java/com/openpositioning/PositionMe/sensors/SensorFusion.java +++ b/app/src/main/java/com/openpositioning/PositionMe/sensors/SensorFusion.java @@ -199,6 +199,11 @@ public class SensorFusion implements SensorEventListener, Observer { private float prevPdrX = 0f; private float prevPdrY = 0f; + // Last raw position from each individual source, for colour-coded display + private double[] lastGnssLatLon = null; // {lat, lon} + private double[] lastWifiLatLon = null; // {lat, lon} + private double[] lastPdrLatLon = null; // {lat, lon} + private final List testPoints = new ArrayList<>(); @@ -513,6 +518,9 @@ public void onSensorChanged(SensorEvent sensorEvent) { particleFilter.predict(dx, dy); prevPdrX = newCords[0]; prevPdrY = newCords[1]; + if (coordinateConverter != null) { + lastPdrLatLon = coordinateConverter.toLatLon(prevPdrX, prevPdrY); + } } // Clear the accelMagnitude after using it @@ -577,6 +585,7 @@ public void onLocationChanged(@NonNull Location location) { float[] enu = coordinateConverter.toEnu( location.getLatitude(), location.getLongitude()); particleFilter.updateWithGnss(enu[0], enu[1]); + lastGnssLatLon = new double[]{location.getLatitude(), location.getLongitude()}; } } if(saveRecording) { @@ -955,6 +964,7 @@ public void onSuccess(LatLng wifiLocation, int floor) { float[] enu = coordinateConverter.toEnu( wifiLocation.latitude, wifiLocation.longitude); particleFilter.updateWithWifi(enu[0], enu[1]); + lastWifiLatLon = new double[]{wifiLocation.latitude, wifiLocation.longitude}; } } @@ -994,6 +1004,21 @@ public double[] getFusedLatLon() { return null; } + /** Last raw GNSS fix. Returns null before first GPS signal. */ + public double[] getLastGnssLatLon() { + return lastGnssLatLon; + } + + /** Last raw WiFi positioning fix. Returns null before first WiFi scan result. */ + public double[] getLastWifiLatLon() { + return lastWifiLatLon; + } + + /** Last PDR-derived position as lat/lon. Returns null before first step is detected. */ + public double[] getLastPdrLatLon() { + return lastPdrLatLon; + } + /** * Method to get current floor the user is at, obtained using WiFiPositioning @@ -1402,6 +1427,9 @@ public void startRecording() { // Reset particle filter state for new recording session particleFilter = new ParticleFilter(); coordinateConverter = null; + lastGnssLatLon = null; + lastWifiLatLon = null; + lastPdrLatLon = null; prevPdrX = 0f; prevPdrY = 0f; if(settings.getBoolean("overwrite_constants", false)) { From 171fd78506381b4c4041c678ec7474f8ef608a91 Mon Sep 17 00:00:00 2001 From: Haoning Huang Date: Mon, 16 Mar 2026 18:32:13 +0000 Subject: [PATCH 24/82] feat: add uncertainty metric, adaptive noise, and WiFi cold-start bootstrap \ 1.expose getSigmaMetres() and getPositionUncertainty() for UI confidence circle \ 2.reduce motion noise when stationary to prevent particle drift \ 3.initialise particle filter from first WiFi position if GNSS unavailable --- .../PositionMe/sensors/ParticleFilter.java | 29 +++++++++++++- .../PositionMe/sensors/SensorFusion.java | 39 ++++++++++++++----- 2 files changed, 57 insertions(+), 11 deletions(-) diff --git a/app/src/main/java/com/openpositioning/PositionMe/sensors/ParticleFilter.java b/app/src/main/java/com/openpositioning/PositionMe/sensors/ParticleFilter.java index 417d037c..0f93e31f 100644 --- a/app/src/main/java/com/openpositioning/PositionMe/sensors/ParticleFilter.java +++ b/app/src/main/java/com/openpositioning/PositionMe/sensors/ParticleFilter.java @@ -83,17 +83,22 @@ public void initParticles(float initX, float initY, float uncertainty) { * Prediction step: translates every particle by the PDR displacement and * adds Gaussian noise to model uncertainty in step length and heading. * + * When the device is stationary, using a reduced noise to lower the drifting of particle cloud. + * * @param dx PDR displacement in East direction (metres) since last call * @param dy PDR displacement in North direction (metres) since last call */ public void predict(float dx, float dy) { if (!initialized) return; + float movementMagnitude = (float) Math.sqrt(dx * dx + dy * dy); + float noise = (movementMagnitude < 0.05f) ? MOTION_NOISE_STD * 0.1f : MOTION_NOISE_STD; for (int i = 0; i < NUM_PARTICLES; i++) { - particlesX[i] += dx + (float) (random.nextGaussian() * MOTION_NOISE_STD); - particlesY[i] += dy + (float) (random.nextGaussian() * MOTION_NOISE_STD); + particlesX[i] += dx + (float) (random.nextGaussian() * noise); + particlesY[i] += dy + (float) (random.nextGaussian() * noise); } } + /** * Update step using a GNSS position observation. * Reweights particles by a Gaussian likelihood centred on the measurement. @@ -137,6 +142,26 @@ public float[] getBestEstimate() { return new float[]{x, y}; } + /** + * Returns the spread of the particle cloud as a single scalar (metres). + * Computed as the RMS of the weighted standard deviations in East and North. + * A larger value means more uncertain. + * + * @return spread radius in metres (if not initialized,return -1). + */ + public double getSigmaMetres() { + if (!initialized) return -1.0; + float[] mean = getBestEstimate(); + double varX = 0.0, varY = 0.0; + for (int i = 0; i < NUM_PARTICLES; i++) { + double dx = particlesX[i] - mean[0]; + double dy = particlesY[i] - mean[1]; + varX += weights[i] * dx * dx; + varY += weights[i] * dy * dy; + } + return Math.sqrt(varX + varY); + } + public boolean isInitialized() { return initialized; } diff --git a/app/src/main/java/com/openpositioning/PositionMe/sensors/SensorFusion.java b/app/src/main/java/com/openpositioning/PositionMe/sensors/SensorFusion.java index f467f39d..5d9c81d0 100644 --- a/app/src/main/java/com/openpositioning/PositionMe/sensors/SensorFusion.java +++ b/app/src/main/java/com/openpositioning/PositionMe/sensors/SensorFusion.java @@ -569,10 +569,10 @@ public void onLocationChanged(@NonNull Location location) { float accuracy = (float) location.getAccuracy(); float speed = (float) location.getSpeed(); String provider = location.getProvider(); - // Initialize coordinate converter and particle filter on first GNSS fix during recording + // Initialize coordinate converter and particle filter on first GNSS position during recording if (saveRecording) { if (!particleFilter.isInitialized()) { - // First fix: set East-North origin, spread particles around (0,0) + // First position: set East-North origin, spread particles around (0,0) coordinateConverter = new CoordinateConverter( location.getLatitude(), location.getLongitude()); particleFilter.initParticles(0f, 0f, Math.max(accuracy, 5f)); @@ -581,7 +581,7 @@ public void onLocationChanged(@NonNull Location location) { Log.i("SensorFusion", "ParticleFilter initialised at lat=" + latitude + " lon=" + longitude); } else { - // Subsequent fixes: convert to East-North space and update particle weights + // Subsequent positions: convert to East-North space and update particle weights float[] enu = coordinateConverter.toEnu( location.getLatitude(), location.getLongitude()); particleFilter.updateWithGnss(enu[0], enu[1]); @@ -958,13 +958,23 @@ private void createWifiPositionRequestCallback(){ this.wiFiPositioning.request(wifiFingerPrint, new WiFiPositioning.VolleyCallback() { @Override public void onSuccess(LatLng wifiLocation, int floor) { - // Update particle filter with WiFi position observation - if (saveRecording && particleFilter.isInitialized() - && coordinateConverter != null) { + lastWifiLatLon = new double[]{wifiLocation.latitude, wifiLocation.longitude}; + if (!saveRecording) return; + + if (!particleFilter.isInitialized()) { + // if GNSS not available — launch with first WiFi position + coordinateConverter = new CoordinateConverter( + wifiLocation.latitude, wifiLocation.longitude); + particleFilter.initParticles(0f, 0f, 20f); + prevPdrX = 0f; + prevPdrY = 0f; + Log.i("SensorFusion", "ParticleFilter launch with WiFi at lat=" + + wifiLocation.latitude + " lon=" + wifiLocation.longitude); + } else { + // Normal update float[] enu = coordinateConverter.toEnu( wifiLocation.latitude, wifiLocation.longitude); particleFilter.updateWithWifi(enu[0], enu[1]); - lastWifiLatLon = new double[]{wifiLocation.latitude, wifiLocation.longitude}; } } @@ -1004,12 +1014,12 @@ public double[] getFusedLatLon() { return null; } - /** Last raw GNSS fix. Returns null before first GPS signal. */ + /** Last raw GNSS position. Returns null before first GPS signal. */ public double[] getLastGnssLatLon() { return lastGnssLatLon; } - /** Last raw WiFi positioning fix. Returns null before first WiFi scan result. */ + /** Last raw WiFi position. Returns null before first WiFi scan result. */ public double[] getLastWifiLatLon() { return lastWifiLatLon; } @@ -1019,6 +1029,17 @@ public double[] getLastPdrLatLon() { return lastPdrLatLon; } + /** + * Returns the spread of the particle cloud in metres. + * Use this to draw an uncertainty circle around the fused position marker. + * + * @return RMS particle spread in metres. + */ + public double getPositionUncertainty() { + if (particleFilter == null) return -1.0; + return particleFilter.getSigmaMetres(); + } + /** * Method to get current floor the user is at, obtained using WiFiPositioning From 421e8b023ceafbcda38356f7fef76ce1247f940f Mon Sep 17 00:00:00 2001 From: Haoning Huang Date: Tue, 17 Mar 2026 22:47:40 +0000 Subject: [PATCH 25/82] feat: expose particle cloud via getParticles() for map matching integration --- .../PositionMe/sensors/ParticleFilter.java | 18 ++++++++++++++++++ .../PositionMe/sensors/SensorFusion.java | 12 ++++++++++++ 2 files changed, 30 insertions(+) diff --git a/app/src/main/java/com/openpositioning/PositionMe/sensors/ParticleFilter.java b/app/src/main/java/com/openpositioning/PositionMe/sensors/ParticleFilter.java index 0f93e31f..974e148f 100644 --- a/app/src/main/java/com/openpositioning/PositionMe/sensors/ParticleFilter.java +++ b/app/src/main/java/com/openpositioning/PositionMe/sensors/ParticleFilter.java @@ -162,6 +162,24 @@ public double getSigmaMetres() { return Math.sqrt(varX + varY); } + /** + * Returns a copy of all particle positions in local East-North coordinates (metres). + * Each row is one particle: {east, north}. + * Used for map matching wall-constraint filter. + * + * @return float[NUM_PARTICLES][2] array, or empty array if not initialized. + */ + public float[][] getParticles() { + if (!initialized) return new float[0][2]; + float[][] result = new float[NUM_PARTICLES][2]; + for (int i = 0; i < NUM_PARTICLES; i++) { + result[i][0] = particlesX[i]; + result[i][1] = particlesY[i]; + } + return result; + } + + public boolean isInitialized() { return initialized; } diff --git a/app/src/main/java/com/openpositioning/PositionMe/sensors/SensorFusion.java b/app/src/main/java/com/openpositioning/PositionMe/sensors/SensorFusion.java index 5d9c81d0..b1e7b5ec 100644 --- a/app/src/main/java/com/openpositioning/PositionMe/sensors/SensorFusion.java +++ b/app/src/main/java/com/openpositioning/PositionMe/sensors/SensorFusion.java @@ -1040,6 +1040,18 @@ public double getPositionUncertainty() { return particleFilter.getSigmaMetres(); } + /** + * Returns a copy of all particle positions in local East-North metres. + * + * Used for map matching wall-constraint filter. + * + * @return float[300][2] particle array, or float[0][2] if uninitialised. + */ + public float[][] getParticles() { + if (particleFilter == null) return new float[0][2]; + return particleFilter.getParticles(); + } + /** * Method to get current floor the user is at, obtained using WiFiPositioning From 326c794e16dde4691e73e96abf462941ccf38fc7 Mon Sep 17 00:00:00 2001 From: Haoning Huang Date: Tue, 17 Mar 2026 23:03:29 +0000 Subject: [PATCH 26/82] feat: floor-aware particle reset on floor change detection B3: add resetAroundPosition() to ParticleFilter, track lastKnownFloor in SensorFusion and widen particle cloud by 8m on barometer floor change --- .../PositionMe/sensors/ParticleFilter.java | 19 +++++++++++++++++++ .../PositionMe/sensors/SensorFusion.java | 15 +++++++++++++++ 2 files changed, 34 insertions(+) diff --git a/app/src/main/java/com/openpositioning/PositionMe/sensors/ParticleFilter.java b/app/src/main/java/com/openpositioning/PositionMe/sensors/ParticleFilter.java index 974e148f..d2f29425 100644 --- a/app/src/main/java/com/openpositioning/PositionMe/sensors/ParticleFilter.java +++ b/app/src/main/java/com/openpositioning/PositionMe/sensors/ParticleFilter.java @@ -179,6 +179,25 @@ public float[][] getParticles() { return result; } + /** + * Resets the particle cloud around a new position with increased uncertainty. + * Called when a floor change is detected, to prevent particles from remaining on the wrong floor. + * Horizontal position is still preserved as the best estimate, but spread is widened. + * + * @param centreX East position to re-centre particles around (metres) + * @param centreY North position to re-centre particles around (metres) + * @param uncertainty Spread radius for the new particle cloud (metres) + */ + public void resetAroundPosition(float centreX, float centreY, float uncertainty) { + for (int i = 0; i < NUM_PARTICLES; i++) { + particlesX[i] = centreX + (float) (random.nextGaussian() * uncertainty); + particlesY[i] = centreY + (float) (random.nextGaussian() * uncertainty); + weights[i] = 1.0f / NUM_PARTICLES; + } + Log.i(TAG, "Particles reset around (" + centreX + ", " + centreY + + ") ± " + uncertainty + " m after floor change"); + } + public boolean isInitialized() { return initialized; diff --git a/app/src/main/java/com/openpositioning/PositionMe/sensors/SensorFusion.java b/app/src/main/java/com/openpositioning/PositionMe/sensors/SensorFusion.java index b1e7b5ec..a205b9da 100644 --- a/app/src/main/java/com/openpositioning/PositionMe/sensors/SensorFusion.java +++ b/app/src/main/java/com/openpositioning/PositionMe/sensors/SensorFusion.java @@ -199,6 +199,10 @@ public class SensorFusion implements SensorEventListener, Observer { private float prevPdrX = 0f; private float prevPdrY = 0f; + // Floor change detection for particle reset + private int lastKnownFloor = 0; + + // Last raw position from each individual source, for colour-coded display private double[] lastGnssLatLon = null; // {lat, lon} private double[] lastWifiLatLon = null; // {lat, lon} @@ -586,6 +590,16 @@ public void onLocationChanged(@NonNull Location location) { location.getLatitude(), location.getLongitude()); particleFilter.updateWithGnss(enu[0], enu[1]); lastGnssLatLon = new double[]{location.getLatitude(), location.getLongitude()}; + // Detect floor change and reset particle cloud if needed + int currentFloor = pdrProcessing.getCurrentFloor(); + if (currentFloor != lastKnownFloor) { + float[] best = particleFilter.getBestEstimate(); + particleFilter.resetAroundPosition(best[0], best[1], 8f); + lastKnownFloor = currentFloor; + Log.i("SensorFusion", "Floor change detected: " + lastKnownFloor + + " → " + currentFloor + ", particles reset"); + } + } } if(saveRecording) { @@ -1463,6 +1477,7 @@ public void startRecording() { lastGnssLatLon = null; lastWifiLatLon = null; lastPdrLatLon = null; + lastKnownFloor = 0; prevPdrX = 0f; prevPdrY = 0f; if(settings.getBoolean("overwrite_constants", false)) { From 4c4d2861efa8e629a33d89d96c46cc1c5ef40143 Mon Sep 17 00:00:00 2001 From: Haoning Huang Date: Thu, 19 Mar 2026 18:47:24 +0000 Subject: [PATCH 27/82] fix: initialise EKF in WiFi cold-start bootstrap alongside ParticleFilter --- .../sensors/ExtendedKalmanFilter.java | 156 ++++++++++++++++++ .../PositionMe/sensors/SensorFusion.java | 31 +++- 2 files changed, 182 insertions(+), 5 deletions(-) create mode 100644 app/src/main/java/com/openpositioning/PositionMe/sensors/ExtendedKalmanFilter.java diff --git a/app/src/main/java/com/openpositioning/PositionMe/sensors/ExtendedKalmanFilter.java b/app/src/main/java/com/openpositioning/PositionMe/sensors/ExtendedKalmanFilter.java new file mode 100644 index 00000000..4e9bcb23 --- /dev/null +++ b/app/src/main/java/com/openpositioning/PositionMe/sensors/ExtendedKalmanFilter.java @@ -0,0 +1,156 @@ +package com.openpositioning.PositionMe.sensors; + +import android.util.Log; + +/** + * Extended Kalman Filter for indoor positioning. + * + * State vector: [east, north] in local East-North metres. + * Process model: constant velocity, state advances by PDR displacement. + * Observation model: direct position measurement. + * + * @author Haoning Huang + */ +public class EKFPositioning { + + private static final String TAG = "EKFPositioning"; + + /** PDR process noise standard deviation (metres). */ + private static final float MOTION_NOISE_STD = 0.3f; + /** GNSS observation noise standard deviation (metres). */ + private static final float GNSS_NOISE_STD = 5.0f; + /** WiFi observation noise standard deviation (metres). */ + private static final float WIFI_NOISE_STD = 15.0f; + + // State estimate + private float stateX, stateY; + + // State covariance P (2x2 symmetric, stored as four scalars) + private float p00, p01, p10, p11; + + private boolean initialized = false; + + /** + * Initializes the filter at the given East-North position. + * + * @param initX Initial East position (metres) + * @param initY Initial North position (metres) + * @param uncertainty Initial 1-sigma uncertainty (metres) + */ + public void initParticles(float initX, float initY, float uncertainty) { + stateX = initX; + stateY = initY; + float u2 = uncertainty * uncertainty; + p00 = u2; p01 = 0f; + p10 = 0f; p11 = u2; + initialized = true; + Log.i(TAG, "EKF initialised at (" + initX + ", " + initY + + ") ± " + uncertainty + " m"); + } + + /** + * Prediction step: advances state by PDR displacement and grows covariance. + * + * @param dx East displacement since last step (metres) + * @param dy North displacement since last step (metres) + */ + public void predict(float dx, float dy) { + if (!initialized) return; + float movementMagnitude = (float) Math.sqrt(dx * dx + dy * dy); + float noiseStd = (movementMagnitude < 0.05f) + ? MOTION_NOISE_STD * 0.1f : MOTION_NOISE_STD; + stateX += dx; + stateY += dy; + float q = noiseStd * noiseStd; + p00 += q; + p11 += q; + } + + /** + * Update step with a position observation. + * H = I, so innovation = meas - state, S = P + R. + * + * @param measX Observed East position (metres) + * @param measY Observed North position (metres) + * @param noiseStd Observation noise standard deviation (metres) + */ + private void update(float measX, float measY, float noiseStd) { + if (!initialized) return; + float r = noiseStd * noiseStd; + // Innovation covariance S = P + R*I + float s00 = p00 + r, s01 = p01; + float s10 = p10, s11 = p11 + r; + // S inverse (explicit 2x2) + float det = s00 * s11 - s01 * s10; + if (Math.abs(det) < 1e-10f) return; + float id = 1f / det; + float si00 = s11 * id, si01 = -s01 * id; + float si10 = -s10 * id, si11 = s00 * id; + // Kalman gain K = P * S^{-1} + float k00 = p00 * si00 + p01 * si10; + float k01 = p00 * si01 + p01 * si11; + float k10 = p10 * si00 + p11 * si10; + float k11 = p10 * si01 + p11 * si11; + // State update + float innX = measX - stateX; + float innY = measY - stateY; + stateX += k00 * innX + k01 * innY; + stateY += k10 * innX + k11 * innY; + // Covariance update P = (I - K) * P + float ik00 = 1f - k00, ik01 = -k01; + float ik10 = -k10, ik11 = 1f - k11; + float np00 = ik00 * p00 + ik01 * p10; + float np01 = ik00 * p01 + ik01 * p11; + float np10 = ik10 * p00 + ik11 * p10; + float np11 = ik10 * p01 + ik11 * p11; + p00 = np00; p01 = np01; + p10 = np10; p11 = np11; + } + + /** Update with a GNSS position observation. */ + public void updateWithGnss(float measX, float measY) { + update(measX, measY, GNSS_NOISE_STD); + Log.d(TAG, "GNSS update. State: (" + stateX + ", " + stateY + ")"); + } + + /** Update with a WiFi positioning observation. */ + public void updateWithWifi(float measX, float measY) { + update(measX, measY, WIFI_NOISE_STD); + Log.d(TAG, "WiFi update. State: (" + stateX + ", " + stateY + ")"); + } + + /** + * Returns the current best position estimate. + * + * @return float[]{east, north} in East-North metres. + */ + public float[] getBestEstimate() { + if (!initialized) return new float[]{0f, 0f}; + return new float[]{stateX, stateY}; + } + + /** + * Returns position uncertainty as the RMS of the covariance diagonal. + * + * @return 1-sigma uncertainty in metres, or -1 if not initialised. + */ + public double getSigmaMetres() { + if (!initialized) return -1.0; + return Math.sqrt(p00 + p11); + } + + /** + * Resets state around a new position with increased uncertainty. + * Used after a floor change. + */ + public void resetAroundPosition(float centreX, float centreY, float uncertainty) { + stateX = centreX; + stateY = centreY; + float u2 = uncertainty * uncertainty; + p00 = u2; p01 = 0f; + p10 = 0f; p11 = u2; + Log.i(TAG, "EKF reset around (" + centreX + ", " + centreY + ")"); + } + + public boolean isInitialized() { return initialized; } +} diff --git a/app/src/main/java/com/openpositioning/PositionMe/sensors/SensorFusion.java b/app/src/main/java/com/openpositioning/PositionMe/sensors/SensorFusion.java index a205b9da..5e9b2fb1 100644 --- a/app/src/main/java/com/openpositioning/PositionMe/sensors/SensorFusion.java +++ b/app/src/main/java/com/openpositioning/PositionMe/sensors/SensorFusion.java @@ -202,6 +202,11 @@ public class SensorFusion implements SensorEventListener, Observer { // Floor change detection for particle reset private int lastKnownFloor = 0; + private ExtendedKalmanFilter ekfPositioning; + // true = use EKF output, false = use Particle Filter output + private boolean useEKF = false; + + // Last raw position from each individual source, for colour-coded display private double[] lastGnssLatLon = null; // {lat, lon} @@ -361,6 +366,8 @@ public void setContext(Context context) { this.pdrProcessing = new PdrProcessing(context); this.particleFilter = new ParticleFilter(); this.settings = PreferenceManager.getDefaultSharedPreferences(context); + this.ekfPositioning = new ExtendedKalmanFilter(); + this.useEKF = settings.getBoolean("use_ekf", false); this.pathView = new PathView(context, null); this.wiFiPositioning = new WiFiPositioning(context); @@ -520,6 +527,7 @@ public void onSensorChanged(SensorEvent sensorEvent) { float dx = newCords[0] - prevPdrX; float dy = newCords[1] - prevPdrY; particleFilter.predict(dx, dy); + ekfPositioning.predict(dx, dy); prevPdrX = newCords[0]; prevPdrY = newCords[1]; if (coordinateConverter != null) { @@ -580,6 +588,7 @@ public void onLocationChanged(@NonNull Location location) { coordinateConverter = new CoordinateConverter( location.getLatitude(), location.getLongitude()); particleFilter.initParticles(0f, 0f, Math.max(accuracy, 5f)); + ekfPositioning.initParticles(0f, 0f, Math.max(accuracy, 5f)); prevPdrX = 0f; prevPdrY = 0f; Log.i("SensorFusion", "ParticleFilter initialised at lat=" @@ -589,12 +598,14 @@ public void onLocationChanged(@NonNull Location location) { float[] enu = coordinateConverter.toEnu( location.getLatitude(), location.getLongitude()); particleFilter.updateWithGnss(enu[0], enu[1]); + ekfPositioning.updateWithGnss(enu[0], enu[1]); lastGnssLatLon = new double[]{location.getLatitude(), location.getLongitude()}; // Detect floor change and reset particle cloud if needed int currentFloor = pdrProcessing.getCurrentFloor(); if (currentFloor != lastKnownFloor) { float[] best = particleFilter.getBestEstimate(); particleFilter.resetAroundPosition(best[0], best[1], 8f); + ekfPositioning.resetAroundPosition(best[0], best[1], 8f); lastKnownFloor = currentFloor; Log.i("SensorFusion", "Floor change detected: " + lastKnownFloor + " → " + currentFloor + ", particles reset"); @@ -989,6 +1000,8 @@ public void onSuccess(LatLng wifiLocation, int floor) { float[] enu = coordinateConverter.toEnu( wifiLocation.latitude, wifiLocation.longitude); particleFilter.updateWithWifi(enu[0], enu[1]); + ekfPositioning.updateWithWifi(enu[0], enu[1]); + } } @@ -1020,14 +1033,17 @@ public void onError(String message) { * @return double[]{latitude, longitude}, or null(if filter is not initialized) */ public double[] getFusedLatLon() { - if (particleFilter != null && particleFilter.isInitialized() - && coordinateConverter != null) { - float[] enu = particleFilter.getBestEstimate(); + boolean ekfReady = useEKF && ekfPositioning != null && ekfPositioning.isInitialized(); + boolean pfReady = !useEKF && particleFilter != null && particleFilter.isInitialized(); + if ((ekfReady || pfReady) && coordinateConverter != null) { + float[] enu = useEKF ? ekfPositioning.getBestEstimate() + : particleFilter.getBestEstimate(); return coordinateConverter.toLatLon(enu[0], enu[1]); } return null; } + /** Last raw GNSS position. Returns null before first GPS signal. */ public double[] getLastGnssLatLon() { return lastGnssLatLon; @@ -1050,10 +1066,13 @@ public double[] getLastPdrLatLon() { * @return RMS particle spread in metres. */ public double getPositionUncertainty() { - if (particleFilter == null) return -1.0; - return particleFilter.getSigmaMetres(); + if (useEKF) { + return ekfPositioning == null ? -1.0 : ekfPositioning.getSigmaMetres(); + } + return particleFilter == null ? -1.0 : particleFilter.getSigmaMetres(); } + /** * Returns a copy of all particle positions in local East-North metres. * @@ -1473,6 +1492,8 @@ public void startRecording() { this.pdrProcessing.resetPDR(); // Reset particle filter state for new recording session particleFilter = new ParticleFilter(); + ekfPositioning = new ExtendedKalmanFilter(); + useEKF = settings.getBoolean("use_ekf", false); coordinateConverter = null; lastGnssLatLon = null; lastWifiLatLon = null; From 48fbf505bae90e362a5aad0af085c118ebba63bb Mon Sep 17 00:00:00 2001 From: Haoning Huang Date: Thu, 19 Mar 2026 22:41:27 +0000 Subject: [PATCH 28/82] change EKFPositioning to ExtendedKalmanFilter --- .../sensors/ExtendedKalmanFilter.java | 21 +++++++++---------- 1 file changed, 10 insertions(+), 11 deletions(-) diff --git a/app/src/main/java/com/openpositioning/PositionMe/sensors/ExtendedKalmanFilter.java b/app/src/main/java/com/openpositioning/PositionMe/sensors/ExtendedKalmanFilter.java index 4e9bcb23..3d206e43 100644 --- a/app/src/main/java/com/openpositioning/PositionMe/sensors/ExtendedKalmanFilter.java +++ b/app/src/main/java/com/openpositioning/PositionMe/sensors/ExtendedKalmanFilter.java @@ -3,15 +3,17 @@ import android.util.Log; /** - * Extended Kalman Filter for indoor positioning. + * The filter maintains a state estimate [east, north] in the local East-North coordinate frame. * - * State vector: [east, north] in local East-North metres. - * Process model: constant velocity, state advances by PDR displacement. - * Observation model: direct position measurement. + * Two-step cycle: + * 1. predict() — advance state by PDR displacement, grow covariance by process noise + * 2. updateWithGnss() — correct state using GNSS observation via Kalman gain + * updateWithWifi() — correct state using WiFi observation via Kalman gain * * @author Haoning Huang */ -public class EKFPositioning { + +public class ExtendedKalmanFilter { private static final String TAG = "EKFPositioning"; @@ -80,7 +82,7 @@ private void update(float measX, float measY, float noiseStd) { // Innovation covariance S = P + R*I float s00 = p00 + r, s01 = p01; float s10 = p10, s11 = p11 + r; - // S inverse (explicit 2x2) + // S inverse float det = s00 * s11 - s01 * s10; if (Math.abs(det) < 1e-10f) return; float id = 1f / det; @@ -132,17 +134,14 @@ public float[] getBestEstimate() { /** * Returns position uncertainty as the RMS of the covariance diagonal. * - * @return 1-sigma uncertainty in metres, or -1 if not initialised. + * @return 1-sigma uncertainty in metres (-1 if not initialized) */ public double getSigmaMetres() { if (!initialized) return -1.0; return Math.sqrt(p00 + p11); } - /** - * Resets state around a new position with increased uncertainty. - * Used after a floor change. - */ + public void resetAroundPosition(float centreX, float centreY, float uncertainty) { stateX = centreX; stateY = centreY; From f2cede26c1e2686c2539857f37bab72f83724647 Mon Sep 17 00:00:00 2001 From: sydneysavarese Date: Fri, 20 Mar 2026 09:36:40 +0000 Subject: [PATCH 29/82] added indoor map corrections, need to be edited --- .../fragment/RecordingFragment.java | 11 +- .../fragment/TrajectoryMapFragment.java | 44 +++- .../PositionMe/utils/IndoorMapManager.java | 237 ++++++++++++++++++ .../PositionMe/utils/VenueMapper.java | 162 +++++++++++- 4 files changed, 443 insertions(+), 11 deletions(-) diff --git a/app/src/main/java/com/openpositioning/PositionMe/presentation/fragment/RecordingFragment.java b/app/src/main/java/com/openpositioning/PositionMe/presentation/fragment/RecordingFragment.java index 5b7ee34b..7b4be19d 100644 --- a/app/src/main/java/com/openpositioning/PositionMe/presentation/fragment/RecordingFragment.java +++ b/app/src/main/java/com/openpositioning/PositionMe/presentation/fragment/RecordingFragment.java @@ -381,7 +381,16 @@ private void updateUIandPosition() { mapFrag.updateObservedMacs(macs); // trajectoryMapFragment.updateObservedMacs(sensorFusion.getLatestBssids()); - mapFrag.updateUserLocation(newLocation, + float[][] particles = sensorFusion.getParticles(); + + LatLng matchedLocation = IndoorMapManager.getMapMatchedLocationFromParticles( + particles, + oldLocation, + heightChange, + newLocation + ); + + mapFrag.updateUserLocation(matchedLocation, (float) Math.toDegrees(sensorFusion.passOrientation())); } } diff --git a/app/src/main/java/com/openpositioning/PositionMe/presentation/fragment/TrajectoryMapFragment.java b/app/src/main/java/com/openpositioning/PositionMe/presentation/fragment/TrajectoryMapFragment.java index 34089b5c..f4932e29 100644 --- a/app/src/main/java/com/openpositioning/PositionMe/presentation/fragment/TrajectoryMapFragment.java +++ b/app/src/main/java/com/openpositioning/PositionMe/presentation/fragment/TrajectoryMapFragment.java @@ -94,6 +94,8 @@ public class TrajectoryMapFragment extends Fragment { private SensorFusion sensorFusion; private TextView floorLabel; + private float lastElevation = Float.NaN; //To compute height change between old and current position + @@ -471,7 +473,47 @@ public void updateUserLocation(@NonNull LatLng newLocation, float orientation) { // Keep track of current location LatLng oldLocation = this.currentLocation; - this.currentLocation = newLocation; + LatLng correctedLocation = newLocation; + float heightChange = 0f; + float[][] particles = sensorFusion.getParticles(); + if (sensorFusion != null) { + float currentElevation = sensorFusion.getElevation(); + + + + if (!Float.isNaN(lastElevation)) { + heightChange = currentElevation - lastElevation; + } + + + lastElevation = currentElevation; + } + + if (oldLocation != null && indoorMapManager != null) { + correctedLocation = indoorMapManager.indoorLocationCorrection( + oldLocation, + newLocation, + heightChange + ); + + indoorMapManager.acceptFloorChange( + correctedLocation, + oldLocation, + heightChange + ); + } + + this.currentLocation = correctedLocation; + newLocation = correctedLocation; + Log.d("IndoorTest", "oldLocation = " + oldLocation); + Log.d("IndoorTest", "newLocation = " + newLocation); + Log.d("IndoorTest", "heightChange = " + heightChange); + +// if indoor map is active and current venue is known: +// send oldLocation, newLocation, current floor, and maybe barometer info to IndoorMapManager +// get back corrected position/floor +// then update marker/polyline using that corrected result + // If no marker, create it if (orientationMarker == null) { diff --git a/app/src/main/java/com/openpositioning/PositionMe/utils/IndoorMapManager.java b/app/src/main/java/com/openpositioning/PositionMe/utils/IndoorMapManager.java index 7babbf4f..96cd908b 100644 --- a/app/src/main/java/com/openpositioning/PositionMe/utils/IndoorMapManager.java +++ b/app/src/main/java/com/openpositioning/PositionMe/utils/IndoorMapManager.java @@ -27,6 +27,7 @@ import java.util.Map; import java.util.HashMap; +import static java.lang.Math.*; /** * Class used to manage indoor floor map overlays * Currently used by RecordingFragment @@ -67,6 +68,9 @@ public class IndoorMapManager { // List of currently drawn indoor floor polygons private final List activeFloorPolygons = new ArrayList<>(); + final double floorDistThresh = 5.0; + final double liftDistThresh = 3.0; + /** * Venue model used for storing API floorplan data @@ -79,6 +83,14 @@ public static class IndoorVenue{ // Raw GeoJSON floor data from API public String rawMapShapes; + public Map floorFeatures = new HashMap<>(); + + public static class FloorFeatures { + public List> wallPolygons = new ArrayList<>(); + public List wallPolylines = new ArrayList<>(); // if your walls are lines + public List stairsCenters = new ArrayList<>(); // or polygons if provided + public List liftCenters = new ArrayList<>(); + } } @@ -164,6 +176,231 @@ public void selectVenue(IndoorVenue venue){ } } + //checks orientation using three points: 0= points on same line, 1 & 2 = points on either side + private static int orientation(LatLng a, LatLng b, LatLng c) { + + double val = + (b.longitude - a.longitude) * (c.latitude - a.latitude) - + (b.latitude - a.latitude) * (c.longitude - a.longitude); + + double eps = 1e-12; + + if (Math.abs(val) < eps) { + return 0; // collinear + } + + return (val > 0) ? 1 : 2; + } + + /* + takes endpoints of two segments and determines whether they intersect + */ + private static boolean segmentsIntersect(LatLng a, LatLng b, LatLng c, LatLng d) { + + int o1 = orientation(a, b, c); + int o2 = orientation(a, b, d); + int o3 = orientation(c, d, a); + int o4 = orientation(c, d, b); + + // Proper intersection + if (o1 != o2 && o3 != o4) { + return true; + } + + // Special cases (collinear) + if (o1 == 0 && onSegment(a, c, b)) return true; + if (o2 == 0 && onSegment(a, d, b)) return true; + if (o3 == 0 && onSegment(c, a, d)) return true; + if (o4 == 0 && onSegment(c, b, d)) return true; + + return false; + } + + private static boolean onSegment(LatLng a, LatLng p, LatLng b) { + return p.latitude <= Math.max(a.latitude, b.latitude) && + p.latitude >= Math.min(a.latitude, b.latitude) && + p.longitude <= Math.max(a.longitude, b.longitude) && + p.longitude >= Math.min(a.longitude, b.longitude); + } + + /// height change = sensorfusion.getelevation + public LatLng indoorLocationCorrection(LatLng oldLocation, LatLng predictedLocation, float heightChange) { + if (currentVenue == null || currentFloorKey == null || oldLocation == null || predictedLocation == null) { + return predictedLocation; + } + + LatLng correctedLocation = predictedLocation; + boolean hitWall = false; + + IndoorVenue.FloorFeatures floorFeatures = currentVenue.floorFeatures.get(currentFloorKey); + if (floorFeatures == null) { + return predictedLocation; + } + + List> wallPolygons = floorFeatures.wallPolygons; + + for (int k = 0; k < wallPolygons.size() && !hitWall; k++) { + List polygon = wallPolygons.get(k); + + for (int i = 0; i < polygon.size(); i++) { + LatLng edgeStart = polygon.get(i); + LatLng edgeEnd = polygon.get((i + 1) % polygon.size()); + + if (segmentsIntersect(oldLocation, predictedLocation, edgeStart, edgeEnd)) { + correctedLocation = adjustPositionToNearestValidLocation( + oldLocation, + predictedLocation, + polygon + ); + hitWall = true; + break; + } + } + } + + //floor adjustment + // if abs(heightChange) > heightThreshold: + //// + //// if distance(correctedLocation, nearest stairs or lift) < proximityThreshold: + //// + //// accept floor change + //// + //// if horizontalMovement < horizontalThreshold: + //// mode = lift + //// else: + //// mode = stairs + //// + //// else: + //// reject floor change + //// keep same floor + + return correctedLocation; + } + + //find nearest valid point that doesn't intersect walls +//loop through points on segment just traversed starting from predicted location back towards prev location +//use dx and dy +//once we find point that doesn't intersect wall +//corrected position = point +//break + + public String acceptFloorChange(LatLng correctedLocation, LatLng oldLocation, float heightChangeMeters) { + if (currentVenue == null || currentFloorKey == null || correctedLocation == null || oldLocation == null) { + return currentFloorKey; + } + + // Require meaningful vertical movement first + double heightThresholdMeters = 2.5; + if (Math.abs(heightChangeMeters) < heightThresholdMeters) { + return currentFloorKey; + } + + IndoorVenue.FloorFeatures floorFeatures = currentVenue.floorFeatures.get(currentFloorKey); + if (floorFeatures == null) { + return currentFloorKey; + } + + double stairsThresholdMeters = 5.0; + double liftThresholdMeters = 4.0; + double liftHorizontalThresholdMeters = 2.0; + + boolean nearStairs = isNearAnyPoint(correctedLocation, floorFeatures.stairsCenters, stairsThresholdMeters); + boolean nearLift = isNearAnyPoint(correctedLocation, floorFeatures.liftCenters, liftThresholdMeters); + + if (!nearStairs && !nearLift) { + return currentFloorKey; + } + + double horizontalDisplacement = distanceMeters(oldLocation, correctedLocation); + + boolean usedLift = nearLift && horizontalDisplacement < liftHorizontalThresholdMeters; + boolean usedStairs = nearStairs && horizontalDisplacement >= liftHorizontalThresholdMeters; + + if (!usedLift && !usedStairs) { + return currentFloorKey; + } + + String nextFloorKey = getAdjacentFloorKey(currentFloorKey, heightChangeMeters > 0); + if (nextFloorKey == null || !currentVenue.floorFeatures.containsKey(nextFloorKey)) { + return currentFloorKey; + } + if (!nextFloorKey.equals(currentFloorKey)) { + currentFloorKey = nextFloorKey; + switchFloor(Integer.parseInt(currentFloorKey)); + } + + return currentFloorKey; + } + + private String getAdjacentFloorKey(String floorKey, boolean goingUp) { + try { + int floor = Integer.parseInt(floorKey); + int next = goingUp ? floor + 1 : floor - 1; + return String.valueOf(next); + } catch (NumberFormatException e) { + return null; + } + } + + private double distanceMeters(LatLng a, LatLng b) { + float[] result = new float[1]; + android.location.Location.distanceBetween( + a.latitude, a.longitude, + b.latitude, b.longitude, + result + ); + return result[0]; + } + + private boolean isNearAnyPoint(LatLng location, List centers, double thresholdMeters) { + + if (location == null || centers == null || centers.isEmpty()) { + return false; + } + + double result; + for (LatLng center : centers) { + result = distanceMeters(location, center); + if (result <= thresholdMeters) { + return true; + } + } + + return false; + } + + public LatLng adjustPositionToNearestValidLocation(LatLng oldLocation, LatLng predictedLocation, List polygon) { + + LatLng corrected = oldLocation; + + double dx = predictedLocation.latitude - oldLocation.latitude; + double dy = predictedLocation.longitude - oldLocation.longitude; + + for (double t = 1.0; t >= 0.0; t -= 0.05) { + double lat = oldLocation.latitude + t * dx; + double lon = oldLocation.longitude + t * dy; + LatLng candidate = new LatLng(lat, lon); + + boolean intersectsWall = false; + + for (int i = 0; i < polygon.size(); i++) { + LatLng wallStart = polygon.get(i); + LatLng wallEnd = polygon.get((i + 1) % polygon.size()); + + if (segmentsIntersect(oldLocation, candidate, wallStart, wallEnd)) { + intersectsWall = true; + break; + } + } + + if (!intersectsWall) { + corrected = candidate; + return corrected; + } + } + + return corrected; + } /** * Increase floor within the current venue. diff --git a/app/src/main/java/com/openpositioning/PositionMe/utils/VenueMapper.java b/app/src/main/java/com/openpositioning/PositionMe/utils/VenueMapper.java index be9292d6..c53286a7 100644 --- a/app/src/main/java/com/openpositioning/PositionMe/utils/VenueMapper.java +++ b/app/src/main/java/com/openpositioning/PositionMe/utils/VenueMapper.java @@ -15,6 +15,7 @@ package com.openpositioning.PositionMe.utils; +//load venue into internal model import android.util.Log; @@ -26,7 +27,9 @@ import org.json.JSONObject; import java.util.ArrayList; +import java.util.HashMap; import java.util.List; +import java.util.Map; public class VenueMapper { @@ -44,7 +47,8 @@ public static List toIndoorVenues(List toIndoorVenues(List parseOutlineGeoJson(String outlineJsonString) throws Exception { List pts = new ArrayList<>(); if (outlineJsonString == null || outlineJsonString.isEmpty()) return pts; - JSONObject fc = new JSONObject(outlineJsonString); - JSONArray features = fc.optJSONArray("features"); + JSONObject object = new JSONObject(outlineJsonString); + JSONArray features = object.optJSONArray("features"); if (features == null || features.length() == 0) return pts; JSONObject geom = features.getJSONObject(0).getJSONObject("geometry"); String type = geom.optString("type", ""); - JSONArray coords = geom.getJSONArray("coordinates"); + JSONArray coordinates = geom.getJSONArray("coordinates"); // MultiPolygon: coordinates[ polygon ][ ring ][ point ][ lon/lat ] // Polygon: coordinates[ ring ][ point ][ lon/lat ] + JSONArray boundary; + + if ("MultiPolygon".equalsIgnoreCase(type)) { + boundary = coordinates.getJSONArray(0).getJSONArray(0); + } else if ("Polygon".equalsIgnoreCase(type)) { + boundary = coordinates.getJSONArray(0); + } else { + return pts; + } + + for (int i = 0; i < boundary.length(); i++) { + JSONArray p = boundary.getJSONArray(i); + double lon = p.getDouble(0); + double lat = p.getDouble(1); + pts.add(new LatLng(lat, lon)); + } + + return pts; + } + + /** + * takes a string of shape, gets JSON object, + */ + private static Map + parseFloorFeatures(String shapes) throws Exception { + + Map floors = new HashMap<>(); + + if (shapes == null || shapes.isEmpty()) { + return floors; + } + + JSONArray shapesArray = new JSONArray(shapes); + + for (int k = 0; k < shapesArray.length(); k++) { + JSONObject shape = shapesArray.getJSONObject(k); + + String floor = String.valueOf(shape.getInt("floor")); + String type = shape.getString("indoor_type"); + + IndoorMapManager.IndoorVenue.FloorFeatures f = floors.get(floor); + //if floor doesn't already exist in indoorvenue.floorfeatures, add it + if (f == null) { + f = new IndoorMapManager.IndoorVenue.FloorFeatures(); + floors.put(floor, f); + } + + JSONObject geometry = shape.getJSONObject("geometry"); + + //if wall, parse and add it to list of walls, if stairs, add to stairs, if lift, add to lifts + if (type.equals("wall")) { + String geomType = geometry.optString("type", ""); + + if ("Polygon".equalsIgnoreCase(geomType) || + "MultiPolygon".equalsIgnoreCase(geomType)) { + List poly = parsePolygon(geometry); + if (!poly.isEmpty()) { + f.wallPolygons.add(poly); + } + } else if ("LineString".equalsIgnoreCase(geomType)) { + List line = parseLineString(geometry); + f.wallPolylines.addAll(line); + } + + } else if (type.equals("stairs")) { + LatLng p = parsePointOrCenter(geometry); + if (p != null) { + f.stairsCenters.add(p); + } + + } else if (type.equals("lift")) { + LatLng p = parsePointOrCenter(geometry); + if (p != null) { + f.liftCenters.add(p); + } + } + } + + return floors; + } + + private static List parsePolygon(JSONObject geometry) throws Exception { + List pts = new ArrayList<>(); + + String type = geometry.optString("type", ""); + JSONArray coordinates = geometry.getJSONArray("coordinates"); JSONArray ring; if ("MultiPolygon".equalsIgnoreCase(type)) { - ring = coords.getJSONArray(0).getJSONArray(0); + ring = coordinates.getJSONArray(0).getJSONArray(0); } else if ("Polygon".equalsIgnoreCase(type)) { - ring = coords.getJSONArray(0); + ring = coordinates.getJSONArray(0); } else { return pts; } @@ -96,6 +185,61 @@ private static List parseOutlineGeoJson(String outlineJsonString) throws return pts; } + private static List parseLineString(JSONObject geometry) throws Exception { + List pts = new ArrayList<>(); + + if (!"LineString".equalsIgnoreCase(geometry.optString("type", ""))) { + return pts; + } + + JSONArray coordinates = geometry.getJSONArray("coordinates"); + for (int i = 0; i < coordinates.length(); i++) { + JSONArray p = coordinates.getJSONArray(i); + double lon = p.getDouble(0); + double lat = p.getDouble(1); + pts.add(new LatLng(lat, lon)); + } + + return pts; + } + + private static LatLng parsePointOrCenter(JSONObject geometry) throws Exception { + String type = geometry.optString("type", ""); + + if ("Point".equalsIgnoreCase(type)) { + JSONArray coordinates = geometry.getJSONArray("coordinates"); + double lon = coordinates.getDouble(0); + double lat = coordinates.getDouble(1); + return new LatLng(lat, lon); + } + + if ("Polygon".equalsIgnoreCase(type) || "MultiPolygon".equalsIgnoreCase(type)) { + List poly = parsePolygon(geometry); + if (!poly.isEmpty()) { + return computeCenter(poly); + } + } + + return null; + } + + private static LatLng computeCenter(List pts) { + if (pts == null || pts.isEmpty()) return null; + + double sumLat = 0.0; + double sumLon = 0.0; + + for (LatLng p : pts) { + sumLat += p.latitude; + sumLon += p.longitude; + } + + return new LatLng(sumLat / pts.size(), sumLon / pts.size()); + } + + /** + * finds the smallest rectangle completely containing all points + */ private static LatLngBounds computeBounds(List pts) { double minLat = Double.POSITIVE_INFINITY, minLon = Double.POSITIVE_INFINITY; double maxLat = Double.NEGATIVE_INFINITY, maxLon = Double.NEGATIVE_INFINITY; From ed86b9888eb26f7ebd135f81d9e1d38d93f5f986 Mon Sep 17 00:00:00 2001 From: sydneysavarese Date: Sat, 21 Mar 2026 20:46:22 +0000 Subject: [PATCH 30/82] added particle filtering to map matching --- .../fragment/RecordingFragment.java | 18 +-- .../fragment/TrajectoryMapFragment.java | 4 + .../PositionMe/utils/IndoorMapManager.java | 152 ++++++++++++++---- 3 files changed, 130 insertions(+), 44 deletions(-) diff --git a/app/src/main/java/com/openpositioning/PositionMe/presentation/fragment/RecordingFragment.java b/app/src/main/java/com/openpositioning/PositionMe/presentation/fragment/RecordingFragment.java index 7b4be19d..e91527cd 100644 --- a/app/src/main/java/com/openpositioning/PositionMe/presentation/fragment/RecordingFragment.java +++ b/app/src/main/java/com/openpositioning/PositionMe/presentation/fragment/RecordingFragment.java @@ -383,15 +383,15 @@ private void updateUIandPosition() { // trajectoryMapFragment.updateObservedMacs(sensorFusion.getLatestBssids()); float[][] particles = sensorFusion.getParticles(); - LatLng matchedLocation = IndoorMapManager.getMapMatchedLocationFromParticles( - particles, - oldLocation, - heightChange, - newLocation - ); - - mapFrag.updateUserLocation(matchedLocation, - (float) Math.toDegrees(sensorFusion.passOrientation())); +// LatLng matchedLocation = IndoorMapManager.getMapMatchedLocationFromParticles( +// particles, +// oldLocation, +// heightChange, +// newLocation +// ); +// +// mapFrag.updateUserLocation(matchedLocation, +// (float) Math.toDegrees(sensorFusion.passOrientation())); } } diff --git a/app/src/main/java/com/openpositioning/PositionMe/presentation/fragment/TrajectoryMapFragment.java b/app/src/main/java/com/openpositioning/PositionMe/presentation/fragment/TrajectoryMapFragment.java index f4932e29..99d58039 100644 --- a/app/src/main/java/com/openpositioning/PositionMe/presentation/fragment/TrajectoryMapFragment.java +++ b/app/src/main/java/com/openpositioning/PositionMe/presentation/fragment/TrajectoryMapFragment.java @@ -786,6 +786,10 @@ public void updateObservedMacs(@NonNull List macs) { } } + public IndoorMapManager getIndoorMapManager() { + return indoorMapManager; + } + diff --git a/app/src/main/java/com/openpositioning/PositionMe/utils/IndoorMapManager.java b/app/src/main/java/com/openpositioning/PositionMe/utils/IndoorMapManager.java index 96cd908b..e2c2e0ff 100644 --- a/app/src/main/java/com/openpositioning/PositionMe/utils/IndoorMapManager.java +++ b/app/src/main/java/com/openpositioning/PositionMe/utils/IndoorMapManager.java @@ -165,7 +165,7 @@ public void selectVenue(IndoorVenue venue){ // Default to first floor currentFloorKey = keys.next(); - drawFloor(floorsObj.getJSONObject(currentFloorKey)); + drawFloor(floorsObj.getJSONObject(currentFloorKey), currentFloorKey); isIndoorMapSet = true; @@ -176,6 +176,74 @@ public void selectVenue(IndoorVenue venue){ } } + /** + * For each particle, zero its weight if the step from prev to current + * position crosses a wall. Called by ParticleFilter after predict(), + * before resample(). + * + * @param prevEast previous East positions, metres (length 300) + * @param prevNorth previous North positions, metres (length 300) + * @param currEast current East positions after predict() (length 300) + * @param currNorth current North positions after predict() (length 300) + * @param weights weight array — modified in-place + * @param converter to convert East-North → LatLng for wall geometry check + */ + public void applyWallConstraints( + float[] prevEast, float[] prevNorth, + float[] currEast, float[] currNorth, + float[] weights, + CoordinateConverter converter) { + + if (currentVenue == null || currentFloorKey == null) return; + IndoorVenue.FloorFeatures floor = + currentVenue.floorFeatures.get(currentFloorKey); + if (floor == null || floor.wallPolygons.isEmpty()) return; + + for (int i = 0; i < weights.length; i++) { + if (weights[i] == 0f) continue; // already dead, skip + + LatLng prev = toLatLng(prevEast[i], prevNorth[i], converter); + LatLng curr = toLatLng(currEast[i], currNorth[i], converter); + if (crossesAnyWall(prev, curr, floor.wallPolygons)) { + LatLng snapped = adjustPositionToNearestValidLocation( + prev, curr, getNearestWallPolygon(prev, curr, floor.wallPolygons)); + float[] enu = converter.toEnu(snapped.latitude, snapped.longitude); + currEast[i] = enu[0]; + currNorth[i] = enu[1]; + weights[i] *= 0.1f; + } + } + + } + private List getNearestWallPolygon(LatLng from, LatLng to, + List> wallPolygons) { + for (List polygon : wallPolygons) { + for (int i = 0; i < polygon.size(); i++) { + LatLng wallA = polygon.get(i); + LatLng wallB = polygon.get((i + 1) % polygon.size()); + if (segmentsIntersect(from, to, wallA, wallB)) return polygon; + } + } + return wallPolygons.get(0); // fallback, shouldn't reach here + } + + private boolean crossesAnyWall(LatLng from, LatLng to, + List> wallPolygons) { + for (List polygon : wallPolygons) { + for (int i = 0; i < polygon.size(); i++) { + LatLng wallA = polygon.get(i); + LatLng wallB = polygon.get((i + 1) % polygon.size()); + if (segmentsIntersect(from, to, wallA, wallB)) return true; + } + } + return false; + } + + private LatLng toLatLng(float eastM, float northM, CoordinateConverter c) { + double[] ll = c.toLatLon(eastM, northM); + return new LatLng(ll[0], ll[1]); + } + //checks orientation using three points: 0= points on same line, 1 & 2 = points on either side private static int orientation(LatLng a, LatLng b, LatLng c) { @@ -326,7 +394,8 @@ public String acceptFloorChange(LatLng correctedLocation, LatLng oldLocation, fl } if (!nextFloorKey.equals(currentFloorKey)) { currentFloorKey = nextFloorKey; - switchFloor(Integer.parseInt(currentFloorKey)); + boolean goingUp = heightChangeMeters > 0; + switchFloor(goingUp ? +1 : -1); } return currentFloorKey; @@ -422,29 +491,21 @@ public void decreaseFloor() { * Switch floor based on direction (+1 or -1) */ private void switchFloor(int direction) { - if (currentVenue == null || currentVenue.rawMapShapes == null) return; try { JSONObject floorsObj = new JSONObject(currentVenue.rawMapShapes); - List floorKeys = getSortedFloorKeys(floorsObj); - Iterator keys = floorsObj.keys(); - while (keys.hasNext()) { - floorKeys.add(keys.next()); - } + List floorKeys = getSortedFloorKeys(floorsObj); // already has all keys int idx = floorKeys.indexOf(currentFloorKey); if (idx < 0) return; int next = idx + direction; if (next >= 0 && next < floorKeys.size()) { - currentFloorKey = floorKeys.get(next); - clearIndoorFloor(); - drawFloor(floorsObj.getJSONObject(currentFloorKey)); + drawFloor(floorsObj.getJSONObject(currentFloorKey), currentFloorKey); isIndoorMapSet = true; - Log.d("IndoorMapManager", "Switched to floor: " + currentFloorKey); } @@ -452,21 +513,20 @@ private void switchFloor(int direction) { Log.e("IndoorMapManager", "Floor switch failed", e); } } - - + /** * Draw a single floor from GeoJSON FeatureCollection. */ - private void drawFloor(JSONObject floorGeoJson) throws JSONException { + private void drawFloor(JSONObject floorGeoJson, String floorKey) throws JSONException { - JSONArray features = floorGeoJson.getJSONArray("features"); + IndoorVenue.FloorFeatures features = new IndoorVenue.FloorFeatures(); + JSONArray featuresArray = floorGeoJson.getJSONArray("features"); - for (int i = 0; i < features.length(); i++) { + for (int i = 0; i < featuresArray.length(); i++) { - JSONObject feature = features.getJSONObject(i); + JSONObject feature = featuresArray.getJSONObject(i); - // ----- Read indoor_type for styling ----- JSONObject props = feature.optJSONObject("properties"); String indoorType = props != null ? props.optString("indoor_type", "") : ""; String t = indoorType == null ? "" : indoorType.toLowerCase(); @@ -479,50 +539,53 @@ private void drawFloor(JSONObject floorGeoJson) throws JSONException { JSONArray multiPoly = geometry.getJSONArray("coordinates"); // Style defaults - int strokeColor = Color.argb(220, 20, 20, 20); // dark grey - int fillColor = Color.argb(25, 60, 130, 255); // subtle blue-ish + int strokeColor = Color.argb(220, 20, 20, 20); + int fillColor = Color.argb(25, 60, 130, 255); float strokeWidth = 2.0f; - // Style by indoor_type if (t.contains("wall")) { - fillColor = Color.argb(0, 0, 0, 0); // no fill + fillColor = Color.argb(0, 0, 0, 0); strokeWidth = 3.5f; } else if (t.contains("door")) { fillColor = Color.argb(0, 0, 0, 0); strokeWidth = 4.5f; } else if (t.contains("corridor") || t.contains("hall")) { - fillColor = Color.argb(35, 60, 130, 255); + fillColor = Color.argb(35, 60, 130, 255); strokeWidth = 1.5f; } else if (t.contains("room") || t.contains("area")) { - fillColor = Color.argb(30, 60, 130, 255); + fillColor = Color.argb(30, 60, 130, 255); strokeWidth = 1.2f; } else { - // keep unknown types subtle - fillColor = Color.argb(15, 60, 130, 255); + fillColor = Color.argb(15, 60, 130, 255); strokeWidth = 1.0f; } for (int j = 0; j < multiPoly.length(); j++) { - // MultiPolygon -> polygon -> rings JSONArray polygon = multiPoly.getJSONArray(j); if (polygon.length() == 0) continue; - // ---- outer ring ---- JSONArray outerRing = polygon.getJSONArray(0); List outerPoints = toLatLngList(outerRing); - // Optional: skip tiny polygons (reduces clutter) if (outerPoints.size() < 3) continue; if (isTiny(outerPoints)) continue; + // Store by type for map matching + if (t.contains("wall")) { + features.wallPolygons.add(outerPoints); + } else if (t.contains("stair")) { + features.stairsCenters.add(centroidOf(outerPoints)); + } else if (t.contains("lift") || t.contains("elevator")) { + features.liftCenters.add(centroidOf(outerPoints)); + } + PolygonOptions opts = new PolygonOptions() .addAll(outerPoints) .strokeColor(strokeColor) .strokeWidth(strokeWidth) .fillColor(fillColor); - // ---- holes (rings 1..n) ---- for (int k = 1; k < polygon.length(); k++) { JSONArray holeRing = polygon.getJSONArray(k); List holePoints = toLatLngList(holeRing); @@ -533,16 +596,22 @@ private void drawFloor(JSONObject floorGeoJson) throws JSONException { Polygon polyObj = gMap.addPolygon(opts); activeFloorPolygons.add(polyObj); -// JSONObject props = feature.optJSONObject("properties"); + if (props != null) { -// String indoorType = props.optString("indoor_type", "NONE"); Log.d("IndoorTypes", "Found indoor_type=" + indoorType); } - } } - } + // Store features on current venue + if (currentVenue != null) { + currentVenue.floorFeatures.put(floorKey, features); + Log.d("IndoorMapManager", "Floor " + floorKey + + " walls=" + features.wallPolygons.size() + + " stairs=" + features.stairsCenters.size() + + " lifts=" + features.liftCenters.size()); + } + } /** * Convert a GeoJSON ring ([[lon,lat], ...]) into List. * GeoJSON uses [lon,lat] order. @@ -558,6 +627,12 @@ private List toLatLngList(JSONArray ring) throws JSONException { return points; } + private LatLng centroidOf(List pts) { + double lat = 0, lon = 0; + for (LatLng p : pts) { lat += p.latitude; lon += p.longitude; } + return new LatLng(lat / pts.size(), lon / pts.size()); + } + /** * Heuristic to drop tiny polygons that clutter the view. * Adjust thresholds if needed. @@ -647,5 +722,12 @@ public String getCurrentFloorKey() { return currentFloorKey; } + public IndoorVenue getCurrentVenue() { return currentVenue; } + + public IndoorVenue.FloorFeatures getCurrentFloorFeatures() { + if (currentVenue == null || currentFloorKey == null) return null; + return currentVenue.floorFeatures.get(currentFloorKey); + } + } From c8fbf11e0ca7b12355624326ca9c3b6cd8c4a8bb Mon Sep 17 00:00:00 2001 From: sydneysavarese Date: Mon, 23 Mar 2026 15:44:54 +0000 Subject: [PATCH 31/82] fixed bug that was making venue outline not appear --- .../fragment/RecordingFragment.java | 4 +- .../fragment/TrajectoryMapFragment.java | 7 +- .../PositionMe/utils/IndoorMapManager.java | 2 + .../PositionMe/utils/VenueMapper.java | 114 ++++++++++++------ 4 files changed, 86 insertions(+), 41 deletions(-) diff --git a/app/src/main/java/com/openpositioning/PositionMe/presentation/fragment/RecordingFragment.java b/app/src/main/java/com/openpositioning/PositionMe/presentation/fragment/RecordingFragment.java index e91527cd..65d59dda 100644 --- a/app/src/main/java/com/openpositioning/PositionMe/presentation/fragment/RecordingFragment.java +++ b/app/src/main/java/com/openpositioning/PositionMe/presentation/fragment/RecordingFragment.java @@ -390,8 +390,8 @@ private void updateUIandPosition() { // newLocation // ); // -// mapFrag.updateUserLocation(matchedLocation, -// (float) Math.toDegrees(sensorFusion.passOrientation())); + mapFrag.updateUserLocation(newLocation, + (float) Math.toDegrees(sensorFusion.passOrientation())); } } diff --git a/app/src/main/java/com/openpositioning/PositionMe/presentation/fragment/TrajectoryMapFragment.java b/app/src/main/java/com/openpositioning/PositionMe/presentation/fragment/TrajectoryMapFragment.java index 99d58039..ce0a1a9a 100644 --- a/app/src/main/java/com/openpositioning/PositionMe/presentation/fragment/TrajectoryMapFragment.java +++ b/app/src/main/java/com/openpositioning/PositionMe/presentation/fragment/TrajectoryMapFragment.java @@ -356,6 +356,7 @@ private void initMapSettings(GoogleMap map) { } private void maybeRequestNearbyVenues(@NonNull LatLng loc) { + Log.d("MapDebug", "maybeRequestNearbyVenues called, timeSinceLast=" + (System.currentTimeMillis() - lastVenueQueryMs) + " loc=" + loc); if (indoorMapManager != null && indoorMapManager.getIsIndoorMapSet()) return; long now = System.currentTimeMillis(); @@ -371,6 +372,7 @@ private void maybeRequestNearbyVenues(@NonNull LatLng loc) { Log.d("TrajectoryMapFragment", "maybeRequestNearbyVenues instance=" + System.identityHashCode(this) + " observedMacs=" + macs.size()); + if (macs.isEmpty()) { Log.d("TrajectoryMapFragment", "Skipping floorplan request: no MACs yet"); return; @@ -469,13 +471,16 @@ public void onNothingSelected(AdapterView parent) {} * @param orientation The user’s heading (e.g. from sensor fusion). */ public void updateUserLocation(@NonNull LatLng newLocation, float orientation) { + Log.d("MapDebug", "updateUserLocation called, gMap=" + gMap + " sensorFusion=" + sensorFusion); if (gMap == null) return; + if (sensorFusion == null) sensorFusion = SensorFusion.getInstance(); + // Keep track of current location LatLng oldLocation = this.currentLocation; LatLng correctedLocation = newLocation; float heightChange = 0f; - float[][] particles = sensorFusion.getParticles(); +// float[][] particles = sensorFusion.getParticles(); if (sensorFusion != null) { float currentElevation = sensorFusion.getElevation(); diff --git a/app/src/main/java/com/openpositioning/PositionMe/utils/IndoorMapManager.java b/app/src/main/java/com/openpositioning/PositionMe/utils/IndoorMapManager.java index e2c2e0ff..1e8acd14 100644 --- a/app/src/main/java/com/openpositioning/PositionMe/utils/IndoorMapManager.java +++ b/app/src/main/java/com/openpositioning/PositionMe/utils/IndoorMapManager.java @@ -120,6 +120,8 @@ public void showVenueOutlines(List venues) { polygonToVenue.clear(); for (IndoorVenue venue : venues) { + Log.d("IndoorMapManager", "Adding venue outline: " + venue.name + + " points=" + venue.outline.size()); Polygon poly = gMap.addPolygon( new PolygonOptions() .addAll(venue.outline) diff --git a/app/src/main/java/com/openpositioning/PositionMe/utils/VenueMapper.java b/app/src/main/java/com/openpositioning/PositionMe/utils/VenueMapper.java index c53286a7..f1df5bc1 100644 --- a/app/src/main/java/com/openpositioning/PositionMe/utils/VenueMapper.java +++ b/app/src/main/java/com/openpositioning/PositionMe/utils/VenueMapper.java @@ -28,6 +28,7 @@ import java.util.ArrayList; import java.util.HashMap; +import java.util.Iterator; import java.util.List; import java.util.Map; @@ -35,11 +36,17 @@ public class VenueMapper { public static List toIndoorVenues(List dtos) { List out = new ArrayList<>(); + Log.d("VenueMapper", "toIndoorVenues called, dtos=" + dtos.size()); for (FloorPlanData.VenueDto dto : dtos) { + Log.d("VenueMapper", "Processing dto name=" + dto.name + + " outline length=" + (dto.outline == null ? "null" : dto.outline.length()) + + " mapShapes length=" + (dto.mapShapes == null ? "null" : dto.mapShapes.length())); try { List outline = parseOutlineGeoJson(dto.outline); + Log.d("VenueMapper", "Parsed outline points=" + outline.size()); if (outline.isEmpty()) continue; + // rest unchanged IndoorMapManager.IndoorVenue v = new IndoorMapManager.IndoorVenue(); v.name = dto.name; @@ -111,72 +118,101 @@ private static List parseOutlineGeoJson(String outlineJsonString) throws return floors; } - JSONArray shapesArray = new JSONArray(shapes); + JSONObject floorsObj = new JSONObject(shapes); + Iterator floorKeys = floorsObj.keys(); - for (int k = 0; k < shapesArray.length(); k++) { - JSONObject shape = shapesArray.getJSONObject(k); + while (floorKeys.hasNext()) { + String floorKey = floorKeys.next(); - String floor = String.valueOf(shape.getInt("floor")); - String type = shape.getString("indoor_type"); + JSONObject floorGeoJson = floorsObj.getJSONObject(floorKey); + JSONArray features = floorGeoJson.optJSONArray("features"); - IndoorMapManager.IndoorVenue.FloorFeatures f = floors.get(floor); - //if floor doesn't already exist in indoorvenue.floorfeatures, add it - if (f == null) { - f = new IndoorMapManager.IndoorVenue.FloorFeatures(); - floors.put(floor, f); + IndoorMapManager.IndoorVenue.FloorFeatures floorFeatures = + new IndoorMapManager.IndoorVenue.FloorFeatures(); + + if (features == null) { + floors.put(floorKey, floorFeatures); + continue; } - JSONObject geometry = shape.getJSONObject("geometry"); + for (int i = 0; i < features.length(); i++) { + JSONObject feature = features.getJSONObject(i); - //if wall, parse and add it to list of walls, if stairs, add to stairs, if lift, add to lifts - if (type.equals("wall")) { - String geomType = geometry.optString("type", ""); + JSONObject properties = feature.optJSONObject("properties"); + JSONObject geometry = feature.optJSONObject("geometry"); - if ("Polygon".equalsIgnoreCase(geomType) || - "MultiPolygon".equalsIgnoreCase(geomType)) { - List poly = parsePolygon(geometry); - if (!poly.isEmpty()) { - f.wallPolygons.add(poly); - } - } else if ("LineString".equalsIgnoreCase(geomType)) { - List line = parseLineString(geometry); - f.wallPolylines.addAll(line); + if (properties == null || geometry == null) { + continue; } - } else if (type.equals("stairs")) { - LatLng p = parsePointOrCenter(geometry); - if (p != null) { - f.stairsCenters.add(p); - } + String indoorType = properties.optString("indoor_type", ""); - } else if (type.equals("lift")) { - LatLng p = parsePointOrCenter(geometry); - if (p != null) { - f.liftCenters.add(p); + if ("wall".equalsIgnoreCase(indoorType)) { + List poly = parsePolygon(geometry); + if (!poly.isEmpty()) { + floorFeatures.wallPolygons.add(poly); + } + } else if ("stairs".equalsIgnoreCase(indoorType)) { + LatLng p = parsePointOrCenter(geometry); + if (p != null) { + floorFeatures.stairsCenters.add(p); + } + } else if ("lift".equalsIgnoreCase(indoorType)) { + LatLng p = parsePointOrCenter(geometry); + if (p != null) { + floorFeatures.liftCenters.add(p); + } } } + + floors.put(floorKey, floorFeatures); } return floors; } - private static List parsePolygon(JSONObject geometry) throws Exception { List pts = new ArrayList<>(); + if (geometry == null) { + return pts; + } + String type = geometry.optString("type", ""); - JSONArray coordinates = geometry.getJSONArray("coordinates"); - JSONArray ring; + JSONArray coords = geometry.optJSONArray("coordinates"); + + if (coords == null || coords.length() == 0) { + return pts; + } + + JSONArray ring = null; if ("MultiPolygon".equalsIgnoreCase(type)) { - ring = coordinates.getJSONArray(0).getJSONArray(0); + JSONArray polygon = coords.optJSONArray(0); + if (polygon == null || polygon.length() == 0) { + return pts; + } + + ring = polygon.optJSONArray(0); + if (ring == null || ring.length() == 0) { + return pts; + } + } else if ("Polygon".equalsIgnoreCase(type)) { - ring = coordinates.getJSONArray(0); + ring = coords.optJSONArray(0); + if (ring == null || ring.length() == 0) { + return pts; + } + } else { return pts; } for (int i = 0; i < ring.length(); i++) { - JSONArray p = ring.getJSONArray(i); + JSONArray p = ring.optJSONArray(i); + if (p == null || p.length() < 2) { + continue; + } + double lon = p.getDouble(0); double lat = p.getDouble(1); pts.add(new LatLng(lat, lon)); @@ -185,6 +221,8 @@ private static List parsePolygon(JSONObject geometry) throws Exception { return pts; } + + private static List parseLineString(JSONObject geometry) throws Exception { List pts = new ArrayList<>(); From 03ca99408de7f978269022a3d3069e0d9cafc3cb Mon Sep 17 00:00:00 2001 From: Bhavyas15 Date: Mon, 23 Mar 2026 23:02:45 +0000 Subject: [PATCH 32/82] Data Display --- .../fragment/RecordingFragment.java | 116 ++- .../fragment/TrajectoryMapFragment.java | 788 +++++++++++++++++- .../sensors/ExtendedKalmanFilter.java | 2 +- .../PositionMe/sensors/SensorFusion.java | 15 +- .../res/layout/fragment_trajectory_map.xml | 90 +- 5 files changed, 972 insertions(+), 39 deletions(-) diff --git a/app/src/main/java/com/openpositioning/PositionMe/presentation/fragment/RecordingFragment.java b/app/src/main/java/com/openpositioning/PositionMe/presentation/fragment/RecordingFragment.java index 5b7ee34b..0e65b5fc 100644 --- a/app/src/main/java/com/openpositioning/PositionMe/presentation/fragment/RecordingFragment.java +++ b/app/src/main/java/com/openpositioning/PositionMe/presentation/fragment/RecordingFragment.java @@ -78,6 +78,14 @@ private List getObservedMacsOrEmpty() { return observedMacs == null ? new ArrayList<>() : new ArrayList<>(observedMacs); } + /** Throttle WiFi debug toast to once every 5 seconds. */ + private long lastWifiToastMs = 0; + + + + + + // UI elements private MaterialButton completeButton, cancelButton, markTestPointButton; private ImageView recIcon; @@ -345,6 +353,15 @@ public void onFinish() { /** * Update the UI with sensor data and pass map updates to TrajectoryMapFragment. */ + /** + * Update the UI with sensor data and pass map updates to TrajectoryMapFragment. + * Called every ~200 ms by refreshDataTask. + * + * Passes three types of position to the map: + * - PDR position → updateUserLocation() → red/purple polyline + green dot + * - GNSS position → updateGNSS() → blue polyline + blue dot + * - WiFi position → updateWifiPosition() → amber dot + */ private void updateUIandPosition() { float[] pdrValues = sensorFusion.getSensorValueMap().get(SensorTypes.PDR); if (pdrValues == null) return; @@ -383,27 +400,116 @@ private void updateUIandPosition() { // trajectoryMapFragment.updateObservedMacs(sensorFusion.getLatestBssids()); mapFrag.updateUserLocation(newLocation, (float) Math.toDegrees(sensorFusion.passOrientation())); + +// Added- must be updated to + // --- WiFi position → amber dot --- +// Remove +// LatLng wifiLocation = sensorFusion.getLatLngWifiPositioning(); +// if (wifiLocation != null +// && wifiLocation.latitude != 0.0 +// && wifiLocation.longitude != 0.0) { +// mapFrag.updateWifiPosition(wifiLocation); +// } + // Drive the arrow marker and purple polyline with the fused position + double[] fused = sensorFusion.getFusedLatLon(); + if (fused != null) { + mapFrag.updateFusedPosition(new LatLng(fused[0], fused[1])); + } + // Amber WiFi observation dot — raw WiFi fix from OpenPositioning API +// double[] wifi = sensorFusion.getLastWifiLatLon(); +// if (wifi != null) { +// mapFrag.updateWifiPosition(new LatLng(wifi[0], wifi[1])); +// } + double[] wifi = sensorFusion.getLastWifiLatLon(); + if (wifi != null) { + mapFrag.updateWifiPosition(new LatLng(wifi[0], wifi[1])); + if (System.currentTimeMillis() - lastWifiToastMs > 5000) { + lastWifiToastMs = System.currentTimeMillis(); + Toast.makeText(requireContext(), + "WiFi fix: " + String.format("%.5f, %.5f", wifi[0], wifi[1]), + Toast.LENGTH_SHORT).show(); + } + } else { + if (System.currentTimeMillis() - lastWifiToastMs > 5000) { + lastWifiToastMs = System.currentTimeMillis(); + Toast.makeText(requireContext(), + "WiFi: no fix yet", + Toast.LENGTH_SHORT).show(); + } + } + + // Green PDR observation dot — raw PDR position from step counting +// double[] pdr = sensorFusion.getLastPdrLatLon(); +// if (pdr != null) { +// mapFrag.updatePdrPosition(new LatLng(pdr[0], pdr[1])); +// } + +// changed + // Green PDR observation dot — same position as the red polyline + mapFrag.updatePdrPosition(newLocation); } } + // GNSS logic if you want to show GNSS error, etc. - float[] gnss = sensorFusion.getSensorValueMap().get(SensorTypes.GNSSLATLONG); - if (gnss != null && trajectoryMapFragment != null) { - // If user toggles showing GNSS in the map, call e.g. +// float[] gnss = sensorFusion.getSensorValueMap().get(SensorTypes.GNSSLATLONG); +// if (gnss != null && trajectoryMapFragment != null) { +// // If user toggles showing GNSS in the map, call e.g. +// if (trajectoryMapFragment.isGnssEnabled()) { +// LatLng gnssLocation = new LatLng(gnss[0], gnss[1]); +// LatLng currentLoc = trajectoryMapFragment.getCurrentLocation(); +// if (currentLoc != null) { +// double errorDist = UtilFunctions.distanceBetweenPoints(currentLoc, gnssLocation); +// gnssError.setVisibility(View.VISIBLE); +// gnssError.setText(String.format(getString(R.string.gnss_error) + "%.2fm", errorDist)); +// } +// trajectoryMapFragment.updateGNSS(gnssLocation); +// } else { +// gnssError.setVisibility(View.GONE); +// trajectoryMapFragment.clearGNSS(); +// } +// } + +// changed to- +// double[] gnssRaw = sensorFusion.getLastGnssLatLon(); +// if (gnssRaw != null && trajectoryMapFragment != null) { +// if (trajectoryMapFragment.isGnssEnabled()) { +// LatLng gnssLocation = new LatLng(gnssRaw[0], gnssRaw[1]); +// LatLng currentLoc = trajectoryMapFragment.getCurrentLocation(); +// if (currentLoc != null) { +// double errorDist = UtilFunctions.distanceBetweenPoints(currentLoc, gnssLocation); +// gnssError.setVisibility(View.VISIBLE); +// gnssError.setText(String.format(getString(R.string.gnss_error) + "%.2fm", errorDist)); +// } +// trajectoryMapFragment.updateGNSS(gnssLocation); +// } else { +// gnssError.setVisibility(View.GONE); +// trajectoryMapFragment.clearGNSS(); +// } +// } +// changed to- + double[] gnssRaw = sensorFusion.getLastGnssLatLon(); + if (gnssRaw != null && trajectoryMapFragment != null) { + LatLng gnssLocation = new LatLng(gnssRaw[0], gnssRaw[1]); + + // Always call updateGNSS — the fragment decides internally what to show + // based on isGnssOn (marker/path) and showGnssDots (dots) + trajectoryMapFragment.updateGNSS(gnssLocation); + + // Show GNSS error distance only when GNSS switch is on if (trajectoryMapFragment.isGnssEnabled()) { - LatLng gnssLocation = new LatLng(gnss[0], gnss[1]); LatLng currentLoc = trajectoryMapFragment.getCurrentLocation(); if (currentLoc != null) { double errorDist = UtilFunctions.distanceBetweenPoints(currentLoc, gnssLocation); gnssError.setVisibility(View.VISIBLE); gnssError.setText(String.format(getString(R.string.gnss_error) + "%.2fm", errorDist)); } - trajectoryMapFragment.updateGNSS(gnssLocation); } else { gnssError.setVisibility(View.GONE); trajectoryMapFragment.clearGNSS(); } } + RecordingActivity act = (RecordingActivity) requireActivity(); String v = act.getSelectedVenueIdOrName(); selectedVenueText.setText("Venue: " + (v == null ? "none" : v)); diff --git a/app/src/main/java/com/openpositioning/PositionMe/presentation/fragment/TrajectoryMapFragment.java b/app/src/main/java/com/openpositioning/PositionMe/presentation/fragment/TrajectoryMapFragment.java index 34089b5c..a35e7fc2 100644 --- a/app/src/main/java/com/openpositioning/PositionMe/presentation/fragment/TrajectoryMapFragment.java +++ b/app/src/main/java/com/openpositioning/PositionMe/presentation/fragment/TrajectoryMapFragment.java @@ -2,6 +2,7 @@ import android.graphics.Color; import android.os.Bundle; +import android.os.Handler; import android.util.Log; import android.view.LayoutInflater; import android.view.View; @@ -30,6 +31,8 @@ import java.util.ArrayList; import java.util.List; +import java.util.Queue; +import java.util.LinkedList; import com.openpositioning.PositionMe.data.remote.FloorPlanData; import com.openpositioning.PositionMe.utils.VenueMapper; @@ -46,7 +49,8 @@ import com.google.android.gms.maps.model.BitmapDescriptorFactory; import com.google.android.gms.maps.model.MarkerOptions; - +import com.google.android.gms.maps.model.Circle; +import com.google.android.gms.maps.model.CircleOptions; /** * A fragment responsible for displaying a trajectory map using Google Maps. @@ -80,6 +84,8 @@ public class TrajectoryMapFragment extends Fragment { private LatLng currentLocation; // Stores the user's current location private Marker orientationMarker; // Marker representing user's heading private Marker gnssMarker; // GNSS position marker + + /** Raw (unfiltered) PDR trajectory — drawn in red. */ private Polyline polyline; // Polyline representing user's movement path private boolean isRed = true; // Tracks whether the polyline color is red private boolean isGnssOn = false; // Tracks if GNSS tracking is enabled @@ -94,6 +100,118 @@ public class TrajectoryMapFragment extends Fragment { private SensorFusion sensorFusion; private TextView floorLabel; + // Added +// /** Raw (unfiltered) PDR trajectory — drawn in red. */ +// private Polyline rawPolyline; + + /** Smoothed trajectory — drawn in purple, visible only when smoothing is ON. */ + private Polyline smoothedPolyline; + + private static final String TAG = "TrajectoryMapFragment"; + + /** + * Minimum distance in metres a position must move before a new dot is placed. + * Prevents dots stacking on each other when the user is stationary. + */ + private static final float MIN_DOT_SPACING_METRES = 2.0f; + + /** Number of recent observations kept per source for colour-coded dots. */ + private static final int MAX_OBSERVATION_MARKERS = 10; + + + /** Default rolling-window size for observation dots. */ + private static final int DEFAULT_MAX_OBSERVATIONS = 5; + + // Dot fill colours + private static final int COLOR_GNSS = Color.parseColor("#2196F3"); // blue + private static final int COLOR_WIFI = Color.parseColor("#FF9800"); // amber + private static final int COLOR_PDR = Color.parseColor("#4CAF50"); // green + /** + * Low-pass filter alpha. Range [0,1]. + * Lower = smoother but more lag; higher = less smoothing but more responsive. + */ + private static final double LOW_PASS_ALPHA = 0.25; + + // ------------------------------------------------------------------------- + // Smoothing state + // ------------------------------------------------------------------------- + + /** Whether the smoothed (purple) polyline is currently shown instead of raw. */ + private boolean isSmoothingEnabled = false; + + /** Running smoothed position for the low-pass filter. */ + private LatLng smoothedPosition = null; + + /** Full list of smoothed positions (mirrors rawPolyline but filtered). */ + private final List smoothedPoints = new ArrayList<>(); + +// // ------------------------------------------------------------------------- +// // Colour-coded observation markers (last N per source) +// // ------------------------------------------------------------------------- +// +// /** Circular buffer of recent GNSS observation markers (shown in blue). */ +// private final Queue gnssObservationMarkers = new LinkedList<>(); +// +// /** Circular buffer of recent WiFi observation markers (shown in orange/amber). */ +// private final Queue wifiObservationMarkers = new LinkedList<>(); +// +// /** Circular buffer of recent PDR observation markers (shown in green). */ +// private final Queue pdrObservationMarkers = new LinkedList<>(); + + // ------------------------------------------------------------------------- + // Observation dot state + // ------------------------------------------------------------------------- + + /** Current rolling-window size — updated when user changes the N input. */ +// private int maxObservations = DEFAULT_MAX_OBSERVATIONS; + private final int maxObservations = 5; + + // Per-source visibility flags (all enabled by default) + private boolean showGnssDots = true; + private boolean showWifiDots = true; + private boolean showPdrDots = true; + + // Per-source rolling queues of on-map markers + private final LinkedList gnssObservationMarkers = new LinkedList<>(); + private final LinkedList wifiObservationMarkers = new LinkedList<>(); + private final LinkedList pdrObservationMarkers = new LinkedList<>(); + + /** + * Position where the most recent dot was placed for each source. + * Used by {@link #hasMoved} to enforce the minimum spacing threshold. + */ + private LatLng lastGnssDotPos = null; + private LatLng lastWifiDotPos = null; + private LatLng lastPdrDotPos = null; + + /** If true, the arrow marker follows the fused (particle filter) position. + * If false, it follows the raw PDR position. + * Controlled by the fusedPdrSwitch toggle. */ + private boolean useFusedPosition = true; + + /** LPF-smoothed fused trajectory — teal, visible only when smoothing toggle is ON. */ + private Polyline lpfPolyline; + + /** Full list of LPF-smoothed fused positions. */ + private final List lpfPoints = new ArrayList<>(); + + /** Semi-transparent uncertainty circle around the fused position marker. + * Radius = getPositionUncertainty(). Colour reflects confidence level. */ + private Circle uncertaintyCircle; + /** Particle cloud markers — faint grey dots showing filter spread. */ + private final List particleMarkers = new ArrayList<>(); + + /** Throttle particle cloud redraws to every 2 seconds. */ + private long lastParticleRedrawMs = 0; + + /** Whether particle cloud overlay is enabled — toggled by UI switch. */ + private boolean showParticleCloud = false; + + + + + + @@ -103,6 +221,42 @@ public class TrajectoryMapFragment extends Fragment { private SwitchMaterial gnssSwitch; private SwitchMaterial autoFloorSwitch; + // Added + private SwitchMaterial smoothingSwitch; + + private SwitchMaterial gnssDotSwitch; + private SwitchMaterial wifiDotSwitch; + private SwitchMaterial pdrDotSwitch; + +// Added + private SwitchMaterial fusedPdrSwitch; + // ── Fused trajectory display ────────────────────────────────────────────── + + /** Handler that drives the 1-second periodic polyline redraw. */ + private final android.os.Handler trajectoryUpdateHandler = + new android.os.Handler(android.os.Looper.getMainLooper()); + + /** True while the fragment is visible and updates should fire. */ + private boolean isTrajectoryUpdateRunning = false; + + /** + * Snapshot of smoothedPoints last drawn onto the polyline. + * Compared against the live list so we only redraw when there is + * actually something new to show. + */ + private int lastDrawnPointCount = 0; + + /** 1-second runnable — redraws the fused polyline then reschedules itself. */ + private final Runnable trajectoryUpdateRunnable = new Runnable() { + @Override + public void run() { + redrawFusedTrajectory(); + if (isTrajectoryUpdateRunning) { + trajectoryUpdateHandler.postDelayed(this, 1000); + } + } + }; + private com.google.android.material.floatingactionbutton.FloatingActionButton floorUpButton, floorDownButton; private Button switchColorButton; private Polygon buildingPolygon; @@ -119,7 +273,7 @@ public class TrajectoryMapFragment extends Fragment { // cache venues if they arrive before map/manager is ready (optional) private List lastFetchedVenues = null; - + private SwitchMaterial particleCloudSwitch; public TrajectoryMapFragment() { // Required empty public constructor @@ -143,6 +297,12 @@ public void onViewCreated(@NonNull View view, switchMapSpinner = view.findViewById(R.id.mapSwitchSpinner); gnssSwitch = view.findViewById(R.id.gnssSwitch); autoFloorSwitch = view.findViewById(R.id.autoFloor); + smoothingSwitch = view.findViewById(R.id.smoothingSwitch); + fusedPdrSwitch = view.findViewById(R.id.fusedPdrSwitch); + particleCloudSwitch = view.findViewById(R.id.particleCloudSwitch); + gnssDotSwitch = view.findViewById(R.id.gnssDotSwitch); + wifiDotSwitch = view.findViewById(R.id.wifiDotSwitch); + pdrDotSwitch = view.findViewById(R.id.pdrDotSwitch); floorUpButton = view.findViewById(R.id.floorUpButton); floorUpButton.setOnClickListener(v -> indoorMapManager.increaseFloor()); floorDownButton = view.findViewById(R.id.floorDownButton); @@ -246,6 +406,43 @@ public void onMapReady(@NonNull GoogleMap googleMap) { autoFloorSwitch.setOnCheckedChangeListener((compoundButton, isChecked) -> { }); + // Smoothing toggle + smoothingSwitch.setOnCheckedChangeListener((buttonView, isChecked) -> { + isSmoothingEnabled = isChecked; + updatePolylineVisibility(); + Log.d(TAG, "Smoothing toggled: " + isChecked); + }); + + fusedPdrSwitch.setOnCheckedChangeListener((btn, isChecked) -> { + useFusedPosition = isChecked; + Log.d(TAG, "Position mode: " + (isChecked ? "Fused" : "PDR")); + }); + + particleCloudSwitch.setOnCheckedChangeListener((btn, isChecked) -> { + showParticleCloud = isChecked; + // Hide all existing particles immediately when toggled off + if (!isChecked) { + clearParticleCloud(); + } + Log.d(TAG, "Particle cloud: " + (isChecked ? "ON" : "OFF")); + }); + + // Dot visibility toggles — also immediately show/hide existing dots + gnssDotSwitch.setOnCheckedChangeListener((btn, isChecked) -> { + showGnssDots = isChecked; + setQueueVisibility(gnssObservationMarkers, isChecked); + }); + + wifiDotSwitch.setOnCheckedChangeListener((btn, isChecked) -> { + showWifiDots = isChecked; + setQueueVisibility(wifiObservationMarkers, isChecked); + }); + + pdrDotSwitch.setOnCheckedChangeListener((btn, isChecked) -> { + showPdrDots = isChecked; + setQueueVisibility(pdrObservationMarkers, isChecked); + }); + floorUpButton.setOnClickListener(v -> { // If user manually changes floor, turn off auto floor autoFloorSwitch.setChecked(false); @@ -270,6 +467,23 @@ public void onMapReady(@NonNull GoogleMap googleMap) { }); } + @Override + public void onResume() { + super.onResume(); + // Start the 1-second fused trajectory update loop + isTrajectoryUpdateRunning = true; + trajectoryUpdateHandler.postDelayed(trajectoryUpdateRunnable, 1000); + } + + @Override + public void onPause() { + super.onPause(); + // Stop the loop when fragment is not visible to avoid wasted redraws + isTrajectoryUpdateRunning = false; + trajectoryUpdateHandler.removeCallbacks(trajectoryUpdateRunnable); + } + + /** * Initialize the map settings with the provided GoogleMap instance. *

@@ -281,6 +495,17 @@ public void onMapReady(@NonNull GoogleMap googleMap) { * @param map */ + // ------------------------------------------------------------------------- + // Test point markers + // ------------------------------------------------------------------------- + + /** + * Creates a numbered red circle marker bitmap for a test point. + * + * @param number the test point index to display inside the circle. + * @return a {@link Bitmap} with a numbered red circle. + */ + private Bitmap createNumberedMarkerBitmap(int number) { int size = 100; // marker size in pixels @@ -338,6 +563,7 @@ private void initMapSettings(GoogleMap map) { // Initialize indoor manager indoorMapManager = new IndoorMapManager(map); + // Raw PDR trajectory — red, always present // Initialize an empty polyline polyline = map.addPolyline(new PolylineOptions() .color(Color.RED) @@ -351,6 +577,29 @@ private void initMapSettings(GoogleMap map) { .width(5f) .add() // start empty ); + + // Added + // Smoothed trajectory — purple, only visible when smoothing is ON + // Raw fused trajectory — purple, always visible + smoothedPolyline = map.addPolyline(new PolylineOptions() + .color(Color.parseColor("#8B00FF")) + .width(6f) + .visible(true)); + + // LPF-smoothed fused trajectory — teal, only visible when smoothing toggle is ON + lpfPolyline = map.addPolyline(new PolylineOptions() + .color(Color.parseColor("#00BCD4")) + .width(7f) + .visible(false)); + + // Uncertainty circle — invisible until first fused position arrives + uncertaintyCircle = map.addCircle(new CircleOptions() + .center(new LatLng(0, 0)) + .radius(0) + .fillColor(Color.argb(50, 0, 255, 0)) // semi-transparent green initially + .strokeColor(Color.argb(100, 0, 255, 0)) + .strokeWidth(2f) + .visible(false)); } private void maybeRequestNearbyVenues(@NonNull LatLng loc) { @@ -499,6 +748,32 @@ public void updateUserLocation(@NonNull LatLng newLocation, float orientation) { polyline.setPoints(points); } + // Added + // --- Compute and extend smoothed polyline --- +// LatLng filtered = applyLowPassFilter(newLocation); +// if (oldLocation != null && !oldLocation.equals(newLocation)) { +// smoothedPoints.add(filtered); +// if (smoothedPolyline != null) { +// smoothedPolyline.setPoints(new ArrayList<>(smoothedPoints)); +// } +// } + +// changed to- + // Extend smoothed polyline and trigger immediate fused trajectory redraw +// LatLng filtered = applyLowPassFilter(newLocation); +// if (oldLocation != null && !oldLocation.equals(newLocation)) { +// smoothedPoints.add(filtered); +// // Movement detected — redraw immediately rather than waiting for the 1s timer +// redrawFusedTrajectory(); +// } + + + // Green PDR dot — only when moved enough +// if (showPdrDots && hasMoved(newLocation, lastPdrDotPos)) { +// addObservationMarker(newLocation, COLOR_PDR, pdrObservationMarkers); +// lastPdrDotPos = newLocation; +// } + // Update indoor map overlay if (indoorMapManager != null) { @@ -512,7 +787,67 @@ public void updateUserLocation(@NonNull LatLng newLocation, float orientation) { } } + /** + * Adds a green PDR observation dot at the raw PDR-derived position. + * Uses getLastPdrLatLon() from SensorFusion — called from RecordingFragment. + * Only places a dot if the PDR dot toggle is ON and the position has moved + * at least MIN_DOT_SPACING_METRES from the last PDR dot. + * + * @param pdrLocation raw PDR position converted to WGS84 lat/lon. + */ + public void updatePdrPosition(@NonNull LatLng pdrLocation) { + if (gMap == null) return; + if (showPdrDots && hasMoved(pdrLocation, lastPdrDotPos)) { + addObservationMarker(pdrLocation, COLOR_PDR, pdrObservationMarkers); + lastPdrDotPos = pdrLocation; + } + } + + /** + * Updates the arrow marker and both fused trajectory polylines. + * + * - Purple line: raw particle filter output, always visible + * - Teal line: LPF applied on top of fused output, toggle-controlled + * + * @param fusedLocation best position estimate from the particle filter. + */ + public void updateFusedPosition(@NonNull LatLng fusedLocation) { + if (gMap == null) return; + + // Raw fused path — purple, always grows + smoothedPoints.add(fusedLocation); + redrawFusedTrajectory(); + + // Update uncertainty circle around the fused marker + updateUncertaintyCircle(fusedLocation); + + // Redraw particle cloud overlay (throttled to every 2s) + redrawParticleCloud(); + // LPF-smoothed fused path — teal, grows but only visible when toggle is ON + LatLng lpfFiltered = applyLowPassFilter(fusedLocation); + lpfPoints.add(lpfFiltered); + if (lpfPolyline != null) { + lpfPolyline.setPoints(new ArrayList<>(lpfPoints)); + } + + // Move arrow marker if fused mode is selected + if (!useFusedPosition) return; + + if (orientationMarker == null) { + orientationMarker = gMap.addMarker(new MarkerOptions() + .position(fusedLocation) + .flat(true) + .title("Current Position") + .icon(BitmapDescriptorFactory.fromBitmap( + UtilFunctions.getBitmapFromVector(requireContext(), + R.drawable.ic_baseline_navigation_24)))); + gMap.moveCamera(CameraUpdateFactory.newLatLngZoom(fusedLocation, 19f)); + } else { + orientationMarker.setPosition(fusedLocation); + gMap.moveCamera(CameraUpdateFactory.newLatLng(fusedLocation)); + } + } /** * Set the initial camera position for the map. @@ -547,32 +882,407 @@ public LatLng getCurrentLocation() { /** * Called when we want to set or update the GNSS marker position */ +// public void updateGNSS(@NonNull LatLng gnssLocation) { +// if (gMap == null) return; +// if (!isGnssOn) return; +// +// if (gnssMarker == null) { +// // Create the GNSS marker for the first time +// gnssMarker = gMap.addMarker(new MarkerOptions() +// .position(gnssLocation) +// .title("GNSS Position") +// .icon(BitmapDescriptorFactory +// .defaultMarker(BitmapDescriptorFactory.HUE_AZURE))); +// lastGnssLocation = gnssLocation; +// } else { +// // Move existing GNSS marker +// gnssMarker.setPosition(gnssLocation); +// +// // Add a segment to the blue GNSS line, if this is a new location +// if (lastGnssLocation != null && !lastGnssLocation.equals(gnssLocation)) { +// List gnssPoints = new ArrayList<>(gnssPolyline.getPoints()); +// gnssPoints.add(gnssLocation); +// gnssPolyline.setPoints(gnssPoints); +// } +// lastGnssLocation = gnssLocation; +// } +// +// // Blue GNSS dot — only when moved enough +// if (showGnssDots && hasMoved(gnssLocation, lastGnssDotPos)) { +// addObservationMarker(gnssLocation, COLOR_GNSS, gnssObservationMarkers); +// lastGnssDotPos = gnssLocation; +// } +// +// } + + /** + * Updates the GNSS marker and polyline, and places a blue GNSS observation dot. + * + * The GNSS marker and blue path line are only shown when the GNSS switch is ON. + * The blue observation dots are controlled independently by the GNSS dot switch + * (showGnssDots) — they appear regardless of the GNSS path switch state. + * + * @param gnssLocation latest raw GNSS fix. + */ public void updateGNSS(@NonNull LatLng gnssLocation) { if (gMap == null) return; - if (!isGnssOn) return; - - if (gnssMarker == null) { - // Create the GNSS marker for the first time - gnssMarker = gMap.addMarker(new MarkerOptions() - .position(gnssLocation) - .title("GNSS Position") - .icon(BitmapDescriptorFactory - .defaultMarker(BitmapDescriptorFactory.HUE_AZURE))); - lastGnssLocation = gnssLocation; - } else { - // Move existing GNSS marker - gnssMarker.setPosition(gnssLocation); - - // Add a segment to the blue GNSS line, if this is a new location - if (lastGnssLocation != null && !lastGnssLocation.equals(gnssLocation)) { - List gnssPoints = new ArrayList<>(gnssPolyline.getPoints()); - gnssPoints.add(gnssLocation); - gnssPolyline.setPoints(gnssPoints); + + // GNSS marker and path line — only when GNSS switch is ON + if (isGnssOn) { + if (gnssMarker == null) { + gnssMarker = gMap.addMarker(new MarkerOptions() + .position(gnssLocation) + .title("GNSS Position") + .icon(BitmapDescriptorFactory + .defaultMarker(BitmapDescriptorFactory.HUE_AZURE))); +// lastGnssLocation = gnssLocation; + } else { + gnssMarker.setPosition(gnssLocation); + if (lastGnssLocation != null && !lastGnssLocation.equals(gnssLocation)) { + List gnssPoints = new ArrayList<>(gnssPolyline.getPoints()); + gnssPoints.add(gnssLocation); + gnssPolyline.setPoints(gnssPoints); + } } - lastGnssLocation = gnssLocation; + } +// Always update lastGnssLocation — needed so path builds correctly + // when gnssSwitch is turned ON mid-session + lastGnssLocation = gnssLocation; + + // Blue dot — independent of gnssSwitch, only controlled by gnssDotSwitch + if (showGnssDots && hasMoved(gnssLocation, lastGnssDotPos)) { + addObservationMarker(gnssLocation, COLOR_GNSS, gnssObservationMarkers); + lastGnssDotPos = gnssLocation; } } + /** + * Updates the map with the latest WiFi position fix and adds an amber WiFi + * observation dot. Called from RecordingFragment whenever a new WiFi position + * is available from SensorFusion. + * + * @param wifiLocation the WiFi-derived position. + */ + public void updateWifiPosition(@NonNull LatLng wifiLocation) { + if (gMap == null) return; + + if (showWifiDots && hasMoved(wifiLocation, lastWifiDotPos)) { + addObservationMarker(wifiLocation, COLOR_WIFI, wifiObservationMarkers); + lastWifiDotPos = wifiLocation; + } + Log.d(TAG, "WiFi position updated: " + wifiLocation); + } + + // ------------------------------------------------------------------------- + // Distance threshold — fixes dot stacking when stationary + // ------------------------------------------------------------------------- + + /** + * Returns {@code true} if {@code newPos} is at least + * {@value MIN_DOT_SPACING_METRES} metres from {@code lastPos}. + * Returns {@code true} unconditionally when {@code lastPos} is {@code null} + * (the very first dot for this source). + * + *

Why this matters: position updates arrive every 200 ms regardless + * of whether the user has moved. Without this guard every call would add a dot, + * so standing still would burn through the entire rolling window at one location, + * leaving no dots along the actual path.

+ * + * @param newPos candidate position for the new dot. + * @param lastPos position of the most recent dot ({@code null} if none yet). + * @return {@code true} if a new dot should be placed. + */ + private boolean hasMoved(@NonNull LatLng newPos, @Nullable LatLng lastPos) { + if (lastPos == null) return true; + float[] result = new float[1]; + android.location.Location.distanceBetween( + lastPos.latitude, lastPos.longitude, + newPos.latitude, newPos.longitude, + result); + return result[0] >= MIN_DOT_SPACING_METRES; + } + + // ------------------------------------------------------------------------- + // Smoothing — low-pass filter + // ------------------------------------------------------------------------- + + /** + * Applies a low-pass filter to the incoming position. The filter blends the + * previous smoothed position with the new raw position using {@link #LOW_PASS_ALPHA}. + * + *

A lower alpha produces a smoother path with more lag; a higher alpha + * follows the raw data more closely. The current value of 0.25 gives a good + * balance for indoor walking speeds.

+ * + * @param newPoint the raw position to filter. + * @return the filtered position. + */ + private LatLng applyLowPassFilter(@NonNull LatLng newPoint) { + if (smoothedPosition == null) { + // First point — initialise filter state + smoothedPosition = newPoint; + return newPoint; + } + double lat = smoothedPosition.latitude + + LOW_PASS_ALPHA * (newPoint.latitude - smoothedPosition.latitude); + double lng = smoothedPosition.longitude + + LOW_PASS_ALPHA * (newPoint.longitude - smoothedPosition.longitude); + smoothedPosition = new LatLng(lat, lng); + return smoothedPosition; + } + + /** + * Controls visibility of the LPF-smoothed fused polyline. + * The red PDR line and purple fused line are always visible. + * Only the teal LPF line is toggled by the smoothing switch. + */ + private void updatePolylineVisibility() { + if (lpfPolyline != null) { + lpfPolyline.setVisible(isSmoothingEnabled); + } + } + + /** + * Updates the uncertainty circle around the fused position marker. + * + * Radius is taken from SensorFusion.getPositionUncertainty() which returns + * the standard deviation of the particle cloud in metres: + * < 5m → green (filter confident) + * 5–15m → yellow (moderate uncertainty) + * > 15m → red (filter uncertain / diverged) + * + * The circle is hidden when the filter returns -1 (not yet initialised). + * + * @param centre the current fused position — centre of the circle. + */ + private void updateUncertaintyCircle(@NonNull LatLng centre) { + if (uncertaintyCircle == null) return; + + double uncertainty = SensorFusion.getInstance().getPositionUncertainty(); + + // Filter not yet initialised — hide the circle + if (uncertainty < 0) { + uncertaintyCircle.setVisible(false); + return; + } + + // Choose colour based on confidence level + int fillColor; + int strokeColor; + if (uncertainty < 5.0) { + // Green — confident + fillColor = Color.argb(50, 0, 200, 0); + strokeColor = Color.argb(150, 0, 200, 0); + } else if (uncertainty <= 15.0) { + // Yellow — moderate + fillColor = Color.argb(50, 255, 200, 0); + strokeColor = Color.argb(150, 255, 200, 0); + } else { + // Red — uncertain + fillColor = Color.argb(50, 220, 0, 0); + strokeColor = Color.argb(150, 220, 0, 0); + } + + uncertaintyCircle.setCenter(centre); + uncertaintyCircle.setRadius(uncertainty); + uncertaintyCircle.setFillColor(fillColor); + uncertaintyCircle.setStrokeColor(strokeColor); + uncertaintyCircle.setVisible(true); + + Log.d(TAG, "Uncertainty circle: radius=" + String.format("%.1f", uncertainty) + "m"); + } + + /** + * Redraws the particle cloud overlay from the current particle positions. + * + * Each particle from getParticles() is in local ENU metres and is converted + * to LatLng via SensorFusion.enuToLatLon() before being rendered as a small + * faint grey circle on the map. + * + * Throttled to redraw at most every 2 seconds to avoid performance issues + * from recreating 300 map objects on every position update. + * + * Only runs when showParticleCloud is true. + */ + private void redrawParticleCloud() { + if (!showParticleCloud || gMap == null) return; + + long now = System.currentTimeMillis(); + if (now - lastParticleRedrawMs < 2000) return; // 2s throttle + lastParticleRedrawMs = now; + + float[][] particles = SensorFusion.getInstance().getParticles(); + if (particles == null || particles.length == 0) return; + + // Remove old particle circles + clearParticleCloud(); + + // Draw new ones + for (float[] particle : particles) { + double[] latLon = SensorFusion.getInstance().enuToLatLon(particle[0], particle[1]); + if (latLon == null) continue; + + Circle dot = gMap.addCircle(new CircleOptions() + .center(new LatLng(latLon[0], latLon[1])) + .radius(0.8) // 0.8m radius dot + .fillColor(Color.argb(60, 120, 120, 120)) // faint grey + .strokeWidth(0f) // no border + .zIndex(0f)); // behind everything + particleMarkers.add(dot); + } + + Log.d(TAG, "Particle cloud redrawn: " + particles.length + " particles"); + } + + /** + * Removes all particle circle overlays from the map and clears the list. + */ + private void clearParticleCloud() { + for (Circle c : particleMarkers) { + if (c != null) c.remove(); + } + particleMarkers.clear(); + } + + /** + * Redraws the fused (smoothed) trajectory polyline if new points have + * arrived since the last draw. + * + *

Called on two triggers: + *

    + *
  1. Every 1 second by {@link #trajectoryUpdateRunnable}.
  2. + *
  3. Immediately from {@link #updateUserLocation} when movement is + * detected (i.e. the position has actually changed).
  4. + *
+ * Only updates the polyline when the point count has grown, avoiding + * unnecessary Google Maps redraws.

+ */ + private void redrawFusedTrajectory() { + if (smoothedPolyline == null || smoothedPoints.isEmpty()) return; + if (smoothedPoints.size() == lastDrawnPointCount) return; // nothing new + + smoothedPolyline.setPoints(new ArrayList<>(smoothedPoints)); + lastDrawnPointCount = smoothedPoints.size(); + Log.d(TAG, "Fused trajectory redrawn — " + lastDrawnPointCount + " points"); + } + + // ------------------------------------------------------------------------- + // Colour-coded observation markers + // ------------------------------------------------------------------------- + + /** + * Adds a numbered observation dot at the given position for the specified source. + * + * After adding, ALL markers in the queue are renumbered so that: + * - The newest dot always shows "1" + * - The oldest dot shows the highest number (up to MAX_OBSERVATION_MARKERS) + * + * When the queue is full, the oldest marker is removed before the new one is added. + * + * @param position the observation position. + * @param color the fill colour for this source. + * @param markerQueue the rolling window queue for this source. + */ + private void addObservationMarker(@NonNull LatLng position, + int color, + @NonNull Queue markerQueue) { + if (gMap == null) return; + + // Remove oldest marker when the window is full + if (markerQueue.size() >= maxObservations) { + Marker oldest = markerQueue.poll(); + if (oldest != null) oldest.remove(); + } + + // Add the new dot — starts as number 1 (most recent), others will be renumbered below + Marker newDot = gMap.addMarker(new MarkerOptions() + .position(position) + .icon(BitmapDescriptorFactory.fromBitmap( + createNumberedDotBitmap(color, 1))) + .anchor(0.5f, 0.5f) + .zIndex(2f)); + + if (newDot != null) { + // Store the dot colour as the tag so we can recreate its bitmap when renumbering + newDot.setTag(color); + markerQueue.add(newDot); + } + + // Renumber all markers: newest = 1, oldest = queue.size() + // The queue is ordered oldest-first (LinkedList), so we iterate in reverse + List markerList = new ArrayList<>(markerQueue); + int total = markerList.size(); + for (int i = 0; i < total; i++) { + Marker m = markerList.get(i); + if (m == null) continue; + int recencyNumber = total - i; // oldest gets highest number + Object tag = m.getTag(); + int markerColor = (tag instanceof Integer) ? (int) tag : color; + m.setIcon(BitmapDescriptorFactory.fromBitmap( + createNumberedDotBitmap(markerColor, recencyNumber))); + } + } + + // ------------------------------------------------------------------------- + // Dot queue visibility + // ------------------------------------------------------------------------- + + /** + * Shows or hides all markers in a queue immediately. Called when the user + * flips one of the three dot-source switches. + */ + private void setQueueVisibility(@NonNull LinkedList queue, boolean visible) { + for (Marker m : queue) if (m != null) m.setVisible(visible); + + } + +// added- + /** + * Creates a numbered circle bitmap for an observation dot marker. + * The number shows recency — 1 is the most recent observation. + * Numbers are updated across the whole queue after each new dot is added. + * + * @param color fill colour of the dot. + * @param number the recency label to display (1 = most recent). + * @return a 40×40 px Bitmap with a filled circle and white number. + */ + private Bitmap createNumberedDotBitmap(int color, int number) { + int size = 40; + Bitmap bitmap = Bitmap.createBitmap(size, size, Bitmap.Config.ARGB_8888); + Canvas canvas = new Canvas(bitmap); + + // Filled circle + Paint fillPaint = new Paint(); + fillPaint.setColor(color); + fillPaint.setAntiAlias(true); + fillPaint.setStyle(Paint.Style.FILL); + canvas.drawCircle(size / 2f, size / 2f, size / 2f - 2, fillPaint); + + // White border + Paint borderPaint = new Paint(); + borderPaint.setColor(Color.WHITE); + borderPaint.setAntiAlias(true); + borderPaint.setStyle(Paint.Style.STROKE); + borderPaint.setStrokeWidth(2.5f); + canvas.drawCircle(size / 2f, size / 2f, size / 2f - 2, borderPaint); + + // Number text + Paint textPaint = new Paint(); + textPaint.setColor(Color.WHITE); + textPaint.setAntiAlias(true); + textPaint.setTextSize(16f); + textPaint.setTypeface(Typeface.DEFAULT_BOLD); + textPaint.setTextAlign(Paint.Align.CENTER); + + Rect bounds = new Rect(); + String text = String.valueOf(number); + textPaint.getTextBounds(text, 0, text.length(), bounds); + float textY = size / 2f - bounds.centerY(); + canvas.drawText(text, size / 2f, textY, textPaint); + + return bitmap; + } + /** * Remove GNSS marker if user toggles it off @@ -614,9 +1324,28 @@ public void clearMapAndReset() { gnssMarker.remove(); gnssMarker = null; } + if (uncertaintyCircle != null) { + uncertaintyCircle.remove(); + uncertaintyCircle = null; + } + lastGnssLocation = null; currentLocation = null; + smoothedPoints.clear(); + lpfPoints.clear(); + smoothedPosition = null; // reset LPF filter state + + clearParticleCloud(); + lastParticleRedrawMs = 0; + + // Reset fused trajectory state + lastDrawnPointCount = 0; + trajectoryUpdateHandler.removeCallbacks(trajectoryUpdateRunnable); + if (isTrajectoryUpdateRunning) { + trajectoryUpdateHandler.postDelayed(trajectoryUpdateRunnable, 1000); + } + // Re-create empty polylines with your chosen colors if (gMap != null) { polyline = gMap.addPolyline(new PolylineOptions() @@ -627,6 +1356,21 @@ public void clearMapAndReset() { .color(Color.BLUE) .width(5f) .add()); + smoothedPolyline = gMap.addPolyline(new PolylineOptions() + .color(Color.parseColor("#8B00FF")) + .width(6f) + .visible(true)); + lpfPolyline = gMap.addPolyline(new PolylineOptions() + .color(Color.parseColor("#00BCD4")) + .width(7f) + .visible(isSmoothingEnabled)); + uncertaintyCircle = gMap.addCircle(new CircleOptions() + .center(new LatLng(0, 0)) + .radius(0) + .fillColor(Color.argb(50, 0, 255, 0)) + .strokeColor(Color.argb(100, 0, 255, 0)) + .strokeWidth(2f) + .visible(false)); } } diff --git a/app/src/main/java/com/openpositioning/PositionMe/sensors/ExtendedKalmanFilter.java b/app/src/main/java/com/openpositioning/PositionMe/sensors/ExtendedKalmanFilter.java index 4e9bcb23..e31af48e 100644 --- a/app/src/main/java/com/openpositioning/PositionMe/sensors/ExtendedKalmanFilter.java +++ b/app/src/main/java/com/openpositioning/PositionMe/sensors/ExtendedKalmanFilter.java @@ -11,7 +11,7 @@ * * @author Haoning Huang */ -public class EKFPositioning { +public class ExtendedKalmanFilter { private static final String TAG = "EKFPositioning"; diff --git a/app/src/main/java/com/openpositioning/PositionMe/sensors/SensorFusion.java b/app/src/main/java/com/openpositioning/PositionMe/sensors/SensorFusion.java index 5e9b2fb1..751f4b42 100644 --- a/app/src/main/java/com/openpositioning/PositionMe/sensors/SensorFusion.java +++ b/app/src/main/java/com/openpositioning/PositionMe/sensors/SensorFusion.java @@ -947,7 +947,7 @@ private boolean isSameBleDeviceList(List newList, * Function to create a request to obtain a wifi location for the obtained wifi fingerprint * */ - private void createWifiPositioningRequest(){ + private void PositioningRequest(){ // Try catch block to catch any errors and prevent app crashing try { // Creating a JSON object to store the WiFi access points @@ -1648,7 +1648,18 @@ public List getLatestBssids() { return macs; } - + /** + * Converts a local ENU position to WGS84 lat/lon. + * Returns null if coordinate converter is not yet initialised. + * + * @param east metres east from the reference point + * @param north metres north from the reference point + * @return double[]{latitude, longitude} or null + */ + public double[] enuToLatLon(float east, float north) { + if (coordinateConverter == null) return null; + return coordinateConverter.toLatLon(east, north); + } //endregion diff --git a/app/src/main/res/layout/fragment_trajectory_map.xml b/app/src/main/res/layout/fragment_trajectory_map.xml index 37235c2f..a21c8269 100644 --- a/app/src/main/res/layout/fragment_trajectory_map.xml +++ b/app/src/main/res/layout/fragment_trajectory_map.xml @@ -35,34 +35,106 @@ + + + + + + + + + + + + + + + + + + + + + + + + + android:textColor="@color/md_theme_onPrimary" + app:elevation="5dp" /> + app:layout_constraintTop_toTopOf="parent" />
@@ -103,7 +175,7 @@ android:paddingTop="8dp" android:paddingEnd="16dp" android:paddingBottom="8dp" - android:text="Floor G" + android:text="@string/floor_default" android:textColor="@android:color/black" android:textSize="14sp" android:textStyle="bold" From 52dad8b66fdd305a65b230f1abf5751be264263f Mon Sep 17 00:00:00 2001 From: sydneysavarese Date: Wed, 25 Mar 2026 10:46:59 +0000 Subject: [PATCH 33/82] implementing particle filter approach to map matching --- .../fragment/RecordingFragment.java | 25 +++++--- .../fragment/TrajectoryMapFragment.java | 2 + .../PositionMe/sensors/ParticleFilter.java | 38 +++++++++++ .../PositionMe/sensors/SensorFusion.java | 64 +++++++++++++++++-- .../PositionMe/utils/IndoorMapManager.java | 9 +++ .../PositionMe/utils/VenueMapper.java | 8 +++ 6 files changed, 131 insertions(+), 15 deletions(-) diff --git a/app/src/main/java/com/openpositioning/PositionMe/presentation/fragment/RecordingFragment.java b/app/src/main/java/com/openpositioning/PositionMe/presentation/fragment/RecordingFragment.java index 65d59dda..bde0dcf7 100644 --- a/app/src/main/java/com/openpositioning/PositionMe/presentation/fragment/RecordingFragment.java +++ b/app/src/main/java/com/openpositioning/PositionMe/presentation/fragment/RecordingFragment.java @@ -36,6 +36,7 @@ import com.openpositioning.PositionMe.presentation.activity.RecordingActivity; import com.openpositioning.PositionMe.sensors.SensorFusion; import com.openpositioning.PositionMe.sensors.SensorTypes; +import com.openpositioning.PositionMe.utils.CoordinateConverter; import com.openpositioning.PositionMe.utils.UtilFunctions; import com.google.android.gms.maps.model.LatLng; import java.util.ArrayList; @@ -382,16 +383,22 @@ private void updateUIandPosition() { // trajectoryMapFragment.updateObservedMacs(sensorFusion.getLatestBssids()); float[][] particles = sensorFusion.getParticles(); + float[] bestEnu = sensorFusion.getBestParticleEstimate(); + CoordinateConverter converter = sensorFusion.getCoordinateConverter(); -// LatLng matchedLocation = IndoorMapManager.getMapMatchedLocationFromParticles( -// particles, -// oldLocation, -// heightChange, -// newLocation -// ); -// - mapFrag.updateUserLocation(newLocation, - (float) Math.toDegrees(sensorFusion.passOrientation())); + LatLng displayLocation; + + if (converter != null) { + double[] latLon = converter.toLatLon(bestEnu[0], bestEnu[1]); + displayLocation = new LatLng(latLon[0], latLon[1]); + } else { + displayLocation = newLocation; // fallback + } + + mapFrag.updateUserLocation( + displayLocation, + (float) Math.toDegrees(sensorFusion.passOrientation()) + ); } } diff --git a/app/src/main/java/com/openpositioning/PositionMe/presentation/fragment/TrajectoryMapFragment.java b/app/src/main/java/com/openpositioning/PositionMe/presentation/fragment/TrajectoryMapFragment.java index ce0a1a9a..657438e0 100644 --- a/app/src/main/java/com/openpositioning/PositionMe/presentation/fragment/TrajectoryMapFragment.java +++ b/app/src/main/java/com/openpositioning/PositionMe/presentation/fragment/TrajectoryMapFragment.java @@ -180,6 +180,8 @@ public void onMapReady(@NonNull GoogleMap googleMap) { // drawBuildingPolygon(); indoorMapManager = new IndoorMapManager(gMap); + sensorFusion = SensorFusion.getInstance(); + sensorFusion.setIndoorMapManager(indoorMapManager); // 1) Handle user clicking a venue outline polygon gMap.setOnPolygonClickListener(polygon -> { IndoorMapManager.IndoorVenue v = indoorMapManager.getVenueForPolygon(polygon); diff --git a/app/src/main/java/com/openpositioning/PositionMe/sensors/ParticleFilter.java b/app/src/main/java/com/openpositioning/PositionMe/sensors/ParticleFilter.java index d2f29425..71c0b4a8 100644 --- a/app/src/main/java/com/openpositioning/PositionMe/sensors/ParticleFilter.java +++ b/app/src/main/java/com/openpositioning/PositionMe/sensors/ParticleFilter.java @@ -179,6 +179,44 @@ public float[][] getParticles() { return result; } + /** + * Returns a deep copy of all particle positions in local East-North coordinates. + * Each row is one particle: {east, north}. + */ + public float[][] getParticlesCopy() { + if (!initialized) return new float[0][2]; + + float[][] copy = new float[NUM_PARTICLES][2]; + for (int i = 0; i < NUM_PARTICLES; i++) { + copy[i][0] = particlesX[i]; + copy[i][1] = particlesY[i]; + } + return copy; + } + + /** + * Returns a copy of the particle weights. + */ + public float[] getWeights() { + if (!initialized) return new float[0]; + + float[] copy = new float[NUM_PARTICLES]; + System.arraycopy(weights, 0, copy, 0, NUM_PARTICLES); + return copy; + } + + public float[] getParticlesXRef() { + return particlesX; + } + + public float[] getParticlesYRef() { + return particlesY; + } + + public float[] getWeightsRef() { + return weights; + } + /** * Resets the particle cloud around a new position with increased uncertainty. * Called when a floor change is detected, to prevent particles from remaining on the wrong floor. diff --git a/app/src/main/java/com/openpositioning/PositionMe/sensors/SensorFusion.java b/app/src/main/java/com/openpositioning/PositionMe/sensors/SensorFusion.java index 5e9b2fb1..5347a91c 100644 --- a/app/src/main/java/com/openpositioning/PositionMe/sensors/SensorFusion.java +++ b/app/src/main/java/com/openpositioning/PositionMe/sensors/SensorFusion.java @@ -22,6 +22,7 @@ import com.google.android.gms.maps.model.LatLng; import com.openpositioning.PositionMe.presentation.activity.MainActivity; +import com.openpositioning.PositionMe.utils.IndoorMapManager; import com.openpositioning.PositionMe.utils.PathView; import com.openpositioning.PositionMe.utils.PdrProcessing; import com.openpositioning.PositionMe.data.remote.ServerCommunications; @@ -215,6 +216,7 @@ public class SensorFusion implements SensorEventListener, Observer { private final List testPoints = new ArrayList<>(); + private IndoorMapManager indoorMapManager; //region Initialisation /** @@ -266,6 +268,10 @@ public Traj.Trajectory.Builder getTrajectory() { return this.trajectory; } + public void setIndoorMapManager(IndoorMapManager indoorMapManager) { + this.indoorMapManager = indoorMapManager; + } + /** * Static function to access singleton instance of SensorFusion. @@ -497,15 +503,13 @@ public void onSensorChanged(SensorEvent sensorEvent) { case Sensor.TYPE_STEP_DETECTOR: long stepTime = SystemClock.uptimeMillis() - bootTime; - if (currentTime - lastStepTime < 20) { Log.e("SensorFusion", "Ignoring step event, too soon after last step event:" + (currentTime - lastStepTime) + " ms"); // Ignore rapid successive step events break; - } - - else { + } else { lastStepTime = currentTime; + // Log if accelMagnitude is empty if (accelMagnitude.isEmpty()) { Log.e("SensorFusion", @@ -526,10 +530,43 @@ public void onSensorChanged(SensorEvent sensorEvent) { if (particleFilter.isInitialized()) { float dx = newCords[0] - prevPdrX; float dy = newCords[1] - prevPdrY; + + // Save particle positions BEFORE prediction + float[][] prevParticles = particleFilter.getParticlesCopy(); + + // Predict particle motion particleFilter.predict(dx, dy); ekfPositioning.predict(dx, dy); + + // Apply wall constraints AFTER prediction + if (coordinateConverter != null && indoorMapManager != null) { + float[] currEast = particleFilter.getParticlesXRef(); + float[] currNorth = particleFilter.getParticlesYRef(); + float[] liveWeights = particleFilter.getWeightsRef(); + + float[] prevEast = new float[prevParticles.length]; + float[] prevNorth = new float[prevParticles.length]; + + for (int i = 0; i < prevParticles.length; i++) { + prevEast[i] = prevParticles[i][0]; + prevNorth[i] = prevParticles[i][1]; + } + + indoorMapManager.applyWallConstraints( + prevEast, + prevNorth, + currEast, + currNorth, + liveWeights, + coordinateConverter + ); + + Log.d("SensorFusion", "Applied wall constraints to particle cloud"); + } + prevPdrX = newCords[0]; prevPdrY = newCords[1]; + if (coordinateConverter != null) { lastPdrLatLon = coordinateConverter.toLatLon(prevPdrX, prevPdrY); } @@ -538,7 +575,6 @@ public void onSensorChanged(SensorEvent sensorEvent) { // Clear the accelMagnitude after using it this.accelMagnitude.clear(); - if (saveRecording) { this.pathView.drawTrajectory(newCords); stepCounter++; @@ -549,7 +585,6 @@ public void onSensorChanged(SensorEvent sensorEvent) { } break; } - } } @@ -1086,6 +1121,12 @@ public float[][] getParticles() { } + + + + + + /** * Method to get current floor the user is at, obtained using WiFiPositioning * @see WiFiPositioning for WiFi positioning @@ -1134,6 +1175,17 @@ private float[] getRotationMatrixFromOrientation(float[] o) { return resultMatrix; } + public CoordinateConverter getCoordinateConverter() { + return coordinateConverter; + } + + public float[] getBestParticleEstimate() { + if (particleFilter == null || !particleFilter.isInitialized()) { + return new float[]{0f, 0f}; + } + return particleFilter.getBestEstimate(); + } + /** * Performs and matrix multiplication of two 3x3 matrices and returns the product. * diff --git a/app/src/main/java/com/openpositioning/PositionMe/utils/IndoorMapManager.java b/app/src/main/java/com/openpositioning/PositionMe/utils/IndoorMapManager.java index 1e8acd14..7d0a9207 100644 --- a/app/src/main/java/com/openpositioning/PositionMe/utils/IndoorMapManager.java +++ b/app/src/main/java/com/openpositioning/PositionMe/utils/IndoorMapManager.java @@ -298,6 +298,8 @@ public LatLng indoorLocationCorrection(LatLng oldLocation, LatLng predictedLocat if (currentVenue == null || currentFloorKey == null || oldLocation == null || predictedLocation == null) { return predictedLocation; } + Log.d("MapMatch", "Checking movement from " + oldLocation + " to " + predictedLocation + + " on floor " + currentFloorKey); LatLng correctedLocation = predictedLocation; boolean hitWall = false; @@ -323,6 +325,8 @@ public LatLng indoorLocationCorrection(LatLng oldLocation, LatLng predictedLocat polygon ); hitWall = true; + Log.d("MapMatch", "Wall intersection detected"); + Log.d("MapMatch", "Corrected location = " + correctedLocation); break; } } @@ -385,6 +389,11 @@ public String acceptFloorChange(LatLng correctedLocation, LatLng oldLocation, fl boolean usedLift = nearLift && horizontalDisplacement < liftHorizontalThresholdMeters; boolean usedStairs = nearStairs && horizontalDisplacement >= liftHorizontalThresholdMeters; + Log.d("MapMatch", "heightChange=" + heightChangeMeters + + ", floor=" + currentFloorKey); + Log.d("MapMatch", "nearStairs=" + nearStairs + + ", nearLift=" + nearLift); + Log.d("MapMatch", "horizontalDisplacement=" + horizontalDisplacement); if (!usedLift && !usedStairs) { return currentFloorKey; diff --git a/app/src/main/java/com/openpositioning/PositionMe/utils/VenueMapper.java b/app/src/main/java/com/openpositioning/PositionMe/utils/VenueMapper.java index f1df5bc1..5c42888b 100644 --- a/app/src/main/java/com/openpositioning/PositionMe/utils/VenueMapper.java +++ b/app/src/main/java/com/openpositioning/PositionMe/utils/VenueMapper.java @@ -56,6 +56,10 @@ public static List toIndoorVenues(List { isGnssOn = isChecked; @@ -413,9 +433,18 @@ public void onMapReady(@NonNull GoogleMap googleMap) { Log.d(TAG, "Smoothing toggled: " + isChecked); }); - fusedPdrSwitch.setOnCheckedChangeListener((btn, isChecked) -> { - useFusedPosition = isChecked; - Log.d(TAG, "Position mode: " + (isChecked ? "Fused" : "PDR")); +// fusedPdrSwitch.setOnCheckedChangeListener((btn, isChecked) -> { +// useFusedPosition = isChecked; +// Log.d(TAG, "Position mode: " + (isChecked ? "Fused" : "PDR")); +// }); + + showPdrPathSwitch.setOnCheckedChangeListener((btn, isChecked) -> { + showPdrPath = isChecked; + // Immediately show or hide the red PDR polyline + if (polyline != null) { + polyline.setVisible(showPdrPath); + } + Log.d(TAG, "PDR path visible: " + isChecked); }); particleCloudSwitch.setOnCheckedChangeListener((btn, isChecked) -> { @@ -718,28 +747,31 @@ public void onNothingSelected(AdapterView parent) {} public void updateUserLocation(@NonNull LatLng newLocation, float orientation) { if (gMap == null) return; + // Store orientation for use by the fused marker + lastOrientation = orientation; + // Keep track of current location LatLng oldLocation = this.currentLocation; this.currentLocation = newLocation; // If no marker, create it - if (orientationMarker == null) { - orientationMarker = gMap.addMarker(new MarkerOptions() - .position(newLocation) - .flat(true) - .title("Current Position") - .icon(BitmapDescriptorFactory.fromBitmap( - UtilFunctions.getBitmapFromVector(requireContext(), - R.drawable.ic_baseline_navigation_24))) - ); - gMap.moveCamera(CameraUpdateFactory.newLatLngZoom(newLocation, 19f)); - } else { - // Update marker position + orientation - orientationMarker.setPosition(newLocation); - orientationMarker.setRotation(orientation); - // Move camera a bit - gMap.moveCamera(CameraUpdateFactory.newLatLng(newLocation)); - } +// if (orientationMarker == null) { +// orientationMarker = gMap.addMarker(new MarkerOptions() +// .position(newLocation) +// .flat(true) +// .title("Current Position") +// .icon(BitmapDescriptorFactory.fromBitmap( +// UtilFunctions.getBitmapFromVector(requireContext(), +// R.drawable.ic_baseline_navigation_24))) +// ); +// gMap.moveCamera(CameraUpdateFactory.newLatLngZoom(newLocation, 19f)); +// } else { +// // Update marker position + orientation +// orientationMarker.setPosition(newLocation); +// orientationMarker.setRotation(orientation); +// // Move camera a bit +// gMap.moveCamera(CameraUpdateFactory.newLatLng(newLocation)); +// } // Extend polyline if movement occurred if (oldLocation != null && !oldLocation.equals(newLocation) && polyline != null) { @@ -811,29 +843,74 @@ public void updatePdrPosition(@NonNull LatLng pdrLocation) { * * @param fusedLocation best position estimate from the particle filter. */ +// public void updateFusedPosition(@NonNull LatLng fusedLocation) { +// if (gMap == null) return; +// +// // Raw fused path — purple, always grows +// smoothedPoints.add(fusedLocation); +// redrawFusedTrajectory(); +// +// // Update uncertainty circle around the fused marker +// updateUncertaintyCircle(fusedLocation); +// +// // Redraw particle cloud overlay (throttled to every 2s) +// redrawParticleCloud(); +// +// // LPF-smoothed fused path — teal, grows but only visible when toggle is ON +// LatLng lpfFiltered = applyLowPassFilter(fusedLocation); +// lpfPoints.add(lpfFiltered); +// if (lpfPolyline != null) { +// lpfPolyline.setPoints(new ArrayList<>(lpfPoints)); +// } +// +// // Move arrow marker if fused mode is selected +// if (!useFusedPosition) return; +// +// if (orientationMarker == null) { +// orientationMarker = gMap.addMarker(new MarkerOptions() +// .position(fusedLocation) +// .flat(true) +// .title("Current Position") +// .icon(BitmapDescriptorFactory.fromBitmap( +// UtilFunctions.getBitmapFromVector(requireContext(), +// R.drawable.ic_baseline_navigation_24)))); +// gMap.moveCamera(CameraUpdateFactory.newLatLngZoom(fusedLocation, 19f)); +// } else { +// orientationMarker.setPosition(fusedLocation); +// gMap.moveCamera(CameraUpdateFactory.newLatLng(fusedLocation)); +// } +// } + + /** + * Updates the arrow marker using the particle filter's fused position. + * The arrow ALWAYS follows the fused position — there is no toggle for this. + * + * Also grows the purple fused trajectory polyline and the teal LPF polyline, + * and updates the uncertainty circle. + * + * @param fusedLocation best position estimate from the particle filter. + */ public void updateFusedPosition(@NonNull LatLng fusedLocation) { if (gMap == null) return; - // Raw fused path — purple, always grows + // Purple fused path — always grows smoothedPoints.add(fusedLocation); redrawFusedTrajectory(); - // Update uncertainty circle around the fused marker - updateUncertaintyCircle(fusedLocation); - - // Redraw particle cloud overlay (throttled to every 2s) - redrawParticleCloud(); - - // LPF-smoothed fused path — teal, grows but only visible when toggle is ON + // Teal LPF path — grows but only visible when smoothing toggle is ON LatLng lpfFiltered = applyLowPassFilter(fusedLocation); lpfPoints.add(lpfFiltered); if (lpfPolyline != null) { lpfPolyline.setPoints(new ArrayList<>(lpfPoints)); } - // Move arrow marker if fused mode is selected - if (!useFusedPosition) return; + // Uncertainty circle — shrinks/grows with filter confidence + updateUncertaintyCircle(fusedLocation); + + // Particle cloud overlay — throttled to every 2 seconds + redrawParticleCloud(); + // Arrow marker always follows fused position if (orientationMarker == null) { orientationMarker = gMap.addMarker(new MarkerOptions() .position(fusedLocation) @@ -845,6 +922,8 @@ public void updateFusedPosition(@NonNull LatLng fusedLocation) { gMap.moveCamera(CameraUpdateFactory.newLatLngZoom(fusedLocation, 19f)); } else { orientationMarker.setPosition(fusedLocation); +// Added + orientationMarker.setRotation(lastOrientation); gMap.moveCamera(CameraUpdateFactory.newLatLng(fusedLocation)); } } diff --git a/app/src/main/res/layout/fragment_trajectory_map.xml b/app/src/main/res/layout/fragment_trajectory_map.xml index a21c8269..f4ec3ebf 100644 --- a/app/src/main/res/layout/fragment_trajectory_map.xml +++ b/app/src/main/res/layout/fragment_trajectory_map.xml @@ -30,113 +30,247 @@ android:layout_height="wrap_content" android:orientation="vertical" android:padding="8dp" - android:gravity="center"> + android:gravity="start"> - + - - + android:layout_height="wrap_content" + android:orientation="horizontal" + android:gravity="center_vertical" + android:padding="4dp"> - - - - + - - - - - - - - - + + + + + - - - + android:orientation="vertical" + android:visibility="gone"> - - + - - + - - - + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + diff --git a/app/src/main/res/values/strings.xml b/app/src/main/res/values/strings.xml index 923bef23..c0781a6a 100644 --- a/app/src/main/res/values/strings.xml +++ b/app/src/main/res/values/strings.xml @@ -137,5 +137,7 @@ End Exit Mark Point + Smooth Path + Floor G \ No newline at end of file From 3dc901eac26bb0c80c52d28b93fa0ff81b85a23f Mon Sep 17 00:00:00 2001 From: Bhavyas15 Date: Thu, 26 Mar 2026 11:34:59 +0000 Subject: [PATCH 35/82] corrected orientation --- .../PositionMe/presentation/fragment/TrajectoryMapFragment.java | 1 + 1 file changed, 1 insertion(+) diff --git a/app/src/main/java/com/openpositioning/PositionMe/presentation/fragment/TrajectoryMapFragment.java b/app/src/main/java/com/openpositioning/PositionMe/presentation/fragment/TrajectoryMapFragment.java index b54b4be1..5a9555cc 100644 --- a/app/src/main/java/com/openpositioning/PositionMe/presentation/fragment/TrajectoryMapFragment.java +++ b/app/src/main/java/com/openpositioning/PositionMe/presentation/fragment/TrajectoryMapFragment.java @@ -921,6 +921,7 @@ public void updateFusedPosition(@NonNull LatLng fusedLocation) { R.drawable.ic_baseline_navigation_24)))); gMap.moveCamera(CameraUpdateFactory.newLatLngZoom(fusedLocation, 19f)); } else { + orientationMarker.setPosition(fusedLocation); // Added orientationMarker.setRotation(lastOrientation); From 43b91cd2c99527533c99d0bd225b3c4c7211a631 Mon Sep 17 00:00:00 2001 From: sydneysavarese Date: Thu, 26 Mar 2026 14:53:30 +0000 Subject: [PATCH 36/82] floor stuff --- .../fragment/TrajectoryMapFragment.java | 11 +- .../PositionMe/utils/IndoorMapManager.java | 100 +++++++++++++++--- 2 files changed, 93 insertions(+), 18 deletions(-) diff --git a/app/src/main/java/com/openpositioning/PositionMe/presentation/fragment/TrajectoryMapFragment.java b/app/src/main/java/com/openpositioning/PositionMe/presentation/fragment/TrajectoryMapFragment.java index 657438e0..a5e39613 100644 --- a/app/src/main/java/com/openpositioning/PositionMe/presentation/fragment/TrajectoryMapFragment.java +++ b/app/src/main/java/com/openpositioning/PositionMe/presentation/fragment/TrajectoryMapFragment.java @@ -482,7 +482,6 @@ public void updateUserLocation(@NonNull LatLng newLocation, float orientation) { LatLng oldLocation = this.currentLocation; LatLng correctedLocation = newLocation; float heightChange = 0f; -// float[][] particles = sensorFusion.getParticles(); if (sensorFusion != null) { float currentElevation = sensorFusion.getElevation(); @@ -497,11 +496,11 @@ public void updateUserLocation(@NonNull LatLng newLocation, float orientation) { } if (oldLocation != null && indoorMapManager != null) { - correctedLocation = indoorMapManager.indoorLocationCorrection( - oldLocation, - newLocation, - heightChange - ); +// correctedLocation = indoorMapManager.indoorLocationCorrection( +// oldLocation, +// newLocation, +// heightChange +// ); indoorMapManager.acceptFloorChange( correctedLocation, diff --git a/app/src/main/java/com/openpositioning/PositionMe/utils/IndoorMapManager.java b/app/src/main/java/com/openpositioning/PositionMe/utils/IndoorMapManager.java index 7d0a9207..eb48ca97 100644 --- a/app/src/main/java/com/openpositioning/PositionMe/utils/IndoorMapManager.java +++ b/app/src/main/java/com/openpositioning/PositionMe/utils/IndoorMapManager.java @@ -204,8 +204,10 @@ public void applyWallConstraints( for (int i = 0; i < weights.length; i++) { if (weights[i] == 0f) continue; // already dead, skip + //convert prev and curr to LatLng LatLng prev = toLatLng(prevEast[i], prevNorth[i], converter); LatLng curr = toLatLng(currEast[i], currNorth[i], converter); + //check if cross walls on that floor if (crossesAnyWall(prev, curr, floor.wallPolygons)) { LatLng snapped = adjustPositionToNearestValidLocation( prev, curr, getNearestWallPolygon(prev, curr, floor.wallPolygons)); @@ -215,6 +217,7 @@ public void applyWallConstraints( weights[i] *= 0.1f; } } + Log.e("IndoorMapManager", "applied wall constraints!"); } private List getNearestWallPolygon(LatLng from, LatLng to, @@ -235,7 +238,11 @@ private boolean crossesAnyWall(LatLng from, LatLng to, for (int i = 0; i < polygon.size(); i++) { LatLng wallA = polygon.get(i); LatLng wallB = polygon.get((i + 1) % polygon.size()); - if (segmentsIntersect(from, to, wallA, wallB)) return true; + if (segmentsIntersect(from, to, wallA, wallB)) { + Log.e("IndoorMapManager", "wall detected!"); + return true; + + } } } return false; @@ -449,16 +456,25 @@ private boolean isNearAnyPoint(LatLng location, List centers, double thr return false; } - public LatLng adjustPositionToNearestValidLocation(LatLng oldLocation, LatLng predictedLocation, List polygon) { + public LatLng adjustPositionToNearestValidLocation( + LatLng oldLocation, + LatLng predictedLocation, + List polygon) { + + LatLng bestValid = oldLocation; + + double low = 0.0; // valid end + double high = 1.0; // invalid end - LatLng corrected = oldLocation; + //binary search + for (int iter = 0; iter < 20; iter++) { + double mid = (low + high) / 2.0; - double dx = predictedLocation.latitude - oldLocation.latitude; - double dy = predictedLocation.longitude - oldLocation.longitude; + double lat = oldLocation.latitude + + mid * (predictedLocation.latitude - oldLocation.latitude); + double lon = oldLocation.longitude + + mid * (predictedLocation.longitude - oldLocation.longitude); - for (double t = 1.0; t >= 0.0; t -= 0.05) { - double lat = oldLocation.latitude + t * dx; - double lon = oldLocation.longitude + t * dy; LatLng candidate = new LatLng(lat, lon); boolean intersectsWall = false; @@ -473,15 +489,75 @@ public LatLng adjustPositionToNearestValidLocation(LatLng oldLocation, LatLng pr } } - if (!intersectsWall) { - corrected = candidate; - return corrected; + if (intersectsWall) { + high = mid; // candidate is invalid, search closer to oldLocation + } else { + low = mid; // candidate is valid, search closer to predictedLocation + bestValid = candidate; } } - return corrected; + return bestValid; + } + + public void initializeFloorFromLocation(LatLng location) { + if (currentVenue == null) return; + + double bestDist = Double.MAX_VALUE; + String bestFloor = null; + + for (Map.Entry entry : currentVenue.floorFeatures.entrySet()) { + String floorKey = entry.getKey(); + IndoorVenue.FloorFeatures floor = entry.getValue(); + + // use centroid of walls (simple heuristic) + LatLng centroid = computeCentroid(floor.wallPolygons); + double dist = distanceMeters(location, centroid); + + if (dist < bestDist) { + bestDist = dist; + bestFloor = floorKey; + } + } + + if (bestFloor != null) { + currentFloorKey = bestFloor; + Log.d("FloorInit", "Initial floor set to " + bestFloor); + } } + public LatLng computeCentroid(List> wallPolygons) { + if (wallPolygons == null || wallPolygons.isEmpty()) { + return null; + } + + double sumLat = 0.0; + double sumLon = 0.0; + int polyCount = 0; + + for (List polygon : wallPolygons) { + if (polygon == null || polygon.isEmpty()) continue; + + double polyLat = 0.0; + double polyLon = 0.0; + + for (LatLng point : polygon) { + polyLat += point.latitude; + polyLon += point.longitude; + } + + polyLat /= polygon.size(); + polyLon /= polygon.size(); + + sumLat += polyLat; + sumLon += polyLon; + polyCount++; + } + + if (polyCount == 0) return null; + + return new LatLng(sumLat / polyCount, sumLon / polyCount); + } /** * Increase floor within the current venue. */ From 2c06239e0e09f1a6bb96144419bcd9fe88c9ae7c Mon Sep 17 00:00:00 2001 From: sydneysavarese Date: Thu, 26 Mar 2026 17:25:24 +0000 Subject: [PATCH 37/82] added smth --- .../presentation/fragment/TrajectoryMapFragment.java | 2 ++ .../com/openpositioning/PositionMe/sensors/SensorFusion.java | 2 +- .../com/openpositioning/PositionMe/utils/IndoorMapManager.java | 3 ++- 3 files changed, 5 insertions(+), 2 deletions(-) diff --git a/app/src/main/java/com/openpositioning/PositionMe/presentation/fragment/TrajectoryMapFragment.java b/app/src/main/java/com/openpositioning/PositionMe/presentation/fragment/TrajectoryMapFragment.java index 23e6a66b..159fbdf9 100644 --- a/app/src/main/java/com/openpositioning/PositionMe/presentation/fragment/TrajectoryMapFragment.java +++ b/app/src/main/java/com/openpositioning/PositionMe/presentation/fragment/TrajectoryMapFragment.java @@ -863,6 +863,8 @@ public void updateUserLocation(@NonNull LatLng newLocation, float orientation) { // call api if (floorplanRemote != null) { maybeRequestNearbyVenues(newLocation); +// IndoorMapManager IMMM = new IndoorMapManager(); +// IMMM.initializeFloorFromLocation(newLocation); } } diff --git a/app/src/main/java/com/openpositioning/PositionMe/sensors/SensorFusion.java b/app/src/main/java/com/openpositioning/PositionMe/sensors/SensorFusion.java index 7c947d33..6436266b 100644 --- a/app/src/main/java/com/openpositioning/PositionMe/sensors/SensorFusion.java +++ b/app/src/main/java/com/openpositioning/PositionMe/sensors/SensorFusion.java @@ -538,7 +538,7 @@ public void onSensorChanged(SensorEvent sensorEvent) { particleFilter.predict(dx, dy); ekfPositioning.predict(dx, dy); - // Apply wall constraints AFTER prediction + // Apply wall constraints after prediction if (coordinateConverter != null && indoorMapManager != null) { float[] currEast = particleFilter.getParticlesXRef(); float[] currNorth = particleFilter.getParticlesYRef(); diff --git a/app/src/main/java/com/openpositioning/PositionMe/utils/IndoorMapManager.java b/app/src/main/java/com/openpositioning/PositionMe/utils/IndoorMapManager.java index eb48ca97..82c88031 100644 --- a/app/src/main/java/com/openpositioning/PositionMe/utils/IndoorMapManager.java +++ b/app/src/main/java/com/openpositioning/PositionMe/utils/IndoorMapManager.java @@ -212,9 +212,10 @@ public void applyWallConstraints( LatLng snapped = adjustPositionToNearestValidLocation( prev, curr, getNearestWallPolygon(prev, curr, floor.wallPolygons)); float[] enu = converter.toEnu(snapped.latitude, snapped.longitude); + //directly change currEast, currNorth, and weights arrays currEast[i] = enu[0]; currNorth[i] = enu[1]; - weights[i] *= 0.1f; + weights[i] *= 0; } } Log.e("IndoorMapManager", "applied wall constraints!"); From b6130ed293961e4b0c9f438581e89a1dc2d91365 Mon Sep 17 00:00:00 2001 From: sydneysavarese Date: Sat, 28 Mar 2026 12:02:54 +0000 Subject: [PATCH 38/82] idk anymore --- .../fragment/RecordingFragment.java | 6 +++++- .../PositionMe/sensors/ParticleFilter.java | 21 +++++++++++++++++++ .../PositionMe/sensors/SensorFusion.java | 8 +++++++ .../PositionMe/utils/IndoorMapManager.java | 18 ++++++++++++++-- 4 files changed, 50 insertions(+), 3 deletions(-) diff --git a/app/src/main/java/com/openpositioning/PositionMe/presentation/fragment/RecordingFragment.java b/app/src/main/java/com/openpositioning/PositionMe/presentation/fragment/RecordingFragment.java index b3925c07..c63372be 100644 --- a/app/src/main/java/com/openpositioning/PositionMe/presentation/fragment/RecordingFragment.java +++ b/app/src/main/java/com/openpositioning/PositionMe/presentation/fragment/RecordingFragment.java @@ -40,6 +40,7 @@ import com.openpositioning.PositionMe.utils.UtilFunctions; import com.google.android.gms.maps.model.LatLng; import java.util.ArrayList; +import java.util.Arrays; import java.util.List; @@ -448,7 +449,7 @@ private void updateUIandPosition() { // changed // Green PDR observation dot — same position as the red polyline mapFrag.updatePdrPosition(newLocation); - float[][] particles = sensorFusion.getParticles(); +// float[][] particles = sensorFusion.getParticles(); float[] bestEnu = sensorFusion.getBestParticleEstimate(); CoordinateConverter converter = sensorFusion.getCoordinateConverter(); @@ -465,6 +466,8 @@ private void updateUIandPosition() { displayLocation, (float) Math.toDegrees(sensorFusion.passOrientation()) ); + Log.d("MapCompare", "PF displayLocation = " + displayLocation); + Log.d("MapCompare", "Fused location = " + Arrays.toString(sensorFusion.getFusedLatLon())); } } @@ -558,6 +561,7 @@ private void updateUIandPosition() { android.util.Log.e("RecordingUI", "Error updating counts: " + e.getMessage()); } } + } /** diff --git a/app/src/main/java/com/openpositioning/PositionMe/sensors/ParticleFilter.java b/app/src/main/java/com/openpositioning/PositionMe/sensors/ParticleFilter.java index 71c0b4a8..68482784 100644 --- a/app/src/main/java/com/openpositioning/PositionMe/sensors/ParticleFilter.java +++ b/app/src/main/java/com/openpositioning/PositionMe/sensors/ParticleFilter.java @@ -280,6 +280,27 @@ private void updateWeights(float measX, float measY, float noiseStd) { } } + public void normalizeWeights() { + if (!initialized) return; + + float totalWeight = 0f; + for (int i = 0; i < NUM_PARTICLES; i++) { + totalWeight += weights[i]; + } + + if (totalWeight > 1e-10f) { + for (int i = 0; i < NUM_PARTICLES; i++) { + weights[i] /= totalWeight; + } + } else { + Log.w(TAG, "Weight collapse detected — resetting to uniform weights"); + float uniform = 1.0f / NUM_PARTICLES; + for (int i = 0; i < NUM_PARTICLES; i++) { + weights[i] = uniform; + } + } + } + /** * Resampling: draws new particles from the current weighted distribution, then resets weights to uniform. */ diff --git a/app/src/main/java/com/openpositioning/PositionMe/sensors/SensorFusion.java b/app/src/main/java/com/openpositioning/PositionMe/sensors/SensorFusion.java index 6436266b..063aeaf6 100644 --- a/app/src/main/java/com/openpositioning/PositionMe/sensors/SensorFusion.java +++ b/app/src/main/java/com/openpositioning/PositionMe/sensors/SensorFusion.java @@ -537,6 +537,9 @@ public void onSensorChanged(SensorEvent sensorEvent) { // Predict particle motion particleFilter.predict(dx, dy); ekfPositioning.predict(dx, dy); + float[] bestBefore = particleFilter.getBestEstimate(); + Log.d("PFDebug", "Best BEFORE constraints: " + + bestBefore[0] + ", " + bestBefore[1]); // Apply wall constraints after prediction if (coordinateConverter != null && indoorMapManager != null) { @@ -560,8 +563,13 @@ public void onSensorChanged(SensorEvent sensorEvent) { liveWeights, coordinateConverter ); + particleFilter.normalizeWeights(); Log.d("SensorFusion", "Applied wall constraints to particle cloud"); + float[] bestAfter = particleFilter.getBestEstimate(); + + Log.d("PFDebug", "Best BEFORE constraints: " + bestBefore[0] + ", " + bestBefore[1]); + Log.d("PFDebug", "Best AFTER constraints: " + bestAfter[0] + ", " + bestAfter[1]); } prevPdrX = newCords[0]; diff --git a/app/src/main/java/com/openpositioning/PositionMe/utils/IndoorMapManager.java b/app/src/main/java/com/openpositioning/PositionMe/utils/IndoorMapManager.java index 82c88031..05943db2 100644 --- a/app/src/main/java/com/openpositioning/PositionMe/utils/IndoorMapManager.java +++ b/app/src/main/java/com/openpositioning/PositionMe/utils/IndoorMapManager.java @@ -196,6 +196,7 @@ public void applyWallConstraints( float[] weights, CoordinateConverter converter) { + if (currentVenue == null || currentFloorKey == null) return; IndoorVenue.FloorFeatures floor = currentVenue.floorFeatures.get(currentFloorKey); @@ -203,20 +204,32 @@ public void applyWallConstraints( for (int i = 0; i < weights.length; i++) { if (weights[i] == 0f) continue; // already dead, skip + Log.d("WallDebug", "Particle " + i + + " prev=(" + prevEast[i] + "," + prevNorth[i] + ")" + + " curr=(" + currEast[i] + "," + currNorth[i] + ")" + + " floor = "+ currentFloorKey); //convert prev and curr to LatLng LatLng prev = toLatLng(prevEast[i], prevNorth[i], converter); LatLng curr = toLatLng(currEast[i], currNorth[i], converter); + //check if cross walls on that floor if (crossesAnyWall(prev, curr, floor.wallPolygons)) { + Log.d("WallDebug", "Particle " + i + " CROSSED WALL"); LatLng snapped = adjustPositionToNearestValidLocation( prev, curr, getNearestWallPolygon(prev, curr, floor.wallPolygons)); + Log.d("WallDebug", "Snapped from " + curr + " → " + snapped); float[] enu = converter.toEnu(snapped.latitude, snapped.longitude); + Log.d("WallDebug", "Snapped from " + curr + " → " + snapped); //directly change currEast, currNorth, and weights arrays currEast[i] = enu[0]; currNorth[i] = enu[1]; - weights[i] *= 0; + //downweight changed location + weights[i] *= 0.01f; + Log.d("WallDebug", "Weight updated: " + weights[i]); + } + } Log.e("IndoorMapManager", "applied wall constraints!"); @@ -632,7 +645,8 @@ private void drawFloor(JSONObject floorGeoJson, String floorKey) throws JSONExce float strokeWidth = 2.0f; if (t.contains("wall")) { - fillColor = Color.argb(0, 0, 0, 0); + strokeColor = Color.RED; + fillColor = Color.argb(0, 250, 0, 0); strokeWidth = 3.5f; } else if (t.contains("door")) { fillColor = Color.argb(0, 0, 0, 0); From 47831a27d5f662e19ce83ee4db400c2744e05761 Mon Sep 17 00:00:00 2001 From: sydneysavarese Date: Sat, 28 Mar 2026 16:39:38 +0000 Subject: [PATCH 39/82] applywallconstraints works until weight collapse, arrow also seems to get stuck --- .../fragment/TrajectoryMapFragment.java | 1 + .../PositionMe/sensors/SensorFusion.java | 32 +++- .../PositionMe/utils/IndoorMapManager.java | 159 ++++++++++++++---- 3 files changed, 153 insertions(+), 39 deletions(-) diff --git a/app/src/main/java/com/openpositioning/PositionMe/presentation/fragment/TrajectoryMapFragment.java b/app/src/main/java/com/openpositioning/PositionMe/presentation/fragment/TrajectoryMapFragment.java index 159fbdf9..c9aa60ef 100644 --- a/app/src/main/java/com/openpositioning/PositionMe/presentation/fragment/TrajectoryMapFragment.java +++ b/app/src/main/java/com/openpositioning/PositionMe/presentation/fragment/TrajectoryMapFragment.java @@ -370,6 +370,7 @@ public void onMapReady(@NonNull GoogleMap googleMap) { indoorMapManager.selectVenue(v); + if(getActivity() instanceof VenueSelectionListener) { ((VenueSelectionListener) getActivity()).onVenueSelected( v.venueId != null ? v.venueId : v.name diff --git a/app/src/main/java/com/openpositioning/PositionMe/sensors/SensorFusion.java b/app/src/main/java/com/openpositioning/PositionMe/sensors/SensorFusion.java index 063aeaf6..48b394a4 100644 --- a/app/src/main/java/com/openpositioning/PositionMe/sensors/SensorFusion.java +++ b/app/src/main/java/com/openpositioning/PositionMe/sensors/SensorFusion.java @@ -216,6 +216,8 @@ public class SensorFusion implements SensorEventListener, Observer { private final List testPoints = new ArrayList<>(); + boolean enuBaked = false; + private IndoorMapManager indoorMapManager; //region Initialisation @@ -269,7 +271,16 @@ public Traj.Trajectory.Builder getTrajectory() { } public void setIndoorMapManager(IndoorMapManager indoorMapManager) { + Log.i("SensorFusion", "set indoormapmanager"); this.indoorMapManager = indoorMapManager; + if(coordinateConverter == null){ + Log.i("SensorFusion", "coordinateConverter null"); + } + if (!enuBaked && this.indoorMapManager != null && coordinateConverter != null) { + Log.i("SensorFusion", "Baking ENU coordinates from setIndoorMapManager"); + this.indoorMapManager.bakeEnuCoordinates(coordinateConverter); + enuBaked = true; + } } @@ -625,17 +636,28 @@ public void onLocationChanged(@NonNull Location location) { float speed = (float) location.getSpeed(); String provider = location.getProvider(); // Initialize coordinate converter and particle filter on first GNSS position during recording + if (coordinateConverter == null) { + coordinateConverter = new CoordinateConverter( + location.getLatitude(), location.getLongitude()); + Log.i("SensorFusion", "CoordinateConverter initialised at lat=" + + latitude + " lon=" + longitude); + } if (saveRecording) { if (!particleFilter.isInitialized()) { // First position: set East-North origin, spread particles around (0,0) - coordinateConverter = new CoordinateConverter( - location.getLatitude(), location.getLongitude()); +// coordinateConverter = new CoordinateConverter( +// location.getLatitude(), location.getLongitude()); + particleFilter.initParticles(0f, 0f, Math.max(accuracy, 5f)); ekfPositioning.initParticles(0f, 0f, Math.max(accuracy, 5f)); prevPdrX = 0f; prevPdrY = 0f; Log.i("SensorFusion", "ParticleFilter initialised at lat=" + latitude + " lon=" + longitude); + if (indoorMapManager != null) { + indoorMapManager.bakeEnuCoordinates(coordinateConverter); + enuBaked = true; + } } else { // Subsequent positions: convert to East-North space and update particle weights float[] enu = coordinateConverter.toEnu( @@ -1031,8 +1053,8 @@ public void onSuccess(LatLng wifiLocation, int floor) { if (!particleFilter.isInitialized()) { // if GNSS not available — launch with first WiFi position - coordinateConverter = new CoordinateConverter( - wifiLocation.latitude, wifiLocation.longitude); +// coordinateConverter = new CoordinateConverter( +// wifiLocation.latitude, wifiLocation.longitude); particleFilter.initParticles(0f, 0f, 20f); prevPdrX = 0f; prevPdrY = 0f; @@ -1554,7 +1576,7 @@ public void startRecording() { particleFilter = new ParticleFilter(); ekfPositioning = new ExtendedKalmanFilter(); useEKF = settings.getBoolean("use_ekf", false); - coordinateConverter = null; +// coordinateConverter = null; lastGnssLatLon = null; lastWifiLatLon = null; lastPdrLatLon = null; diff --git a/app/src/main/java/com/openpositioning/PositionMe/utils/IndoorMapManager.java b/app/src/main/java/com/openpositioning/PositionMe/utils/IndoorMapManager.java index 05943db2..be93630c 100644 --- a/app/src/main/java/com/openpositioning/PositionMe/utils/IndoorMapManager.java +++ b/app/src/main/java/com/openpositioning/PositionMe/utils/IndoorMapManager.java @@ -20,6 +20,7 @@ import com.google.android.gms.maps.model.LatLngBounds; import com.google.android.gms.maps.model.Polygon; import com.google.android.gms.maps.model.PolygonOptions; +import com.openpositioning.PositionMe.sensors.SensorFusion; import org.json.JSONArray; import org.json.JSONException; @@ -87,8 +88,8 @@ public static class IndoorVenue{ public static class FloorFeatures { public List> wallPolygons = new ArrayList<>(); - public List wallPolylines = new ArrayList<>(); // if your walls are lines - public List stairsCenters = new ArrayList<>(); // or polygons if provided + public List> wallPolygonsEnu = new ArrayList<>(); + public List stairsCenters = new ArrayList<>(); public List liftCenters = new ArrayList<>(); } } @@ -196,44 +197,131 @@ public void applyWallConstraints( float[] weights, CoordinateConverter converter) { - if (currentVenue == null || currentFloorKey == null) return; - IndoorVenue.FloorFeatures floor = - currentVenue.floorFeatures.get(currentFloorKey); - if (floor == null || floor.wallPolygons.isEmpty()) return; + IndoorVenue.FloorFeatures floor = currentVenue.floorFeatures.get(currentFloorKey); + if (floor == null || floor.wallPolygonsEnu.isEmpty()) { + Log.w("WallDebug", "No ENU wall polygons — did bakeEnuCoordinates run?"); + return; + } for (int i = 0; i < weights.length; i++) { - if (weights[i] == 0f) continue; // already dead, skip - Log.d("WallDebug", "Particle " + i + - " prev=(" + prevEast[i] + "," + prevNorth[i] + ")" + - " curr=(" + currEast[i] + "," + currNorth[i] + ")" + - " floor = "+ currentFloorKey); - - //convert prev and curr to LatLng - LatLng prev = toLatLng(prevEast[i], prevNorth[i], converter); - LatLng curr = toLatLng(currEast[i], currNorth[i], converter); - - //check if cross walls on that floor - if (crossesAnyWall(prev, curr, floor.wallPolygons)) { - Log.d("WallDebug", "Particle " + i + " CROSSED WALL"); - LatLng snapped = adjustPositionToNearestValidLocation( - prev, curr, getNearestWallPolygon(prev, curr, floor.wallPolygons)); - Log.d("WallDebug", "Snapped from " + curr + " → " + snapped); - float[] enu = converter.toEnu(snapped.latitude, snapped.longitude); - Log.d("WallDebug", "Snapped from " + curr + " → " + snapped); - //directly change currEast, currNorth, and weights arrays - currEast[i] = enu[0]; - currNorth[i] = enu[1]; - //downweight changed location - weights[i] *= 0.01f; - Log.d("WallDebug", "Weight updated: " + weights[i]); + if (weights[i] == 0f) continue; + + float[] prev = {prevEast[i], prevNorth[i]}; + float[] curr = {currEast[i], currNorth[i]}; + if (crossesAnyWallEnu(prev, curr, floor.wallPolygonsEnu)) { + // Snap back to just before the wall + float[] snapped = snapToWallEnu(prev, curr, floor.wallPolygonsEnu); + currEast[i] = snapped[0]; + currNorth[i] = snapped[1]; + weights[i] = 0f; } + } + } + private float[] snapToWallEnu(float[] from, float[] to, + List> allWalls) { + float[] best = from.clone(); + double low = 0.0, high = 1.0; + for (int iter = 0; iter < 24; iter++) { + double mid = (low + high) / 2.0; + float[] candidate = { + (float)(from[0] + mid * (to[0] - from[0])), + (float)(from[1] + mid * (to[1] - from[1])) + }; + + // Check candidate against ALL walls, not just the nearest + if (crossesAnyWallEnu(from, candidate, allWalls)) { + high = mid; + } else { + low = mid; + best = candidate; + } + } + return best; + } + private boolean crossesAnyWallEnu(float[] from, float[] to, List> walls) { + for (List polygon : walls) { + for (int i = 0; i < polygon.size(); i++) { + float[] a = polygon.get(i); + float[] b = polygon.get((i + 1) % polygon.size()); + if (segmentsIntersectEnu(from, to, a, b)) return true; } - Log.e("IndoorMapManager", "applied wall constraints!"); + } + return false; + } + private boolean segmentsIntersectEnu(float[] p1, float[] p2, float[] p3, float[] p4) { + // All values in metres — no precision issues + double d1x = p2[0] - p1[0], d1y = p2[1] - p1[1]; + double d2x = p4[0] - p3[0], d2y = p4[1] - p3[1]; + double cross = d1x * d2y - d1y * d2x; + if (Math.abs(cross) < 1e-6) return false; // parallel, eps in m² is fine here + + double t = ((p3[0] - p1[0]) * d2y - (p3[1] - p1[1]) * d2x) / cross; + double u = ((p3[0] - p1[0]) * d1y - (p3[1] - p1[1]) * d1x) / cross; + return t >= 0 && t <= 1 && u >= 0 && u <= 1; + } +// public void applyWallConstraints( +// float[] prevEast, float[] prevNorth, +// float[] currEast, float[] currNorth, +// float[] weights, +// CoordinateConverter converter) { +// +// +// if (currentVenue == null || currentFloorKey == null) return; +// IndoorVenue.FloorFeatures floor = +// currentVenue.floorFeatures.get(currentFloorKey); +// if (floor == null || floor.wallPolygons.isEmpty()) return; +// +// for (int i = 0; i < weights.length; i++) { +// if (weights[i] == 0f) continue; // already dead, skip +// Log.d("WallDebug", "Particle " + i + +// " prev=(" + prevEast[i] + "," + prevNorth[i] + ")" + +// " curr=(" + currEast[i] + "," + currNorth[i] + ")" + +// " floor = "+ currentFloorKey); +// +// //convert prev and curr to LatLng +// LatLng prev = toLatLng(prevEast[i], prevNorth[i], converter); +// LatLng curr = toLatLng(currEast[i], currNorth[i], converter); +// +// //check if cross walls on that floor +// if (crossesAnyWall(prev, curr, floor.wallPolygons)) { +// Log.d("WallDebug", "Particle " + i + " CROSSED WALL"); +// LatLng snapped = adjustPositionToNearestValidLocation( +// prev, curr, getNearestWallPolygon(prev, curr, floor.wallPolygons)); +// Log.d("WallDebug", "Snapped from " + curr + " → " + snapped); +// float[] enu = converter.toEnu(snapped.latitude, snapped.longitude); +// Log.d("WallDebug", "Snapped from " + curr + " → " + snapped); +// //directly change currEast, currNorth, and weights arrays +// currEast[i] = enu[0]; +// currNorth[i] = enu[1]; +// //downweight changed location +// weights[i] *= 0.01f; +// Log.d("WallDebug", "Weight updated: " + weights[i]); +// +// } +// +// } +// Log.e("IndoorMapManager", "applied wall constraints!"); +// +// } +public void bakeEnuCoordinates(CoordinateConverter converter) { + if (currentVenue == null || currentFloorKey == null) return; + IndoorVenue.FloorFeatures floor = currentVenue.floorFeatures.get(currentFloorKey); + if (floor == null) return; + + floor.wallPolygonsEnu.clear(); + for (List polygon : floor.wallPolygons) { + List enuPoly = new ArrayList<>(); + for (LatLng p : polygon) { + enuPoly.add(converter.toEnu(p.latitude, p.longitude)); + } + floor.wallPolygonsEnu.add(enuPoly); } + Log.d("WallDebug", "Baked " + floor.wallPolygonsEnu.size() + " wall polygons to ENU"); +} private List getNearestWallPolygon(LatLng from, LatLng to, List> wallPolygons) { for (List polygon : wallPolygons) { @@ -276,9 +364,9 @@ private static int orientation(LatLng a, LatLng b, LatLng c) { double eps = 1e-12; - if (Math.abs(val) < eps) { - return 0; // collinear - } +// if (Math.abs(val) < eps) { +// return 0; // collinear +// } return (val > 0) ? 1 : 2; } @@ -608,6 +696,7 @@ private void switchFloor(int direction) { drawFloor(floorsObj.getJSONObject(currentFloorKey), currentFloorKey); isIndoorMapSet = true; Log.d("IndoorMapManager", "Switched to floor: " + currentFloorKey); + bakeEnuCoordinates(SensorFusion.getInstance().getCoordinateConverter()); } } catch (JSONException e) { @@ -681,6 +770,8 @@ private void drawFloor(JSONObject floorGeoJson, String floorKey) throws JSONExce } else if (t.contains("lift") || t.contains("elevator")) { features.liftCenters.add(centroidOf(outerPoints)); } + Log.d("IndoorTypes", "Feature " + i + " indoor_type='" + indoorType + + "' geomType=" + geomType + " points=" + outerPoints.size()); PolygonOptions opts = new PolygonOptions() .addAll(outerPoints) From d25adb9972d58fb4adaf46017adbb21514ea61eb Mon Sep 17 00:00:00 2001 From: sydneysavarese Date: Sun, 29 Mar 2026 13:24:05 +0100 Subject: [PATCH 40/82] completely stops fused path from going through walls, it will get stuck around wall though. ToDo: figure out how to route path around walls so it doesnt get stuck --- .../PositionMe/sensors/SensorFusion.java | 17 +- .../PositionMe/utils/IndoorMapManager.java | 495 +++++++++++++++++- 2 files changed, 475 insertions(+), 37 deletions(-) diff --git a/app/src/main/java/com/openpositioning/PositionMe/sensors/SensorFusion.java b/app/src/main/java/com/openpositioning/PositionMe/sensors/SensorFusion.java index 48b394a4..c24339dd 100644 --- a/app/src/main/java/com/openpositioning/PositionMe/sensors/SensorFusion.java +++ b/app/src/main/java/com/openpositioning/PositionMe/sensors/SensorFusion.java @@ -667,14 +667,15 @@ public void onLocationChanged(@NonNull Location location) { lastGnssLatLon = new double[]{location.getLatitude(), location.getLongitude()}; // Detect floor change and reset particle cloud if needed int currentFloor = pdrProcessing.getCurrentFloor(); - if (currentFloor != lastKnownFloor) { - float[] best = particleFilter.getBestEstimate(); - particleFilter.resetAroundPosition(best[0], best[1], 8f); - ekfPositioning.resetAroundPosition(best[0], best[1], 8f); - lastKnownFloor = currentFloor; - Log.i("SensorFusion", "Floor change detected: " + lastKnownFloor - + " → " + currentFloor + ", particles reset"); - } +// if (currentFloor != lastKnownFloor) { +// float[] best = particleFilter.getBestEstimate(); +// particleFilter.resetAroundPosition(best[0], best[1], 8f); +// ekfPositioning.resetAroundPosition(best[0], best[1], 8f); +// Log.i("SensorFusion", "Floor change detected: " + lastKnownFloor +// + " → " + currentFloor + ", particles reset"); +// lastKnownFloor = currentFloor; +// +// } } } diff --git a/app/src/main/java/com/openpositioning/PositionMe/utils/IndoorMapManager.java b/app/src/main/java/com/openpositioning/PositionMe/utils/IndoorMapManager.java index be93630c..2525fa91 100644 --- a/app/src/main/java/com/openpositioning/PositionMe/utils/IndoorMapManager.java +++ b/app/src/main/java/com/openpositioning/PositionMe/utils/IndoorMapManager.java @@ -190,35 +190,448 @@ public void selectVenue(IndoorVenue venue){ * @param currNorth current North positions after predict() (length 300) * @param weights weight array — modified in-place * @param converter to convert East-North → LatLng for wall geometry check + * + * */ + private static final float INTERSECTION_EPSILON = 1e-6f; + private static final float WALL_CLEARANCE_METERS = 0.20f; + private static final float WALL_SNAP_BACK_METERS = 0.25f; + private static final float RING_CLOSURE_EPSILON = 1e-4f; + public void applyWallConstraints( - float[] prevEast, float[] prevNorth, - float[] currEast, float[] currNorth, + float[] prevEast, + float[] prevNorth, + float[] currEast, + float[] currNorth, float[] weights, CoordinateConverter converter) { if (currentVenue == null || currentFloorKey == null) return; + IndoorVenue.FloorFeatures floor = currentVenue.floorFeatures.get(currentFloorKey); - if (floor == null || floor.wallPolygonsEnu.isEmpty()) { - Log.w("WallDebug", "No ENU wall polygons — did bakeEnuCoordinates run?"); - return; - } + if (floor == null || floor.wallPolygonsEnu == null || floor.wallPolygonsEnu.isEmpty()) return; + + List> walls = floor.wallPolygonsEnu; for (int i = 0; i < weights.length; i++) { - if (weights[i] == 0f) continue; + if (weights[i] <= 0f) continue; float[] prev = {prevEast[i], prevNorth[i]}; float[] curr = {currEast[i], currNorth[i]}; - if (crossesAnyWallEnu(prev, curr, floor.wallPolygonsEnu)) { - // Snap back to just before the wall - float[] snapped = snapToWallEnu(prev, curr, floor.wallPolygonsEnu); - currEast[i] = snapped[0]; - currNorth[i] = snapped[1]; - weights[i] = 0f; + WallCrossing crossing = findFirstWallCrossing(prev, curr, walls); + boolean tooClose = isTooCloseToAnyWall(curr, walls, WALL_CLEARANCE_METERS); + + if (crossing == null && !tooClose) { + continue; + } + + float[] corrected; + if (crossing != null) { + corrected = moveToJustBeforeWall(prev, curr, crossing.t, WALL_SNAP_BACK_METERS); + } else { + corrected = new float[]{prev[0], prev[1]}; + } + + currEast[i] = corrected[0]; + currNorth[i] = corrected[1]; + weights[i] *= 0.1f; + } + } + + private static class WallCrossing { + final float[] crossingPoint; + final int polygonIndex; + final int edgeIndex; + final float t; + + WallCrossing(float[] pt, int polygonIndex, int edgeIndex, float t) { + this.crossingPoint = pt; + this.polygonIndex = polygonIndex; + this.edgeIndex = edgeIndex; + this.t = t; + } + } + + private WallCrossing findFirstWallCrossing( + float[] from, + float[] to, + List> walls) { + + double bestT = Double.MAX_VALUE; + WallCrossing best = null; + + for (int pi = 0; pi < walls.size(); pi++) { + List polygon = walls.get(pi); + if (polygon == null || polygon.size() < 2) continue; + + int edgeCount = getRingEdgeCount(polygon); + + for (int ei = 0; ei < edgeCount; ei++) { + float[] a = polygon.get(ei); + float[] b = polygon.get((ei + 1) % polygon.size()); + + double t = intersectionT(from, to, a, b); + if (t >= 0.0 && t <= 1.0 && t < bestT) { + bestT = t; + float[] pt = { + (float) (from[0] + t * (to[0] - from[0])), + (float) (from[1] + t * (to[1] - from[1])) + }; + best = new WallCrossing(pt, pi, ei, (float) t); + } + } + } + + return best; + } + + private int getRingEdgeCount(List ring) { + if (ring == null || ring.size() < 2) return 0; + + float[] first = ring.get(0); + float[] last = ring.get(ring.size() - 1); + + boolean alreadyClosed = + Math.abs(first[0] - last[0]) < RING_CLOSURE_EPSILON && + Math.abs(first[1] - last[1]) < RING_CLOSURE_EPSILON; + + return alreadyClosed ? ring.size() - 1 : ring.size(); + } + + private double intersectionT(float[] p1, float[] p2, float[] p3, float[] p4) { + double rX = p2[0] - p1[0]; + double rY = p2[1] - p1[1]; + double sX = p4[0] - p3[0]; + double sY = p4[1] - p3[1]; + + double denom = rX * sY - rY * sX; + if (Math.abs(denom) < INTERSECTION_EPSILON) { + return -1.0; + } + + double qmpX = p3[0] - p1[0]; + double qmpY = p3[1] - p1[1]; + + double t = (qmpX * sY - qmpY * sX) / denom; + double u = (qmpX * rY - qmpY * rX) / denom; + + return (t >= 0.0 && t <= 1.0 && u >= 0.0 && u <= 1.0) ? t : -1.0; + } + + private boolean isTooCloseToAnyWall(float[] point, List> walls, float clearance) { + for (List polygon : walls) { + if (polygon == null || polygon.size() < 2) continue; + + int edgeCount = getRingEdgeCount(polygon); + + for (int i = 0; i < edgeCount; i++) { + float[] a = polygon.get(i); + float[] b = polygon.get((i + 1) % polygon.size()); + + if (distancePointToSegment(point, a, b) < clearance) { + return true; + } } } + return false; + } + + private float distancePointToSegment(float[] p, float[] a, float[] b) { + float px = p[0], py = p[1]; + float ax = a[0], ay = a[1]; + float bx = b[0], by = b[1]; + + float dx = bx - ax; + float dy = by - ay; + float len2 = dx * dx + dy * dy; + + if (len2 < 1e-12f) { + float ex = px - ax; + float ey = py - ay; + return (float) Math.sqrt(ex * ex + ey * ey); + } + + float t = ((px - ax) * dx + (py - ay) * dy) / len2; + t = Math.max(0f, Math.min(1f, t)); + + float cx = ax + t * dx; + float cy = ay + t * dy; + + float ex = px - cx; + float ey = py - cy; + return (float) Math.sqrt(ex * ex + ey * ey); + } + + private float[] moveToJustBeforeWall(float[] from, float[] to, float hitT, float snapBackMeters) { + float dx = to[0] - from[0]; + float dy = to[1] - from[1]; + float len = (float) Math.sqrt(dx * dx + dy * dy); + + if (len < 1e-6f) { + return new float[]{from[0], from[1]}; + } + + float backT = snapBackMeters / len; + float safeT = Math.max(0f, hitT - backT); + + return new float[]{ + from[0] + safeT * dx, + from[1] + safeT * dy + }; } +// private static final float MAX_GAP_WIDTH_METERS = 2.5f; +// private static final float GAP_SEARCH_RADIUS_METERS = 3.0f; +// private static final float MIN_GAP_WIDTH_METERS = 0.20f; +// private static final float GAP_ROUTE_WEIGHT_PENALTY = 0.5f; +// +// public void applyWallConstraints( +// float[] prevEast, +// float[] prevNorth, +// float[] currEast, +// float[] currNorth, +// float[] weights, +// CoordinateConverter converter) { +// +// if (currentVenue == null || currentFloorKey == null) return; +// IndoorVenue.FloorFeatures floor = currentVenue.floorFeatures.get(currentFloorKey); +// if (floor == null || floor.wallPolygonsEnu == null || floor.wallPolygonsEnu.isEmpty()) return; +// +// List> walls = floor.wallPolygonsEnu; +// +// for (int i = 0; i < weights.length; i++) { +// if (weights[i] <= 0f) continue; +// +// float[] prev = {prevEast[i], prevNorth[i]}; +// float[] curr = {currEast[i], currNorth[i]}; +// +// WallCrossing crossing = findFirstWallCrossing(prev, curr, walls); +// if (crossing == null) continue; +// +// float[] gapMid = findLocalGapNearCrossing( +// crossing.crossingPoint, +// walls, +// GAP_SEARCH_RADIUS_METERS, +// MIN_GAP_WIDTH_METERS, +// MAX_GAP_WIDTH_METERS +// ); +// +// if (gapMid != null) { +// boolean leg1Clear = findFirstWallCrossing(prev, gapMid, walls) == null; +// boolean leg2Clear = findFirstWallCrossing(gapMid, curr, walls) == null; +// +// if (leg1Clear && leg2Clear) { +// // Let particle continue to its intended destination, +// // but penalise for using an inferred opening. +// weights[i] *= GAP_ROUTE_WEIGHT_PENALTY; +// continue; +// } +// } +// +// float[] snapped = snapToWallEnu(prev, curr, walls); +// currEast[i] = snapped[0]; +// currNorth[i] = snapped[1]; +// weights[i] = 0f; +// } +// } +// +// private float[] findLocalGapNearCrossing( +// float[] crossingPoint, +// List> walls, +// float searchRadius, +// float minGapWidth, +// float maxGapWidth) { +// +// List nearbyVertices = new ArrayList<>(); +// +// // Only collect vertices near the crossing point +// for (List polygon : walls) { +// for (float[] pt : polygon) { +// if (distance(pt, crossingPoint) <= searchRadius) { +// nearbyVertices.add(pt); +// } +// } +// } +// +// float bestScore = Float.MAX_VALUE; +// float[] bestMid = null; +// +// for (int i = 0; i < nearbyVertices.size(); i++) { +// for (int j = i + 1; j < nearbyVertices.size(); j++) { +// float[] a = nearbyVertices.get(i); +// float[] b = nearbyVertices.get(j); +// +// float gapWidth = distance(a, b); +// if (gapWidth < minGapWidth || gapWidth > maxGapWidth) continue; +// +// float[] mid = midpoint(a, b); +// +// // midpoint itself must be close to the crossing +// float midpointDist = distance(mid, crossingPoint); +// if (midpointDist > searchRadius) continue; +// +// // Prefer narrow gaps close to the crossing point +// float score = midpointDist + 0.5f * gapWidth; +// +// if (score < bestScore) { +// bestScore = score; +// bestMid = mid; +// } +// } +// } +// +// return bestMid; +// } +// +// private float distance(float[] a, float[] b) { +// float dx = a[0] - b[0]; +// float dy = a[1] - b[1]; +// return (float) Math.sqrt(dx * dx + dy * dy); +// } +// +// private float[] midpoint(float[] a, float[] b) { +// return new float[] { +// 0.5f * (a[0] + b[0]), +// 0.5f * (a[1] + b[1]) +// }; +// } +// +// private static class WallCrossing { +// float[] crossingPoint; +// int polygonIndex; +// int edgeIndex; +// WallCrossing(float[] pt, int poly, int edge) { +// crossingPoint = pt; polygonIndex = poly; edgeIndex = edge; +// } +// } +// +// private WallCrossing findFirstWallCrossing(float[] from, float[] to, +// List> walls) { +// double bestT = Double.MAX_VALUE; +// WallCrossing best = null; +// +// for (int pi = 0; pi < walls.size(); pi++) { +// List polygon = walls.get(pi); +// for (int ei = 0; ei < polygon.size(); ei++) { +// float[] a = polygon.get(ei); +// float[] b = polygon.get((ei + 1) % polygon.size()); +// +// // Parametric intersection — find t along from→to where it hits a→b +// double t = intersectionT(from, to, a, b); +// if (t >= 0 && t <= 1 && t < bestT) { +// bestT = t; +// float[] pt = { +// (float)(from[0] + t * (to[0] - from[0])), +// (float)(from[1] + t * (to[1] - from[1])) +// }; +// best = new WallCrossing(pt, pi, ei); +// } +// } +// } +// return best; +// } +// +// // Returns t ∈ [0,1] along segment p1→p2 where it intersects p3→p4, or -1 if no intersection +// private double intersectionT(float[] p1, float[] p2, float[] p3, float[] p4) { +// double d1x = p2[0] - p1[0], d1y = p2[1] - p1[1]; +// double d2x = p4[0] - p3[0], d2y = p4[1] - p3[1]; +// double cross = d1x * d2y - d1y * d2x; +// if (Math.abs(cross) < 1e-6) return -1; +// +// double t = ((p3[0] - p1[0]) * d2y - (p3[1] - p1[1]) * d2x) / cross; +// double u = ((p3[0] - p1[0]) * d1y - (p3[1] - p1[1]) * d1x) / cross; +// return (t >= 0 && t <= 1 && u >= 0 && u <= 1) ? t : -1; +// } +// +// private float[] findNearestGap(float[] nearPoint, List> walls, +// float maxGapWidth) { +// float bestDist = Float.MAX_VALUE; +// float[] bestMid = null; +// +// // Collect all wall endpoints (start and end of each polygon) +// List endpoints = new ArrayList<>(); +// for (List polygon : walls) { +// // The last point of a closed polygon is the same as the first, +// // so the "open" endpoints are just all points in the list +// +// for (float[] pt : polygon) { +// endpoints.add(pt); +// } +// } +// +// // Find pairs of endpoints that are close together — those are gap edges +// for (int i = 0; i < endpoints.size(); i++) { +// for (int j = i + 1; j < endpoints.size(); j++) { +// float[] a = endpoints.get(i); +// float[] b = endpoints.get(j); +// +// float dx = b[0] - a[0]; +// float dy = b[1] - a[1]; +// float dist = (float) Math.sqrt(dx * dx + dy * dy); +// +// // Skip if the two endpoints are too far apart (not a gap) or +// // touching (same point — closing edge of same polygon) +// if (dist < 0.05f || dist > maxGapWidth) continue; +// +// // Midpoint of this gap +// float[] mid = {(a[0] + b[0]) / 2f, (a[1] + b[1]) / 2f}; +// +// // Distance from the wall crossing to this gap +// float dx2 = mid[0] - nearPoint[0]; +// float dy2 = mid[1] - nearPoint[1]; +// float gapDist = (float) Math.sqrt(dx2 * dx2 + dy2 * dy2); +//// Add this to findNearestGap temporarily for calibration +// Log.d("GapDebug", "Gap found: dist=" + dist + "m at " + mid[0] + "," + mid[1]); +// if (gapDist < bestDist) { +// bestDist = gapDist; +// bestMid = mid; +// } +// } +// } +// +// return bestMid; // null if no gap found within maxGapWidth +// } +// public void applyWallConstraints( +// float[] prevEast, float[] prevNorth, +// float[] currEast, float[] currNorth, +// float[] weights, +// CoordinateConverter converter) { +// +// if (currentVenue == null || currentFloorKey == null) return; +// IndoorVenue.FloorFeatures floor = currentVenue.floorFeatures.get(currentFloorKey); +// if (floor == null || floor.wallPolygonsEnu.isEmpty()) { +// Log.w("WallDebug", "No ENU wall polygons — did bakeEnuCoordinates run?"); +// return; +// } +// +// for (int i = 0; i < weights.length; i++) { +// if (weights[i] == 0f) continue; +// +// float[] prev = {prevEast[i], prevNorth[i]}; +// float[] curr = {currEast[i], currNorth[i]}; +// +// if (crossesAnyWallEnu(prev, curr, floor.wallPolygonsEnu)) { +// // Snap back to just before the wall +// float[] snapped = snapToWallEnu(prev, curr, floor.wallPolygonsEnu); +// currEast[i] = snapped[0]; +// currNorth[i] = snapped[1]; +// weights[i] *= 0.1; +// } +// } +// } + + private boolean crossesAnyWallEnu(float[] from, float[] to, List> walls) { + for (List polygon : walls) { + for (int i = 0; i < polygon.size(); i++) { + float[] a = polygon.get(i); + float[] b = polygon.get((i + 1) % polygon.size()); + if (segmentsIntersectEnu(from, to, a, b)) return true; + } + } + return false; + } + + private float[] snapToWallEnu(float[] from, float[] to, List> allWalls) { float[] best = from.clone(); @@ -241,28 +654,52 @@ private float[] snapToWallEnu(float[] from, float[] to, } return best; } - private boolean crossesAnyWallEnu(float[] from, float[] to, List> walls) { - for (List polygon : walls) { - for (int i = 0; i < polygon.size(); i++) { - float[] a = polygon.get(i); - float[] b = polygon.get((i + 1) % polygon.size()); - if (segmentsIntersectEnu(from, to, a, b)) return true; - } + + private boolean segmentsIntersectEnu(float[] p1, float[] p2, float[] p3, float[] p4) { + double eps = 1e-6; + + double o1 = orientation(p1, p2, p3); + double o2 = orientation(p1, p2, p4); + double o3 = orientation(p3, p4, p1); + double o4 = orientation(p3, p4, p2); + + // Proper intersection + if ((o1 > eps && o2 < -eps || o1 < -eps && o2 > eps) && + (o3 > eps && o4 < -eps || o3 < -eps && o4 > eps)) { + return true; } + + // Collinear / endpoint cases + if (Math.abs(o1) <= eps && onSegmentEnu(p1, p3, p2, eps)) return true; + if (Math.abs(o2) <= eps && onSegmentEnu(p1, p4, p2, eps)) return true; + if (Math.abs(o3) <= eps && onSegmentEnu(p3, p1, p4, eps)) return true; + if (Math.abs(o4) <= eps && onSegmentEnu(p3, p2, p4, eps)) return true; + return false; } - private boolean segmentsIntersectEnu(float[] p1, float[] p2, float[] p3, float[] p4) { - // All values in metres — no precision issues - double d1x = p2[0] - p1[0], d1y = p2[1] - p1[1]; - double d2x = p4[0] - p3[0], d2y = p4[1] - p3[1]; - double cross = d1x * d2y - d1y * d2x; - if (Math.abs(cross) < 1e-6) return false; // parallel, eps in m² is fine here + private double orientation(float[] a, float[] b, float[] c) { + return (b[0] - a[0]) * (c[1] - a[1]) - (b[1] - a[1]) * (c[0] - a[0]); + } - double t = ((p3[0] - p1[0]) * d2y - (p3[1] - p1[1]) * d2x) / cross; - double u = ((p3[0] - p1[0]) * d1y - (p3[1] - p1[1]) * d1x) / cross; - return t >= 0 && t <= 1 && u >= 0 && u <= 1; + private boolean onSegmentEnu(float[] a, float[] p, float[] b, double eps) { + return p[0] >= Math.min(a[0], b[0]) - eps && + p[0] <= Math.max(a[0], b[0]) + eps && + p[1] >= Math.min(a[1], b[1]) - eps && + p[1] <= Math.max(a[1], b[1]) + eps; } + +// private boolean segmentsIntersectEnu(float[] p1, float[] p2, float[] p3, float[] p4) { +// // All values in metres — no precision issues +// double d1x = p2[0] - p1[0], d1y = p2[1] - p1[1]; +// double d2x = p4[0] - p3[0], d2y = p4[1] - p3[1]; +// double cross = d1x * d2y - d1y * d2x; +// if (Math.abs(cross) < 1e-6) return false; // parallel, eps in m² is fine here +// +// double t = ((p3[0] - p1[0]) * d2y - (p3[1] - p1[1]) * d2x) / cross; +// double u = ((p3[0] - p1[0]) * d1y - (p3[1] - p1[1]) * d1x) / cross; +// return t >= 0 && t <= 1 && u >= 0 && u <= 1; +// } // public void applyWallConstraints( // float[] prevEast, float[] prevNorth, // float[] currEast, float[] currNorth, From a3e701003e65ea77cf991c274aa6688393faa2ac Mon Sep 17 00:00:00 2001 From: sydneysavarese Date: Sun, 29 Mar 2026 17:55:11 +0100 Subject: [PATCH 41/82] floor switch working! --- .../fragment/TrajectoryMapFragment.java | 27 ++- .../PositionMe/utils/IndoorMapManager.java | 207 +++++++++++++++--- 2 files changed, 190 insertions(+), 44 deletions(-) diff --git a/app/src/main/java/com/openpositioning/PositionMe/presentation/fragment/TrajectoryMapFragment.java b/app/src/main/java/com/openpositioning/PositionMe/presentation/fragment/TrajectoryMapFragment.java index c9aa60ef..094eddc8 100644 --- a/app/src/main/java/com/openpositioning/PositionMe/presentation/fragment/TrajectoryMapFragment.java +++ b/app/src/main/java/com/openpositioning/PositionMe/presentation/fragment/TrajectoryMapFragment.java @@ -146,6 +146,9 @@ public class TrajectoryMapFragment extends Fragment { /** Full list of smoothed positions (mirrors rawPolyline but filtered). */ private final List smoothedPoints = new ArrayList<>(); + String newfloor; + String oldfloor; + // // ------------------------------------------------------------------------- // // Colour-coded observation markers (last N per source) // // ------------------------------------------------------------------------- @@ -763,18 +766,13 @@ public void updateUserLocation(@NonNull LatLng newLocation, float orientation) { LatLng oldLocation = this.currentLocation; LatLng correctedLocation = newLocation; float heightChange = 0f; + if (sensorFusion != null) { float currentElevation = sensorFusion.getElevation(); + Log.d("MapMatch", "currel: " + currentElevation); - if (!Float.isNaN(lastElevation)) { - heightChange = currentElevation - lastElevation; - } - - - lastElevation = currentElevation; - } if (oldLocation != null && indoorMapManager != null) { // correctedLocation = indoorMapManager.indoorLocationCorrection( @@ -782,13 +780,22 @@ public void updateUserLocation(@NonNull LatLng newLocation, float orientation) { // newLocation, // heightChange // ); - - indoorMapManager.acceptFloorChange( + oldfloor = newfloor; + newfloor = indoorMapManager.acceptFloorChange( correctedLocation, oldLocation, - heightChange + currentElevation ); } + if(oldfloor != newfloor) { + Log.d("MapMatch", "new floor: " + newfloor); + + + if (floorLabel != null) { + floorLabel.post(() -> floorLabel.setText("Floor: " + newfloor)); + } + } + } this.currentLocation = correctedLocation; newLocation = correctedLocation; diff --git a/app/src/main/java/com/openpositioning/PositionMe/utils/IndoorMapManager.java b/app/src/main/java/com/openpositioning/PositionMe/utils/IndoorMapManager.java index 2525fa91..5dbc8d10 100644 --- a/app/src/main/java/com/openpositioning/PositionMe/utils/IndoorMapManager.java +++ b/app/src/main/java/com/openpositioning/PositionMe/utils/IndoorMapManager.java @@ -1,6 +1,7 @@ package com.openpositioning.PositionMe.utils; import android.graphics.Color; +import android.os.Looper; import android.util.Log; import com.google.android.gms.maps.GoogleMap; @@ -28,6 +29,11 @@ import java.util.Map; import java.util.HashMap; +//import java.util.logging.Handler; +import android.os.Handler; +import android.os.Looper; +import java.util.logging.LogRecord; + import static java.lang.Math.*; /** * Class used to manage indoor floor map overlays @@ -72,6 +78,19 @@ public class IndoorMapManager { final double floorDistThresh = 5.0; final double liftDistThresh = 3.0; + private String confirmedFloorKey = null; + private float confirmedFloorElevation = Float.NaN; + + private final Handler floorCommitHandler = new Handler(Looper.getMainLooper()); + private static final long FLOOR_COMMIT_DELAY_MS = 1500; + + private final Runnable commitBrowsedFloorRunnable = new Runnable() { + @Override + public void run() { + commitCurrentDisplayedFloor(); + } + }; + /** * Venue model used for storing API floorplan data @@ -904,66 +923,126 @@ public LatLng indoorLocationCorrection(LatLng oldLocation, LatLng predictedLocat //corrected position = point //break - public String acceptFloorChange(LatLng correctedLocation, LatLng oldLocation, float heightChangeMeters) { - if (currentVenue == null || currentFloorKey == null || correctedLocation == null || oldLocation == null) { + private long lastFloorChangeTimeMs = 0; + private static final long MIN_FLOOR_CHANGE_INTERVAL_MS = 5000; // 5 seconds minimum + private static final double HEIGHT_THRESHOLD_METERS = 2.5; + private static final double STAIRS_THRESHOLD_METERS = 5.0; + private static final double LIFT_THRESHOLD_METERS = 4.0; + private static final double LIFT_HORIZONTAL_THRESHOLD_METERS = 2.0; + + public String acceptFloorChange(LatLng correctedLocation, + LatLng oldLocation, + float currentHeight) { + + if (currentVenue == null || + currentFloorKey == null || + correctedLocation == null || + oldLocation == null) { return currentFloorKey; } - // Require meaningful vertical movement first - double heightThresholdMeters = 2.5; - if (Math.abs(heightChangeMeters) < heightThresholdMeters) { + if (confirmedFloorKey == null || Float.isNaN(confirmedFloorElevation)) { + Log.d("MapMatch", "No confirmed floor reference yet"); return currentFloorKey; } - IndoorVenue.FloorFeatures floorFeatures = currentVenue.floorFeatures.get(currentFloorKey); + long now = System.currentTimeMillis(); + if (now - lastFloorChangeTimeMs < MIN_FLOOR_CHANGE_INTERVAL_MS) { + Log.d("MapMatch", "Floor change blocked by debounce"); + return currentFloorKey; + } + + float heightChangeMeters = currentHeight - confirmedFloorElevation; + if (Math.abs(heightChangeMeters) < HEIGHT_THRESHOLD_METERS) { + Log.d("MapMatch", "Height change too small: " + heightChangeMeters); + return currentFloorKey; + } + + IndoorVenue.FloorFeatures floorFeatures = currentVenue.floorFeatures.get(confirmedFloorKey); if (floorFeatures == null) { + Log.d("MapMatch", "No floor features for confirmed floor: " + confirmedFloorKey); return currentFloorKey; } - double stairsThresholdMeters = 5.0; - double liftThresholdMeters = 4.0; - double liftHorizontalThresholdMeters = 2.0; + int direction = heightChangeMeters > 0 ? 1 : -1; + String nextFloorKey = getAdjacentFloorKey(confirmedFloorKey, direction); - boolean nearStairs = isNearAnyPoint(correctedLocation, floorFeatures.stairsCenters, stairsThresholdMeters); - boolean nearLift = isNearAnyPoint(correctedLocation, floorFeatures.liftCenters, liftThresholdMeters); + Log.d("MapMatch", "confirmed floor: " + confirmedFloorKey); + Log.d("MapMatch", "current displayed floor: " + currentFloorKey); + Log.d("MapMatch", "candidate next floor: " + nextFloorKey); + Log.d("MapMatch", "heightChange=" + heightChangeMeters); - if (!nearStairs && !nearLift) { + if (nextFloorKey == null || !currentVenue.floorFeatures.containsKey(nextFloorKey)) { + Log.d("MapMatch", "Next floor invalid"); return currentFloorKey; } + boolean nearStairs = isNearAnyPoint( + correctedLocation, + floorFeatures.stairsCenters, + STAIRS_THRESHOLD_METERS + ); + + boolean nearLift = isNearAnyPoint( + correctedLocation, + floorFeatures.liftCenters, + LIFT_THRESHOLD_METERS + ); + double horizontalDisplacement = distanceMeters(oldLocation, correctedLocation); - boolean usedLift = nearLift && horizontalDisplacement < liftHorizontalThresholdMeters; - boolean usedStairs = nearStairs && horizontalDisplacement >= liftHorizontalThresholdMeters; - Log.d("MapMatch", "heightChange=" + heightChangeMeters + - ", floor=" + currentFloorKey); - Log.d("MapMatch", "nearStairs=" + nearStairs + - ", nearLift=" + nearLift); + boolean usedLift = nearLift && horizontalDisplacement < LIFT_HORIZONTAL_THRESHOLD_METERS; + boolean usedStairs = nearStairs && horizontalDisplacement >= LIFT_HORIZONTAL_THRESHOLD_METERS; + + Log.d("MapMatch", "nearStairs=" + nearStairs + ", nearLift=" + nearLift); Log.d("MapMatch", "horizontalDisplacement=" + horizontalDisplacement); + Log.d("MapMatch", "usedLift=" + usedLift + ", usedStairs=" + usedStairs); - if (!usedLift && !usedStairs) { - return currentFloorKey; - } + /// commented out right now because location accuracy is bad so algo never detects that it is near stairs/lift +// if (!usedLift && !usedStairs) { +// Log.d("MapMatch", "Rejected floor change: not near stairs/lift in a plausible way"); +// return currentFloorKey; +// } - String nextFloorKey = getAdjacentFloorKey(currentFloorKey, heightChangeMeters > 0); - if (nextFloorKey == null || !currentVenue.floorFeatures.containsKey(nextFloorKey)) { + if (nextFloorKey.equals(confirmedFloorKey)) { return currentFloorKey; } - if (!nextFloorKey.equals(currentFloorKey)) { - currentFloorKey = nextFloorKey; - boolean goingUp = heightChangeMeters > 0; - switchFloor(goingUp ? +1 : -1); - } - return currentFloorKey; + commitAutoFloorChange(nextFloorKey, currentHeight); + lastFloorChangeTimeMs = now; + + Log.d("MapMatch", "Accepted floor change to " + nextFloorKey); + showFloor(nextFloorKey); + return nextFloorKey; + } + + private void commitCurrentDisplayedFloor() { + if (currentFloorKey == null) return; + + confirmedFloorKey = currentFloorKey; + confirmedFloorElevation = SensorFusion.getInstance().getElevation(); + + Log.d("IndoorMapManager", "Confirmed floor: " + confirmedFloorKey + + " at elevation " + confirmedFloorElevation); } - private String getAdjacentFloorKey(String floorKey, boolean goingUp) { + private String getAdjacentFloorKey(String floorKey, int direction) { + if (currentVenue == null || currentVenue.rawMapShapes == null) return null; + try { - int floor = Integer.parseInt(floorKey); - int next = goingUp ? floor + 1 : floor - 1; - return String.valueOf(next); - } catch (NumberFormatException e) { + JSONObject floorsObj = new JSONObject(currentVenue.rawMapShapes); + List floorKeys = getSortedFloorKeys(floorsObj); + + int idx = floorKeys.indexOf(floorKey); + if (idx < 0) return null; + + int next = idx + direction; + if (next < 0 || next >= floorKeys.size()) return null; + + return floorKeys.get(next); + + } catch (JSONException e) { + Log.e("IndoorMapManager", "getAdjacentFloorKey failed", e); return null; } } @@ -1117,6 +1196,9 @@ public void decreaseFloor() { * Switch floor based on direction (+1 or -1) */ private void switchFloor(int direction) { +// Log.d("Switchfloor", "Switching from floor") + + if (currentVenue == null || currentVenue.rawMapShapes == null) return; try { @@ -1134,12 +1216,61 @@ private void switchFloor(int direction) { isIndoorMapSet = true; Log.d("IndoorMapManager", "Switched to floor: " + currentFloorKey); bakeEnuCoordinates(SensorFusion.getInstance().getCoordinateConverter()); + + + // Delay the floor commit + floorCommitHandler.removeCallbacks(commitBrowsedFloorRunnable); + floorCommitHandler.postDelayed(commitBrowsedFloorRunnable, FLOOR_COMMIT_DELAY_MS); + } } catch (JSONException e) { Log.e("IndoorMapManager", "Floor switch failed", e); } } + + private void showFloor(String floorKey) { + if (currentVenue == null || currentVenue.rawMapShapes == null || floorKey == null) return; + + try { + JSONObject floorsObj = new JSONObject(currentVenue.rawMapShapes); + + currentFloorKey = floorKey; + clearIndoorFloor(); + Log.d("showFloor", "drawing floor "+ currentFloorKey); + drawFloor(floorsObj.getJSONObject(currentFloorKey), currentFloorKey); + isIndoorMapSet = true; + bakeEnuCoordinates(SensorFusion.getInstance().getCoordinateConverter()); + + Log.d("IndoorMapManager", "Showing floor: " + currentFloorKey); + + } catch (JSONException e) { + Log.e("IndoorMapManager", "Failed to show floor: " + floorKey, e); + } + } + + private void commitAutoFloorChange(String newFloorKey, float elevation) { + currentFloorKey = newFloorKey; + confirmedFloorKey = newFloorKey; + confirmedFloorElevation = elevation; + + floorCommitHandler.removeCallbacks(commitBrowsedFloorRunnable); + + try { + JSONObject floorsObj = new JSONObject(currentVenue.rawMapShapes); + clearIndoorFloor(); + drawFloor(floorsObj.getJSONObject(currentFloorKey), currentFloorKey); + isIndoorMapSet = true; + bakeEnuCoordinates(SensorFusion.getInstance().getCoordinateConverter()); + } catch (JSONException e) { + Log.e("IndoorMapManager", "Auto floor redraw failed", e); + } + + Log.d("IndoorMapManager", "AUTO confirmed floor: " + confirmedFloorKey + + " at elevation " + confirmedFloorElevation); + } + + /** * Draw a single floor from GeoJSON FeatureCollection. @@ -1352,6 +1483,14 @@ public String getCurrentFloorKey() { return currentFloorKey; } + public String getConfirmedFloorKey() { + return confirmedFloorKey; + } + + public float getConfirmedFloorElevation() { + return confirmedFloorElevation; + } + public IndoorVenue getCurrentVenue() { return currentVenue; } public IndoorVenue.FloorFeatures getCurrentFloorFeatures() { From 75f3271c406df4fcbc9e735118b52c90a6cd12e0 Mon Sep 17 00:00:00 2001 From: Haoning Huang Date: Sun, 29 Mar 2026 23:09:51 +0100 Subject: [PATCH 42/82] feat: accuracy-adaptive GNSS noise, fix duplicate WiFi fingerprint, fix wall penalty - Add updateWithGnss(measX, measY, accuracy) overload to ParticleFilter and EKF; observation noise std is now clamped to [3, 30] m from the reported GPS accuracy instead of a fixed 5 m constant - Remove duplicate trajectory.addWifiFingerprints() call in updateWifiData(); fingerprint was being appended twice per scan regardless of deduplication result - Replace hard zero-weight assignment for wall-crossing particles with a 0.01x penalty factor in IndoorMapManager.applyWallConstraints(), preventing full weight collapse when all particles cross a wall simultaneously --- .../sensors/ExtendedKalmanFilter.java | 14 +++++++++++++ .../PositionMe/sensors/ParticleFilter.java | 20 +++++++++++++++++++ .../PositionMe/sensors/SensorFusion.java | 8 +++----- .../PositionMe/utils/IndoorMapManager.java | 14 ++++++------- 4 files changed, 44 insertions(+), 12 deletions(-) diff --git a/app/src/main/java/com/openpositioning/PositionMe/sensors/ExtendedKalmanFilter.java b/app/src/main/java/com/openpositioning/PositionMe/sensors/ExtendedKalmanFilter.java index 5ba316a4..c1597751 100644 --- a/app/src/main/java/com/openpositioning/PositionMe/sensors/ExtendedKalmanFilter.java +++ b/app/src/main/java/com/openpositioning/PositionMe/sensors/ExtendedKalmanFilter.java @@ -114,6 +114,20 @@ public void updateWithGnss(float measX, float measY) { Log.d(TAG, "GNSS update. State: (" + stateX + ", " + stateY + ")"); } + /** + * Update with a GNSS observation using accuracy-adaptive noise. + * + * @param measX Observed East position (metres) + * @param measY Observed North position (metres) + * @param accuracy Reported horizontal accuracy from Android Location (metres) + */ + public void updateWithGnss(float measX, float measY, float accuracy) { + float noiseStd = Math.min(Math.max(accuracy, 3.0f), 30.0f); + update(measX, measY, noiseStd); + Log.d(TAG, "GNSS update (accuracy=" + accuracy + "m, noiseStd=" + noiseStd + + "m). State: (" + stateX + ", " + stateY + ")"); + } + /** Update with a WiFi positioning observation. */ public void updateWithWifi(float measX, float measY) { update(measX, measY, WIFI_NOISE_STD); diff --git a/app/src/main/java/com/openpositioning/PositionMe/sensors/ParticleFilter.java b/app/src/main/java/com/openpositioning/PositionMe/sensors/ParticleFilter.java index 68482784..81d3dc37 100644 --- a/app/src/main/java/com/openpositioning/PositionMe/sensors/ParticleFilter.java +++ b/app/src/main/java/com/openpositioning/PositionMe/sensors/ParticleFilter.java @@ -114,6 +114,26 @@ public void updateWithGnss(float measX, float measY) { Log.d(TAG, "GNSS update applied. Best estimate: " + java.util.Arrays.toString(getBestEstimate())); } + /** + * Update step using a GNSS position observation with accuracy-adaptive noise. + * Maps the reported GNSS accuracy (metres) to an observation noise std dev: + * accuracy < 5 m → noise std = accuracy (high trust) + * accuracy 5–20 m → noise std = accuracy + * accuracy > 20 m → noise std = accuracy (capped at 30 m) + * + * @param measX Observed East position in East-North metres + * @param measY Observed North position in East-North metres + * @param accuracy Reported horizontal accuracy from Android Location (metres) + */ + public void updateWithGnss(float measX, float measY, float accuracy) { + if (!initialized) return; + float noiseStd = Math.min(Math.max(accuracy, 3.0f), 30.0f); + updateWeights(measX, measY, noiseStd); + resample(); + Log.d(TAG, "GNSS update (accuracy=" + accuracy + "m, noiseStd=" + noiseStd + + "m). Best estimate: " + java.util.Arrays.toString(getBestEstimate())); + } + /** * Update step using a WiFi positioning observation. * diff --git a/app/src/main/java/com/openpositioning/PositionMe/sensors/SensorFusion.java b/app/src/main/java/com/openpositioning/PositionMe/sensors/SensorFusion.java index 48b394a4..95e21738 100644 --- a/app/src/main/java/com/openpositioning/PositionMe/sensors/SensorFusion.java +++ b/app/src/main/java/com/openpositioning/PositionMe/sensors/SensorFusion.java @@ -659,11 +659,11 @@ public void onLocationChanged(@NonNull Location location) { enuBaked = true; } } else { - // Subsequent positions: convert to East-North space and update particle weights + // Subsequent positions: convert to East-North space and update particle weights. float[] enu = coordinateConverter.toEnu( location.getLatitude(), location.getLongitude()); - particleFilter.updateWithGnss(enu[0], enu[1]); - ekfPositioning.updateWithGnss(enu[0], enu[1]); + particleFilter.updateWithGnss(enu[0], enu[1], accuracy); + ekfPositioning.updateWithGnss(enu[0], enu[1], accuracy); lastGnssLatLon = new double[]{location.getLatitude(), location.getLongitude()}; // Detect floor change and reset particle cloud if needed int currentFloor = pdrProcessing.getCurrentFloor(); @@ -747,8 +747,6 @@ private void updateWifiData(Object[] wifiList) { } else { android.util.Log.d("SensorFusion", "Duplicate WiFi fingerprint skipped"); } - // Adding WiFi data to Trajectory - this.trajectory.addWifiFingerprints(wifiData); } diff --git a/app/src/main/java/com/openpositioning/PositionMe/utils/IndoorMapManager.java b/app/src/main/java/com/openpositioning/PositionMe/utils/IndoorMapManager.java index be93630c..8e99cb4f 100644 --- a/app/src/main/java/com/openpositioning/PositionMe/utils/IndoorMapManager.java +++ b/app/src/main/java/com/openpositioning/PositionMe/utils/IndoorMapManager.java @@ -211,11 +211,11 @@ public void applyWallConstraints( float[] curr = {currEast[i], currNorth[i]}; if (crossesAnyWallEnu(prev, curr, floor.wallPolygonsEnu)) { - // Snap back to just before the wall + // Snap particle to last valid position and apply strong weight penalty float[] snapped = snapToWallEnu(prev, curr, floor.wallPolygonsEnu); currEast[i] = snapped[0]; currNorth[i] = snapped[1]; - weights[i] = 0f; + weights[i] *= 0.01f; } } } @@ -461,11 +461,11 @@ public LatLng indoorLocationCorrection(LatLng oldLocation, LatLng predictedLocat } //find nearest valid point that doesn't intersect walls -//loop through points on segment just traversed starting from predicted location back towards prev location -//use dx and dy -//once we find point that doesn't intersect wall -//corrected position = point -//break + //loop through points on segment just traversed starting from predicted location back towards prev location + //use dx and dy + //once we find point that doesn't intersect wall + //corrected position = point + //break public String acceptFloorChange(LatLng correctedLocation, LatLng oldLocation, float heightChangeMeters) { if (currentVenue == null || currentFloorKey == null || correctedLocation == null || oldLocation == null) { From aba3957fb7dd7cf446c50c371fe39b065d923608 Mon Sep 17 00:00:00 2001 From: Haoning Huang Date: Sun, 29 Mar 2026 23:35:57 +0100 Subject: [PATCH 43/82] feat: fix PDR heading bias and add WiFi AP-count adaptive noise - Complementary filter for heading: gyroscope integrates yaw between steps, rotation vector applies 2% correction per update to prevent long-term drift; PDR now uses fusedHeading instead of raw orientation[0] - WiFi observation noise scales with AP count: noise = clamp(20 - apCount*1.5, 8, 20) m, so scans with more visible APs receive higher trust in both ParticleFilter and EKF --- .../sensors/ExtendedKalmanFilter.java | 14 ++++++ .../PositionMe/sensors/ParticleFilter.java | 16 ++++++ .../PositionMe/sensors/SensorFusion.java | 49 +++++++++++++++++-- 3 files changed, 76 insertions(+), 3 deletions(-) diff --git a/app/src/main/java/com/openpositioning/PositionMe/sensors/ExtendedKalmanFilter.java b/app/src/main/java/com/openpositioning/PositionMe/sensors/ExtendedKalmanFilter.java index c1597751..0fc67cf9 100644 --- a/app/src/main/java/com/openpositioning/PositionMe/sensors/ExtendedKalmanFilter.java +++ b/app/src/main/java/com/openpositioning/PositionMe/sensors/ExtendedKalmanFilter.java @@ -134,6 +134,20 @@ public void updateWithWifi(float measX, float measY) { Log.d(TAG, "WiFi update. State: (" + stateX + ", " + stateY + ")"); } + /** + * Update with a WiFi positioning observation using AP-count-adaptive noise. + * + * @param measX Observed East position (metres) + * @param measY Observed North position (metres) + * @param apCount Number of WiFi APs used to compute the position fix + */ + public void updateWithWifi(float measX, float measY, int apCount) { + float noiseStd = Math.max(8.0f, 20.0f - apCount * 1.5f); + update(measX, measY, noiseStd); + Log.d(TAG, "WiFi update (apCount=" + apCount + ", noiseStd=" + noiseStd + + "m). State: (" + stateX + ", " + stateY + ")"); + } + /** * Returns the current best position estimate. * diff --git a/app/src/main/java/com/openpositioning/PositionMe/sensors/ParticleFilter.java b/app/src/main/java/com/openpositioning/PositionMe/sensors/ParticleFilter.java index 81d3dc37..ccd87cc6 100644 --- a/app/src/main/java/com/openpositioning/PositionMe/sensors/ParticleFilter.java +++ b/app/src/main/java/com/openpositioning/PositionMe/sensors/ParticleFilter.java @@ -147,6 +147,22 @@ public void updateWithWifi(float measX, float measY) { Log.d(TAG, "WiFi update applied. Best estimate: " + java.util.Arrays.toString(getBestEstimate())); } + /** + * Update step using a WiFi positioning observation with AP-count-adaptive noise. + * + * @param measX Observed East position in East-North metres + * @param measY Observed North position in East-North metres + * @param apCount Number of WiFi APs used to compute the position fix + */ + public void updateWithWifi(float measX, float measY, int apCount) { + if (!initialized) return; + float noiseStd = Math.max(8.0f, 20.0f - apCount * 1.5f); + updateWeights(measX, measY, noiseStd); + resample(); + Log.d(TAG, "WiFi update (apCount=" + apCount + ", noiseStd=" + noiseStd + + "m). Best estimate: " + java.util.Arrays.toString(getBestEstimate())); + } + /** * Returns the current best position estimate as the weighted mean of all particles. * diff --git a/app/src/main/java/com/openpositioning/PositionMe/sensors/SensorFusion.java b/app/src/main/java/com/openpositioning/PositionMe/sensors/SensorFusion.java index 95e21738..cdd6743c 100644 --- a/app/src/main/java/com/openpositioning/PositionMe/sensors/SensorFusion.java +++ b/app/src/main/java/com/openpositioning/PositionMe/sensors/SensorFusion.java @@ -200,6 +200,11 @@ public class SensorFusion implements SensorEventListener, Observer { private float prevPdrX = 0f; private float prevPdrY = 0f; + // Gyroscope-integrated heading with rotation-vector correction (radians) + private float fusedHeading = 0f; + private boolean headingInitialised = false; + private long lastGyroTimestampMs = 0; + // Floor change detection for particle reset private int lastKnownFloor = 0; @@ -458,6 +463,17 @@ public void onSensorChanged(SensorEvent sensorEvent) { angularVelocity[1] = sensorEvent.values[1]; angularVelocity[2] = sensorEvent.values[2]; + // Integrate yaw rate to advance fusedHeading. + // angularVelocity[2] is the device z-axis rotation rate (rad/s). + if (headingInitialised && lastGyroTimestampMs > 0) { + long dtMs = currentTime - lastGyroTimestampMs; + if (dtMs > 0 && dtMs < 500) { + fusedHeading = normalizeAngle(fusedHeading - angularVelocity[2] * (dtMs / 1000f)); + } + } + lastGyroTimestampMs = currentTime; + break; + case Sensor.TYPE_LINEAR_ACCELERATION: filteredAcc[0] = sensorEvent.values[0]; filteredAcc[1] = sensorEvent.values[1]; @@ -509,6 +525,16 @@ public void onSensorChanged(SensorEvent sensorEvent) { float[] rotationVectorDCM = new float[9]; SensorManager.getRotationMatrixFromVector(rotationVectorDCM, this.rotation); SensorManager.getOrientation(rotationVectorDCM, this.orientation); + + // Complementary filter: slow rotation-vector correction on gyro-integrated heading. + // Corrects long-term gyro drift while preserving short-term stability. + if (!headingInitialised) { + fusedHeading = this.orientation[0]; + headingInitialised = true; + } else { + float diff = normalizeAngle(this.orientation[0] - fusedHeading); + fusedHeading = normalizeAngle(fusedHeading + 0.02f * diff); + } break; case Sensor.TYPE_STEP_DETECTOR: @@ -534,7 +560,7 @@ public void onSensorChanged(SensorEvent sensorEvent) { float[] newCords = this.pdrProcessing.updatePdr( stepTime, this.accelMagnitude, - this.orientation[0] + fusedHeading ); // Feed PDR displacement to particle filter @@ -1040,6 +1066,8 @@ private void createWifiPositionRequestCallback(){ for (Wifi data : this.wifiList){ wifiAccessPoints.put(String.valueOf(data.getBssid()), data.getLevel()); } + // Capture AP count before entering the async callback + final int apCount = this.wifiList.size(); // Creating POST Request JSONObject wifiFingerPrint = new JSONObject(); wifiFingerPrint.put(WIFI_FINGERPRINT, wifiAccessPoints); @@ -1062,8 +1090,8 @@ public void onSuccess(LatLng wifiLocation, int floor) { // Normal update float[] enu = coordinateConverter.toEnu( wifiLocation.latitude, wifiLocation.longitude); - particleFilter.updateWithWifi(enu[0], enu[1]); - ekfPositioning.updateWithWifi(enu[0], enu[1]); + particleFilter.updateWithWifi(enu[0], enu[1], apCount); + ekfPositioning.updateWithWifi(enu[0], enu[1], apCount); } } @@ -1581,6 +1609,9 @@ public void startRecording() { lastKnownFloor = 0; prevPdrX = 0f; prevPdrY = 0f; + fusedHeading = 0f; + headingInitialised = false; + lastGyroTimestampMs = 0; if(settings.getBoolean("overwrite_constants", false)) { this.filter_coefficient = Float.parseFloat(settings.getString("accel_filter", "0.96")); } else { @@ -1743,4 +1774,16 @@ public double[] enuToLatLon(float east, float north) { //endregion + /** + * Wraps an angle in radians to the range [-π, π]. + * + * @param angle angle in radians + * @return equivalent angle in [-π, π] + */ + private float normalizeAngle(float angle) { + while (angle > Math.PI) angle -= 2 * (float) Math.PI; + while (angle < -Math.PI) angle += 2 * (float) Math.PI; + return angle; + } + } From c3c1111ded294928b51f4cd1ba8221727c1fe770 Mon Sep 17 00:00:00 2001 From: Haoning Huang Date: Sun, 29 Mar 2026 23:42:39 +0100 Subject: [PATCH 44/82] fix: inject particles near observation on weight collapse When all particle weights collapse to zero (PDR error exceeds observation noise range), 20% of particles are now reseeded near the GNSS/WiFi observation before resetting to uniform weights, allowing the filter to recover its position estimate rather than staying frozen at the wrong location. --- .../PositionMe/sensors/ParticleFilter.java | 20 ++++++++++++++++--- 1 file changed, 17 insertions(+), 3 deletions(-) diff --git a/app/src/main/java/com/openpositioning/PositionMe/sensors/ParticleFilter.java b/app/src/main/java/com/openpositioning/PositionMe/sensors/ParticleFilter.java index ccd87cc6..aed24b51 100644 --- a/app/src/main/java/com/openpositioning/PositionMe/sensors/ParticleFilter.java +++ b/app/src/main/java/com/openpositioning/PositionMe/sensors/ParticleFilter.java @@ -277,13 +277,20 @@ public boolean isInitialized() { return initialized; } + /** + * Fraction of particles injected near the observation when weight collapse is detected. + * These particles allow the filter to recover when PDR error exceeds the observation noise range. + */ + private static final float INJECTION_FRACTION = 0.2f; + /** * Multiplies each particle's weight by the Gaussian likelihood of the given observation. * Normalizes the weight array, sum = 1. * * Likelihood: w_i *= exp( -distance^2 / (2 * std^2) ) * - * If all weights collapse to zero, weights are reset to uniform to allow recovery. + * If all weights collapse to zero, a fraction of particles is injected near the observation + * to allow recovery when PDR error is large. Remaining particles retain uniform weights. * * @param measX Observed East position (East-North metres) * @param measY Observed North position (East-North metres) @@ -307,8 +314,15 @@ private void updateWeights(float measX, float measY, float noiseStd) { weights[i] /= totalWeight; } } else { - // Weight collapse: reset to uniform so the filter can recover - Log.w(TAG, "Weight collapse detected — resetting to uniform weights"); + // Weight collapse: inject a fraction of particles near the observation, + // then reset all weights to uniform. + Log.w(TAG, "Weight collapse — injecting particles near observation (" + + measX + ", " + measY + ")"); + int injected = (int) (NUM_PARTICLES * INJECTION_FRACTION); + for (int i = 0; i < injected; i++) { + particlesX[i] = measX + (float) (random.nextGaussian() * noiseStd); + particlesY[i] = measY + (float) (random.nextGaussian() * noiseStd); + } float uniform = 1.0f / NUM_PARTICLES; for (int i = 0; i < NUM_PARTICLES; i++) { weights[i] = uniform; From fa41275b60c5d32fde3f33edaf0063d3428e8e9c Mon Sep 17 00:00:00 2001 From: Haoning Huang Date: Mon, 30 Mar 2026 00:25:47 +0100 Subject: [PATCH 45/82] feat: ZUPT, jump rejection, sigma-adaptive noise, GNSS heading, display smoothing - ZUPT: skip PDR predict when accel peak-to-peak < 0.5 m/s^2 (false/stationary step) - Jump rejection: discard GNSS/WiFi updates that jump >80m from current estimate - Sigma-adaptive noise: halve observation noise (min 3m/5m) when particle sigma >15m - GNSS heading: derive fusedHeading from consecutive GNSS fixes when displacement >3m, bypassing indoor magnetic distortion in rotation vector - Display: apply LPF (alpha=0.15) to purple fused trajectory; both polylines now share the same filtered point instead of the purple line showing raw positions --- .../fragment/TrajectoryMapFragment.java | 8 +- .../sensors/ExtendedKalmanFilter.java | 12 +++ .../PositionMe/sensors/ParticleFilter.java | 15 ++++ .../PositionMe/sensors/SensorFusion.java | 82 +++++++++++++++++-- 4 files changed, 109 insertions(+), 8 deletions(-) diff --git a/app/src/main/java/com/openpositioning/PositionMe/presentation/fragment/TrajectoryMapFragment.java b/app/src/main/java/com/openpositioning/PositionMe/presentation/fragment/TrajectoryMapFragment.java index c9aa60ef..7f038f09 100644 --- a/app/src/main/java/com/openpositioning/PositionMe/presentation/fragment/TrajectoryMapFragment.java +++ b/app/src/main/java/com/openpositioning/PositionMe/presentation/fragment/TrajectoryMapFragment.java @@ -131,7 +131,7 @@ public class TrajectoryMapFragment extends Fragment { * Low-pass filter alpha. Range [0,1]. * Lower = smoother but more lag; higher = less smoothing but more responsive. */ - private static final double LOW_PASS_ALPHA = 0.25; + private static final double LOW_PASS_ALPHA = 0.15; // ------------------------------------------------------------------------- // Smoothing state @@ -943,12 +943,14 @@ public void updatePdrPosition(@NonNull LatLng pdrLocation) { public void updateFusedPosition(@NonNull LatLng fusedLocation) { if (gMap == null) return; + // Apply LPF to fused position; both polylines share the same filtered point + LatLng lpfFiltered = applyLowPassFilter(fusedLocation); + // Purple fused path — always grows - smoothedPoints.add(fusedLocation); + smoothedPoints.add(lpfFiltered); redrawFusedTrajectory(); // Teal LPF path — grows but only visible when smoothing toggle is ON - LatLng lpfFiltered = applyLowPassFilter(fusedLocation); lpfPoints.add(lpfFiltered); if (lpfPolyline != null) { lpfPolyline.setPoints(new ArrayList<>(lpfPoints)); diff --git a/app/src/main/java/com/openpositioning/PositionMe/sensors/ExtendedKalmanFilter.java b/app/src/main/java/com/openpositioning/PositionMe/sensors/ExtendedKalmanFilter.java index 0fc67cf9..9ded598a 100644 --- a/app/src/main/java/com/openpositioning/PositionMe/sensors/ExtendedKalmanFilter.java +++ b/app/src/main/java/com/openpositioning/PositionMe/sensors/ExtendedKalmanFilter.java @@ -134,6 +134,18 @@ public void updateWithWifi(float measX, float measY) { Log.d(TAG, "WiFi update. State: (" + stateX + ", " + stateY + ")"); } + /** + * Update with a WiFi positioning observation with a caller-supplied noise std. + * + * @param measX Observed East position (metres) + * @param measY Observed North position (metres) + * @param noiseStd Observation noise standard deviation (metres) + */ + public void updateWithWifi(float measX, float measY, float noiseStd) { + update(measX, measY, noiseStd); + Log.d(TAG, "WiFi update (noiseStd=" + noiseStd + "m). State: (" + stateX + ", " + stateY + ")"); + } + /** * Update with a WiFi positioning observation using AP-count-adaptive noise. * diff --git a/app/src/main/java/com/openpositioning/PositionMe/sensors/ParticleFilter.java b/app/src/main/java/com/openpositioning/PositionMe/sensors/ParticleFilter.java index aed24b51..3542cc18 100644 --- a/app/src/main/java/com/openpositioning/PositionMe/sensors/ParticleFilter.java +++ b/app/src/main/java/com/openpositioning/PositionMe/sensors/ParticleFilter.java @@ -147,6 +147,21 @@ public void updateWithWifi(float measX, float measY) { Log.d(TAG, "WiFi update applied. Best estimate: " + java.util.Arrays.toString(getBestEstimate())); } + /** + * Update step using a WiFi positioning observation with a caller-supplied noise std. + * + * @param measX Observed East position in East-North metres + * @param measY Observed North position in East-North metres + * @param noiseStd Observation noise standard deviation (metres) + */ + public void updateWithWifi(float measX, float measY, float noiseStd) { + if (!initialized) return; + updateWeights(measX, measY, noiseStd); + resample(); + Log.d(TAG, "WiFi update (noiseStd=" + noiseStd + "m). Best estimate: " + + java.util.Arrays.toString(getBestEstimate())); + } + /** * Update step using a WiFi positioning observation with AP-count-adaptive noise. * diff --git a/app/src/main/java/com/openpositioning/PositionMe/sensors/SensorFusion.java b/app/src/main/java/com/openpositioning/PositionMe/sensors/SensorFusion.java index cdd6743c..a9760312 100644 --- a/app/src/main/java/com/openpositioning/PositionMe/sensors/SensorFusion.java +++ b/app/src/main/java/com/openpositioning/PositionMe/sensors/SensorFusion.java @@ -219,6 +219,9 @@ public class SensorFusion implements SensorEventListener, Observer { private double[] lastWifiLatLon = null; // {lat, lon} private double[] lastPdrLatLon = null; // {lat, lon} + // Previous valid GNSS position in ENU (metres), used to derive heading from consecutive fixes + private float[] lastGnssEnu = null; + private final List testPoints = new ArrayList<>(); boolean enuBaked = false; @@ -547,6 +550,12 @@ public void onSensorChanged(SensorEvent sensorEvent) { } else { lastStepTime = currentTime; + // Skip PDR update if the acceleration pattern indicates no real movement + if (isStationary(accelMagnitude)) { + accelMagnitude.clear(); + break; + } + // Log if accelMagnitude is empty if (accelMagnitude.isEmpty()) { Log.e("SensorFusion", @@ -688,9 +697,40 @@ public void onLocationChanged(@NonNull Location location) { // Subsequent positions: convert to East-North space and update particle weights. float[] enu = coordinateConverter.toEnu( location.getLatitude(), location.getLongitude()); - particleFilter.updateWithGnss(enu[0], enu[1], accuracy); - ekfPositioning.updateWithGnss(enu[0], enu[1], accuracy); - lastGnssLatLon = new double[]{location.getLatitude(), location.getLongitude()}; + + // Jump detection: reject position if it is too far from the current estimate + float[] currentEst = particleFilter.getBestEstimate(); + float jumpDist = (float) Math.hypot( + enu[0] - currentEst[0], enu[1] - currentEst[1]); + if (jumpDist > 80f) { + Log.w("SensorFusion", "GNSS jump " + jumpDist + "m — update rejected"); + } else { + // Sigma-adaptive noise: tighten observation noise when particles diverge + float adaptedAccuracy = accuracy; + double sigma = particleFilter.getSigmaMetres(); + if (sigma > 15.0) { + adaptedAccuracy = Math.max(accuracy * 0.5f, 3.0f); + } + + // Derive heading from two consecutive valid GNSS fixes + if (lastGnssEnu != null) { + float dEast = enu[0] - lastGnssEnu[0]; + float dNorth = enu[1] - lastGnssEnu[1]; + float gnssDist = (float) Math.hypot(dEast, dNorth); + if (gnssDist > 3f) { + fusedHeading = normalizeAngle( + (float) Math.atan2(dEast, dNorth)); + Log.d("SensorFusion", "GNSS heading: " + + (float) Math.toDegrees(fusedHeading) + "°"); + } + } + lastGnssEnu = enu; + + particleFilter.updateWithGnss(enu[0], enu[1], adaptedAccuracy); + ekfPositioning.updateWithGnss(enu[0], enu[1], adaptedAccuracy); + lastGnssLatLon = new double[]{location.getLatitude(), location.getLongitude()}; + } + // Detect floor change and reset particle cloud if needed int currentFloor = pdrProcessing.getCurrentFloor(); if (currentFloor != lastKnownFloor) { @@ -1090,9 +1130,23 @@ public void onSuccess(LatLng wifiLocation, int floor) { // Normal update float[] enu = coordinateConverter.toEnu( wifiLocation.latitude, wifiLocation.longitude); - particleFilter.updateWithWifi(enu[0], enu[1], apCount); - ekfPositioning.updateWithWifi(enu[0], enu[1], apCount); + // Jump detection: reject position if it is too far from the current estimate + float[] currentEst = particleFilter.getBestEstimate(); + float jumpDist = (float) Math.hypot( + enu[0] - currentEst[0], enu[1] - currentEst[1]); + if (jumpDist > 80f) { + Log.w("SensorFusion", "WiFi jump " + jumpDist + "m — update rejected"); + } else { + // Sigma-adaptive noise: tighten observation noise when particles diverge + float noiseStd = Math.max(8.0f, 20.0f - apCount * 1.5f); + double sigma = particleFilter.getSigmaMetres(); + if (sigma > 15.0) { + noiseStd = Math.max(noiseStd * 0.5f, 5.0f); + } + particleFilter.updateWithWifi(enu[0], enu[1], noiseStd); + ekfPositioning.updateWithWifi(enu[0], enu[1], noiseStd); + } } } @@ -1612,6 +1666,7 @@ public void startRecording() { fusedHeading = 0f; headingInitialised = false; lastGyroTimestampMs = 0; + lastGnssEnu = null; if(settings.getBoolean("overwrite_constants", false)) { this.filter_coefficient = Float.parseFloat(settings.getString("accel_filter", "0.96")); } else { @@ -1774,6 +1829,23 @@ public double[] enuToLatLon(float east, float north) { //endregion + /** + * Returns true if the linear acceleration samples indicate the device is stationary. + * Uses the peak-to-peak range of the sample window. + * + * @param samples linear acceleration magnitudes (m/s²) collected between two step events + * @return true if peak-to-peak range is below the stationary threshold (0.5 m/s²) + */ + private boolean isStationary(List samples) { + if (samples.isEmpty()) return false; + double max = Double.MIN_VALUE, min = Double.MAX_VALUE; + for (double v : samples) { + if (v > max) max = v; + if (v < min) min = v; + } + return (max - min) < 0.5; + } + /** * Wraps an angle in radians to the range [-π, π]. * From 94efd2d9c8bcbbd326bda9fb1a2ca3bb9a87ade5 Mon Sep 17 00:00:00 2001 From: Haoning Huang Date: Mon, 30 Mar 2026 00:40:01 +0100 Subject: [PATCH 46/82] fix: guard GNSS heading update against low-accuracy fixes Displacement threshold is now max(accuracy * 1.5, 5m) instead of a fixed 3m, so a noisy GNSS fix cannot corrupt fusedHeading when the reported accuracy is large. --- .../openpositioning/PositionMe/sensors/SensorFusion.java | 7 +++++-- 1 file changed, 5 insertions(+), 2 deletions(-) diff --git a/app/src/main/java/com/openpositioning/PositionMe/sensors/SensorFusion.java b/app/src/main/java/com/openpositioning/PositionMe/sensors/SensorFusion.java index a9760312..e61d132e 100644 --- a/app/src/main/java/com/openpositioning/PositionMe/sensors/SensorFusion.java +++ b/app/src/main/java/com/openpositioning/PositionMe/sensors/SensorFusion.java @@ -712,12 +712,15 @@ public void onLocationChanged(@NonNull Location location) { adaptedAccuracy = Math.max(accuracy * 0.5f, 3.0f); } - // Derive heading from two consecutive valid GNSS fixes + // Derive heading from two consecutive valid GNSS fixes. + // Displacement must exceed 1.5x the reported accuracy to ensure the + // computed direction reflects real movement rather than GPS noise. if (lastGnssEnu != null) { float dEast = enu[0] - lastGnssEnu[0]; float dNorth = enu[1] - lastGnssEnu[1]; float gnssDist = (float) Math.hypot(dEast, dNorth); - if (gnssDist > 3f) { + float minDist = Math.max(accuracy * 1.5f, 5f); + if (gnssDist > minDist) { fusedHeading = normalizeAngle( (float) Math.atan2(dEast, dNorth)); Log.d("SensorFusion", "GNSS heading: " From 3b0af2b5647a1548ce1a100b5385841a040efbf6 Mon Sep 17 00:00:00 2001 From: Haoning Huang Date: Mon, 30 Mar 2026 11:04:33 +0100 Subject: [PATCH 47/82] fix: reduce motion noise std and re-centre on high-accuracy GNSS Lower MOTION_NOISE_STD from 0.3 to 0.15m in ParticleFilter and EKF. When GNSS accuracy < 5m, reset particle cloud directly around the fix instead of weighted update. --- .../PositionMe/sensors/ExtendedKalmanFilter.java | 2 +- .../PositionMe/sensors/ParticleFilter.java | 2 +- .../PositionMe/sensors/SensorFusion.java | 12 ++++++++++-- 3 files changed, 12 insertions(+), 4 deletions(-) diff --git a/app/src/main/java/com/openpositioning/PositionMe/sensors/ExtendedKalmanFilter.java b/app/src/main/java/com/openpositioning/PositionMe/sensors/ExtendedKalmanFilter.java index 9ded598a..e53a5121 100644 --- a/app/src/main/java/com/openpositioning/PositionMe/sensors/ExtendedKalmanFilter.java +++ b/app/src/main/java/com/openpositioning/PositionMe/sensors/ExtendedKalmanFilter.java @@ -17,7 +17,7 @@ public class ExtendedKalmanFilter { private static final String TAG = "EKFPositioning"; /** PDR process noise standard deviation (metres). */ - private static final float MOTION_NOISE_STD = 0.3f; + private static final float MOTION_NOISE_STD = 0.15f; /** GNSS observation noise standard deviation (metres). */ private static final float GNSS_NOISE_STD = 5.0f; /** WiFi observation noise standard deviation (metres). */ diff --git a/app/src/main/java/com/openpositioning/PositionMe/sensors/ParticleFilter.java b/app/src/main/java/com/openpositioning/PositionMe/sensors/ParticleFilter.java index 3542cc18..cc089e60 100644 --- a/app/src/main/java/com/openpositioning/PositionMe/sensors/ParticleFilter.java +++ b/app/src/main/java/com/openpositioning/PositionMe/sensors/ParticleFilter.java @@ -27,7 +27,7 @@ public class ParticleFilter { * Standard deviation of Gaussian noise added to each particle during the predict step (metres). * Represents uncertainty in PDR step length / heading. */ - private static final float MOTION_NOISE_STD = 0.3f; + private static final float MOTION_NOISE_STD = 0.15f; /** * Standard deviation of the GNSS observation model (metres). diff --git a/app/src/main/java/com/openpositioning/PositionMe/sensors/SensorFusion.java b/app/src/main/java/com/openpositioning/PositionMe/sensors/SensorFusion.java index e61d132e..9b04e6f0 100644 --- a/app/src/main/java/com/openpositioning/PositionMe/sensors/SensorFusion.java +++ b/app/src/main/java/com/openpositioning/PositionMe/sensors/SensorFusion.java @@ -729,8 +729,16 @@ public void onLocationChanged(@NonNull Location location) { } lastGnssEnu = enu; - particleFilter.updateWithGnss(enu[0], enu[1], adaptedAccuracy); - ekfPositioning.updateWithGnss(enu[0], enu[1], adaptedAccuracy); + // High-accuracy fix: re-centre particle cloud to prevent filter divergence + if (accuracy < 5f) { + particleFilter.resetAroundPosition(enu[0], enu[1], accuracy); + ekfPositioning.resetAroundPosition(enu[0], enu[1], accuracy); + Log.i("SensorFusion", "High-accuracy GNSS (" + accuracy + + "m) — particle cloud recentred"); + } else { + particleFilter.updateWithGnss(enu[0], enu[1], adaptedAccuracy); + ekfPositioning.updateWithGnss(enu[0], enu[1], adaptedAccuracy); + } lastGnssLatLon = new double[]{location.getLatitude(), location.getLongitude()}; } From 5789930eeaddaaa122b021efc82d95df521ac102 Mon Sep 17 00:00:00 2001 From: Haoning Huang Date: Mon, 30 Mar 2026 11:11:06 +0100 Subject: [PATCH 48/82] fix: connect map-matching floor change to particle filter reset acceptFloorChange() return value now triggers onFloorChanged() in SensorFusion, resetting the particle cloud when map matching confirms a floor transition. --- .../fragment/TrajectoryMapFragment.java | 14 +++++++++++--- .../PositionMe/sensors/SensorFusion.java | 15 +++++++++++++++ 2 files changed, 26 insertions(+), 3 deletions(-) diff --git a/app/src/main/java/com/openpositioning/PositionMe/presentation/fragment/TrajectoryMapFragment.java b/app/src/main/java/com/openpositioning/PositionMe/presentation/fragment/TrajectoryMapFragment.java index 7f038f09..a9f1601b 100644 --- a/app/src/main/java/com/openpositioning/PositionMe/presentation/fragment/TrajectoryMapFragment.java +++ b/app/src/main/java/com/openpositioning/PositionMe/presentation/fragment/TrajectoryMapFragment.java @@ -783,11 +783,19 @@ public void updateUserLocation(@NonNull LatLng newLocation, float orientation) { // heightChange // ); - indoorMapManager.acceptFloorChange( + String newFloorKey = indoorMapManager.acceptFloorChange( correctedLocation, oldLocation, - heightChange - ); + heightChange); + String currentFloorKey = indoorMapManager.getCurrentFloorKey(); + if (newFloorKey != null && currentFloorKey != null + && !newFloorKey.equals(currentFloorKey)) { + try { + sensorFusion.onFloorChanged(Integer.parseInt(newFloorKey)); + } catch (NumberFormatException e) { + Log.w("TrajectoryMapFragment", "Non-numeric floor key: " + newFloorKey); + } + } } this.currentLocation = correctedLocation; diff --git a/app/src/main/java/com/openpositioning/PositionMe/sensors/SensorFusion.java b/app/src/main/java/com/openpositioning/PositionMe/sensors/SensorFusion.java index 9b04e6f0..4562fc4e 100644 --- a/app/src/main/java/com/openpositioning/PositionMe/sensors/SensorFusion.java +++ b/app/src/main/java/com/openpositioning/PositionMe/sensors/SensorFusion.java @@ -1307,6 +1307,21 @@ public float[] getBestParticleEstimate() { return particleFilter.getBestEstimate(); } + /** + * Called when map matching confirms a floor change. + * Resets the particle cloud around the current best estimate with increased uncertainty, + * and updates the last known floor to stay in sync with barometer-based detection. + * + * @param newFloor integer floor number confirmed by map matching + */ + public void onFloorChanged(int newFloor) { + float[] best = particleFilter.getBestEstimate(); + particleFilter.resetAroundPosition(best[0], best[1], 8f); + ekfPositioning.resetAroundPosition(best[0], best[1], 8f); + lastKnownFloor = newFloor; + Log.i("SensorFusion", "Floor change confirmed by map matching → floor " + newFloor); + } + /** * Performs and matrix multiplication of two 3x3 matrices and returns the product. * From 3b5dee0471aeccb82bd80ef59913a36566d0eb77 Mon Sep 17 00:00:00 2001 From: Haoning Huang Date: Mon, 30 Mar 2026 11:12:51 +0100 Subject: [PATCH 49/82] fix: add missing use_ekf toggle to Settings screen The use_ekf preference key was read in SensorFusion but never defined in root_preferences.xml, so the EKF could never be enabled from Settings. --- app/src/main/res/xml/root_preferences.xml | 7 +++++++ 1 file changed, 7 insertions(+) diff --git a/app/src/main/res/xml/root_preferences.xml b/app/src/main/res/xml/root_preferences.xml index 65793d88..05306a13 100644 --- a/app/src/main/res/xml/root_preferences.xml +++ b/app/src/main/res/xml/root_preferences.xml @@ -67,6 +67,13 @@ + + Date: Mon, 30 Mar 2026 11:22:39 +0100 Subject: [PATCH 50/82] changed colors of stairs and lifts --- .../PositionMe/utils/IndoorMapManager.java | 12 +++++++----- 1 file changed, 7 insertions(+), 5 deletions(-) diff --git a/app/src/main/java/com/openpositioning/PositionMe/utils/IndoorMapManager.java b/app/src/main/java/com/openpositioning/PositionMe/utils/IndoorMapManager.java index 5dbc8d10..024acb46 100644 --- a/app/src/main/java/com/openpositioning/PositionMe/utils/IndoorMapManager.java +++ b/app/src/main/java/com/openpositioning/PositionMe/utils/IndoorMapManager.java @@ -1302,15 +1302,17 @@ private void drawFloor(JSONObject floorGeoJson, String floorKey) throws JSONExce float strokeWidth = 2.0f; if (t.contains("wall")) { - strokeColor = Color.RED; +// strokeColor = Color.RED; fillColor = Color.argb(0, 250, 0, 0); strokeWidth = 3.5f; - } else if (t.contains("door")) { + } else if (t.contains("lift")) { + strokeColor = Color.RED; fillColor = Color.argb(0, 0, 0, 0); - strokeWidth = 4.5f; - } else if (t.contains("corridor") || t.contains("hall")) { + strokeWidth = 8f; + } else if (t.contains("stairs")) { + strokeColor = Color.YELLOW; fillColor = Color.argb(35, 60, 130, 255); - strokeWidth = 1.5f; + strokeWidth = 8f; } else if (t.contains("room") || t.contains("area")) { fillColor = Color.argb(30, 60, 130, 255); strokeWidth = 1.2f; From 4e3f9d66fc00e3a6be179866c5ae4b0f81b0b026 Mon Sep 17 00:00:00 2001 From: Haoning Huang Date: Mon, 30 Mar 2026 12:38:10 +0100 Subject: [PATCH 51/82] fix: unify trajectory colors, fix GNSS dots, fix EKF display, add wall constraint toggle, fix WiFi init --- .../fragment/RecordingFragment.java | 21 +++------ .../fragment/TrajectoryMapFragment.java | 43 +++++++++---------- .../PositionMe/sensors/SensorFusion.java | 18 +++++--- app/src/main/res/xml/root_preferences.xml | 7 +++ 4 files changed, 45 insertions(+), 44 deletions(-) diff --git a/app/src/main/java/com/openpositioning/PositionMe/presentation/fragment/RecordingFragment.java b/app/src/main/java/com/openpositioning/PositionMe/presentation/fragment/RecordingFragment.java index c63372be..41bca034 100644 --- a/app/src/main/java/com/openpositioning/PositionMe/presentation/fragment/RecordingFragment.java +++ b/app/src/main/java/com/openpositioning/PositionMe/presentation/fragment/RecordingFragment.java @@ -446,28 +446,17 @@ private void updateUIandPosition() { // mapFrag.updatePdrPosition(new LatLng(pdr[0], pdr[1])); // } -// changed - // Green PDR observation dot — same position as the red polyline + // Green PDR observation dot mapFrag.updatePdrPosition(newLocation); -// float[][] particles = sensorFusion.getParticles(); - float[] bestEnu = sensorFusion.getBestParticleEstimate(); - CoordinateConverter converter = sensorFusion.getCoordinateConverter(); - - LatLng displayLocation; - - if (converter != null) { - double[] latLon = converter.toLatLon(bestEnu[0], bestEnu[1]); - displayLocation = new LatLng(latLon[0], latLon[1]); - } else { - displayLocation = newLocation; // fallback - } + // Arrow marker — always follows the active fusion algorithm (PF or EKF) + LatLng displayLocation = (fused != null) + ? new LatLng(fused[0], fused[1]) + : newLocation; mapFrag.updateUserLocation( displayLocation, (float) Math.toDegrees(sensorFusion.passOrientation()) ); - Log.d("MapCompare", "PF displayLocation = " + displayLocation); - Log.d("MapCompare", "Fused location = " + Arrays.toString(sensorFusion.getFusedLatLon())); } } diff --git a/app/src/main/java/com/openpositioning/PositionMe/presentation/fragment/TrajectoryMapFragment.java b/app/src/main/java/com/openpositioning/PositionMe/presentation/fragment/TrajectoryMapFragment.java index a9f1601b..e9509350 100644 --- a/app/src/main/java/com/openpositioning/PositionMe/presentation/fragment/TrajectoryMapFragment.java +++ b/app/src/main/java/com/openpositioning/PositionMe/presentation/fragment/TrajectoryMapFragment.java @@ -420,8 +420,8 @@ public void onMapReady(@NonNull GoogleMap googleMap) { polyline.setColor(Color.BLACK); isRed = false; } else { - switchColorButton.setBackgroundColor(Color.RED); - polyline.setColor(Color.RED); + switchColorButton.setBackgroundColor(COLOR_PDR); + polyline.setColor(COLOR_PDR); isRed = true; } } @@ -597,32 +597,29 @@ private void initMapSettings(GoogleMap map) { // Initialize indoor manager indoorMapManager = new IndoorMapManager(map); - // Raw PDR trajectory — red, always present - // Initialize an empty polyline + // Raw PDR trajectory — green, matches PDR observation dots polyline = map.addPolyline(new PolylineOptions() - .color(Color.RED) + .color(COLOR_PDR) .width(5f) - .add() // start empty + .add() ); - // GNSS path in blue + // GNSS path — blue, matches GNSS observation dots gnssPolyline = map.addPolyline(new PolylineOptions() - .color(Color.BLUE) + .color(COLOR_GNSS) .width(5f) - .add() // start empty + .add() ); - // Added - // Smoothed trajectory — purple, only visible when smoothing is ON - // Raw fused trajectory — purple, always visible + // Fused trajectory — red, matches the arrow marker smoothedPolyline = map.addPolyline(new PolylineOptions() - .color(Color.parseColor("#8B00FF")) + .color(Color.RED) .width(6f) .visible(true)); - // LPF-smoothed fused trajectory — teal, only visible when smoothing toggle is ON + // LPF-smoothed fused trajectory — dark red, only visible when smoothing toggle is ON lpfPolyline = map.addPolyline(new PolylineOptions() - .color(Color.parseColor("#00BCD4")) + .color(Color.parseColor("#B71C1C")) .width(7f) .visible(false)); @@ -1066,6 +1063,13 @@ public LatLng getCurrentLocation() { */ public void updateGNSS(@NonNull LatLng gnssLocation) { if (gMap == null) return; + + // Blue dot — always shown when gnssDotSwitch is ON, regardless of gnssSwitch + if (showGnssDots && hasMoved(gnssLocation, lastGnssDotPos)) { + addObservationMarker(gnssLocation, COLOR_GNSS, gnssObservationMarkers); + lastGnssDotPos = gnssLocation; + } + if (!isGnssOn) return; // GNSS marker and path line — only when GNSS switch is ON @@ -1086,15 +1090,8 @@ public void updateGNSS(@NonNull LatLng gnssLocation) { } } } -// Always update lastGnssLocation — needed so path builds correctly - // when gnssSwitch is turned ON mid-session + // Always update lastGnssLocation so path builds correctly when gnssSwitch is turned ON mid-session lastGnssLocation = gnssLocation; - - // Blue dot — independent of gnssSwitch, only controlled by gnssDotSwitch - if (showGnssDots && hasMoved(gnssLocation, lastGnssDotPos)) { - addObservationMarker(gnssLocation, COLOR_GNSS, gnssObservationMarkers); - lastGnssDotPos = gnssLocation; - } } /** diff --git a/app/src/main/java/com/openpositioning/PositionMe/sensors/SensorFusion.java b/app/src/main/java/com/openpositioning/PositionMe/sensors/SensorFusion.java index 4562fc4e..0565f10d 100644 --- a/app/src/main/java/com/openpositioning/PositionMe/sensors/SensorFusion.java +++ b/app/src/main/java/com/openpositioning/PositionMe/sensors/SensorFusion.java @@ -588,7 +588,8 @@ public void onSensorChanged(SensorEvent sensorEvent) { bestBefore[0] + ", " + bestBefore[1]); // Apply wall constraints after prediction - if (coordinateConverter != null && indoorMapManager != null) { + if (coordinateConverter != null && indoorMapManager != null + && settings.getBoolean("use_wall_constraints", true)) { float[] currEast = particleFilter.getParticlesXRef(); float[] currNorth = particleFilter.getParticlesYRef(); float[] liveWeights = particleFilter.getWeightsRef(); @@ -1129,13 +1130,20 @@ public void onSuccess(LatLng wifiLocation, int floor) { if (!saveRecording) return; if (!particleFilter.isInitialized()) { - // if GNSS not available — launch with first WiFi position -// coordinateConverter = new CoordinateConverter( -// wifiLocation.latitude, wifiLocation.longitude); + // GNSS not yet available — initialise from first WiFi fix + if (coordinateConverter == null) { + coordinateConverter = new CoordinateConverter( + wifiLocation.latitude, wifiLocation.longitude); + if (indoorMapManager != null) { + indoorMapManager.bakeEnuCoordinates(coordinateConverter); + enuBaked = true; + } + } particleFilter.initParticles(0f, 0f, 20f); + ekfPositioning.initParticles(0f, 0f, 20f); prevPdrX = 0f; prevPdrY = 0f; - Log.i("SensorFusion", "ParticleFilter launch with WiFi at lat=" + Log.i("SensorFusion", "ParticleFilter initialised from WiFi at lat=" + wifiLocation.latitude + " lon=" + wifiLocation.longitude); } else { // Normal update diff --git a/app/src/main/res/xml/root_preferences.xml b/app/src/main/res/xml/root_preferences.xml index 05306a13..8e638542 100644 --- a/app/src/main/res/xml/root_preferences.xml +++ b/app/src/main/res/xml/root_preferences.xml @@ -74,6 +74,13 @@ app:summaryOn="Extended Kalman Filter" app:defaultValue="false" /> + + Date: Mon, 30 Mar 2026 14:20:55 +0100 Subject: [PATCH 52/82] WIP: positioning fusion improvements (recording bugs present) MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit - EKF/PF aggressive WiFi convergence when stationary (1s: noise=3m, P+50; 3s: noise=2m, P+200) - WiFi scan interval reduced 15s -> 1s - Particle cloud hidden in EKF mode - Point numbering: oldest=1, newest=highest - Remove duplicate updateUserLocation call (fixes spurious initial polyline segment) - Add EKF inflateCovariance() and isUsingEKF() methods - Add use_ekf and use_wall_constraints settings toggles NOTE: PDR path behavior has changed (now pure dead reckoning) — recording display bugs not yet fully resolved. --- .../fragment/RecordingFragment.java | 9 ----- .../fragment/TrajectoryMapFragment.java | 15 +++---- .../sensors/ExtendedKalmanFilter.java | 10 +++++ .../PositionMe/sensors/SensorFusion.java | 40 ++++++++++++++++--- .../PositionMe/sensors/WifiDataProcessor.java | 4 +- 5 files changed, 55 insertions(+), 23 deletions(-) diff --git a/app/src/main/java/com/openpositioning/PositionMe/presentation/fragment/RecordingFragment.java b/app/src/main/java/com/openpositioning/PositionMe/presentation/fragment/RecordingFragment.java index 41bca034..80236ae6 100644 --- a/app/src/main/java/com/openpositioning/PositionMe/presentation/fragment/RecordingFragment.java +++ b/app/src/main/java/com/openpositioning/PositionMe/presentation/fragment/RecordingFragment.java @@ -448,15 +448,6 @@ private void updateUIandPosition() { // Green PDR observation dot mapFrag.updatePdrPosition(newLocation); - - // Arrow marker — always follows the active fusion algorithm (PF or EKF) - LatLng displayLocation = (fused != null) - ? new LatLng(fused[0], fused[1]) - : newLocation; - mapFrag.updateUserLocation( - displayLocation, - (float) Math.toDegrees(sensorFusion.passOrientation()) - ); } } diff --git a/app/src/main/java/com/openpositioning/PositionMe/presentation/fragment/TrajectoryMapFragment.java b/app/src/main/java/com/openpositioning/PositionMe/presentation/fragment/TrajectoryMapFragment.java index e9509350..8d6d466a 100644 --- a/app/src/main/java/com/openpositioning/PositionMe/presentation/fragment/TrajectoryMapFragment.java +++ b/app/src/main/java/com/openpositioning/PositionMe/presentation/fragment/TrajectoryMapFragment.java @@ -1244,6 +1244,7 @@ private void updateUncertaintyCircle(@NonNull LatLng centre) { */ private void redrawParticleCloud() { if (!showParticleCloud || gMap == null) return; + if (SensorFusion.getInstance().isUsingEKF()) { clearParticleCloud(); return; } long now = System.currentTimeMillis(); if (now - lastParticleRedrawMs < 2000) return; // 2s throttle @@ -1312,8 +1313,8 @@ private void redrawFusedTrajectory() { * Adds a numbered observation dot at the given position for the specified source. * * After adding, ALL markers in the queue are renumbered so that: - * - The newest dot always shows "1" - * - The oldest dot shows the highest number (up to MAX_OBSERVATION_MARKERS) + * - The oldest dot always shows "1" + * - The newest dot shows the highest number (up to MAX_OBSERVATION_MARKERS) * * When the queue is full, the oldest marker is removed before the new one is added. * @@ -1332,7 +1333,7 @@ private void addObservationMarker(@NonNull LatLng position, if (oldest != null) oldest.remove(); } - // Add the new dot — starts as number 1 (most recent), others will be renumbered below + // Add the new dot — label is overwritten by the renumber loop below Marker newDot = gMap.addMarker(new MarkerOptions() .position(position) .icon(BitmapDescriptorFactory.fromBitmap( @@ -1346,14 +1347,14 @@ private void addObservationMarker(@NonNull LatLng position, markerQueue.add(newDot); } - // Renumber all markers: newest = 1, oldest = queue.size() - // The queue is ordered oldest-first (LinkedList), so we iterate in reverse + // Renumber all markers: oldest = 1, newest = queue.size() + // The queue is ordered oldest-first (LinkedList), so i=0 is oldest List markerList = new ArrayList<>(markerQueue); int total = markerList.size(); for (int i = 0; i < total; i++) { Marker m = markerList.get(i); if (m == null) continue; - int recencyNumber = total - i; // oldest gets highest number + int recencyNumber = i + 1; // oldest = 1, newest = total Object tag = m.getTag(); int markerColor = (tag instanceof Integer) ? (int) tag : color; m.setIcon(BitmapDescriptorFactory.fromBitmap( @@ -1381,7 +1382,7 @@ private void setQueueVisibility(@NonNull LinkedList queue, boolean visib * Numbers are updated across the whole queue after each new dot is added. * * @param color fill colour of the dot. - * @param number the recency label to display (1 = most recent). + * @param number the sequence label to display (1 = oldest, highest = newest). * @return a 40×40 px Bitmap with a filled circle and white number. */ private Bitmap createNumberedDotBitmap(int color, int number) { diff --git a/app/src/main/java/com/openpositioning/PositionMe/sensors/ExtendedKalmanFilter.java b/app/src/main/java/com/openpositioning/PositionMe/sensors/ExtendedKalmanFilter.java index e53a5121..b8d0ee70 100644 --- a/app/src/main/java/com/openpositioning/PositionMe/sensors/ExtendedKalmanFilter.java +++ b/app/src/main/java/com/openpositioning/PositionMe/sensors/ExtendedKalmanFilter.java @@ -193,5 +193,15 @@ public void resetAroundPosition(float centreX, float centreY, float uncertainty) Log.i(TAG, "EKF reset around (" + centreX + ", " + centreY + ")"); } + /** + * Inflates the diagonal of P to allow WiFi observations to pull the state. + * + * @param amount Variance increment (metres²) added to p00 and p11 + */ + public void inflateCovariance(float amount) { + p00 += amount; + p11 += amount; + } + public boolean isInitialized() { return initialized; } } diff --git a/app/src/main/java/com/openpositioning/PositionMe/sensors/SensorFusion.java b/app/src/main/java/com/openpositioning/PositionMe/sensors/SensorFusion.java index 0565f10d..0ddd8942 100644 --- a/app/src/main/java/com/openpositioning/PositionMe/sensors/SensorFusion.java +++ b/app/src/main/java/com/openpositioning/PositionMe/sensors/SensorFusion.java @@ -222,6 +222,9 @@ public class SensorFusion implements SensorEventListener, Observer { // Previous valid GNSS position in ENU (metres), used to derive heading from consecutive fixes private float[] lastGnssEnu = null; + // Last WiFi position in ENU (metres), cached for stationary soft-update + private float[] lastWifiEnu = null; + private final List testPoints = new ArrayList<>(); boolean enuBaked = false; @@ -1118,8 +1121,9 @@ private void createWifiPositionRequestCallback(){ for (Wifi data : this.wifiList){ wifiAccessPoints.put(String.valueOf(data.getBssid()), data.getLevel()); } - // Capture AP count before entering the async callback + // Capture AP count and timestamp before entering the async callback final int apCount = this.wifiList.size(); + final long currentTime = System.currentTimeMillis(); // Creating POST Request JSONObject wifiFingerPrint = new JSONObject(); wifiFingerPrint.put(WIFI_FINGERPRINT, wifiAccessPoints); @@ -1150,6 +1154,9 @@ public void onSuccess(LatLng wifiLocation, int floor) { float[] enu = coordinateConverter.toEnu( wifiLocation.latitude, wifiLocation.longitude); + // Cache WiFi ENU for stationary soft-update + lastWifiEnu = enu; + // Jump detection: reject position if it is too far from the current estimate float[] currentEst = particleFilter.getBestEstimate(); float jumpDist = (float) Math.hypot( @@ -1157,11 +1164,28 @@ public void onSuccess(LatLng wifiLocation, int floor) { if (jumpDist > 80f) { Log.w("SensorFusion", "WiFi jump " + jumpDist + "m — update rejected"); } else { - // Sigma-adaptive noise: tighten observation noise when particles diverge + // Stationary duration in milliseconds + long stationaryMs = currentTime - lastStepTime; + + // Base noise from AP count float noiseStd = Math.max(8.0f, 20.0f - apCount * 1.5f); - double sigma = particleFilter.getSigmaMetres(); - if (sigma > 15.0) { - noiseStd = Math.max(noiseStd * 0.5f, 5.0f); + + // Aggressively tighten noise and inflate EKF covariance when stationary, + // so both PF and EKF converge strongly to the WiFi observation. + if (stationaryMs > 3000) { + // >3s stationary: near-full trust in WiFi (K ≈ 0.97) + noiseStd = 2.0f; + ekfPositioning.inflateCovariance(200.0f); + } else if (stationaryMs > 1000) { + // >1s stationary: strong WiFi pull (K ≈ 0.90) + noiseStd = 3.0f; + ekfPositioning.inflateCovariance(50.0f); + } else { + // Moving: sigma-adaptive reduction only + double sigma = particleFilter.getSigmaMetres(); + if (sigma > 15.0) { + noiseStd = Math.max(noiseStd * 0.5f, 5.0f); + } } particleFilter.updateWithWifi(enu[0], enu[1], noiseStd); ekfPositioning.updateWithWifi(enu[0], enu[1], noiseStd); @@ -1249,6 +1273,11 @@ public float[][] getParticles() { return particleFilter.getParticles(); } + /** Returns true if the EKF is selected as the active positioning algorithm. */ + public boolean isUsingEKF() { + return useEKF; + } + @@ -1701,6 +1730,7 @@ public void startRecording() { headingInitialised = false; lastGyroTimestampMs = 0; lastGnssEnu = null; + lastWifiEnu = null; if(settings.getBoolean("overwrite_constants", false)) { this.filter_coefficient = Float.parseFloat(settings.getString("accel_filter", "0.96")); } else { diff --git a/app/src/main/java/com/openpositioning/PositionMe/sensors/WifiDataProcessor.java b/app/src/main/java/com/openpositioning/PositionMe/sensors/WifiDataProcessor.java index 447cfb12..265521e8 100644 --- a/app/src/main/java/com/openpositioning/PositionMe/sensors/WifiDataProcessor.java +++ b/app/src/main/java/com/openpositioning/PositionMe/sensors/WifiDataProcessor.java @@ -50,7 +50,7 @@ public class WifiDataProcessor implements Observable { //Time over which a new scan will be initiated - private static final long scanInterval = 15000; + private static final long scanInterval = 1000; // Application context for handling permissions and WifiManager instances private final Context context; @@ -136,7 +136,7 @@ public void startListening() { scanWifiDataTimer.scheduleAtFixedRate( new scheduledWifiScan(), 0, - 15000 + scanInterval ); } From 6b5c2ddfab013348b651e4d9424f538376af043f Mon Sep 17 00:00:00 2001 From: Haoning Huang Date: Mon, 30 Mar 2026 15:58:25 +0100 Subject: [PATCH 53/82] fix: correct recording start position and increase observation dot limit MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit - Reset coordinateConverter on startRecording() so first GNSS after recording starts sets the true coordinate origin, not the stale setup-phase position - Reset enuBaked flag alongside coordinateConverter reset - RecordingFragment: skip drawing until filter is initialised (fused!=null), then use fused position as PDR base on first update — both trajectories now share the same real starting point - Increase MAX_OBSERVATION_MARKERS from 10 to 500 and use the constant instead of the hardcoded 5 --- .../fragment/RecordingFragment.java | 26 +++++++++---------- .../fragment/TrajectoryMapFragment.java | 4 +-- .../PositionMe/sensors/SensorFusion.java | 3 ++- 3 files changed, 17 insertions(+), 16 deletions(-) diff --git a/app/src/main/java/com/openpositioning/PositionMe/presentation/fragment/RecordingFragment.java b/app/src/main/java/com/openpositioning/PositionMe/presentation/fragment/RecordingFragment.java index 80236ae6..d5b70b72 100644 --- a/app/src/main/java/com/openpositioning/PositionMe/presentation/fragment/RecordingFragment.java +++ b/app/src/main/java/com/openpositioning/PositionMe/presentation/fragment/RecordingFragment.java @@ -377,15 +377,18 @@ private void updateUIandPosition() { float elevationVal = sensorFusion.getElevation(); elevation.setText(getString(R.string.elevation, String.format("%.1f", elevationVal))); - // Current location - // Convert PDR coordinates to actual LatLng if you have a known starting lat/lon - // Or simply pass relative data for the TrajectoryMapFragment to handle - // For example: - float[] latLngArray = sensorFusion.getGNSSLatitude(true); - if (latLngArray != null) { - LatLng oldLocation = trajectoryMapFragment.getCurrentLocation(); // or store locally + // Wait for the filter to acquire its first real position fix before drawing. + double[] fused = sensorFusion.getFusedLatLon(); + if (fused == null) { + previousPosX = pdrValues[0]; + previousPosY = pdrValues[1]; + return; + } + + { + LatLng oldLocation = trajectoryMapFragment.getCurrentLocation(); LatLng newLocation = UtilFunctions.calculateNewPos( - oldLocation == null ? new LatLng(latLngArray[0], latLngArray[1]) : oldLocation, + oldLocation != null ? oldLocation : new LatLng(fused[0], fused[1]), new float[]{ pdrValues[0] - previousPosX, pdrValues[1] - previousPosY } ); @@ -412,11 +415,8 @@ private void updateUIandPosition() { // && wifiLocation.longitude != 0.0) { // mapFrag.updateWifiPosition(wifiLocation); // } - // Drive the arrow marker and purple polyline with the fused position - double[] fused = sensorFusion.getFusedLatLon(); - if (fused != null) { - mapFrag.updateFusedPosition(new LatLng(fused[0], fused[1])); - } + // Drive the arrow marker and fused trajectory polyline + mapFrag.updateFusedPosition(new LatLng(fused[0], fused[1])); // Amber WiFi observation dot — raw WiFi fix from OpenPositioning API // double[] wifi = sensorFusion.getLastWifiLatLon(); // if (wifi != null) { diff --git a/app/src/main/java/com/openpositioning/PositionMe/presentation/fragment/TrajectoryMapFragment.java b/app/src/main/java/com/openpositioning/PositionMe/presentation/fragment/TrajectoryMapFragment.java index 8d6d466a..b758fcea 100644 --- a/app/src/main/java/com/openpositioning/PositionMe/presentation/fragment/TrajectoryMapFragment.java +++ b/app/src/main/java/com/openpositioning/PositionMe/presentation/fragment/TrajectoryMapFragment.java @@ -117,7 +117,7 @@ public class TrajectoryMapFragment extends Fragment { private static final float MIN_DOT_SPACING_METRES = 2.0f; /** Number of recent observations kept per source for colour-coded dots. */ - private static final int MAX_OBSERVATION_MARKERS = 10; + private static final int MAX_OBSERVATION_MARKERS = 500; /** Default rolling-window size for observation dots. */ @@ -165,7 +165,7 @@ public class TrajectoryMapFragment extends Fragment { /** Current rolling-window size — updated when user changes the N input. */ // private int maxObservations = DEFAULT_MAX_OBSERVATIONS; - private final int maxObservations = 5; + private final int maxObservations = MAX_OBSERVATION_MARKERS; // Per-source visibility flags (all enabled by default) private boolean showGnssDots = true; diff --git a/app/src/main/java/com/openpositioning/PositionMe/sensors/SensorFusion.java b/app/src/main/java/com/openpositioning/PositionMe/sensors/SensorFusion.java index 0ddd8942..13c5d1cf 100644 --- a/app/src/main/java/com/openpositioning/PositionMe/sensors/SensorFusion.java +++ b/app/src/main/java/com/openpositioning/PositionMe/sensors/SensorFusion.java @@ -1719,7 +1719,8 @@ public void startRecording() { particleFilter = new ParticleFilter(); ekfPositioning = new ExtendedKalmanFilter(); useEKF = settings.getBoolean("use_ekf", false); -// coordinateConverter = null; + coordinateConverter = null; // force fresh origin at actual recording position + enuBaked = false; lastGnssLatLon = null; lastWifiLatLon = null; lastPdrLatLon = null; From 794370f5e330ba16351b3e79737c8c5d9e64303e Mon Sep 17 00:00:00 2001 From: sydneysavarese Date: Mon, 30 Mar 2026 18:16:20 +0100 Subject: [PATCH 54/82] starting to implement new wall filtering --- .../fragment/TrajectoryMapFragment.java | 10 ++--- .../PositionMe/sensors/SensorFusion.java | 44 ++++++++++++++----- 2 files changed, 39 insertions(+), 15 deletions(-) diff --git a/app/src/main/java/com/openpositioning/PositionMe/presentation/fragment/TrajectoryMapFragment.java b/app/src/main/java/com/openpositioning/PositionMe/presentation/fragment/TrajectoryMapFragment.java index b498f16b..66b822a3 100644 --- a/app/src/main/java/com/openpositioning/PositionMe/presentation/fragment/TrajectoryMapFragment.java +++ b/app/src/main/java/com/openpositioning/PositionMe/presentation/fragment/TrajectoryMapFragment.java @@ -775,11 +775,11 @@ public void updateUserLocation(@NonNull LatLng newLocation, float orientation) { if (oldLocation != null && indoorMapManager != null) { -// correctedLocation = indoorMapManager.indoorLocationCorrection( -// oldLocation, -// newLocation, -// heightChange -// ); + correctedLocation = indoorMapManager.indoorLocationCorrection( + oldLocation, + newLocation, + heightChange + ); oldfloor = newfloor; newfloor = indoorMapManager.acceptFloorChange( correctedLocation, diff --git a/app/src/main/java/com/openpositioning/PositionMe/sensors/SensorFusion.java b/app/src/main/java/com/openpositioning/PositionMe/sensors/SensorFusion.java index 5ae74564..30f94900 100644 --- a/app/src/main/java/com/openpositioning/PositionMe/sensors/SensorFusion.java +++ b/app/src/main/java/com/openpositioning/PositionMe/sensors/SensorFusion.java @@ -228,6 +228,8 @@ public class SensorFusion implements SensorEventListener, Observer { private IndoorMapManager indoorMapManager; + private float[] prevBestEnu = null; + //region Initialisation /** * Private constructor for implementing singleton design pattern for SensorFusion. @@ -1189,16 +1191,7 @@ public void onError(String message) { * * @return double[]{latitude, longitude}, or null(if filter is not initialized) */ - public double[] getFusedLatLon() { - boolean ekfReady = useEKF && ekfPositioning != null && ekfPositioning.isInitialized(); - boolean pfReady = !useEKF && particleFilter != null && particleFilter.isInitialized(); - if ((ekfReady || pfReady) && coordinateConverter != null) { - float[] enu = useEKF ? ekfPositioning.getBestEstimate() - : particleFilter.getBestEstimate(); - return coordinateConverter.toLatLon(enu[0], enu[1]); - } - return null; - } + /** Last raw GNSS position. Returns null before first GPS signal. */ @@ -1216,6 +1209,10 @@ public double[] getLastPdrLatLon() { return lastPdrLatLon; } + public void resetFusedConstraintState() { + prevBestEnu = null; + } + /** * Returns the spread of the particle cloud in metres. * Use this to draw an uncertainty circle around the fused position marker. @@ -1308,6 +1305,33 @@ public float[] getBestParticleEstimate() { return particleFilter.getBestEstimate(); } + public double[] getFusedLatLon() { + boolean ekfReady = useEKF && ekfPositioning != null && ekfPositioning.isInitialized(); + boolean pfReady = !useEKF && particleFilter != null && particleFilter.isInitialized(); + + if (!(ekfReady || pfReady) || coordinateConverter == null) { + return null; + } + + float[] rawEnu = useEKF + ? ekfPositioning.getBestEstimate() + : particleFilter.getBestEstimate(); + + if (rawEnu == null || rawEnu.length < 2) { + return null; + } + + float[] displayEnu = new float[]{rawEnu[0], rawEnu[1]}; + + if (indoorMapManager != null && prevBestEnu != null) { + displayEnu = indoorMapManager.constrainMovementToWalls(prevBestEnu, rawEnu); + } + + prevBestEnu = new float[]{displayEnu[0], displayEnu[1]}; + + return coordinateConverter.toLatLon(displayEnu[0], displayEnu[1]); + } + /** * Called when map matching confirms a floor change. * Resets the particle cloud around the current best estimate with increased uncertainty, From ca1db5cc3f3f56899483ff1ed860a1e7a8e3857e Mon Sep 17 00:00:00 2001 From: sydneysavarese Date: Mon, 30 Mar 2026 18:28:59 +0100 Subject: [PATCH 55/82] idk --- .../PositionMe/utils/IndoorMapManager.java | 396 ++++++++++++------ 1 file changed, 267 insertions(+), 129 deletions(-) diff --git a/app/src/main/java/com/openpositioning/PositionMe/utils/IndoorMapManager.java b/app/src/main/java/com/openpositioning/PositionMe/utils/IndoorMapManager.java index 9ca27773..e2d0fb4b 100644 --- a/app/src/main/java/com/openpositioning/PositionMe/utils/IndoorMapManager.java +++ b/app/src/main/java/com/openpositioning/PositionMe/utils/IndoorMapManager.java @@ -197,61 +197,33 @@ public void selectVenue(IndoorVenue venue){ } } - /** - * For each particle, zero its weight if the step from prev to current - * position crosses a wall. Called by ParticleFilter after predict(), - * before resample(). - * - * @param prevEast previous East positions, metres (length 300) - * @param prevNorth previous North positions, metres (length 300) - * @param currEast current East positions after predict() (length 300) - * @param currNorth current North positions after predict() (length 300) - * @param weights weight array — modified in-place - * @param converter to convert East-North → LatLng for wall geometry check - */ private static final float INTERSECTION_EPSILON = 1e-6f; - private static final float WALL_CLEARANCE_METERS = 0.20f; - private static final float WALL_SNAP_BACK_METERS = 0.25f; private static final float RING_CLOSURE_EPSILON = 1e-4f; + private static final float WALL_SNAP_BACK_METERS = 0.05f; - public void applyWallConstraints( - float[] prevEast, - float[] prevNorth, - float[] currEast, - float[] currNorth, - float[] weights, - CoordinateConverter converter) { - - if (currentVenue == null || currentFloorKey == null) return; - IndoorVenue.FloorFeatures floor = currentVenue.floorFeatures.get(currentFloorKey); - if (floor == null || floor.wallPolygonsEnu == null || floor.wallPolygonsEnu.isEmpty()) return; - - List> walls = floor.wallPolygonsEnu; - - for (int i = 0; i < weights.length; i++) { - if (weights[i] <= 0f) continue; - - float[] prev = {prevEast[i], prevNorth[i]}; - float[] curr = {currEast[i], currNorth[i]}; + public float[] constrainMovementToWalls(float[] fromEnu, float[] toEnu) { + if (fromEnu == null || toEnu == null) { + return toEnu; + } - WallCrossing crossing = findFirstWallCrossing(prev, curr, walls); - boolean tooClose = isTooCloseToAnyWall(curr, walls, WALL_CLEARANCE_METERS); + if (currentVenue == null || currentFloorKey == null) { + return toEnu; + } - if (crossing == null && !tooClose) { - continue; - } + IndoorVenue.FloorFeatures floorFeatures = currentVenue.floorFeatures.get(currentFloorKey); + if (floorFeatures == null || + floorFeatures.wallPolygonsEnu == null || + floorFeatures.wallPolygonsEnu.isEmpty()) { + return toEnu; + } - float[] corrected; - if (crossing != null) { - corrected = moveToJustBeforeWall(prev, curr, crossing.t, WALL_SNAP_BACK_METERS); - } else { - corrected = new float[]{prev[0], prev[1]}; - } + WallCrossing crossing = findFirstWallCrossing(fromEnu, toEnu, floorFeatures.wallPolygonsEnu); - currEast[i] = corrected[0]; - currNorth[i] = corrected[1]; - weights[i] *= 0.1f; + if (crossing == null) { + return new float[]{toEnu[0], toEnu[1]}; } + + return moveToJustBeforeWall(fromEnu, toEnu, crossing.t, WALL_SNAP_BACK_METERS); } private static class WallCrossing { @@ -260,19 +232,17 @@ private static class WallCrossing { final int edgeIndex; final float t; - WallCrossing(float[] pt, int polygonIndex, int edgeIndex, float t) { - this.crossingPoint = pt; + WallCrossing(float[] crossingPoint, int polygonIndex, int edgeIndex, float t) { + this.crossingPoint = crossingPoint; this.polygonIndex = polygonIndex; this.edgeIndex = edgeIndex; this.t = t; } } - private WallCrossing findFirstWallCrossing( - float[] from, - float[] to, - List> walls) { - + private WallCrossing findFirstWallCrossing(float[] from, + float[] to, + List> walls) { double bestT = Double.MAX_VALUE; WallCrossing best = null; @@ -289,11 +259,13 @@ private WallCrossing findFirstWallCrossing( double t = intersectionT(from, to, a, b); if (t >= 0.0 && t <= 1.0 && t < bestT) { bestT = t; - float[] pt = { + + float[] crossingPoint = new float[]{ (float) (from[0] + t * (to[0] - from[0])), (float) (from[1] + t * (to[1] - from[1])) }; - best = new WallCrossing(pt, pi, ei, (float) t); + + best = new WallCrossing(crossingPoint, pi, ei, (float) t); } } } @@ -334,50 +306,6 @@ private double intersectionT(float[] p1, float[] p2, float[] p3, float[] p4) { return (t >= 0.0 && t <= 1.0 && u >= 0.0 && u <= 1.0) ? t : -1.0; } - private boolean isTooCloseToAnyWall(float[] point, List> walls, float clearance) { - for (List polygon : walls) { - if (polygon == null || polygon.size() < 2) continue; - - int edgeCount = getRingEdgeCount(polygon); - - for (int i = 0; i < edgeCount; i++) { - float[] a = polygon.get(i); - float[] b = polygon.get((i + 1) % polygon.size()); - - if (distancePointToSegment(point, a, b) < clearance) { - return true; - } - } - } - return false; - } - - private float distancePointToSegment(float[] p, float[] a, float[] b) { - float px = p[0], py = p[1]; - float ax = a[0], ay = a[1]; - float bx = b[0], by = b[1]; - - float dx = bx - ax; - float dy = by - ay; - float len2 = dx * dx + dy * dy; - - if (len2 < 1e-12f) { - float ex = px - ax; - float ey = py - ay; - return (float) Math.sqrt(ex * ex + ey * ey); - } - - float t = ((px - ax) * dx + (py - ay) * dy) / len2; - t = Math.max(0f, Math.min(1f, t)); - - float cx = ax + t * dx; - float cy = ay + t * dy; - - float ex = px - cx; - float ey = py - cy; - return (float) Math.sqrt(ex * ex + ey * ey); - } - private float[] moveToJustBeforeWall(float[] from, float[] to, float hitT, float snapBackMeters) { float dx = to[0] - from[0]; float dy = to[1] - from[1]; @@ -395,6 +323,205 @@ private float[] moveToJustBeforeWall(float[] from, float[] to, float hitT, float from[1] + safeT * dy }; } + +// /** +// * For each particle, zero its weight if the step from prev to current +// * position crosses a wall. Called by ParticleFilter after predict(), +// * before resample(). +// * +// * @param prevEast previous East positions, metres (length 300) +// * @param prevNorth previous North positions, metres (length 300) +// * @param currEast current East positions after predict() (length 300) +// * @param currNorth current North positions after predict() (length 300) +// * @param weights weight array — modified in-place +// * @param converter to convert East-North → LatLng for wall geometry check +// */ +// private static final float INTERSECTION_EPSILON = 1e-6f; +// private static final float WALL_CLEARANCE_METERS = 0.20f; +// private static final float WALL_SNAP_BACK_METERS = 0.25f; +// private static final float RING_CLOSURE_EPSILON = 1e-4f; +// +// public void applyWallConstraints( +// float[] prevEast, +// float[] prevNorth, +// float[] currEast, +// float[] currNorth, +// float[] weights, +// CoordinateConverter converter) { +// +// if (currentVenue == null || currentFloorKey == null) return; +// IndoorVenue.FloorFeatures floor = currentVenue.floorFeatures.get(currentFloorKey); +// if (floor == null || floor.wallPolygonsEnu == null || floor.wallPolygonsEnu.isEmpty()) return; +// +// List> walls = floor.wallPolygonsEnu; +// +// for (int i = 0; i < weights.length; i++) { +// if (weights[i] <= 0f) continue; +// +// float[] prev = {prevEast[i], prevNorth[i]}; +// float[] curr = {currEast[i], currNorth[i]}; +// +// WallCrossing crossing = findFirstWallCrossing(prev, curr, walls); +// boolean tooClose = isTooCloseToAnyWall(curr, walls, WALL_CLEARANCE_METERS); +// +// if (crossing == null && !tooClose) { +// continue; +// } +// +// float[] corrected; +// if (crossing != null) { +// corrected = moveToJustBeforeWall(prev, curr, crossing.t, WALL_SNAP_BACK_METERS); +// } else { +// corrected = new float[]{prev[0], prev[1]}; +// } +// +// currEast[i] = corrected[0]; +// currNorth[i] = corrected[1]; +// weights[i] *= 0.1f; +// } +// } +// +// private static class WallCrossing { +// final float[] crossingPoint; +// final int polygonIndex; +// final int edgeIndex; +// final float t; +// +// WallCrossing(float[] pt, int polygonIndex, int edgeIndex, float t) { +// this.crossingPoint = pt; +// this.polygonIndex = polygonIndex; +// this.edgeIndex = edgeIndex; +// this.t = t; +// } +// } +// +// private WallCrossing findFirstWallCrossing( +// float[] from, +// float[] to, +// List> walls) { +// +// double bestT = Double.MAX_VALUE; +// WallCrossing best = null; +// +// for (int pi = 0; pi < walls.size(); pi++) { +// List polygon = walls.get(pi); +// if (polygon == null || polygon.size() < 2) continue; +// +// int edgeCount = getRingEdgeCount(polygon); +// +// for (int ei = 0; ei < edgeCount; ei++) { +// float[] a = polygon.get(ei); +// float[] b = polygon.get((ei + 1) % polygon.size()); +// +// double t = intersectionT(from, to, a, b); +// if (t >= 0.0 && t <= 1.0 && t < bestT) { +// bestT = t; +// float[] pt = { +// (float) (from[0] + t * (to[0] - from[0])), +// (float) (from[1] + t * (to[1] - from[1])) +// }; +// best = new WallCrossing(pt, pi, ei, (float) t); +// } +// } +// } +// +// return best; +// } +// +// private int getRingEdgeCount(List ring) { +// if (ring == null || ring.size() < 2) return 0; +// +// float[] first = ring.get(0); +// float[] last = ring.get(ring.size() - 1); +// +// boolean alreadyClosed = +// Math.abs(first[0] - last[0]) < RING_CLOSURE_EPSILON && +// Math.abs(first[1] - last[1]) < RING_CLOSURE_EPSILON; +// +// return alreadyClosed ? ring.size() - 1 : ring.size(); +// } + +// private double intersectionT(float[] p1, float[] p2, float[] p3, float[] p4) { +// double rX = p2[0] - p1[0]; +// double rY = p2[1] - p1[1]; +// double sX = p4[0] - p3[0]; +// double sY = p4[1] - p3[1]; +// +// double denom = rX * sY - rY * sX; +// if (Math.abs(denom) < INTERSECTION_EPSILON) { +// return -1.0; +// } +// +// double qmpX = p3[0] - p1[0]; +// double qmpY = p3[1] - p1[1]; +// +// double t = (qmpX * sY - qmpY * sX) / denom; +// double u = (qmpX * rY - qmpY * rX) / denom; +// +// return (t >= 0.0 && t <= 1.0 && u >= 0.0 && u <= 1.0) ? t : -1.0; +// } + +// private boolean isTooCloseToAnyWall(float[] point, List> walls, float clearance) { +// for (List polygon : walls) { +// if (polygon == null || polygon.size() < 2) continue; +// +// int edgeCount = getRingEdgeCount(polygon); +// +// for (int i = 0; i < edgeCount; i++) { +// float[] a = polygon.get(i); +// float[] b = polygon.get((i + 1) % polygon.size()); +// +// if (distancePointToSegment(point, a, b) < clearance) { +// return true; +// } +// } +// } +// return false; +// } + +// private float distancePointToSegment(float[] p, float[] a, float[] b) { +// float px = p[0], py = p[1]; +// float ax = a[0], ay = a[1]; +// float bx = b[0], by = b[1]; +// +// float dx = bx - ax; +// float dy = by - ay; +// float len2 = dx * dx + dy * dy; +// +// if (len2 < 1e-12f) { +// float ex = px - ax; +// float ey = py - ay; +// return (float) Math.sqrt(ex * ex + ey * ey); +// } +// +// float t = ((px - ax) * dx + (py - ay) * dy) / len2; +// t = Math.max(0f, Math.min(1f, t)); +// +// float cx = ax + t * dx; +// float cy = ay + t * dy; +// +// float ex = px - cx; +// float ey = py - cy; +// return (float) Math.sqrt(ex * ex + ey * ey); +// } +// +// private float[] moveToJustBeforeWall(float[] from, float[] to, float hitT, float snapBackMeters) { +// float dx = to[0] - from[0]; +// float dy = to[1] - from[1]; +// float len = (float) Math.sqrt(dx * dx + dy * dy); +// +// if (len < 1e-6f) { +// return new float[]{from[0], from[1]}; +// } +// +// float backT = snapBackMeters / len; +// float safeT = Math.max(0f, hitT - backT); +// +// return new float[]{ +// from[0] + safeT * dx, +// from[1] + safeT * dy +// }; +// } // private static final float MAX_GAP_WIDTH_METERS = 2.5f; // private static final float GAP_SEARCH_RADIUS_METERS = 3.0f; // private static final float MIN_GAP_WIDTH_METERS = 0.20f; @@ -807,6 +934,11 @@ private LatLng toLatLng(float eastM, float northM, CoordinateConverter c) { return new LatLng(ll[0], ll[1]); } + private float[] toEnu(LatLng latLng, CoordinateConverter c) { + float[] enu = c.toEnu(latLng.latitude, latLng.longitude); + return new float[]{(float) enu[0], (float) enu[1]}; + } + //checks orientation using three points: 0= points on same line, 1 & 2 = points on either side private static int orientation(LatLng a, LatLng b, LatLng c) { @@ -855,44 +987,51 @@ private static boolean onSegment(LatLng a, LatLng p, LatLng b) { } /// height change = sensorfusion.getelevation - public LatLng indoorLocationCorrection(LatLng oldLocation, LatLng predictedLocation, float heightChange) { - if (currentVenue == null || currentFloorKey == null || oldLocation == null || predictedLocation == null) { + public LatLng indoorLocationCorrection(LatLng oldLocation, + LatLng predictedLocation, + float heightChange) { + + if (currentVenue == null || currentFloorKey == null || + oldLocation == null || predictedLocation == null) { return predictedLocation; } - Log.d("MapMatch", "Checking movement from " + oldLocation + " to " + predictedLocation + - " on floor " + currentFloorKey); - LatLng correctedLocation = predictedLocation; - boolean hitWall = false; + IndoorVenue.FloorFeatures floorFeatures = + currentVenue.floorFeatures.get(currentFloorKey); - IndoorVenue.FloorFeatures floorFeatures = currentVenue.floorFeatures.get(currentFloorKey); - if (floorFeatures == null) { + if (floorFeatures == null || + floorFeatures.wallPolygonsEnu == null || + floorFeatures.wallPolygonsEnu.isEmpty()) { return predictedLocation; } - List> wallPolygons = floorFeatures.wallPolygons; + CoordinateConverter c = + SensorFusion.getInstance().getCoordinateConverter(); - for (int k = 0; k < wallPolygons.size() && !hitWall; k++) { - List polygon = wallPolygons.get(k); + if (c == null) return predictedLocation; - for (int i = 0; i < polygon.size(); i++) { - LatLng edgeStart = polygon.get(i); - LatLng edgeEnd = polygon.get((i + 1) % polygon.size()); - - if (segmentsIntersect(oldLocation, predictedLocation, edgeStart, edgeEnd)) { - correctedLocation = adjustPositionToNearestValidLocation( - oldLocation, - predictedLocation, - polygon - ); - hitWall = true; - Log.d("MapMatch", "Wall intersection detected"); - Log.d("MapMatch", "Corrected location = " + correctedLocation); - break; - } - } + float[] from = toEnu(oldLocation, c); + float[] to = toEnu(predictedLocation, c); + + Log.d("MapMatch", + "Checking movement from (" + from[0] + "," + from[1] + ") to (" + + to[0] + "," + to[1] + ")"); + + WallCrossing crossing = + findFirstWallCrossing(from, to, floorFeatures.wallPolygonsEnu); + + if (crossing == null) { + return predictedLocation; } + float[] corrected = moveToJustBeforeWall(from, to, crossing.t, 0.25f); + + Log.d("MapMatch", + "Wall hit at (" + crossing.crossingPoint[0] + "," + crossing.crossingPoint[1] + ")" + + " → corrected to (" + corrected[0] + "," + corrected[1] + ")"); + + return toLatLng(corrected[0], corrected[1], c); + } //floor adjustment // if abs(heightChange) > heightThreshold: //// @@ -909,8 +1048,7 @@ public LatLng indoorLocationCorrection(LatLng oldLocation, LatLng predictedLocat //// reject floor change //// keep same floor - return correctedLocation; - } + //find nearest valid point that doesn't intersect walls //loop through points on segment just traversed starting from predicted location back towards prev location From 349f34dc97997a685c4b29f67d8778cde4047cf7 Mon Sep 17 00:00:00 2001 From: sydneysavarese Date: Mon, 30 Mar 2026 19:13:29 +0100 Subject: [PATCH 56/82] best estimate wall constraints --- .../PositionMe/sensors/SensorFusion.java | 38 +++++++++++++++---- .../PositionMe/utils/IndoorMapManager.java | 29 ++++++++++++-- 2 files changed, 55 insertions(+), 12 deletions(-) diff --git a/app/src/main/java/com/openpositioning/PositionMe/sensors/SensorFusion.java b/app/src/main/java/com/openpositioning/PositionMe/sensors/SensorFusion.java index 40a5629e..d2ca7ad7 100644 --- a/app/src/main/java/com/openpositioning/PositionMe/sensors/SensorFusion.java +++ b/app/src/main/java/com/openpositioning/PositionMe/sensors/SensorFusion.java @@ -587,7 +587,29 @@ public void onSensorChanged(SensorEvent sensorEvent) { // Predict particle motion particleFilter.predict(dx, dy); + + float[] ekfPrev = ekfPositioning.getBestEstimate(); ekfPositioning.predict(dx, dy); + +// Wall-clamp the EKF position after each prediction step + if (coordinateConverter != null + && indoorMapManager != null + && settings.getBoolean("use_wall_constraints", true)) { + + float[] ekfEst = ekfPositioning.getBestEstimate(); + float[] clamped = indoorMapManager.clampToWallEnu(ekfPrev, ekfEst); + + boolean wasClamped = + Math.abs(clamped[0] - ekfEst[0]) > 1e-4f || + Math.abs(clamped[1] - ekfEst[1]) > 1e-4f; + + if (wasClamped) { + ekfPositioning.resetAroundPosition(clamped[0], clamped[1], 2.0f); + Log.d("SensorFusion", "EKF clamped to wall: (" + + clamped[0] + ", " + clamped[1] + ")"); + } + } + float[] bestBefore = particleFilter.getBestEstimate(); Log.d("PFDebug", "Best BEFORE constraints: " + bestBefore[0] + ", " + bestBefore[1]); @@ -607,14 +629,14 @@ public void onSensorChanged(SensorEvent sensorEvent) { prevNorth[i] = prevParticles[i][1]; } - indoorMapManager.applyWallConstraints( - prevEast, - prevNorth, - currEast, - currNorth, - liveWeights, - coordinateConverter - ); +// indoorMapManager.applyWallConstraints( +// prevEast, +// prevNorth, +// currEast, +// currNorth, +// liveWeights, +// coordinateConverter +// ); particleFilter.normalizeWeights(); Log.d("SensorFusion", "Applied wall constraints to particle cloud"); diff --git a/app/src/main/java/com/openpositioning/PositionMe/utils/IndoorMapManager.java b/app/src/main/java/com/openpositioning/PositionMe/utils/IndoorMapManager.java index e2d0fb4b..ae22d5e7 100644 --- a/app/src/main/java/com/openpositioning/PositionMe/utils/IndoorMapManager.java +++ b/app/src/main/java/com/openpositioning/PositionMe/utils/IndoorMapManager.java @@ -197,6 +197,27 @@ public void selectVenue(IndoorVenue venue){ } } + /** + * Checks whether the movement from {@code fromEnu} to {@code toEnu} crosses any wall + * on the current floor. If it does, returns the last valid ENU position just before the + * wall (clamped via binary search). If no wall is crossed, returns {@code toEnu} unchanged. + * + * Call this after every EKF prediction step, before reading the new state. + * + * @param fromEnu float[]{east, north} — previous EKF position in metres + * @param toEnu float[]{east, north} — new EKF position after predict() + * @return clamped float[]{east, north}, or toEnu if no wall was crossed + */ + public float[] clampToWallEnu(float[] fromEnu, float[] toEnu) { + if (currentVenue == null || currentFloorKey == null) return toEnu; + IndoorVenue.FloorFeatures floor = currentVenue.floorFeatures.get(currentFloorKey); + if (floor == null || floor.wallPolygonsEnu.isEmpty()) return toEnu; + + if (!crossesAnyWallEnu(fromEnu, toEnu, floor.wallPolygonsEnu)) return toEnu; + + return snapToWallEnu(fromEnu, toEnu, floor.wallPolygonsEnu); + } + private static final float INTERSECTION_EPSILON = 1e-6f; private static final float RING_CLOSURE_EPSILON = 1e-4f; private static final float WALL_SNAP_BACK_METERS = 0.05f; @@ -1133,10 +1154,10 @@ public String acceptFloorChange(LatLng correctedLocation, Log.d("MapMatch", "usedLift=" + usedLift + ", usedStairs=" + usedStairs); /// commented out right now because location accuracy is bad so algo never detects that it is near stairs/lift -// if (!usedLift && !usedStairs) { -// Log.d("MapMatch", "Rejected floor change: not near stairs/lift in a plausible way"); -// return currentFloorKey; -// } + if (!usedLift && !usedStairs) { + Log.d("MapMatch", "Rejected floor change: not near stairs/lift in a plausible way"); + return currentFloorKey; + } if (nextFloorKey.equals(confirmedFloorKey)) { return currentFloorKey; From 158f37469c0d6f150ce13e1bec0de34c5b660536 Mon Sep 17 00:00:00 2001 From: sydneysavarese Date: Tue, 31 Mar 2026 11:46:36 +0100 Subject: [PATCH 57/82] trying to improve walls, still not great --- .../fragment/TrajectoryMapFragment.java | 13 +- .../PositionMe/sensors/SensorFusion.java | 75 +++- .../PositionMe/utils/IndoorMapManager.java | 358 ++++++++++++++++-- 3 files changed, 405 insertions(+), 41 deletions(-) diff --git a/app/src/main/java/com/openpositioning/PositionMe/presentation/fragment/TrajectoryMapFragment.java b/app/src/main/java/com/openpositioning/PositionMe/presentation/fragment/TrajectoryMapFragment.java index a66ecfb2..b6b3edc8 100644 --- a/app/src/main/java/com/openpositioning/PositionMe/presentation/fragment/TrajectoryMapFragment.java +++ b/app/src/main/java/com/openpositioning/PositionMe/presentation/fragment/TrajectoryMapFragment.java @@ -32,6 +32,7 @@ import java.util.ArrayList; import java.util.List; +import java.util.Objects; import java.util.Queue; import java.util.LinkedList; import com.openpositioning.PositionMe.data.remote.FloorPlanData; @@ -762,6 +763,7 @@ public void updateUserLocation(@NonNull LatLng newLocation, float orientation) { // Keep track of current location LatLng oldLocation = this.currentLocation; LatLng correctedLocation = newLocation; + IndoorMapManager.FloorChangeResult floorResult = null; float heightChange = 0f; if (sensorFusion != null) { @@ -778,14 +780,19 @@ public void updateUserLocation(@NonNull LatLng newLocation, float orientation) { heightChange ); oldfloor = newfloor; - newfloor = indoorMapManager.acceptFloorChange( + floorResult = indoorMapManager.acceptFloorChange( correctedLocation, oldLocation, currentElevation ); + if (floorResult.snappedLocation != null) { + correctedLocation = floorResult.snappedLocation; + newfloor = floorResult.floorKey; + } } - if(oldfloor != newfloor) { - Log.d("MapMatch", "new floor: " + newfloor); + if (!Objects.equals(oldfloor, newfloor)) { +// if(!(oldfloor.equals (newfloor))) { +// Log.d("MapMatch", "new floor: " + newfloor); if (floorLabel != null) { diff --git a/app/src/main/java/com/openpositioning/PositionMe/sensors/SensorFusion.java b/app/src/main/java/com/openpositioning/PositionMe/sensors/SensorFusion.java index d2ca7ad7..415fa414 100644 --- a/app/src/main/java/com/openpositioning/PositionMe/sensors/SensorFusion.java +++ b/app/src/main/java/com/openpositioning/PositionMe/sensors/SensorFusion.java @@ -199,6 +199,7 @@ public class SensorFusion implements SensorEventListener, Observer { // Previous PDR cumulative position, used to compute per-step displacement private float prevPdrX = 0f; private float prevPdrY = 0f; + private float[] prevEkfEnu = null; // Gyroscope-integrated heading with rotation-vector correction (radians) private float fusedHeading = 0f; @@ -415,7 +416,6 @@ public void setContext(Context context) { } //endregion - //region Sensor processing /** * {@inheritDoc} @@ -590,23 +590,71 @@ public void onSensorChanged(SensorEvent sensorEvent) { float[] ekfPrev = ekfPositioning.getBestEstimate(); ekfPositioning.predict(dx, dy); + // Previous EKF position in ENU, for wall-slide constraint + // Wall-clamp the EKF position after each prediction step - if (coordinateConverter != null - && indoorMapManager != null +// if (coordinateConverter != null +// && indoorMapManager != null +// && settings.getBoolean("use_wall_constraints", true)) { +// +// float[] ekfEst = ekfPositioning.getBestEstimate(); +// float[] clamped = indoorMapManager.clampToWallEnu(ekfPrev, ekfEst); +// +// boolean wasClamped = +// Math.abs(clamped[0] - ekfEst[0]) > 1e-4f || +// Math.abs(clamped[1] - ekfEst[1]) > 1e-4f; +// +// if (wasClamped) { +// ekfPositioning.resetAroundPosition(clamped[0], clamped[1], 2.0f); +// Log.d("SensorFusion", "EKF clamped to wall: (" +// + clamped[0] + ", " + clamped[1] + ")"); +// } +// } + + // Wall-slide the EKF position after each prediction step + // Wall-slide the EKF position after each prediction step +// if (coordinateConverter != null && indoorMapManager != null +// && settings.getBoolean("use_wall_constraints", true)) { +// float[] ekfEst = ekfPositioning.getBestEstimate(); +// if (prevEkfEnu != null) { +// float[] adjusted = indoorMapManager.slideAlongWallEnu(prevEkfEnu, ekfEst); +// if (adjusted != ekfEst) { +// ekfPositioning.resetAroundPosition(adjusted[0], adjusted[1], 2.0f); +// Log.d("SensorFusion", "EKF wall-slid to: (" +// + adjusted[0] + ", " + adjusted[1] + ")"); +// prevEkfEnu = adjusted; +// } else { +// prevEkfEnu = ekfEst.clone(); +// } +// } else { +// // First step — just record current position, no constraint to apply yet +// prevEkfEnu = ekfEst.clone(); +// } +// } + + // Wall constraint for EKF after each prediction step + if (coordinateConverter != null && indoorMapManager != null && settings.getBoolean("use_wall_constraints", true)) { - float[] ekfEst = ekfPositioning.getBestEstimate(); - float[] clamped = indoorMapManager.clampToWallEnu(ekfPrev, ekfEst); - - boolean wasClamped = - Math.abs(clamped[0] - ekfEst[0]) > 1e-4f || - Math.abs(clamped[1] - ekfEst[1]) > 1e-4f; - if (wasClamped) { - ekfPositioning.resetAroundPosition(clamped[0], clamped[1], 2.0f); - Log.d("SensorFusion", "EKF clamped to wall: (" - + clamped[0] + ", " + clamped[1] + ")"); + if (prevEkfEnu != null) { + // First re-route prevEkfEnu if the EKF has jumped to the + // other side of a wall (e.g. after a GNSS/WiFi correction) + prevEkfEnu = indoorMapManager.reroutePrevEnu(prevEkfEnu, ekfEst); + + // Now apply normal wall-slide for the current step + float[] adjusted = indoorMapManager.slideAlongWallEnu(prevEkfEnu, ekfEst); + if (adjusted != ekfEst) { + ekfPositioning.resetAroundPosition(adjusted[0], adjusted[1], 2.0f); + prevEkfEnu = adjusted; + Log.d("SensorFusion", "EKF wall-slid to: (" + + adjusted[0] + ", " + adjusted[1] + ")"); + } else { + prevEkfEnu = ekfEst.clone(); + } + } else { + prevEkfEnu = ekfEst.clone(); } } @@ -1774,6 +1822,7 @@ public void startRecording() { lastKnownFloor = 0; prevPdrX = 0f; prevPdrY = 0f; + prevEkfEnu = null; fusedHeading = 0f; headingInitialised = false; lastGyroTimestampMs = 0; diff --git a/app/src/main/java/com/openpositioning/PositionMe/utils/IndoorMapManager.java b/app/src/main/java/com/openpositioning/PositionMe/utils/IndoorMapManager.java index ae22d5e7..914a0cc5 100644 --- a/app/src/main/java/com/openpositioning/PositionMe/utils/IndoorMapManager.java +++ b/app/src/main/java/com/openpositioning/PositionMe/utils/IndoorMapManager.java @@ -976,6 +976,215 @@ private static int orientation(LatLng a, LatLng b, LatLng c) { return (val > 0) ? 1 : 2; } + /** + * Finds gaps (doorways) in walls between two ENU positions by looking for + * wall segments that have a break/gap large enough to walk through (>0.6m). + * Returns a waypoint through the nearest gap, or null if no gap found. + */ + private float[] findGapBetweenPoints(float[] fromEnu, float[] toEnu, + List> walls) { + float[] bestGap = null; + double bestDist = Double.MAX_VALUE; + + // Direction vector from->to + float dx = toEnu[0] - fromEnu[0]; + float dy = toEnu[1] - fromEnu[1]; + float totalDist = (float) Math.sqrt(dx * dx + dy * dy); + if (totalDist < 1e-6f) return null; + + for (List polygon : walls) { + for (int i = 0; i < polygon.size(); i++) { + float[] a = polygon.get(i); + float[] b = polygon.get((i + 1) % polygon.size()); + + // Only consider wall segments that intersect our path + if (!segmentsIntersectEnu(fromEnu, toEnu, a, b)) continue; + + // Look for a gap by checking adjacent segments for a break + // A gap exists where two consecutive wall endpoints don't connect + float[] prev = polygon.get((i - 1 + polygon.size()) % polygon.size()); + float[] next = polygon.get((i + 2) % polygon.size()); + + // Check gap before segment a + float gapBeforeSize = (float) Math.sqrt( + Math.pow(a[0] - prev[1], 2) + Math.pow(a[1] - prev[1], 2)); + + // Check gap after segment b + float gapAfterSize = (float) Math.sqrt( + Math.pow(next[0] - b[0], 2) + Math.pow(next[1] - b[1], 2)); + + // Midpoint of segment as candidate gap point + float midX = (a[0] + b[0]) / 2f; + float midY = (a[1] + b[1]) / 2f; + + // Find closest point on the wall segment to our path + double distToMid = Math.sqrt( + Math.pow(midX - fromEnu[0], 2) + Math.pow(midY - fromEnu[1], 2)); + + if (distToMid < bestDist) { + bestDist = distToMid; + bestGap = new float[]{midX, midY}; + } + } + } + return bestGap; + } + + /** + * When the EKF has teleported to the other side of a wall (e.g. after a + * strong GNSS/WiFi correction), this re-routes prevEkfEnu through the + * nearest navigable gap so that future wall-slide checks work correctly. + * + * Returns an updated "previous position" that is on the same side of all + * walls as toEnu, routed through doorways/gaps. + * + * @param fromEnu current prevEkfEnu + * @param toEnu current EKF best estimate (possibly on other side of wall) + * @return re-routed fromEnu that is navigably connected to toEnu + */ + public float[] reroutePrevEnu(float[] fromEnu, float[] toEnu) { + if (currentVenue == null || currentFloorKey == null) return fromEnu; + IndoorVenue.FloorFeatures floor = currentVenue.floorFeatures.get(currentFloorKey); + if (floor == null || floor.wallPolygonsEnu.isEmpty()) return fromEnu; + + // If no wall crossing, no rerouting needed + if (!crossesAnyWallEnu(fromEnu, toEnu, floor.wallPolygonsEnu)) return fromEnu; + + // Simple gap search: scan along the wall that was crossed looking for + // the largest gap (doorway). We sample points along the crossing wall + // and find the one that has the shortest clear path to toEnu. + float[] bestWaypoint = null; + double bestScore = Double.MAX_VALUE; + + for (List polygon : floor.wallPolygonsEnu) { + for (int i = 0; i < polygon.size(); i++) { + float[] a = polygon.get(i); + float[] b = polygon.get((i + 1) % polygon.size()); + + if (!segmentsIntersectEnu(fromEnu, toEnu, a, b)) continue; + + // Sample along this wall segment and adjacent segments + // looking for a point that has a clear line to toEnu + int samples = 20; + for (int s = 0; s <= samples; s++) { + float t = (float) s / samples; + float candidateX = a[0] + t * (b[0] - a[0]); + float candidateY = a[1] + t * (b[1] - a[1]); + float[] candidate = {candidateX, candidateY}; + + // Check if this candidate has a clear line to toEnu + if (!crossesAnyWallEnu(candidate, toEnu, floor.wallPolygonsEnu)) { + double dist = Math.sqrt( + Math.pow(candidateX - fromEnu[0], 2) + + Math.pow(candidateY - fromEnu[1], 2)); + if (dist < bestScore) { + bestScore = dist; + bestWaypoint = candidate; + } + } + } + + // Also check points slightly offset from the wall endpoints + // as these are where doorways typically are + float[][] endpoints = {a, b}; + float[][] offsets = {{0.5f, 0f}, {-0.5f, 0f}, {0f, 0.5f}, {0f, -0.5f}}; + for (float[] ep : endpoints) { + for (float[] off : offsets) { + float[] candidate = {ep[0] + off[0], ep[1] + off[1]}; + if (!crossesAnyWallEnu(candidate, toEnu, floor.wallPolygonsEnu)) { + double dist = Math.sqrt( + Math.pow(candidate[0] - fromEnu[0], 2) + + Math.pow(candidate[1] - fromEnu[1], 2)); + if (dist < bestScore) { + bestScore = dist; + bestWaypoint = candidate; + } + } + } + } + } + } + + // If we found a waypoint through a gap, route prevEkfEnu through it + if (bestWaypoint != null) { + Log.d("IndoorMapManager", "Rerouted prevEnu through gap at (" + + bestWaypoint[0] + ", " + bestWaypoint[1] + ")"); + return bestWaypoint; + } + + // No gap found — just move prevEkfEnu to toEnu directly + // so we don't stay permanently stuck + Log.d("IndoorMapManager", "No gap found, snapping prevEnu to toEnu"); + return toEnu.clone(); + } + + /** + * If the movement from fromEnu to toEnu crosses a wall, slides the destination + * along the wall surface rather than stopping at it. This prevents the position + * from getting stuck while still respecting the wall boundary. + * + * If no wall is crossed, returns toEnu unchanged. + * + * @param fromEnu float[]{east, north} — previous position in metres + * @param toEnu float[]{east, north} — new position after predict() + * @return wall-slid float[]{east, north}, or toEnu if no wall was crossed + */ + public float[] slideAlongWallEnu(float[] fromEnu, float[] toEnu) { + if (currentVenue == null || currentFloorKey == null) return toEnu; + IndoorVenue.FloorFeatures floor = currentVenue.floorFeatures.get(currentFloorKey); + if (floor == null || floor.wallPolygonsEnu.isEmpty()) return toEnu; + + if (!crossesAnyWallEnu(fromEnu, toEnu, floor.wallPolygonsEnu)) return toEnu; + + // Find the wall segment that was hit + float[] wallA = null, wallB = null; + outer: + for (List polygon : floor.wallPolygonsEnu) { + for (int i = 0; i < polygon.size(); i++) { + float[] a = polygon.get(i); + float[] b = polygon.get((i + 1) % polygon.size()); + if (segmentsIntersectEnu(fromEnu, toEnu, a, b)) { + wallA = a; + wallB = b; + break outer; + } + } + } + + if (wallA == null) return toEnu; // shouldn't happen + + // Snap to just before the wall first + float[] hitPoint = snapToWallEnu(fromEnu, toEnu, floor.wallPolygonsEnu); + + // Compute the movement vector and the wall direction vector + float moveX = toEnu[0] - fromEnu[0]; + float moveY = toEnu[1] - fromEnu[1]; + + float wallDX = wallB[0] - wallA[0]; + float wallDY = wallB[1] - wallA[1]; + float wallLen = (float) Math.sqrt(wallDX * wallDX + wallDY * wallDY); + if (wallLen < 1e-6f) return hitPoint; + + // Normalise wall direction + float wallNX = wallDX / wallLen; + float wallNY = wallDY / wallLen; + + // Project movement onto wall direction (slide component) + float dot = moveX * wallNX + moveY * wallNY; + float slideX = dot * wallNX; + float slideY = dot * wallNY; + + // Apply slide from hit point + float[] slid = new float[]{hitPoint[0] + slideX, hitPoint[1] + slideY}; + + // If the slid position also crosses a wall, just return the hit point + if (crossesAnyWallEnu(hitPoint, slid, floor.wallPolygonsEnu)) { + return hitPoint; + } + + return slid; + } + /* takes endpoints of two segments and determines whether they intersect */ @@ -1080,43 +1289,48 @@ public LatLng indoorLocationCorrection(LatLng oldLocation, private long lastFloorChangeTimeMs = 0; private static final long MIN_FLOOR_CHANGE_INTERVAL_MS = 5000; // 5 seconds minimum - private static final double HEIGHT_THRESHOLD_METERS = 2.5; - private static final double STAIRS_THRESHOLD_METERS = 5.0; - private static final double LIFT_THRESHOLD_METERS = 4.0; - private static final double LIFT_HORIZONTAL_THRESHOLD_METERS = 2.0; - - public String acceptFloorChange(LatLng correctedLocation, - LatLng oldLocation, - float currentHeight) { + private static final double HEIGHT_THRESHOLD_METERS = 4.5; + private static final double STAIRS_THRESHOLD_METERS = 12.0; + private static final double LIFT_THRESHOLD_METERS = 10.0; + private static final double LIFT_HORIZONTAL_THRESHOLD_METERS = 1.0; + private LatLng floorTransitionStartLocation = null; + private boolean floorTransitionInProgress = false; + private static final float FLOOR_TRANSITION_START_THRESHOLD_METERS = 1.0f; + + public FloorChangeResult acceptFloorChange(LatLng correctedLocation, + LatLng oldLocation, + float currentHeight) { if (currentVenue == null || currentFloorKey == null || correctedLocation == null || oldLocation == null) { - return currentFloorKey; + return new FloorChangeResult(currentFloorKey, correctedLocation, false); } if (confirmedFloorKey == null || Float.isNaN(confirmedFloorElevation)) { Log.d("MapMatch", "No confirmed floor reference yet"); - return currentFloorKey; + return new FloorChangeResult(currentFloorKey, correctedLocation, false); } long now = System.currentTimeMillis(); if (now - lastFloorChangeTimeMs < MIN_FLOOR_CHANGE_INTERVAL_MS) { Log.d("MapMatch", "Floor change blocked by debounce"); - return currentFloorKey; + return new FloorChangeResult(currentFloorKey, correctedLocation, false); } + startFloorTransitionIfNeeded(correctedLocation, currentHeight); float heightChangeMeters = currentHeight - confirmedFloorElevation; if (Math.abs(heightChangeMeters) < HEIGHT_THRESHOLD_METERS) { Log.d("MapMatch", "Height change too small: " + heightChangeMeters); - return currentFloorKey; + resetFloorTransitionState(); + return new FloorChangeResult(currentFloorKey, correctedLocation, false); } - IndoorVenue.FloorFeatures floorFeatures = currentVenue.floorFeatures.get(confirmedFloorKey); - if (floorFeatures == null) { + IndoorVenue.FloorFeatures currentFloorFeatures = currentVenue.floorFeatures.get(confirmedFloorKey); + if (currentFloorFeatures == null) { Log.d("MapMatch", "No floor features for confirmed floor: " + confirmedFloorKey); - return currentFloorKey; + return new FloorChangeResult(currentFloorKey, correctedLocation, false); } int direction = heightChangeMeters > 0 ? 1 : -1; @@ -1129,46 +1343,140 @@ public String acceptFloorChange(LatLng correctedLocation, if (nextFloorKey == null || !currentVenue.floorFeatures.containsKey(nextFloorKey)) { Log.d("MapMatch", "Next floor invalid"); - return currentFloorKey; + return new FloorChangeResult(currentFloorKey, correctedLocation, false); + } + + IndoorVenue.FloorFeatures nextFloorFeatures = currentVenue.floorFeatures.get(nextFloorKey); + if (nextFloorFeatures == null) { + Log.d("MapMatch", "No floor features for destination floor: " + nextFloorKey); + return new FloorChangeResult(currentFloorKey, correctedLocation, false); } boolean nearStairs = isNearAnyPoint( correctedLocation, - floorFeatures.stairsCenters, + currentFloorFeatures.stairsCenters, STAIRS_THRESHOLD_METERS ); boolean nearLift = isNearAnyPoint( correctedLocation, - floorFeatures.liftCenters, + currentFloorFeatures.liftCenters, LIFT_THRESHOLD_METERS ); - double horizontalDisplacement = distanceMeters(oldLocation, correctedLocation); + double horizontalDisplacement = getFloorTransitionHorizontalDisplacement(correctedLocation); + resetFloorTransitionState(); boolean usedLift = nearLift && horizontalDisplacement < LIFT_HORIZONTAL_THRESHOLD_METERS; - boolean usedStairs = nearStairs && horizontalDisplacement >= LIFT_HORIZONTAL_THRESHOLD_METERS; + boolean usedStairs = false; + if (!nearLift && nearStairs){ + usedStairs = true; + } + else { + usedStairs = nearStairs && horizontalDisplacement >= LIFT_HORIZONTAL_THRESHOLD_METERS; + } Log.d("MapMatch", "nearStairs=" + nearStairs + ", nearLift=" + nearLift); Log.d("MapMatch", "horizontalDisplacement=" + horizontalDisplacement); Log.d("MapMatch", "usedLift=" + usedLift + ", usedStairs=" + usedStairs); - /// commented out right now because location accuracy is bad so algo never detects that it is near stairs/lift if (!usedLift && !usedStairs) { Log.d("MapMatch", "Rejected floor change: not near stairs/lift in a plausible way"); - return currentFloorKey; + return new FloorChangeResult(currentFloorKey, correctedLocation, false); } if (nextFloorKey.equals(confirmedFloorKey)) { - return currentFloorKey; + return new FloorChangeResult(currentFloorKey, correctedLocation, false); + } + + LatLng snappedDestination = correctedLocation; + + + if (usedLift) { + LatLng nearestLiftOnNextFloor = getNearestPoint(correctedLocation, nextFloorFeatures.liftCenters); + if (nearestLiftOnNextFloor != null) { + snappedDestination = nearestLiftOnNextFloor; + } + } else if (usedStairs) { + LatLng nearestStairsOnNextFloor = getNearestPoint(correctedLocation, nextFloorFeatures.stairsCenters); + if (nearestStairsOnNextFloor != null) { + snappedDestination = nearestStairsOnNextFloor; + } } commitAutoFloorChange(nextFloorKey, currentHeight); lastFloorChangeTimeMs = now; - Log.d("MapMatch", "Accepted floor change to " + nextFloorKey); + Log.d("MapMatch", "Accepted floor change to " + nextFloorKey + + " with snapped destination " + snappedDestination); + Log.d("MapMatch", "nextFloor stair count = " + + (nextFloorFeatures.stairsCenters == null ? 0 : nextFloorFeatures.stairsCenters.size())); + Log.d("MapMatch", "nextFloor lift count = " + + (nextFloorFeatures.liftCenters == null ? 0 : nextFloorFeatures.liftCenters.size())); + showFloor(nextFloorKey); - return nextFloorKey; + + + + return new FloorChangeResult(nextFloorKey, snappedDestination, true); + } + + private void startFloorTransitionIfNeeded(LatLng currentLocation, float currentHeight) { + if (currentLocation == null) return; + if (confirmedFloorKey == null || Float.isNaN(confirmedFloorElevation)) return; + + float heightDelta = currentHeight - confirmedFloorElevation; + + if (!floorTransitionInProgress && + Math.abs(heightDelta) >= FLOOR_TRANSITION_START_THRESHOLD_METERS) { + floorTransitionInProgress = true; + floorTransitionStartLocation = currentLocation; + Log.d("MapMatch", "Started floor transition at " + currentLocation + + ", height delta = " + heightDelta); + } + } + + private double getFloorTransitionHorizontalDisplacement(LatLng currentLocation) { + if (!floorTransitionInProgress || floorTransitionStartLocation == null || currentLocation == null) { + return 0.0; + } + return distanceMeters(floorTransitionStartLocation, currentLocation); + } + + private void resetFloorTransitionState() { + floorTransitionInProgress = false; + floorTransitionStartLocation = null; + } + + private LatLng getNearestPoint(LatLng location, List centers) { + if (location == null || centers == null || centers.isEmpty()) { + return null; + } + + LatLng nearest = null; + double bestDist = Double.MAX_VALUE; + + for (LatLng center : centers) { + double d = distanceMeters(location, center); + if (d < bestDist) { + bestDist = d; + nearest = center; + } + } + + return nearest; + } + + public static class FloorChangeResult { + public final String floorKey; + public final LatLng snappedLocation; + public final boolean changedFloor; + + public FloorChangeResult(String floorKey, LatLng snappedLocation, boolean changedFloor) { + this.floorKey = floorKey; + this.snappedLocation = snappedLocation; + this.changedFloor = changedFloor; + } } private void commitCurrentDisplayedFloor() { From 2564375e5bdebc19818d7a2dc8f9d7deab44c7e0 Mon Sep 17 00:00:00 2001 From: sydneysavarese Date: Tue, 31 Mar 2026 14:56:38 +0100 Subject: [PATCH 58/82] working wall constraints --- .../fragment/TrajectoryMapFragment.java | 135 +--- .../PositionMe/sensors/SensorFusion.java | 10 +- .../PositionMe/utils/IndoorMapManager.java | 620 +++--------------- 3 files changed, 110 insertions(+), 655 deletions(-) diff --git a/app/src/main/java/com/openpositioning/PositionMe/presentation/fragment/TrajectoryMapFragment.java b/app/src/main/java/com/openpositioning/PositionMe/presentation/fragment/TrajectoryMapFragment.java index b6b3edc8..92554a3b 100644 --- a/app/src/main/java/com/openpositioning/PositionMe/presentation/fragment/TrajectoryMapFragment.java +++ b/app/src/main/java/com/openpositioning/PositionMe/presentation/fragment/TrajectoryMapFragment.java @@ -807,31 +807,7 @@ public void updateUserLocation(@NonNull LatLng newLocation, float orientation) { Log.d("IndoorTest", "newLocation = " + newLocation); Log.d("IndoorTest", "heightChange = " + heightChange); -// if indoor map is active and current venue is known: -// send oldLocation, newLocation, current floor, and maybe barometer info to IndoorMapManager -// get back corrected position/floor -// then update marker/polyline using that corrected result - - - // If no marker, create it -// if (orientationMarker == null) { -// orientationMarker = gMap.addMarker(new MarkerOptions() -// .position(newLocation) -// .flat(true) -// .title("Current Position") -// .icon(BitmapDescriptorFactory.fromBitmap( -// UtilFunctions.getBitmapFromVector(requireContext(), -// R.drawable.ic_baseline_navigation_24))) -// ); -// gMap.moveCamera(CameraUpdateFactory.newLatLngZoom(newLocation, 19f)); -// } else { -// // Update marker position + orientation -// orientationMarker.setPosition(newLocation); -// orientationMarker.setRotation(orientation); -// // Move camera a bit -// gMap.moveCamera(CameraUpdateFactory.newLatLng(newLocation)); -// } - +// // Extend polyline if movement occurred if (oldLocation != null && !oldLocation.equals(newLocation) && polyline != null) { List points = new ArrayList<>(polyline.getPoints()); @@ -839,32 +815,6 @@ public void updateUserLocation(@NonNull LatLng newLocation, float orientation) { polyline.setPoints(points); } - // Added - // --- Compute and extend smoothed polyline --- -// LatLng filtered = applyLowPassFilter(newLocation); -// if (oldLocation != null && !oldLocation.equals(newLocation)) { -// smoothedPoints.add(filtered); -// if (smoothedPolyline != null) { -// smoothedPolyline.setPoints(new ArrayList<>(smoothedPoints)); -// } -// } - -// changed to- - // Extend smoothed polyline and trigger immediate fused trajectory redraw -// LatLng filtered = applyLowPassFilter(newLocation); -// if (oldLocation != null && !oldLocation.equals(newLocation)) { -// smoothedPoints.add(filtered); -// // Movement detected — redraw immediately rather than waiting for the 1s timer -// redrawFusedTrajectory(); -// } - - - // Green PDR dot — only when moved enough -// if (showPdrDots && hasMoved(newLocation, lastPdrDotPos)) { -// addObservationMarker(newLocation, COLOR_PDR, pdrObservationMarkers); -// lastPdrDotPos = newLocation; -// } - // Update indoor map overlay if (indoorMapManager != null) { @@ -875,8 +825,6 @@ public void updateUserLocation(@NonNull LatLng newLocation, float orientation) { // call api if (floorplanRemote != null) { maybeRequestNearbyVenues(newLocation); -// IndoorMapManager IMMM = new IndoorMapManager(); -// IMMM.initializeFloorFromLocation(newLocation); } } @@ -896,51 +844,7 @@ public void updatePdrPosition(@NonNull LatLng pdrLocation) { } } - /** - * Updates the arrow marker and both fused trajectory polylines. - * - * - Purple line: raw particle filter output, always visible - * - Teal line: LPF applied on top of fused output, toggle-controlled - * - * @param fusedLocation best position estimate from the particle filter. - */ -// public void updateFusedPosition(@NonNull LatLng fusedLocation) { -// if (gMap == null) return; -// -// // Raw fused path — purple, always grows -// smoothedPoints.add(fusedLocation); -// redrawFusedTrajectory(); -// -// // Update uncertainty circle around the fused marker -// updateUncertaintyCircle(fusedLocation); -// -// // Redraw particle cloud overlay (throttled to every 2s) -// redrawParticleCloud(); -// -// // LPF-smoothed fused path — teal, grows but only visible when toggle is ON -// LatLng lpfFiltered = applyLowPassFilter(fusedLocation); -// lpfPoints.add(lpfFiltered); -// if (lpfPolyline != null) { -// lpfPolyline.setPoints(new ArrayList<>(lpfPoints)); -// } -// -// // Move arrow marker if fused mode is selected -// if (!useFusedPosition) return; -// -// if (orientationMarker == null) { -// orientationMarker = gMap.addMarker(new MarkerOptions() -// .position(fusedLocation) -// .flat(true) -// .title("Current Position") -// .icon(BitmapDescriptorFactory.fromBitmap( -// UtilFunctions.getBitmapFromVector(requireContext(), -// R.drawable.ic_baseline_navigation_24)))); -// gMap.moveCamera(CameraUpdateFactory.newLatLngZoom(fusedLocation, 19f)); -// } else { -// orientationMarker.setPosition(fusedLocation); -// gMap.moveCamera(CameraUpdateFactory.newLatLng(fusedLocation)); -// } -// } + /** * Updates the arrow marker using the particle filter's fused position. @@ -1022,41 +926,6 @@ public LatLng getCurrentLocation() { return currentLocation; } - /** - * Called when we want to set or update the GNSS marker position - */ -// public void updateGNSS(@NonNull LatLng gnssLocation) { -// if (gMap == null) return; -// if (!isGnssOn) return; -// -// if (gnssMarker == null) { -// // Create the GNSS marker for the first time -// gnssMarker = gMap.addMarker(new MarkerOptions() -// .position(gnssLocation) -// .title("GNSS Position") -// .icon(BitmapDescriptorFactory -// .defaultMarker(BitmapDescriptorFactory.HUE_AZURE))); -// lastGnssLocation = gnssLocation; -// } else { -// // Move existing GNSS marker -// gnssMarker.setPosition(gnssLocation); -// -// // Add a segment to the blue GNSS line, if this is a new location -// if (lastGnssLocation != null && !lastGnssLocation.equals(gnssLocation)) { -// List gnssPoints = new ArrayList<>(gnssPolyline.getPoints()); -// gnssPoints.add(gnssLocation); -// gnssPolyline.setPoints(gnssPoints); -// } -// lastGnssLocation = gnssLocation; -// } -// -// // Blue GNSS dot — only when moved enough -// if (showGnssDots && hasMoved(gnssLocation, lastGnssDotPos)) { -// addObservationMarker(gnssLocation, COLOR_GNSS, gnssObservationMarkers); -// lastGnssDotPos = gnssLocation; -// } -// -// } /** * Updates the GNSS marker and polyline, and places a blue GNSS observation dot. diff --git a/app/src/main/java/com/openpositioning/PositionMe/sensors/SensorFusion.java b/app/src/main/java/com/openpositioning/PositionMe/sensors/SensorFusion.java index 415fa414..d601febd 100644 --- a/app/src/main/java/com/openpositioning/PositionMe/sensors/SensorFusion.java +++ b/app/src/main/java/com/openpositioning/PositionMe/sensors/SensorFusion.java @@ -612,7 +612,7 @@ public void onSensorChanged(SensorEvent sensorEvent) { // } // } - // Wall-slide the EKF position after each prediction step + // Wall-slide the EKF position after each prediction step // if (coordinateConverter != null && indoorMapManager != null // && settings.getBoolean("use_wall_constraints", true)) { @@ -677,14 +677,6 @@ public void onSensorChanged(SensorEvent sensorEvent) { prevNorth[i] = prevParticles[i][1]; } -// indoorMapManager.applyWallConstraints( -// prevEast, -// prevNorth, -// currEast, -// currNorth, -// liveWeights, -// coordinateConverter -// ); particleFilter.normalizeWeights(); Log.d("SensorFusion", "Applied wall constraints to particle cloud"); diff --git a/app/src/main/java/com/openpositioning/PositionMe/utils/IndoorMapManager.java b/app/src/main/java/com/openpositioning/PositionMe/utils/IndoorMapManager.java index 914a0cc5..880a05af 100644 --- a/app/src/main/java/com/openpositioning/PositionMe/utils/IndoorMapManager.java +++ b/app/src/main/java/com/openpositioning/PositionMe/utils/IndoorMapManager.java @@ -345,443 +345,6 @@ private float[] moveToJustBeforeWall(float[] from, float[] to, float hitT, float }; } -// /** -// * For each particle, zero its weight if the step from prev to current -// * position crosses a wall. Called by ParticleFilter after predict(), -// * before resample(). -// * -// * @param prevEast previous East positions, metres (length 300) -// * @param prevNorth previous North positions, metres (length 300) -// * @param currEast current East positions after predict() (length 300) -// * @param currNorth current North positions after predict() (length 300) -// * @param weights weight array — modified in-place -// * @param converter to convert East-North → LatLng for wall geometry check -// */ -// private static final float INTERSECTION_EPSILON = 1e-6f; -// private static final float WALL_CLEARANCE_METERS = 0.20f; -// private static final float WALL_SNAP_BACK_METERS = 0.25f; -// private static final float RING_CLOSURE_EPSILON = 1e-4f; -// -// public void applyWallConstraints( -// float[] prevEast, -// float[] prevNorth, -// float[] currEast, -// float[] currNorth, -// float[] weights, -// CoordinateConverter converter) { -// -// if (currentVenue == null || currentFloorKey == null) return; -// IndoorVenue.FloorFeatures floor = currentVenue.floorFeatures.get(currentFloorKey); -// if (floor == null || floor.wallPolygonsEnu == null || floor.wallPolygonsEnu.isEmpty()) return; -// -// List> walls = floor.wallPolygonsEnu; -// -// for (int i = 0; i < weights.length; i++) { -// if (weights[i] <= 0f) continue; -// -// float[] prev = {prevEast[i], prevNorth[i]}; -// float[] curr = {currEast[i], currNorth[i]}; -// -// WallCrossing crossing = findFirstWallCrossing(prev, curr, walls); -// boolean tooClose = isTooCloseToAnyWall(curr, walls, WALL_CLEARANCE_METERS); -// -// if (crossing == null && !tooClose) { -// continue; -// } -// -// float[] corrected; -// if (crossing != null) { -// corrected = moveToJustBeforeWall(prev, curr, crossing.t, WALL_SNAP_BACK_METERS); -// } else { -// corrected = new float[]{prev[0], prev[1]}; -// } -// -// currEast[i] = corrected[0]; -// currNorth[i] = corrected[1]; -// weights[i] *= 0.1f; -// } -// } -// -// private static class WallCrossing { -// final float[] crossingPoint; -// final int polygonIndex; -// final int edgeIndex; -// final float t; -// -// WallCrossing(float[] pt, int polygonIndex, int edgeIndex, float t) { -// this.crossingPoint = pt; -// this.polygonIndex = polygonIndex; -// this.edgeIndex = edgeIndex; -// this.t = t; -// } -// } -// -// private WallCrossing findFirstWallCrossing( -// float[] from, -// float[] to, -// List> walls) { -// -// double bestT = Double.MAX_VALUE; -// WallCrossing best = null; -// -// for (int pi = 0; pi < walls.size(); pi++) { -// List polygon = walls.get(pi); -// if (polygon == null || polygon.size() < 2) continue; -// -// int edgeCount = getRingEdgeCount(polygon); -// -// for (int ei = 0; ei < edgeCount; ei++) { -// float[] a = polygon.get(ei); -// float[] b = polygon.get((ei + 1) % polygon.size()); -// -// double t = intersectionT(from, to, a, b); -// if (t >= 0.0 && t <= 1.0 && t < bestT) { -// bestT = t; -// float[] pt = { -// (float) (from[0] + t * (to[0] - from[0])), -// (float) (from[1] + t * (to[1] - from[1])) -// }; -// best = new WallCrossing(pt, pi, ei, (float) t); -// } -// } -// } -// -// return best; -// } -// -// private int getRingEdgeCount(List ring) { -// if (ring == null || ring.size() < 2) return 0; -// -// float[] first = ring.get(0); -// float[] last = ring.get(ring.size() - 1); -// -// boolean alreadyClosed = -// Math.abs(first[0] - last[0]) < RING_CLOSURE_EPSILON && -// Math.abs(first[1] - last[1]) < RING_CLOSURE_EPSILON; -// -// return alreadyClosed ? ring.size() - 1 : ring.size(); -// } - -// private double intersectionT(float[] p1, float[] p2, float[] p3, float[] p4) { -// double rX = p2[0] - p1[0]; -// double rY = p2[1] - p1[1]; -// double sX = p4[0] - p3[0]; -// double sY = p4[1] - p3[1]; -// -// double denom = rX * sY - rY * sX; -// if (Math.abs(denom) < INTERSECTION_EPSILON) { -// return -1.0; -// } -// -// double qmpX = p3[0] - p1[0]; -// double qmpY = p3[1] - p1[1]; -// -// double t = (qmpX * sY - qmpY * sX) / denom; -// double u = (qmpX * rY - qmpY * rX) / denom; -// -// return (t >= 0.0 && t <= 1.0 && u >= 0.0 && u <= 1.0) ? t : -1.0; -// } - -// private boolean isTooCloseToAnyWall(float[] point, List> walls, float clearance) { -// for (List polygon : walls) { -// if (polygon == null || polygon.size() < 2) continue; -// -// int edgeCount = getRingEdgeCount(polygon); -// -// for (int i = 0; i < edgeCount; i++) { -// float[] a = polygon.get(i); -// float[] b = polygon.get((i + 1) % polygon.size()); -// -// if (distancePointToSegment(point, a, b) < clearance) { -// return true; -// } -// } -// } -// return false; -// } - -// private float distancePointToSegment(float[] p, float[] a, float[] b) { -// float px = p[0], py = p[1]; -// float ax = a[0], ay = a[1]; -// float bx = b[0], by = b[1]; -// -// float dx = bx - ax; -// float dy = by - ay; -// float len2 = dx * dx + dy * dy; -// -// if (len2 < 1e-12f) { -// float ex = px - ax; -// float ey = py - ay; -// return (float) Math.sqrt(ex * ex + ey * ey); -// } -// -// float t = ((px - ax) * dx + (py - ay) * dy) / len2; -// t = Math.max(0f, Math.min(1f, t)); -// -// float cx = ax + t * dx; -// float cy = ay + t * dy; -// -// float ex = px - cx; -// float ey = py - cy; -// return (float) Math.sqrt(ex * ex + ey * ey); -// } -// -// private float[] moveToJustBeforeWall(float[] from, float[] to, float hitT, float snapBackMeters) { -// float dx = to[0] - from[0]; -// float dy = to[1] - from[1]; -// float len = (float) Math.sqrt(dx * dx + dy * dy); -// -// if (len < 1e-6f) { -// return new float[]{from[0], from[1]}; -// } -// -// float backT = snapBackMeters / len; -// float safeT = Math.max(0f, hitT - backT); -// -// return new float[]{ -// from[0] + safeT * dx, -// from[1] + safeT * dy -// }; -// } -// private static final float MAX_GAP_WIDTH_METERS = 2.5f; -// private static final float GAP_SEARCH_RADIUS_METERS = 3.0f; -// private static final float MIN_GAP_WIDTH_METERS = 0.20f; -// private static final float GAP_ROUTE_WEIGHT_PENALTY = 0.5f; -// -// public void applyWallConstraints( -// float[] prevEast, -// float[] prevNorth, -// float[] currEast, -// float[] currNorth, -// float[] weights, -// CoordinateConverter converter) { -// -// if (currentVenue == null || currentFloorKey == null) return; -// IndoorVenue.FloorFeatures floor = currentVenue.floorFeatures.get(currentFloorKey); -// if (floor == null || floor.wallPolygonsEnu == null || floor.wallPolygonsEnu.isEmpty()) return; -// -// List> walls = floor.wallPolygonsEnu; -// -// for (int i = 0; i < weights.length; i++) { -// if (weights[i] <= 0f) continue; -// -// float[] prev = {prevEast[i], prevNorth[i]}; -// float[] curr = {currEast[i], currNorth[i]}; -// -// WallCrossing crossing = findFirstWallCrossing(prev, curr, walls); -// if (crossing == null) continue; -// -// float[] gapMid = findLocalGapNearCrossing( -// crossing.crossingPoint, -// walls, -// GAP_SEARCH_RADIUS_METERS, -// MIN_GAP_WIDTH_METERS, -// MAX_GAP_WIDTH_METERS -// ); -// -// if (gapMid != null) { -// boolean leg1Clear = findFirstWallCrossing(prev, gapMid, walls) == null; -// boolean leg2Clear = findFirstWallCrossing(gapMid, curr, walls) == null; -// -// if (leg1Clear && leg2Clear) { -// // Let particle continue to its intended destination, -// // but penalise for using an inferred opening. -// weights[i] *= GAP_ROUTE_WEIGHT_PENALTY; -// continue; -// } -// } -// -// float[] snapped = snapToWallEnu(prev, curr, walls); -// currEast[i] = snapped[0]; -// currNorth[i] = snapped[1]; -// weights[i] = 0f; -// } -// } -// -// private float[] findLocalGapNearCrossing( -// float[] crossingPoint, -// List> walls, -// float searchRadius, -// float minGapWidth, -// float maxGapWidth) { -// -// List nearbyVertices = new ArrayList<>(); -// -// // Only collect vertices near the crossing point -// for (List polygon : walls) { -// for (float[] pt : polygon) { -// if (distance(pt, crossingPoint) <= searchRadius) { -// nearbyVertices.add(pt); -// } -// } -// } -// -// float bestScore = Float.MAX_VALUE; -// float[] bestMid = null; -// -// for (int i = 0; i < nearbyVertices.size(); i++) { -// for (int j = i + 1; j < nearbyVertices.size(); j++) { -// float[] a = nearbyVertices.get(i); -// float[] b = nearbyVertices.get(j); -// -// float gapWidth = distance(a, b); -// if (gapWidth < minGapWidth || gapWidth > maxGapWidth) continue; -// -// float[] mid = midpoint(a, b); -// -// // midpoint itself must be close to the crossing -// float midpointDist = distance(mid, crossingPoint); -// if (midpointDist > searchRadius) continue; -// -// // Prefer narrow gaps close to the crossing point -// float score = midpointDist + 0.5f * gapWidth; -// -// if (score < bestScore) { -// bestScore = score; -// bestMid = mid; -// } -// } -// } -// -// return bestMid; -// } -// -// private float distance(float[] a, float[] b) { -// float dx = a[0] - b[0]; -// float dy = a[1] - b[1]; -// return (float) Math.sqrt(dx * dx + dy * dy); -// } -// -// private float[] midpoint(float[] a, float[] b) { -// return new float[] { -// 0.5f * (a[0] + b[0]), -// 0.5f * (a[1] + b[1]) -// }; -// } -// -// private static class WallCrossing { -// float[] crossingPoint; -// int polygonIndex; -// int edgeIndex; -// WallCrossing(float[] pt, int poly, int edge) { -// crossingPoint = pt; polygonIndex = poly; edgeIndex = edge; -// } -// } -// -// private WallCrossing findFirstWallCrossing(float[] from, float[] to, -// List> walls) { -// double bestT = Double.MAX_VALUE; -// WallCrossing best = null; -// -// for (int pi = 0; pi < walls.size(); pi++) { -// List polygon = walls.get(pi); -// for (int ei = 0; ei < polygon.size(); ei++) { -// float[] a = polygon.get(ei); -// float[] b = polygon.get((ei + 1) % polygon.size()); -// -// // Parametric intersection — find t along from→to where it hits a→b -// double t = intersectionT(from, to, a, b); -// if (t >= 0 && t <= 1 && t < bestT) { -// bestT = t; -// float[] pt = { -// (float)(from[0] + t * (to[0] - from[0])), -// (float)(from[1] + t * (to[1] - from[1])) -// }; -// best = new WallCrossing(pt, pi, ei); -// } -// } -// } -// return best; -// } -// -// // Returns t ∈ [0,1] along segment p1→p2 where it intersects p3→p4, or -1 if no intersection -// private double intersectionT(float[] p1, float[] p2, float[] p3, float[] p4) { -// double d1x = p2[0] - p1[0], d1y = p2[1] - p1[1]; -// double d2x = p4[0] - p3[0], d2y = p4[1] - p3[1]; -// double cross = d1x * d2y - d1y * d2x; -// if (Math.abs(cross) < 1e-6) return -1; -// -// double t = ((p3[0] - p1[0]) * d2y - (p3[1] - p1[1]) * d2x) / cross; -// double u = ((p3[0] - p1[0]) * d1y - (p3[1] - p1[1]) * d1x) / cross; -// return (t >= 0 && t <= 1 && u >= 0 && u <= 1) ? t : -1; -// } -// -// private float[] findNearestGap(float[] nearPoint, List> walls, -// float maxGapWidth) { -// float bestDist = Float.MAX_VALUE; -// float[] bestMid = null; -// -// // Collect all wall endpoints (start and end of each polygon) -// List endpoints = new ArrayList<>(); -// for (List polygon : walls) { -// // The last point of a closed polygon is the same as the first, -// // so the "open" endpoints are just all points in the list -// -// for (float[] pt : polygon) { -// endpoints.add(pt); -// } -// } -// -// // Find pairs of endpoints that are close together — those are gap edges -// for (int i = 0; i < endpoints.size(); i++) { -// for (int j = i + 1; j < endpoints.size(); j++) { -// float[] a = endpoints.get(i); -// float[] b = endpoints.get(j); -// -// float dx = b[0] - a[0]; -// float dy = b[1] - a[1]; -// float dist = (float) Math.sqrt(dx * dx + dy * dy); -// -// // Skip if the two endpoints are too far apart (not a gap) or -// // touching (same point — closing edge of same polygon) -// if (dist < 0.05f || dist > maxGapWidth) continue; -// -// // Midpoint of this gap -// float[] mid = {(a[0] + b[0]) / 2f, (a[1] + b[1]) / 2f}; -// -// // Distance from the wall crossing to this gap -// float dx2 = mid[0] - nearPoint[0]; -// float dy2 = mid[1] - nearPoint[1]; -// float gapDist = (float) Math.sqrt(dx2 * dx2 + dy2 * dy2); -//// Add this to findNearestGap temporarily for calibration -// Log.d("GapDebug", "Gap found: dist=" + dist + "m at " + mid[0] + "," + mid[1]); -// if (gapDist < bestDist) { -// bestDist = gapDist; -// bestMid = mid; -// } -// } -// } -// -// return bestMid; // null if no gap found within maxGapWidth -// } -// public void applyWallConstraints( -// float[] prevEast, float[] prevNorth, -// float[] currEast, float[] currNorth, -// float[] weights, -// CoordinateConverter converter) { -// -// if (currentVenue == null || currentFloorKey == null) return; -// IndoorVenue.FloorFeatures floor = currentVenue.floorFeatures.get(currentFloorKey); -// if (floor == null || floor.wallPolygonsEnu.isEmpty()) { -// Log.w("WallDebug", "No ENU wall polygons — did bakeEnuCoordinates run?"); -// return; -// } -// -// for (int i = 0; i < weights.length; i++) { -// if (weights[i] == 0f) continue; -// -// float[] prev = {prevEast[i], prevNorth[i]}; -// float[] curr = {currEast[i], currNorth[i]}; -// -// if (crossesAnyWallEnu(prev, curr, floor.wallPolygonsEnu)) { -// // Snap back to just before the wall -// float[] snapped = snapToWallEnu(prev, curr, floor.wallPolygonsEnu); -// currEast[i] = snapped[0]; -// currNorth[i] = snapped[1]; -// weights[i] *= 0.1; -// } -// } -// } private boolean crossesAnyWallEnu(float[] from, float[] to, List> walls) { for (List polygon : walls) { @@ -851,62 +414,6 @@ private boolean onSegmentEnu(float[] a, float[] p, float[] b, double eps) { p[1] >= Math.min(a[1], b[1]) - eps && p[1] <= Math.max(a[1], b[1]) + eps; } - -// private boolean segmentsIntersectEnu(float[] p1, float[] p2, float[] p3, float[] p4) { -// // All values in metres — no precision issues -// double d1x = p2[0] - p1[0], d1y = p2[1] - p1[1]; -// double d2x = p4[0] - p3[0], d2y = p4[1] - p3[1]; -// double cross = d1x * d2y - d1y * d2x; -// if (Math.abs(cross) < 1e-6) return false; // parallel, eps in m² is fine here -// -// double t = ((p3[0] - p1[0]) * d2y - (p3[1] - p1[1]) * d2x) / cross; -// double u = ((p3[0] - p1[0]) * d1y - (p3[1] - p1[1]) * d1x) / cross; -// return t >= 0 && t <= 1 && u >= 0 && u <= 1; -// } -// public void applyWallConstraints( -// float[] prevEast, float[] prevNorth, -// float[] currEast, float[] currNorth, -// float[] weights, -// CoordinateConverter converter) { -// -// -// if (currentVenue == null || currentFloorKey == null) return; -// IndoorVenue.FloorFeatures floor = -// currentVenue.floorFeatures.get(currentFloorKey); -// if (floor == null || floor.wallPolygons.isEmpty()) return; -// -// for (int i = 0; i < weights.length; i++) { -// if (weights[i] == 0f) continue; // already dead, skip -// Log.d("WallDebug", "Particle " + i + -// " prev=(" + prevEast[i] + "," + prevNorth[i] + ")" + -// " curr=(" + currEast[i] + "," + currNorth[i] + ")" + -// " floor = "+ currentFloorKey); -// -// //convert prev and curr to LatLng -// LatLng prev = toLatLng(prevEast[i], prevNorth[i], converter); -// LatLng curr = toLatLng(currEast[i], currNorth[i], converter); -// -// //check if cross walls on that floor -// if (crossesAnyWall(prev, curr, floor.wallPolygons)) { -// Log.d("WallDebug", "Particle " + i + " CROSSED WALL"); -// LatLng snapped = adjustPositionToNearestValidLocation( -// prev, curr, getNearestWallPolygon(prev, curr, floor.wallPolygons)); -// Log.d("WallDebug", "Snapped from " + curr + " → " + snapped); -// float[] enu = converter.toEnu(snapped.latitude, snapped.longitude); -// Log.d("WallDebug", "Snapped from " + curr + " → " + snapped); -// //directly change currEast, currNorth, and weights arrays -// currEast[i] = enu[0]; -// currNorth[i] = enu[1]; -// //downweight changed location -// weights[i] *= 0.01f; -// Log.d("WallDebug", "Weight updated: " + weights[i]); -// -// } -// -// } -// Log.e("IndoorMapManager", "applied wall constraints!"); -// -// } public void bakeEnuCoordinates(CoordinateConverter converter) { if (currentVenue == null || currentFloorKey == null) return; IndoorVenue.FloorFeatures floor = currentVenue.floorFeatures.get(currentFloorKey); @@ -969,10 +476,6 @@ private static int orientation(LatLng a, LatLng b, LatLng c) { double eps = 1e-12; -// if (Math.abs(val) < eps) { -// return 0; // collinear -// } - return (val > 0) ? 1 : 2; } @@ -1118,6 +621,104 @@ public float[] reroutePrevEnu(float[] fromEnu, float[] toEnu) { return toEnu.clone(); } + private LatLng getWalkableSnapNearAccessPoint(LatLng accessCenter, + LatLng referenceLocation, + IndoorVenue.FloorFeatures floorFeatures) { + if (accessCenter == null) return referenceLocation; + if (floorFeatures == null) return accessCenter; + + // First try a point offset toward where the user came from + LatLng firstCandidate = offsetFromCenterTowardReference(accessCenter, referenceLocation, 1.5); + if (!isInsideAnyWall(firstCandidate, floorFeatures.wallPolygons)) { + return firstCandidate; + } + + // Then do a radial search around the center + double[] radii = {1.0, 1.5, 2.0, 2.5, 3.0}; + int angleStepDeg = 20; + + for (double radius : radii) { + for (int deg = 0; deg < 360; deg += angleStepDeg) { + double rad = Math.toRadians(deg); + double east = radius * Math.cos(rad); + double north = radius * Math.sin(rad); + + LatLng candidate = offsetLatLngMeters(accessCenter, east, north); + if (!isInsideAnyWall(candidate, floorFeatures.wallPolygons)) { + return candidate; + } + } + } + + // Fallback: keep the old corrected location if everything near the center is blocked + return referenceLocation; + } + + private boolean isPointInPolygon(LatLng point, List polygon) { + if (point == null || polygon == null || polygon.size() < 3) return false; + + boolean inside = false; + double x = point.longitude; + double y = point.latitude; + + for (int i = 0, j = polygon.size() - 1; i < polygon.size(); j = i++) { + double xi = polygon.get(i).longitude; + double yi = polygon.get(i).latitude; + double xj = polygon.get(j).longitude; + double yj = polygon.get(j).latitude; + + boolean intersect = ((yi > y) != (yj > y)) && + (x < (xj - xi) * (y - yi) / ((yj - yi) + 1e-12) + xi); + + if (intersect) inside = !inside; + } + + return inside; + } + + private boolean isInsideAnyWall(LatLng point, List> wallPolygons) { + if (point == null || wallPolygons == null) return false; + + for (List polygon : wallPolygons) { + if (polygon != null && polygon.size() >= 3 && isPointInPolygon(point, polygon)) { + return true; + } + } + return false; + } + + private LatLng offsetLatLngMeters(LatLng origin, double eastMeters, double northMeters) { + if (origin == null) return null; + + double latRad = Math.toRadians(origin.latitude); + + double dLat = northMeters / 111320.0; + double dLng = eastMeters / (111320.0 * Math.cos(latRad)); + + return new LatLng( + origin.latitude + dLat, + origin.longitude + dLng + ); + } + + private LatLng offsetFromCenterTowardReference(LatLng center, LatLng reference, double offsetMeters) { + if (center == null || reference == null) return center; + + double dNorth = (reference.latitude - center.latitude) * 111320.0; + double dEast = (reference.longitude - center.longitude) * + 111320.0 * Math.cos(Math.toRadians(center.latitude)); + + double norm = Math.sqrt(dEast * dEast + dNorth * dNorth); + if (norm < 1e-6) { + return offsetLatLngMeters(center, offsetMeters, 0.0); + } + + double unitEast = dEast / norm; + double unitNorth = dNorth / norm; + + return offsetLatLngMeters(center, unitEast * offsetMeters, unitNorth * offsetMeters); + } + /** * If the movement from fromEnu to toEnu crosses a wall, slides the destination * along the wall surface rather than stopping at it. This prevents the position @@ -1262,21 +863,7 @@ public LatLng indoorLocationCorrection(LatLng oldLocation, return toLatLng(corrected[0], corrected[1], c); } - //floor adjustment - // if abs(heightChange) > heightThreshold: - //// - //// if distance(correctedLocation, nearest stairs or lift) < proximityThreshold: - //// - //// accept floor change - //// - //// if horizontalMovement < horizontalThreshold: - //// mode = lift - //// else: - //// mode = stairs - //// - //// else: - //// reject floor change - //// keep same floor + @@ -1400,7 +987,12 @@ public FloorChangeResult acceptFloorChange(LatLng correctedLocation, } else if (usedStairs) { LatLng nearestStairsOnNextFloor = getNearestPoint(correctedLocation, nextFloorFeatures.stairsCenters); if (nearestStairsOnNextFloor != null) { - snappedDestination = nearestStairsOnNextFloor; +// snappedDestination = nearestStairsOnNextFloor; + snappedDestination = getWalkableSnapNearAccessPoint( + nearestStairsOnNextFloor, + oldLocation, + nextFloorFeatures + ); } } @@ -1421,6 +1013,8 @@ public FloorChangeResult acceptFloorChange(LatLng correctedLocation, return new FloorChangeResult(nextFloorKey, snappedDestination, true); } + + private void startFloorTransitionIfNeeded(LatLng currentLocation, float currentHeight) { if (currentLocation == null) return; if (confirmedFloorKey == null || Float.isNaN(confirmedFloorElevation)) return; From 6760d882cc71993739689cd98021a12a123543a1 Mon Sep 17 00:00:00 2001 From: sydneysavarese Date: Tue, 31 Mar 2026 16:26:19 +0100 Subject: [PATCH 59/82] added circle to indicate what lift or stairs was taken and point snaps to where stairs/lift were --- .../fragment/TrajectoryMapFragment.java | 24 +++++-- .../PositionMe/utils/IndoorMapManager.java | 66 ++++++++++++++----- 2 files changed, 67 insertions(+), 23 deletions(-) diff --git a/app/src/main/java/com/openpositioning/PositionMe/presentation/fragment/TrajectoryMapFragment.java b/app/src/main/java/com/openpositioning/PositionMe/presentation/fragment/TrajectoryMapFragment.java index 92554a3b..5d1debef 100644 --- a/app/src/main/java/com/openpositioning/PositionMe/presentation/fragment/TrajectoryMapFragment.java +++ b/app/src/main/java/com/openpositioning/PositionMe/presentation/fragment/TrajectoryMapFragment.java @@ -86,6 +86,7 @@ public class TrajectoryMapFragment extends Fragment { private LatLng currentLocation; // Stores the user's current location private Marker orientationMarker; // Marker representing user's heading private Marker gnssMarker; // GNSS position marker + private Circle activeAccessHighlight = null; /** Raw (unfiltered) PDR trajectory — drawn in red. */ private Polyline polyline; // Polyline representing user's movement path @@ -637,6 +638,21 @@ private void initMapSettings(GoogleMap map) { .visible(false)); } + private void highlightAccessPoint(LatLng center) { + if (center == null || gMap == null) return; + + if (activeAccessHighlight != null) { + activeAccessHighlight.remove(); + activeAccessHighlight = null; + } + + activeAccessHighlight = gMap.addCircle(new CircleOptions() + .center(center) + .radius(2.0) // meters + .strokeWidth(4f) + .strokeColor(Color.GREEN) + .fillColor(0x2200FF00)); + } private void maybeRequestNearbyVenues(@NonNull LatLng loc) { Log.d("MapDebug", "maybeRequestNearbyVenues called, timeSinceLast=" + (System.currentTimeMillis() - lastVenueQueryMs) + " loc=" + loc); if (indoorMapManager != null && indoorMapManager.getIsIndoorMapSet()) return; @@ -789,12 +805,11 @@ public void updateUserLocation(@NonNull LatLng newLocation, float orientation) { correctedLocation = floorResult.snappedLocation; newfloor = floorResult.floorKey; } + if (floorResult.changedFloor && floorResult.highlightcenter != null) { + highlightAccessPoint(floorResult.highlightcenter); + } } if (!Objects.equals(oldfloor, newfloor)) { -// if(!(oldfloor.equals (newfloor))) { -// Log.d("MapMatch", "new floor: " + newfloor); - - if (floorLabel != null) { floorLabel.post(() -> floorLabel.setText("Floor: " + newfloor)); } @@ -807,7 +822,6 @@ public void updateUserLocation(@NonNull LatLng newLocation, float orientation) { Log.d("IndoorTest", "newLocation = " + newLocation); Log.d("IndoorTest", "heightChange = " + heightChange); -// // Extend polyline if movement occurred if (oldLocation != null && !oldLocation.equals(newLocation) && polyline != null) { List points = new ArrayList<>(polyline.getPoints()); diff --git a/app/src/main/java/com/openpositioning/PositionMe/utils/IndoorMapManager.java b/app/src/main/java/com/openpositioning/PositionMe/utils/IndoorMapManager.java index 880a05af..f3b4d49a 100644 --- a/app/src/main/java/com/openpositioning/PositionMe/utils/IndoorMapManager.java +++ b/app/src/main/java/com/openpositioning/PositionMe/utils/IndoorMapManager.java @@ -5,6 +5,8 @@ import com.google.android.gms.maps.GoogleMap; import com.google.android.gms.maps.model.BitmapDescriptorFactory; +import com.google.android.gms.maps.model.Circle; +import com.google.android.gms.maps.model.CircleOptions; import com.google.android.gms.maps.model.GroundOverlay; import com.google.android.gms.maps.model.GroundOverlayOptions; import com.google.android.gms.maps.model.LatLng; @@ -621,6 +623,25 @@ public float[] reroutePrevEnu(float[] fromEnu, float[] toEnu) { return toEnu.clone(); } + private Circle activeAccessHighlight = null; + + public void highlightAccessPoint(LatLng center) { + if (center == null || gMap == null) return; + + // remove previous highlight + if (activeAccessHighlight != null) { + activeAccessHighlight.remove(); + } + + activeAccessHighlight = gMap.addCircle(new CircleOptions() + .center(center) + .radius(2.0) // meters (tweak) + .strokeWidth(3f) + .strokeColor(Color.GREEN) + .fillColor(0x2200FF00) // translucent green + ); + } + private LatLng getWalkableSnapNearAccessPoint(LatLng accessCenter, LatLng referenceLocation, IndoorVenue.FloorFeatures floorFeatures) { @@ -892,18 +913,18 @@ public FloorChangeResult acceptFloorChange(LatLng correctedLocation, currentFloorKey == null || correctedLocation == null || oldLocation == null) { - return new FloorChangeResult(currentFloorKey, correctedLocation, false); + return new FloorChangeResult(currentFloorKey, correctedLocation, false, null); } if (confirmedFloorKey == null || Float.isNaN(confirmedFloorElevation)) { Log.d("MapMatch", "No confirmed floor reference yet"); - return new FloorChangeResult(currentFloorKey, correctedLocation, false); + return new FloorChangeResult(currentFloorKey, correctedLocation, false, null); } long now = System.currentTimeMillis(); if (now - lastFloorChangeTimeMs < MIN_FLOOR_CHANGE_INTERVAL_MS) { Log.d("MapMatch", "Floor change blocked by debounce"); - return new FloorChangeResult(currentFloorKey, correctedLocation, false); + return new FloorChangeResult(currentFloorKey, correctedLocation, false, null); } startFloorTransitionIfNeeded(correctedLocation, currentHeight); @@ -911,13 +932,13 @@ public FloorChangeResult acceptFloorChange(LatLng correctedLocation, if (Math.abs(heightChangeMeters) < HEIGHT_THRESHOLD_METERS) { Log.d("MapMatch", "Height change too small: " + heightChangeMeters); resetFloorTransitionState(); - return new FloorChangeResult(currentFloorKey, correctedLocation, false); + return new FloorChangeResult(currentFloorKey, correctedLocation, false, null); } IndoorVenue.FloorFeatures currentFloorFeatures = currentVenue.floorFeatures.get(confirmedFloorKey); if (currentFloorFeatures == null) { Log.d("MapMatch", "No floor features for confirmed floor: " + confirmedFloorKey); - return new FloorChangeResult(currentFloorKey, correctedLocation, false); + return new FloorChangeResult(currentFloorKey, correctedLocation, false, null); } int direction = heightChangeMeters > 0 ? 1 : -1; @@ -930,13 +951,13 @@ public FloorChangeResult acceptFloorChange(LatLng correctedLocation, if (nextFloorKey == null || !currentVenue.floorFeatures.containsKey(nextFloorKey)) { Log.d("MapMatch", "Next floor invalid"); - return new FloorChangeResult(currentFloorKey, correctedLocation, false); + return new FloorChangeResult(currentFloorKey, correctedLocation, false, null); } IndoorVenue.FloorFeatures nextFloorFeatures = currentVenue.floorFeatures.get(nextFloorKey); if (nextFloorFeatures == null) { Log.d("MapMatch", "No floor features for destination floor: " + nextFloorKey); - return new FloorChangeResult(currentFloorKey, correctedLocation, false); + return new FloorChangeResult(currentFloorKey, correctedLocation, false, null); } boolean nearStairs = isNearAnyPoint( @@ -969,11 +990,14 @@ public FloorChangeResult acceptFloorChange(LatLng correctedLocation, if (!usedLift && !usedStairs) { Log.d("MapMatch", "Rejected floor change: not near stairs/lift in a plausible way"); - return new FloorChangeResult(currentFloorKey, correctedLocation, false); + return new FloorChangeResult(currentFloorKey, correctedLocation, false, null); } + LatLng highlightCenter = null; + + if (nextFloorKey.equals(confirmedFloorKey)) { - return new FloorChangeResult(currentFloorKey, correctedLocation, false); + return new FloorChangeResult(currentFloorKey, correctedLocation, false, null); } LatLng snappedDestination = correctedLocation; @@ -983,16 +1007,19 @@ public FloorChangeResult acceptFloorChange(LatLng correctedLocation, LatLng nearestLiftOnNextFloor = getNearestPoint(correctedLocation, nextFloorFeatures.liftCenters); if (nearestLiftOnNextFloor != null) { snappedDestination = nearestLiftOnNextFloor; + highlightCenter = nearestLiftOnNextFloor; } } else if (usedStairs) { LatLng nearestStairsOnNextFloor = getNearestPoint(correctedLocation, nextFloorFeatures.stairsCenters); + highlightCenter = nearestStairsOnNextFloor; + if (nearestStairsOnNextFloor != null) { -// snappedDestination = nearestStairsOnNextFloor; - snappedDestination = getWalkableSnapNearAccessPoint( - nearestStairsOnNextFloor, - oldLocation, - nextFloorFeatures - ); + snappedDestination = nearestStairsOnNextFloor; +// snappedDestination = getWalkableSnapNearAccessPoint( +// nearestStairsOnNextFloor, +// oldLocation, +// nextFloorFeatures +// ); } } @@ -1010,7 +1037,7 @@ public FloorChangeResult acceptFloorChange(LatLng correctedLocation, - return new FloorChangeResult(nextFloorKey, snappedDestination, true); + return new FloorChangeResult(nextFloorKey, snappedDestination, true, highlightCenter); } @@ -1066,10 +1093,13 @@ public static class FloorChangeResult { public final LatLng snappedLocation; public final boolean changedFloor; - public FloorChangeResult(String floorKey, LatLng snappedLocation, boolean changedFloor) { + public LatLng highlightcenter; + + public FloorChangeResult(String floorKey, LatLng snappedLocation, boolean changedFloor, LatLng highlightcenter) { this.floorKey = floorKey; this.snappedLocation = snappedLocation; this.changedFloor = changedFloor; + this.highlightcenter = highlightcenter; } } @@ -1360,7 +1390,7 @@ private void drawFloor(JSONObject floorGeoJson, String floorKey) throws JSONExce fillColor = Color.argb(0, 250, 0, 0); strokeWidth = 3.5f; } else if (t.contains("lift")) { - strokeColor = Color.RED; + strokeColor = Color.BLUE; fillColor = Color.argb(0, 0, 0, 0); strokeWidth = 8f; } else if (t.contains("stairs")) { From 4f46f5aaa183d12957991479200275f7413b1d0e Mon Sep 17 00:00:00 2001 From: sydneysavarese Date: Tue, 31 Mar 2026 17:10:42 +0100 Subject: [PATCH 60/82] horizontal displacement works! --- .../PositionMe/utils/IndoorMapManager.java | 87 +++++++++++++++---- 1 file changed, 69 insertions(+), 18 deletions(-) diff --git a/app/src/main/java/com/openpositioning/PositionMe/utils/IndoorMapManager.java b/app/src/main/java/com/openpositioning/PositionMe/utils/IndoorMapManager.java index f3b4d49a..2a7ff9e7 100644 --- a/app/src/main/java/com/openpositioning/PositionMe/utils/IndoorMapManager.java +++ b/app/src/main/java/com/openpositioning/PositionMe/utils/IndoorMapManager.java @@ -901,9 +901,9 @@ public LatLng indoorLocationCorrection(LatLng oldLocation, private static final double STAIRS_THRESHOLD_METERS = 12.0; private static final double LIFT_THRESHOLD_METERS = 10.0; private static final double LIFT_HORIZONTAL_THRESHOLD_METERS = 1.0; - private LatLng floorTransitionStartLocation = null; - private boolean floorTransitionInProgress = false; - private static final float FLOOR_TRANSITION_START_THRESHOLD_METERS = 1.0f; +// private LatLng floorTransitionStartLocation = null; +// private boolean floorTransitionInProgress = false; +// private static final float FLOOR_TRANSITION_START_THRESHOLD_METERS = 1.0f; public FloorChangeResult acceptFloorChange(LatLng correctedLocation, LatLng oldLocation, @@ -926,18 +926,22 @@ public FloorChangeResult acceptFloorChange(LatLng correctedLocation, Log.d("MapMatch", "Floor change blocked by debounce"); return new FloorChangeResult(currentFloorKey, correctedLocation, false, null); } - startFloorTransitionIfNeeded(correctedLocation, currentHeight); + updateFloorTransitionState(correctedLocation, currentHeight); + + double horizontalDisplacement = + getFloorTransitionHorizontalDisplacement(correctedLocation); float heightChangeMeters = currentHeight - confirmedFloorElevation; if (Math.abs(heightChangeMeters) < HEIGHT_THRESHOLD_METERS) { Log.d("MapMatch", "Height change too small: " + heightChangeMeters); - resetFloorTransitionState(); +// resetFloorTransitionState(); return new FloorChangeResult(currentFloorKey, correctedLocation, false, null); } IndoorVenue.FloorFeatures currentFloorFeatures = currentVenue.floorFeatures.get(confirmedFloorKey); if (currentFloorFeatures == null) { Log.d("MapMatch", "No floor features for confirmed floor: " + confirmedFloorKey); +// resetFloorTransitionState(); return new FloorChangeResult(currentFloorKey, correctedLocation, false, null); } @@ -951,12 +955,14 @@ public FloorChangeResult acceptFloorChange(LatLng correctedLocation, if (nextFloorKey == null || !currentVenue.floorFeatures.containsKey(nextFloorKey)) { Log.d("MapMatch", "Next floor invalid"); +// resetFloorTransitionState(); return new FloorChangeResult(currentFloorKey, correctedLocation, false, null); } IndoorVenue.FloorFeatures nextFloorFeatures = currentVenue.floorFeatures.get(nextFloorKey); if (nextFloorFeatures == null) { Log.d("MapMatch", "No floor features for destination floor: " + nextFloorKey); +// resetFloorTransitionState(); return new FloorChangeResult(currentFloorKey, correctedLocation, false, null); } @@ -972,24 +978,25 @@ public FloorChangeResult acceptFloorChange(LatLng correctedLocation, LIFT_THRESHOLD_METERS ); - double horizontalDisplacement = getFloorTransitionHorizontalDisplacement(correctedLocation); - resetFloorTransitionState(); +// double horizontalDisplacement = getFloorTransitionHorizontalDisplacement(correctedLocation); +// resetFloorTransitionState(); boolean usedLift = nearLift && horizontalDisplacement < LIFT_HORIZONTAL_THRESHOLD_METERS; boolean usedStairs = false; - if (!nearLift && nearStairs){ - usedStairs = true; - } +// if (!nearLift && nearStairs){ +// usedStairs = true; +// } - else { +// else { usedStairs = nearStairs && horizontalDisplacement >= LIFT_HORIZONTAL_THRESHOLD_METERS; - } +// } Log.d("MapMatch", "nearStairs=" + nearStairs + ", nearLift=" + nearLift); Log.d("MapMatch", "horizontalDisplacement=" + horizontalDisplacement); Log.d("MapMatch", "usedLift=" + usedLift + ", usedStairs=" + usedStairs); if (!usedLift && !usedStairs) { Log.d("MapMatch", "Rejected floor change: not near stairs/lift in a plausible way"); +// resetFloorTransitionState(); return new FloorChangeResult(currentFloorKey, correctedLocation, false, null); } LatLng highlightCenter = null; @@ -997,6 +1004,7 @@ public FloorChangeResult acceptFloorChange(LatLng correctedLocation, if (nextFloorKey.equals(confirmedFloorKey)) { +// resetFloorTransitionState(); return new FloorChangeResult(currentFloorKey, correctedLocation, false, null); } @@ -1025,6 +1033,7 @@ public FloorChangeResult acceptFloorChange(LatLng correctedLocation, commitAutoFloorChange(nextFloorKey, currentHeight); lastFloorChangeTimeMs = now; + resetFloorTransitionState(); Log.d("MapMatch", "Accepted floor change to " + nextFloorKey + " with snapped destination " + snappedDestination); @@ -1042,33 +1051,75 @@ public FloorChangeResult acceptFloorChange(LatLng correctedLocation, - private void startFloorTransitionIfNeeded(LatLng currentLocation, float currentHeight) { + // ================= FLOOR TRANSITION TRACKING ================= + + private LatLng floorTransitionStartLocation = null; + private LatLng lastStableFloorLocation = null; + private boolean floorTransitionInProgress = false; + + // Tune these based on your barometer noise + private static final float FLOOR_STABLE_BAND_METERS = 0.5f; // "definitely still on floor" + private static final float FLOOR_TRANSITION_START_THRESHOLD_METERS = 1.0f; // "transition has begun" + + /** + * Updates transition tracking state. + * Call this every update BEFORE computing horizontal displacement. + */ + private void updateFloorTransitionState(LatLng currentLocation, float currentHeight) { if (currentLocation == null) return; if (confirmedFloorKey == null || Float.isNaN(confirmedFloorElevation)) return; float heightDelta = currentHeight - confirmedFloorElevation; + float absDelta = Math.abs(heightDelta); + + // Case 1: Still clearly on the confirmed floor → keep refreshing anchor + if (absDelta < FLOOR_STABLE_BAND_METERS) { + lastStableFloorLocation = currentLocation; + + // If we had started a transition but came back, cancel it + floorTransitionInProgress = false; + floorTransitionStartLocation = null; + return; + } + // Case 2: Height has meaningfully deviated → start transition (once) if (!floorTransitionInProgress && - Math.abs(heightDelta) >= FLOOR_TRANSITION_START_THRESHOLD_METERS) { + absDelta >= FLOOR_TRANSITION_START_THRESHOLD_METERS) { + floorTransitionInProgress = true; - floorTransitionStartLocation = currentLocation; - Log.d("MapMatch", "Started floor transition at " + currentLocation + + + // Prefer last stable location (more accurate than noisy trigger point) + floorTransitionStartLocation = (lastStableFloorLocation != null) + ? lastStableFloorLocation + : currentLocation; + + Log.d("MapMatch", "Started floor transition at " + floorTransitionStartLocation + + ", current location = " + currentLocation + ", height delta = " + heightDelta); } } + /** + * Returns horizontal displacement since transition began. + */ private double getFloorTransitionHorizontalDisplacement(LatLng currentLocation) { - if (!floorTransitionInProgress || floorTransitionStartLocation == null || currentLocation == null) { + if (!floorTransitionInProgress || + floorTransitionStartLocation == null || + currentLocation == null) { return 0.0; } + return distanceMeters(floorTransitionStartLocation, currentLocation); } + /** + * Call this after a successful floor change. + */ private void resetFloorTransitionState() { floorTransitionInProgress = false; floorTransitionStartLocation = null; + lastStableFloorLocation = null; } - private LatLng getNearestPoint(LatLng location, List centers) { if (location == null || centers == null || centers.isEmpty()) { return null; From d9821711e8b7158b9713fb06ef0954a34e30574c Mon Sep 17 00:00:00 2001 From: Haoning Huang Date: Tue, 31 Mar 2026 18:59:58 +0100 Subject: [PATCH 61/82] =?UTF-8?q?wip:=20ui=20merge=20in=20progress=20?= =?UTF-8?q?=E2=80=94=20partial=20changes=20applied?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../viewitems/TestPointListAdapter.java | 16 +++++- .../PositionMe/sensors/SensorFusion.java | 56 ++++++++++++++----- app/src/main/res/xml/root_preferences.xml | 10 ++++ 3 files changed, 66 insertions(+), 16 deletions(-) diff --git a/app/src/main/java/com/openpositioning/PositionMe/presentation/viewitems/TestPointListAdapter.java b/app/src/main/java/com/openpositioning/PositionMe/presentation/viewitems/TestPointListAdapter.java index e3c2af42..ec66881c 100644 --- a/app/src/main/java/com/openpositioning/PositionMe/presentation/viewitems/TestPointListAdapter.java +++ b/app/src/main/java/com/openpositioning/PositionMe/presentation/viewitems/TestPointListAdapter.java @@ -14,12 +14,16 @@ import java.text.SimpleDateFormat; import java.util.List; import java.util.Locale; +import java.util.TimeZone; +import java.util.Date; public class TestPointListAdapter extends RecyclerView.Adapter { private final Context context; private final List testPoints; + private long startTime = -1; + public TestPointListAdapter(Context context, List testPoints) { this.context = context; this.testPoints = testPoints; @@ -38,8 +42,16 @@ public void onBindViewHolder(@NonNull TestPointViewHolder holder, int position) holder.tvNumber.setText(String.valueOf(tp.number)); holder.tvLatLon.setText(String.format(Locale.US, "(%.6f, %.6f)", tp.latitude, tp.longitude)); - SimpleDateFormat sdf = new SimpleDateFormat("yyyy-MM-dd HH:mm:ss", Locale.US); - holder.tvTimestamp.setText(sdf.format(tp.timestamp)); + if (startTime == -1) { + startTime = tp.timestamp; + } + + long elapsed = tp.timestamp - startTime; + + SimpleDateFormat sdf = new SimpleDateFormat("HH:mm:ss", Locale.US); + sdf.setTimeZone(TimeZone.getTimeZone("UTC")); + + holder.tvTimestamp.setText(sdf.format(new Date(elapsed))); } @Override diff --git a/app/src/main/java/com/openpositioning/PositionMe/sensors/SensorFusion.java b/app/src/main/java/com/openpositioning/PositionMe/sensors/SensorFusion.java index 13c5d1cf..0c314425 100644 --- a/app/src/main/java/com/openpositioning/PositionMe/sensors/SensorFusion.java +++ b/app/src/main/java/com/openpositioning/PositionMe/sensors/SensorFusion.java @@ -1121,9 +1121,13 @@ private void createWifiPositionRequestCallback(){ for (Wifi data : this.wifiList){ wifiAccessPoints.put(String.valueOf(data.getBssid()), data.getLevel()); } - // Capture AP count and timestamp before entering the async callback + // Capture AP count, average RSSI and timestamp before the async callback closure. + // These must be final locals because the lambda captures them from the enclosing scope. final int apCount = this.wifiList.size(); final long currentTime = System.currentTimeMillis(); + float rssiSum = 0f; + for (Wifi data : this.wifiList) rssiSum += data.getLevel(); + final float avgRssi = (apCount > 0) ? rssiSum / apCount : -75f; // Creating POST Request JSONObject wifiFingerPrint = new JSONObject(); wifiFingerPrint.put(WIFI_FINGERPRINT, wifiAccessPoints); @@ -1157,36 +1161,59 @@ public void onSuccess(LatLng wifiLocation, int floor) { // Cache WiFi ENU for stationary soft-update lastWifiEnu = enu; - // Jump detection: reject position if it is too far from the current estimate + // Hard-reject implausibly large jumps (> 80 m). float[] currentEst = particleFilter.getBestEstimate(); float jumpDist = (float) Math.hypot( enu[0] - currentEst[0], enu[1] - currentEst[1]); if (jumpDist > 80f) { - Log.w("SensorFusion", "WiFi jump " + jumpDist + "m — update rejected"); + Log.w("SensorFusion", "WiFi hard-reject: jump=" + jumpDist + "m"); } else { - // Stationary duration in milliseconds long stationaryMs = currentTime - lastStepTime; + boolean isStationary = stationaryMs > 1000; - // Base noise from AP count + // Base observation noise from AP count. + // More visible APs → tighter position estimate → lower noise. float noiseStd = Math.max(8.0f, 20.0f - apCount * 1.5f); - // Aggressively tighten noise and inflate EKF covariance when stationary, - // so both PF and EKF converge strongly to the WiFi observation. + // Scale noise based on average signal strength of the scan. + // Strong signal (> -60 dBm) → reliable ranging; weak (< -80 dBm) → coarser estimate. + if (avgRssi > -60f) { + noiseStd *= 0.7f; + } else if (avgRssi < -80f) { + noiseStd *= 1.5f; + } + + // When moving, a large displacement between the WiFi fix and the current + // estimate is likely a fingerprinting error rather than true movement. + // Penalise proportionally: at 8 m → ×1, at 16 m → ×2, capped at ×4. + if (!isStationary && jumpDist > 8f) { + float jumpPenalty = Math.min(jumpDist / 8f, 4f); + noiseStd *= jumpPenalty; + Log.d("SensorFusion", "WiFi jump penalty ×" + jumpPenalty + + " dist=" + jumpDist + "m rssi=" + avgRssi); + } + + // When stationary, WiFi is the primary position source. + // Tighten noise and inflate EKF covariance so updates converge quickly. if (stationaryMs > 3000) { - // >3s stationary: near-full trust in WiFi (K ≈ 0.97) noiseStd = 2.0f; ekfPositioning.inflateCovariance(200.0f); - } else if (stationaryMs > 1000) { - // >1s stationary: strong WiFi pull (K ≈ 0.90) + } else if (isStationary) { noiseStd = 3.0f; ekfPositioning.inflateCovariance(50.0f); } else { - // Moving: sigma-adaptive reduction only + // While moving, reduce noise further only if the particle cloud + // is already widely dispersed. double sigma = particleFilter.getSigmaMetres(); if (sigma > 15.0) { noiseStd = Math.max(noiseStd * 0.5f, 5.0f); } } + + noiseStd = Math.max(noiseStd, 2.0f); + Log.d("SensorFusion", "WiFi update noiseStd=" + noiseStd + + " apCount=" + apCount + " avgRssi=" + avgRssi + + " jump=" + jumpDist + "m stationary=" + isStationary); particleFilter.updateWithWifi(enu[0], enu[1], noiseStd); ekfPositioning.updateWithWifi(enu[0], enu[1], noiseStd); } @@ -1696,15 +1723,16 @@ public void startRecording() { // Add the initial orientation as the first IMU reading this.trajectory.addImuData(Traj.IMUReading.newBuilder() - .setRelativeTimestamp(0) // 时间戳为0(起始点) + .setRelativeTimestamp(0) .setAcc(Traj.Vector3.newBuilder() - .setX(0).setY(0).setZ(0) // 初始加速度设为0 + .setX(0).setY(0).setZ(0) .build()) .setGyr(Traj.Vector3.newBuilder() - .setX(0).setY(0).setZ(0) // 初始陀螺仪设为0 + .setX(0).setY(0).setZ(0) .build()) .setRotationVector(Traj.Quaternion.newBuilder() .setX(initialRotation[0]) + .setY(initialRotation[1]) .setZ(initialRotation[2]) .setW(initialRotation[3]) diff --git a/app/src/main/res/xml/root_preferences.xml b/app/src/main/res/xml/root_preferences.xml index 8e638542..c1aa0333 100644 --- a/app/src/main/res/xml/root_preferences.xml +++ b/app/src/main/res/xml/root_preferences.xml @@ -97,6 +97,16 @@ app:defaultValue="0.364" android:summary="@string/weiberg_K" /> + + Date: Tue, 31 Mar 2026 19:07:13 +0100 Subject: [PATCH 62/82] ui: use fused position for test points, remove wifi toasts --- .../fragment/RecordingFragment.java | 61 ++++++++----------- 1 file changed, 27 insertions(+), 34 deletions(-) diff --git a/app/src/main/java/com/openpositioning/PositionMe/presentation/fragment/RecordingFragment.java b/app/src/main/java/com/openpositioning/PositionMe/presentation/fragment/RecordingFragment.java index d5b70b72..47b6e68e 100644 --- a/app/src/main/java/com/openpositioning/PositionMe/presentation/fragment/RecordingFragment.java +++ b/app/src/main/java/com/openpositioning/PositionMe/presentation/fragment/RecordingFragment.java @@ -226,29 +226,35 @@ public void onViewCreated(@NonNull View view, SensorFusion.getInstance().addTestPoint(timestampMillis); - float[] gnss = SensorFusion.getInstance().getGNSSLatitude(false); - if (gnss != null) { - double lat = gnss[0]; - double lon = gnss[1]; - - SensorFusion.getInstance().addTestPoint(timestampMillis, lat, lon); - - testPointCounter++; - - if (trajectoryMapFragment != null) { - trajectoryMapFragment.addTestPointMarker( - new LatLng(lat, lon), - testPointCounter - ); + // Use fused position if available — places marker on the purple fused trajectory. + // Falls back to raw GNSS if the particle filter hasn't initialised yet. + double lat, lon; + double[] fused = SensorFusion.getInstance().getFusedLatLon(); + + if (fused != null) { + lat = fused[0]; + lon = fused[1]; + } else { + // Particle filter not yet ready — fall back to raw GNSS + float[] gnss = SensorFusion.getInstance().getGNSSLatitude(false); + if (gnss == null || (gnss[0] == 0.0f && gnss[1] == 0.0f)) { + Toast.makeText(requireContext(), + "Position not available yet", + Toast.LENGTH_SHORT).show(); + return; } + lat = gnss[0]; + lon = gnss[1]; + } -// Toast.makeText(requireContext(), -// "Test point " + testPointCounter + " marked", -// Toast.LENGTH_SHORT).show(); - } else { - Toast.makeText(requireContext(), - "GNSS not available yet", - Toast.LENGTH_SHORT).show(); + SensorFusion.getInstance().addTestPoint(timestampMillis, lat, lon); + testPointCounter++; + + if (trajectoryMapFragment != null) { + trajectoryMapFragment.addTestPointMarker( + new LatLng(lat, lon), + testPointCounter + ); } }); @@ -425,19 +431,6 @@ private void updateUIandPosition() { double[] wifi = sensorFusion.getLastWifiLatLon(); if (wifi != null) { mapFrag.updateWifiPosition(new LatLng(wifi[0], wifi[1])); - if (System.currentTimeMillis() - lastWifiToastMs > 5000) { - lastWifiToastMs = System.currentTimeMillis(); - Toast.makeText(requireContext(), - "WiFi fix: " + String.format("%.5f, %.5f", wifi[0], wifi[1]), - Toast.LENGTH_SHORT).show(); - } - } else { - if (System.currentTimeMillis() - lastWifiToastMs > 5000) { - lastWifiToastMs = System.currentTimeMillis(); - Toast.makeText(requireContext(), - "WiFi: no fix yet", - Toast.LENGTH_SHORT).show(); - } } // Green PDR observation dot — raw PDR position from step counting From 6a8d6ed7def052404c80b9f011eb354d0d39139b Mon Sep 17 00:00:00 2001 From: Haoning Huang Date: Tue, 31 Mar 2026 19:11:01 +0100 Subject: [PATCH 63/82] ui: draw fused trajectory on correction map, add fusedTrajectoryPoints to SensorFusion --- .../presentation/fragment/CorrectionFragment.java | 15 +++++++++++++++ .../PositionMe/sensors/SensorFusion.java | 14 +++++++++++++- 2 files changed, 28 insertions(+), 1 deletion(-) diff --git a/app/src/main/java/com/openpositioning/PositionMe/presentation/fragment/CorrectionFragment.java b/app/src/main/java/com/openpositioning/PositionMe/presentation/fragment/CorrectionFragment.java index 8f94cb27..61afc8b0 100644 --- a/app/src/main/java/com/openpositioning/PositionMe/presentation/fragment/CorrectionFragment.java +++ b/app/src/main/java/com/openpositioning/PositionMe/presentation/fragment/CorrectionFragment.java @@ -26,6 +26,11 @@ import com.google.android.gms.maps.SupportMapFragment; import com.google.android.gms.maps.model.LatLng; import com.google.android.gms.maps.model.MarkerOptions; +import com.google.android.gms.maps.model.Polyline; +import com.google.android.gms.maps.model.PolylineOptions; +import android.graphics.Color; +import java.util.ArrayList; +import java.util.List; /** * A simple {@link Fragment} subclass. Corrections Fragment is displayed after a recording session @@ -90,6 +95,16 @@ public void onMapReady(GoogleMap map) { double zoom = Math.log(156543.03392f * Math.cos(startPosition[0] * Math.PI / 180) * scalingRatio) / Math.log(2); mMap.moveCamera(CameraUpdateFactory.newLatLngZoom(start, (float) zoom)); + + // Draw the fused trajectory on the correction map. + List fusedPoints = sensorFusion.getFusedTrajectoryPoints(); + if (fusedPoints != null && fusedPoints.size() > 1) { + mMap.addPolyline(new PolylineOptions() + .addAll(fusedPoints) + .color(Color.parseColor("#8B00FF")) // same purple as recording screen + .width(6f)); + } + } }); diff --git a/app/src/main/java/com/openpositioning/PositionMe/sensors/SensorFusion.java b/app/src/main/java/com/openpositioning/PositionMe/sensors/SensorFusion.java index 0c314425..e4e2b5b0 100644 --- a/app/src/main/java/com/openpositioning/PositionMe/sensors/SensorFusion.java +++ b/app/src/main/java/com/openpositioning/PositionMe/sensors/SensorFusion.java @@ -1247,17 +1247,29 @@ public void onError(String message) { * * @return double[]{latitude, longitude}, or null(if filter is not initialized) */ + /** Trajectory points accumulated during a session, used to redraw path on CorrectionFragment. */ + private final List fusedTrajectoryPoints = new ArrayList<>(); + public double[] getFusedLatLon() { boolean ekfReady = useEKF && ekfPositioning != null && ekfPositioning.isInitialized(); boolean pfReady = !useEKF && particleFilter != null && particleFilter.isInitialized(); if ((ekfReady || pfReady) && coordinateConverter != null) { float[] enu = useEKF ? ekfPositioning.getBestEstimate() : particleFilter.getBestEstimate(); - return coordinateConverter.toLatLon(enu[0], enu[1]); + double[] latLon = coordinateConverter.toLatLon(enu[0], enu[1]); + if (fusedTrajectoryPoints.size() < 2000) { + fusedTrajectoryPoints.add(new LatLng(latLon[0], latLon[1])); + } + return latLon; } return null; } + /** Returns accumulated fused trajectory points for display in CorrectionFragment. */ + public List getFusedTrajectoryPoints() { + return fusedTrajectoryPoints; + } + /** Last raw GNSS position. Returns null before first GPS signal. */ public double[] getLastGnssLatLon() { From f0417bdcefecb6198800302d9343fca9d1a1d695 Mon Sep 17 00:00:00 2001 From: Haoning Huang Date: Tue, 31 Mar 2026 19:11:51 +0100 Subject: [PATCH 64/82] =?UTF-8?q?ui:=20update=20trajectory=20map=20layout?= =?UTF-8?q?=20=E2=80=94=20add=20gnssPathSwitch,=20adjust=20switch=20sizes,?= =?UTF-8?q?=20default=20dots=20off?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../res/layout/fragment_trajectory_map.xml | 250 +++++++----------- 1 file changed, 97 insertions(+), 153 deletions(-) diff --git a/app/src/main/res/layout/fragment_trajectory_map.xml b/app/src/main/res/layout/fragment_trajectory_map.xml index f4ec3ebf..575c3bfe 100644 --- a/app/src/main/res/layout/fragment_trajectory_map.xml +++ b/app/src/main/res/layout/fragment_trajectory_map.xml @@ -70,78 +70,129 @@ + + + + + + android:paddingStart="-5dp" + android:drawableStart="@android:drawable/ic_menu_directions" + android:text="GNSS Path"/> + android:id="@+id/smoothingSwitch" + android:layout_width="200dp" + android:orientation="horizontal" + android:gravity="center_vertical" + android:layout_height="20dp" + android:checked="false" + android:paddingStart="-5dp" + android:drawableStart="@android:drawable/ic_menu_directions" + android:text="Smooth Path" /> + android:paddingStart="-5dp" + android:drawableStart="@android:drawable/ic_menu_directions" + android:text="PDR Path" /> - + + + + + + + + + + - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - + + @@ -280,10 +224,6 @@ - - - - + + + + Date: Tue, 31 Mar 2026 19:16:40 +0100 Subject: [PATCH 65/82] =?UTF-8?q?ui:=20update=20TrajectoryMapFragment=20?= =?UTF-8?q?=E2=80=94=20rename=20polylines,=20add=20gnssPathSwitch,=20adjus?= =?UTF-8?q?t=20colors=20and=20defaults?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../fragment/TrajectoryMapFragment.java | 155 +++++++++++++----- 1 file changed, 114 insertions(+), 41 deletions(-) diff --git a/app/src/main/java/com/openpositioning/PositionMe/presentation/fragment/TrajectoryMapFragment.java b/app/src/main/java/com/openpositioning/PositionMe/presentation/fragment/TrajectoryMapFragment.java index b758fcea..9cefe5ff 100644 --- a/app/src/main/java/com/openpositioning/PositionMe/presentation/fragment/TrajectoryMapFragment.java +++ b/app/src/main/java/com/openpositioning/PositionMe/presentation/fragment/TrajectoryMapFragment.java @@ -46,6 +46,7 @@ import android.graphics.Paint; import android.graphics.Rect; import android.graphics.Typeface; +import android.graphics.drawable.Drawable; import com.google.android.gms.maps.model.BitmapDescriptorFactory; import com.google.android.gms.maps.model.MarkerOptions; @@ -53,6 +54,9 @@ import com.google.android.gms.maps.model.Circle; import com.google.android.gms.maps.model.CircleOptions; +import android.content.SharedPreferences; +import androidx.preference.PreferenceManager; + /** * A fragment responsible for displaying a trajectory map using Google Maps. *

@@ -87,10 +91,13 @@ public class TrajectoryMapFragment extends Fragment { private Marker gnssMarker; // GNSS position marker /** Raw (unfiltered) PDR trajectory — drawn in red. */ - private Polyline polyline; // Polyline representing user's movement path + private Polyline pdrPolyline; // Polyline representing user's PDR movement path private boolean isRed = true; // Tracks whether the polyline color is red private boolean isGnssOn = false; // Tracks if GNSS tracking is enabled + /** Whether the blue GNSS trajectory polyline is visible. */ + private boolean showGnssPath = false; + private Polyline gnssPolyline; // Polyline for GNSS path private LatLng lastGnssLocation = null; // Stores the last GNSS location @@ -101,12 +108,13 @@ public class TrajectoryMapFragment extends Fragment { private SensorFusion sensorFusion; private TextView floorLabel; + // Added // /** Raw (unfiltered) PDR trajectory — drawn in red. */ // private Polyline rawPolyline; /** Smoothed trajectory — drawn in purple, visible only when smoothing is ON. */ - private Polyline smoothedPolyline; + private Polyline fusedPolyline; private static final String TAG = "TrajectoryMapFragment"; @@ -131,7 +139,7 @@ public class TrajectoryMapFragment extends Fragment { * Low-pass filter alpha. Range [0,1]. * Lower = smoother but more lag; higher = less smoothing but more responsive. */ - private static final double LOW_PASS_ALPHA = 0.15; + private static final double LOW_PASS_ALPHA = 0.3; // ------------------------------------------------------------------------- // Smoothing state @@ -165,12 +173,13 @@ public class TrajectoryMapFragment extends Fragment { /** Current rolling-window size — updated when user changes the N input. */ // private int maxObservations = DEFAULT_MAX_OBSERVATIONS; - private final int maxObservations = MAX_OBSERVATION_MARKERS; + + private int maxObservations = 5; // Per-source visibility flags (all enabled by default) - private boolean showGnssDots = true; - private boolean showWifiDots = true; - private boolean showPdrDots = true; + private boolean showGnssDots = false; + private boolean showWifiDots = false; + private boolean showPdrDots = false; // Per-source rolling queues of on-map markers private final LinkedList gnssObservationMarkers = new LinkedList<>(); @@ -238,6 +247,8 @@ public class TrajectoryMapFragment extends Fragment { private SwitchMaterial wifiDotSwitch; private SwitchMaterial pdrDotSwitch; + private SwitchMaterial gnssPathSwitch; + // Added // private SwitchMaterial fusedPdrSwitch; private SwitchMaterial showPdrPathSwitch; @@ -308,6 +319,7 @@ public void onViewCreated(@NonNull View view, controlCardContent = view.findViewById(R.id.controlCardContent); switchMapSpinner = view.findViewById(R.id.mapSwitchSpinner); gnssSwitch = view.findViewById(R.id.gnssSwitch); + gnssPathSwitch = view.findViewById(R.id.gnssPathSwitch); autoFloorSwitch = view.findViewById(R.id.autoFloor); smoothingSwitch = view.findViewById(R.id.smoothingSwitch); // fusedPdrSwitch = view.findViewById(R.id.fusedPdrSwitch); @@ -324,6 +336,22 @@ public void onViewCreated(@NonNull View view, floorLabel = view.findViewById(R.id.floorLabel); floorLabel.setText("Floor: -"); + Drawable d1 = gnssPathSwitch.getCompoundDrawablesRelative()[0]; + d1.setTint(Color.BLUE); + + Drawable d2 = smoothingSwitch.getCompoundDrawablesRelative()[0]; + d2.setTint(Color.CYAN); + + Drawable d3 = showPdrPathSwitch.getCompoundDrawablesRelative()[0]; + d3.setTint(Color.RED); + + Drawable d4 = particleCloudSwitch.getCompoundDrawablesRelative()[0]; + d4.setTint(Color.rgb(255,165,0)); // orange + + // Hide particle cloud switch when EKF mode is active + SharedPreferences prefs = PreferenceManager.getDefaultSharedPreferences(requireContext()); + boolean useEkf = prefs.getBoolean("use_ekf", false); + particleCloudSwitch.setVisibility(useEkf ? View.GONE : View.VISIBLE); // Setup floor up/down UI hidden initially until we know there's an indoor map // setFloorControlsVisibility(View.GONE); @@ -412,16 +440,24 @@ public void onMapReady(@NonNull GoogleMap googleMap) { } }); + gnssPathSwitch.setOnCheckedChangeListener((btn, isChecked) -> { + showGnssPath = isChecked; + if (gnssPolyline != null) { + gnssPolyline.setVisible(showGnssPath); + } + Log.d(TAG, "GNSS path visible: " + isChecked); + }); + // Color switch switchColorButton.setOnClickListener(v -> { - if (polyline != null) { + if (pdrPolyline != null) { if (isRed) { switchColorButton.setBackgroundColor(Color.BLACK); - polyline.setColor(Color.BLACK); + fusedPolyline.setColor(Color.BLACK); isRed = false; } else { - switchColorButton.setBackgroundColor(COLOR_PDR); - polyline.setColor(COLOR_PDR); + switchColorButton.setBackgroundColor(Color.RED); + fusedPolyline.setColor(Color.RED); isRed = true; } } @@ -446,8 +482,8 @@ public void onMapReady(@NonNull GoogleMap googleMap) { showPdrPathSwitch.setOnCheckedChangeListener((btn, isChecked) -> { showPdrPath = isChecked; // Immediately show or hide the red PDR polyline - if (polyline != null) { - polyline.setVisible(showPdrPath); + if (pdrPolyline != null) { + pdrPolyline.setVisible(showPdrPath); } Log.d(TAG, "PDR path visible: " + isChecked); }); @@ -504,11 +540,31 @@ public void onMapReady(@NonNull GoogleMap googleMap) { @Override public void onResume() { super.onResume(); + // Read slider value + SharedPreferences prefs = PreferenceManager.getDefaultSharedPreferences(requireContext()); + maxObservations = prefs.getInt("last_observations", 20); + trimObservationQueues(); + + Log.d("TrajectoryMapFragment", "Max observations set to: " + maxObservations); + // Start the 1-second fused trajectory update loop isTrajectoryUpdateRunning = true; trajectoryUpdateHandler.postDelayed(trajectoryUpdateRunnable, 1000); } + private void trimObservationQueues() { + trimQueue(gnssObservationMarkers); + trimQueue(wifiObservationMarkers); + trimQueue(pdrObservationMarkers); + } + + private void trimQueue(LinkedList queue) { + while (queue.size() > maxObservations) { + Marker m = queue.poll(); + if (m != null) m.remove(); + } + } + @Override public void onPause() { super.onPause(); @@ -541,7 +597,7 @@ public void onPause() { */ private Bitmap createNumberedMarkerBitmap(int number) { - int size = 100; // marker size in pixels + int size = 60; // marker size in pixels Bitmap bitmap = Bitmap.createBitmap(size, size, Bitmap.Config.ARGB_8888); Canvas canvas = new Canvas(bitmap); @@ -598,7 +654,7 @@ private void initMapSettings(GoogleMap map) { indoorMapManager = new IndoorMapManager(map); // Raw PDR trajectory — green, matches PDR observation dots - polyline = map.addPolyline(new PolylineOptions() + pdrPolyline = map.addPolyline(new PolylineOptions() .color(COLOR_PDR) .width(5f) .add() @@ -609,17 +665,19 @@ private void initMapSettings(GoogleMap map) { .color(COLOR_GNSS) .width(5f) .add() + .visible(false) + .add() // start empty ); // Fused trajectory — red, matches the arrow marker - smoothedPolyline = map.addPolyline(new PolylineOptions() - .color(Color.RED) + fusedPolyline = map.addPolyline(new PolylineOptions() + .color(Color.parseColor("#8B00FF")) .width(6f) .visible(true)); - // LPF-smoothed fused trajectory — dark red, only visible when smoothing toggle is ON + // LPF-smoothed fused trajectory — only visible when smoothing toggle is ON lpfPolyline = map.addPolyline(new PolylineOptions() - .color(Color.parseColor("#B71C1C")) + .color(Color.parseColor("#00BCD4")) .width(7f) .visible(false)); @@ -827,10 +885,10 @@ public void updateUserLocation(@NonNull LatLng newLocation, float orientation) { // } // Extend polyline if movement occurred - if (oldLocation != null && !oldLocation.equals(newLocation) && polyline != null) { - List points = new ArrayList<>(polyline.getPoints()); + if (oldLocation != null && !oldLocation.equals(newLocation) && pdrPolyline != null) { + List points = new ArrayList<>(pdrPolyline.getPoints()); points.add(newLocation); - polyline.setPoints(points); + pdrPolyline.setPoints(points); } // Added @@ -838,8 +896,8 @@ public void updateUserLocation(@NonNull LatLng newLocation, float orientation) { // LatLng filtered = applyLowPassFilter(newLocation); // if (oldLocation != null && !oldLocation.equals(newLocation)) { // smoothedPoints.add(filtered); -// if (smoothedPolyline != null) { -// smoothedPolyline.setPoints(new ArrayList<>(smoothedPoints)); +// if (fusedPolyline != null) { +// fusedPolyline.setPoints(new ArrayList<>(smoothedPoints)); // } // } @@ -1083,7 +1141,13 @@ public void updateGNSS(@NonNull LatLng gnssLocation) { // lastGnssLocation = gnssLocation; } else { gnssMarker.setPosition(gnssLocation); - if (lastGnssLocation != null && !lastGnssLocation.equals(gnssLocation)) { +// if (lastGnssLocation != null && !lastGnssLocation.equals(gnssLocation)) { +// List gnssPoints = new ArrayList<>(gnssPolyline.getPoints()); +// gnssPoints.add(gnssLocation); +// gnssPolyline.setPoints(gnssPoints); +// } + if (showGnssPath && lastGnssLocation != null + && !lastGnssLocation.equals(gnssLocation)) { List gnssPoints = new ArrayList<>(gnssPolyline.getPoints()); gnssPoints.add(gnssLocation); gnssPolyline.setPoints(gnssPoints); @@ -1092,6 +1156,12 @@ public void updateGNSS(@NonNull LatLng gnssLocation) { } // Always update lastGnssLocation so path builds correctly when gnssSwitch is turned ON mid-session lastGnssLocation = gnssLocation; + + // Blue dot — independent of gnssSwitch, only controlled by gnssDotSwitch + if (showGnssDots && hasMoved(gnssLocation, lastGnssDotPos)) { + addObservationMarker(gnssLocation, COLOR_GNSS, gnssObservationMarkers); + lastGnssDotPos = gnssLocation; + } } /** @@ -1175,6 +1245,9 @@ private LatLng applyLowPassFilter(@NonNull LatLng newPoint) { * Only the teal LPF line is toggled by the smoothing switch. */ private void updatePolylineVisibility() { + if (fusedPolyline != null) { + fusedPolyline.setVisible(!isSmoothingEnabled); + } if (lpfPolyline != null) { lpfPolyline.setVisible(isSmoothingEnabled); } @@ -1297,10 +1370,10 @@ private void clearParticleCloud() { * unnecessary Google Maps redraws.

*/ private void redrawFusedTrajectory() { - if (smoothedPolyline == null || smoothedPoints.isEmpty()) return; + if (fusedPolyline == null || smoothedPoints.isEmpty()) return; if (smoothedPoints.size() == lastDrawnPointCount) return; // nothing new - smoothedPolyline.setPoints(new ArrayList<>(smoothedPoints)); + fusedPolyline.setPoints(new ArrayList<>(smoothedPoints)); lastDrawnPointCount = smoothedPoints.size(); Log.d(TAG, "Fused trajectory redrawn — " + lastDrawnPointCount + " points"); } @@ -1313,8 +1386,8 @@ private void redrawFusedTrajectory() { * Adds a numbered observation dot at the given position for the specified source. * * After adding, ALL markers in the queue are renumbered so that: - * - The oldest dot always shows "1" - * - The newest dot shows the highest number (up to MAX_OBSERVATION_MARKERS) + * - The newest dot always shows "1" + * - The oldest dot shows the highest number (up to MAX_OBSERVATION_MARKERS) * * When the queue is full, the oldest marker is removed before the new one is added. * @@ -1333,7 +1406,7 @@ private void addObservationMarker(@NonNull LatLng position, if (oldest != null) oldest.remove(); } - // Add the new dot — label is overwritten by the renumber loop below + // Add the new dot — starts as number 1 (most recent), others will be renumbered below Marker newDot = gMap.addMarker(new MarkerOptions() .position(position) .icon(BitmapDescriptorFactory.fromBitmap( @@ -1347,14 +1420,14 @@ private void addObservationMarker(@NonNull LatLng position, markerQueue.add(newDot); } - // Renumber all markers: oldest = 1, newest = queue.size() - // The queue is ordered oldest-first (LinkedList), so i=0 is oldest + // Renumber all markers: newest = 1, oldest = queue.size() + // The queue is ordered oldest-first (LinkedList), so we iterate in reverse List markerList = new ArrayList<>(markerQueue); int total = markerList.size(); for (int i = 0; i < total; i++) { Marker m = markerList.get(i); if (m == null) continue; - int recencyNumber = i + 1; // oldest = 1, newest = total + int recencyNumber = total - i; // oldest gets highest number Object tag = m.getTag(); int markerColor = (tag instanceof Integer) ? (int) tag : color; m.setIcon(BitmapDescriptorFactory.fromBitmap( @@ -1382,7 +1455,7 @@ private void setQueueVisibility(@NonNull LinkedList queue, boolean visib * Numbers are updated across the whole queue after each new dot is added. * * @param color fill colour of the dot. - * @param number the sequence label to display (1 = oldest, highest = newest). + * @param number the recency label to display (1 = most recent). * @return a 40×40 px Bitmap with a filled circle and white number. */ private Bitmap createNumberedDotBitmap(int color, int number) { @@ -1443,13 +1516,12 @@ public boolean isGnssEnabled() { private void setFloorControlsVisibility(int visibility) { floorUpButton.setVisibility(visibility); floorDownButton.setVisibility(visibility); - autoFloorSwitch.setVisibility(visibility); } public void clearMapAndReset() { - if (polyline != null) { - polyline.remove(); - polyline = null; + if (pdrPolyline != null) { + pdrPolyline.remove(); + pdrPolyline = null; } if (gnssPolyline != null) { gnssPolyline.remove(); @@ -1487,18 +1559,19 @@ public void clearMapAndReset() { // Re-create empty polylines with your chosen colors if (gMap != null) { - polyline = gMap.addPolyline(new PolylineOptions() + pdrPolyline = gMap.addPolyline(new PolylineOptions() .color(Color.RED) .width(5f) .add()); gnssPolyline = gMap.addPolyline(new PolylineOptions() .color(Color.BLUE) .width(5f) + .visible(showGnssPath) .add()); - smoothedPolyline = gMap.addPolyline(new PolylineOptions() + fusedPolyline = gMap.addPolyline(new PolylineOptions() .color(Color.parseColor("#8B00FF")) .width(6f) - .visible(true)); + .visible(!isSmoothingEnabled)); lpfPolyline = gMap.addPolyline(new PolylineOptions() .color(Color.parseColor("#00BCD4")) .width(7f) From 0097b54c88e830bb4d96604d9fd9ed7c33e24a4c Mon Sep 17 00:00:00 2001 From: Haoning Huang Date: Tue, 31 Mar 2026 19:20:01 +0100 Subject: [PATCH 66/82] ui: show raw fused position on purple path, LPF only on cyan path --- .../presentation/fragment/TrajectoryMapFragment.java | 10 ++++------ 1 file changed, 4 insertions(+), 6 deletions(-) diff --git a/app/src/main/java/com/openpositioning/PositionMe/presentation/fragment/TrajectoryMapFragment.java b/app/src/main/java/com/openpositioning/PositionMe/presentation/fragment/TrajectoryMapFragment.java index 9cefe5ff..f90f7c6a 100644 --- a/app/src/main/java/com/openpositioning/PositionMe/presentation/fragment/TrajectoryMapFragment.java +++ b/app/src/main/java/com/openpositioning/PositionMe/presentation/fragment/TrajectoryMapFragment.java @@ -1006,14 +1006,12 @@ public void updatePdrPosition(@NonNull LatLng pdrLocation) { public void updateFusedPosition(@NonNull LatLng fusedLocation) { if (gMap == null) return; - // Apply LPF to fused position; both polylines share the same filtered point - LatLng lpfFiltered = applyLowPassFilter(fusedLocation); - - // Purple fused path — always grows - smoothedPoints.add(lpfFiltered); + // Raw fused path — always grows (no filter applied here) + smoothedPoints.add(fusedLocation); redrawFusedTrajectory(); - // Teal LPF path — grows but only visible when smoothing toggle is ON + // LPF-smoothed path — grows but only visible when smoothing toggle is ON + LatLng lpfFiltered = applyLowPassFilter(fusedLocation); lpfPoints.add(lpfFiltered); if (lpfPolyline != null) { lpfPolyline.setPoints(new ArrayList<>(lpfPoints)); From 49aa41713bb91f5c8e847fe02ce57ee332e39f7e Mon Sep 17 00:00:00 2001 From: Haoning Huang Date: Tue, 31 Mar 2026 19:31:25 +0100 Subject: [PATCH 67/82] ui: highlight stairs (yellow) and lifts (blue) on indoor map, remove red wall color --- .../PositionMe/utils/IndoorMapManager.java | 10 +++++++++- 1 file changed, 9 insertions(+), 1 deletion(-) diff --git a/app/src/main/java/com/openpositioning/PositionMe/utils/IndoorMapManager.java b/app/src/main/java/com/openpositioning/PositionMe/utils/IndoorMapManager.java index 8e99cb4f..3c30a618 100644 --- a/app/src/main/java/com/openpositioning/PositionMe/utils/IndoorMapManager.java +++ b/app/src/main/java/com/openpositioning/PositionMe/utils/IndoorMapManager.java @@ -734,9 +734,17 @@ private void drawFloor(JSONObject floorGeoJson, String floorKey) throws JSONExce float strokeWidth = 2.0f; if (t.contains("wall")) { - strokeColor = Color.RED; + // Dark stroke (not red) keeps walls visible without dominating the map fillColor = Color.argb(0, 250, 0, 0); strokeWidth = 3.5f; + } else if (t.contains("lift") || t.contains("elevator")) { + strokeColor = Color.BLUE; + fillColor = Color.argb(0, 0, 0, 0); + strokeWidth = 8f; + } else if (t.contains("stair")) { + strokeColor = Color.YELLOW; + fillColor = Color.argb(35, 60, 130, 255); + strokeWidth = 8f; } else if (t.contains("door")) { fillColor = Color.argb(0, 0, 0, 0); strokeWidth = 4.5f; From 0deaf8e1177de156be11b96ec6885ae8965d91ac Mon Sep 17 00:00:00 2001 From: Haoning Huang Date: Tue, 31 Mar 2026 19:34:32 +0100 Subject: [PATCH 68/82] feat: add EKF single-position wall constraint methods (clampToWallEnu, constrainMovementToWalls) --- .../PositionMe/utils/IndoorMapManager.java | 120 ++++++++++++++++++ 1 file changed, 120 insertions(+) diff --git a/app/src/main/java/com/openpositioning/PositionMe/utils/IndoorMapManager.java b/app/src/main/java/com/openpositioning/PositionMe/utils/IndoorMapManager.java index 3c30a618..3a7c7215 100644 --- a/app/src/main/java/com/openpositioning/PositionMe/utils/IndoorMapManager.java +++ b/app/src/main/java/com/openpositioning/PositionMe/utils/IndoorMapManager.java @@ -307,6 +307,126 @@ private boolean segmentsIntersectEnu(float[] p1, float[] p2, float[] p3, float[] // Log.e("IndoorMapManager", "applied wall constraints!"); // // } + + // ------------------------------------------------------------------------- + // EKF single-position wall constraint (added from teammate's map-matching work) + // The particle-filter batch method above is kept unchanged for SensorFusion. + // ------------------------------------------------------------------------- + + private static final float INTERSECTION_EPSILON = 1e-6f; + private static final float RING_CLOSURE_EPSILON = 1e-4f; + private static final float WALL_SNAP_BACK_METERS = 0.05f; + + /** + * Clamps a single EKF position step to wall boundaries using binary search. + * If fromEnu → toEnu crosses a wall, returns the last valid position before the wall. + * + * @param fromEnu float[]{east, north} — previous EKF position (metres) + * @param toEnu float[]{east, north} — new EKF position after predict() + * @return clamped position, or toEnu unchanged if no wall was crossed + */ + public float[] clampToWallEnu(float[] fromEnu, float[] toEnu) { + if (currentVenue == null || currentFloorKey == null) return toEnu; + IndoorVenue.FloorFeatures floor = currentVenue.floorFeatures.get(currentFloorKey); + if (floor == null || floor.wallPolygonsEnu.isEmpty()) return toEnu; + if (!crossesAnyWallEnu(fromEnu, toEnu, floor.wallPolygonsEnu)) return toEnu; + return snapToWallEnu(fromEnu, toEnu, floor.wallPolygonsEnu); + } + + /** + * Constrains a single EKF position step to wall boundaries using precise + * crossing-point detection. Snaps back WALL_SNAP_BACK_METERS before the wall. + * + * @param fromEnu float[]{east, north} — previous position (metres) + * @param toEnu float[]{east, north} — new position after predict() + * @return constrained position, or toEnu unchanged if no wall was crossed + */ + public float[] constrainMovementToWalls(float[] fromEnu, float[] toEnu) { + if (fromEnu == null || toEnu == null) return toEnu; + if (currentVenue == null || currentFloorKey == null) return toEnu; + IndoorVenue.FloorFeatures floorFeatures = currentVenue.floorFeatures.get(currentFloorKey); + if (floorFeatures == null || floorFeatures.wallPolygonsEnu == null + || floorFeatures.wallPolygonsEnu.isEmpty()) return toEnu; + + WallCrossing crossing = findFirstWallCrossing(fromEnu, toEnu, floorFeatures.wallPolygonsEnu); + if (crossing == null) return new float[]{toEnu[0], toEnu[1]}; + return moveToJustBeforeWall(fromEnu, toEnu, crossing.t, WALL_SNAP_BACK_METERS); + } + + private static class WallCrossing { + final float[] crossingPoint; + final int polygonIndex; + final int edgeIndex; + final float t; + + WallCrossing(float[] crossingPoint, int polygonIndex, int edgeIndex, float t) { + this.crossingPoint = crossingPoint; + this.polygonIndex = polygonIndex; + this.edgeIndex = edgeIndex; + this.t = t; + } + } + + private WallCrossing findFirstWallCrossing(float[] from, float[] to, + List> walls) { + double bestT = Double.MAX_VALUE; + WallCrossing best = null; + + for (int pi = 0; pi < walls.size(); pi++) { + List polygon = walls.get(pi); + if (polygon == null || polygon.size() < 2) continue; + int edgeCount = getRingEdgeCount(polygon); + + for (int ei = 0; ei < edgeCount; ei++) { + float[] a = polygon.get(ei); + float[] b = polygon.get((ei + 1) % polygon.size()); + double t = intersectionT(from, to, a, b); + if (t >= 0.0 && t <= 1.0 && t < bestT) { + bestT = t; + float[] cp = new float[]{ + (float)(from[0] + t * (to[0] - from[0])), + (float)(from[1] + t * (to[1] - from[1])) + }; + best = new WallCrossing(cp, pi, ei, (float) t); + } + } + } + return best; + } + + private int getRingEdgeCount(List ring) { + if (ring == null || ring.size() < 2) return 0; + float[] first = ring.get(0); + float[] last = ring.get(ring.size() - 1); + boolean closed = Math.abs(first[0] - last[0]) < RING_CLOSURE_EPSILON + && Math.abs(first[1] - last[1]) < RING_CLOSURE_EPSILON; + return closed ? ring.size() - 1 : ring.size(); + } + + private double intersectionT(float[] p1, float[] p2, float[] p3, float[] p4) { + double rX = p2[0] - p1[0], rY = p2[1] - p1[1]; + double sX = p4[0] - p3[0], sY = p4[1] - p3[1]; + double denom = rX * sY - rY * sX; + if (Math.abs(denom) < INTERSECTION_EPSILON) return -1.0; + double qmpX = p3[0] - p1[0], qmpY = p3[1] - p1[1]; + double t = (qmpX * sY - qmpY * sX) / denom; + double u = (qmpX * rY - qmpY * rX) / denom; + return (t >= 0.0 && t <= 1.0 && u >= 0.0 && u <= 1.0) ? t : -1.0; + } + + private float[] moveToJustBeforeWall(float[] from, float[] to, float hitT, + float snapBackMeters) { + float dx = to[0] - from[0]; + float dy = to[1] - from[1]; + float len = (float) Math.sqrt(dx * dx + dy * dy); + if (len < 1e-6f) return new float[]{from[0], from[1]}; + float backT = snapBackMeters / len; + float safeT = Math.max(0f, hitT - backT); + return new float[]{from[0] + safeT * dx, from[1] + safeT * dy}; + } + + // ------------------------------------------------------------------------- + public void bakeEnuCoordinates(CoordinateConverter converter) { if (currentVenue == null || currentFloorKey == null) return; IndoorVenue.FloorFeatures floor = currentVenue.floorFeatures.get(currentFloorKey); From 2cec6d12ea933d8819e387b397eae6d824e85498 Mon Sep 17 00:00:00 2001 From: Haoning Huang Date: Tue, 31 Mar 2026 19:41:05 +0100 Subject: [PATCH 69/82] =?UTF-8?q?feat:=20add=20floor=20commit=20system=20?= =?UTF-8?q?=E2=80=94=20confirmed=20floor=20baseline,=201500ms=20delay,=20s?= =?UTF-8?q?howFloor,=20commitAutoFloorChange?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../PositionMe/utils/IndoorMapManager.java | 99 +++++++++++++++++-- 1 file changed, 92 insertions(+), 7 deletions(-) diff --git a/app/src/main/java/com/openpositioning/PositionMe/utils/IndoorMapManager.java b/app/src/main/java/com/openpositioning/PositionMe/utils/IndoorMapManager.java index 3a7c7215..a3298e92 100644 --- a/app/src/main/java/com/openpositioning/PositionMe/utils/IndoorMapManager.java +++ b/app/src/main/java/com/openpositioning/PositionMe/utils/IndoorMapManager.java @@ -28,6 +28,8 @@ import java.util.Map; import java.util.HashMap; +import android.os.Handler; +import android.os.Looper; import static java.lang.Math.*; /** * Class used to manage indoor floor map overlays @@ -63,6 +65,17 @@ public class IndoorMapManager { // Stores the currently displayed floor key (e.g., "B1", "G", "1") private String currentFloorKey; + // Confirmed floor — set after a successful auto or manual floor change. + // Used by acceptFloorChange() to measure height delta from a known baseline. + private String confirmedFloorKey = null; + private float confirmedFloorElevation = Float.NaN; + + // Delay before a manual browse (floor up/down button) is committed as confirmed. + // Prevents accidental floor commits when the user taps the button quickly. + private static final long FLOOR_COMMIT_DELAY_MS = 1500; + private final Handler floorCommitHandler = new Handler(Looper.getMainLooper()); + private final Runnable commitBrowsedFloorRunnable = this::commitCurrentDisplayedFloor; + // Map polygon (outline) → venue mapping private final Map polygonToVenue = new HashMap<>(); @@ -642,11 +655,17 @@ public String acceptFloorChange(LatLng correctedLocation, LatLng oldLocation, fl } private String getAdjacentFloorKey(String floorKey, boolean goingUp) { + if (currentVenue == null || currentVenue.rawMapShapes == null) return null; try { - int floor = Integer.parseInt(floorKey); - int next = goingUp ? floor + 1 : floor - 1; - return String.valueOf(next); - } catch (NumberFormatException e) { + JSONObject floorsObj = new JSONObject(currentVenue.rawMapShapes); + List floorKeys = getSortedFloorKeys(floorsObj); + int idx = floorKeys.indexOf(floorKey); + if (idx < 0) return null; + int next = idx + (goingUp ? +1 : -1); + if (next < 0 || next >= floorKeys.size()) return null; + return floorKeys.get(next); + } catch (JSONException e) { + Log.e("IndoorMapManager", "getAdjacentFloorKey failed", e); return null; } } @@ -797,14 +816,16 @@ public void decreaseFloor() { /** - * Switch floor based on direction (+1 or -1) + * Switch floor based on direction (+1 or -1). + * After drawing, schedules a delayed commit so rapid taps don't + * prematurely update the confirmed elevation baseline. */ private void switchFloor(int direction) { if (currentVenue == null || currentVenue.rawMapShapes == null) return; try { JSONObject floorsObj = new JSONObject(currentVenue.rawMapShapes); - List floorKeys = getSortedFloorKeys(floorsObj); // already has all keys + List floorKeys = getSortedFloorKeys(floorsObj); int idx = floorKeys.indexOf(currentFloorKey); if (idx < 0) return; @@ -815,14 +836,78 @@ private void switchFloor(int direction) { clearIndoorFloor(); drawFloor(floorsObj.getJSONObject(currentFloorKey), currentFloorKey); isIndoorMapSet = true; - Log.d("IndoorMapManager", "Switched to floor: " + currentFloorKey); bakeEnuCoordinates(SensorFusion.getInstance().getCoordinateConverter()); + Log.d("IndoorMapManager", "Switched to floor: " + currentFloorKey); + + // Delay before treating this as the confirmed floor baseline + floorCommitHandler.removeCallbacks(commitBrowsedFloorRunnable); + floorCommitHandler.postDelayed(commitBrowsedFloorRunnable, FLOOR_COMMIT_DELAY_MS); } } catch (JSONException e) { Log.e("IndoorMapManager", "Floor switch failed", e); } } + + /** + * Records the currently displayed floor as confirmed and snapshots the + * current barometric elevation as the baseline for future floor-change detection. + */ + private void commitCurrentDisplayedFloor() { + if (currentFloorKey == null) return; + confirmedFloorKey = currentFloorKey; + confirmedFloorElevation = SensorFusion.getInstance().getElevation(); + Log.d("IndoorMapManager", "Confirmed floor: " + confirmedFloorKey + + " at elevation " + confirmedFloorElevation); + } + + /** + * Redraws the map for {@code newFloorKey} and commits it as the confirmed floor. + * Called by acceptFloorChange() after an automatic floor transition is validated. + */ + private void commitAutoFloorChange(String newFloorKey, float elevation) { + currentFloorKey = newFloorKey; + confirmedFloorKey = newFloorKey; + confirmedFloorElevation = elevation; + floorCommitHandler.removeCallbacks(commitBrowsedFloorRunnable); + + try { + JSONObject floorsObj = new JSONObject(currentVenue.rawMapShapes); + clearIndoorFloor(); + drawFloor(floorsObj.getJSONObject(currentFloorKey), currentFloorKey); + isIndoorMapSet = true; + bakeEnuCoordinates(SensorFusion.getInstance().getCoordinateConverter()); + } catch (JSONException e) { + Log.e("IndoorMapManager", "Auto floor redraw failed", e); + } + Log.d("IndoorMapManager", "AUTO confirmed floor: " + confirmedFloorKey + + " at elevation " + confirmedFloorElevation); + } + + /** + * Shows a floor on the map without changing confirmedFloorKey. + * Useful for previewing a floor before the change is validated. + */ + private void showFloor(String floorKey) { + if (currentVenue == null || currentVenue.rawMapShapes == null || floorKey == null) return; + try { + JSONObject floorsObj = new JSONObject(currentVenue.rawMapShapes); + currentFloorKey = floorKey; + clearIndoorFloor(); + drawFloor(floorsObj.getJSONObject(currentFloorKey), currentFloorKey); + isIndoorMapSet = true; + bakeEnuCoordinates(SensorFusion.getInstance().getCoordinateConverter()); + Log.d("IndoorMapManager", "Showing floor: " + currentFloorKey); + } catch (JSONException e) { + Log.e("IndoorMapManager", "Failed to show floor: " + floorKey, e); + } + } + + /** Returns the last confirmed floor key, or null if not yet set. */ + public String getConfirmedFloorKey() { return confirmedFloorKey; } + + /** Returns the barometric elevation recorded when the floor was last confirmed. */ + public float getConfirmedFloorElevation() { return confirmedFloorElevation; } /** * Draw a single floor from GeoJSON FeatureCollection. From 1f3950e4cbb662d5fa506697499fce89eadb2b7c Mon Sep 17 00:00:00 2001 From: Haoning Huang Date: Tue, 31 Mar 2026 19:44:43 +0100 Subject: [PATCH 70/82] =?UTF-8?q?feat:=20upgrade=20acceptFloorChange=20?= =?UTF-8?q?=E2=80=94=20FloorChangeResult,=20debounce,=20transition=20track?= =?UTF-8?q?ing,=20snap=20to=20stairs/lift?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../fragment/TrajectoryMapFragment.java | 13 +- .../PositionMe/utils/IndoorMapManager.java | 197 +++++++++++++++--- 2 files changed, 169 insertions(+), 41 deletions(-) diff --git a/app/src/main/java/com/openpositioning/PositionMe/presentation/fragment/TrajectoryMapFragment.java b/app/src/main/java/com/openpositioning/PositionMe/presentation/fragment/TrajectoryMapFragment.java index f90f7c6a..ab23baf7 100644 --- a/app/src/main/java/com/openpositioning/PositionMe/presentation/fragment/TrajectoryMapFragment.java +++ b/app/src/main/java/com/openpositioning/PositionMe/presentation/fragment/TrajectoryMapFragment.java @@ -838,17 +838,16 @@ public void updateUserLocation(@NonNull LatLng newLocation, float orientation) { // heightChange // ); - String newFloorKey = indoorMapManager.acceptFloorChange( + float currentElevation = sensorFusion != null ? sensorFusion.getElevation() : Float.NaN; + IndoorMapManager.FloorChangeResult floorResult = indoorMapManager.acceptFloorChange( correctedLocation, oldLocation, - heightChange); - String currentFloorKey = indoorMapManager.getCurrentFloorKey(); - if (newFloorKey != null && currentFloorKey != null - && !newFloorKey.equals(currentFloorKey)) { + currentElevation); + if (floorResult.changedFloor) { try { - sensorFusion.onFloorChanged(Integer.parseInt(newFloorKey)); + sensorFusion.onFloorChanged(Integer.parseInt(floorResult.floorKey)); } catch (NumberFormatException e) { - Log.w("TrajectoryMapFragment", "Non-numeric floor key: " + newFloorKey); + Log.w("TrajectoryMapFragment", "Non-numeric floor key: " + floorResult.floorKey); } } } diff --git a/app/src/main/java/com/openpositioning/PositionMe/utils/IndoorMapManager.java b/app/src/main/java/com/openpositioning/PositionMe/utils/IndoorMapManager.java index a3298e92..623ae8e9 100644 --- a/app/src/main/java/com/openpositioning/PositionMe/utils/IndoorMapManager.java +++ b/app/src/main/java/com/openpositioning/PositionMe/utils/IndoorMapManager.java @@ -600,58 +600,187 @@ public LatLng indoorLocationCorrection(LatLng oldLocation, LatLng predictedLocat //corrected position = point //break - public String acceptFloorChange(LatLng correctedLocation, LatLng oldLocation, float heightChangeMeters) { - if (currentVenue == null || currentFloorKey == null || correctedLocation == null || oldLocation == null) { - return currentFloorKey; + // ── Floor-change detection thresholds ──────────────────────────────────── + private static final double HEIGHT_THRESHOLD_METERS = 4.5; + private static final double STAIRS_THRESHOLD_METERS = 12.0; + private static final double LIFT_THRESHOLD_METERS = 10.0; + private static final double LIFT_HORIZONTAL_THRESHOLD_METERS = 1.0; + + // Debounce: ignore floor-change attempts within 5 s of the last one + private long lastFloorChangeTimeMs = 0; + private static final long MIN_FLOOR_CHANGE_INTERVAL_MS = 5000; + + // Floor transition tracking + private static final float FLOOR_STABLE_BAND_METERS = 0.5f; + private static final float FLOOR_TRANSITION_START_THRESHOLD_METERS = 1.0f; + private LatLng floorTransitionStartLocation = null; + private LatLng lastStableFloorLocation = null; + private boolean floorTransitionInProgress = false; + + /** + * Evaluates whether a floor change has occurred. + * + * @param correctedLocation current horizontal position + * @param oldLocation previous horizontal position + * @param currentHeight absolute barometric elevation (metres), from SensorFusion.getElevation() + * @return FloorChangeResult carrying the (possibly new) floor key, + * an optionally snapped destination, and a flag indicating whether the floor changed + */ + public FloorChangeResult acceptFloorChange(LatLng correctedLocation, + LatLng oldLocation, + float currentHeight) { + if (currentVenue == null || currentFloorKey == null + || correctedLocation == null || oldLocation == null) { + return new FloorChangeResult(currentFloorKey, correctedLocation, false, null); } - // Require meaningful vertical movement first - double heightThresholdMeters = 2.5; - if (Math.abs(heightChangeMeters) < heightThresholdMeters) { - return currentFloorKey; + if (confirmedFloorKey == null || Float.isNaN(confirmedFloorElevation)) { + Log.d("MapMatch", "No confirmed floor reference yet"); + return new FloorChangeResult(currentFloorKey, correctedLocation, false, null); } - IndoorVenue.FloorFeatures floorFeatures = currentVenue.floorFeatures.get(currentFloorKey); - if (floorFeatures == null) { - return currentFloorKey; + // Debounce: block rapid successive floor changes + long now = System.currentTimeMillis(); + if (now - lastFloorChangeTimeMs < MIN_FLOOR_CHANGE_INTERVAL_MS) { + Log.d("MapMatch", "Floor change blocked by debounce"); + return new FloorChangeResult(currentFloorKey, correctedLocation, false, null); } - double stairsThresholdMeters = 5.0; - double liftThresholdMeters = 4.0; - double liftHorizontalThresholdMeters = 2.0; + updateFloorTransitionState(correctedLocation, currentHeight); + double horizontalDisplacement = getFloorTransitionHorizontalDisplacement(correctedLocation); - boolean nearStairs = isNearAnyPoint(correctedLocation, floorFeatures.stairsCenters, stairsThresholdMeters); - boolean nearLift = isNearAnyPoint(correctedLocation, floorFeatures.liftCenters, liftThresholdMeters); + float heightChangeMeters = currentHeight - confirmedFloorElevation; + if (Math.abs(heightChangeMeters) < HEIGHT_THRESHOLD_METERS) { + return new FloorChangeResult(currentFloorKey, correctedLocation, false, null); + } - if (!nearStairs && !nearLift) { - return currentFloorKey; + IndoorVenue.FloorFeatures currentFloorFeatures = + currentVenue.floorFeatures.get(confirmedFloorKey); + if (currentFloorFeatures == null) { + return new FloorChangeResult(currentFloorKey, correctedLocation, false, null); } - double horizontalDisplacement = distanceMeters(oldLocation, correctedLocation); + String nextFloorKey = getAdjacentFloorKey(confirmedFloorKey, heightChangeMeters > 0); + Log.d("MapMatch", "confirmed floor: " + confirmedFloorKey + + " candidate next: " + nextFloorKey + + " heightChange=" + heightChangeMeters); - boolean usedLift = nearLift && horizontalDisplacement < liftHorizontalThresholdMeters; - boolean usedStairs = nearStairs && horizontalDisplacement >= liftHorizontalThresholdMeters; - Log.d("MapMatch", "heightChange=" + heightChangeMeters + - ", floor=" + currentFloorKey); - Log.d("MapMatch", "nearStairs=" + nearStairs + - ", nearLift=" + nearLift); - Log.d("MapMatch", "horizontalDisplacement=" + horizontalDisplacement); + if (nextFloorKey == null || !currentVenue.floorFeatures.containsKey(nextFloorKey)) { + return new FloorChangeResult(currentFloorKey, correctedLocation, false, null); + } + + IndoorVenue.FloorFeatures nextFloorFeatures = + currentVenue.floorFeatures.get(nextFloorKey); + if (nextFloorFeatures == null) { + return new FloorChangeResult(currentFloorKey, correctedLocation, false, null); + } + + boolean nearStairs = isNearAnyPoint(correctedLocation, + currentFloorFeatures.stairsCenters, STAIRS_THRESHOLD_METERS); + boolean nearLift = isNearAnyPoint(correctedLocation, + currentFloorFeatures.liftCenters, LIFT_THRESHOLD_METERS); + + boolean usedLift = nearLift && horizontalDisplacement < LIFT_HORIZONTAL_THRESHOLD_METERS; + boolean usedStairs = nearStairs && horizontalDisplacement >= LIFT_HORIZONTAL_THRESHOLD_METERS; + + Log.d("MapMatch", "nearStairs=" + nearStairs + ", nearLift=" + nearLift + + ", horizontalDisplacement=" + horizontalDisplacement + + ", usedLift=" + usedLift + ", usedStairs=" + usedStairs); if (!usedLift && !usedStairs) { - return currentFloorKey; + return new FloorChangeResult(currentFloorKey, correctedLocation, false, null); } - String nextFloorKey = getAdjacentFloorKey(currentFloorKey, heightChangeMeters > 0); - if (nextFloorKey == null || !currentVenue.floorFeatures.containsKey(nextFloorKey)) { - return currentFloorKey; + if (nextFloorKey.equals(confirmedFloorKey)) { + return new FloorChangeResult(currentFloorKey, correctedLocation, false, null); } - if (!nextFloorKey.equals(currentFloorKey)) { - currentFloorKey = nextFloorKey; - boolean goingUp = heightChangeMeters > 0; - switchFloor(goingUp ? +1 : -1); + + // Snap destination to the nearest access point on the new floor + LatLng snappedDestination = correctedLocation; + LatLng highlightCenter = null; + + if (usedLift) { + LatLng nearestLift = getNearestPoint(correctedLocation, nextFloorFeatures.liftCenters); + if (nearestLift != null) { snappedDestination = nearestLift; highlightCenter = nearestLift; } + } else { + LatLng nearestStairs = getNearestPoint(correctedLocation, nextFloorFeatures.stairsCenters); + if (nearestStairs != null) { snappedDestination = nearestStairs; highlightCenter = nearestStairs; } } - return currentFloorKey; + commitAutoFloorChange(nextFloorKey, currentHeight); + lastFloorChangeTimeMs = now; + resetFloorTransitionState(); + showFloor(nextFloorKey); + + Log.d("MapMatch", "Accepted floor change to " + nextFloorKey + + " snapped=" + snappedDestination); + + return new FloorChangeResult(nextFloorKey, snappedDestination, true, highlightCenter); + } + + // ── Floor transition helpers ────────────────────────────────────────────── + + private void updateFloorTransitionState(LatLng currentLocation, float currentHeight) { + if (currentLocation == null || confirmedFloorKey == null + || Float.isNaN(confirmedFloorElevation)) return; + + float absDelta = Math.abs(currentHeight - confirmedFloorElevation); + + if (absDelta < FLOOR_STABLE_BAND_METERS) { + lastStableFloorLocation = currentLocation; + floorTransitionInProgress = false; + floorTransitionStartLocation = null; + return; + } + + if (!floorTransitionInProgress + && absDelta >= FLOOR_TRANSITION_START_THRESHOLD_METERS) { + floorTransitionInProgress = true; + floorTransitionStartLocation = (lastStableFloorLocation != null) + ? lastStableFloorLocation : currentLocation; + Log.d("MapMatch", "Floor transition started at " + floorTransitionStartLocation); + } + } + + private double getFloorTransitionHorizontalDisplacement(LatLng currentLocation) { + if (!floorTransitionInProgress || floorTransitionStartLocation == null + || currentLocation == null) return 0.0; + return distanceMeters(floorTransitionStartLocation, currentLocation); + } + + private void resetFloorTransitionState() { + floorTransitionInProgress = false; + floorTransitionStartLocation = null; + lastStableFloorLocation = null; + } + + private LatLng getNearestPoint(LatLng location, List centers) { + if (location == null || centers == null || centers.isEmpty()) return null; + LatLng nearest = null; + double bestDist = Double.MAX_VALUE; + for (LatLng center : centers) { + double d = distanceMeters(location, center); + if (d < bestDist) { bestDist = d; nearest = center; } + } + return nearest; + } + + // ── FloorChangeResult ───────────────────────────────────────────────────── + + /** Result of an acceptFloorChange() call. */ + public static class FloorChangeResult { + public final String floorKey; + public final LatLng snappedLocation; + public final boolean changedFloor; + public final LatLng highlightCenter; + + public FloorChangeResult(String floorKey, LatLng snappedLocation, + boolean changedFloor, LatLng highlightCenter) { + this.floorKey = floorKey; + this.snappedLocation = snappedLocation; + this.changedFloor = changedFloor; + this.highlightCenter = highlightCenter; + } } private String getAdjacentFloorKey(String floorKey, boolean goingUp) { From 746d4a5f0d2970d3773f729c4b74910facdbfc70 Mon Sep 17 00:00:00 2001 From: Haoning Huang Date: Tue, 31 Mar 2026 20:05:56 +0100 Subject: [PATCH 71/82] fix: init confirmed floor on venue select, connect EKF wall constraint with correct value comparison --- .../PositionMe/sensors/SensorFusion.java | 63 ++++++++++++------- .../PositionMe/utils/IndoorMapManager.java | 3 + 2 files changed, 42 insertions(+), 24 deletions(-) diff --git a/app/src/main/java/com/openpositioning/PositionMe/sensors/SensorFusion.java b/app/src/main/java/com/openpositioning/PositionMe/sensors/SensorFusion.java index e4e2b5b0..7545eb47 100644 --- a/app/src/main/java/com/openpositioning/PositionMe/sensors/SensorFusion.java +++ b/app/src/main/java/com/openpositioning/PositionMe/sensors/SensorFusion.java @@ -593,33 +593,48 @@ public void onSensorChanged(SensorEvent sensorEvent) { // Apply wall constraints after prediction if (coordinateConverter != null && indoorMapManager != null && settings.getBoolean("use_wall_constraints", true)) { - float[] currEast = particleFilter.getParticlesXRef(); - float[] currNorth = particleFilter.getParticlesYRef(); - float[] liveWeights = particleFilter.getWeightsRef(); - float[] prevEast = new float[prevParticles.length]; - float[] prevNorth = new float[prevParticles.length]; + if (useEKF) { + // EKF mode: clamp single position to wall boundary + float[] prevEnu = {prevPdrX, prevPdrY}; + float[] ekfState = ekfPositioning.getBestEstimate(); + float[] clamped = indoorMapManager.constrainMovementToWalls( + prevEnu, ekfState); + // Use value comparison — constrainMovementToWalls always returns + // a new array, so reference equality would always be true. + boolean wallHit = Math.abs(clamped[0] - ekfState[0]) > 1e-4f + || Math.abs(clamped[1] - ekfState[1]) > 1e-4f; + if (wallHit) { + ekfPositioning.resetAroundPosition( + clamped[0], clamped[1], + (float) ekfPositioning.getSigmaMetres()); + Log.d("SensorFusion", "EKF wall clamp applied"); + } + } else { + // Particle filter mode: batch weight penalty per particle + float[] currEast = particleFilter.getParticlesXRef(); + float[] currNorth = particleFilter.getParticlesYRef(); + float[] liveWeights = particleFilter.getWeightsRef(); - for (int i = 0; i < prevParticles.length; i++) { - prevEast[i] = prevParticles[i][0]; - prevNorth[i] = prevParticles[i][1]; - } + float[] prevEast = new float[prevParticles.length]; + float[] prevNorth = new float[prevParticles.length]; - indoorMapManager.applyWallConstraints( - prevEast, - prevNorth, - currEast, - currNorth, - liveWeights, - coordinateConverter - ); - particleFilter.normalizeWeights(); - - Log.d("SensorFusion", "Applied wall constraints to particle cloud"); - float[] bestAfter = particleFilter.getBestEstimate(); - - Log.d("PFDebug", "Best BEFORE constraints: " + bestBefore[0] + ", " + bestBefore[1]); - Log.d("PFDebug", "Best AFTER constraints: " + bestAfter[0] + ", " + bestAfter[1]); + for (int i = 0; i < prevParticles.length; i++) { + prevEast[i] = prevParticles[i][0]; + prevNorth[i] = prevParticles[i][1]; + } + + indoorMapManager.applyWallConstraints( + prevEast, prevNorth, + currEast, currNorth, + liveWeights, coordinateConverter); + particleFilter.normalizeWeights(); + + Log.d("SensorFusion", "PF wall constraints applied"); + float[] bestAfter = particleFilter.getBestEstimate(); + Log.d("PFDebug", "Best BEFORE: " + bestBefore[0] + ", " + bestBefore[1]); + Log.d("PFDebug", "Best AFTER: " + bestAfter[0] + ", " + bestAfter[1]); + } } prevPdrX = newCords[0]; diff --git a/app/src/main/java/com/openpositioning/PositionMe/utils/IndoorMapManager.java b/app/src/main/java/com/openpositioning/PositionMe/utils/IndoorMapManager.java index 623ae8e9..f0a2a5ae 100644 --- a/app/src/main/java/com/openpositioning/PositionMe/utils/IndoorMapManager.java +++ b/app/src/main/java/com/openpositioning/PositionMe/utils/IndoorMapManager.java @@ -187,6 +187,9 @@ public void selectVenue(IndoorVenue venue){ Log.d("IndoorMapManager", "Selected floor: " + currentFloorKey); + // Initialise the confirmed floor baseline so acceptFloorChange() can fire + commitCurrentDisplayedFloor(); + } catch (JSONException e) { Log.e("IndoorMapManager", "Failed parsing floor GeoJSON", e); } From bb7cf6dd8df6f43b9316bad7e6e657fb62a3aa2e Mon Sep 17 00:00:00 2001 From: Bhavyas15 Date: Tue, 31 Mar 2026 23:10:44 +0100 Subject: [PATCH 72/82] Refined code + correction fragment updations --- .../data/remote/ServerCommunications.java | 5 - .../fragment/CorrectionFragment.java | 43 +- .../fragment/RecordingFragment.java | 78 +--- .../fragment/TrajectoryMapFragment.java | 388 ++---------------- .../PositionMe/sensors/SensorFusion.java | 132 +++--- .../PositionMe/utils/PathView.java | 2 +- .../res/layout/fragment_trajectory_map.xml | 76 ++-- app/src/main/res/values/strings.xml | 6 + 8 files changed, 183 insertions(+), 547 deletions(-) diff --git a/app/src/main/java/com/openpositioning/PositionMe/data/remote/ServerCommunications.java b/app/src/main/java/com/openpositioning/PositionMe/data/remote/ServerCommunications.java index d54a0400..e92503c9 100644 --- a/app/src/main/java/com/openpositioning/PositionMe/data/remote/ServerCommunications.java +++ b/app/src/main/java/com/openpositioning/PositionMe/data/remote/ServerCommunications.java @@ -22,7 +22,6 @@ import android.os.Looper; import android.widget.Toast; -import androidx.annotation.NonNull; import androidx.preference.PreferenceManager; import com.google.protobuf.util.JsonFormat; @@ -44,7 +43,6 @@ import java.util.ArrayList; import java.util.Date; import java.util.List; -import java.util.zip.ZipEntry; import java.util.zip.ZipInputStream; import okhttp3.Call; @@ -74,7 +72,6 @@ public class ServerCommunications implements Observable { public static Map downloadRecords = new HashMap<>(); // Application context for handling permissions and devices private final Context context; - // Network status checking private ConnectivityManager connMgr; private boolean isWifiConn; @@ -100,8 +97,6 @@ public class ServerCommunications implements Observable { private static final String PROTOCOL_CONTENT_TYPE = "multipart/form-data"; private static final String PROTOCOL_ACCEPT_TYPE = "application/json"; - - /** * Public default constructor of {@link ServerCommunications}. The constructor saves context, * initialises a {@link ConnectivityManager}, {@link Observer} and gets the user preferences. diff --git a/app/src/main/java/com/openpositioning/PositionMe/presentation/fragment/CorrectionFragment.java b/app/src/main/java/com/openpositioning/PositionMe/presentation/fragment/CorrectionFragment.java index 61afc8b0..a715105d 100644 --- a/app/src/main/java/com/openpositioning/PositionMe/presentation/fragment/CorrectionFragment.java +++ b/app/src/main/java/com/openpositioning/PositionMe/presentation/fragment/CorrectionFragment.java @@ -26,10 +26,8 @@ import com.google.android.gms.maps.SupportMapFragment; import com.google.android.gms.maps.model.LatLng; import com.google.android.gms.maps.model.MarkerOptions; -import com.google.android.gms.maps.model.Polyline; import com.google.android.gms.maps.model.PolylineOptions; import android.graphics.Color; -import java.util.ArrayList; import java.util.List; /** @@ -101,13 +99,11 @@ public void onMapReady(GoogleMap map) { if (fusedPoints != null && fusedPoints.size() > 1) { mMap.addPolyline(new PolylineOptions() .addAll(fusedPoints) - .color(Color.parseColor("#8B00FF")) // same purple as recording screen + .color(Color.RED) // same Red as recording screen .width(6f)); } - } }); - return rootView; } @@ -118,6 +114,7 @@ public void onViewCreated(@NonNull View view, @Nullable Bundle savedInstanceStat this.averageStepLengthText = view.findViewById(R.id.averageStepView); this.stepLengthInput = view.findViewById(R.id.inputStepLength); this.pathView = view.findViewById(R.id.pathView1); +// this.pathView.setTrajectoryColor(Color.GREEN); averageStepLength = sensorFusion.passAverageStepLength(); averageStepLengthText.setText(getString(R.string.averageStepLgn) + ": " @@ -127,12 +124,21 @@ public void onViewCreated(@NonNull View view, @Nullable Bundle savedInstanceStat this.stepLengthInput.setOnKeyListener((v, keyCode, event) -> { if (keyCode == KeyEvent.KEYCODE_ENTER) { newStepLength = Float.parseFloat(changedText.toString()); + float scalingFactor = newStepLength / averageStepLength; // Rescale path - sensorFusion.redrawPath(newStepLength / averageStepLength); + sensorFusion.redrawPath(scalingFactor); + + // Rescale FUSED trajectory + sensorFusion.rescaleFusedTrajectory(scalingFactor); + + averageStepLengthText.setText(getString(R.string.averageStepLgn) + ": " + String.format("%.2f", newStepLength)); pathView.invalidate(); + // Update the fused trajectory on the map + updateFusedTrajectoryOnMap(); + secondPass++; if (secondPass == 2) { averageStepLength = newStepLength; @@ -158,18 +164,29 @@ public void afterTextChanged(Editable s) { this.button.setOnClickListener(new View.OnClickListener() { @Override public void onClick(View view) { - // ************* CHANGED CODE HERE ************* - // Before: - // NavDirections action = CorrectionFragmentDirections.actionCorrectionFragmentToHomeFragment(); - // Navigation.findNavController(view).navigate(action); - // ((AppCompatActivity)getActivity()).getSupportActionBar().show(); - - // Now, simply tell the Activity we are done: ((RecordingActivity) requireActivity()).finishFlow(); } }); } + private void updateFusedTrajectoryOnMap() { + if (mMap != null) { + // Clear the map (removes all polylines and markers) + mMap.clear(); + + // Re-add the start marker + mMap.addMarker(new MarkerOptions().position(start).title("Start Position")); + + // Redraw the fused trajectory with updated points + List fusedPoints = sensorFusion.getFusedTrajectoryPoints(); + if (fusedPoints != null && fusedPoints.size() > 1) { + mMap.addPolyline(new PolylineOptions() + .addAll(fusedPoints) + .color(Color.RED) + .width(6f)); + } + } + } public void setScalingRatio(float scalingRatio) { this.scalingRatio = scalingRatio; } diff --git a/app/src/main/java/com/openpositioning/PositionMe/presentation/fragment/RecordingFragment.java b/app/src/main/java/com/openpositioning/PositionMe/presentation/fragment/RecordingFragment.java index 47b6e68e..f62b3e15 100644 --- a/app/src/main/java/com/openpositioning/PositionMe/presentation/fragment/RecordingFragment.java +++ b/app/src/main/java/com/openpositioning/PositionMe/presentation/fragment/RecordingFragment.java @@ -3,7 +3,6 @@ import android.app.AlertDialog; import android.content.Context; import android.content.SharedPreferences; -import android.graphics.Bitmap; import android.graphics.Color; import android.os.Bundle; import android.os.CountDownTimer; @@ -22,9 +21,6 @@ import android.widget.ProgressBar; import android.widget.TextView; import android.widget.Toast; - -import com.google.android.gms.maps.model.BitmapDescriptorFactory; -import com.google.android.gms.maps.model.MarkerOptions; import com.google.android.material.button.MaterialButton; import androidx.annotation.NonNull; @@ -36,11 +32,9 @@ import com.openpositioning.PositionMe.presentation.activity.RecordingActivity; import com.openpositioning.PositionMe.sensors.SensorFusion; import com.openpositioning.PositionMe.sensors.SensorTypes; -import com.openpositioning.PositionMe.utils.CoordinateConverter; import com.openpositioning.PositionMe.utils.UtilFunctions; import com.google.android.gms.maps.model.LatLng; import java.util.ArrayList; -import java.util.Arrays; import java.util.List; @@ -68,10 +62,8 @@ */ public class RecordingFragment extends Fragment { - private List observedMacs = new ArrayList<>(); private TextView selectedVenueText; - public void updateObservedMacs(@NonNull List macs) { observedMacs = new ArrayList<>(macs); } @@ -79,15 +71,9 @@ public void updateObservedMacs(@NonNull List macs) { private List getObservedMacsOrEmpty() { return observedMacs == null ? new ArrayList<>() : new ArrayList<>(observedMacs); } - /** Throttle WiFi debug toast to once every 5 seconds. */ private long lastWifiToastMs = 0; - - - - - // UI elements private MaterialButton completeButton, cancelButton, markTestPointButton; private ImageView recIcon; @@ -258,7 +244,6 @@ public void onViewCreated(@NonNull View view, } }); - // Cancel button with confirmation dialog cancelButton.setOnClickListener(v -> { AlertDialog dialog = new AlertDialog.Builder(requireActivity()) @@ -275,13 +260,11 @@ public void onViewCreated(@NonNull View view, dialogInterface.dismiss(); }) .create(); // Create the dialog but do not show it yet - // Show the dialog and change the button color dialog.setOnShowListener(dialogInterface -> { Button negativeButton = dialog.getButton(AlertDialog.BUTTON_NEGATIVE); negativeButton.setTextColor(Color.RED); // Set "Yes" button color to red }); - dialog.show(); // Finally, show the dialog }); @@ -408,79 +391,20 @@ private void updateUIandPosition() { Log.d("RecordingFragment", "passing macs size=" + macs.size()); mapFrag.updateObservedMacs(macs); -// trajectoryMapFragment.updateObservedMacs(sensorFusion.getLatestBssids()); mapFrag.updateUserLocation(newLocation, (float) Math.toDegrees(sensorFusion.passOrientation())); -// Added- must be updated to - // --- WiFi position → amber dot --- -// Remove -// LatLng wifiLocation = sensorFusion.getLatLngWifiPositioning(); -// if (wifiLocation != null -// && wifiLocation.latitude != 0.0 -// && wifiLocation.longitude != 0.0) { -// mapFrag.updateWifiPosition(wifiLocation); -// } // Drive the arrow marker and fused trajectory polyline mapFrag.updateFusedPosition(new LatLng(fused[0], fused[1])); - // Amber WiFi observation dot — raw WiFi fix from OpenPositioning API -// double[] wifi = sensorFusion.getLastWifiLatLon(); -// if (wifi != null) { -// mapFrag.updateWifiPosition(new LatLng(wifi[0], wifi[1])); -// } double[] wifi = sensorFusion.getLastWifiLatLon(); if (wifi != null) { mapFrag.updateWifiPosition(new LatLng(wifi[0], wifi[1])); } - // Green PDR observation dot — raw PDR position from step counting -// double[] pdr = sensorFusion.getLastPdrLatLon(); -// if (pdr != null) { -// mapFrag.updatePdrPosition(new LatLng(pdr[0], pdr[1])); -// } - - // Green PDR observation dot mapFrag.updatePdrPosition(newLocation); } } - // GNSS logic if you want to show GNSS error, etc. -// float[] gnss = sensorFusion.getSensorValueMap().get(SensorTypes.GNSSLATLONG); -// if (gnss != null && trajectoryMapFragment != null) { -// // If user toggles showing GNSS in the map, call e.g. -// if (trajectoryMapFragment.isGnssEnabled()) { -// LatLng gnssLocation = new LatLng(gnss[0], gnss[1]); -// LatLng currentLoc = trajectoryMapFragment.getCurrentLocation(); -// if (currentLoc != null) { -// double errorDist = UtilFunctions.distanceBetweenPoints(currentLoc, gnssLocation); -// gnssError.setVisibility(View.VISIBLE); -// gnssError.setText(String.format(getString(R.string.gnss_error) + "%.2fm", errorDist)); -// } -// trajectoryMapFragment.updateGNSS(gnssLocation); -// } else { -// gnssError.setVisibility(View.GONE); -// trajectoryMapFragment.clearGNSS(); -// } -// } - -// changed to- -// double[] gnssRaw = sensorFusion.getLastGnssLatLon(); -// if (gnssRaw != null && trajectoryMapFragment != null) { -// if (trajectoryMapFragment.isGnssEnabled()) { -// LatLng gnssLocation = new LatLng(gnssRaw[0], gnssRaw[1]); -// LatLng currentLoc = trajectoryMapFragment.getCurrentLocation(); -// if (currentLoc != null) { -// double errorDist = UtilFunctions.distanceBetweenPoints(currentLoc, gnssLocation); -// gnssError.setVisibility(View.VISIBLE); -// gnssError.setText(String.format(getString(R.string.gnss_error) + "%.2fm", errorDist)); -// } -// trajectoryMapFragment.updateGNSS(gnssLocation); -// } else { -// gnssError.setVisibility(View.GONE); -// trajectoryMapFragment.clearGNSS(); -// } -// } -// changed to- double[] gnssRaw = sensorFusion.getLastGnssLatLon(); if (gnssRaw != null && trajectoryMapFragment != null) { LatLng gnssLocation = new LatLng(gnssRaw[0], gnssRaw[1]); @@ -513,7 +437,7 @@ private void updateUIandPosition() { previousPosX = pdrValues[0]; previousPosY = pdrValues[1]; - // Update live data counts - track actual recorded data + // Update live data counts - track actual recorded data if (sensorFusion != null && sensorFusion.getTrajectory() != null) { try { // WiFi fingerprints (actual recorded) diff --git a/app/src/main/java/com/openpositioning/PositionMe/presentation/fragment/TrajectoryMapFragment.java b/app/src/main/java/com/openpositioning/PositionMe/presentation/fragment/TrajectoryMapFragment.java index ab23baf7..31ef1d01 100644 --- a/app/src/main/java/com/openpositioning/PositionMe/presentation/fragment/TrajectoryMapFragment.java +++ b/app/src/main/java/com/openpositioning/PositionMe/presentation/fragment/TrajectoryMapFragment.java @@ -2,7 +2,6 @@ import android.graphics.Color; import android.os.Bundle; -import android.os.Handler; import android.util.Log; import android.view.LayoutInflater; import android.view.View; @@ -42,7 +41,6 @@ import android.graphics.Bitmap; import android.graphics.Canvas; -import android.graphics.Color; import android.graphics.Paint; import android.graphics.Rect; import android.graphics.Typeface; @@ -79,113 +77,52 @@ */ //request nearby indoor maps - //draw venue polygons - //handle venue click +// draw venue polygons +//handle venue click public class TrajectoryMapFragment extends Fragment { - private static final boolean USE_MOCK_FLOORPLAN = true; private GoogleMap gMap; // Google Maps instance private LatLng currentLocation; // Stores the user's current location private Marker orientationMarker; // Marker representing user's heading private Marker gnssMarker; // GNSS position marker - - /** Raw (unfiltered) PDR trajectory — drawn in red. */ private Polyline pdrPolyline; // Polyline representing user's PDR movement path + private Polyline gnssPolyline; // Polyline for GNSS path + private Polyline fusedPolyline; // best estimated position - Red initially, can be changed to black + private Polyline lpfPolyline; // LPF-smoothed fused trajectory — teal, visible only when smoothing toggle is O private boolean isRed = true; // Tracks whether the polyline color is red private boolean isGnssOn = false; // Tracks if GNSS tracking is enabled - - /** Whether the blue GNSS trajectory polyline is visible. */ - private boolean showGnssPath = false; - - private Polyline gnssPolyline; // Polyline for GNSS path + private boolean showGnssPath = false; // Controls visibility of GNSS path (blue) private LatLng lastGnssLocation = null; // Stores the last GNSS location - private LatLng pendingCameraPosition = null; // Stores pending camera movement private boolean hasPendingCameraMove = false; // Tracks if camera needs to move - private IndoorMapManager indoorMapManager; // Manages indoor mapping private SensorFusion sensorFusion; private TextView floorLabel; - - - // Added -// /** Raw (unfiltered) PDR trajectory — drawn in red. */ -// private Polyline rawPolyline; - - /** Smoothed trajectory — drawn in purple, visible only when smoothing is ON. */ - private Polyline fusedPolyline; - private static final String TAG = "TrajectoryMapFragment"; - - /** - * Minimum distance in metres a position must move before a new dot is placed. - * Prevents dots stacking on each other when the user is stationary. - */ - private static final float MIN_DOT_SPACING_METRES = 2.0f; - - /** Number of recent observations kept per source for colour-coded dots. */ - private static final int MAX_OBSERVATION_MARKERS = 500; - - - /** Default rolling-window size for observation dots. */ - private static final int DEFAULT_MAX_OBSERVATIONS = 5; - + private static final float MIN_DOT_SPACING_METRES = 2.0f; // Minimum distance in metres a position must move before a new dot is placed // Dot fill colours - private static final int COLOR_GNSS = Color.parseColor("#2196F3"); // blue + private static final int COLOR_GNSS = Color.parseColor("#215AF6"); // blue private static final int COLOR_WIFI = Color.parseColor("#FF9800"); // amber - private static final int COLOR_PDR = Color.parseColor("#4CAF50"); // green - /** - * Low-pass filter alpha. Range [0,1]. - * Lower = smoother but more lag; higher = less smoothing but more responsive. - */ - private static final double LOW_PASS_ALPHA = 0.3; - - // ------------------------------------------------------------------------- - // Smoothing state - // ------------------------------------------------------------------------- - - /** Whether the smoothed (purple) polyline is currently shown instead of raw. */ - private boolean isSmoothingEnabled = false; - - /** Running smoothed position for the low-pass filter. */ - private LatLng smoothedPosition = null; - - /** Full list of smoothed positions (mirrors rawPolyline but filtered). */ - private final List smoothedPoints = new ArrayList<>(); - -// // ------------------------------------------------------------------------- -// // Colour-coded observation markers (last N per source) -// // ------------------------------------------------------------------------- -// -// /** Circular buffer of recent GNSS observation markers (shown in blue). */ -// private final Queue gnssObservationMarkers = new LinkedList<>(); -// -// /** Circular buffer of recent WiFi observation markers (shown in orange/amber). */ -// private final Queue wifiObservationMarkers = new LinkedList<>(); -// -// /** Circular buffer of recent PDR observation markers (shown in green). */ -// private final Queue pdrObservationMarkers = new LinkedList<>(); - - // ------------------------------------------------------------------------- - // Observation dot state - // ------------------------------------------------------------------------- - - /** Current rolling-window size — updated when user changes the N input. */ -// private int maxObservations = DEFAULT_MAX_OBSERVATIONS; + private static final int COLOR_PDR = Color.parseColor("#BBF060"); // green + private static final double LOW_PASS_ALPHA = 0.2; // Range- [0.1] ;Lower = smoother but more lag; higher = less smoothing but more responsive + private boolean isSmoothingEnabled = false; // toggle for lpf filter on best estimate + private LatLng smoothedPosition = null; // Running smoothed position for the low-pass filter. + private int defaultObservations = 5; - private int maxObservations = 5; - - // Per-source visibility flags (all enabled by default) + // Per-source visibility flags (all disabled by default) private boolean showGnssDots = false; private boolean showWifiDots = false; private boolean showPdrDots = false; + private boolean showPdrPath = true; // Control visibility of raw PDR trajectory + + private final List smoothedPoints = new ArrayList<>(); // Full list of smoothed positions (mirrors fusedPolyline but filtered) + private final List lpfPoints = new ArrayList<>(); // Full list of LPF-smoothed fused positions // Per-source rolling queues of on-map markers private final LinkedList gnssObservationMarkers = new LinkedList<>(); private final LinkedList wifiObservationMarkers = new LinkedList<>(); private final LinkedList pdrObservationMarkers = new LinkedList<>(); - /** * Position where the most recent dot was placed for each source. * Used by {@link #hasMoved} to enforce the minimum spacing threshold. @@ -194,21 +131,6 @@ public class TrajectoryMapFragment extends Fragment { private LatLng lastWifiDotPos = null; private LatLng lastPdrDotPos = null; - /** If true, the arrow marker follows the fused (particle filter) position. - * If false, it follows the raw PDR position. - * Controlled by the fusedPdrSwitch toggle. */ -// private boolean useFusedPosition = true; - - /** If true, the raw PDR trajectory (red line) is visible. - * Controlled by showPdrPathSwitch. Arrow marker always follows fused position. */ - private boolean showPdrPath = true; - - /** LPF-smoothed fused trajectory — teal, visible only when smoothing toggle is ON. */ - private Polyline lpfPolyline; - - /** Full list of LPF-smoothed fused positions. */ - private final List lpfPoints = new ArrayList<>(); - /** Semi-transparent uncertainty circle around the fused position marker. * Radius = getPositionUncertainty(). Colour reflects confidence level. */ private Circle uncertaintyCircle; @@ -227,31 +149,30 @@ public class TrajectoryMapFragment extends Fragment { /** Most recent device heading in degrees, from passOrientation(). */ private float lastOrientation = 0f; - - private float lastElevation = Float.NaN; //To compute height change between old and current position - - // UI private Spinner switchMapSpinner; private SwitchMaterial gnssSwitch; private SwitchMaterial autoFloorSwitch; - - // Added private SwitchMaterial smoothingSwitch; - private SwitchMaterial gnssDotSwitch; private SwitchMaterial wifiDotSwitch; private SwitchMaterial pdrDotSwitch; - private SwitchMaterial gnssPathSwitch; + private SwitchMaterial showPdrPathSwitch; + private com.google.android.material.floatingactionbutton.FloatingActionButton floorUpButton, floorDownButton; + private Button switchColorButton; + private Polygon buildingPolygon; + private FloorPlanData floorplanRemote; + private long lastVenueQueryMs = 0; + private LatLng lastVenueQueryLoc = null; + private final Object macLock = new Object(); + private List observedMacs = new ArrayList<>(); + private SwitchMaterial particleCloudSwitch; -// Added -// private SwitchMaterial fusedPdrSwitch; -private SwitchMaterial showPdrPathSwitch; // ── Fused trajectory display ────────────────────────────────────────────── /** Handler that drives the 1-second periodic polyline redraw. */ @@ -279,24 +200,6 @@ public void run() { } }; - private com.google.android.material.floatingactionbutton.FloatingActionButton floorUpButton, floorDownButton; - private Button switchColorButton; - private Polygon buildingPolygon; - - private List selectedVenue; -// private IndoorMapManager.IndoorFloor selectedFloor; - private FloorPlanData floorplanRemote; - private long lastVenueQueryMs = 0; - private LatLng lastVenueQueryLoc = null; - - private final Object macLock = new Object(); - private List observedMacs = new ArrayList<>(); - - // cache venues if they arrive before map/manager is ready (optional) - private List lastFetchedVenues = null; - - private SwitchMaterial particleCloudSwitch; - public TrajectoryMapFragment() { // Required empty public constructor } @@ -322,7 +225,6 @@ public void onViewCreated(@NonNull View view, gnssPathSwitch = view.findViewById(R.id.gnssPathSwitch); autoFloorSwitch = view.findViewById(R.id.autoFloor); smoothingSwitch = view.findViewById(R.id.smoothingSwitch); -// fusedPdrSwitch = view.findViewById(R.id.fusedPdrSwitch); showPdrPathSwitch = view.findViewById(R.id.fusedPdrSwitch); particleCloudSwitch = view.findViewById(R.id.particleCloudSwitch); gnssDotSwitch = view.findViewById(R.id.gnssDotSwitch); @@ -338,13 +240,10 @@ public void onViewCreated(@NonNull View view, Drawable d1 = gnssPathSwitch.getCompoundDrawablesRelative()[0]; d1.setTint(Color.BLUE); - Drawable d2 = smoothingSwitch.getCompoundDrawablesRelative()[0]; d2.setTint(Color.CYAN); - Drawable d3 = showPdrPathSwitch.getCompoundDrawablesRelative()[0]; d3.setTint(Color.RED); - Drawable d4 = particleCloudSwitch.getCompoundDrawablesRelative()[0]; d4.setTint(Color.rgb(255,165,0)); // orange @@ -353,9 +252,6 @@ public void onViewCreated(@NonNull View view, boolean useEkf = prefs.getBoolean("use_ekf", false); particleCloudSwitch.setVisibility(useEkf ? View.GONE : View.VISIBLE); - // Setup floor up/down UI hidden initially until we know there's an indoor map -// setFloorControlsVisibility(View.GONE); - // Initialize the map asynchronously SupportMapFragment mapFragment = (SupportMapFragment) getChildFragmentManager().findFragmentById(R.id.trajectoryMap); @@ -377,7 +273,7 @@ public void onMapReady(@NonNull GoogleMap googleMap) { pendingCameraPosition = null; } -// drawBuildingPolygon(); + // drawBuildingPolygon(); indoorMapManager = new IndoorMapManager(gMap); sensorFusion = SensorFusion.getInstance(); sensorFusion.setIndoorMapManager(indoorMapManager); @@ -411,10 +307,7 @@ public void onMapReady(@NonNull GoogleMap googleMap) { } }); - Log.d("TrajectoryMapFragment", "onMapReady: Map is ready!"); - - } }); } @@ -474,11 +367,6 @@ public void onMapReady(@NonNull GoogleMap googleMap) { Log.d(TAG, "Smoothing toggled: " + isChecked); }); -// fusedPdrSwitch.setOnCheckedChangeListener((btn, isChecked) -> { -// useFusedPosition = isChecked; -// Log.d(TAG, "Position mode: " + (isChecked ? "Fused" : "PDR")); -// }); - showPdrPathSwitch.setOnCheckedChangeListener((btn, isChecked) -> { showPdrPath = isChecked; // Immediately show or hide the red PDR polyline @@ -520,9 +408,7 @@ public void onMapReady(@NonNull GoogleMap googleMap) { indoorMapManager.increaseFloor(); String fk = indoorMapManager.getCurrentFloorKey(); if (floorLabel != null) floorLabel.setText("Floor: " + (fk == null ? "-" : fk)); - } - }); floorDownButton.setOnClickListener(v -> { @@ -533,7 +419,6 @@ public void onMapReady(@NonNull GoogleMap googleMap) { if (floorLabel != null) floorLabel.setText("Floor: " + (fk == null ? "-" : fk)); } - }); } @@ -542,16 +427,17 @@ public void onResume() { super.onResume(); // Read slider value SharedPreferences prefs = PreferenceManager.getDefaultSharedPreferences(requireContext()); - maxObservations = prefs.getInt("last_observations", 20); + defaultObservations = prefs.getInt("last_observations", 20); trimObservationQueues(); - Log.d("TrajectoryMapFragment", "Max observations set to: " + maxObservations); + Log.d("TrajectoryMapFragment", "Max observations set to: " + defaultObservations); // Start the 1-second fused trajectory update loop isTrajectoryUpdateRunning = true; trajectoryUpdateHandler.postDelayed(trajectoryUpdateRunnable, 1000); } + //If more number of markers present, and we suddenly reduce the number of GNSS, PDR, Wifi dots on screen, remove excess private void trimObservationQueues() { trimQueue(gnssObservationMarkers); trimQueue(wifiObservationMarkers); @@ -559,7 +445,7 @@ private void trimObservationQueues() { } private void trimQueue(LinkedList queue) { - while (queue.size() > maxObservations) { + while (queue.size() > defaultObservations) { Marker m = queue.poll(); if (m != null) m.remove(); } @@ -573,7 +459,6 @@ public void onPause() { trajectoryUpdateHandler.removeCallbacks(trajectoryUpdateRunnable); } - /** * Initialize the map settings with the provided GoogleMap instance. *

@@ -641,7 +526,6 @@ public void addTestPointMarker(LatLng latLng, int number) { gMap.addMarker(markerOptions); } - private void initMapSettings(GoogleMap map) { // Basic map settings map.getUiSettings().setCompassEnabled(true); @@ -671,13 +555,13 @@ private void initMapSettings(GoogleMap map) { // Fused trajectory — red, matches the arrow marker fusedPolyline = map.addPolyline(new PolylineOptions() - .color(Color.parseColor("#8B00FF")) + .color(Color.RED) .width(6f) .visible(true)); // LPF-smoothed fused trajectory — only visible when smoothing toggle is ON lpfPolyline = map.addPolyline(new PolylineOptions() - .color(Color.parseColor("#00BCD4")) + .color(Color.parseColor("#21f6eb")) // cyan .width(7f) .visible(false)); @@ -703,7 +587,6 @@ private void maybeRequestNearbyVenues(@NonNull LatLng loc) { lastVenueQueryMs = now; lastVenueQueryLoc = loc; - List macs = getObservedMacsOrEmpty(); Log.d("TrajectoryMapFragment", "maybeRequestNearbyVenues instance=" + System.identityHashCode(this) + " observedMacs=" + macs.size()); @@ -712,7 +595,6 @@ private void maybeRequestNearbyVenues(@NonNull LatLng loc) { Log.d("TrajectoryMapFragment", "Skipping floorplan request: no MACs yet"); return; } - Log.d("TrajectoryMapFragment", "Floorplan request @ " + loc.latitude + "," + loc.longitude + " macs=" + macs.size()); if (floorplanRemote == null) { @@ -736,8 +618,6 @@ private void maybeRequestNearbyVenues(@NonNull LatLng loc) { }); } - - @Override public void onError(Exception e) { Log.d("TrajectoryMapFragment", "floorplan request failed", e); } @@ -745,8 +625,6 @@ private void maybeRequestNearbyVenues(@NonNull LatLng loc) { ); } - - /** * Initialize the map type spinner with the available map types. *

@@ -821,22 +699,14 @@ public void updateUserLocation(@NonNull LatLng newLocation, float orientation) { if (sensorFusion != null) { float currentElevation = sensorFusion.getElevation(); - - if (!Float.isNaN(lastElevation)) { heightChange = currentElevation - lastElevation; } - lastElevation = currentElevation; } if (oldLocation != null && indoorMapManager != null) { -// correctedLocation = indoorMapManager.indoorLocationCorrection( -// oldLocation, -// newLocation, -// heightChange -// ); float currentElevation = sensorFusion != null ? sensorFusion.getElevation() : Float.NaN; IndoorMapManager.FloorChangeResult floorResult = indoorMapManager.acceptFloorChange( @@ -858,31 +728,6 @@ public void updateUserLocation(@NonNull LatLng newLocation, float orientation) { Log.d("IndoorTest", "newLocation = " + newLocation); Log.d("IndoorTest", "heightChange = " + heightChange); -// if indoor map is active and current venue is known: -// send oldLocation, newLocation, current floor, and maybe barometer info to IndoorMapManager -// get back corrected position/floor -// then update marker/polyline using that corrected result - - - // If no marker, create it -// if (orientationMarker == null) { -// orientationMarker = gMap.addMarker(new MarkerOptions() -// .position(newLocation) -// .flat(true) -// .title("Current Position") -// .icon(BitmapDescriptorFactory.fromBitmap( -// UtilFunctions.getBitmapFromVector(requireContext(), -// R.drawable.ic_baseline_navigation_24))) -// ); -// gMap.moveCamera(CameraUpdateFactory.newLatLngZoom(newLocation, 19f)); -// } else { -// // Update marker position + orientation -// orientationMarker.setPosition(newLocation); -// orientationMarker.setRotation(orientation); -// // Move camera a bit -// gMap.moveCamera(CameraUpdateFactory.newLatLng(newLocation)); -// } - // Extend polyline if movement occurred if (oldLocation != null && !oldLocation.equals(newLocation) && pdrPolyline != null) { List points = new ArrayList<>(pdrPolyline.getPoints()); @@ -890,33 +735,6 @@ public void updateUserLocation(@NonNull LatLng newLocation, float orientation) { pdrPolyline.setPoints(points); } - // Added - // --- Compute and extend smoothed polyline --- -// LatLng filtered = applyLowPassFilter(newLocation); -// if (oldLocation != null && !oldLocation.equals(newLocation)) { -// smoothedPoints.add(filtered); -// if (fusedPolyline != null) { -// fusedPolyline.setPoints(new ArrayList<>(smoothedPoints)); -// } -// } - -// changed to- - // Extend smoothed polyline and trigger immediate fused trajectory redraw -// LatLng filtered = applyLowPassFilter(newLocation); -// if (oldLocation != null && !oldLocation.equals(newLocation)) { -// smoothedPoints.add(filtered); -// // Movement detected — redraw immediately rather than waiting for the 1s timer -// redrawFusedTrajectory(); -// } - - - // Green PDR dot — only when moved enough -// if (showPdrDots && hasMoved(newLocation, lastPdrDotPos)) { -// addObservationMarker(newLocation, COLOR_PDR, pdrObservationMarkers); -// lastPdrDotPos = newLocation; -// } - - // Update indoor map overlay if (indoorMapManager != null) { indoorMapManager.setCurrentLocation(newLocation); @@ -926,8 +744,6 @@ public void updateUserLocation(@NonNull LatLng newLocation, float orientation) { // call api if (floorplanRemote != null) { maybeRequestNearbyVenues(newLocation); -// IndoorMapManager IMMM = new IndoorMapManager(); -// IMMM.initializeFloorFromLocation(newLocation); } } @@ -947,57 +763,10 @@ public void updatePdrPosition(@NonNull LatLng pdrLocation) { } } - /** - * Updates the arrow marker and both fused trajectory polylines. - * - * - Purple line: raw particle filter output, always visible - * - Teal line: LPF applied on top of fused output, toggle-controlled - * - * @param fusedLocation best position estimate from the particle filter. - */ -// public void updateFusedPosition(@NonNull LatLng fusedLocation) { -// if (gMap == null) return; -// -// // Raw fused path — purple, always grows -// smoothedPoints.add(fusedLocation); -// redrawFusedTrajectory(); -// -// // Update uncertainty circle around the fused marker -// updateUncertaintyCircle(fusedLocation); -// -// // Redraw particle cloud overlay (throttled to every 2s) -// redrawParticleCloud(); -// -// // LPF-smoothed fused path — teal, grows but only visible when toggle is ON -// LatLng lpfFiltered = applyLowPassFilter(fusedLocation); -// lpfPoints.add(lpfFiltered); -// if (lpfPolyline != null) { -// lpfPolyline.setPoints(new ArrayList<>(lpfPoints)); -// } -// -// // Move arrow marker if fused mode is selected -// if (!useFusedPosition) return; -// -// if (orientationMarker == null) { -// orientationMarker = gMap.addMarker(new MarkerOptions() -// .position(fusedLocation) -// .flat(true) -// .title("Current Position") -// .icon(BitmapDescriptorFactory.fromBitmap( -// UtilFunctions.getBitmapFromVector(requireContext(), -// R.drawable.ic_baseline_navigation_24)))); -// gMap.moveCamera(CameraUpdateFactory.newLatLngZoom(fusedLocation, 19f)); -// } else { -// orientationMarker.setPosition(fusedLocation); -// gMap.moveCamera(CameraUpdateFactory.newLatLng(fusedLocation)); -// } -// } - /** * Updates the arrow marker using the particle filter's fused position. - * The arrow ALWAYS follows the fused position — there is no toggle for this. * - * Also grows the purple fused trajectory polyline and the teal LPF polyline, + * Also grows the red fused trajectory polyline and the cyan LPF polyline, * and updates the uncertainty circle. * * @param fusedLocation best position estimate from the particle filter. @@ -1033,9 +802,7 @@ public void updateFusedPosition(@NonNull LatLng fusedLocation) { R.drawable.ic_baseline_navigation_24)))); gMap.moveCamera(CameraUpdateFactory.newLatLngZoom(fusedLocation, 19f)); } else { - orientationMarker.setPosition(fusedLocation); -// Added orientationMarker.setRotation(lastOrientation); gMap.moveCamera(CameraUpdateFactory.newLatLng(fusedLocation)); } @@ -1062,7 +829,6 @@ public void setInitialCameraPosition(@NonNull LatLng startLocation) { } } - /** * Get the current user location on the map. * @return The current user location as a LatLng object. @@ -1071,42 +837,6 @@ public LatLng getCurrentLocation() { return currentLocation; } - /** - * Called when we want to set or update the GNSS marker position - */ -// public void updateGNSS(@NonNull LatLng gnssLocation) { -// if (gMap == null) return; -// if (!isGnssOn) return; -// -// if (gnssMarker == null) { -// // Create the GNSS marker for the first time -// gnssMarker = gMap.addMarker(new MarkerOptions() -// .position(gnssLocation) -// .title("GNSS Position") -// .icon(BitmapDescriptorFactory -// .defaultMarker(BitmapDescriptorFactory.HUE_AZURE))); -// lastGnssLocation = gnssLocation; -// } else { -// // Move existing GNSS marker -// gnssMarker.setPosition(gnssLocation); -// -// // Add a segment to the blue GNSS line, if this is a new location -// if (lastGnssLocation != null && !lastGnssLocation.equals(gnssLocation)) { -// List gnssPoints = new ArrayList<>(gnssPolyline.getPoints()); -// gnssPoints.add(gnssLocation); -// gnssPolyline.setPoints(gnssPoints); -// } -// lastGnssLocation = gnssLocation; -// } -// -// // Blue GNSS dot — only when moved enough -// if (showGnssDots && hasMoved(gnssLocation, lastGnssDotPos)) { -// addObservationMarker(gnssLocation, COLOR_GNSS, gnssObservationMarkers); -// lastGnssDotPos = gnssLocation; -// } -// -// } - /** * Updates the GNSS marker and polyline, and places a blue GNSS observation dot. * @@ -1125,8 +855,6 @@ public void updateGNSS(@NonNull LatLng gnssLocation) { lastGnssDotPos = gnssLocation; } - if (!isGnssOn) return; - // GNSS marker and path line — only when GNSS switch is ON if (isGnssOn) { if (gnssMarker == null) { @@ -1135,14 +863,8 @@ public void updateGNSS(@NonNull LatLng gnssLocation) { .title("GNSS Position") .icon(BitmapDescriptorFactory .defaultMarker(BitmapDescriptorFactory.HUE_AZURE))); -// lastGnssLocation = gnssLocation; } else { gnssMarker.setPosition(gnssLocation); -// if (lastGnssLocation != null && !lastGnssLocation.equals(gnssLocation)) { -// List gnssPoints = new ArrayList<>(gnssPolyline.getPoints()); -// gnssPoints.add(gnssLocation); -// gnssPolyline.setPoints(gnssPoints); -// } if (showGnssPath && lastGnssLocation != null && !lastGnssLocation.equals(gnssLocation)) { List gnssPoints = new ArrayList<>(gnssPolyline.getPoints()); @@ -1151,6 +873,7 @@ public void updateGNSS(@NonNull LatLng gnssLocation) { } } } + else return; // Always update lastGnssLocation so path builds correctly when gnssSwitch is turned ON mid-session lastGnssLocation = gnssLocation; @@ -1188,11 +911,6 @@ public void updateWifiPosition(@NonNull LatLng wifiLocation) { * Returns {@code true} unconditionally when {@code lastPos} is {@code null} * (the very first dot for this source). * - *

Why this matters: position updates arrive every 200 ms regardless - * of whether the user has moved. Without this guard every call would add a dot, - * so standing still would burn through the entire rolling window at one location, - * leaving no dots along the actual path.

- * * @param newPos candidate position for the new dot. * @param lastPos position of the most recent dot ({@code null} if none yet). * @return {@code true} if a new dot should be placed. @@ -1215,10 +933,6 @@ private boolean hasMoved(@NonNull LatLng newPos, @Nullable LatLng lastPos) { * Applies a low-pass filter to the incoming position. The filter blends the * previous smoothed position with the new raw position using {@link #LOW_PASS_ALPHA}. * - *

A lower alpha produces a smoother path with more lag; a higher alpha - * follows the raw data more closely. The current value of 0.25 gives a good - * balance for indoor walking speeds.

- * * @param newPoint the raw position to filter. * @return the filtered position. */ @@ -1238,8 +952,6 @@ private LatLng applyLowPassFilter(@NonNull LatLng newPoint) { /** * Controls visibility of the LPF-smoothed fused polyline. - * The red PDR line and purple fused line are always visible. - * Only the teal LPF line is toggled by the smoothing switch. */ private void updatePolylineVisibility() { if (fusedPolyline != null) { @@ -1384,7 +1096,7 @@ private void redrawFusedTrajectory() { * * After adding, ALL markers in the queue are renumbered so that: * - The newest dot always shows "1" - * - The oldest dot shows the highest number (up to MAX_OBSERVATION_MARKERS) + * - The oldest dot shows the highest number * * When the queue is full, the oldest marker is removed before the new one is added. * @@ -1398,7 +1110,7 @@ private void addObservationMarker(@NonNull LatLng position, if (gMap == null) return; // Remove oldest marker when the window is full - if (markerQueue.size() >= maxObservations) { + if (markerQueue.size() >= defaultObservations) { Marker oldest = markerQueue.poll(); if (oldest != null) oldest.remove(); } @@ -1442,10 +1154,8 @@ private void addObservationMarker(@NonNull LatLng position, */ private void setQueueVisibility(@NonNull LinkedList queue, boolean visible) { for (Marker m : queue) if (m != null) m.setVisible(visible); - } -// added- /** * Creates a numbered circle bitmap for an observation dot marker. * The number shows recency — 1 is the most recent observation. @@ -1492,10 +1202,7 @@ private Bitmap createNumberedDotBitmap(int color, int number) { return bitmap; } - - /** - * Remove GNSS marker if user toggles it off - */ + // Remove GNSS marker if user toggles it off public void clearGNSS() { if (gnssMarker != null) { gnssMarker.remove(); @@ -1503,9 +1210,7 @@ public void clearGNSS() { } } - /** - * Whether user is currently showing GNSS or not - */ + // Whether user is currently showing GNSS or not public boolean isGnssEnabled() { return isGnssOn; } @@ -1592,13 +1297,11 @@ public void clearMapAndReset() { * The method removes the old polygon if it exists and adds the new polygon * to the map with the specified options. * The method logs the number of vertices in the polygon for debugging. - *

* - * Note: The method uses hard-coded vertices for the building polygon. + * Note: The method uses hard-coded vertices for the building polygon. * - *

* - * See: {@link com.google.android.gms.maps.model.PolygonOptions} The options for the new polygon. + * See: {@link com.google.android.gms.maps.model.PolygonOptions} The options for the new polygon. */ private void drawBuildingPolygon() { if (gMap == null) { @@ -1696,12 +1399,7 @@ public void updateObservedMacs(@NonNull List macs) { observedMacs = new ArrayList<>(macs); } } - public IndoorMapManager getIndoorMapManager() { return indoorMapManager; } - - - - } diff --git a/app/src/main/java/com/openpositioning/PositionMe/sensors/SensorFusion.java b/app/src/main/java/com/openpositioning/PositionMe/sensors/SensorFusion.java index 7545eb47..3725da74 100644 --- a/app/src/main/java/com/openpositioning/PositionMe/sensors/SensorFusion.java +++ b/app/src/main/java/com/openpositioning/PositionMe/sensors/SensorFusion.java @@ -14,7 +14,6 @@ import android.util.Log; import androidx.annotation.NonNull; -import androidx.annotation.RequiresApi; import androidx.preference.PreferenceManager; import android.net.wifi.ScanResult; @@ -43,7 +42,6 @@ import com.openpositioning.PositionMe.sensors.model.TestPoint; -import com.openpositioning.PositionMe.sensors.ParticleFilter; import com.openpositioning.PositionMe.utils.CoordinateConverter; /** @@ -76,13 +74,9 @@ public class SensorFusion implements SensorEventListener, Observer { private Traj.Fingerprint lastWifiFingerprint = null; private List lastBleDeviceList = null; - long maxReportLatencyNs = 0; // Disable batching to deliver events immediately - // Define a threshold for large time gaps (in milliseconds) - private static final long LARGE_GAP_THRESHOLD_MS = 500; // Adjust this if needed - - //region Static variables + //Static variables // Singleton Class private static final SensorFusion sensorFusion = new SensorFusion(); // Static constant for calculations with milliseconds @@ -93,9 +87,8 @@ public class SensorFusion implements SensorEventListener, Observer { private static final float ALPHA = 0.8f; // String for creating WiFi fingerprint JSO N object private static final String WIFI_FINGERPRINT= "wf"; - //endregion - //region Instance variables + //Instance variables // Keep device awake while recording private PowerManager.WakeLock wakeLock; private Context appContext; @@ -114,6 +107,7 @@ public class SensorFusion implements SensorEventListener, Observer { private MovementSensor rotationSensor; private MovementSensor gravitySensor; private MovementSensor linearAccelerationSensor; + // Other data recording private WifiDataProcessor wifiProcessor; private volatile List latestBssids = new ArrayList<>(); @@ -221,14 +215,10 @@ public class SensorFusion implements SensorEventListener, Observer { // Previous valid GNSS position in ENU (metres), used to derive heading from consecutive fixes private float[] lastGnssEnu = null; - // Last WiFi position in ENU (metres), cached for stationary soft-update private float[] lastWifiEnu = null; - private final List testPoints = new ArrayList<>(); - boolean enuBaked = false; - private IndoorMapManager indoorMapManager; //region Initialisation @@ -294,7 +284,6 @@ public void setIndoorMapManager(IndoorMapManager indoorMapManager) { } } - /** * Static function to access singleton instance of SensorFusion. * @@ -412,9 +401,7 @@ public void setContext(Context context) { } - //endregion - - //region Sensor processing + // Sensor processing /** * {@inheritDoc} * @@ -434,12 +421,6 @@ public void onSensorChanged(SensorEvent sensorEvent) { if (lastTimestamp != null) { long timeGap = currentTime - lastTimestamp; - -// // Log a warning if the time gap is larger than the threshold -// if (timeGap > LARGE_GAP_THRESHOLD_MS) { -// Log.e("SensorFusion", "Large time gap detected for sensor " + sensorType + -// " | Time gap: " + timeGap + " ms"); -// } } // Update timestamp and frequency counter for this sensor @@ -493,11 +474,6 @@ public void onSensorChanged(SensorEvent sensorEvent) { ); this.accelMagnitude.add(accelMagFiltered); -// // Debug logging -// Log.v("SensorFusion", -// "Added new linear accel magnitude: " + accelMagFiltered -// + "; accelMagnitude size = " + accelMagnitude.size()); - elevator = pdrProcessing.estimateElevator(gravity, filteredAcc); break; @@ -506,9 +482,6 @@ public void onSensorChanged(SensorEvent sensorEvent) { gravity[1] = sensorEvent.values[1]; gravity[2] = sensorEvent.values[2]; - // Possibly log gravity values if needed - //Log.v("SensorFusion", "Gravity: " + Arrays.toString(gravity)); - elevator = pdrProcessing.estimateElevator(gravity, filteredAcc); break; @@ -698,10 +671,6 @@ public void onLocationChanged(@NonNull Location location) { } if (saveRecording) { if (!particleFilter.isInitialized()) { - // First position: set East-North origin, spread particles around (0,0) -// coordinateConverter = new CoordinateConverter( -// location.getLatitude(), location.getLongitude()); - particleFilter.initParticles(0f, 0f, Math.max(accuracy, 5f)); ekfPositioning.initParticles(0f, 0f, Math.max(accuracy, 5f)); prevPdrX = 0f; @@ -771,7 +740,6 @@ public void onLocationChanged(@NonNull Location location) { Log.i("SensorFusion", "Floor change detected: " + lastKnownFloor + " → " + currentFloor + ", particles reset"); } - } } if(saveRecording) { @@ -843,15 +811,10 @@ private void updateWifiData(Object[] wifiList) { } else { android.util.Log.d("SensorFusion", "Duplicate WiFi fingerprint skipped"); } - - } - createWifiPositionRequestCallback(); Log.d("SensorFusion", "wifiList length = " + (wifiList == null ? 0 : wifiList.length)); - - } /** @@ -961,7 +924,6 @@ private void updateBleData(Object[] bleArray) { } } - /** * Check if two WiFi fingerprints are similar enough to be considered duplicates * Uses overlap ratio instead of exact match to handle unstable WiFi signals @@ -1100,8 +1062,6 @@ private boolean isSameBleDeviceList(List newList, return isDuplicate; } - - /** * Function to create a request to obtain a wifi location for the obtained wifi fingerprint * @@ -1246,7 +1206,6 @@ public void onError(String message) { // Error log to keep record of errors (for secure programming and maintainability) Log.e("jsonErrors","Error creating json object"+e.toString()); } - } /** @@ -1272,7 +1231,9 @@ public double[] getFusedLatLon() { float[] enu = useEKF ? ekfPositioning.getBestEstimate() : particleFilter.getBestEstimate(); double[] latLon = coordinateConverter.toLatLon(enu[0], enu[1]); - if (fusedTrajectoryPoints.size() < 2000) { + + // Only add points during active recording + if (saveRecording && fusedTrajectoryPoints.size() < 2000) { fusedTrajectoryPoints.add(new LatLng(latLon[0], latLon[1])); } return latLon; @@ -1314,7 +1275,6 @@ public double getPositionUncertainty() { return particleFilter == null ? -1.0 : particleFilter.getSigmaMetres(); } - /** * Returns a copy of all particle positions in local East-North metres. * @@ -1332,13 +1292,6 @@ public boolean isUsingEKF() { return useEKF; } - - - - - - - /** * Method to get current floor the user is at, obtained using WiFiPositioning * @see WiFiPositioning for WiFi positioning @@ -1598,9 +1551,7 @@ public int getHoldMode(){ } } - //endregion - - //region Start/Stop + // Start/Stop /** * Registers all device listeners and enables updates with the specified sampling rate. @@ -1734,7 +1685,7 @@ public void startRecording() { .setAndroidVersion(Build.VERSION.RELEASE) .setStartTimestamp(absoluteStartTime) .setTrajectoryId(trajectoryName) - .setInitialPosition(Traj.GNSSPosition.newBuilder() // ← 添加这4行! + .setInitialPosition(Traj.GNSSPosition.newBuilder() .setLatitude(initialLatitude) .setLongitude(initialLongitude) .setAltitude(initialAltitude) @@ -1787,6 +1738,7 @@ public void startRecording() { lastGyroTimestampMs = 0; lastGnssEnu = null; lastWifiEnu = null; + fusedTrajectoryPoints.clear(); // Clear old fused trajectory points if(settings.getBoolean("overwrite_constants", false)) { this.filter_coefficient = Float.parseFloat(settings.getString("accel_filter", "0.96")); } else { @@ -1815,9 +1767,7 @@ public void stopRecording() { } } - //endregion - - //region Trajectory object + // Trajectory object /** * Send the trajectory object to servers. @@ -1920,7 +1870,6 @@ public void run() { else { counter++; } - } } @@ -1947,8 +1896,6 @@ public double[] enuToLatLon(float east, float north) { return coordinateConverter.toLatLon(east, north); } - //endregion - /** * Returns true if the linear acceleration samples indicate the device is stationary. * Uses the peak-to-peak range of the sample window. @@ -1978,4 +1925,61 @@ private float normalizeAngle(float angle) { return angle; } + /** + * Rescales the fused trajectory points based on a new step length scaling factor. + * Called from CorrectionFragment when the user adjusts the average step length. + * + * @param scalingFactor ratio of new step length to original step length + */ + public void rescaleFusedTrajectory(float scalingFactor) { + if (fusedTrajectoryPoints.isEmpty()) { + Log.w("SensorFusion", "rescaleFusedTrajectory: no points to rescale"); + return; + } + + if (coordinateConverter == null) { + Log.w("SensorFusion", "rescaleFusedTrajectory: coordinateConverter is null"); + return; + } + + // Get the first point as reference (this is the origin) + LatLng startPoint = fusedTrajectoryPoints.get(0); + + // Convert start point to ENU + float[] startEnu = coordinateConverter.toEnu(startPoint.latitude, startPoint.longitude); + + // Rescale each subsequent point relative to the start + for (int i = 1; i < fusedTrajectoryPoints.size(); i++) { + LatLng currentPoint = fusedTrajectoryPoints.get(i); + + // Convert current point to ENU + float[] currentEnu = coordinateConverter.toEnu( + currentPoint.latitude, currentPoint.longitude); + + // Calculate offset from start + float eastOffset = currentEnu[0] - startEnu[0]; + float northOffset = currentEnu[1] - startEnu[1]; + + // Apply scaling factor + float newEast = startEnu[0] + (eastOffset * scalingFactor); + float newNorth = startEnu[1] + (northOffset * scalingFactor); + + // Convert back to lat/lon + double[] newLatLon = coordinateConverter.toLatLon(newEast, newNorth); + + // Update the point in the list + fusedTrajectoryPoints.set(i, new LatLng(newLatLon[0], newLatLon[1])); + } + + Log.i("SensorFusion", "Fused trajectory rescaled with factor: " + scalingFactor); + } + + /** + * Clears accumulated fused trajectory points. + * Called when starting a new recording session. + */ + public void clearFusedTrajectoryPoints() { + fusedTrajectoryPoints.clear(); + Log.i("SensorFusion", "Fused trajectory points cleared"); + } } diff --git a/app/src/main/java/com/openpositioning/PositionMe/utils/PathView.java b/app/src/main/java/com/openpositioning/PositionMe/utils/PathView.java index 5a5efa8d..c56cd47a 100644 --- a/app/src/main/java/com/openpositioning/PositionMe/utils/PathView.java +++ b/app/src/main/java/com/openpositioning/PositionMe/utils/PathView.java @@ -27,7 +27,7 @@ */ public class PathView extends View { // Set up drawing colour - private final int paintColor = Color.BLUE; + private final int paintColor = Color.parseColor("#BBF060"); // Defines paint and canvas private Paint drawPaint; // Path of straight lines diff --git a/app/src/main/res/layout/fragment_trajectory_map.xml b/app/src/main/res/layout/fragment_trajectory_map.xml index 575c3bfe..1f9848f8 100644 --- a/app/src/main/res/layout/fragment_trajectory_map.xml +++ b/app/src/main/res/layout/fragment_trajectory_map.xml @@ -44,19 +44,19 @@ + android:text="@string/mapControls" + android:textColor="@color/md_theme_onSurface" + android:textSize="15sp" + android:textStyle="bold" /> + android:text="@string/dropdownSymbol" + android:textColor="@color/md_theme_onSurface" + android:textSize="15sp" /> @@ -73,7 +73,7 @@ android:layout_width="200dp" android:orientation="horizontal" android:gravity="center_vertical" - android:layout_height="20dp" + android:layout_height="25dp" android:checked="false" android:text="@string/gnssSwitch" /> @@ -82,20 +82,20 @@ android:layout_width="200dp" android:orientation="horizontal" android:gravity="center_vertical" - android:layout_height="20dp" + android:layout_height="25dp" android:checked="false" android:text="@string/auto_floor" /> + android:gravity="center_vertical" + android:orientation="horizontal" + android:paddingStart="-5dp" + android:text="@string/particleCloud" /> + android:gravity="center_vertical" + android:orientation="horizontal" + android:paddingStart="-5dp" + android:text="@string/gnssPath" /> + android:gravity="center_vertical" + android:orientation="horizontal" + android:paddingStart="-5dp" + android:text="@string/smoothPath" /> + android:gravity="center_vertical" + android:orientation="horizontal" + android:paddingStart="-5dp" + android:text="@string/pdrPath" /> - - - - - - - - @@ -169,7 +161,7 @@ android:layout_width="200dp" android:orientation="horizontal" android:gravity="center_vertical" - android:layout_height="20dp" + android:layout_height="25dp" android:checked="false" android:text="🟠 WiFi dots" /> @@ -178,7 +170,7 @@ android:layout_width="200dp" android:orientation="horizontal" android:gravity="center_vertical" - android:layout_height="20dp" + android:layout_height="25dp" android:checked="false" android:text="🟢 PDR dots" /> @@ -193,7 +185,7 @@ android:layout_width="wrap_content" android:orientation="horizontal" android:gravity="center_vertical" - android:layout_height="48dp" + android:layout_height="45dp" android:backgroundTint="@color/red" android:text="@string/color" android:textColor="@color/md_theme_onPrimary" @@ -201,7 +193,7 @@ Mark Point Smooth Path Floor G + PDR Path + Smooth Path + GNSS Path + Particle Cloud + + Map Controls \ No newline at end of file From a498f0a96be4cfc91d77706544e89f20d7fc8dc4 Mon Sep 17 00:00:00 2001 From: Bhavyas15 Date: Wed, 1 Apr 2026 00:36:47 +0100 Subject: [PATCH 73/82] Correction fragment best estimate update --- .../fragment/CorrectionFragment.java | 162 ++++++++++++++++-- .../main/res/layout/fragment_correction.xml | 33 ++-- 2 files changed, 173 insertions(+), 22 deletions(-) diff --git a/app/src/main/java/com/openpositioning/PositionMe/presentation/fragment/CorrectionFragment.java b/app/src/main/java/com/openpositioning/PositionMe/presentation/fragment/CorrectionFragment.java index a715105d..24bdc2a2 100644 --- a/app/src/main/java/com/openpositioning/PositionMe/presentation/fragment/CorrectionFragment.java +++ b/app/src/main/java/com/openpositioning/PositionMe/presentation/fragment/CorrectionFragment.java @@ -28,7 +28,9 @@ import com.google.android.gms.maps.model.MarkerOptions; import com.google.android.gms.maps.model.PolylineOptions; import android.graphics.Color; +import java.util.ArrayList; import java.util.List; +import android.widget.Switch; /** * A simple {@link Fragment} subclass. Corrections Fragment is displayed after a recording session @@ -52,6 +54,14 @@ public class CorrectionFragment extends Fragment { private static LatLng start; private PathView pathView; + // ✅ ADD THESE NEW VARIABLES FOR FUSED TRAJECTORY CORRECTION + private float fusedOffsetLat = 0f; // Translation offset in latitude + private float fusedOffsetLng = 0f; // Translation offset in longitude + private float fusedRotationDegrees = 0f; // Rotation in degrees + private LatLng lastTouchPosition = null; // For drag gesture + private Switch togglePDR; + private boolean showPDR = false; + public CorrectionFragment() { // Required empty public constructor } @@ -94,14 +104,12 @@ public void onMapReady(GoogleMap map) { * scalingRatio) / Math.log(2); mMap.moveCamera(CameraUpdateFactory.newLatLngZoom(start, (float) zoom)); - // Draw the fused trajectory on the correction map. - List fusedPoints = sensorFusion.getFusedTrajectoryPoints(); - if (fusedPoints != null && fusedPoints.size() > 1) { - mMap.addPolyline(new PolylineOptions() - .addAll(fusedPoints) - .color(Color.RED) // same Red as recording screen - .width(6f)); - } + // Draw the fused trajectory on the correction map + updateFusedTrajectoryOnMap(); + + // ✅ ADD TOUCH LISTENERS FOR INTERACTIVE CORRECTION + setupMapTouchListeners(); + } }); return rootView; @@ -114,7 +122,20 @@ public void onViewCreated(@NonNull View view, @Nullable Bundle savedInstanceStat this.averageStepLengthText = view.findViewById(R.id.averageStepView); this.stepLengthInput = view.findViewById(R.id.inputStepLength); this.pathView = view.findViewById(R.id.pathView1); -// this.pathView.setTrajectoryColor(Color.GREEN); + + togglePDR = view.findViewById(R.id.toggle_pdr); + togglePDR.setChecked(false); // default OFF + pathView.setVisibility(View.GONE); + + togglePDR.setOnCheckedChangeListener((buttonView, isChecked) -> { + showPDR = isChecked; + + if (showPDR) { + pathView.setVisibility(View.VISIBLE); + } else { + pathView.setVisibility(View.GONE); + } + }); averageStepLength = sensorFusion.passAverageStepLength(); averageStepLengthText.setText(getString(R.string.averageStepLgn) + ": " @@ -123,7 +144,11 @@ public void onViewCreated(@NonNull View view, @Nullable Bundle savedInstanceStat // Listen for ENTER key this.stepLengthInput.setOnKeyListener((v, keyCode, event) -> { if (keyCode == KeyEvent.KEYCODE_ENTER) { - newStepLength = Float.parseFloat(changedText.toString()); + if (changedText != null && !changedText.toString().isEmpty()) { + newStepLength = Float.parseFloat(changedText.toString()); + } else { + return false; + } float scalingFactor = newStepLength / averageStepLength; // Rescale path sensorFusion.redrawPath(scalingFactor); @@ -180,13 +205,128 @@ private void updateFusedTrajectoryOnMap() { // Redraw the fused trajectory with updated points List fusedPoints = sensorFusion.getFusedTrajectoryPoints(); if (fusedPoints != null && fusedPoints.size() > 1) { + // Apply transformations (rotation + translation) + List transformedPoints = applyFusedTransformations(fusedPoints); + mMap.addPolyline(new PolylineOptions() - .addAll(fusedPoints) + .addAll(transformedPoints) .color(Color.RED) .width(6f)); } } } + + /** + * Set up touch listeners for interactive fused trajectory correction. + * - Single finger drag: translate the fused trajectory + * - Two finger rotation gesture: rotate the fused trajectory + */ + private void setupMapTouchListeners() { + if (mMap == null) return; + + mMap.setOnCameraMoveListener(new GoogleMap.OnCameraMoveListener() { + @Override + public void onCameraMove() { + LatLng currentCenter = mMap.getCameraPosition().target; + + if (lastTouchPosition != null) { + fusedOffsetLat += (currentCenter.latitude - lastTouchPosition.latitude); + fusedOffsetLng += (currentCenter.longitude - lastTouchPosition.longitude); + } + + // Always update rotation from map bearing + fusedRotationDegrees = mMap.getCameraPosition().bearing; + + lastTouchPosition = currentCenter; + updateFusedTrajectoryOnMap(); + } + }); + + mMap.setOnCameraIdleListener(new GoogleMap.OnCameraIdleListener() { + @Override + public void onCameraIdle() { + lastTouchPosition = null; + } + }); + + mMap.setOnMapLongClickListener(new GoogleMap.OnMapLongClickListener() { + @Override + public void onMapLongClick(LatLng latLng) { + // Reset corrections + fusedOffsetLat = 0f; + fusedOffsetLng = 0f; + fusedRotationDegrees = 0f; + updateFusedTrajectoryOnMap(); + } + }); + } + + /** + * Apply rotation and translation transformations to the fused trajectory. + * + * @param originalPoints Original fused trajectory points + * @return Transformed points with rotation and translation applied + */ + private List applyFusedTransformations(List originalPoints) { + if (originalPoints == null || originalPoints.isEmpty()) { + return originalPoints; + } + + List transformedPoints = new ArrayList<>(); + + // ✅ Step 1: Normalize to first point + LatLng firstPoint = originalPoints.get(0); + + // ✅ Step 2: Use center for rotation (better UX) + double avgLat = 0; + double avgLng = 0; + + for (LatLng p : originalPoints) { + avgLat += p.latitude; + avgLng += p.longitude; + } + + avgLat /= originalPoints.size(); + avgLng /= originalPoints.size(); + + LatLng rotationCenter = new LatLng(avgLat, avgLng); + + // ✅ Step 3: Convert rotation to radians + double rotationRad = Math.toRadians(fusedRotationDegrees); + double cosTheta = Math.cos(rotationRad); + double sinTheta = Math.sin(rotationRad); + + for (LatLng point : originalPoints) { + + // 🔹 Normalize relative to first point (so both start same) + double lat = point.latitude - firstPoint.latitude; + double lng = point.longitude - firstPoint.longitude; + + // 🔹 Also shift rotation center to normalized space + double centerLat = rotationCenter.latitude - firstPoint.latitude; + double centerLng = rotationCenter.longitude - firstPoint.longitude; + + // 🔹 Translate to rotation center + double relLat = lat - centerLat; + double relLng = lng - centerLng; + + // 🔹 Apply rotation + double rotatedLat = relLat * cosTheta - relLng * sinTheta; + double rotatedLng = relLat * sinTheta + relLng * cosTheta; + + // 🔹 Translate back from center + rotatedLat += centerLat; + rotatedLng += centerLng; + + // 🔹 Move everything to GNSS start + offset + double finalLat = start.latitude + rotatedLat + fusedOffsetLat; + double finalLng = start.longitude + rotatedLng + fusedOffsetLng; + + transformedPoints.add(new LatLng(finalLat, finalLng)); + } + + return transformedPoints; + } public void setScalingRatio(float scalingRatio) { this.scalingRatio = scalingRatio; } diff --git a/app/src/main/res/layout/fragment_correction.xml b/app/src/main/res/layout/fragment_correction.xml index ce536570..0f48b150 100644 --- a/app/src/main/res/layout/fragment_correction.xml +++ b/app/src/main/res/layout/fragment_correction.xml @@ -53,31 +53,40 @@ android:layout_width="match_parent" android:layout_height="wrap_content" android:padding="10dp"> + + app:layout_constraintTop_toBottomOf="@id/toggle_pdr" + app:layout_constraintStart_toStartOf="parent" /> + app:layout_constraintStart_toStartOf="parent" /> + app:layout_constraintTop_toTopOf="@id/correctStepLabel" + app:layout_constraintBottom_toBottomOf="@id/correctStepLabel" + app:layout_constraintEnd_toEndOf="parent"> + app:layout_constraintTop_toTopOf="parent" + app:layout_constraintVertical_bias="0.0" /> \ No newline at end of file From 3d293552d7a4b5f7574872aeef9d17b914879fb3 Mon Sep 17 00:00:00 2001 From: Bhavyas15 <139043257+Bhavyas15@users.noreply.github.com> Date: Wed, 1 Apr 2026 10:00:10 +0100 Subject: [PATCH 74/82] Increase max points display from 15 to 30 --- app/src/main/res/xml/root_preferences.xml | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/app/src/main/res/xml/root_preferences.xml b/app/src/main/res/xml/root_preferences.xml index c1aa0333..33c1f89d 100644 --- a/app/src/main/res/xml/root_preferences.xml +++ b/app/src/main/res/xml/root_preferences.xml @@ -103,7 +103,7 @@ app:summary="Controls number of recent GNSS, WiFi, and PDR points shown" app:defaultValue="5" android:min="2" - android:max="15" + android:max="30" app:showSeekBarValue="true" app:dependency="overwrite_constants"/> @@ -156,4 +156,4 @@ - \ No newline at end of file + From 7c66250d372478bfc678e9b92086a706c9730eec Mon Sep 17 00:00:00 2001 From: sydneysavarese Date: Wed, 1 Apr 2026 10:20:33 +0100 Subject: [PATCH 75/82] added floor button visibility and autofloor functionality --- .../fragment/TrajectoryMapFragment.java | 34 ++++++++++++------- 1 file changed, 22 insertions(+), 12 deletions(-) diff --git a/app/src/main/java/com/openpositioning/PositionMe/presentation/fragment/TrajectoryMapFragment.java b/app/src/main/java/com/openpositioning/PositionMe/presentation/fragment/TrajectoryMapFragment.java index 5d1debef..e17e0ec9 100644 --- a/app/src/main/java/com/openpositioning/PositionMe/presentation/fragment/TrajectoryMapFragment.java +++ b/app/src/main/java/com/openpositioning/PositionMe/presentation/fragment/TrajectoryMapFragment.java @@ -330,6 +330,13 @@ public void onViewCreated(@NonNull View view, floorLabel.setText("Floor: -"); + +// Hide floor controls until a venue is selected + floorUpButton.setVisibility(View.GONE); + floorDownButton.setVisibility(View.GONE); + autoFloorSwitch.setVisibility(View.GONE); + floorLabel.setVisibility(View.GONE); + // Setup floor up/down UI hidden initially until we know there's an indoor map // setFloorControlsVisibility(View.GONE); @@ -484,7 +491,7 @@ public void onMapReady(@NonNull GoogleMap googleMap) { floorUpButton.setOnClickListener(v -> { // If user manually changes floor, turn off auto floor - autoFloorSwitch.setChecked(false); +// autoFloorSwitch.setChecked(false); if (indoorMapManager != null) { indoorMapManager.increaseFloor(); String fk = indoorMapManager.getCurrentFloorKey(); @@ -796,17 +803,19 @@ public void updateUserLocation(@NonNull LatLng newLocation, float orientation) { heightChange ); oldfloor = newfloor; - floorResult = indoorMapManager.acceptFloorChange( - correctedLocation, - oldLocation, - currentElevation - ); - if (floorResult.snappedLocation != null) { - correctedLocation = floorResult.snappedLocation; - newfloor = floorResult.floorKey; - } - if (floorResult.changedFloor && floorResult.highlightcenter != null) { - highlightAccessPoint(floorResult.highlightcenter); + if (autoFloorSwitch.isChecked()) { + floorResult = indoorMapManager.acceptFloorChange( + correctedLocation, + oldLocation, + currentElevation + ); + if (floorResult.snappedLocation != null) { + correctedLocation = floorResult.snappedLocation; + newfloor = floorResult.floorKey; + } + if (floorResult.changedFloor && floorResult.highlightcenter != null) { + highlightAccessPoint(floorResult.highlightcenter); + } } } if (!Objects.equals(oldfloor, newfloor)) { @@ -1333,6 +1342,7 @@ private void setFloorControlsVisibility(int visibility) { floorUpButton.setVisibility(visibility); floorDownButton.setVisibility(visibility); autoFloorSwitch.setVisibility(visibility); + floorLabel.setVisibility(visibility); } public void clearMapAndReset() { From 8721fc3d1c1f8c90e8037a4eb6c9fd5c656143af Mon Sep 17 00:00:00 2001 From: Haoning Huang Date: Wed, 1 Apr 2026 10:17:20 +0100 Subject: [PATCH 76/82] fix: reduce EKF covariance inflation and cap single-step WiFi displacement --- .../PositionMe/sensors/SensorFusion.java | 76 +++++++++++++++++-- 1 file changed, 69 insertions(+), 7 deletions(-) diff --git a/app/src/main/java/com/openpositioning/PositionMe/sensors/SensorFusion.java b/app/src/main/java/com/openpositioning/PositionMe/sensors/SensorFusion.java index 3725da74..459fd96a 100644 --- a/app/src/main/java/com/openpositioning/PositionMe/sensors/SensorFusion.java +++ b/app/src/main/java/com/openpositioning/PositionMe/sensors/SensorFusion.java @@ -194,6 +194,12 @@ public class SensorFusion implements SensorEventListener, Observer { private float prevPdrX = 0f; private float prevPdrY = 0f; + // Rolling average of recent PDR step displacements — used to gauge movement trend. + // Smoothed over the last ~5 steps via exponential moving average (alpha = 0.3). + private float pdrTrendDx = 0f; + private float pdrTrendDy = 0f; + private static final float PDR_TREND_ALPHA = 0.3f; + // Gyroscope-integrated heading with rotation-vector correction (radians) private float fusedHeading = 0f; private boolean headingInitialised = false; @@ -553,6 +559,10 @@ public void onSensorChanged(SensorEvent sensorEvent) { float dx = newCords[0] - prevPdrX; float dy = newCords[1] - prevPdrY; + // Update PDR movement trend (exponential moving average) + pdrTrendDx = PDR_TREND_ALPHA * dx + (1f - PDR_TREND_ALPHA) * pdrTrendDx; + pdrTrendDy = PDR_TREND_ALPHA * dy + (1f - PDR_TREND_ALPHA) * pdrTrendDy; + // Save particle positions BEFORE prediction float[][] prevParticles = particleFilter.getParticlesCopy(); @@ -1168,14 +1178,16 @@ public void onSuccess(LatLng wifiLocation, int floor) { + " dist=" + jumpDist + "m rssi=" + avgRssi); } - // When stationary, WiFi is the primary position source. - // Tighten noise and inflate EKF covariance so updates converge quickly. + // When stationary, WiFi provides a position anchor. + // Keep covariance inflation modest so the Kalman gain stays + // below ~0.5 and a single erroneous fix cannot pull the state + // more than a few metres in one step. if (stationaryMs > 3000) { - noiseStd = 2.0f; - ekfPositioning.inflateCovariance(200.0f); + noiseStd = 4.0f; + ekfPositioning.inflateCovariance(10.0f); } else if (isStationary) { - noiseStd = 3.0f; - ekfPositioning.inflateCovariance(50.0f); + noiseStd = 6.0f; + ekfPositioning.inflateCovariance(5.0f); } else { // While moving, reduce noise further only if the particle cloud // is already widely dispersed. @@ -1186,11 +1198,59 @@ public void onSuccess(LatLng wifiLocation, int floor) { } noiseStd = Math.max(noiseStd, 2.0f); + + // ── EKF-specific: PDR motion-consistency check ────────────── + // When moving, compare WiFi correction direction against the + // recent PDR movement trend. If they are near-opposite (cosine < 0), + // the WiFi observation is pulling against the walk direction — + // likely a fingerprint error. Inflate noise to dampen the pull. + // Also apply a gradual step: blend toward the WiFi position rather + // than jumping to it, so the trajectory stays smooth. + float ekfNoiseStd = noiseStd; + float[] ekfState = ekfPositioning.getBestEstimate(); + + float corrDx = enu[0] - ekfState[0]; + float corrDy = enu[1] - ekfState[1]; + float corrMag = (float) Math.sqrt(corrDx * corrDx + corrDy * corrDy); + + // Direction consistency check (moving only): + // if WiFi correction opposes recent PDR movement, inflate noise. + if (!isStationary) { + float trendMag = (float) Math.sqrt( + pdrTrendDx * pdrTrendDx + pdrTrendDy * pdrTrendDy); + if (trendMag > 0.05f && corrMag > 1.0f) { + float cosAngle = (pdrTrendDx * corrDx + pdrTrendDy * corrDy) + / (trendMag * corrMag); + if (cosAngle < 0f) { + float backwardPenalty = 1f + 2f * (-cosAngle); + ekfNoiseStd *= backwardPenalty; + Log.d("SensorFusion", "EKF WiFi direction penalty ×" + + backwardPenalty + " cosAngle=" + cosAngle); + } + } + } + + // Gradual position update: cap the single-step displacement so one + // erroneous WiFi fix cannot teleport the state. + // Allow a larger step when stationary (WiFi is the only anchor) + // but still cap it to limit damage from a bad fix. + final float MAX_STEP_METRES = isStationary ? 2.0f : 1.5f; + if (corrMag > MAX_STEP_METRES) { + float blend = MAX_STEP_METRES / corrMag; + float gradualEast = ekfState[0] + blend * corrDx; + float gradualNorth = ekfState[1] + blend * corrDy; + ekfPositioning.updateWithWifi(gradualEast, gradualNorth, ekfNoiseStd); + Log.d("SensorFusion", "EKF WiFi capped step=" + MAX_STEP_METRES + + "m corrMag=" + corrMag + " noise=" + ekfNoiseStd); + particleFilter.updateWithWifi(enu[0], enu[1], noiseStd); + return; + } + Log.d("SensorFusion", "WiFi update noiseStd=" + noiseStd + " apCount=" + apCount + " avgRssi=" + avgRssi + " jump=" + jumpDist + "m stationary=" + isStationary); particleFilter.updateWithWifi(enu[0], enu[1], noiseStd); - ekfPositioning.updateWithWifi(enu[0], enu[1], noiseStd); + ekfPositioning.updateWithWifi(enu[0], enu[1], ekfNoiseStd); } } } @@ -1733,6 +1793,8 @@ public void startRecording() { lastKnownFloor = 0; prevPdrX = 0f; prevPdrY = 0f; + pdrTrendDx = 0f; + pdrTrendDy = 0f; fusedHeading = 0f; headingInitialised = false; lastGyroTimestampMs = 0; From 46aca2bacdf6c165e053c5d91eedec8fa63dc33d Mon Sep 17 00:00:00 2001 From: Haoning Huang Date: Wed, 1 Apr 2026 10:25:26 +0100 Subject: [PATCH 77/82] fix: add EKF innovation gating to reject outlier WiFi observations --- .../sensors/ExtendedKalmanFilter.java | 32 +++++++++++++++++++ .../PositionMe/sensors/SensorFusion.java | 13 ++++++++ 2 files changed, 45 insertions(+) diff --git a/app/src/main/java/com/openpositioning/PositionMe/sensors/ExtendedKalmanFilter.java b/app/src/main/java/com/openpositioning/PositionMe/sensors/ExtendedKalmanFilter.java index b8d0ee70..03d331a4 100644 --- a/app/src/main/java/com/openpositioning/PositionMe/sensors/ExtendedKalmanFilter.java +++ b/app/src/main/java/com/openpositioning/PositionMe/sensors/ExtendedKalmanFilter.java @@ -204,4 +204,36 @@ public void inflateCovariance(float amount) { } public boolean isInitialized() { return initialized; } + + /** + * Computes the squared Mahalanobis distance between a candidate observation + * and the current predicted state, using the innovation covariance S = P + R·I. + * + *

For a 2-D position observation the result follows a chi-squared distribution + * with 2 degrees of freedom. Typical rejection thresholds:

+ *
    + *
  • 95 % confidence boundary: 5.99
  • + *
  • 99 % confidence boundary: 9.21
  • + *
+ * + * @param measX Observed East position (metres) + * @param measY Observed North position (metres) + * @param noiseStd Observation noise standard deviation (metres) + * @return squared Mahalanobis distance, or {@code Float.MAX_VALUE} if not initialized + */ + public float mahalanobisDistanceSq(float measX, float measY, float noiseStd) { + if (!initialized) return Float.MAX_VALUE; + float r = noiseStd * noiseStd; + float s00 = p00 + r; + float s01 = p01; + float s10 = p10; + float s11 = p11 + r; + float det = s00 * s11 - s01 * s10; + if (Math.abs(det) < 1e-10f) return Float.MAX_VALUE; + float innX = measX - stateX; + float innY = measY - stateY; + // d² = [innX innY] · S⁻¹ · [innX innY]ᵀ + float id = 1f / det; + return (innX * innX * s11 - 2f * innX * innY * s01 + innY * innY * s00) * id; + } } diff --git a/app/src/main/java/com/openpositioning/PositionMe/sensors/SensorFusion.java b/app/src/main/java/com/openpositioning/PositionMe/sensors/SensorFusion.java index 459fd96a..fd407789 100644 --- a/app/src/main/java/com/openpositioning/PositionMe/sensors/SensorFusion.java +++ b/app/src/main/java/com/openpositioning/PositionMe/sensors/SensorFusion.java @@ -1230,6 +1230,19 @@ public void onSuccess(LatLng wifiLocation, int floor) { } } + // Innovation gating: reject the WiFi fix for EKF if the observation + // is statistically inconsistent with the predicted state. + // Chi-squared 2-DOF 99% threshold = 9.21 + final float GATE_THRESHOLD_SQ = 9.21f; + float mahaSq = ekfPositioning.mahalanobisDistanceSq( + enu[0], enu[1], ekfNoiseStd); + if (mahaSq > GATE_THRESHOLD_SQ) { + Log.d("SensorFusion", "EKF WiFi gated out mahaSq=" + mahaSq + + " threshold=" + GATE_THRESHOLD_SQ); + particleFilter.updateWithWifi(enu[0], enu[1], noiseStd); + return; + } + // Gradual position update: cap the single-step displacement so one // erroneous WiFi fix cannot teleport the state. // Allow a larger step when stationary (WiFi is the only anchor) From c7b8ac8b8a953c1cfd876181160b36df5c95900e Mon Sep 17 00:00:00 2001 From: Haoning Huang Date: Wed, 1 Apr 2026 10:47:35 +0100 Subject: [PATCH 78/82] fix: apply EMA smoothing to WiFi observations before EKF update --- .../PositionMe/sensors/SensorFusion.java | 26 +++++++++++++++---- 1 file changed, 21 insertions(+), 5 deletions(-) diff --git a/app/src/main/java/com/openpositioning/PositionMe/sensors/SensorFusion.java b/app/src/main/java/com/openpositioning/PositionMe/sensors/SensorFusion.java index fd407789..e641a32e 100644 --- a/app/src/main/java/com/openpositioning/PositionMe/sensors/SensorFusion.java +++ b/app/src/main/java/com/openpositioning/PositionMe/sensors/SensorFusion.java @@ -223,6 +223,9 @@ public class SensorFusion implements SensorEventListener, Observer { private float[] lastGnssEnu = null; // Last WiFi position in ENU (metres), cached for stationary soft-update private float[] lastWifiEnu = null; + // EMA-smoothed WiFi position in ENU, fed to EKF instead of the raw fix + private float[] smoothedWifiEnu = null; + private static final float WIFI_EMA_ALPHA = 0.4f; private final List testPoints = new ArrayList<>(); boolean enuBaked = false; private IndoorMapManager indoorMapManager; @@ -1146,6 +1149,19 @@ public void onSuccess(LatLng wifiLocation, int floor) { // Cache WiFi ENU for stationary soft-update lastWifiEnu = enu; + // EMA smoothing: blend raw fix toward the running average. + // Particle filter always receives the raw fix; EKF uses the + // smoothed value so high-frequency fingerprint noise is damped. + if (smoothedWifiEnu == null) { + smoothedWifiEnu = new float[]{enu[0], enu[1]}; + } else { + smoothedWifiEnu[0] = WIFI_EMA_ALPHA * enu[0] + + (1f - WIFI_EMA_ALPHA) * smoothedWifiEnu[0]; + smoothedWifiEnu[1] = WIFI_EMA_ALPHA * enu[1] + + (1f - WIFI_EMA_ALPHA) * smoothedWifiEnu[1]; + } + float[] ekfEnu = smoothedWifiEnu; + // Hard-reject implausibly large jumps (> 80 m). float[] currentEst = particleFilter.getBestEstimate(); float jumpDist = (float) Math.hypot( @@ -1209,8 +1225,8 @@ public void onSuccess(LatLng wifiLocation, int floor) { float ekfNoiseStd = noiseStd; float[] ekfState = ekfPositioning.getBestEstimate(); - float corrDx = enu[0] - ekfState[0]; - float corrDy = enu[1] - ekfState[1]; + float corrDx = ekfEnu[0] - ekfState[0]; + float corrDy = ekfEnu[1] - ekfState[1]; float corrMag = (float) Math.sqrt(corrDx * corrDx + corrDy * corrDy); // Direction consistency check (moving only): @@ -1232,10 +1248,9 @@ public void onSuccess(LatLng wifiLocation, int floor) { // Innovation gating: reject the WiFi fix for EKF if the observation // is statistically inconsistent with the predicted state. - // Chi-squared 2-DOF 99% threshold = 9.21 final float GATE_THRESHOLD_SQ = 9.21f; float mahaSq = ekfPositioning.mahalanobisDistanceSq( - enu[0], enu[1], ekfNoiseStd); + ekfEnu[0], ekfEnu[1], ekfNoiseStd); if (mahaSq > GATE_THRESHOLD_SQ) { Log.d("SensorFusion", "EKF WiFi gated out mahaSq=" + mahaSq + " threshold=" + GATE_THRESHOLD_SQ); @@ -1263,7 +1278,7 @@ public void onSuccess(LatLng wifiLocation, int floor) { + " apCount=" + apCount + " avgRssi=" + avgRssi + " jump=" + jumpDist + "m stationary=" + isStationary); particleFilter.updateWithWifi(enu[0], enu[1], noiseStd); - ekfPositioning.updateWithWifi(enu[0], enu[1], ekfNoiseStd); + ekfPositioning.updateWithWifi(ekfEnu[0], ekfEnu[1], ekfNoiseStd); } } } @@ -1813,6 +1828,7 @@ public void startRecording() { lastGyroTimestampMs = 0; lastGnssEnu = null; lastWifiEnu = null; + smoothedWifiEnu = null; fusedTrajectoryPoints.clear(); // Clear old fused trajectory points if(settings.getBoolean("overwrite_constants", false)) { this.filter_coefficient = Float.parseFloat(settings.getString("accel_filter", "0.96")); From 415a73b64dc0ddca9bc792597e31353258cf9dc3 Mon Sep 17 00:00:00 2001 From: Haoning Huang Date: Wed, 1 Apr 2026 10:52:24 +0100 Subject: [PATCH 79/82] debug: log isStationary suppression of PDR steps --- .../com/openpositioning/PositionMe/sensors/SensorFusion.java | 2 ++ 1 file changed, 2 insertions(+) diff --git a/app/src/main/java/com/openpositioning/PositionMe/sensors/SensorFusion.java b/app/src/main/java/com/openpositioning/PositionMe/sensors/SensorFusion.java index e641a32e..31ef45c3 100644 --- a/app/src/main/java/com/openpositioning/PositionMe/sensors/SensorFusion.java +++ b/app/src/main/java/com/openpositioning/PositionMe/sensors/SensorFusion.java @@ -537,6 +537,8 @@ public void onSensorChanged(SensorEvent sensorEvent) { // Skip PDR update if the acceleration pattern indicates no real movement if (isStationary(accelMagnitude)) { + Log.d("SensorFusion", "isStationary=true, skipping PDR step (samples=" + + accelMagnitude.size() + ")"); accelMagnitude.clear(); break; } From eee24307a1bad35c3745abba4e06a683d87790b2 Mon Sep 17 00:00:00 2001 From: Haoning Huang Date: Wed, 1 Apr 2026 11:25:52 +0100 Subject: [PATCH 80/82] =?UTF-8?q?fix:=20tighten=20isStationary=20=E2=80=94?= =?UTF-8?q?=20min=205=20samples,=20threshold=200.5=20=E2=86=92=200.3=20m/s?= =?UTF-8?q?=C2=B2?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../openpositioning/PositionMe/sensors/SensorFusion.java | 7 ++++++- 1 file changed, 6 insertions(+), 1 deletion(-) diff --git a/app/src/main/java/com/openpositioning/PositionMe/sensors/SensorFusion.java b/app/src/main/java/com/openpositioning/PositionMe/sensors/SensorFusion.java index 31ef45c3..8f6ebe75 100644 --- a/app/src/main/java/com/openpositioning/PositionMe/sensors/SensorFusion.java +++ b/app/src/main/java/com/openpositioning/PositionMe/sensors/SensorFusion.java @@ -1998,12 +1998,17 @@ public double[] enuToLatLon(float east, float north) { */ private boolean isStationary(List samples) { if (samples.isEmpty()) return false; + // Require at least 5 samples; fewer samples means a very short step interval, + // which is more likely genuine movement than noise. + if (samples.size() < 5) return false; double max = Double.MIN_VALUE, min = Double.MAX_VALUE; for (double v : samples) { if (v > max) max = v; if (v < min) min = v; } - return (max - min) < 0.5; + // Lowered threshold from 0.5 to 0.3 m/s²: walking in a bag/pocket produces + // a steady magnitude that varies less than 0.5 but still more than 0.3. + return (max - min) < 0.3; } /** From 3e1b9702a7246857ea6cf260fa9daa8621b6db07 Mon Sep 17 00:00:00 2001 From: Haoning Huang Date: Wed, 1 Apr 2026 18:34:05 +0100 Subject: [PATCH 81/82] fix: remove duplicate EKF wall clamp and gate display constraint on setting --- .../PositionMe/sensors/SensorFusion.java | 23 ++++--------------- 1 file changed, 4 insertions(+), 19 deletions(-) diff --git a/app/src/main/java/com/openpositioning/PositionMe/sensors/SensorFusion.java b/app/src/main/java/com/openpositioning/PositionMe/sensors/SensorFusion.java index 41d2d2f9..3662e838 100644 --- a/app/src/main/java/com/openpositioning/PositionMe/sensors/SensorFusion.java +++ b/app/src/main/java/com/openpositioning/PositionMe/sensors/SensorFusion.java @@ -655,23 +655,7 @@ public void onSensorChanged(SensorEvent sensorEvent) { if (coordinateConverter != null && indoorMapManager != null && settings.getBoolean("use_wall_constraints", true)) { - if (useEKF) { - // EKF mode: clamp single position to wall boundary - float[] prevEnu = {prevPdrX, prevPdrY}; - float[] ekfState = ekfPositioning.getBestEstimate(); - float[] clamped = indoorMapManager.constrainMovementToWalls( - prevEnu, ekfState); - // Use value comparison — constrainMovementToWalls always returns - // a new array, so reference equality would always be true. - boolean wallHit = Math.abs(clamped[0] - ekfState[0]) > 1e-4f - || Math.abs(clamped[1] - ekfState[1]) > 1e-4f; - if (wallHit) { - ekfPositioning.resetAroundPosition( - clamped[0], clamped[1], - (float) ekfPositioning.getSigmaMetres()); - Log.d("SensorFusion", "EKF wall clamp applied"); - } - } else { + if (!useEKF) { // Particle filter mode: batch weight penalty per particle float[] currEast = particleFilter.getParticlesXRef(); float[] currNorth = particleFilter.getParticlesYRef(); @@ -1534,7 +1518,8 @@ public double[] getFusedLatLon() { float[] displayEnu = new float[]{rawEnu[0], rawEnu[1]}; - if (indoorMapManager != null && prevBestEnu != null) { + if (indoorMapManager != null && prevBestEnu != null + && settings.getBoolean("use_wall_constraints", true)) { displayEnu = indoorMapManager.constrainMovementToWalls(prevBestEnu, rawEnu); } @@ -1796,7 +1781,7 @@ public void stopListening() { //The app often crashes here because the scan receiver stops after it has found the list. // It will only unregister one if there is to unregister try { - this.wifiProcessor.stopListening(); //error here? + this.wifiProcessor.stopListening(); } catch (Exception e) { System.err.println("Wifi resumed before existing"); } From 2a15684bc1ad36470ab05cfe109d69ddbf74f3d2 Mon Sep 17 00:00:00 2001 From: sydneysavarese Date: Wed, 1 Apr 2026 18:37:10 +0100 Subject: [PATCH 82/82] added comments --- .../fragment/TrajectoryMapFragment.java | 2 - .../PositionMe/sensors/SensorFusion.java | 134 +--- .../PositionMe/utils/IndoorMapManager.java | 668 +++++++++--------- 3 files changed, 360 insertions(+), 444 deletions(-) diff --git a/app/src/main/java/com/openpositioning/PositionMe/presentation/fragment/TrajectoryMapFragment.java b/app/src/main/java/com/openpositioning/PositionMe/presentation/fragment/TrajectoryMapFragment.java index fd8a29fc..d437ec02 100644 --- a/app/src/main/java/com/openpositioning/PositionMe/presentation/fragment/TrajectoryMapFragment.java +++ b/app/src/main/java/com/openpositioning/PositionMe/presentation/fragment/TrajectoryMapFragment.java @@ -258,8 +258,6 @@ public void onViewCreated(@NonNull View view, autoFloorSwitch.setVisibility(View.GONE); floorLabel.setVisibility(View.GONE); - // Setup floor up/down UI hidden initially until we know there's an indoor map -// setFloorControlsVisibility(View.GONE); // Hide particle cloud switch when EKF mode is active SharedPreferences prefs = PreferenceManager.getDefaultSharedPreferences(requireContext()); boolean useEkf = prefs.getBoolean("use_ekf", false); diff --git a/app/src/main/java/com/openpositioning/PositionMe/sensors/SensorFusion.java b/app/src/main/java/com/openpositioning/PositionMe/sensors/SensorFusion.java index 41d2d2f9..0f96922c 100644 --- a/app/src/main/java/com/openpositioning/PositionMe/sensors/SensorFusion.java +++ b/app/src/main/java/com/openpositioning/PositionMe/sensors/SensorFusion.java @@ -309,30 +309,41 @@ public float[] getInitialRotation() { return this.initialRotation; } + + /** - * Initialisation function for the SensorFusion instance. - * - * Initialise all Movement sensor instances from context and predetermined types. Creates a - * server communication instance for sending trajectories. Saves current absolute and relative - * time, and initialises saving the recording to false. - * - * @param context application context for permissions and device access. + * Adds a test point (ground truth or manually marked point) to a local list. + * This is typically used for debugging or evaluation purposes. * - * @see MovementSensor handling all SensorManager based data collection devices. - * @see ServerCommunications handling communication with the server. - * @see GNSSDataProcessor for location data processing. - * @see WifiDataProcessor for network data processing. + * @param timestampMillis Timestamp of the test point in milliseconds + * @param lat Latitude of the point + * @param lon Longitude of the point */ - public void addTestPoint(long timestampMillis, double lat, double lon) { testPoints.add(new TestPoint(timestampMillis, lat, lon)); } -// debugging- + /** + * Returns all stored test points. + * Used for debugging, evaluation, or visualisation of ground truth vs estimated trajectory. + * + * @return List of test points + */ public List getTestPoints() { return testPoints; } + + /** + * Adds a test point to the trajectory at the current estimated position. + * This is stored in the trajectory protobuf for later analysis. + * + * NOTE: + * - Only works when recording is active. + * - Uses current latitude/longitude/elevation from sensors. + * + * @param timestamp Absolute timestamp when the test point was triggered + */ public void addTestPoint(long timestamp) { Log.d("TestPoint", "Test point marked at: " + timestamp); if (!saveRecording || trajectory == null) { @@ -354,6 +365,21 @@ public void addTestPoint(long timestamp) { Log.d("SensorFusion", "Test point added @ " + latitude + ", " + longitude); } + /** + * Initialises all sensors, processors, filters, and system components. + * + * This MUST be called before using SensorFusion. + * + * Responsibilities: + * - Initialise all hardware sensors (accelerometer, gyro, etc.) + * - Initialise WiFi, BLE, GNSS processors + * - Set up particle filter + EKF + * - Configure settings and filters + * - Start WiFi scanning + * - Acquire wake lock to keep device active during recording + * + * @param context Application context + */ public void setContext(Context context) { this.appContext = context.getApplicationContext(); // store app context for later use @@ -389,8 +415,6 @@ public void setContext(Context context) { this.bootTime = SystemClock.uptimeMillis(); // Initialise saveRecording to false this.saveRecording = false; - - // Other initialisations... this.accelMagnitude = new ArrayList<>(); this.pdrProcessing = new PdrProcessing(context); this.particleFilter = new ParticleFilter(); @@ -580,48 +604,6 @@ public void onSensorChanged(SensorEvent sensorEvent) { float[] ekfPrev = ekfPositioning.getBestEstimate(); ekfPositioning.predict(dx, dy); // Previous EKF position in ENU, for wall-slide constraint - - -// Wall-clamp the EKF position after each prediction step -// if (coordinateConverter != null -// && indoorMapManager != null -// && settings.getBoolean("use_wall_constraints", true)) { -// -// float[] ekfEst = ekfPositioning.getBestEstimate(); -// float[] clamped = indoorMapManager.clampToWallEnu(ekfPrev, ekfEst); -// -// boolean wasClamped = -// Math.abs(clamped[0] - ekfEst[0]) > 1e-4f || -// Math.abs(clamped[1] - ekfEst[1]) > 1e-4f; -// -// if (wasClamped) { -// ekfPositioning.resetAroundPosition(clamped[0], clamped[1], 2.0f); -// Log.d("SensorFusion", "EKF clamped to wall: (" -// + clamped[0] + ", " + clamped[1] + ")"); -// } -// } - - - // Wall-slide the EKF position after each prediction step -// if (coordinateConverter != null && indoorMapManager != null -// && settings.getBoolean("use_wall_constraints", true)) { -// float[] ekfEst = ekfPositioning.getBestEstimate(); -// if (prevEkfEnu != null) { -// float[] adjusted = indoorMapManager.slideAlongWallEnu(prevEkfEnu, ekfEst); -// if (adjusted != ekfEst) { -// ekfPositioning.resetAroundPosition(adjusted[0], adjusted[1], 2.0f); -// Log.d("SensorFusion", "EKF wall-slid to: (" -// + adjusted[0] + ", " + adjusted[1] + ")"); -// prevEkfEnu = adjusted; -// } else { -// prevEkfEnu = ekfEst.clone(); -// } -// } else { -// // First step — just record current position, no constraint to apply yet -// prevEkfEnu = ekfEst.clone(); -// } -// } - // Wall constraint for EKF after each prediction step if (coordinateConverter != null && indoorMapManager != null && settings.getBoolean("use_wall_constraints", true)) { @@ -814,18 +796,6 @@ public void onLocationChanged(@NonNull Location location) { lastGnssLatLon = new double[]{location.getLatitude(), location.getLongitude()}; } - // Detect floor change and reset particle cloud if needed - int currentFloor = pdrProcessing.getCurrentFloor(); -// if (currentFloor != lastKnownFloor) { -// float[] best = particleFilter.getBestEstimate(); -// particleFilter.resetAroundPosition(best[0], best[1], 8f); -// ekfPositioning.resetAroundPosition(best[0], best[1], 8f); -// Log.i("SensorFusion", "Floor change detected: " + lastKnownFloor -// + " → " + currentFloor + ", particles reset"); -// lastKnownFloor = currentFloor; -// -// } - } } if(saveRecording) { @@ -1385,23 +1355,6 @@ public void onError(String message) { /** Trajectory points accumulated during a session, used to redraw path on CorrectionFragment. */ private final List fusedTrajectoryPoints = new ArrayList<>(); -// public double[] getFusedLatLon() { -// boolean ekfReady = useEKF && ekfPositioning != null && ekfPositioning.isInitialized(); -// boolean pfReady = !useEKF && particleFilter != null && particleFilter.isInitialized(); -// if ((ekfReady || pfReady) && coordinateConverter != null) { -// float[] enu = useEKF ? ekfPositioning.getBestEstimate() -// : particleFilter.getBestEstimate(); -// double[] latLon = coordinateConverter.toLatLon(enu[0], enu[1]); -// -// // Only add points during active recording -// if (saveRecording && fusedTrajectoryPoints.size() < 2000) { -// fusedTrajectoryPoints.add(new LatLng(latLon[0], latLon[1])); -// } -// return latLon; -// } -// return null; -// } - /** Returns accumulated fused trajectory points for display in CorrectionFragment. */ public List getFusedTrajectoryPoints() { return fusedTrajectoryPoints; @@ -1418,15 +1371,6 @@ public double[] getLastWifiLatLon() { return lastWifiLatLon; } - /** Last PDR-derived position as lat/lon. Returns null before first step is detected. */ - public double[] getLastPdrLatLon() { - return lastPdrLatLon; - } - - public void resetFusedConstraintState() { - prevBestEnu = null; - } - /** * Returns the spread of the particle cloud in metres. * Use this to draw an uncertainty circle around the fused position marker. diff --git a/app/src/main/java/com/openpositioning/PositionMe/utils/IndoorMapManager.java b/app/src/main/java/com/openpositioning/PositionMe/utils/IndoorMapManager.java index a1b23a09..3d9d9767 100644 --- a/app/src/main/java/com/openpositioning/PositionMe/utils/IndoorMapManager.java +++ b/app/src/main/java/com/openpositioning/PositionMe/utils/IndoorMapManager.java @@ -76,15 +76,75 @@ public class IndoorMapManager { // List of currently drawn indoor floor polygons private final List activeFloorPolygons = new ArrayList<>(); + + // Distance (m) to consider user near stairs/floor features final double floorDistThresh = 5.0; + + // Distance (m) to consider user near a lift (tighter than stairs) final double liftDistThresh = 3.0; + // Last confirmed floor key used as baseline for floor change detection private String confirmedFloorKey = null; + + // Elevation (m) at which the current floor was confirmed (barometer reference) private float confirmedFloorElevation = Float.NaN; + // Handler to delay committing floor changes during UI floor browsing private final Handler floorCommitHandler = new Handler(Looper.getMainLooper()); + + // Delay (ms) before confirming a browsed floor as the active floor private static final long FLOOR_COMMIT_DELAY_MS = 1500; + // Timestamp of last accepted floor change (used to debounce rapid switches) + private long lastFloorChangeTimeMs = 0; + + // Minimum time (ms) between floor changes to prevent oscillation + private static final long MIN_FLOOR_CHANGE_INTERVAL_MS = 5000; + + // Required vertical change (m) to consider a real floor transition (barometer threshold) + private static final double HEIGHT_THRESHOLD_METERS = 4.5; + + // Max distance (m) to consider user near stairs for a valid floor change + private static final double STAIRS_THRESHOLD_METERS = 12.0; + + // Max distance (m) to consider user near a lift for a valid floor change + private static final double LIFT_THRESHOLD_METERS = 10.0; + + // Max horizontal movement (m) allowed for lift detection (lifts have minimal horizontal shift) + private static final double LIFT_HORIZONTAL_THRESHOLD_METERS = 1.0; + + // Tolerance for floating-point precision when checking line segment intersections + private static final float INTERSECTION_EPSILON = 1e-6f; + + // Tolerance for determining if a polygon ring is already closed (first ≈ last point) + private static final float RING_CLOSURE_EPSILON = 1e-4f; + + // Distance (m) to back off from a wall after detecting a collision (prevents sticking) + private static final float WALL_SNAP_BACK_METERS = 0.05f; + + // FLOOR TRANSITION TRACKING + + //location of where we starting changing floors + private LatLng floorTransitionStartLocation = null; + + private LatLng lastStableFloorLocation = null; + //are we potentially changing floors + private boolean floorTransitionInProgress = false; + + private static final float FLOOR_STABLE_BAND_METERS = 0.5f; + //threshold to start tracking as potential new floor transition + private static final float FLOOR_TRANSITION_START_THRESHOLD_METERS = 1.0f; + + /** + * Confirms the currently displayed floor as the user's reference floor. + * + * Stores both: + * - the current floor key, and + * - the current sensor-derived elevation at the moment of confirmation. + * + * This confirmed floor/elevation pair is later used as the baseline for + * detecting real floor changes. + */ private final Runnable commitBrowsedFloorRunnable = new Runnable() { @Override public void run() { @@ -106,10 +166,18 @@ public static class IndoorVenue{ public String rawMapShapes; public Map floorFeatures = new HashMap<>(); + // Stores all geometric features for a single floor, used for rendering and map-matching public static class FloorFeatures { + // Wall polygons in LatLng (used for drawing and geographic checks) public List> wallPolygons = new ArrayList<>(); + + // Wall polygons converted to ENU (meters) for efficient collision detection public List> wallPolygonsEnu = new ArrayList<>(); + + // Centroid positions of stair features (used for floor transition logic) public List stairsCenters = new ArrayList<>(); + + // Centroid positions of lift/elevator features (used for floor transition logic) public List liftCenters = new ArrayList<>(); } } @@ -199,31 +267,22 @@ public void selectVenue(IndoorVenue venue){ } } + /** - * Checks whether the movement from {@code fromEnu} to {@code toEnu} crosses any wall - * on the current floor. If it does, returns the last valid ENU position just before the - * wall (clamped via binary search). If no wall is crossed, returns {@code toEnu} unchanged. + * Prevents movement from passing through walls on the current floor. + * + * This checks whether the line segment from the previous ENU position to the + * proposed ENU position intersects any wall polygon edge. If no wall is crossed, + * the destination is returned unchanged. * - * Call this after every EKF prediction step, before reading the new state. + * If a wall is crossed, the movement is shortened so that the returned point + * lies just before the first wall intersection. This is used as a hard wall + * constraint for fused position estimates. * - * @param fromEnu float[]{east, north} — previous EKF position in metres - * @param toEnu float[]{east, north} — new EKF position after predict() - * @return clamped float[]{east, north}, or toEnu if no wall was crossed + * @param fromEnu Previous position in ENU metres: {east, north} + * @param toEnu Proposed new position in ENU metres: {east, north} + * @return Safe ENU position that does not cross a wall */ - public float[] clampToWallEnu(float[] fromEnu, float[] toEnu) { - if (currentVenue == null || currentFloorKey == null) return toEnu; - IndoorVenue.FloorFeatures floor = currentVenue.floorFeatures.get(currentFloorKey); - if (floor == null || floor.wallPolygonsEnu.isEmpty()) return toEnu; - - if (!crossesAnyWallEnu(fromEnu, toEnu, floor.wallPolygonsEnu)) return toEnu; - - return snapToWallEnu(fromEnu, toEnu, floor.wallPolygonsEnu); - } - - private static final float INTERSECTION_EPSILON = 1e-6f; - private static final float RING_CLOSURE_EPSILON = 1e-4f; - private static final float WALL_SNAP_BACK_METERS = 0.05f; - public float[] constrainMovementToWalls(float[] fromEnu, float[] toEnu) { if (fromEnu == null || toEnu == null) { return toEnu; @@ -249,10 +308,18 @@ public float[] constrainMovementToWalls(float[] fromEnu, float[] toEnu) { return moveToJustBeforeWall(fromEnu, toEnu, crossing.t, WALL_SNAP_BACK_METERS); } + // Represents where a movement path first intersects a wall edge in ENU space private static class WallCrossing { + // Exact ENU point where the path intersects the wall final float[] crossingPoint; + + // Index of the wall polygon that was intersected final int polygonIndex; + + // Index of the specific edge within the polygon that was hit final int edgeIndex; + + // Parametric position along the path (0=start, 1=end) where intersection occurs final float t; WallCrossing(float[] crossingPoint, int polygonIndex, int edgeIndex, float t) { @@ -263,6 +330,24 @@ private static class WallCrossing { } } + + /** + * Finds the earliest wall edge intersected by a movement segment. + * + * Iterates through all wall polygons on the current floor and checks every edge + * for intersection with the segment from {@code from} to {@code to}. If multiple + * walls are crossed, the closest one along the path is returned. + * + * The returned WallCrossing includes: + * - the intersection point, + * - which polygon and edge were hit, + * - the interpolation parameter t along the path. + * + * @param from Start ENU point {east, north} + * @param to End ENU point {east, north} + * @param walls List of wall polygons in ENU coordinates + * @return First wall crossing along the path, or null if no crossing occurs + */ private WallCrossing findFirstWallCrossing(float[] from, float[] to, List> walls) { @@ -296,6 +381,16 @@ private WallCrossing findFirstWallCrossing(float[] from, return best; } + /** + * Returns the number of usable edges in a polygon ring. + * + * Some polygon rings are explicitly closed, meaning the first and last point are + * the same. In that case, the final repeated point should not create an extra edge. + * This helper detects that case and returns the correct number of edges. + * + * @param ring Polygon ring as a list of ENU points + * @return Number of distinct edges in the ring + */ private int getRingEdgeCount(List ring) { if (ring == null || ring.size() < 2) return 0; @@ -309,6 +404,24 @@ private int getRingEdgeCount(List ring) { return alreadyClosed ? ring.size() - 1 : ring.size(); } + /** + * Computes the intersection parameter t for two line segments. + * + * The first segment is p1 -> p2, and the second is p3 -> p4. + * If the segments intersect, this returns the parameter t such that: + * + * intersection = p1 + t * (p2 - p1) + * + * where 0 <= t <= 1 means the intersection lies on the first segment. + * + * If the lines are parallel or the segments do not intersect, returns -1. + * + * @param p1 Start of first segment + * @param p2 End of first segment + * @param p3 Start of second segment + * @param p4 End of second segment + * @return Interpolation parameter t on first segment, or -1 if no intersection + */ private double intersectionT(float[] p1, float[] p2, float[] p3, float[] p4) { double rX = p2[0] - p1[0]; double rY = p2[1] - p1[1]; @@ -329,6 +442,20 @@ private double intersectionT(float[] p1, float[] p2, float[] p3, float[] p4) { return (t >= 0.0 && t <= 1.0 && u >= 0.0 && u <= 1.0) ? t : -1.0; } + /** + * Moves a point to just before a detected wall collision. + * + * Given a path from {@code from} to {@code to} and the interpolation value + * {@code hitT} where the wall was hit, this backs the point away slightly + * from the wall by {@code snapBackMeters}. This avoids leaving the estimate + * exactly on the wall boundary. + * + * @param from Start ENU point + * @param to End ENU point + * @param hitT Path interpolation value where wall is hit + * @param snapBackMeters Distance to back off from the wall + * @return Adjusted ENU position just before the wall + */ private float[] moveToJustBeforeWall(float[] from, float[] to, float hitT, float snapBackMeters) { float dx = to[0] - from[0]; float dy = to[1] - from[1]; @@ -347,7 +474,17 @@ private float[] moveToJustBeforeWall(float[] from, float[] to, float hitT, float }; } - + /** + * Checks whether a movement segment intersects any wall edge in ENU space. + * + * This is a broad collision test used before more detailed correction logic. + * It loops over every wall polygon and every edge within each polygon. + * + * @param from Start ENU point + * @param to End ENU point + * @param walls List of wall polygons in ENU coordinates + * @return true if the segment crosses at least one wall, false otherwise + */ private boolean crossesAnyWallEnu(float[] from, float[] to, List> walls) { for (List polygon : walls) { for (int i = 0; i < polygon.size(); i++) { @@ -359,7 +496,19 @@ private boolean crossesAnyWallEnu(float[] from, float[] to, List> return false; } - + /** + * Finds the furthest valid point along a path before hitting a wall. + * + * Uses binary search between {@code from} and {@code to} to find the last point + * that does not cross any wall. This is useful when a movement intersects a wall + * and we want to clamp the position as close as possible to the obstacle without + * crossing it. + * + * @param from Start ENU point + * @param to End ENU point + * @param allWalls List of all wall polygons in ENU coordinates + * @return Last valid ENU point before wall intersection + */ private float[] snapToWallEnu(float[] from, float[] to, List> allWalls) { float[] best = from.clone(); @@ -383,6 +532,20 @@ private float[] snapToWallEnu(float[] from, float[] to, return best; } + + /** + * Tests whether two 2D line segments intersect in ENU coordinates. + * + * Handles both proper crossings and edge cases such as collinear points + * or touching at endpoints. This is the core geometric primitive used by + * the wall constraint logic. + * + * @param p1 Start of first segment + * @param p2 End of first segment + * @param p3 Start of second segment + * @param p4 End of second segment + * @return true if the segments intersect, false otherwise + */ private boolean segmentsIntersectEnu(float[] p1, float[] p2, float[] p3, float[] p4) { double eps = 1e-6; @@ -406,16 +569,56 @@ private boolean segmentsIntersectEnu(float[] p1, float[] p2, float[] p3, float[] return false; } + /** + * Returns the signed orientation / cross product of three ENU points. + * + * Positive value -> c is to one side of line ab + * Negative value -> c is to the other side + * Near zero -> points are approximately collinear + * + * Used by segment intersection tests. + * + * @param a First point + * @param b Second point + * @param c Third point + * @return Signed 2D cross product value + */ private double orientation(float[] a, float[] b, float[] c) { return (b[0] - a[0]) * (c[1] - a[1]) - (b[1] - a[1]) * (c[0] - a[0]); } + /** + * Checks whether a point lies on a line segment in ENU space. + * + * Assumes the point is already known to be approximately collinear with the + * segment, and then checks whether it falls within the segment bounds. + * + * @param a Segment start + * @param p Candidate point + * @param b Segment end + * @param eps Tolerance for floating-point comparisons + * @return true if p lies on segment ab, false otherwise + */ private boolean onSegmentEnu(float[] a, float[] p, float[] b, double eps) { return p[0] >= Math.min(a[0], b[0]) - eps && p[0] <= Math.max(a[0], b[0]) + eps && p[1] >= Math.min(a[1], b[1]) - eps && p[1] <= Math.max(a[1], b[1]) + eps; } + + /** + * Precomputes ENU versions of wall polygons for the current floor. + * + * Converts all wall polygon LatLng coordinates into local East-North-Up metre + * coordinates using the supplied CoordinateConverter. This allows wall collision + * checks to be done in a consistent local metric coordinate system. + * + * Should be called whenever: + * - a new floor is shown, or + * - the coordinate converter becomes available / changes. + * + * @param converter Converter for LatLng <-> ENU transformations + */ public void bakeEnuCoordinates(CoordinateConverter converter) { if (currentVenue == null || currentFloorKey == null) return; IndoorVenue.FloorFeatures floor = currentVenue.floorFeatures.get(currentFloorKey); @@ -431,33 +634,7 @@ public void bakeEnuCoordinates(CoordinateConverter converter) { } Log.d("WallDebug", "Baked " + floor.wallPolygonsEnu.size() + " wall polygons to ENU"); } - private List getNearestWallPolygon(LatLng from, LatLng to, - List> wallPolygons) { - for (List polygon : wallPolygons) { - for (int i = 0; i < polygon.size(); i++) { - LatLng wallA = polygon.get(i); - LatLng wallB = polygon.get((i + 1) % polygon.size()); - if (segmentsIntersect(from, to, wallA, wallB)) return polygon; - } - } - return wallPolygons.get(0); // fallback, shouldn't reach here - } - private boolean crossesAnyWall(LatLng from, LatLng to, - List> wallPolygons) { - for (List polygon : wallPolygons) { - for (int i = 0; i < polygon.size(); i++) { - LatLng wallA = polygon.get(i); - LatLng wallB = polygon.get((i + 1) % polygon.size()); - if (segmentsIntersect(from, to, wallA, wallB)) { - Log.e("IndoorMapManager", "wall detected!"); - return true; - - } - } - } - return false; - } private LatLng toLatLng(float eastM, float northM, CoordinateConverter c) { double[] ll = c.toLatLon(eastM, northM); @@ -481,59 +658,6 @@ private static int orientation(LatLng a, LatLng b, LatLng c) { return (val > 0) ? 1 : 2; } - /** - * Finds gaps (doorways) in walls between two ENU positions by looking for - * wall segments that have a break/gap large enough to walk through (>0.6m). - * Returns a waypoint through the nearest gap, or null if no gap found. - */ - private float[] findGapBetweenPoints(float[] fromEnu, float[] toEnu, - List> walls) { - float[] bestGap = null; - double bestDist = Double.MAX_VALUE; - - // Direction vector from->to - float dx = toEnu[0] - fromEnu[0]; - float dy = toEnu[1] - fromEnu[1]; - float totalDist = (float) Math.sqrt(dx * dx + dy * dy); - if (totalDist < 1e-6f) return null; - - for (List polygon : walls) { - for (int i = 0; i < polygon.size(); i++) { - float[] a = polygon.get(i); - float[] b = polygon.get((i + 1) % polygon.size()); - - // Only consider wall segments that intersect our path - if (!segmentsIntersectEnu(fromEnu, toEnu, a, b)) continue; - - // Look for a gap by checking adjacent segments for a break - // A gap exists where two consecutive wall endpoints don't connect - float[] prev = polygon.get((i - 1 + polygon.size()) % polygon.size()); - float[] next = polygon.get((i + 2) % polygon.size()); - - // Check gap before segment a - float gapBeforeSize = (float) Math.sqrt( - Math.pow(a[0] - prev[1], 2) + Math.pow(a[1] - prev[1], 2)); - - // Check gap after segment b - float gapAfterSize = (float) Math.sqrt( - Math.pow(next[0] - b[0], 2) + Math.pow(next[1] - b[1], 2)); - - // Midpoint of segment as candidate gap point - float midX = (a[0] + b[0]) / 2f; - float midY = (a[1] + b[1]) / 2f; - - // Find closest point on the wall segment to our path - double distToMid = Math.sqrt( - Math.pow(midX - fromEnu[0], 2) + Math.pow(midY - fromEnu[1], 2)); - - if (distToMid < bestDist) { - bestDist = distToMid; - bestGap = new float[]{midX, midY}; - } - } - } - return bestGap; - } /** * When the EKF has teleported to the other side of a wall (e.g. after a @@ -625,6 +749,14 @@ public float[] reroutePrevEnu(float[] fromEnu, float[] toEnu) { private Circle activeAccessHighlight = null; + /** + * Draws a temporary visual highlight around a stairs/lift access point. + * + * Used to show the user which access point was selected during a floor change. + * Removes any previously drawn highlight before adding the new one. + * + * @param center Access point centre to highlight + */ public void highlightAccessPoint(LatLng center) { if (center == null || gMap == null) return; @@ -642,103 +774,7 @@ public void highlightAccessPoint(LatLng center) { ); } - private LatLng getWalkableSnapNearAccessPoint(LatLng accessCenter, - LatLng referenceLocation, - IndoorVenue.FloorFeatures floorFeatures) { - if (accessCenter == null) return referenceLocation; - if (floorFeatures == null) return accessCenter; - - // First try a point offset toward where the user came from - LatLng firstCandidate = offsetFromCenterTowardReference(accessCenter, referenceLocation, 1.5); - if (!isInsideAnyWall(firstCandidate, floorFeatures.wallPolygons)) { - return firstCandidate; - } - - // Then do a radial search around the center - double[] radii = {1.0, 1.5, 2.0, 2.5, 3.0}; - int angleStepDeg = 20; - - for (double radius : radii) { - for (int deg = 0; deg < 360; deg += angleStepDeg) { - double rad = Math.toRadians(deg); - double east = radius * Math.cos(rad); - double north = radius * Math.sin(rad); - - LatLng candidate = offsetLatLngMeters(accessCenter, east, north); - if (!isInsideAnyWall(candidate, floorFeatures.wallPolygons)) { - return candidate; - } - } - } - - // Fallback: keep the old corrected location if everything near the center is blocked - return referenceLocation; - } - - private boolean isPointInPolygon(LatLng point, List polygon) { - if (point == null || polygon == null || polygon.size() < 3) return false; - - boolean inside = false; - double x = point.longitude; - double y = point.latitude; - - for (int i = 0, j = polygon.size() - 1; i < polygon.size(); j = i++) { - double xi = polygon.get(i).longitude; - double yi = polygon.get(i).latitude; - double xj = polygon.get(j).longitude; - double yj = polygon.get(j).latitude; - - boolean intersect = ((yi > y) != (yj > y)) && - (x < (xj - xi) * (y - yi) / ((yj - yi) + 1e-12) + xi); - - if (intersect) inside = !inside; - } - - return inside; - } - - private boolean isInsideAnyWall(LatLng point, List> wallPolygons) { - if (point == null || wallPolygons == null) return false; - - for (List polygon : wallPolygons) { - if (polygon != null && polygon.size() >= 3 && isPointInPolygon(point, polygon)) { - return true; - } - } - return false; - } - - private LatLng offsetLatLngMeters(LatLng origin, double eastMeters, double northMeters) { - if (origin == null) return null; - - double latRad = Math.toRadians(origin.latitude); - - double dLat = northMeters / 111320.0; - double dLng = eastMeters / (111320.0 * Math.cos(latRad)); - - return new LatLng( - origin.latitude + dLat, - origin.longitude + dLng - ); - } - - private LatLng offsetFromCenterTowardReference(LatLng center, LatLng reference, double offsetMeters) { - if (center == null || reference == null) return center; - double dNorth = (reference.latitude - center.latitude) * 111320.0; - double dEast = (reference.longitude - center.longitude) * - 111320.0 * Math.cos(Math.toRadians(center.latitude)); - - double norm = Math.sqrt(dEast * dEast + dNorth * dNorth); - if (norm < 1e-6) { - return offsetLatLngMeters(center, offsetMeters, 0.0); - } - - double unitEast = dEast / norm; - double unitNorth = dNorth / norm; - - return offsetLatLngMeters(center, unitEast * offsetMeters, unitNorth * offsetMeters); - } /** * If the movement from fromEnu to toEnu crosses a wall, slides the destination @@ -807,38 +843,22 @@ public float[] slideAlongWallEnu(float[] fromEnu, float[] toEnu) { return slid; } - /* - takes endpoints of two segments and determines whether they intersect - */ - private static boolean segmentsIntersect(LatLng a, LatLng b, LatLng c, LatLng d) { - - int o1 = orientation(a, b, c); - int o2 = orientation(a, b, d); - int o3 = orientation(c, d, a); - int o4 = orientation(c, d, b); - - // Proper intersection - if (o1 != o2 && o3 != o4) { - return true; - } - - // Special cases (collinear) - if (o1 == 0 && onSegment(a, c, b)) return true; - if (o2 == 0 && onSegment(a, d, b)) return true; - if (o3 == 0 && onSegment(c, a, d)) return true; - if (o4 == 0 && onSegment(c, b, d)) return true; - - return false; - } - - private static boolean onSegment(LatLng a, LatLng p, LatLng b) { - return p.latitude <= Math.max(a.latitude, b.latitude) && - p.latitude >= Math.min(a.latitude, b.latitude) && - p.longitude <= Math.max(a.longitude, b.longitude) && - p.longitude >= Math.min(a.longitude, b.longitude); - } - /// height change = sensorfusion.getelevation + /** + * Applies wall-based correction to a predicted indoor location. + * + * Converts the old and predicted geographic coordinates into ENU space, checks + * whether the motion crosses a wall, and if so clamps the destination to just + * before the first wall hit. The corrected ENU point is then converted back to + * LatLng. + * + * This is the LatLng-facing version of the wall constraint logic. + * + * @param oldLocation Previous corrected location + * @param predictedLocation Newly predicted location + * @param heightChange Current vertical change estimate (currently not directly used here) + * @return Corrected location that does not pass through walls + */ public LatLng indoorLocationCorrection(LatLng oldLocation, LatLng predictedLocation, float heightChange) { @@ -886,25 +906,27 @@ public LatLng indoorLocationCorrection(LatLng oldLocation, } - - - //find nearest valid point that doesn't intersect walls - //loop through points on segment just traversed starting from predicted location back towards prev location - //use dx and dy - //once we find point that doesn't intersect wall - //corrected position = point - //break - - private long lastFloorChangeTimeMs = 0; - private static final long MIN_FLOOR_CHANGE_INTERVAL_MS = 5000; // 5 seconds minimum - private static final double HEIGHT_THRESHOLD_METERS = 4.5; - private static final double STAIRS_THRESHOLD_METERS = 12.0; - private static final double LIFT_THRESHOLD_METERS = 10.0; - private static final double LIFT_HORIZONTAL_THRESHOLD_METERS = 1.0; -// private LatLng floorTransitionStartLocation = null; -// private boolean floorTransitionInProgress = false; -// private static final float FLOOR_TRANSITION_START_THRESHOLD_METERS = 1.0f; - + /** + * Decides whether a proposed floor change should be accepted. + * + * A floor change is accepted only if: + * - there is a confirmed current floor reference, + * - enough time has passed since the last floor change, + * - the barometric height change exceeds a threshold, + * - the user is plausibly near stairs or a lift, + * - the horizontal movement pattern matches either stairs or lift usage. + * + * If accepted, the method: + * - determines the adjacent destination floor, + * - snaps the destination to the nearest stairs/lift centre on that floor, + * - commits the new floor state, + * - redraws the correct floor overlay. + * + * @param correctedLocation Current corrected location on map + * @param oldLocation Previous location + * @param currentHeight Current barometric height estimate + * @return FloorChangeResult describing whether the floor changed and where to snap the user + */ public FloorChangeResult acceptFloorChange(LatLng correctedLocation, LatLng oldLocation, float currentHeight) { @@ -955,14 +977,12 @@ public FloorChangeResult acceptFloorChange(LatLng correctedLocation, if (nextFloorKey == null || !currentVenue.floorFeatures.containsKey(nextFloorKey)) { Log.d("MapMatch", "Next floor invalid"); -// resetFloorTransitionState(); return new FloorChangeResult(currentFloorKey, correctedLocation, false, null); } IndoorVenue.FloorFeatures nextFloorFeatures = currentVenue.floorFeatures.get(nextFloorKey); if (nextFloorFeatures == null) { Log.d("MapMatch", "No floor features for destination floor: " + nextFloorKey); -// resetFloorTransitionState(); return new FloorChangeResult(currentFloorKey, correctedLocation, false, null); } @@ -978,25 +998,17 @@ public FloorChangeResult acceptFloorChange(LatLng correctedLocation, LIFT_THRESHOLD_METERS ); -// double horizontalDisplacement = getFloorTransitionHorizontalDisplacement(correctedLocation); -// resetFloorTransitionState(); boolean usedLift = nearLift && horizontalDisplacement < LIFT_HORIZONTAL_THRESHOLD_METERS; boolean usedStairs = false; -// if (!nearLift && nearStairs){ -// usedStairs = true; -// } -// else { usedStairs = nearStairs && horizontalDisplacement >= LIFT_HORIZONTAL_THRESHOLD_METERS; -// } Log.d("MapMatch", "nearStairs=" + nearStairs + ", nearLift=" + nearLift); Log.d("MapMatch", "horizontalDisplacement=" + horizontalDisplacement); Log.d("MapMatch", "usedLift=" + usedLift + ", usedStairs=" + usedStairs); if (!usedLift && !usedStairs) { Log.d("MapMatch", "Rejected floor change: not near stairs/lift in a plausible way"); -// resetFloorTransitionState(); return new FloorChangeResult(currentFloorKey, correctedLocation, false, null); } LatLng highlightCenter = null; @@ -1004,7 +1016,6 @@ public FloorChangeResult acceptFloorChange(LatLng correctedLocation, if (nextFloorKey.equals(confirmedFloorKey)) { -// resetFloorTransitionState(); return new FloorChangeResult(currentFloorKey, correctedLocation, false, null); } @@ -1023,11 +1034,6 @@ public FloorChangeResult acceptFloorChange(LatLng correctedLocation, if (nearestStairsOnNextFloor != null) { snappedDestination = nearestStairsOnNextFloor; -// snappedDestination = getWalkableSnapNearAccessPoint( -// nearestStairsOnNextFloor, -// oldLocation, -// nextFloorFeatures -// ); } } @@ -1041,25 +1047,13 @@ public FloorChangeResult acceptFloorChange(LatLng correctedLocation, (nextFloorFeatures.stairsCenters == null ? 0 : nextFloorFeatures.stairsCenters.size())); Log.d("MapMatch", "nextFloor lift count = " + (nextFloorFeatures.liftCenters == null ? 0 : nextFloorFeatures.liftCenters.size())); - showFloor(nextFloorKey); - - - return new FloorChangeResult(nextFloorKey, snappedDestination, true, highlightCenter); } - // ================= FLOOR TRANSITION TRACKING ================= - - private LatLng floorTransitionStartLocation = null; - private LatLng lastStableFloorLocation = null; - private boolean floorTransitionInProgress = false; - // Tune these based on your barometer noise - private static final float FLOOR_STABLE_BAND_METERS = 0.5f; // "definitely still on floor" - private static final float FLOOR_TRANSITION_START_THRESHOLD_METERS = 1.0f; // "transition has begun" /** * Updates transition tracking state. @@ -1164,6 +1158,16 @@ private void commitCurrentDisplayedFloor() { " at elevation " + confirmedFloorElevation); } + /** + * Returns the floor key directly above or below a given floor. + * + * Floors are first sorted into building order (e.g. B2, B1, G, 1, 2, ...), + * then the next key is selected using the supplied direction. + * + * @param floorKey Current floor key + * @param direction +1 for up one floor, -1 for down one floor + * @return Adjacent floor key, or null if none exists + */ private String getAdjacentFloorKey(String floorKey, int direction) { if (currentVenue == null || currentVenue.rawMapShapes == null) return null; @@ -1185,6 +1189,15 @@ private String getAdjacentFloorKey(String floorKey, int direction) { } } + /** + * Computes straight-line distance between two LatLng points in metres. + * + * Uses Android's Location.distanceBetween utility. + * + * @param a First point + * @param b Second point + * @return Distance in metres + */ private double distanceMeters(LatLng a, LatLng b) { float[] result = new float[1]; android.location.Location.distanceBetween( @@ -1195,6 +1208,17 @@ private double distanceMeters(LatLng a, LatLng b) { return result[0]; } + /** + * Checks whether a location lies within a threshold distance of any point in a list. + * + * Used for access-point logic such as determining whether the user is close enough + * to stairs or a lift for a floor change to be plausible. + * + * @param location Location to test + * @param centers Candidate reference points + * @param thresholdMeters Distance threshold in metres + * @return true if location is near at least one point + */ private boolean isNearAnyPoint(LatLng location, List centers, double thresholdMeters) { if (location == null || centers == null || centers.isEmpty()) { @@ -1212,76 +1236,6 @@ private boolean isNearAnyPoint(LatLng location, List centers, double thr return false; } - public LatLng adjustPositionToNearestValidLocation( - LatLng oldLocation, - LatLng predictedLocation, - List polygon) { - - LatLng bestValid = oldLocation; - - double low = 0.0; // valid end - double high = 1.0; // invalid end - - //binary search - for (int iter = 0; iter < 20; iter++) { - double mid = (low + high) / 2.0; - - double lat = oldLocation.latitude + - mid * (predictedLocation.latitude - oldLocation.latitude); - double lon = oldLocation.longitude + - mid * (predictedLocation.longitude - oldLocation.longitude); - - LatLng candidate = new LatLng(lat, lon); - - boolean intersectsWall = false; - - for (int i = 0; i < polygon.size(); i++) { - LatLng wallStart = polygon.get(i); - LatLng wallEnd = polygon.get((i + 1) % polygon.size()); - - if (segmentsIntersect(oldLocation, candidate, wallStart, wallEnd)) { - intersectsWall = true; - break; - } - } - - if (intersectsWall) { - high = mid; // candidate is invalid, search closer to oldLocation - } else { - low = mid; // candidate is valid, search closer to predictedLocation - bestValid = candidate; - } - } - - return bestValid; - } - - public void initializeFloorFromLocation(LatLng location) { - if (currentVenue == null) return; - - double bestDist = Double.MAX_VALUE; - String bestFloor = null; - - for (Map.Entry entry : currentVenue.floorFeatures.entrySet()) { - String floorKey = entry.getKey(); - IndoorVenue.FloorFeatures floor = entry.getValue(); - - // use centroid of walls (simple heuristic) - LatLng centroid = computeCentroid(floor.wallPolygons); - double dist = distanceMeters(location, centroid); - - if (dist < bestDist) { - bestDist = dist; - bestFloor = floorKey; - } - } - - if (bestFloor != null) { - currentFloorKey = bestFloor; - Log.d("FloorInit", "Initial floor set to " + bestFloor); - } - } - public LatLng computeCentroid(List> wallPolygons) { if (wallPolygons == null || wallPolygons.isEmpty()) { return null; @@ -1364,6 +1318,17 @@ private void switchFloor(int direction) { } } + /** + * Displays a specific floor immediately. + * + * Clears the existing floor overlay, redraws the requested floor, and rebakes + * ENU wall coordinates for map matching. + * + * Unlike delayed browsing logic, this is typically used when the floor should + * be shown directly, such as after an accepted automatic floor change. + * + * @param floorKey Floor key to display + */ private void showFloor(String floorKey) { if (currentVenue == null || currentVenue.rawMapShapes == null || floorKey == null) return; @@ -1384,6 +1349,16 @@ private void showFloor(String floorKey) { } } + /** + * Immediately commits an automatically detected floor change. + * + * Updates both the displayed floor and the confirmed floor reference, stores the + * elevation at which the change was accepted, cancels any pending delayed floor + * commit, and redraws the new floor overlay. + * + * @param newFloorKey Newly accepted floor + * @param elevation Elevation associated with the accepted floor change + */ private void commitAutoFloorChange(String newFloorKey, float elevation) { currentFloorKey = newFloorKey; confirmedFloorKey = newFloorKey; @@ -1437,7 +1412,6 @@ private void drawFloor(JSONObject floorGeoJson, String floorKey) throws JSONExce float strokeWidth = 2.0f; if (t.contains("wall")) { -// strokeColor = Color.RED; fillColor = Color.argb(0, 250, 0, 0); strokeWidth = 3.5f; } else if (t.contains("lift")) {