Browse Source

复原PV结构体

master
LIN\54376 1 month ago
parent
commit
7869a40a27
  1. 7
      app/src/main/java/bsp_PV.proto
  2. 4
      app/src/main/java/com/example/fivewheel/MainActivity.java

7
app/src/main/java/bsp_PV.proto

@ -5,7 +5,8 @@ option java_package = "com.example.fivewheel.models";
message PV_struct_define{ message PV_struct_define{
int32 Robot_ChgLength= 1; int32 Robot_ChgLength= 1;
double Robot_LeftCompensation=2;
double Robot_AutoSpeedBase=2; double Robot_RightCompensation=3;
double Robot_ManualSpeedBase=3; double Robot_AutoSpeedBase=4;
double Robot_ManualSpeedBase=5;
}; };

4
app/src/main/java/com/example/fivewheel/MainActivity.java

@ -271,12 +271,16 @@ public class MainActivity extends AppCompatActivity {
_toSendPV = BspPV.PV_struct_define.newBuilder() _toSendPV = BspPV.PV_struct_define.newBuilder()
.setRobotChgLength(getSafeInt(mainBinding.tvRobotChgLength, 0)) .setRobotChgLength(getSafeInt(mainBinding.tvRobotChgLength, 0))
.setRobotLeftCompensation(0)
.setRobotRightCompensation(0)
.setRobotAutoSpeedBase(getSafeDouble(mainBinding.tvRobotAutoSpeed, 0.0)) .setRobotAutoSpeedBase(getSafeDouble(mainBinding.tvRobotAutoSpeed, 0.0))
.setRobotManualSpeedBase(getSafeDouble(mainBinding.tvRobotManualSpeed, 0.0)) .setRobotManualSpeedBase(getSafeDouble(mainBinding.tvRobotManualSpeed, 0.0))
.build(); .build();
byte[] byteArray = _toSendPV.toByteArray(); byte[] byteArray = _toSendPV.toByteArray();
byte[] sendbyteArray = new byte[byteArray.length + 4]; byte[] sendbyteArray = new byte[byteArray.length + 4];
byte[] sendbyteArray3 = new byte[byteArray.length + 6]; byte[] sendbyteArray3 = new byte[byteArray.length + 6];

Loading…
Cancel
Save