diff --git a/app/build.gradle b/app/build.gradle index bcba049..80b633f 100644 --- a/app/build.gradle +++ b/app/build.gradle @@ -3,11 +3,11 @@ plugins { } android { - namespace 'com.example.removemarineanimals' + namespace 'com.example.fivewheel' compileSdk 34 defaultConfig { - applicationId "com.example.removemarineanimals" + applicationId "com.example.fivewheel" minSdk 24 targetSdk 34 versionCode 1 diff --git a/app/src/androidTest/java/com/example/removemarineanimals/AppDatabase.java b/app/src/androidTest/java/com/example/fivewheel/AppDatabase.java similarity index 95% rename from app/src/androidTest/java/com/example/removemarineanimals/AppDatabase.java rename to app/src/androidTest/java/com/example/fivewheel/AppDatabase.java index b6c7326..f3e6427 100644 --- a/app/src/androidTest/java/com/example/removemarineanimals/AppDatabase.java +++ b/app/src/androidTest/java/com/example/fivewheel/AppDatabase.java @@ -1,4 +1,4 @@ -package com.example.removemarineanimals; +package com.example.fivewheel; import android.content.Context; diff --git a/app/src/androidTest/java/com/example/removemarineanimals/ExampleInstrumentedTest.java b/app/src/androidTest/java/com/example/fivewheel/ExampleInstrumentedTest.java similarity index 94% rename from app/src/androidTest/java/com/example/removemarineanimals/ExampleInstrumentedTest.java rename to app/src/androidTest/java/com/example/fivewheel/ExampleInstrumentedTest.java index 6a26675..3900c81 100644 --- a/app/src/androidTest/java/com/example/removemarineanimals/ExampleInstrumentedTest.java +++ b/app/src/androidTest/java/com/example/fivewheel/ExampleInstrumentedTest.java @@ -1,4 +1,4 @@ -package com.example.removemarineanimals; +package com.example.fivewheel; import android.content.Context; diff --git a/app/src/androidTest/java/com/example/removemarineanimals/RobotLog.java b/app/src/androidTest/java/com/example/fivewheel/RobotLog.java similarity index 92% rename from app/src/androidTest/java/com/example/removemarineanimals/RobotLog.java rename to app/src/androidTest/java/com/example/fivewheel/RobotLog.java index c0bf6dd..5c4aa52 100644 --- a/app/src/androidTest/java/com/example/removemarineanimals/RobotLog.java +++ b/app/src/androidTest/java/com/example/fivewheel/RobotLog.java @@ -1,4 +1,4 @@ -package com.example.removemarineanimals; +package com.example.fivewheel; import androidx.room.ColumnInfo; import androidx.room.Entity; diff --git a/app/src/androidTest/java/com/example/removemarineanimals/RobotLogDao.java b/app/src/androidTest/java/com/example/fivewheel/RobotLogDao.java similarity index 87% rename from app/src/androidTest/java/com/example/removemarineanimals/RobotLogDao.java rename to app/src/androidTest/java/com/example/fivewheel/RobotLogDao.java index 6544647..35e872e 100644 --- a/app/src/androidTest/java/com/example/removemarineanimals/RobotLogDao.java +++ b/app/src/androidTest/java/com/example/fivewheel/RobotLogDao.java @@ -1,4 +1,4 @@ -package com.example.removemarineanimals; +package com.example.fivewheel; import androidx.room.Dao; import androidx.room.Insert; diff --git a/app/src/main/java/bsp_Error.proto b/app/src/main/java/bsp_Error.proto index 9bad973..a29967a 100644 --- a/app/src/main/java/bsp_Error.proto +++ b/app/src/main/java/bsp_Error.proto @@ -1,7 +1,7 @@ syntax = "proto3"; option java_multiple_files = false; -option java_package = "com.example.removemarineanimals.models"; +option java_package = "com.example.fivewheel.models"; message ErrorData { diff --git a/app/src/main/java/bsp_IV.proto b/app/src/main/java/bsp_IV.proto index ccd3f4e..de9981e 100644 --- a/app/src/main/java/bsp_IV.proto +++ b/app/src/main/java/bsp_IV.proto @@ -1,6 +1,6 @@ syntax = "proto3"; option java_multiple_files = false; -option java_package = "com.example.removemarineanimals.models"; +option java_package = "com.example.fivewheel.models"; message IV_struct_define{ @@ -18,4 +18,7 @@ message IV_struct_define{ int32 Robot_Error_Left = 11; int32 Robot_Error_Right = 12; + int32 Robot_Compensation_Left = 13; + int32 Robot_Compensation_Right = 14; + }; diff --git a/app/src/main/java/bsp_PV.proto b/app/src/main/java/bsp_PV.proto index 6390c0f..9ee959b 100644 --- a/app/src/main/java/bsp_PV.proto +++ b/app/src/main/java/bsp_PV.proto @@ -1,12 +1,11 @@ syntax = "proto3"; option java_multiple_files = false; -option java_package = "com.example.removemarineanimals.models"; +option java_package = "com.example.fivewheel.models"; message PV_struct_define{ int32 Robot_ChgLength= 1; - double Robot_LeftCompensation=2; - double Robot_RightCompensation=3; - double Robot_AutoSpeedBase=4; - double Robot_ManualSpeedBase=5; + + double Robot_AutoSpeedBase=2; + double Robot_ManualSpeedBase=3; }; diff --git a/app/src/main/java/com/example/removemarineanimals/MainActivity - 副本.txt b/app/src/main/java/com/example/fivewheel/MainActivity - 副本.txt similarity index 100% rename from app/src/main/java/com/example/removemarineanimals/MainActivity - 副本.txt rename to app/src/main/java/com/example/fivewheel/MainActivity - 副本.txt diff --git a/app/src/main/java/com/example/removemarineanimals/MainActivity.java b/app/src/main/java/com/example/fivewheel/MainActivity.java similarity index 92% rename from app/src/main/java/com/example/removemarineanimals/MainActivity.java rename to app/src/main/java/com/example/fivewheel/MainActivity.java index 80ec2f0..1e84b75 100644 --- a/app/src/main/java/com/example/removemarineanimals/MainActivity.java +++ b/app/src/main/java/com/example/fivewheel/MainActivity.java @@ -1,4 +1,4 @@ -package com.example.removemarineanimals; +package com.example.fivewheel; import android.content.Context; import android.content.SharedPreferences; @@ -14,13 +14,13 @@ import androidx.databinding.DataBindingUtil; import androidx.lifecycle.ViewModelProvider; import androidx.lifecycle.ViewModelStoreOwner; -import com.example.removemarineanimals.databinding.ActivityMainBinding; -import com.example.removemarineanimals.models.BspPV; -import com.example.removemarineanimals.models.RobotRMACM; -import com.example.removemarineanimals.services.ModbusCRC; -import com.example.removemarineanimals.services.VideoPlayerHelper; -import com.example.removemarineanimals.services.ttySerialPortHelper; -import com.example.removemarineanimals.viewmodels.MainViewModel; +import com.example.fivewheel.databinding.ActivityMainBinding; +import com.example.fivewheel.models.BspPV; +import com.example.fivewheel.models.RobotRMACM; +import com.example.fivewheel.services.ModbusCRC; +import com.example.fivewheel.services.VideoPlayerHelper; +import com.example.fivewheel.services.ttySerialPortHelper; +import com.example.fivewheel.viewmodels.MainViewModel; import java.util.Timer; import java.util.TimerTask; @@ -205,8 +205,8 @@ public class MainActivity extends AppCompatActivity { setupIntegerEditText(mainBinding.tvRobotAutoSpeed); // 小数输入框 - setupDecimalEditText(mainBinding.tvRobotLeftCompensation); - setupDecimalEditText(mainBinding.tvRobotRightCompensation); +// setupDecimalEditText(mainBinding.tvRobotLeftCompensation); + // setupDecimalEditText(mainBinding.tvRobotRightCompensation); // 保存数据 @@ -227,8 +227,8 @@ public class MainActivity extends AppCompatActivity { mainBinding.rFAngleRoll.setText(String.valueOf(0)); mainBinding.tvRobotError.setText(String.valueOf(0)); mainBinding.tvRobotChgLength.setText(Str_RobotChgLength); - mainBinding.tvRobotLeftCompensation.setText(Str_RobotLeftCompensation); - mainBinding.tvRobotRightCompensation.setText(Str_RobotRightCompensation); + // mainBinding.tvRobotLeftCompensation.setText(Str_RobotLeftCompensation); + // mainBinding.tvRobotRightCompensation.setText(Str_RobotRightCompensation); mainBinding.tvForce.setText(String.valueOf(0)); mainBinding.tvRobotManualSpeed.setText(Str_RobotManualSpeed); mainBinding.tvRobotAutoSpeed.setText(Str_RobotAutoSpeed); @@ -271,8 +271,6 @@ public class MainActivity extends AppCompatActivity { _toSendPV = BspPV.PV_struct_define.newBuilder() .setRobotChgLength(getSafeInt(mainBinding.tvRobotChgLength, 0)) - .setRobotLeftCompensation(getSafeDouble(mainBinding.tvRobotLeftCompensation, 0.0)) - .setRobotRightCompensation(getSafeDouble(mainBinding.tvRobotRightCompensation, 0.0)) .setRobotAutoSpeedBase(getSafeDouble(mainBinding.tvRobotAutoSpeed, 0.0)) .setRobotManualSpeedBase(getSafeDouble(mainBinding.tvRobotManualSpeed, 0.0)) .build(); @@ -378,8 +376,6 @@ public class MainActivity extends AppCompatActivity { public void run() { _toSendPV = BspPV.PV_struct_define.newBuilder() .setRobotChgLength(Integer.parseInt(mainBinding.tvRobotChgLength.getText().toString())) - .setRobotLeftCompensation(Double.parseDouble(mainBinding.tvRobotLeftCompensation.getText().toString())) - .setRobotRightCompensation(Double.parseDouble(mainBinding.tvRobotRightCompensation.getText().toString())) .setRobotAutoSpeedBase(Double.parseDouble(mainBinding.tvRobotAutoSpeed.getText().toString())) .setRobotManualSpeedBase(Double.parseDouble(mainBinding.tvRobotManualSpeed.getText().toString())) .build(); diff --git a/app/src/main/java/com/example/removemarineanimals/models/BspError.java b/app/src/main/java/com/example/fivewheel/models/BspError.java similarity index 85% rename from app/src/main/java/com/example/removemarineanimals/models/BspError.java rename to app/src/main/java/com/example/fivewheel/models/BspError.java index a7010bd..ca7b356 100644 --- a/app/src/main/java/com/example/removemarineanimals/models/BspError.java +++ b/app/src/main/java/com/example/fivewheel/models/BspError.java @@ -3,7 +3,7 @@ // source: bsp_Error.proto // Protobuf Java Version: 4.27.2 -package com.example.removemarineanimals.models; +package com.example.fivewheel.models; public final class BspError { private BspError() {} @@ -171,7 +171,7 @@ public final class BspError { } public static final com.google.protobuf.Descriptors.EnumDescriptor getDescriptor() { - return com.example.removemarineanimals.models.BspError.getDescriptor().getEnumTypes().get(0); + return com.example.fivewheel.models.BspError.getDescriptor().getEnumTypes().get(0); } private static final ComError[] VALUES = values(); @@ -245,15 +245,15 @@ public final class BspError { public static final com.google.protobuf.Descriptors.Descriptor getDescriptor() { - return com.example.removemarineanimals.models.BspError.internal_static_ErrorData_descriptor; + return com.example.fivewheel.models.BspError.internal_static_ErrorData_descriptor; } @java.lang.Override protected com.google.protobuf.GeneratedMessage.FieldAccessorTable internalGetFieldAccessorTable() { - return com.example.removemarineanimals.models.BspError.internal_static_ErrorData_fieldAccessorTable + return com.example.fivewheel.models.BspError.internal_static_ErrorData_fieldAccessorTable .ensureFieldAccessorsInitialized( - com.example.removemarineanimals.models.BspError.ErrorData.class, com.example.removemarineanimals.models.BspError.ErrorData.Builder.class); + com.example.fivewheel.models.BspError.ErrorData.class, com.example.fivewheel.models.BspError.ErrorData.Builder.class); } public static final int COM_ERROR_CODE_FIELD_NUMBER = 1; @@ -343,10 +343,10 @@ public final class BspError { if (obj == this) { return true; } - if (!(obj instanceof com.example.removemarineanimals.models.BspError.ErrorData)) { + if (!(obj instanceof com.example.fivewheel.models.BspError.ErrorData)) { return super.equals(obj); } - com.example.removemarineanimals.models.BspError.ErrorData other = (com.example.removemarineanimals.models.BspError.ErrorData) obj; + com.example.fivewheel.models.BspError.ErrorData other = (com.example.fivewheel.models.BspError.ErrorData) obj; if (getComErrorCode() != other.getComErrorCode()) return false; @@ -376,44 +376,44 @@ public final class BspError { return hash; } - public static com.example.removemarineanimals.models.BspError.ErrorData parseFrom( + public static com.example.fivewheel.models.BspError.ErrorData parseFrom( java.nio.ByteBuffer data) throws com.google.protobuf.InvalidProtocolBufferException { return PARSER.parseFrom(data); } - public static com.example.removemarineanimals.models.BspError.ErrorData parseFrom( + public static com.example.fivewheel.models.BspError.ErrorData parseFrom( java.nio.ByteBuffer data, com.google.protobuf.ExtensionRegistryLite extensionRegistry) throws com.google.protobuf.InvalidProtocolBufferException { return PARSER.parseFrom(data, extensionRegistry); } - public static com.example.removemarineanimals.models.BspError.ErrorData parseFrom( + public static com.example.fivewheel.models.BspError.ErrorData parseFrom( com.google.protobuf.ByteString data) throws com.google.protobuf.InvalidProtocolBufferException { return PARSER.parseFrom(data); } - public static com.example.removemarineanimals.models.BspError.ErrorData parseFrom( + public static com.example.fivewheel.models.BspError.ErrorData parseFrom( com.google.protobuf.ByteString data, com.google.protobuf.ExtensionRegistryLite extensionRegistry) throws com.google.protobuf.InvalidProtocolBufferException { return PARSER.parseFrom(data, extensionRegistry); } - public static com.example.removemarineanimals.models.BspError.ErrorData parseFrom(byte[] data) + public static com.example.fivewheel.models.BspError.ErrorData parseFrom(byte[] data) throws com.google.protobuf.InvalidProtocolBufferException { return PARSER.parseFrom(data); } - public static com.example.removemarineanimals.models.BspError.ErrorData parseFrom( + public static com.example.fivewheel.models.BspError.ErrorData parseFrom( byte[] data, com.google.protobuf.ExtensionRegistryLite extensionRegistry) throws com.google.protobuf.InvalidProtocolBufferException { return PARSER.parseFrom(data, extensionRegistry); } - public static com.example.removemarineanimals.models.BspError.ErrorData parseFrom(java.io.InputStream input) + public static com.example.fivewheel.models.BspError.ErrorData parseFrom(java.io.InputStream input) throws java.io.IOException { return com.google.protobuf.GeneratedMessage .parseWithIOException(PARSER, input); } - public static com.example.removemarineanimals.models.BspError.ErrorData parseFrom( + public static com.example.fivewheel.models.BspError.ErrorData parseFrom( java.io.InputStream input, com.google.protobuf.ExtensionRegistryLite extensionRegistry) throws java.io.IOException { @@ -421,26 +421,26 @@ public final class BspError { .parseWithIOException(PARSER, input, extensionRegistry); } - public static com.example.removemarineanimals.models.BspError.ErrorData parseDelimitedFrom(java.io.InputStream input) + public static com.example.fivewheel.models.BspError.ErrorData parseDelimitedFrom(java.io.InputStream input) throws java.io.IOException { return com.google.protobuf.GeneratedMessage .parseDelimitedWithIOException(PARSER, input); } - public static com.example.removemarineanimals.models.BspError.ErrorData parseDelimitedFrom( + public static com.example.fivewheel.models.BspError.ErrorData 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.example.removemarineanimals.models.BspError.ErrorData parseFrom( + public static com.example.fivewheel.models.BspError.ErrorData parseFrom( com.google.protobuf.CodedInputStream input) throws java.io.IOException { return com.google.protobuf.GeneratedMessage .parseWithIOException(PARSER, input); } - public static com.example.removemarineanimals.models.BspError.ErrorData parseFrom( + public static com.example.fivewheel.models.BspError.ErrorData parseFrom( com.google.protobuf.CodedInputStream input, com.google.protobuf.ExtensionRegistryLite extensionRegistry) throws java.io.IOException { @@ -453,7 +453,7 @@ public final class BspError { public static Builder newBuilder() { return DEFAULT_INSTANCE.toBuilder(); } - public static Builder newBuilder(com.example.removemarineanimals.models.BspError.ErrorData prototype) { + public static Builder newBuilder(com.example.fivewheel.models.BspError.ErrorData prototype) { return DEFAULT_INSTANCE.toBuilder().mergeFrom(prototype); } @java.lang.Override @@ -474,18 +474,18 @@ public final class BspError { public static final class Builder extends com.google.protobuf.GeneratedMessage.Builder implements // @@protoc_insertion_point(builder_implements:ErrorData) - com.example.removemarineanimals.models.BspError.ErrorDataOrBuilder { + com.example.fivewheel.models.BspError.ErrorDataOrBuilder { public static final com.google.protobuf.Descriptors.Descriptor getDescriptor() { - return com.example.removemarineanimals.models.BspError.internal_static_ErrorData_descriptor; + return com.example.fivewheel.models.BspError.internal_static_ErrorData_descriptor; } @java.lang.Override protected com.google.protobuf.GeneratedMessage.FieldAccessorTable internalGetFieldAccessorTable() { - return com.example.removemarineanimals.models.BspError.internal_static_ErrorData_fieldAccessorTable + return com.example.fivewheel.models.BspError.internal_static_ErrorData_fieldAccessorTable .ensureFieldAccessorsInitialized( - com.example.removemarineanimals.models.BspError.ErrorData.class, com.example.removemarineanimals.models.BspError.ErrorData.Builder.class); + com.example.fivewheel.models.BspError.ErrorData.class, com.example.fivewheel.models.BspError.ErrorData.Builder.class); } // Construct using com.example.removemarineanimals.models.BspError.ErrorData.newBuilder() @@ -511,17 +511,17 @@ public final class BspError { @java.lang.Override public com.google.protobuf.Descriptors.Descriptor getDescriptorForType() { - return com.example.removemarineanimals.models.BspError.internal_static_ErrorData_descriptor; + return com.example.fivewheel.models.BspError.internal_static_ErrorData_descriptor; } @java.lang.Override - public com.example.removemarineanimals.models.BspError.ErrorData getDefaultInstanceForType() { - return com.example.removemarineanimals.models.BspError.ErrorData.getDefaultInstance(); + public com.example.fivewheel.models.BspError.ErrorData getDefaultInstanceForType() { + return com.example.fivewheel.models.BspError.ErrorData.getDefaultInstance(); } @java.lang.Override - public com.example.removemarineanimals.models.BspError.ErrorData build() { - com.example.removemarineanimals.models.BspError.ErrorData result = buildPartial(); + public com.example.fivewheel.models.BspError.ErrorData build() { + com.example.fivewheel.models.BspError.ErrorData result = buildPartial(); if (!result.isInitialized()) { throw newUninitializedMessageException(result); } @@ -529,14 +529,14 @@ public final class BspError { } @java.lang.Override - public com.example.removemarineanimals.models.BspError.ErrorData buildPartial() { - com.example.removemarineanimals.models.BspError.ErrorData result = new com.example.removemarineanimals.models.BspError.ErrorData(this); + public com.example.fivewheel.models.BspError.ErrorData buildPartial() { + com.example.fivewheel.models.BspError.ErrorData result = new com.example.fivewheel.models.BspError.ErrorData(this); if (bitField0_ != 0) { buildPartial0(result); } onBuilt(); return result; } - private void buildPartial0(com.example.removemarineanimals.models.BspError.ErrorData result) { + private void buildPartial0(com.example.fivewheel.models.BspError.ErrorData result) { int from_bitField0_ = bitField0_; if (((from_bitField0_ & 0x00000001) != 0)) { result.comErrorCode_ = comErrorCode_; @@ -551,16 +551,16 @@ public final class BspError { @java.lang.Override public Builder mergeFrom(com.google.protobuf.Message other) { - if (other instanceof com.example.removemarineanimals.models.BspError.ErrorData) { - return mergeFrom((com.example.removemarineanimals.models.BspError.ErrorData)other); + if (other instanceof com.example.fivewheel.models.BspError.ErrorData) { + return mergeFrom((com.example.fivewheel.models.BspError.ErrorData)other); } else { super.mergeFrom(other); return this; } } - public Builder mergeFrom(com.example.removemarineanimals.models.BspError.ErrorData other) { - if (other == com.example.removemarineanimals.models.BspError.ErrorData.getDefaultInstance()) return this; + public Builder mergeFrom(com.example.fivewheel.models.BspError.ErrorData other) { + if (other == com.example.fivewheel.models.BspError.ErrorData.getDefaultInstance()) return this; if (other.getComErrorCode() != 0) { setComErrorCode(other.getComErrorCode()); } @@ -728,12 +728,12 @@ public final class BspError { } // @@protoc_insertion_point(class_scope:ErrorData) - private static final com.example.removemarineanimals.models.BspError.ErrorData DEFAULT_INSTANCE; + private static final com.example.fivewheel.models.BspError.ErrorData DEFAULT_INSTANCE; static { - DEFAULT_INSTANCE = new com.example.removemarineanimals.models.BspError.ErrorData(); + DEFAULT_INSTANCE = new com.example.fivewheel.models.BspError.ErrorData(); } - public static com.example.removemarineanimals.models.BspError.ErrorData getDefaultInstance() { + public static com.example.fivewheel.models.BspError.ErrorData getDefaultInstance() { return DEFAULT_INSTANCE; } @@ -769,7 +769,7 @@ public final class BspError { } @java.lang.Override - public com.example.removemarineanimals.models.BspError.ErrorData getDefaultInstanceForType() { + public com.example.fivewheel.models.BspError.ErrorData getDefaultInstanceForType() { return DEFAULT_INSTANCE; } diff --git a/app/src/main/java/com/example/removemarineanimals/models/BspIV.java b/app/src/main/java/com/example/fivewheel/models/BspIV.java similarity index 81% rename from app/src/main/java/com/example/removemarineanimals/models/BspIV.java rename to app/src/main/java/com/example/fivewheel/models/BspIV.java index 61fc59e..ffb979f 100644 --- a/app/src/main/java/com/example/removemarineanimals/models/BspIV.java +++ b/app/src/main/java/com/example/fivewheel/models/BspIV.java @@ -3,7 +3,7 @@ // source: bsp_IV.proto // Protobuf Java Version: 4.27.2 -package com.example.removemarineanimals.models; +package com.example.fivewheel.models; public final class BspIV { private BspIV() {} @@ -104,6 +104,18 @@ public final class BspIV { * @return The robotErrorRight. */ int getRobotErrorRight(); + + /** + * int32 Robot_Compensation_Left = 13; + * @return The robotCompensationLeft. + */ + int getRobotCompensationLeft(); + + /** + * int32 Robot_Compensation_Right = 14; + * @return The robotCompensationRight. + */ + int getRobotCompensationRight(); } /** * Protobuf type {@code IV_struct_define} @@ -131,15 +143,15 @@ public final class BspIV { public static final com.google.protobuf.Descriptors.Descriptor getDescriptor() { - return com.example.removemarineanimals.models.BspIV.internal_static_IV_struct_define_descriptor; + return com.example.fivewheel.models.BspIV.internal_static_IV_struct_define_descriptor; } @java.lang.Override protected com.google.protobuf.GeneratedMessage.FieldAccessorTable internalGetFieldAccessorTable() { - return com.example.removemarineanimals.models.BspIV.internal_static_IV_struct_define_fieldAccessorTable + return com.example.fivewheel.models.BspIV.internal_static_IV_struct_define_fieldAccessorTable .ensureFieldAccessorsInitialized( - com.example.removemarineanimals.models.BspIV.IV_struct_define.class, com.example.removemarineanimals.models.BspIV.IV_struct_define.Builder.class); + com.example.fivewheel.models.BspIV.IV_struct_define.class, com.example.fivewheel.models.BspIV.IV_struct_define.Builder.class); } public static final int ROBOT_MOVE_AUTOSPEED_FIELD_NUMBER = 1; @@ -278,6 +290,28 @@ public final class BspIV { return robotErrorRight_; } + public static final int ROBOT_COMPENSATION_LEFT_FIELD_NUMBER = 13; + private int robotCompensationLeft_ = 0; + /** + * int32 Robot_Compensation_Left = 13; + * @return The robotCompensationLeft. + */ + @java.lang.Override + public int getRobotCompensationLeft() { + return robotCompensationLeft_; + } + + public static final int ROBOT_COMPENSATION_RIGHT_FIELD_NUMBER = 14; + private int robotCompensationRight_ = 0; + /** + * int32 Robot_Compensation_Right = 14; + * @return The robotCompensationRight. + */ + @java.lang.Override + public int getRobotCompensationRight() { + return robotCompensationRight_; + } + private byte memoizedIsInitialized = -1; @java.lang.Override public final boolean isInitialized() { @@ -328,6 +362,12 @@ public final class BspIV { if (robotErrorRight_ != 0) { output.writeInt32(12, robotErrorRight_); } + if (robotCompensationLeft_ != 0) { + output.writeInt32(13, robotCompensationLeft_); + } + if (robotCompensationRight_ != 0) { + output.writeInt32(14, robotCompensationRight_); + } getUnknownFields().writeTo(output); } @@ -385,6 +425,14 @@ public final class BspIV { size += com.google.protobuf.CodedOutputStream .computeInt32Size(12, robotErrorRight_); } + if (robotCompensationLeft_ != 0) { + size += com.google.protobuf.CodedOutputStream + .computeInt32Size(13, robotCompensationLeft_); + } + if (robotCompensationRight_ != 0) { + size += com.google.protobuf.CodedOutputStream + .computeInt32Size(14, robotCompensationRight_); + } size += getUnknownFields().getSerializedSize(); memoizedSize = size; return size; @@ -395,10 +443,10 @@ public final class BspIV { if (obj == this) { return true; } - if (!(obj instanceof com.example.removemarineanimals.models.BspIV.IV_struct_define)) { + if (!(obj instanceof com.example.fivewheel.models.BspIV.IV_struct_define)) { return super.equals(obj); } - com.example.removemarineanimals.models.BspIV.IV_struct_define other = (com.example.removemarineanimals.models.BspIV.IV_struct_define) obj; + com.example.fivewheel.models.BspIV.IV_struct_define other = (com.example.fivewheel.models.BspIV.IV_struct_define) obj; if (getRobotMoveAutoSpeed() != other.getRobotMoveAutoSpeed()) return false; @@ -424,6 +472,10 @@ public final class BspIV { != other.getRobotErrorLeft()) return false; if (getRobotErrorRight() != other.getRobotErrorRight()) return false; + if (getRobotCompensationLeft() + != other.getRobotCompensationLeft()) return false; + if (getRobotCompensationRight() + != other.getRobotCompensationRight()) return false; if (!getUnknownFields().equals(other.getUnknownFields())) return false; return true; } @@ -459,49 +511,53 @@ public final class BspIV { hash = (53 * hash) + getRobotErrorLeft(); hash = (37 * hash) + ROBOT_ERROR_RIGHT_FIELD_NUMBER; hash = (53 * hash) + getRobotErrorRight(); + hash = (37 * hash) + ROBOT_COMPENSATION_LEFT_FIELD_NUMBER; + hash = (53 * hash) + getRobotCompensationLeft(); + hash = (37 * hash) + ROBOT_COMPENSATION_RIGHT_FIELD_NUMBER; + hash = (53 * hash) + getRobotCompensationRight(); hash = (29 * hash) + getUnknownFields().hashCode(); memoizedHashCode = hash; return hash; } - public static com.example.removemarineanimals.models.BspIV.IV_struct_define parseFrom( + public static com.example.fivewheel.models.BspIV.IV_struct_define parseFrom( java.nio.ByteBuffer data) throws com.google.protobuf.InvalidProtocolBufferException { return PARSER.parseFrom(data); } - public static com.example.removemarineanimals.models.BspIV.IV_struct_define parseFrom( + public static com.example.fivewheel.models.BspIV.IV_struct_define parseFrom( java.nio.ByteBuffer data, com.google.protobuf.ExtensionRegistryLite extensionRegistry) throws com.google.protobuf.InvalidProtocolBufferException { return PARSER.parseFrom(data, extensionRegistry); } - public static com.example.removemarineanimals.models.BspIV.IV_struct_define parseFrom( + public static com.example.fivewheel.models.BspIV.IV_struct_define parseFrom( com.google.protobuf.ByteString data) throws com.google.protobuf.InvalidProtocolBufferException { return PARSER.parseFrom(data); } - public static com.example.removemarineanimals.models.BspIV.IV_struct_define parseFrom( + public static com.example.fivewheel.models.BspIV.IV_struct_define parseFrom( com.google.protobuf.ByteString data, com.google.protobuf.ExtensionRegistryLite extensionRegistry) throws com.google.protobuf.InvalidProtocolBufferException { return PARSER.parseFrom(data, extensionRegistry); } - public static com.example.removemarineanimals.models.BspIV.IV_struct_define parseFrom(byte[] data) + public static com.example.fivewheel.models.BspIV.IV_struct_define parseFrom(byte[] data) throws com.google.protobuf.InvalidProtocolBufferException { return PARSER.parseFrom(data); } - public static com.example.removemarineanimals.models.BspIV.IV_struct_define parseFrom( + public static com.example.fivewheel.models.BspIV.IV_struct_define parseFrom( byte[] data, com.google.protobuf.ExtensionRegistryLite extensionRegistry) throws com.google.protobuf.InvalidProtocolBufferException { return PARSER.parseFrom(data, extensionRegistry); } - public static com.example.removemarineanimals.models.BspIV.IV_struct_define parseFrom(java.io.InputStream input) + public static com.example.fivewheel.models.BspIV.IV_struct_define parseFrom(java.io.InputStream input) throws java.io.IOException { return com.google.protobuf.GeneratedMessage .parseWithIOException(PARSER, input); } - public static com.example.removemarineanimals.models.BspIV.IV_struct_define parseFrom( + public static com.example.fivewheel.models.BspIV.IV_struct_define parseFrom( java.io.InputStream input, com.google.protobuf.ExtensionRegistryLite extensionRegistry) throws java.io.IOException { @@ -509,26 +565,26 @@ public final class BspIV { .parseWithIOException(PARSER, input, extensionRegistry); } - public static com.example.removemarineanimals.models.BspIV.IV_struct_define parseDelimitedFrom(java.io.InputStream input) + public static com.example.fivewheel.models.BspIV.IV_struct_define parseDelimitedFrom(java.io.InputStream input) throws java.io.IOException { return com.google.protobuf.GeneratedMessage .parseDelimitedWithIOException(PARSER, input); } - public static com.example.removemarineanimals.models.BspIV.IV_struct_define parseDelimitedFrom( + public static com.example.fivewheel.models.BspIV.IV_struct_define 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.example.removemarineanimals.models.BspIV.IV_struct_define parseFrom( + public static com.example.fivewheel.models.BspIV.IV_struct_define parseFrom( com.google.protobuf.CodedInputStream input) throws java.io.IOException { return com.google.protobuf.GeneratedMessage .parseWithIOException(PARSER, input); } - public static com.example.removemarineanimals.models.BspIV.IV_struct_define parseFrom( + public static com.example.fivewheel.models.BspIV.IV_struct_define parseFrom( com.google.protobuf.CodedInputStream input, com.google.protobuf.ExtensionRegistryLite extensionRegistry) throws java.io.IOException { @@ -541,7 +597,7 @@ public final class BspIV { public static Builder newBuilder() { return DEFAULT_INSTANCE.toBuilder(); } - public static Builder newBuilder(com.example.removemarineanimals.models.BspIV.IV_struct_define prototype) { + public static Builder newBuilder(com.example.fivewheel.models.BspIV.IV_struct_define prototype) { return DEFAULT_INSTANCE.toBuilder().mergeFrom(prototype); } @java.lang.Override @@ -562,21 +618,21 @@ public final class BspIV { public static final class Builder extends com.google.protobuf.GeneratedMessage.Builder implements // @@protoc_insertion_point(builder_implements:IV_struct_define) - com.example.removemarineanimals.models.BspIV.IV_struct_defineOrBuilder { + com.example.fivewheel.models.BspIV.IV_struct_defineOrBuilder { public static final com.google.protobuf.Descriptors.Descriptor getDescriptor() { - return com.example.removemarineanimals.models.BspIV.internal_static_IV_struct_define_descriptor; + return com.example.fivewheel.models.BspIV.internal_static_IV_struct_define_descriptor; } @java.lang.Override protected com.google.protobuf.GeneratedMessage.FieldAccessorTable internalGetFieldAccessorTable() { - return com.example.removemarineanimals.models.BspIV.internal_static_IV_struct_define_fieldAccessorTable + return com.example.fivewheel.models.BspIV.internal_static_IV_struct_define_fieldAccessorTable .ensureFieldAccessorsInitialized( - com.example.removemarineanimals.models.BspIV.IV_struct_define.class, com.example.removemarineanimals.models.BspIV.IV_struct_define.Builder.class); + com.example.fivewheel.models.BspIV.IV_struct_define.class, com.example.fivewheel.models.BspIV.IV_struct_define.Builder.class); } - // Construct using com.example.removemarineanimals.models.BspIV.IV_struct_define.newBuilder() + // Construct using com.example.fivewheel.models.BspIV.IV_struct_define.newBuilder() private Builder() { } @@ -602,23 +658,25 @@ public final class BspIV { robotCurrentRight_ = 0; robotErrorLeft_ = 0; robotErrorRight_ = 0; + robotCompensationLeft_ = 0; + robotCompensationRight_ = 0; return this; } @java.lang.Override public com.google.protobuf.Descriptors.Descriptor getDescriptorForType() { - return com.example.removemarineanimals.models.BspIV.internal_static_IV_struct_define_descriptor; + return com.example.fivewheel.models.BspIV.internal_static_IV_struct_define_descriptor; } @java.lang.Override - public com.example.removemarineanimals.models.BspIV.IV_struct_define getDefaultInstanceForType() { - return com.example.removemarineanimals.models.BspIV.IV_struct_define.getDefaultInstance(); + public com.example.fivewheel.models.BspIV.IV_struct_define getDefaultInstanceForType() { + return com.example.fivewheel.models.BspIV.IV_struct_define.getDefaultInstance(); } @java.lang.Override - public com.example.removemarineanimals.models.BspIV.IV_struct_define build() { - com.example.removemarineanimals.models.BspIV.IV_struct_define result = buildPartial(); + public com.example.fivewheel.models.BspIV.IV_struct_define build() { + com.example.fivewheel.models.BspIV.IV_struct_define result = buildPartial(); if (!result.isInitialized()) { throw newUninitializedMessageException(result); } @@ -626,14 +684,14 @@ public final class BspIV { } @java.lang.Override - public com.example.removemarineanimals.models.BspIV.IV_struct_define buildPartial() { - com.example.removemarineanimals.models.BspIV.IV_struct_define result = new com.example.removemarineanimals.models.BspIV.IV_struct_define(this); + public com.example.fivewheel.models.BspIV.IV_struct_define buildPartial() { + com.example.fivewheel.models.BspIV.IV_struct_define result = new com.example.fivewheel.models.BspIV.IV_struct_define(this); if (bitField0_ != 0) { buildPartial0(result); } onBuilt(); return result; } - private void buildPartial0(com.example.removemarineanimals.models.BspIV.IV_struct_define result) { + private void buildPartial0(com.example.fivewheel.models.BspIV.IV_struct_define result) { int from_bitField0_ = bitField0_; if (((from_bitField0_ & 0x00000001) != 0)) { result.robotMoveAutoSpeed_ = robotMoveAutoSpeed_; @@ -671,20 +729,26 @@ public final class BspIV { if (((from_bitField0_ & 0x00000800) != 0)) { result.robotErrorRight_ = robotErrorRight_; } + if (((from_bitField0_ & 0x00001000) != 0)) { + result.robotCompensationLeft_ = robotCompensationLeft_; + } + if (((from_bitField0_ & 0x00002000) != 0)) { + result.robotCompensationRight_ = robotCompensationRight_; + } } @java.lang.Override public Builder mergeFrom(com.google.protobuf.Message other) { - if (other instanceof com.example.removemarineanimals.models.BspIV.IV_struct_define) { - return mergeFrom((com.example.removemarineanimals.models.BspIV.IV_struct_define)other); + if (other instanceof com.example.fivewheel.models.BspIV.IV_struct_define) { + return mergeFrom((com.example.fivewheel.models.BspIV.IV_struct_define)other); } else { super.mergeFrom(other); return this; } } - public Builder mergeFrom(com.example.removemarineanimals.models.BspIV.IV_struct_define other) { - if (other == com.example.removemarineanimals.models.BspIV.IV_struct_define.getDefaultInstance()) return this; + public Builder mergeFrom(com.example.fivewheel.models.BspIV.IV_struct_define other) { + if (other == com.example.fivewheel.models.BspIV.IV_struct_define.getDefaultInstance()) return this; if (other.getRobotMoveAutoSpeed() != 0) { setRobotMoveAutoSpeed(other.getRobotMoveAutoSpeed()); } @@ -721,6 +785,12 @@ public final class BspIV { if (other.getRobotErrorRight() != 0) { setRobotErrorRight(other.getRobotErrorRight()); } + if (other.getRobotCompensationLeft() != 0) { + setRobotCompensationLeft(other.getRobotCompensationLeft()); + } + if (other.getRobotCompensationRight() != 0) { + setRobotCompensationRight(other.getRobotCompensationRight()); + } this.mergeUnknownFields(other.getUnknownFields()); onChanged(); return this; @@ -807,6 +877,16 @@ public final class BspIV { bitField0_ |= 0x00000800; break; } // case 96 + case 104: { + robotCompensationLeft_ = input.readInt32(); + bitField0_ |= 0x00001000; + break; + } // case 104 + case 112: { + robotCompensationRight_ = input.readInt32(); + bitField0_ |= 0x00002000; + break; + } // case 112 default: { if (!super.parseUnknownField(input, extensionRegistry, tag)) { done = true; // was an endgroup tag @@ -1220,16 +1300,80 @@ public final class BspIV { return this; } + private int robotCompensationLeft_ ; + /** + * int32 Robot_Compensation_Left = 13; + * @return The robotCompensationLeft. + */ + @java.lang.Override + public int getRobotCompensationLeft() { + return robotCompensationLeft_; + } + /** + * int32 Robot_Compensation_Left = 13; + * @param value The robotCompensationLeft to set. + * @return This builder for chaining. + */ + public Builder setRobotCompensationLeft(int value) { + + robotCompensationLeft_ = value; + bitField0_ |= 0x00001000; + onChanged(); + return this; + } + /** + * int32 Robot_Compensation_Left = 13; + * @return This builder for chaining. + */ + public Builder clearRobotCompensationLeft() { + bitField0_ = (bitField0_ & ~0x00001000); + robotCompensationLeft_ = 0; + onChanged(); + return this; + } + + private int robotCompensationRight_ ; + /** + * int32 Robot_Compensation_Right = 14; + * @return The robotCompensationRight. + */ + @java.lang.Override + public int getRobotCompensationRight() { + return robotCompensationRight_; + } + /** + * int32 Robot_Compensation_Right = 14; + * @param value The robotCompensationRight to set. + * @return This builder for chaining. + */ + public Builder setRobotCompensationRight(int value) { + + robotCompensationRight_ = value; + bitField0_ |= 0x00002000; + onChanged(); + return this; + } + /** + * int32 Robot_Compensation_Right = 14; + * @return This builder for chaining. + */ + public Builder clearRobotCompensationRight() { + bitField0_ = (bitField0_ & ~0x00002000); + robotCompensationRight_ = 0; + onChanged(); + return this; + } + // @@protoc_insertion_point(builder_scope:IV_struct_define) } // @@protoc_insertion_point(class_scope:IV_struct_define) - private static final com.example.removemarineanimals.models.BspIV.IV_struct_define DEFAULT_INSTANCE; + private static final com.example.fivewheel.models.BspIV.IV_struct_define DEFAULT_INSTANCE; static { - DEFAULT_INSTANCE = new com.example.removemarineanimals.models.BspIV.IV_struct_define(); + DEFAULT_INSTANCE = new com.example.fivewheel.models.BspIV.IV_struct_define(); } - public static com.example.removemarineanimals.models.BspIV.IV_struct_define getDefaultInstance() { + public static com.example.fivewheel.models.BspIV.IV_struct_define getDefaultInstance() { return DEFAULT_INSTANCE; } @@ -1265,7 +1409,7 @@ public final class BspIV { } @java.lang.Override - public com.example.removemarineanimals.models.BspIV.IV_struct_define getDefaultInstanceForType() { + public com.example.fivewheel.models.BspIV.IV_struct_define getDefaultInstanceForType() { return DEFAULT_INSTANCE; } @@ -1285,7 +1429,7 @@ public final class BspIV { descriptor; static { java.lang.String[] descriptorData = { - "\n\014bsp_IV.proto\"\341\002\n\020IV_struct_define\022\034\n\024R" + + "\n\014bsp_IV.proto\"\244\003\n\020IV_struct_define\022\034\n\024R" + "obot_Move_AutoSpeed\030\001 \001(\005\022\036\n\026Robot_Move_" + "ManualSpeed\030\002 \001(\005\022\035\n\025Robot_CurrentPositi" + "on\030\003 \001(\005\022\027\n\017Robot_AngleRoll\030\004 \001(\005\022\023\n\013Rob" + @@ -1294,8 +1438,9 @@ public final class BspIV { "t_CurrentState\030\010 \001(\005\022\032\n\022Robot_Current_Le" + "ft\030\t \001(\005\022\033\n\023Robot_Current_Right\030\n \001(\005\022\030\n" + "\020Robot_Error_Left\030\013 \001(\005\022\031\n\021Robot_Error_R" + - "ight\030\014 \001(\005B*\n&com.example.removemarinean" + - "imals.modelsP\000b\006proto3" + "ight\030\014 \001(\005\022\037\n\027Robot_Compensation_Left\030\r " + + "\001(\005\022 \n\030Robot_Compensation_Right\030\016 \001(\005B \n" + + "\034com.example.fivewheel.modelsP\000b\006proto3" }; descriptor = com.google.protobuf.Descriptors.FileDescriptor .internalBuildGeneratedFileFrom(descriptorData, @@ -1306,7 +1451,7 @@ public final class BspIV { internal_static_IV_struct_define_fieldAccessorTable = new com.google.protobuf.GeneratedMessage.FieldAccessorTable( internal_static_IV_struct_define_descriptor, - new java.lang.String[] { "RobotMoveAutoSpeed", "RobotMoveManualSpeed", "RobotCurrentPosition", "RobotAngleRoll", "RobotError", "RobotDynamometerValue", "RobotForceValue", "RobotCurrentState", "RobotCurrentLeft", "RobotCurrentRight", "RobotErrorLeft", "RobotErrorRight", }); + new java.lang.String[] { "RobotMoveAutoSpeed", "RobotMoveManualSpeed", "RobotCurrentPosition", "RobotAngleRoll", "RobotError", "RobotDynamometerValue", "RobotForceValue", "RobotCurrentState", "RobotCurrentLeft", "RobotCurrentRight", "RobotErrorLeft", "RobotErrorRight", "RobotCompensationLeft", "RobotCompensationRight", }); descriptor.resolveAllFeaturesImmutable(); } diff --git a/app/src/main/java/com/example/removemarineanimals/models/BspPV.java b/app/src/main/java/com/example/fivewheel/models/BspPV.java similarity index 86% rename from app/src/main/java/com/example/removemarineanimals/models/BspPV.java rename to app/src/main/java/com/example/fivewheel/models/BspPV.java index 05a7fa5..9b4de14 100644 --- a/app/src/main/java/com/example/removemarineanimals/models/BspPV.java +++ b/app/src/main/java/com/example/fivewheel/models/BspPV.java @@ -3,7 +3,7 @@ // source: bsp_PV.proto // Protobuf Java Version: 4.27.2 -package com.example.removemarineanimals.models; +package com.example.fivewheel.models; public final class BspPV { private BspPV() {} @@ -85,15 +85,15 @@ public final class BspPV { public static final com.google.protobuf.Descriptors.Descriptor getDescriptor() { - return com.example.removemarineanimals.models.BspPV.internal_static_PV_struct_define_descriptor; + return com.example.fivewheel.models.BspPV.internal_static_PV_struct_define_descriptor; } @java.lang.Override protected com.google.protobuf.GeneratedMessage.FieldAccessorTable internalGetFieldAccessorTable() { - return com.example.removemarineanimals.models.BspPV.internal_static_PV_struct_define_fieldAccessorTable + return com.example.fivewheel.models.BspPV.internal_static_PV_struct_define_fieldAccessorTable .ensureFieldAccessorsInitialized( - com.example.removemarineanimals.models.BspPV.PV_struct_define.class, com.example.removemarineanimals.models.BspPV.PV_struct_define.Builder.class); + com.example.fivewheel.models.BspPV.PV_struct_define.class, com.example.fivewheel.models.BspPV.PV_struct_define.Builder.class); } public static final int ROBOT_CHGLENGTH_FIELD_NUMBER = 1; @@ -219,10 +219,10 @@ public final class BspPV { if (obj == this) { return true; } - if (!(obj instanceof com.example.removemarineanimals.models.BspPV.PV_struct_define)) { + if (!(obj instanceof com.example.fivewheel.models.BspPV.PV_struct_define)) { return super.equals(obj); } - com.example.removemarineanimals.models.BspPV.PV_struct_define other = (com.example.removemarineanimals.models.BspPV.PV_struct_define) obj; + com.example.fivewheel.models.BspPV.PV_struct_define other = (com.example.fivewheel.models.BspPV.PV_struct_define) obj; if (getRobotChgLength() != other.getRobotChgLength()) return false; @@ -268,44 +268,44 @@ public final class BspPV { return hash; } - public static com.example.removemarineanimals.models.BspPV.PV_struct_define parseFrom( + public static com.example.fivewheel.models.BspPV.PV_struct_define parseFrom( java.nio.ByteBuffer data) throws com.google.protobuf.InvalidProtocolBufferException { return PARSER.parseFrom(data); } - public static com.example.removemarineanimals.models.BspPV.PV_struct_define parseFrom( + public static com.example.fivewheel.models.BspPV.PV_struct_define parseFrom( java.nio.ByteBuffer data, com.google.protobuf.ExtensionRegistryLite extensionRegistry) throws com.google.protobuf.InvalidProtocolBufferException { return PARSER.parseFrom(data, extensionRegistry); } - public static com.example.removemarineanimals.models.BspPV.PV_struct_define parseFrom( + public static com.example.fivewheel.models.BspPV.PV_struct_define parseFrom( com.google.protobuf.ByteString data) throws com.google.protobuf.InvalidProtocolBufferException { return PARSER.parseFrom(data); } - public static com.example.removemarineanimals.models.BspPV.PV_struct_define parseFrom( + public static com.example.fivewheel.models.BspPV.PV_struct_define parseFrom( com.google.protobuf.ByteString data, com.google.protobuf.ExtensionRegistryLite extensionRegistry) throws com.google.protobuf.InvalidProtocolBufferException { return PARSER.parseFrom(data, extensionRegistry); } - public static com.example.removemarineanimals.models.BspPV.PV_struct_define parseFrom(byte[] data) + public static com.example.fivewheel.models.BspPV.PV_struct_define parseFrom(byte[] data) throws com.google.protobuf.InvalidProtocolBufferException { return PARSER.parseFrom(data); } - public static com.example.removemarineanimals.models.BspPV.PV_struct_define parseFrom( + public static com.example.fivewheel.models.BspPV.PV_struct_define parseFrom( byte[] data, com.google.protobuf.ExtensionRegistryLite extensionRegistry) throws com.google.protobuf.InvalidProtocolBufferException { return PARSER.parseFrom(data, extensionRegistry); } - public static com.example.removemarineanimals.models.BspPV.PV_struct_define parseFrom(java.io.InputStream input) + public static com.example.fivewheel.models.BspPV.PV_struct_define parseFrom(java.io.InputStream input) throws java.io.IOException { return com.google.protobuf.GeneratedMessage .parseWithIOException(PARSER, input); } - public static com.example.removemarineanimals.models.BspPV.PV_struct_define parseFrom( + public static com.example.fivewheel.models.BspPV.PV_struct_define parseFrom( java.io.InputStream input, com.google.protobuf.ExtensionRegistryLite extensionRegistry) throws java.io.IOException { @@ -313,26 +313,26 @@ public final class BspPV { .parseWithIOException(PARSER, input, extensionRegistry); } - public static com.example.removemarineanimals.models.BspPV.PV_struct_define parseDelimitedFrom(java.io.InputStream input) + public static com.example.fivewheel.models.BspPV.PV_struct_define parseDelimitedFrom(java.io.InputStream input) throws java.io.IOException { return com.google.protobuf.GeneratedMessage .parseDelimitedWithIOException(PARSER, input); } - public static com.example.removemarineanimals.models.BspPV.PV_struct_define parseDelimitedFrom( + public static com.example.fivewheel.models.BspPV.PV_struct_define 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.example.removemarineanimals.models.BspPV.PV_struct_define parseFrom( + public static com.example.fivewheel.models.BspPV.PV_struct_define parseFrom( com.google.protobuf.CodedInputStream input) throws java.io.IOException { return com.google.protobuf.GeneratedMessage .parseWithIOException(PARSER, input); } - public static com.example.removemarineanimals.models.BspPV.PV_struct_define parseFrom( + public static com.example.fivewheel.models.BspPV.PV_struct_define parseFrom( com.google.protobuf.CodedInputStream input, com.google.protobuf.ExtensionRegistryLite extensionRegistry) throws java.io.IOException { @@ -345,7 +345,7 @@ public final class BspPV { public static Builder newBuilder() { return DEFAULT_INSTANCE.toBuilder(); } - public static Builder newBuilder(com.example.removemarineanimals.models.BspPV.PV_struct_define prototype) { + public static Builder newBuilder(com.example.fivewheel.models.BspPV.PV_struct_define prototype) { return DEFAULT_INSTANCE.toBuilder().mergeFrom(prototype); } @java.lang.Override @@ -366,18 +366,18 @@ public final class BspPV { public static final class Builder extends com.google.protobuf.GeneratedMessage.Builder implements // @@protoc_insertion_point(builder_implements:PV_struct_define) - com.example.removemarineanimals.models.BspPV.PV_struct_defineOrBuilder { + com.example.fivewheel.models.BspPV.PV_struct_defineOrBuilder { public static final com.google.protobuf.Descriptors.Descriptor getDescriptor() { - return com.example.removemarineanimals.models.BspPV.internal_static_PV_struct_define_descriptor; + return com.example.fivewheel.models.BspPV.internal_static_PV_struct_define_descriptor; } @java.lang.Override protected com.google.protobuf.GeneratedMessage.FieldAccessorTable internalGetFieldAccessorTable() { - return com.example.removemarineanimals.models.BspPV.internal_static_PV_struct_define_fieldAccessorTable + return com.example.fivewheel.models.BspPV.internal_static_PV_struct_define_fieldAccessorTable .ensureFieldAccessorsInitialized( - com.example.removemarineanimals.models.BspPV.PV_struct_define.class, com.example.removemarineanimals.models.BspPV.PV_struct_define.Builder.class); + com.example.fivewheel.models.BspPV.PV_struct_define.class, com.example.fivewheel.models.BspPV.PV_struct_define.Builder.class); } // Construct using com.example.removemarineanimals.models.BspPV.PV_struct_define.newBuilder() @@ -405,17 +405,17 @@ public final class BspPV { @java.lang.Override public com.google.protobuf.Descriptors.Descriptor getDescriptorForType() { - return com.example.removemarineanimals.models.BspPV.internal_static_PV_struct_define_descriptor; + return com.example.fivewheel.models.BspPV.internal_static_PV_struct_define_descriptor; } @java.lang.Override - public com.example.removemarineanimals.models.BspPV.PV_struct_define getDefaultInstanceForType() { - return com.example.removemarineanimals.models.BspPV.PV_struct_define.getDefaultInstance(); + public com.example.fivewheel.models.BspPV.PV_struct_define getDefaultInstanceForType() { + return com.example.fivewheel.models.BspPV.PV_struct_define.getDefaultInstance(); } @java.lang.Override - public com.example.removemarineanimals.models.BspPV.PV_struct_define build() { - com.example.removemarineanimals.models.BspPV.PV_struct_define result = buildPartial(); + public com.example.fivewheel.models.BspPV.PV_struct_define build() { + com.example.fivewheel.models.BspPV.PV_struct_define result = buildPartial(); if (!result.isInitialized()) { throw newUninitializedMessageException(result); } @@ -423,14 +423,14 @@ public final class BspPV { } @java.lang.Override - public com.example.removemarineanimals.models.BspPV.PV_struct_define buildPartial() { - com.example.removemarineanimals.models.BspPV.PV_struct_define result = new com.example.removemarineanimals.models.BspPV.PV_struct_define(this); + public com.example.fivewheel.models.BspPV.PV_struct_define buildPartial() { + com.example.fivewheel.models.BspPV.PV_struct_define result = new com.example.fivewheel.models.BspPV.PV_struct_define(this); if (bitField0_ != 0) { buildPartial0(result); } onBuilt(); return result; } - private void buildPartial0(com.example.removemarineanimals.models.BspPV.PV_struct_define result) { + private void buildPartial0(com.example.fivewheel.models.BspPV.PV_struct_define result) { int from_bitField0_ = bitField0_; if (((from_bitField0_ & 0x00000001) != 0)) { result.robotChgLength_ = robotChgLength_; @@ -451,16 +451,16 @@ public final class BspPV { @java.lang.Override public Builder mergeFrom(com.google.protobuf.Message other) { - if (other instanceof com.example.removemarineanimals.models.BspPV.PV_struct_define) { - return mergeFrom((com.example.removemarineanimals.models.BspPV.PV_struct_define)other); + if (other instanceof com.example.fivewheel.models.BspPV.PV_struct_define) { + return mergeFrom((com.example.fivewheel.models.BspPV.PV_struct_define)other); } else { super.mergeFrom(other); return this; } } - public Builder mergeFrom(com.example.removemarineanimals.models.BspPV.PV_struct_define other) { - if (other == com.example.removemarineanimals.models.BspPV.PV_struct_define.getDefaultInstance()) return this; + public Builder mergeFrom(com.example.fivewheel.models.BspPV.PV_struct_define other) { + if (other == com.example.fivewheel.models.BspPV.PV_struct_define.getDefaultInstance()) return this; if (other.getRobotChgLength() != 0) { setRobotChgLength(other.getRobotChgLength()); } @@ -708,12 +708,12 @@ public final class BspPV { } // @@protoc_insertion_point(class_scope:PV_struct_define) - private static final com.example.removemarineanimals.models.BspPV.PV_struct_define DEFAULT_INSTANCE; + private static final com.example.fivewheel.models.BspPV.PV_struct_define DEFAULT_INSTANCE; static { - DEFAULT_INSTANCE = new com.example.removemarineanimals.models.BspPV.PV_struct_define(); + DEFAULT_INSTANCE = new com.example.fivewheel.models.BspPV.PV_struct_define(); } - public static com.example.removemarineanimals.models.BspPV.PV_struct_define getDefaultInstance() { + public static com.example.fivewheel.models.BspPV.PV_struct_define getDefaultInstance() { return DEFAULT_INSTANCE; } @@ -749,7 +749,7 @@ public final class BspPV { } @java.lang.Override - public com.example.removemarineanimals.models.BspPV.PV_struct_define getDefaultInstanceForType() { + public com.example.fivewheel.models.BspPV.PV_struct_define getDefaultInstanceForType() { return DEFAULT_INSTANCE; } diff --git a/app/src/main/java/com/example/removemarineanimals/models/RobotData.java b/app/src/main/java/com/example/fivewheel/models/RobotData.java similarity index 99% rename from app/src/main/java/com/example/removemarineanimals/models/RobotData.java rename to app/src/main/java/com/example/fivewheel/models/RobotData.java index 138f780..73543a7 100644 --- a/app/src/main/java/com/example/removemarineanimals/models/RobotData.java +++ b/app/src/main/java/com/example/fivewheel/models/RobotData.java @@ -3,7 +3,7 @@ // source: robot_data.proto // Protobuf Java Version: 4.27.2 -package com.example.removemarineanimals.models; +package com.example.fivewheel.models; public final class RobotData { private RobotData() {} diff --git a/app/src/main/java/com/example/removemarineanimals/models/RobotRMACM.java b/app/src/main/java/com/example/fivewheel/models/RobotRMACM.java similarity index 99% rename from app/src/main/java/com/example/removemarineanimals/models/RobotRMACM.java rename to app/src/main/java/com/example/fivewheel/models/RobotRMACM.java index c1badac..cfbb3ba 100644 --- a/app/src/main/java/com/example/removemarineanimals/models/RobotRMACM.java +++ b/app/src/main/java/com/example/fivewheel/models/RobotRMACM.java @@ -3,7 +3,7 @@ // source: robot_RMACM.proto // Protobuf Java Version: 4.27.2 -package com.example.removemarineanimals.models; +package com.example.fivewheel.models; public final class RobotRMACM { private RobotRMACM() {} diff --git a/app/src/main/java/com/example/removemarineanimals/services/CustomProber.java b/app/src/main/java/com/example/fivewheel/services/CustomProber.java similarity index 93% rename from app/src/main/java/com/example/removemarineanimals/services/CustomProber.java rename to app/src/main/java/com/example/fivewheel/services/CustomProber.java index c9871c8..84c4922 100644 --- a/app/src/main/java/com/example/removemarineanimals/services/CustomProber.java +++ b/app/src/main/java/com/example/fivewheel/services/CustomProber.java @@ -1,4 +1,4 @@ -package com.example.removemarineanimals.services; +package com.example.fivewheel.services; import com.hoho.android.usbserial.driver.FtdiSerialDriver; diff --git a/app/src/main/java/com/example/removemarineanimals/services/DisplayUtils.java b/app/src/main/java/com/example/fivewheel/services/DisplayUtils.java similarity index 89% rename from app/src/main/java/com/example/removemarineanimals/services/DisplayUtils.java rename to app/src/main/java/com/example/fivewheel/services/DisplayUtils.java index a39e782..a2c1201 100644 --- a/app/src/main/java/com/example/removemarineanimals/services/DisplayUtils.java +++ b/app/src/main/java/com/example/fivewheel/services/DisplayUtils.java @@ -1,4 +1,4 @@ -package com.example.removemarineanimals.services; +package com.example.fivewheel.services; import android.content.Context; import android.content.res.Resources; diff --git a/app/src/main/java/com/example/removemarineanimals/services/ModbusCRC.java b/app/src/main/java/com/example/fivewheel/services/ModbusCRC.java similarity index 97% rename from app/src/main/java/com/example/removemarineanimals/services/ModbusCRC.java rename to app/src/main/java/com/example/fivewheel/services/ModbusCRC.java index f8b7316..b649c43 100644 --- a/app/src/main/java/com/example/removemarineanimals/services/ModbusCRC.java +++ b/app/src/main/java/com/example/fivewheel/services/ModbusCRC.java @@ -1,4 +1,4 @@ -package com.example.removemarineanimals.services; +package com.example.fivewheel.services; public class ModbusCRC { diff --git a/app/src/main/java/com/example/removemarineanimals/services/RobotDataHanlder.java b/app/src/main/java/com/example/fivewheel/services/RobotDataHanlder.java similarity index 92% rename from app/src/main/java/com/example/removemarineanimals/services/RobotDataHanlder.java rename to app/src/main/java/com/example/fivewheel/services/RobotDataHanlder.java index 798adde..d163fd8 100644 --- a/app/src/main/java/com/example/removemarineanimals/services/RobotDataHanlder.java +++ b/app/src/main/java/com/example/fivewheel/services/RobotDataHanlder.java @@ -1,6 +1,6 @@ -package com.example.removemarineanimals.services; +package com.example.fivewheel.services; -import com.example.removemarineanimals.models.RobotData; +import com.example.fivewheel.models.RobotData; import com.google.protobuf.InvalidProtocolBufferException; public class RobotDataHanlder { diff --git a/app/src/main/java/com/example/removemarineanimals/services/RtspRecorder.java b/app/src/main/java/com/example/fivewheel/services/RtspRecorder.java similarity index 100% rename from app/src/main/java/com/example/removemarineanimals/services/RtspRecorder.java rename to app/src/main/java/com/example/fivewheel/services/RtspRecorder.java diff --git a/app/src/main/java/com/example/removemarineanimals/services/USBSerialPortHelper.java b/app/src/main/java/com/example/fivewheel/services/USBSerialPortHelper.java similarity index 97% rename from app/src/main/java/com/example/removemarineanimals/services/USBSerialPortHelper.java rename to app/src/main/java/com/example/fivewheel/services/USBSerialPortHelper.java index f9f8da2..2e38972 100644 --- a/app/src/main/java/com/example/removemarineanimals/services/USBSerialPortHelper.java +++ b/app/src/main/java/com/example/fivewheel/services/USBSerialPortHelper.java @@ -1,4 +1,4 @@ -package com.example.removemarineanimals.services; +package com.example.fivewheel.services; import android.app.PendingIntent; import android.content.BroadcastReceiver; @@ -15,10 +15,10 @@ import android.os.Looper; import androidx.core.content.ContextCompat; -import com.example.removemarineanimals.BuildConfig; -import com.example.removemarineanimals.MainActivity; -import com.example.removemarineanimals.models.RobotData; -import com.example.removemarineanimals.viewmodels.MainViewModel; +import com.example.fivewheel.BuildConfig; +import com.example.fivewheel.MainActivity; +import com.example.fivewheel.models.RobotData; +import com.example.fivewheel.viewmodels.MainViewModel; import com.hoho.android.usbserial.driver.UsbSerialDriver; import com.hoho.android.usbserial.driver.UsbSerialPort; import com.hoho.android.usbserial.driver.UsbSerialProber; diff --git a/app/src/main/java/com/example/removemarineanimals/services/VideoPlayerHelper.java b/app/src/main/java/com/example/fivewheel/services/VideoPlayerHelper.java similarity index 95% rename from app/src/main/java/com/example/removemarineanimals/services/VideoPlayerHelper.java rename to app/src/main/java/com/example/fivewheel/services/VideoPlayerHelper.java index 9fb28d7..d6b190b 100644 --- a/app/src/main/java/com/example/removemarineanimals/services/VideoPlayerHelper.java +++ b/app/src/main/java/com/example/fivewheel/services/VideoPlayerHelper.java @@ -1,4 +1,4 @@ -package com.example.removemarineanimals.services; +package com.example.fivewheel.services; import cn.nodemedia.NodePlayer; import cn.nodemedia.NodePlayerView; diff --git a/app/src/main/java/com/example/removemarineanimals/services/ttySerialPortHelper.java b/app/src/main/java/com/example/fivewheel/services/ttySerialPortHelper.java similarity index 96% rename from app/src/main/java/com/example/removemarineanimals/services/ttySerialPortHelper.java rename to app/src/main/java/com/example/fivewheel/services/ttySerialPortHelper.java index 482dd1b..8f267a2 100644 --- a/app/src/main/java/com/example/removemarineanimals/services/ttySerialPortHelper.java +++ b/app/src/main/java/com/example/fivewheel/services/ttySerialPortHelper.java @@ -1,15 +1,15 @@ -package com.example.removemarineanimals.services; +package com.example.fivewheel.services; import android.util.Log; -import com.example.removemarineanimals.models.BspIV; +import com.example.fivewheel.models.BspIV; import android_serialport_api.SerialPortFinder; import tp.xmaihh.serialport.SerialHelper; import tp.xmaihh.serialport.bean.ComBean; public class ttySerialPortHelper { - public static com.example.removemarineanimals.MainActivity MainActivity; + public static com.example.fivewheel.MainActivity MainActivity; private static final String TAG = "ttySerialPortHelper"; private static SerialHelper serialHelper; private static SerialPortFinder serialPortFinder; @@ -82,9 +82,9 @@ public class ttySerialPortHelper { MainActivity.mainBinding.rFAngleRoll.setText(String.valueOf(_toReceiveIV.getRobotAngleRoll()/100.0)); MainActivity.mainBinding.tvRobotError.setText(String.valueOf(_toReceiveIV.getRobotError())); MainActivity.mainBinding.tvDynamometer.setText(String.valueOf(_toReceiveIV.getRobotDynamometerValue()/100.0)); + MainActivity.mainBinding.tvRobotRightCompensation.setText(String.valueOf(_toReceiveIV.getRobotCompensationRight()/100.0)); + MainActivity.mainBinding.tvRobotLeftCompensation.setText(String.valueOf(_toReceiveIV.getRobotCompensationLeft()/100.0)); MainActivity.mainBinding.tvForce.setText(String.valueOf(_toReceiveIV.getRobotForceValue())); -// MainActivity.mainBinding.tvRobotAutoSpeed.setText(String.valueOf(_toReceiveIV.getRobotMoveAutoSpeed())); - // MainActivity.mainBinding.tvRobotManualSpeed.setText(String.valueOf(_toReceiveIV.getRobotMoveManualSpeed())); MainActivity.mainBinding.tvRobotCurrent.setText("L"+String.valueOf(_toReceiveIV.getRobotCurrentLeft()/1000) + "R"+String.valueOf(_toReceiveIV.getRobotCurrentLeft()/1000)); diff --git a/app/src/main/java/com/example/removemarineanimals/viewmodels/MainViewModel.java b/app/src/main/java/com/example/fivewheel/viewmodels/MainViewModel.java similarity index 67% rename from app/src/main/java/com/example/removemarineanimals/viewmodels/MainViewModel.java rename to app/src/main/java/com/example/fivewheel/viewmodels/MainViewModel.java index 7e2b9ad..2d6f83d 100644 --- a/app/src/main/java/com/example/removemarineanimals/viewmodels/MainViewModel.java +++ b/app/src/main/java/com/example/fivewheel/viewmodels/MainViewModel.java @@ -1,27 +1,17 @@ -package com.example.removemarineanimals.viewmodels; +package com.example.fivewheel.viewmodels; -import android.view.View; import android.widget.SeekBar; -import androidx.annotation.MainThread; -import androidx.lifecycle.LiveData; -import androidx.lifecycle.MutableLiveData; import androidx.lifecycle.ViewModel; -import com.example.removemarineanimals.R; -import com.example.removemarineanimals.databinding.ActivityMainBinding; +import com.example.fivewheel.R; +import com.example.fivewheel.databinding.ActivityMainBinding; //import com.example.removemarineanimals.models.user; //import com.example.removemarineanimals.services.RobotData; -import com.example.removemarineanimals.services.RobotDataHanlder; //import com.example.removemarineanimals.services.VideoHelper; -import java.io.UnsupportedEncodingException; -import java.text.SimpleDateFormat; -import java.util.Date; - -import cn.nodemedia.NodePlayer; public class MainViewModel extends ViewModel { diff --git a/app/src/main/java/generate_java.bat b/app/src/main/java/generate_java.bat index cda58d5..01d41da 100644 --- a/app/src/main/java/generate_java.bat +++ b/app/src/main/java/generate_java.bat @@ -1,4 +1,4 @@ -cd /d D:\Android_studio_workspace\RemoveMarineAnimals\app\src\main\java +cd /d F:\BHBF\cubeide\swj\FiveWheelAPP\app\src\main\java protoc --proto_path=. --java_out=. bsp_IV.proto pause diff --git a/app/src/main/res/layout/activity_main.xml b/app/src/main/res/layout/activity_main.xml index da468d1..03c9f86 100644 --- a/app/src/main/res/layout/activity_main.xml +++ b/app/src/main/res/layout/activity_main.xml @@ -9,7 +9,7 @@ + type="com.example.fivewheel.viewmodels.MainViewModel" /> - -