Merge branch 'dev_robosweeper-d_app-module_221230_1.1.0' into dev_arch_opt_3.0
# Conflicts: # OCH/mogo-och-common-module/src/main/java/com/mogo/och/common/module/utils/CallerLoggerUtils.kt # OCH/mogo-och-sweeper/src/main/java/com/mogo/och/sweeper/ui/SweeperOperatePanelView.java # app/src/main/java/com/mogo/launcher/stageone/ConfigStartUp.kt # core/function-impl/mogo-core-function-datacenter/src/main/java/com/mogo/eagle/core/function/datacenter/autopilot/adapter/MoGoAdasListenerImpl.kt # core/function-impl/mogo-core-function-datacenter/src/main/java/com/mogo/eagle/core/function/datacenter/autopilot/adapter/MoGoHandAdasMsgManager.java # core/function-impl/mogo-core-function-devatools/src/main/java/com/zhjt/mogo_core_function_devatools/badcase/biz/AIDataCollectWindow.kt # core/function-impl/mogo-core-function-devatools/src/main/java/com/zhjt/mogo_core_function_devatools/badcase/biz/InitiativeBadCaseWindow.kt # core/function-impl/mogo-core-function-hmi/src/main/java/com/mogo/eagle/core/function/hmi/ui/widget/SteeringWheelView.java # core/function-impl/mogo-core-function-hmi/src/main/java/com/mogo/eagle/core/function/hmi/ui/widget/TrafficDataView.java # core/function-impl/mogo-core-function-map/src/main/java/com/mogo/eagle/core/function/smp/SmallMapFragment.java # core/mogo-core-function-api/src/main/java/com/mogo/eagle/core/function/api/autopilot/IMoGoAutopilotVehicleStateListener.kt # core/mogo-core-function-call/src/main/java/com/mogo/eagle/core/function/call/autopilot/CallerAutopilotVehicleStateListenerManager.kt # gradle.properties # libraries/mogo-map/src/main/java/com/mogo/map/CustomMapApiBuilder.java
@@ -4,6 +4,7 @@ import com.mogo.eagle.core.data.config.FunctionBuildConfig
|
||||
import com.mogo.eagle.core.utilcode.mogo.AppIdentityModeUtils
|
||||
import com.mogo.eagle.core.utilcode.mogo.logger.scene.SceneConstant.Companion.M_BUS
|
||||
import com.mogo.eagle.core.utilcode.mogo.logger.scene.SceneConstant.Companion.M_BUS_P
|
||||
import com.mogo.eagle.core.utilcode.mogo.logger.scene.SceneConstant.Companion.M_SWEEPER
|
||||
import com.mogo.eagle.core.utilcode.mogo.logger.scene.SceneConstant.Companion.M_TAXI
|
||||
import com.mogo.eagle.core.utilcode.mogo.logger.scene.SceneConstant.Companion.M_TAXI_P
|
||||
|
||||
@@ -24,7 +25,11 @@ object CallerLoggerUtils {
|
||||
AppIdentityModeUtils.isPassenger(FunctionBuildConfig.appIdentityMode)){
|
||||
//小巴车乘客
|
||||
M_BUS_P
|
||||
}else{
|
||||
}else if (AppIdentityModeUtils.isSweeper(FunctionBuildConfig.appIdentityMode)){
|
||||
//清扫车
|
||||
M_SWEEPER
|
||||
}
|
||||
else{
|
||||
""
|
||||
}
|
||||
}
|
||||
@@ -39,8 +39,9 @@ import java.util.Arrays;
|
||||
import java.util.HashMap;
|
||||
import java.util.List;
|
||||
|
||||
import chassis.Chassis;
|
||||
import chassis.ChassisStatesOuterClass;
|
||||
import chassis.SpecialVehicleTaskCmdOuterClass;
|
||||
import chassis.VehicleStateOuterClass;
|
||||
|
||||
/**
|
||||
* 清扫车操作面板View
|
||||
@@ -178,7 +179,7 @@ public class SweeperOperatePanelView extends LinearLayout {
|
||||
}
|
||||
|
||||
@Override
|
||||
public boolean onCheckIfCmdSuccess(VehicleStateOuterClass.SweeperFuTianCleanSystemState cleanSystemState) {
|
||||
public boolean onCheckIfCmdSuccess(ChassisStatesOuterClass.SweeperFuTianTaskSystemStates cleanSystemState) {
|
||||
boolean success = false;
|
||||
if (cleanSystemState == null) {
|
||||
return success;
|
||||
@@ -284,7 +285,7 @@ public class SweeperOperatePanelView extends LinearLayout {
|
||||
}
|
||||
|
||||
@Override
|
||||
public boolean onCheckIfCmdSuccess(VehicleStateOuterClass.SweeperFuTianCleanSystemState cleanSystemState) {
|
||||
public boolean onCheckIfCmdSuccess(ChassisStatesOuterClass.SweeperFuTianTaskSystemStates cleanSystemState) {
|
||||
boolean success = false;
|
||||
if (cleanSystemState == null) {
|
||||
return success;
|
||||
@@ -402,7 +403,7 @@ public class SweeperOperatePanelView extends LinearLayout {
|
||||
}
|
||||
|
||||
@Override
|
||||
public boolean onCheckIfCmdSuccess(VehicleStateOuterClass.SweeperFuTianCleanSystemState cleanSystemState) {
|
||||
public boolean onCheckIfCmdSuccess(ChassisStatesOuterClass.SweeperFuTianTaskSystemStates cleanSystemState) {
|
||||
boolean success = false;
|
||||
if (cleanSystemState == null) {
|
||||
return success;
|
||||
@@ -490,7 +491,7 @@ public class SweeperOperatePanelView extends LinearLayout {
|
||||
}
|
||||
|
||||
@Override
|
||||
public boolean onCheckIfCmdSuccess(VehicleStateOuterClass.SweeperFuTianCleanSystemState cleanSystemState) {
|
||||
public boolean onCheckIfCmdSuccess(ChassisStatesOuterClass.SweeperFuTianTaskSystemStates cleanSystemState) {
|
||||
boolean success = false;
|
||||
if (cleanSystemState == null) {
|
||||
return success;
|
||||
@@ -759,7 +760,7 @@ public class SweeperOperatePanelView extends LinearLayout {
|
||||
private final IMoGoSweeperFutianCleanSystemListener mIMoGoAutopilotVehicleStateListener = new IMoGoSweeperFutianCleanSystemListener() {
|
||||
|
||||
@Override
|
||||
public void onSweeperFutianCleanSystemState(@NonNull VehicleStateOuterClass.SweeperFuTianCleanSystemState cleanSystemState) {
|
||||
public void onSweeperFutianCleanSystemState(@NonNull ChassisStatesOuterClass.SweeperFuTianTaskSystemStates cleanSystemState) {
|
||||
long current = System.currentTimeMillis();
|
||||
if (current - mCurrentTimeMillis <= VEHICLE_STATE_INTERVAL_MILLIS) {
|
||||
return;
|
||||
@@ -810,7 +811,7 @@ public class SweeperOperatePanelView extends LinearLayout {
|
||||
mSyncingVehicleState = true;
|
||||
}
|
||||
|
||||
private synchronized void onSyncVehicleStateCallBack(VehicleStateOuterClass.SweeperFuTianCleanSystemState cleanSystemState) {
|
||||
private synchronized void onSyncVehicleStateCallBack(ChassisStatesOuterClass.SweeperFuTianTaskSystemStates cleanSystemState) {
|
||||
if (cleanSystemState == null) return;
|
||||
mSyncingVehicleState = false;
|
||||
// 清扫作业开启状态(以电机状态为true代表Open成功,实际控制端控制步骤为:1.发送远程控制上装指令 2.发送电机启动指令)
|
||||
@@ -902,7 +903,7 @@ public class SweeperOperatePanelView extends LinearLayout {
|
||||
* @param cleanSystemState
|
||||
* @return
|
||||
*/
|
||||
private boolean checkIfCleanModePureSweep(VehicleStateOuterClass.SweeperFuTianCleanSystemState cleanSystemState) {
|
||||
private boolean checkIfCleanModePureSweep(ChassisStatesOuterClass.SweeperFuTianTaskSystemStates cleanSystemState) {
|
||||
// 作业模式状态
|
||||
// 洗扫
|
||||
boolean clean_mode_wash_sweep = cleanSystemState.getSecuModWashSweepSts();
|
||||
@@ -1019,7 +1020,7 @@ public class SweeperOperatePanelView extends LinearLayout {
|
||||
|
||||
void onCountDownTick(int senonds);
|
||||
|
||||
boolean onCheckIfCmdSuccess(VehicleStateOuterClass.SweeperFuTianCleanSystemState cleanSystemState);
|
||||
boolean onCheckIfCmdSuccess(ChassisStatesOuterClass.SweeperFuTianTaskSystemStates cleanSystemState);
|
||||
|
||||
void onCmdSuccess();
|
||||
|
||||
|
||||
@@ -4,6 +4,7 @@ import android.content.Context;
|
||||
import android.util.AttributeSet;
|
||||
import android.view.LayoutInflater;
|
||||
import android.widget.ImageView;
|
||||
import android.widget.TextView;
|
||||
|
||||
import com.mogo.eagle.core.function.api.hmi.view.IViewTrafficLight;
|
||||
import com.mogo.eagle.core.utilcode.util.UiThreadHandler;
|
||||
@@ -13,14 +14,14 @@ import com.mogo.och.common.module.wigets.OCHGradientTextView;
|
||||
import org.jetbrains.annotations.Nullable;
|
||||
|
||||
/**
|
||||
* Bus司机端:红绿灯view
|
||||
* 清扫车:红绿灯view
|
||||
*
|
||||
* Created on 2022/3/29
|
||||
*/
|
||||
public class SweeperTrafficLightView extends IViewTrafficLight {
|
||||
|
||||
private ImageView mLightIconIV;
|
||||
private OCHGradientTextView mLightTimeTV;
|
||||
private TextView mLightTimeTV;
|
||||
private int mCurrentLightId;
|
||||
|
||||
public SweeperTrafficLightView(@Nullable Context context) {
|
||||
@@ -98,9 +99,6 @@ public class SweeperTrafficLightView extends IViewTrafficLight {
|
||||
super.changeCountdownRed(redNum);
|
||||
UiThreadHandler.post(() -> {
|
||||
if (redNum > 0) {
|
||||
mLightTimeTV.setVertrial(true);
|
||||
mLightTimeTV.setmColorList(new int[]{getResources().getColor(R.color.sweeper_traffic_light_red_color_up),
|
||||
getResources().getColor(R.color.sweeper_traffic_light_red_color_down)});
|
||||
mLightTimeTV.setText(String.valueOf(redNum));
|
||||
} else {
|
||||
mLightTimeTV.setText("");
|
||||
@@ -113,9 +111,6 @@ public class SweeperTrafficLightView extends IViewTrafficLight {
|
||||
super.changeCountdownGreen(greenNum);
|
||||
UiThreadHandler.post(() -> {
|
||||
if (greenNum > 0) {
|
||||
mLightTimeTV.setVertrial(true);
|
||||
mLightTimeTV.setmColorList(new int[]{getResources().getColor(R.color.sweeper_traffic_light_green_color_up),
|
||||
getResources().getColor(R.color.sweeper_traffic_light_green_color_down)});
|
||||
mLightTimeTV.setText(String.valueOf(greenNum));
|
||||
} else {
|
||||
mLightTimeTV.setText("");
|
||||
@@ -128,9 +123,6 @@ public class SweeperTrafficLightView extends IViewTrafficLight {
|
||||
super.changeCountdownYellow(yellowNum);
|
||||
UiThreadHandler.post(() -> {
|
||||
if (yellowNum > 0) {
|
||||
mLightTimeTV.setVertrial(true);
|
||||
mLightTimeTV.setmColorList(new int[]{getResources().getColor(R.color.sweeper_traffic_light_yellow_color_up),
|
||||
getResources().getColor(R.color.sweeper_traffic_light_yellow_color_down)});
|
||||
mLightTimeTV.setText(String.valueOf(yellowNum));
|
||||
} else {
|
||||
mLightTimeTV.setText("");
|
||||
|
||||
@@ -89,19 +89,22 @@
|
||||
android:id="@+id/sweeper_switch_model_layout"
|
||||
android:layout_width="@dimen/module_mogo_och_operation_status_bg_width"
|
||||
android:layout_height="@dimen/module_mogo_och_operation_status_bg_height"
|
||||
android:layout_marginLeft="@dimen/module_mogo_och_margin_left"
|
||||
android:background="@drawable/sweeper_switch_map_bg"
|
||||
android:elevation="@dimen/sweeper_dp_10"
|
||||
android:padding="@dimen/sweeper_dp_20"
|
||||
app:layout_constraintBottom_toBottomOf="@+id/module_mogo_och_operation_status"
|
||||
app:layout_constraintLeft_toRightOf="@+id/module_mogo_och_operation_status"
|
||||
app:layout_constraintBottom_toBottomOf="parent"
|
||||
app:layout_constraintLeft_toLeftOf="parent"
|
||||
android:layout_marginLeft="@dimen/module_mogo_och_margin_left"
|
||||
android:layout_marginBottom="@dimen/module_mogo_och_margin_bottom"
|
||||
android:gravity="center"
|
||||
android:orientation="horizontal">
|
||||
|
||||
<ImageView
|
||||
android:id="@+id/sweeper_switch_model_icon"
|
||||
android:layout_width="wrap_content"
|
||||
android:layout_height="wrap_content" />
|
||||
android:layout_width="@dimen/dp_80"
|
||||
android:layout_height="@dimen/dp_80"
|
||||
android:layout_centerInParent="true"
|
||||
android:layout_gravity="center" />
|
||||
</LinearLayout>
|
||||
<CheckedTextView
|
||||
android:id="@+id/module_mogo_och_operation_status"
|
||||
@@ -118,7 +121,8 @@
|
||||
android:layout_marginLeft="@dimen/module_mogo_och_margin_left"
|
||||
android:layout_marginBottom="@dimen/module_mogo_och_margin_bottom"
|
||||
app:layout_constraintBottom_toBottomOf="parent"
|
||||
app:layout_constraintLeft_toLeftOf="parent"/>
|
||||
app:layout_constraintLeft_toLeftOf="parent"
|
||||
android:visibility="gone"/>
|
||||
|
||||
<RelativeLayout
|
||||
android:id="@+id/module_mogo_och_setting_layout"
|
||||
@@ -131,8 +135,8 @@
|
||||
app:layout_constraintBottom_toBottomOf="parent"
|
||||
app:layout_constraintLeft_toRightOf="@id/sweeper_switch_model_layout">
|
||||
<ImageView
|
||||
android:layout_width="wrap_content"
|
||||
android:layout_height="wrap_content"
|
||||
android:layout_width="@dimen/dp_80"
|
||||
android:layout_height="@dimen/dp_80"
|
||||
android:layout_centerInParent="true"
|
||||
android:layout_gravity="center"
|
||||
android:background="@drawable/sweeper_setting_btn_bg" />
|
||||
@@ -149,8 +153,8 @@
|
||||
app:layout_constraintBottom_toBottomOf="parent"
|
||||
app:layout_constraintLeft_toRightOf="@id/module_mogo_och_setting_layout">
|
||||
<ImageView
|
||||
android:layout_width="wrap_content"
|
||||
android:layout_height="wrap_content"
|
||||
android:layout_width="@dimen/dp_80"
|
||||
android:layout_height="@dimen/dp_80"
|
||||
android:layout_centerInParent="true"
|
||||
android:layout_gravity="center"
|
||||
android:src="@drawable/bad_case_selector"/>
|
||||
@@ -168,8 +172,8 @@
|
||||
app:layout_constraintLeft_toRightOf="@id/module_mogo_och_badcase_rl">
|
||||
|
||||
<ImageView
|
||||
android:layout_width="wrap_content"
|
||||
android:layout_height="wrap_content"
|
||||
android:layout_width="@dimen/dp_80"
|
||||
android:layout_height="@dimen/dp_80"
|
||||
android:layout_centerInParent="true"
|
||||
android:layout_gravity="center"
|
||||
android:src="@drawable/ai_collect_selector" />
|
||||
@@ -191,7 +195,8 @@
|
||||
app:layout_constraintLeft_toLeftOf="parent"
|
||||
app:layout_constraintRight_toRightOf="parent"
|
||||
app:textSize="@dimen/module_mogo_och_slide_panel_textSize"
|
||||
tools:visibility="visible" />
|
||||
tools:visibility="visible"
|
||||
/>
|
||||
|
||||
<Button
|
||||
android:id="@+id/btnAutopilotDisable"
|
||||
|
||||
@@ -1,35 +1,21 @@
|
||||
<?xml version="1.0" encoding="utf-8"?>
|
||||
<androidx.constraintlayout.widget.ConstraintLayout
|
||||
<FrameLayout
|
||||
xmlns:android="http://schemas.android.com/apk/res/android"
|
||||
xmlns:app="http://schemas.android.com/apk/res-auto"
|
||||
android:layout_width="@dimen/sweeper_traffic_light_layout_width"
|
||||
android:layout_height="@dimen/sweeper_traffic_light_layout_height"
|
||||
android:visibility="visible">
|
||||
|
||||
<ImageView
|
||||
android:layout_width="@dimen/sweeper_traffic_light_bg_width"
|
||||
android:layout_height="@dimen/sweeper_traffic_light_bg_height"
|
||||
android:background="@drawable/bg_sweeper_traffic_light_background"
|
||||
app:layout_constraintLeft_toLeftOf="parent"
|
||||
app:layout_constraintTop_toTopOf="parent"
|
||||
android:layout_marginLeft="@dimen/sweeper_traffic_light_bg_margin_left"
|
||||
android:layout_marginTop="@dimen/sweeper_traffic_light_bg_margin_top"/>
|
||||
|
||||
android:layout_width="wrap_content"
|
||||
android:layout_height="wrap_content">
|
||||
<ImageView
|
||||
android:id="@+id/sweeper_traffic_light_iv"
|
||||
android:layout_width="@dimen/sweeper_traffic_light_icon_size"
|
||||
android:layout_height="@dimen/sweeper_traffic_light_icon_size"
|
||||
app:layout_constraintLeft_toLeftOf="parent"
|
||||
app:layout_constraintTop_toTopOf="parent"/>
|
||||
|
||||
<com.mogo.och.common.module.wigets.OCHGradientTextView
|
||||
android:layout_gravity="center"
|
||||
android:src="@drawable/sweeper_light_red_nor"/>
|
||||
<TextView
|
||||
android:id="@+id/sweeper_traffic_light_time_tv"
|
||||
android:layout_width="@dimen/sweeper_traffic_light_time_view_width"
|
||||
android:layout_width="match_parent"
|
||||
android:layout_height="match_parent"
|
||||
android:textSize="@dimen/sweeper_traffic_light_time_size"
|
||||
android:textStyle="bold"
|
||||
app:layout_constraintRight_toRightOf="parent"
|
||||
app:layout_constraintTop_toTopOf="parent"
|
||||
android:gravity="center" />
|
||||
|
||||
</androidx.constraintlayout.widget.ConstraintLayout>
|
||||
android:textSize="@dimen/dp_24"
|
||||
android:layout_gravity="center"
|
||||
android:gravity="center"
|
||||
android:text="10"
|
||||
android:textColor="@color/white"/>
|
||||
</FrameLayout>
|
||||
@@ -145,7 +145,7 @@
|
||||
<dimen name="sweeper_traffic_light_bg_height">120dp</dimen>
|
||||
<dimen name="sweeper_traffic_light_bg_margin_left">15dp</dimen>
|
||||
<dimen name="sweeper_traffic_light_bg_margin_top">17dp</dimen>
|
||||
<dimen name="sweeper_traffic_light_icon_size">154dp</dimen>
|
||||
<dimen name="sweeper_traffic_light_icon_size">100dp</dimen>
|
||||
<dimen name="sweeper_traffic_light_time_view_width">130dp</dimen>
|
||||
<dimen name="sweeper_traffic_light_time_size">60dp</dimen>
|
||||
|
||||
|
||||
@@ -7,7 +7,9 @@ import com.zhidao.adas.client.bean.AutopilotState;
|
||||
import com.zhidao.adas.client.bean.BaseInfo;
|
||||
import com.zhidao.adas.client.bean.BasicInfoReq;
|
||||
import com.zhidao.adas.client.bean.CarConfigResp;
|
||||
import com.zhidao.adas.client.bean.ChassisStates;
|
||||
import com.zhidao.adas.client.bean.ErrorData;
|
||||
import com.zhidao.adas.client.bean.FSMFunctionStates;
|
||||
import com.zhidao.adas.client.bean.GlobalPathResp;
|
||||
import com.zhidao.adas.client.bean.GnssInfo;
|
||||
import com.zhidao.adas.client.bean.MogoReportMessage;
|
||||
@@ -117,6 +119,8 @@ public class DataDistribution {
|
||||
public final List<String> listOriginalPointCloud = new ArrayList<>();
|
||||
public final List<String> listPlanningObjects = new ArrayList<>();
|
||||
public final List<String> listPlanningDecisionState = new ArrayList<>();
|
||||
public final List<String> listChassisStates = new ArrayList<>();
|
||||
public final List<String> listFSMFunctionStates = new ArrayList<>();
|
||||
|
||||
public String cutDown(String str) {
|
||||
if (isCutDown && str.length() > 650) {
|
||||
@@ -184,6 +188,14 @@ public class DataDistribution {
|
||||
if (listener != null && Constants.TITLE.RECEIVE_VEHICLE_STATE.equals(listener.first)) {
|
||||
listener.second.onRefresh();
|
||||
}
|
||||
} else if (data instanceof ChassisStates) {
|
||||
listChassisStates.add(0, time + str);
|
||||
if (listChassisStates.size() > LIST_SIZE) {
|
||||
listChassisStates.remove(listChassisStates.size() - 1);
|
||||
}
|
||||
if (listener != null && Constants.TITLE.RECEIVE_CHASSIS_STATES.equals(listener.first)) {
|
||||
listener.second.onRefresh();
|
||||
}
|
||||
} else if (data instanceof AutopilotState) {
|
||||
listAutopilotState.add(0, time + str);
|
||||
if (listAutopilotState.size() > LIST_SIZE) {
|
||||
@@ -270,6 +282,14 @@ public class DataDistribution {
|
||||
if (listener != null && Constants.TITLE.RECEIVE_RECORD_DATA_CONFIG_RESP.equals(listener.first)) {
|
||||
listener.second.onRefresh();
|
||||
}
|
||||
} else if (data instanceof FSMFunctionStates) {
|
||||
listFSMFunctionStates.add(0, time + str);
|
||||
if (listFSMFunctionStates.size() > LIST_SIZE) {
|
||||
listFSMFunctionStates.remove(listFSMFunctionStates.size() - 1);
|
||||
}
|
||||
if (listener != null && Constants.TITLE.RECEIVE_FUNCTION_STATES.equals(listener.first)) {
|
||||
listener.second.onRefresh();
|
||||
}
|
||||
} else if (data instanceof ErrorData) {
|
||||
listErrorData.add(0, time + str);
|
||||
if (listErrorData.size() > 100) {
|
||||
|
||||
@@ -0,0 +1,24 @@
|
||||
package com.zhidao.adas.client.bean;
|
||||
|
||||
import com.google.protobuf.TextFormat;
|
||||
|
||||
import java.text.SimpleDateFormat;
|
||||
|
||||
import chassis.ChassisStatesOuterClass;
|
||||
import mogo.telematics.pad.MessagePad;
|
||||
|
||||
public class ChassisStates extends BaseInfo {
|
||||
public final ChassisStatesOuterClass.ChassisStates bean;
|
||||
|
||||
public ChassisStates(MessagePad.Header header, ChassisStatesOuterClass.ChassisStates bean, SimpleDateFormat sdf) {
|
||||
super("接收", bean.getSerializedSize(), header, sdf);
|
||||
this.bean = bean;
|
||||
}
|
||||
|
||||
|
||||
@Override
|
||||
public String toString() {
|
||||
return super.toString() + TextFormat.printer().escapingNonAscii(false).printToString(bean);
|
||||
}
|
||||
|
||||
}
|
||||
@@ -0,0 +1,24 @@
|
||||
package com.zhidao.adas.client.bean;
|
||||
|
||||
import com.google.protobuf.TextFormat;
|
||||
|
||||
import java.text.SimpleDateFormat;
|
||||
|
||||
import function_state_management.FunctionStates;
|
||||
import mogo.telematics.pad.MessagePad;
|
||||
|
||||
public class FSMFunctionStates extends BaseInfo {
|
||||
public final FunctionStates.FSMFunctionStates bean;
|
||||
|
||||
public FSMFunctionStates(MessagePad.Header header, FunctionStates.FSMFunctionStates bean, SimpleDateFormat sdf) {
|
||||
super("接收", bean.getSerializedSize(), header, sdf);
|
||||
this.bean = bean;
|
||||
}
|
||||
|
||||
|
||||
@Override
|
||||
public String toString() {
|
||||
return super.toString() + TextFormat.printer().escapingNonAscii(false).printToString(bean);
|
||||
}
|
||||
|
||||
}
|
||||
@@ -105,6 +105,8 @@ public class InfoFragment extends BaseFragment {
|
||||
adapter.setData(DataDistribution.getInstance().listGnssInfo);
|
||||
} else if (Constants.TITLE.RECEIVE_VEHICLE_STATE.equals(title)) {
|
||||
adapter.setData(DataDistribution.getInstance().listVehicleState);
|
||||
} else if (Constants.TITLE.RECEIVE_CHASSIS_STATES.equals(title)) {
|
||||
adapter.setData(DataDistribution.getInstance().listChassisStates);
|
||||
} else if (Constants.TITLE.RECEIVE_TRACKED_OBJECTS.equals(title)) {
|
||||
adapter.setData(DataDistribution.getInstance().listTrackedObjects);
|
||||
} else if (Constants.TITLE.RECEIVE_AUTOPILOT_STATE.equals(title)) {
|
||||
@@ -135,6 +137,8 @@ public class InfoFragment extends BaseFragment {
|
||||
adapter.setData(DataDistribution.getInstance().listPlanningObjects);
|
||||
} else if (Constants.TITLE.RECEIVE_PLANNING_DECISION_STATE.equals(title)) {
|
||||
adapter.setData(DataDistribution.getInstance().listPlanningDecisionState);
|
||||
} else if (Constants.TITLE.RECEIVE_FUNCTION_STATES.equals(title)) {
|
||||
adapter.setData(DataDistribution.getInstance().listFSMFunctionStates);
|
||||
} else {
|
||||
adapter.setData(DataDistribution.getInstance().listErrorData);
|
||||
}
|
||||
|
||||
@@ -59,7 +59,9 @@ import com.zhidao.adas.client.bean.ArrivalNotification;
|
||||
import com.zhidao.adas.client.bean.AutopilotState;
|
||||
import com.zhidao.adas.client.bean.BasicInfoReq;
|
||||
import com.zhidao.adas.client.bean.CarConfigResp;
|
||||
import com.zhidao.adas.client.bean.ChassisStates;
|
||||
import com.zhidao.adas.client.bean.ErrorData;
|
||||
import com.zhidao.adas.client.bean.FSMFunctionStates;
|
||||
import com.zhidao.adas.client.bean.GlobalPathResp;
|
||||
import com.zhidao.adas.client.bean.GnssInfo;
|
||||
import com.zhidao.adas.client.bean.IPCConnectState;
|
||||
@@ -113,7 +115,9 @@ import java.util.Locale;
|
||||
import java.util.concurrent.ScheduledExecutorService;
|
||||
|
||||
import chassis.Chassis;
|
||||
import chassis.ChassisStatesOuterClass;
|
||||
import chassis.VehicleStateOuterClass;
|
||||
import function_state_management.FunctionStates;
|
||||
import io.netty.channel.Channel;
|
||||
import mogo.telematics.pad.MessagePad;
|
||||
import mogo_msg.MogoReportMsg;
|
||||
@@ -629,7 +633,9 @@ public class MainActivity extends BaseActivity implements OnAdasListener, OnAdas
|
||||
titleFragmentData.add(Constants.TITLE.RECEIVE_TRAJECTORY);
|
||||
titleFragmentData.add(Constants.TITLE.RECEIVE_TRACKED_OBJECTS);
|
||||
titleFragmentData.add(Constants.TITLE.RECEIVE_VEHICLE_STATE);
|
||||
titleFragmentData.add(Constants.TITLE.RECEIVE_CHASSIS_STATES);
|
||||
titleFragmentData.add(Constants.TITLE.RECEIVE_AUTOPILOT_STATE);
|
||||
titleFragmentData.add(Constants.TITLE.RECEIVE_FUNCTION_STATES);
|
||||
titleFragmentData.add(Constants.TITLE.RECEIVE_REPORT_MESSAGE);
|
||||
titleFragmentData.add(Constants.TITLE.RECEIVE_PERCEPTION_TRAFFIC_LIGHT);
|
||||
titleFragmentData.add(Constants.TITLE.RECEIVE_PREDICTION_OBSTACLE_TRAJECTORY);
|
||||
@@ -895,6 +901,12 @@ public class MainActivity extends BaseActivity implements OnAdasListener, OnAdas
|
||||
DataDistribution.getInstance().addData(base);
|
||||
}
|
||||
|
||||
@Override
|
||||
public void onChassisStates(MessagePad.Header header, ChassisStatesOuterClass.ChassisStates chassisStates) {
|
||||
ChassisStates base = new ChassisStates(header, chassisStates, sdf);
|
||||
DataDistribution.getInstance().addData(base);
|
||||
}
|
||||
|
||||
@Override
|
||||
public void onAutopilotState(MessagePad.Header header, MessagePad.AutopilotState autopilotState) {
|
||||
AutopilotState base = new AutopilotState(header, autopilotState, sdf);
|
||||
@@ -1016,6 +1028,12 @@ public class MainActivity extends BaseActivity implements OnAdasListener, OnAdas
|
||||
DataDistribution.getInstance().addData(base);
|
||||
}
|
||||
|
||||
@Override
|
||||
public void onFunctionStates(MessagePad.Header header, FunctionStates.FSMFunctionStates functionStates) {
|
||||
FSMFunctionStates base = new FSMFunctionStates(header, functionStates, sdf);
|
||||
DataDistribution.getInstance().addData(base);
|
||||
}
|
||||
|
||||
|
||||
private void initAdas() {
|
||||
CupidLogUtils.e(TAG, "--->初始化");
|
||||
|
||||
@@ -151,7 +151,9 @@ public class Constants {
|
||||
String RECEIVE_TRACKED_OBJECTS = MessageType.TYPE_RECEIVE_TRACKED_OBJECTS.desc;
|
||||
String RECEIVE_GNSS_INFO = MessageType.TYPE_RECEIVE_GNSS_INFO.desc;
|
||||
String RECEIVE_VEHICLE_STATE = MessageType.TYPE_RECEIVE_VEHICLE_STATE.desc;
|
||||
String RECEIVE_CHASSIS_STATES = MessageType.TYPE_RECEIVE_CHASSIS_STATES.desc;
|
||||
String RECEIVE_AUTOPILOT_STATE = MessageType.TYPE_RECEIVE_AUTOPILOT_STATE.desc;
|
||||
String RECEIVE_FUNCTION_STATES = MessageType.TYPE_RECEIVE_FUNCTION_STATES.desc;
|
||||
String RECEIVE_REPORT_MESSAGE = MessageType.TYPE_RECEIVE_REPORT_MESSAGE.desc;
|
||||
String RECEIVE_PERCEPTION_TRAFFIC_LIGHT = MessageType.TYPE_RECEIVE_PERCEPTION_TRAFFIC_LIGHT.desc;
|
||||
String RECEIVE_PREDICTION_OBSTACLE_TRAJECTORY = MessageType.TYPE_RECEIVE_PREDICTION_OBSTACLE_TRAJECTORY.desc;
|
||||
|
||||
@@ -1,5 +1,6 @@
|
||||
package com.mogo.eagle.core.function.datacenter.autopilot.adapter
|
||||
|
||||
import chassis.ChassisStatesOuterClass
|
||||
import chassis.VehicleStateOuterClass
|
||||
import com.mogo.eagle.core.data.app.AppConfigInfo
|
||||
import com.mogo.eagle.core.data.config.FunctionBuildConfig
|
||||
@@ -58,6 +59,7 @@ import com.zhidao.support.adas.high.bean.AutopilotStatistics
|
||||
import com.zhidao.support.adas.high.common.ProtocolStatus
|
||||
import com.zhjt.service.chain.ChainLog
|
||||
import com.zhjt.service.chain.TracingConstants.Endpoint.Companion.PAD
|
||||
import function_state_management.FunctionStates
|
||||
import mogo.telematics.pad.MessagePad
|
||||
import mogo.telematics.pad.MessagePad.TrackedObject
|
||||
import mogo_msg.MogoReportMsg
|
||||
@@ -139,38 +141,66 @@ class MoGoAdasListenerImpl : OnAdasListener {
|
||||
}
|
||||
}
|
||||
|
||||
//自车状态(底盘),车灯等。
|
||||
@ChainLog(
|
||||
linkChainLog = CHAIN_LINK_LOG_WEB_SOCKET_VEHICLE,
|
||||
linkCode = CHAIN_LINK_ADAS,
|
||||
endpoint = PAD,
|
||||
nodeAliasCode = CHAIN_ALIAS_CODE_ADAS_MESSAGE_AUTOPILOT_VEHICLE,
|
||||
paramIndexes = [0, 1],
|
||||
clientPkFileName = "sn"
|
||||
)
|
||||
/**
|
||||
* 老底盘
|
||||
* TODO 老地盘数据会转发到新地盘
|
||||
* TODO 鹰眼不要用此接口展示页面相关,可以用来记录链路日志
|
||||
*
|
||||
* @param header 头
|
||||
* @param vehicleState 数据
|
||||
*/
|
||||
override fun onVehicleState(
|
||||
header: MessagePad.Header,
|
||||
vehicleState: VehicleStateOuterClass.VehicleState?
|
||||
) {
|
||||
|
||||
if (vehicleState != null) {
|
||||
//转向灯数据
|
||||
CallerChassisLamplightListenerManager.invokeAutopilotLightSwitchData(vehicleState.light)
|
||||
//刹车灯数据
|
||||
CallerChassisLamplightListenerManager.invokeAutopilotBrakeLightData(vehicleState.brakeLightStatus)
|
||||
//方向盘转向角数据
|
||||
CallerChassisSteeringStateListenerManager.invokeAutopilotSteeringData(vehicleState.steering)
|
||||
//挂挡档位数据
|
||||
CallerChassisGearStateListenerManager.invokeAutopilotGearData(vehicleState.gear)
|
||||
//加速度
|
||||
CallerChassisAccStateListenerManager.invokeAutopilotAcc(vehicleState.accel)
|
||||
//油门
|
||||
CallerChassisThrottleStateListenerManager.invokeAutopilotThrottle(vehicleState.throttle)
|
||||
//刹车
|
||||
CallerChassisBrakeStateListenerManager.invokeAutopilotBrake(vehicleState.brake)
|
||||
//清扫车(福田)清扫控制系统状态
|
||||
vehicleState.sweeperFutianCleanSystemState?.also {
|
||||
CallerSweeperFutianCleanSystemListenerManager.invokeSweeperFutianCleanSystemState(it)
|
||||
}
|
||||
|
||||
@ChainLog(
|
||||
linkChainLog = CHAIN_LINK_LOG_WEB_SOCKET_VEHICLE,
|
||||
linkCode = CHAIN_LINK_ADAS,
|
||||
endpoint = PAD,
|
||||
nodeAliasCode = CHAIN_ALIAS_CODE_ADAS_MESSAGE_AUTOPILOT_VEHICLE,
|
||||
paramIndexes = [0, 1],
|
||||
clientPkFileName = "sn"
|
||||
)
|
||||
override fun onChassisStates(header: MessagePad.Header, chassisStates: ChassisStatesOuterClass.ChassisStates?) {
|
||||
if (chassisStates != null) {
|
||||
chassisStates.bcmSystemStates?.let { bcmSystemStates ->
|
||||
bcmSystemStates.turnLightState?.let {
|
||||
//转向灯数据
|
||||
CallerChassisLamplightListenerManager.invokeAutopilotLightSwitchData(it)
|
||||
}
|
||||
//刹车灯数据
|
||||
CallerChassisLamplightListenerManager.invokeAutopilotBrakeLightData(bcmSystemStates.brakeLightState != 0)
|
||||
}
|
||||
chassisStates.steerSystemStates?.let {
|
||||
//方向盘转向角数据
|
||||
CallerChassisSteeringStateListenerManager.invokeAutopilotSteeringData(it.steeringWheelAngle)
|
||||
}
|
||||
chassisStates.gearSystemStates?.let { gearSystemStates ->
|
||||
gearSystemStates.gearPosition?.let {
|
||||
//挂挡档位数据
|
||||
CallerChassisGearStateListenerManager.invokeAutopilotGearData(it)
|
||||
}
|
||||
}
|
||||
chassisStates.vehicleMotionStates?.let {
|
||||
//加速度
|
||||
CallerChassisAccStateListenerManager.invokeAutopilotAcc(it.acceleration)
|
||||
}
|
||||
chassisStates.drivingSystemStates?.let {
|
||||
//油门
|
||||
CallerChassisThrottleStateListenerManager.invokeAutopilotThrottle(it.throttleResponsePosition)
|
||||
}
|
||||
chassisStates.brakeSystemStates?.let {
|
||||
//刹车
|
||||
CallerChassisBrakeStateListenerManager.invokeAutopilotBrake(it.brakePedalResponsePosition)
|
||||
}
|
||||
chassisStates.taskSystemStates?.let { taskSystemStates ->
|
||||
taskSystemStates.sweeperFutianTaskSystemStates?.let {
|
||||
//清扫车(福田)清扫控制系统状态
|
||||
CallerSweeperFutianCleanSystemListenerManager.invokeSweeperFutianCleanSystemState(it)
|
||||
}
|
||||
}
|
||||
} else {
|
||||
CallerAutopilotVehicleStateListenerManager.invokeAutopilotDataException(header.timestamp.toLong())
|
||||
@@ -434,7 +464,15 @@ class MoGoAdasListenerImpl : OnAdasListener {
|
||||
invokePNCActions(it)
|
||||
}
|
||||
}
|
||||
/**
|
||||
* 重构后的功能状态
|
||||
*
|
||||
* @param header 头
|
||||
* @param functionStates 头
|
||||
*/
|
||||
override fun onFunctionStates(header: MessagePad.Header?, functionStates: FunctionStates.FSMFunctionStates?) {
|
||||
|
||||
}
|
||||
|
||||
/**
|
||||
* 是否可以启动自动驾驶
|
||||
|
||||
@@ -332,7 +332,7 @@ class AIDataCollectWindow constructor(activity: Activity) : View.OnTouchListener
|
||||
// 默认固定位置,靠屏幕右边缘的中间
|
||||
mWindowManager!!.defaultDisplay.getMetrics(metrics)
|
||||
mWindowParams!!.x = metrics.widthPixels
|
||||
mWindowParams!!.y = metrics.heightPixels / 2 - BarUtils.getStatusBarHeight() - 350
|
||||
mWindowParams!!.y = metrics.heightPixels - BarUtils.getStatusBarHeight()-950
|
||||
mWindowManager!!.addView(mFloatLayout, mWindowParams)
|
||||
}
|
||||
}
|
||||
|
||||
@@ -343,7 +343,7 @@ class InitiativeBadCaseWindow constructor(activity: Activity) : View.OnTouchList
|
||||
// 默认固定位置,靠屏幕右边缘的中间
|
||||
mWindowManager!!.defaultDisplay.getMetrics(metrics)
|
||||
mWindowParams!!.x = metrics.widthPixels
|
||||
mWindowParams!!.y = metrics.heightPixels / 2 - BarUtils.getStatusBarHeight() - 950
|
||||
mWindowParams!!.y = metrics.heightPixels - BarUtils.getStatusBarHeight()-950
|
||||
mWindowManager!!.addView(mFloatLayout, mWindowParams)
|
||||
//开启录包
|
||||
if (recordCaseEntity != null) {
|
||||
|
||||
@@ -16,6 +16,7 @@ import com.mogo.eagle.core.utilcode.mogo.logger.scene.SceneConstant.Companion.M_
|
||||
import com.mogo.eagle.core.utilcode.mogo.logger.scene.SceneConstant.Companion.M_OBU
|
||||
import com.mogo.eagle.core.utilcode.mogo.logger.scene.SceneConstant.Companion.M_OLD_ROUTE
|
||||
import com.mogo.eagle.core.utilcode.mogo.logger.scene.SceneConstant.Companion.M_OTHER
|
||||
import com.mogo.eagle.core.utilcode.mogo.logger.scene.SceneConstant.Companion.M_SWEEPER
|
||||
import com.mogo.eagle.core.utilcode.mogo.logger.scene.SceneConstant.Companion.M_TAXI
|
||||
import com.mogo.eagle.core.utilcode.mogo.logger.scene.SceneConstant.Companion.M_TAXI_P
|
||||
import com.mogo.eagle.core.utilcode.mogo.logger.scene.SceneConstant.Companion.M_V2X
|
||||
@@ -38,6 +39,7 @@ class SceneManager {
|
||||
private const val NET = "NET"
|
||||
private const val BUS = "BUS"
|
||||
private const val TAXI = "TAXI"
|
||||
private const val SWEEPER = "SWEEPER"
|
||||
private const val TAXI_P = "TAXI_P"
|
||||
private const val OTHER = "OTHER"
|
||||
|
||||
@@ -63,6 +65,7 @@ class SceneManager {
|
||||
sceneModuleTAG.map[BUS] = SceneModule(true, M_BUS)
|
||||
sceneModuleTAG.map[TAXI] = SceneModule(true, M_TAXI)
|
||||
sceneModuleTAG.map[TAXI_P] = SceneModule(true, M_TAXI_P)
|
||||
sceneModuleTAG.map[SWEEPER] = SceneModule(true, M_SWEEPER)
|
||||
sceneModuleTAG.map[OTHER] = SceneModule(false, M_OTHER)
|
||||
|
||||
sceneLogTAG.map[TAXI] = SceneTAG(false)
|
||||
@@ -160,6 +163,15 @@ class SceneManager {
|
||||
sceneCache[M_OLD_ROUTE]?.logger = logger
|
||||
scene.updateSceneCache(sceneCache)
|
||||
}
|
||||
SWEEPER -> {
|
||||
sceneCache[M_SWEEPER]?.logger = logger
|
||||
sceneCache[M_NETWORK]?.logger = logger
|
||||
sceneCache[M_ADAS_IMPL]?.logger = logger
|
||||
sceneCache[M_HMI]?.logger = logger
|
||||
sceneCache[M_DEVA]?.logger = logger
|
||||
sceneCache[M_OLD_ROUTE]?.logger = logger
|
||||
scene.updateSceneCache(sceneCache)
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -4,7 +4,7 @@ import android.content.Context
|
||||
import android.util.Log
|
||||
import chassis.Chassis.GearPosition
|
||||
import chassis.Chassis.LightSwitch
|
||||
import chassis.VehicleStateOuterClass
|
||||
import chassis.ChassisStatesOuterClass
|
||||
import com.mogo.eagle.core.function.api.autopilot.*
|
||||
import com.mogo.eagle.core.function.call.autopilot.*
|
||||
import com.mogo.eagle.core.utilcode.kotlin.safeCancel
|
||||
@@ -105,7 +105,7 @@ internal class CanImpl(ctx: Context) :
|
||||
timeOutCheck()
|
||||
}
|
||||
|
||||
override fun onSweeperFutianCleanSystemState(cleanSystemState: VehicleStateOuterClass.SweeperFuTianCleanSystemState) {
|
||||
override fun onSweeperFutianCleanSystemState(cleanSystemState: ChassisStatesOuterClass.SweeperFuTianTaskSystemStates) {
|
||||
send(CanStatus(isCanEnabled()))
|
||||
timeOutCheck()
|
||||
}
|
||||
|
||||
@@ -18,7 +18,7 @@ import androidx.core.content.ContextCompat
|
||||
import androidx.core.view.*
|
||||
import androidx.recyclerview.widget.LinearLayoutManager
|
||||
import chassis.Chassis
|
||||
import chassis.VehicleStateOuterClass
|
||||
import chassis.ChassisStatesOuterClass
|
||||
import com.mogo.cloud.passport.MoGoAiCloudClient
|
||||
import com.mogo.cloud.passport.MoGoAiCloudClientConfig
|
||||
import com.mogo.commons.debug.DebugConfig
|
||||
@@ -1251,6 +1251,8 @@ class DebugSettingView @JvmOverloads constructor(
|
||||
SceneConstant.M_TAXI -> cbTaxiLog.isChecked = log
|
||||
//TAXI_P日志标签
|
||||
SceneConstant.M_TAXI_P -> cbTaxiPLog.isChecked = log
|
||||
//清扫车日志
|
||||
SceneConstant.M_SWEEPER -> cbSweeperPLog.isChecked = log
|
||||
//其他模块日志(暂未区分具体模块)
|
||||
SceneConstant.M_OTHER -> cbOtherLog.isChecked = log
|
||||
}
|
||||
@@ -1381,6 +1383,12 @@ class DebugSettingView @JvmOverloads constructor(
|
||||
sceneMap[SceneConstant.M_TAXI_P] = taxiPModule
|
||||
CallerDevaToolsManager.updateModuleTAG(sceneMap)
|
||||
}
|
||||
//清扫车日志标签
|
||||
cbTaxiPLog.setOnCheckedChangeListener { _, isChecked ->
|
||||
val sweeperModule = SceneModule(isChecked, SceneConstant.M_SWEEPER)
|
||||
sceneMap[SceneConstant.M_SWEEPER] = sweeperModule
|
||||
CallerDevaToolsManager.updateModuleTAG(sceneMap)
|
||||
}
|
||||
//其他未分类模块日志
|
||||
cbOtherLog.setOnCheckedChangeListener { _, isChecked ->
|
||||
val otherModule = SceneModule(isChecked, SceneConstant.M_OTHER)
|
||||
@@ -2145,7 +2153,7 @@ class DebugSettingView @JvmOverloads constructor(
|
||||
/**
|
||||
* 清扫车(福田)清扫控制系统状态
|
||||
*/
|
||||
override fun onSweeperFutianCleanSystemState(cleanSystemState: VehicleStateOuterClass.SweeperFuTianCleanSystemState) {
|
||||
override fun onSweeperFutianCleanSystemState(cleanSystemState: ChassisStatesOuterClass.SweeperFuTianTaskSystemStates) {
|
||||
|
||||
}
|
||||
|
||||
|
||||
@@ -2146,6 +2146,13 @@
|
||||
android:layout_height="wrap_content"
|
||||
android:checked="false"
|
||||
android:text="乘客屏日志" />
|
||||
<CheckBox
|
||||
android:id="@+id/cbSweeperPLog"
|
||||
style="@style/DebugSettingText"
|
||||
android:layout_width="wrap_content"
|
||||
android:layout_height="wrap_content"
|
||||
android:checked="false"
|
||||
android:text="清扫车日志" />
|
||||
|
||||
<CheckBox
|
||||
android:id="@+id/cbOtherLog"
|
||||
|
||||
@@ -1,5 +1,7 @@
|
||||
package com.mogo.eagle.core.function.smp;
|
||||
|
||||
import static com.mogo.eagle.core.utilcode.mogo.logger.scene.SceneConstant.M_MAP;
|
||||
|
||||
import android.content.Context;
|
||||
import android.os.Bundle;
|
||||
import android.view.View;
|
||||
@@ -16,8 +18,10 @@ import com.mogo.eagle.core.function.api.autopilot.IMoGoAutopilotStatusListener;
|
||||
import com.mogo.eagle.core.function.api.autopilot.IMoGoPlanningRottingListener;
|
||||
import com.mogo.eagle.core.function.api.map.smp.IMogoSmallMapProvider;
|
||||
import com.mogo.eagle.core.function.call.autopilot.CallerAutoPilotManager;
|
||||
import com.mogo.eagle.core.function.call.autopilot.CallerAutoPilotStatusListenerManager;
|
||||
import com.mogo.eagle.core.function.call.autopilot.CallerPlanningRottingListenerManager;
|
||||
import com.mogo.eagle.core.function.map.R;
|
||||
import com.mogo.eagle.core.utilcode.mogo.logger.CallerLogger;
|
||||
import com.mogo.eagle.core.utilcode.util.UiThreadHandler;
|
||||
|
||||
import org.jetbrains.annotations.NotNull;
|
||||
@@ -67,6 +71,7 @@ public class SmallMapFragment extends BaseFragment
|
||||
mSmallMapDirectionView = mRootView.findViewById(R.id.smallMapDirectionView);
|
||||
mSmallMapDirectionView.onCreateView(savedInstanceState);
|
||||
CallerPlanningRottingListenerManager.INSTANCE.addListener(TAG, this);
|
||||
CallerAutoPilotStatusListenerManager.INSTANCE.addListener(TAG,this);
|
||||
}
|
||||
|
||||
@Override
|
||||
@@ -86,8 +91,13 @@ public class SmallMapFragment extends BaseFragment
|
||||
@Override
|
||||
public void drawablePolyline(List<MogoLatLng> coordinates) {
|
||||
if (mSmallMapDirectionView != null) {
|
||||
mSmallMapDirectionView.convert(coordinates);
|
||||
UiThreadHandler.post(() -> mSmallMapDirectionView.drawablePolyline());
|
||||
UiThreadHandler.post(new Runnable() {
|
||||
@Override
|
||||
public void run() {
|
||||
mSmallMapDirectionView.convert(coordinates);
|
||||
mSmallMapDirectionView.drawablePolyline();
|
||||
}
|
||||
});
|
||||
}
|
||||
}
|
||||
|
||||
@@ -127,9 +137,12 @@ public class SmallMapFragment extends BaseFragment
|
||||
@Override
|
||||
public void onAutopilotStatusResponse(@NotNull AutopilotStatusInfo autoPilotStatusInfo) {
|
||||
int tempStatus = autoPilotStatusInfo.getPilotmode();
|
||||
CallerLogger.INSTANCE.i(M_MAP + TAG, "onAutopilotStatusResponse:"+tempStatus+" autoPilotStatus:"+autoPilotStatus);
|
||||
if (tempStatus != 1) {
|
||||
CallerLogger.INSTANCE.i(M_MAP + TAG, "onAutopilotStatusResponse:"+tempStatus+" clearPolyline");
|
||||
clearPolyline();
|
||||
}else if (tempStatus == 1 && autoPilotStatus == 0){
|
||||
CallerLogger.INSTANCE.i(M_MAP + TAG, "onAutopilotStatusResponse:getGlobalPath");
|
||||
CallerAutoPilotManager.INSTANCE.getGlobalPath();
|
||||
}
|
||||
autoPilotStatus = tempStatus;
|
||||
@@ -156,16 +169,21 @@ public class SmallMapFragment extends BaseFragment
|
||||
|
||||
@Override
|
||||
public void onAutopilotRotting(MessagePad.GlobalPathResp globalPathResp) {
|
||||
CallerLogger.INSTANCE.i(M_MAP + TAG, "onAutopilotRotting");
|
||||
if (globalPathResp == null || globalPathResp.getWayPointsList().size() == 0) {
|
||||
return;
|
||||
}
|
||||
CallerLogger.INSTANCE.i(M_MAP + TAG, "onAutopilotRotting:"+globalPathResp.getWayPointsList().size());
|
||||
|
||||
List<MogoLatLng> latLngList = new ArrayList<>();
|
||||
for (MessagePad.Location routeModel : globalPathResp.getWayPointsList()) {
|
||||
latLngList.add(new MogoLatLng(routeModel.getLatitude(), routeModel.getLongitude()));
|
||||
}
|
||||
if (latLngList.size() > 0) {
|
||||
CallerLogger.INSTANCE.i(M_MAP + TAG, "onAutopilotRotting:"+"drawablePolyline");
|
||||
drawablePolyline(latLngList);
|
||||
} else {
|
||||
CallerLogger.INSTANCE.i(M_MAP + TAG, "onAutopilotRotting:"+"clearPolyline");
|
||||
clearPolyline();
|
||||
}
|
||||
}
|
||||
|
||||
@@ -654,39 +654,59 @@ enum class EventTypeEnum(
|
||||
return when (poiType) {
|
||||
//交通检查
|
||||
TRAFFIC_CHECK.poiType -> {
|
||||
R.drawable.v_to_x_marker_2
|
||||
R.drawable.v2x_icon_jiaotongjiancha_vr
|
||||
}
|
||||
//封路
|
||||
ROAD_CLOSED.poiType -> {
|
||||
R.drawable.v_to_x_marker_16
|
||||
R.drawable.v2x_icon_fenglu_vr
|
||||
}
|
||||
//施工
|
||||
FOURS_ROAD_WORK.poiType -> {
|
||||
R.drawable.v_to_x_marker_11
|
||||
R.drawable.icon_warning_v2x_road_construction
|
||||
}
|
||||
//AI施工
|
||||
AI_ROAD_WORK.poiType -> {
|
||||
R.drawable.v_to_x_marker_11
|
||||
R.drawable.icon_warning_v2x_road_construction
|
||||
}
|
||||
//拥堵
|
||||
FOURS_BLOCK_UP.poiType -> {
|
||||
R.drawable.v_to_x_marker_5
|
||||
R.drawable.icon_warning_v2x_congestion
|
||||
}
|
||||
//积水
|
||||
FOURS_PONDING.poiType -> {
|
||||
R.drawable.v_to_x_marker_6
|
||||
R.drawable.v2x_icon_jishui_vr
|
||||
}
|
||||
//浓雾
|
||||
FOURS_FOG.poiType -> {
|
||||
R.drawable.v_to_x_marker_9
|
||||
R.drawable.v2x_icon_nongwu_vr
|
||||
}
|
||||
//结冰
|
||||
FOURS_ICE.poiType -> {
|
||||
R.drawable.v_to_x_marker_8
|
||||
R.drawable.v2x_icon_jiebing_vr
|
||||
}
|
||||
//事故
|
||||
FOURS_ACCIDENT.poiType -> {
|
||||
R.drawable.v_to_x_marker_7
|
||||
R.drawable.v2x_icon_jiaotongshigu_vr
|
||||
}
|
||||
//重大事故
|
||||
FOURS_ACCIDENT_01.poiType -> {
|
||||
R.drawable.v2x_icon_jiaotongshigu_vr
|
||||
}
|
||||
//特大事故
|
||||
FOURS_ACCIDENT_02.poiType -> {
|
||||
R.drawable.v2x_icon_jiaotongshigu_vr
|
||||
}
|
||||
//较大事故
|
||||
FOURS_ACCIDENT_03.poiType -> {
|
||||
R.drawable.v2x_icon_jiaotongshigu_vr
|
||||
}
|
||||
//一般事故
|
||||
FOURS_ACCIDENT_04.poiType -> {
|
||||
R.drawable.v2x_icon_jiaotongshigu_vr
|
||||
}
|
||||
//轻微事故
|
||||
FOURS_ACCIDENT_05.poiType -> {
|
||||
R.drawable.v2x_icon_jiaotongshigu_vr
|
||||
}
|
||||
//事故
|
||||
FOURS_LIVING.poiType -> {
|
||||
@@ -708,6 +728,30 @@ enum class EventTypeEnum(
|
||||
ALERT_CAR_TROUBLE_WARNING.poiType -> {
|
||||
R.drawable.icon_car_red
|
||||
}
|
||||
//VIP车辆优先通行,已为您变为绿灯
|
||||
TYPE_VIP_IDENTIFICATION_PASS.poiType -> {
|
||||
R.drawable.icon_warning_v2x_vip_turn_light
|
||||
}
|
||||
//VIP车辆优先通行,已为您延长绿灯
|
||||
TYPE_VIP_IDENTIFICATION_EXTEND.poiType -> {
|
||||
R.drawable.icon_warning_v2x_vip_turn_light
|
||||
}
|
||||
//VIP变灯请求失败
|
||||
TYPE_VIP_ERROR_IDENTIFICATION.poiType -> {
|
||||
R.drawable.icon_warning_v2x_vip_turn_light
|
||||
}
|
||||
//最优路线
|
||||
TYPE_OPTIMAL_ROUTE_RECOMMEND.poiType -> {
|
||||
R.drawable.icon_warning_v2x_optimal_route
|
||||
}
|
||||
//鬼探头类型
|
||||
GHOST_PROBE.poiType -> {
|
||||
R.drawable.icon_warning_v2x_pedestrian_crossing
|
||||
}
|
||||
//接管
|
||||
TAKE_OVER_EVENT.poiType -> {
|
||||
R.drawable.icon_warning_take_over
|
||||
}
|
||||
else -> {
|
||||
R.drawable.icon_default
|
||||
}
|
||||
|
||||
@@ -9,6 +9,6 @@ interface IMoGoAutopilotVehicleStateListener {
|
||||
/**
|
||||
* 没有自车状态数据
|
||||
*/
|
||||
fun onAutopilotDataException(timestamp: Long){}
|
||||
fun onAutopilotDataException(timestamp: Long) {}
|
||||
|
||||
}
|
||||
0
core/mogo-core-res/src/main/res/drawable-xhdpi/icon_map_marker_road_block_up2_white.png
Executable file → Normal file
|
Before Width: | Height: | Size: 3.6 KiB After Width: | Height: | Size: 3.6 KiB |
0
core/mogo-core-res/src/main/res/drawable-xhdpi/icon_map_marker_road_check2_white.png
Executable file → Normal file
|
Before Width: | Height: | Size: 2.8 KiB After Width: | Height: | Size: 2.8 KiB |
0
core/mogo-core-res/src/main/res/drawable-xhdpi/module_common_icon_map_marker_road_block_up2_white.png
Normal file → Executable file
|
Before Width: | Height: | Size: 3.6 KiB After Width: | Height: | Size: 3.6 KiB |
0
core/mogo-core-res/src/main/res/drawable-xhdpi/module_common_icon_map_marker_road_check2_white.png
Normal file → Executable file
|
Before Width: | Height: | Size: 2.8 KiB After Width: | Height: | Size: 2.8 KiB |
@@ -10,6 +10,7 @@ import com.mogo.eagle.core.utilcode.mogo.logger.scene.SceneConstant.Companion.M_
|
||||
import com.mogo.eagle.core.utilcode.mogo.logger.scene.SceneConstant.Companion.M_NETWORK
|
||||
import com.mogo.eagle.core.utilcode.mogo.logger.scene.SceneConstant.Companion.M_OLD_ROUTE
|
||||
import com.mogo.eagle.core.utilcode.mogo.logger.scene.SceneConstant.Companion.M_OTHER
|
||||
import com.mogo.eagle.core.utilcode.mogo.logger.scene.SceneConstant.Companion.M_SWEEPER
|
||||
import com.mogo.eagle.core.utilcode.mogo.logger.scene.SceneConstant.Companion.M_TAXI
|
||||
import com.mogo.eagle.core.utilcode.mogo.logger.scene.SceneConstant.Companion.M_TAXI_P
|
||||
import com.mogo.eagle.core.utilcode.mogo.logger.scene.SceneConstant.Companion.M_V2X
|
||||
@@ -67,6 +68,9 @@ class Scene {
|
||||
//初始化BUS
|
||||
val busMap = SceneLogCache(mutableMapOf(), true)
|
||||
sceneCache[M_BUS] = busMap
|
||||
//初始化清扫车
|
||||
val sweeperMap = SceneLogCache(mutableMapOf(), true)
|
||||
sceneCache[M_SWEEPER] = sweeperMap
|
||||
|
||||
}
|
||||
|
||||
|
||||
@@ -39,6 +39,8 @@ class SceneConstant {
|
||||
const val M_TAXI = "M_TAXI-"
|
||||
//出租车乘客屏
|
||||
const val M_TAXI_P = "M_TAXI_P-"
|
||||
//清扫车
|
||||
const val M_SWEEPER = "M_SWEEPER-"
|
||||
|
||||
}
|
||||
}
|
||||
69
libraries/mogo-adas-data/src/main/proto/bag_manager.proto
Normal file
@@ -0,0 +1,69 @@
|
||||
syntax = "proto2";
|
||||
package bag_manager;
|
||||
|
||||
enum BagStat{
|
||||
SUCCEED = 0;
|
||||
EXECUTING = 1;
|
||||
EXECUTEERROR = 2;
|
||||
COPYERROR = 3;
|
||||
MERGEERROR = 4;
|
||||
UPLOADCOSERROR = 5;
|
||||
}
|
||||
|
||||
// 上传cos桶状态
|
||||
message UploadCosStat{
|
||||
required uint64 key = 1;
|
||||
required uint32 stat = 2; // 0-成功 1-执行中 2-copy过程失败 3-合并过程失败 4-上传过程失败
|
||||
optional string message = 3; // 失败时的具体描述
|
||||
}
|
||||
|
||||
//空间使用情况
|
||||
message SpaceInfo{
|
||||
optional string directory = 1; // 路径名,为空表示总空间,否则表示对应的/home/mogo/data/bags下的子目录
|
||||
optional uint64 total = 2; // 总空间
|
||||
optional uint64 free = 3; // 可用空间
|
||||
optional uint64 used = 4; // 已用空间
|
||||
}
|
||||
// bag目录空间使用情况
|
||||
message BagSpaceInfo{
|
||||
optional string host = 1; // 主机名
|
||||
optional SpaceInfo diskSpaceInfo = 2; // 硬盘空间信息
|
||||
repeated SpaceInfo BagDirsSpaceInfo = 3; // /home/mogo/data/bags下各子空间信息
|
||||
}
|
||||
|
||||
// bag附加信息(录音,备注,接管信息)
|
||||
message BagDescription{
|
||||
optional string description = 1; // bag接管描述或重命名信息
|
||||
optional bool hasAudio = 2; // 此bag是否具有录音文件
|
||||
optional string audioUrl = 3; // bag附加录音文件的文件名
|
||||
optional bool reportBI = 4; //上报BI状态
|
||||
}
|
||||
|
||||
// 各主机上报的包信息
|
||||
message SubBag {
|
||||
required uint64 key = 1; // bag key值
|
||||
required string host = 2; // 主机名
|
||||
optional uint64 size = 3; // 此子包的大小
|
||||
}
|
||||
|
||||
// 单个key值对应的包信息
|
||||
message BagInfo{
|
||||
required uint64 key = 1; // bag key值
|
||||
optional uint64 totalSize = 2; // 所有子包或合并后的包的总大小
|
||||
optional string timestamp = 3; // 时间戳
|
||||
optional string bagPath = 4; // bag所在路径
|
||||
optional bool mergeStat = 5; // 合并状态
|
||||
optional bool uploadStat = 6; // 上传cos桶状态
|
||||
optional BagDescription description = 7; // 包描述信息
|
||||
repeated SubBag subBags = 8; // 子包信息
|
||||
}
|
||||
|
||||
// 包管理请求
|
||||
message BagManager{
|
||||
required uint32 reqType = 1; // 请求类型:0-invalid 1-获取空间使用信息 2-遍历所有bag 3-上传cos 4-删除bag 5-为bag添加附加信息
|
||||
optional uint64 keyReq = 2; // 要操作的包的key值,发送请求且reqType=(3,4,5)时有效
|
||||
optional BagDescription descReq = 3; // 更新包附加信息,发送请求且reqType=5时有效
|
||||
repeated BagSpaceInfo spaceInfoResp = 4; // 空间使用信息,获取响应且reqType=1时有效
|
||||
repeated BagInfo bagsInfoResp = 5; // 包信息列表,获取响应且reqType=2时有效
|
||||
optional UploadCosStat uploadCosResp = 6; //反馈上传cos桶结果,获取响应且reqType=3时有效
|
||||
}
|
||||
@@ -24,7 +24,8 @@ enum PilotMode {
|
||||
MODE_STEER_ONLY = 2;
|
||||
MODE_SPEED_ONLY = 3;
|
||||
MODE_REMOTE_DRIVE = 6;
|
||||
CHASSID_TELECONTROL_DRIVE = 7;
|
||||
MODE_TELECONTROL_DRIVE = 7;
|
||||
MODE_INVALID = 8;
|
||||
}
|
||||
|
||||
enum LongitudeDrivingMode {
|
||||
@@ -98,4 +99,4 @@ enum CleanSystemControlMode {
|
||||
Clean_PureWash_Both_Side_Work = 12;
|
||||
Clean_PureWash_Left_Work = 13;
|
||||
Clean_PureWash_Right_Work = 14;
|
||||
}
|
||||
}
|
||||
|
||||
@@ -6,7 +6,7 @@ import "geometry.proto";
|
||||
enum ProtocolVersion
|
||||
{
|
||||
Defaultver = 0;
|
||||
CurrentVersion = 9; //每次修改proto文件增加1
|
||||
CurrentVersion = 12; //每次修改proto文件增加1
|
||||
}
|
||||
|
||||
enum MessageType
|
||||
@@ -58,6 +58,7 @@ enum MessageType
|
||||
MsgTypeSpecialVehicleTaskCmd = 0x10118; //特种车辆命令
|
||||
MsgTypeSetParamReq = 0x10119; //设置参数命令
|
||||
MsgTypeTripInfoEvent = 0x1011a; //行程信息
|
||||
MsgTypeBagManagerCmd = 0x1011b; //bag管理
|
||||
}
|
||||
|
||||
message Header
|
||||
@@ -208,6 +209,7 @@ message Line
|
||||
message TrajectoryDownloadReq
|
||||
{
|
||||
Line line = 1; //路线
|
||||
uint32 source = 2; //来源方, 0:invalid, 1:pad, 2:aicloud
|
||||
}
|
||||
|
||||
// message definition for MessageType: MsgTypeBasicInfoReq
|
||||
@@ -452,9 +454,14 @@ enum DrivingState
|
||||
AUTO_LANE_CHANGE_RIGHT = 6; //主动向左变道状态: driving_action:1 表示触发变道;driving_action:2 表示执行变道;driving_action:3 表示变道取消;driving_action:4 表示变道完成
|
||||
LANE_AVOID_LEFT = 7; //主动向左绕行状态: driving_action:1 表示触发绕行;driving_action:2 表示执行绕行;driving_action:3 表示绕行取消;driving_action:4 表示绕行完成
|
||||
LANE_AVOID_RIGHT = 8; //主动向右绕行状态: driving_action:1 表示触发绕行;driving_action:2 表示执行绕行;driving_action:3 表示绕行取消;driving_action:4 表示绕行完成
|
||||
START_UP = 9; //起步状态: driving_action:1 表示正常启动;driving_action:2 表示择机起步;
|
||||
PULL_OVER = 10; //靠边停车状态: driving_action:1 表示正常靠边停车;driving_action:2 表示择机靠边停车;
|
||||
UN_PROTECTED_INTERSECTION = 11; //路口预测响应状态: driving_action:1 表示触发了预测响应;
|
||||
START_UP = 9; //起步状态: driving_action:1 表示正常启动;driving_action:2 表示择机起步
|
||||
PULL_OVER = 10; //靠边停车状态: driving_action:1 表示正常靠边停车;driving_action:2 表示择机靠边停车
|
||||
UN_PROTECTED_INTERSECTION = 11; //路口预测响应状态: driving_action:1 表示触发了预测响应
|
||||
AUTO_LANE_CHANGE_LEFT_V2N = 12; //V2N主动向左变道状态: driving_action:1 表示触发变道;driving_action:2 表示执行变道;driving_action:3 表示变道取消;driving_action:4 表示变道完成
|
||||
AUTO_LANE_CHANGE_RIGHT_V2N = 13; //V2N主动向右变道状态: driving_action:1 表示触发变道;driving_action:2 表示执行变道;driving_action:3 表示变道取消;driving_action:4 表示变道完成
|
||||
LANE_AVOID_LEFT_V2N = 14; //V2N主动向左绕行状态: driving_action:1 表示触发绕行;driving_action:2 表示执行绕行;driving_action:3 表示绕行取消;driving_action:4 表示绕行完成
|
||||
LANE_AVOID_RIGHT_V2N = 15; //V2N主动向右绕行状态: driving_action:1 表示触发绕行;driving_action:2 表示执行绕行;driving_action:3 表示绕行取消;driving_action:4 表示绕行完成
|
||||
WAITING_V2N = 16; //V2N正在等待变道避让施工场景/静止障碍物: driving_action:1 表示正在等待;driving_action:2 表示等待超时请求平行驾驶;
|
||||
}
|
||||
|
||||
enum DrivingAction
|
||||
@@ -515,4 +522,6 @@ message TripInfoEvent
|
||||
//message definition for MsgTypeObuWarningData
|
||||
//refer to obu_warning_event.proto for details
|
||||
|
||||
//message definition for MsgTypeBagManagerCmd
|
||||
//refer to bag_manager.proto for details
|
||||
|
||||
|
||||
@@ -1,5 +1,5 @@
|
||||
syntax = "proto3";
|
||||
package mogo.v2x.v2i;
|
||||
package mogo.v2x;
|
||||
|
||||
import "header.proto";
|
||||
import "mogo_v2x.proto";
|
||||
@@ -91,10 +91,27 @@ message SpatWarningData{
|
||||
repeated SpatLight lights = 3; /* 灯色信息集合 */
|
||||
}
|
||||
|
||||
message ObuWarningData{
|
||||
common.Header header = 1;
|
||||
int32 MsgDataType = 2; /*1:rsiEvent; 2:RsmEvent; 3:SpatEvent*/
|
||||
RsiWarningData rsiEvent = 3;
|
||||
RsmWarningData RsmEvent = 4;
|
||||
SpatWarningData SpatEvent = 5;
|
||||
message NodeID{
|
||||
int32 region = 1;/* 定义地图中划分区域的ID号 */
|
||||
int32 id = 2; /* 定义地图节点ID */
|
||||
}
|
||||
|
||||
message MapMatchData{
|
||||
int32 status = 1;/* 状态信息,0:更新,1:添加,2:删除 */
|
||||
int32 unitMask = 2;/* 描述所属字段有效性 */
|
||||
NodeID currentNodeID = 3;/* 前方节点信息 */
|
||||
NodeID upstreamNodeID = 4;/* 上游节点信息 */
|
||||
int32 matchingLaneID = 5;/* 匹配车道ID,0:无效 */
|
||||
int32 speedMaxLimit = 6;/* 建议最大车速,单位(0.02m/s) */
|
||||
int32 speedMinLimit = 7;/* 建议最小车速,单位(0.02m/s) */
|
||||
}
|
||||
|
||||
message ObuWarningData{
|
||||
common.Header header = 1;
|
||||
int32 msgDataType = 2; /*1:rsiEvent; 2:rsmEvent; 3:spatEvent; 4:mapMatchData*/
|
||||
RsiWarningData rsiEvent = 3;
|
||||
RsmWarningData rsmEvent = 4;
|
||||
SpatWarningData spatEvent = 5;
|
||||
MapMatchData mapMatchData = 6;
|
||||
}
|
||||
|
||||
|
||||
@@ -17,4 +17,8 @@ message RoboSweeperTaskIndex {
|
||||
double ref_edge_point_lon = 10; // 投影边沿点经度
|
||||
double ref_edge_point_lat = 11; // 投影边沿点纬度
|
||||
double dist_to_ref_edge_point = 12; // 自车到投影边沿点的距离 正值为在投影边沿点的右边 ,负值为在投影边沿点的右边
|
||||
}
|
||||
|
||||
uint32 clean_mode = 13; // 清扫作业模式 1–纯扫 2--洗扫, 3--纯洗, 4--纯吸
|
||||
uint32 clean_direction = 14; // 清扫方向 1--两侧, 2--左侧, 3--右侧
|
||||
uint32 clean_intensity= 15; // 作业强度 1–标准 2--强力
|
||||
}
|
||||
|
||||
@@ -30,7 +30,6 @@ message HealthInfo{
|
||||
message TopicInfo{
|
||||
optional string name = 1; //topic name
|
||||
optional int32 hz = 2; //Topic发送的频率
|
||||
// optional int32 max_delay = 3; //unit: msec
|
||||
}
|
||||
|
||||
message DropTopic{
|
||||
@@ -38,10 +37,28 @@ message DropTopic{
|
||||
repeated TopicInfo topic = 2;
|
||||
}
|
||||
|
||||
message NodeInfo{
|
||||
optional string node_name = 1; //node name
|
||||
optional string launch_name = 2; //launch name
|
||||
optional int32 state = 3; //0:未知状态None,1:依赖未就绪Waiting,2:启动中Starting,3:运行running,4:停止stopping,5:无法启动状态,6:人为启动状态,7:人为关闭状态
|
||||
}
|
||||
|
||||
message NodeFaultList{
|
||||
required int32 sum = 1; //下述node总数
|
||||
repeated NodeInfo node = 2;
|
||||
}
|
||||
|
||||
message StatusInfo {
|
||||
required SystemState sys_state=1; // 当前消息状态
|
||||
required SystemState sys_state=1; // 当前系统状态
|
||||
repeated HealthInfo health_info=2; // 健康检查状态信息
|
||||
optional DropTopic topic_drop_info=3; // topic 掉频信息, 如有掉频添加没有不添加
|
||||
optional string reserved = 4; // 预留可选字段,用于接口扩充或者,其他信息补充
|
||||
optional string reserved = 4; // 用于表示idle模式,'idle' 表示idle模式 'work' 表示正常工作
|
||||
// add by liyl 20220907
|
||||
optional int32 pilot_mode = 5; // 0: manaul 1: autopilot 2: RemotePilot
|
||||
optional string map_version = 6; // MAP 版本信息
|
||||
optional string master_version = 7; // system_master 版本信息
|
||||
optional bool auto_pilot_ready = 8; // 自动驾驶状态就绪, 20221111增加
|
||||
optional bool remote_pilot_ready = 9; // 平行驾驶状态就绪
|
||||
optional NodeFaultList auto_pilot_unready_list = 10; //20221128 增加
|
||||
optional NodeFaultList remote_pilot_unready_list = 11; //20221128 增加
|
||||
}
|
||||
|
||||
@@ -4,7 +4,9 @@ import com.zhidao.support.adas.high.bean.AutopilotAbility;
|
||||
import com.zhidao.support.adas.high.bean.AutopilotStatistics;
|
||||
import com.zhidao.support.adas.high.common.ProtocolStatus;
|
||||
|
||||
import chassis.ChassisStatesOuterClass;
|
||||
import chassis.VehicleStateOuterClass;
|
||||
import function_state_management.FunctionStates;
|
||||
import mogo.telematics.pad.MessagePad;
|
||||
import mogo_msg.MogoReportMsg;
|
||||
import perception.TrafficLightOuterClass;
|
||||
@@ -51,13 +53,24 @@ public interface OnAdasListener {
|
||||
void onGnssInfo(MessagePad.Header header, MessagePad.GnssInfo gnssInfo);
|
||||
|
||||
/**
|
||||
* 底盘信息, 透传底盘状态,pb参考底盘
|
||||
* 老底盘信息,透传底盘状态,pb参考底盘
|
||||
* TODO 老地盘数据会转发到新地盘
|
||||
* TODO 鹰眼不要用此接口展示页面相关,可以用来记录链路日志
|
||||
* TODO 后期可能会优化掉
|
||||
*
|
||||
* @param header 头
|
||||
* @param vehicleState 数据
|
||||
*/
|
||||
void onVehicleState(MessagePad.Header header, VehicleStateOuterClass.VehicleState vehicleState);
|
||||
|
||||
/**
|
||||
* 底盘状态
|
||||
*
|
||||
* @param header 头
|
||||
* @param chassisStates 头
|
||||
*/
|
||||
void onChassisStates(MessagePad.Header header, ChassisStatesOuterClass.ChassisStates chassisStates);
|
||||
|
||||
/**
|
||||
* 自动驾驶状态
|
||||
*
|
||||
@@ -180,6 +193,13 @@ public interface OnAdasListener {
|
||||
*/
|
||||
void onPlanningActionMsg(MessagePad.Header header, MessagePad.PlanningActionMsg planningActionMsg);
|
||||
|
||||
/**
|
||||
* 重构后的功能状态
|
||||
*
|
||||
* @param header 头
|
||||
* @param functionStates 头
|
||||
*/
|
||||
void onFunctionStates(MessagePad.Header header, FunctionStates.FSMFunctionStates functionStates);
|
||||
|
||||
/**
|
||||
* 是否有能力启动自动驾驶
|
||||
|
||||
@@ -16,13 +16,15 @@ public enum MessageType {
|
||||
TYPE_RECEIVE_TRAJECTORY(MessagePad.MessageType.MsgTypeTrajectory, "车前引导线"),
|
||||
TYPE_RECEIVE_TRACKED_OBJECTS(MessagePad.MessageType.MsgTypeTrackedObjects, "障碍物信息"),
|
||||
TYPE_RECEIVE_GNSS_INFO(MessagePad.MessageType.MsgTypeGnssInfo, "惯导信息"),
|
||||
TYPE_RECEIVE_VEHICLE_STATE(MessagePad.MessageType.MsgTypeVehicleState, "底盘信息"),
|
||||
TYPE_RECEIVE_VEHICLE_STATE(MessagePad.MessageType.MsgTypeVehicleState, "老底盘状态"),
|
||||
TYPE_RECEIVE_AUTOPILOT_STATE(MessagePad.MessageType.MsgTypeAutopilotState, "自动驾驶状态"),
|
||||
TYPE_RECEIVE_REPORT_MESSAGE(MessagePad.MessageType.MsgTypeReportMessage, "监控事件报告"),
|
||||
TYPE_RECEIVE_PERCEPTION_TRAFFIC_LIGHT(MessagePad.MessageType.MsgTypePerceptionTrafficLight, "感知红绿灯"),
|
||||
TYPE_RECEIVE_PREDICTION_OBSTACLE_TRAJECTORY(MessagePad.MessageType.MsgTypePredictionObstacleTrajectory, "他车轨迹预测"),
|
||||
TYPE_RECEIVE_POINT_CLOUD(MessagePad.MessageType.MsgTypePointCloud, "点云透传"),
|
||||
TYPE_RECEIVE_PLANNING_OBJECTS(MessagePad.MessageType.MsgTypePlanningObjects, "Planning障碍物"),
|
||||
TYPE_RECEIVE_CHASSIS_STATES(MessagePad.MessageType.MsgTypeChassisStates, "底盘状态"),
|
||||
TYPE_RECEIVE_FUNCTION_STATES(MessagePad.MessageType.MsgTypeFunctionStates, "重构后功能状态"),
|
||||
|
||||
TYPE_RECEIVE_BASIC_INFO_REQ(MessagePad.MessageType.MsgTypeBasicInfoReq, "自动驾驶设备基础信息请求"),
|
||||
TYPE_SEND_BASIC_INFO_RESP(MessagePad.MessageType.MsgTypeBasicInfoResp, "自动驾驶设备基础信息应答"),
|
||||
@@ -52,7 +54,7 @@ public enum MessageType {
|
||||
TYPE_SEND_SET_PARAM_REQ(MessagePad.MessageType.MsgTypeSetParamReq, "设置参数命令"),
|
||||
TYPE_SEND_TRIP_INFO_REQ(MessagePad.MessageType.MsgTypeTripInfoEvent, "行程信息"),
|
||||
TYPE_SEND_SPECIAL_VEHICLE_TASK_CMD(MessagePad.MessageType.MsgTypeSpecialVehicleTaskCmd, "特种车辆命令"),
|
||||
//透传 原始pb文件中不存在以下type。由于Java中无法强转所以在mogo-adas-data message_pad.proto中放开注释
|
||||
//TODO 透传原始pb文件中不存在以下type。由于Java中无法强转,所以在mogo-adas-data/message_pad.proto中放开注释
|
||||
TYPE_RECEIVE_PLANNING_DECISION_STATE(MessagePad.MessageType.MsgTypePlanningDecisionState, "Planning决策状态");
|
||||
|
||||
|
||||
|
||||
@@ -0,0 +1,22 @@
|
||||
package com.zhidao.support.adas.high.msg;
|
||||
|
||||
import com.google.protobuf.InvalidProtocolBufferException;
|
||||
import com.zhidao.support.adas.high.OnAdasListener;
|
||||
import com.zhidao.support.adas.high.protocol.RawData;
|
||||
|
||||
import chassis.ChassisStatesOuterClass;
|
||||
|
||||
/**
|
||||
* 重构后的底盘状态
|
||||
*/
|
||||
public class ChassisStatesMessage extends MyAbstractMessageHandler {
|
||||
|
||||
@Override
|
||||
public void handlerMsg(RawData raw, OnAdasListener adasListener) throws InvalidProtocolBufferException {
|
||||
ChassisStatesOuterClass.ChassisStates chassisStates = ChassisStatesOuterClass.ChassisStates.parser().parseFrom(raw.originalData.toByteArray(), raw.getOffsetValue(), raw.getPackageLengthValue() - raw.getOffsetValue());
|
||||
if (adasListener != null) {
|
||||
adasListener.onChassisStates(raw.getHeader(), chassisStates);
|
||||
}
|
||||
}
|
||||
|
||||
}
|
||||
@@ -0,0 +1,31 @@
|
||||
package com.zhidao.support.adas.high.msg;
|
||||
|
||||
import android.os.SystemClock;
|
||||
|
||||
import com.google.protobuf.InvalidProtocolBufferException;
|
||||
import com.zhidao.support.adas.high.AdasChannel;
|
||||
import com.zhidao.support.adas.high.OnAdasListener;
|
||||
import com.zhidao.support.adas.high.common.CupidLogUtils;
|
||||
import com.zhidao.support.adas.high.protocol.RawData;
|
||||
|
||||
import function_state_management.FunctionStates;
|
||||
|
||||
/**
|
||||
* 重构后的功能状态
|
||||
*/
|
||||
public class FunctionStatesMessage extends MyAbstractMessageHandler {
|
||||
|
||||
@Override
|
||||
public void handlerMsg(RawData raw, OnAdasListener adasListener) throws InvalidProtocolBufferException {
|
||||
FunctionStates.FSMFunctionStates functionStates = FunctionStates.FSMFunctionStates.parser().parseFrom(raw.originalData.toByteArray(), raw.getOffsetValue(), raw.getPackageLengthValue() - raw.getOffsetValue());
|
||||
AdasChannel.calculateTimeConsumingOnDispatchRaw("重构后的功能状态", raw.receiveTime);
|
||||
long nowTime = 0;
|
||||
if (CupidLogUtils.isEnableLog())
|
||||
nowTime = SystemClock.elapsedRealtime();
|
||||
if (adasListener != null) {
|
||||
adasListener.onFunctionStates(raw.getHeader(), functionStates);
|
||||
}
|
||||
AdasChannel.calculateTimeConsumingBusiness("重构后的功能状态", nowTime);
|
||||
}
|
||||
|
||||
}
|
||||
@@ -15,7 +15,8 @@ public class MyMessageFactory implements IMyMessageFactory {
|
||||
private IMsg trajectoryMessage;//局部轨迹消息
|
||||
private IMsg trackedObjectsMessage;//障碍物信息
|
||||
private IMsg gnssInfoMessage;//惯导信息
|
||||
private IMsg vehicleStateMessage;//底盘信息, 透传底盘状态,pb参考底盘
|
||||
private IMsg vehicleStateMessage;//老底盘信息, 透传底盘状态,pb参考底盘
|
||||
private IMsg chassisStatesMessage;//重构后的底盘状态
|
||||
private IMsg autopilotStateMessage;//自动驾驶状态
|
||||
private IMsg reportMessage;//监控事件报告
|
||||
private IMsg perceptionTrafficLightMessage;//感知红绿灯
|
||||
@@ -31,6 +32,7 @@ public class MyMessageFactory implements IMyMessageFactory {
|
||||
private IMsg statusQueryRespMessage;//状态查询应答
|
||||
private IMsg recordDataConfigRespMessage;//数据采集配置应答
|
||||
private IMsg planningDecisionStateMessage;//planning决策状态
|
||||
private IMsg functionStatesMessage;//重构后的功能状态
|
||||
|
||||
private final AutopilotReview autopilotReview;
|
||||
|
||||
@@ -64,6 +66,12 @@ public class MyMessageFactory implements IMyMessageFactory {
|
||||
vehicleStateMessage = new VehicleStateMessage();
|
||||
}
|
||||
return vehicleStateMessage;
|
||||
} else if (messageType == MessageType.TYPE_RECEIVE_CHASSIS_STATES.typeCode) {
|
||||
//重构后的底盘状态
|
||||
if (chassisStatesMessage == null) {
|
||||
chassisStatesMessage = new ChassisStatesMessage();
|
||||
}
|
||||
return chassisStatesMessage;
|
||||
} else if (messageType == MessageType.TYPE_RECEIVE_AUTOPILOT_STATE.typeCode) {
|
||||
//自动驾驶状态
|
||||
if (autopilotStateMessage == null) {
|
||||
@@ -148,6 +156,12 @@ public class MyMessageFactory implements IMyMessageFactory {
|
||||
planningDecisionStateMessage = new PlanningDecisionStateMessage();
|
||||
}
|
||||
return planningDecisionStateMessage;
|
||||
} else if (messageType == MessageType.TYPE_RECEIVE_FUNCTION_STATES.typeCode) {
|
||||
//重构后的功能状态
|
||||
if (functionStatesMessage == null) {
|
||||
functionStatesMessage = new FunctionStatesMessage();
|
||||
}
|
||||
return functionStatesMessage;
|
||||
} else {
|
||||
//MessageType.TYPE_DEFAULT.typeCode
|
||||
return null;
|
||||
|
||||
@@ -9,7 +9,10 @@ import com.zhidao.support.adas.high.common.AutopilotAbilityManager;
|
||||
import com.zhidao.support.adas.high.common.CupidLogUtils;
|
||||
import com.zhidao.support.adas.high.protocol.RawData;
|
||||
|
||||
import chassis.Chassis;
|
||||
import chassis.ChassisStatesOuterClass;
|
||||
import chassis.VehicleStateOuterClass;
|
||||
import common.HeaderOuterClass;
|
||||
|
||||
/**
|
||||
* 底盘信息, 透传底盘状态,pb参考底盘
|
||||
@@ -25,9 +28,312 @@ public class VehicleStateMessage extends MyAbstractMessageHandler {
|
||||
if (CupidLogUtils.isEnableLog())
|
||||
nowTime = SystemClock.elapsedRealtime();
|
||||
if (adasListener != null) {
|
||||
compatibility(adasListener, raw, vehicleState);
|
||||
adasListener.onVehicleState(raw.getHeader(), vehicleState);
|
||||
}
|
||||
AdasChannel.calculateTimeConsumingBusiness("底盘信息", nowTime);
|
||||
// CupidLogUtils.e("底盘信息--->" + vehicleState.toString());
|
||||
}
|
||||
|
||||
/**
|
||||
* 将老地盘数据转换成新地盘数据
|
||||
* 字段注释中 鹰眼已用 的 已和底盘相关开发 确认过,其他字段均为确认对应关系
|
||||
* 新底盘中未找到字段:
|
||||
* parking_brake longitude_driving_mode eps_steering_mode
|
||||
* steering_sign location_missing trajectory_missing
|
||||
* chassis_status_missing pilot_mode_condition_met vehicletakeoverstatus
|
||||
*/
|
||||
private void compatibility(OnAdasListener adasListener, RawData raw, VehicleStateOuterClass.VehicleState vehicleState) throws InvalidProtocolBufferException {
|
||||
/**************老地盘转换成新地盘PB***************/
|
||||
ChassisStatesOuterClass.ChassisStates.Builder builder = ChassisStatesOuterClass.ChassisStates.newBuilder();
|
||||
//工控机所用Header
|
||||
if (vehicleState.hasHeader()) {
|
||||
HeaderOuterClass.Header outHeader = vehicleState.getHeader();
|
||||
if (outHeader != null) {
|
||||
builder.setHeader(HeaderOuterClass.Header.parseFrom(vehicleState.getHeader().toByteArray()));
|
||||
}
|
||||
}
|
||||
setBCMSystemStates(builder, vehicleState);
|
||||
setSteerSystemStates(builder, vehicleState);
|
||||
setGearSystemStates(builder, vehicleState);
|
||||
setVehicleMotionStates(builder, vehicleState);
|
||||
setDrivingSystemStates(builder, vehicleState);
|
||||
setBrakeSystemStates(builder, vehicleState);
|
||||
setChassisAutopilotAssistanceInformation(builder, vehicleState);
|
||||
//电子驻车制动系统
|
||||
if (vehicleState.hasEpb()) {
|
||||
Chassis.EPBWorkStatus old = vehicleState.getEpb();
|
||||
if (old != null) {
|
||||
ChassisStatesOuterClass.EPBWorkStates epb = null;
|
||||
if (old == Chassis.EPBWorkStatus.EPBSTATUS_NONE) {
|
||||
epb = ChassisStatesOuterClass.EPBWorkStates.EPB_STATE_NONE;
|
||||
} else if (old == Chassis.EPBWorkStatus.EPBSTATUS_LOCKED) {
|
||||
epb = ChassisStatesOuterClass.EPBWorkStates.EPB_STATE_LOCKED;
|
||||
} else if (old == Chassis.EPBWorkStatus.EPBSTATUS_RELEASED) {
|
||||
epb = ChassisStatesOuterClass.EPBWorkStates.EPB_STATE_RELEASED;
|
||||
} else if (old == Chassis.EPBWorkStatus.EPBSTATUS_LOCKED_FAIL) {
|
||||
epb = ChassisStatesOuterClass.EPBWorkStates.EPB_STATE_LOCKED_FAIL;
|
||||
} else if (old == Chassis.EPBWorkStatus.EPBSTATUS_RELEASE_FAIL) {
|
||||
epb = ChassisStatesOuterClass.EPBWorkStates.EPB_STATE_RELEASE_FAIL;
|
||||
} else if (old == Chassis.EPBWorkStatus.EPBSTATUS_FAULT) {
|
||||
epb = ChassisStatesOuterClass.EPBWorkStates.EPB_STATE_FAULT;
|
||||
}
|
||||
if (epb != null) {
|
||||
builder.setEpbSystemStates(ChassisStatesOuterClass.EPBSystemStates.newBuilder()
|
||||
.setEpbWorkState(epb));
|
||||
}
|
||||
}
|
||||
}
|
||||
// 整车故障状态
|
||||
if (vehicleState.hasVehiclefaultlevel()) {
|
||||
Chassis.VehicleFaultLevel vehicleFaultLevel = vehicleState.getVehiclefaultlevel();
|
||||
if (vehicleFaultLevel != null) {
|
||||
ChassisStatesOuterClass.VehicleFaultLevels vehicleFaultLevels = null;
|
||||
if (vehicleFaultLevel == Chassis.VehicleFaultLevel.None_Fault) {
|
||||
vehicleFaultLevels = ChassisStatesOuterClass.VehicleFaultLevels.NONE_FAULT;
|
||||
} else if (vehicleFaultLevel == Chassis.VehicleFaultLevel.General_Fault) {
|
||||
vehicleFaultLevels = ChassisStatesOuterClass.VehicleFaultLevels.GENERAL_FAULT;
|
||||
} else if (vehicleFaultLevel == Chassis.VehicleFaultLevel.Serious_Fault) {
|
||||
vehicleFaultLevels = ChassisStatesOuterClass.VehicleFaultLevels.SERIOUS_FAULT;
|
||||
} else if (vehicleFaultLevel == Chassis.VehicleFaultLevel.Critical_Fault) {
|
||||
vehicleFaultLevels = ChassisStatesOuterClass.VehicleFaultLevels.CRITICAL_FAULT;
|
||||
}
|
||||
if (vehicleFaultLevels != null) {
|
||||
builder.setVehicleChassisFaultInformation(ChassisStatesOuterClass.VehicleChassisFaultInformation.newBuilder()
|
||||
.setVehiclefaultlevel(vehicleFaultLevels));
|
||||
}
|
||||
}
|
||||
}
|
||||
//电量
|
||||
if (vehicleState.hasBmsSoc()) {
|
||||
builder.setBmsSystemStates(ChassisStatesOuterClass.BMSSystemStates.newBuilder().setBmsSoc(vehicleState.getBmsSoc()));
|
||||
}
|
||||
//清扫车(福田)清扫控制系统状态
|
||||
if (vehicleState.hasSweeperFutianCleanSystemState()) {
|
||||
VehicleStateOuterClass.SweeperFuTianCleanSystemState sweeperFuTianCleanSystemState = vehicleState.getSweeperFutianCleanSystemState();
|
||||
if (sweeperFuTianCleanSystemState != null) {
|
||||
byte[] bytes = sweeperFuTianCleanSystemState.toByteArray();
|
||||
builder.setTaskSystemStates(ChassisStatesOuterClass.TaskSystemStates.newBuilder()
|
||||
.setSweeperFutianTaskSystemStates(ChassisStatesOuterClass.SweeperFuTianTaskSystemStates.parseFrom(bytes)));//鹰眼已用 清扫车专用
|
||||
}
|
||||
}
|
||||
adasListener.onChassisStates(raw.getHeader(), builder.build());
|
||||
}
|
||||
|
||||
|
||||
private void setChassisAutopilotAssistanceInformation(ChassisStatesOuterClass.ChassisStates.Builder builder, VehicleStateOuterClass.VehicleState vehicleState) {
|
||||
ChassisStatesOuterClass.ChassisAutopilotAssistanceInformation.Builder chassisAutopilotAssistanceInformation = null;
|
||||
if (vehicleState.hasPilotMode()) {
|
||||
Chassis.PilotMode pilotMode = vehicleState.getPilotMode();
|
||||
if (pilotMode != null) {
|
||||
chassisAutopilotAssistanceInformation = ChassisStatesOuterClass.ChassisAutopilotAssistanceInformation.newBuilder();
|
||||
chassisAutopilotAssistanceInformation.setChassisPilotModeState(pilotMode);
|
||||
}
|
||||
}
|
||||
if (vehicleState.hasEmergencyStopSwitch()) {
|
||||
if (chassisAutopilotAssistanceInformation == null) {
|
||||
chassisAutopilotAssistanceInformation = ChassisStatesOuterClass.ChassisAutopilotAssistanceInformation.newBuilder();
|
||||
}
|
||||
// 急停开关状态
|
||||
chassisAutopilotAssistanceInformation.setEmergencyStopSwitchState(vehicleState.getEmergencyStopSwitch());
|
||||
}
|
||||
if (chassisAutopilotAssistanceInformation != null) {
|
||||
builder.setChassisAutopilotAssistanceInformation(chassisAutopilotAssistanceInformation);
|
||||
}
|
||||
}
|
||||
|
||||
/**
|
||||
* 档位
|
||||
*/
|
||||
private void setGearSystemStates(ChassisStatesOuterClass.ChassisStates.Builder builder, VehicleStateOuterClass.VehicleState vehicleState) {
|
||||
ChassisStatesOuterClass.GearSystemStates.Builder gearSystemStates = null;
|
||||
if (vehicleState.hasGear()) {
|
||||
Chassis.GearPosition gear = vehicleState.getGear();
|
||||
if (gear != null) {
|
||||
gearSystemStates = ChassisStatesOuterClass.GearSystemStates.newBuilder();
|
||||
//挂挡档位数据
|
||||
gearSystemStates.setGearPosition(gear);//鹰眼已用
|
||||
}
|
||||
}
|
||||
if (vehicleState.hasGearSwitchInference()) {
|
||||
if (gearSystemStates == null) {
|
||||
gearSystemStates = ChassisStatesOuterClass.GearSystemStates.newBuilder();
|
||||
}
|
||||
//档位干预
|
||||
gearSystemStates.setGearSwitchInferenceState(vehicleState.getGearSwitchInference());
|
||||
}
|
||||
if (gearSystemStates != null) {
|
||||
builder.setGearSystemStates(gearSystemStates);
|
||||
}
|
||||
}
|
||||
|
||||
/**
|
||||
* 油门
|
||||
*/
|
||||
private void setDrivingSystemStates(ChassisStatesOuterClass.ChassisStates.Builder builder, VehicleStateOuterClass.VehicleState vehicleState) {
|
||||
ChassisStatesOuterClass.DrivingSystemStates.Builder drivingSystemStates = null;
|
||||
if (vehicleState.hasThrottle()) {
|
||||
drivingSystemStates = ChassisStatesOuterClass.DrivingSystemStates.newBuilder();
|
||||
//油门
|
||||
drivingSystemStates.setThrottleResponsePosition(vehicleState.getThrottle());//鹰眼已用
|
||||
}
|
||||
if (vehicleState.hasAccelInference()) {
|
||||
if (drivingSystemStates == null) {
|
||||
drivingSystemStates = ChassisStatesOuterClass.DrivingSystemStates.newBuilder();
|
||||
}
|
||||
//加速踏板干预
|
||||
drivingSystemStates.setAccelerationPedalInferenceState(vehicleState.getAccelInference());
|
||||
}
|
||||
if (drivingSystemStates != null) {
|
||||
builder.setDrivingSystemStates(drivingSystemStates);
|
||||
}
|
||||
}
|
||||
|
||||
/**
|
||||
* 刹车
|
||||
*/
|
||||
private void setBrakeSystemStates(ChassisStatesOuterClass.ChassisStates.Builder builder, VehicleStateOuterClass.VehicleState vehicleState) {
|
||||
ChassisStatesOuterClass.BrakeSystemStates.Builder brakeSystemStates = null;
|
||||
if (vehicleState.hasBrake()) {
|
||||
brakeSystemStates = ChassisStatesOuterClass.BrakeSystemStates.newBuilder();
|
||||
//刹车
|
||||
brakeSystemStates.setBrakePedalResponsePosition(vehicleState.getBrake());//鹰眼已用
|
||||
}
|
||||
if (vehicleState.hasBrakeInference()) {
|
||||
if (brakeSystemStates == null) {
|
||||
brakeSystemStates = ChassisStatesOuterClass.BrakeSystemStates.newBuilder();
|
||||
}
|
||||
//刹车干预
|
||||
brakeSystemStates.setBrakePedalInferenceState(vehicleState.getBrakeInference());
|
||||
}
|
||||
if (brakeSystemStates != null) {
|
||||
builder.setBrakeSystemStates(brakeSystemStates);
|
||||
}
|
||||
}
|
||||
|
||||
/**
|
||||
* 方向盘
|
||||
*/
|
||||
private void setSteerSystemStates(ChassisStatesOuterClass.ChassisStates.Builder builder, VehicleStateOuterClass.VehicleState vehicleState) {
|
||||
ChassisStatesOuterClass.SteerSystemStates.Builder steerSystemStates = null;
|
||||
if (vehicleState.hasSteering()) {
|
||||
steerSystemStates = ChassisStatesOuterClass.SteerSystemStates.newBuilder();
|
||||
//方向盘转向角数据
|
||||
steerSystemStates.setSteeringWheelAngle(vehicleState.getSteering());//鹰眼已用
|
||||
}
|
||||
if (vehicleState.hasSteerInference()) {
|
||||
if (steerSystemStates == null) {
|
||||
steerSystemStates = ChassisStatesOuterClass.SteerSystemStates.newBuilder();
|
||||
}
|
||||
//方向盘干预
|
||||
steerSystemStates.setSteeringWheelInferenceState(vehicleState.getSteerInference());
|
||||
}
|
||||
if (vehicleState.hasSteeringSpd()) {
|
||||
if (steerSystemStates == null) {
|
||||
steerSystemStates = ChassisStatesOuterClass.SteerSystemStates.newBuilder();
|
||||
}
|
||||
steerSystemStates.setSteeringWheelSpeed(vehicleState.getSteeringSpd());
|
||||
}
|
||||
if (vehicleState.hasLeftFrontWheelAngle()) {
|
||||
if (steerSystemStates == null) {
|
||||
steerSystemStates = ChassisStatesOuterClass.SteerSystemStates.newBuilder();
|
||||
}
|
||||
steerSystemStates.setFrontLeftWheelAngle(vehicleState.getLeftFrontWheelAngle());
|
||||
}
|
||||
if (vehicleState.hasRightFrontWheelAngle()) {
|
||||
if (steerSystemStates == null) {
|
||||
steerSystemStates = ChassisStatesOuterClass.SteerSystemStates.newBuilder();
|
||||
}
|
||||
steerSystemStates.setFrontRightWheelAngle(vehicleState.getRightFrontWheelAngle());
|
||||
}
|
||||
if (steerSystemStates != null) {
|
||||
builder.setSteerSystemStates(steerSystemStates);
|
||||
}
|
||||
}
|
||||
|
||||
private void setVehicleMotionStates(ChassisStatesOuterClass.ChassisStates.Builder builder, VehicleStateOuterClass.VehicleState vehicleState) {
|
||||
ChassisStatesOuterClass.VehicleMotionStates.Builder vehicleMotionStates = null;
|
||||
if (vehicleState.hasSpeed()) {
|
||||
vehicleMotionStates = ChassisStatesOuterClass.VehicleMotionStates.newBuilder();
|
||||
vehicleMotionStates.setSpeed(vehicleState.getSpeed());
|
||||
}
|
||||
if (vehicleState.hasAccel()) {
|
||||
if (vehicleMotionStates == null) {
|
||||
vehicleMotionStates = ChassisStatesOuterClass.VehicleMotionStates.newBuilder();
|
||||
}
|
||||
//加速度
|
||||
vehicleMotionStates.setAcceleration(vehicleState.getAccel());//鹰眼已用
|
||||
}
|
||||
if (vehicleMotionStates != null) {
|
||||
builder.setVehicleMotionStates(vehicleMotionStates);
|
||||
}
|
||||
}
|
||||
|
||||
/**
|
||||
* 车身控制模块
|
||||
*/
|
||||
private void setBCMSystemStates(ChassisStatesOuterClass.ChassisStates.Builder builder, VehicleStateOuterClass.VehicleState vehicleState) {
|
||||
ChassisStatesOuterClass.BCMSystemStates.Builder bcmSystemStates = null;
|
||||
if (vehicleState.hasLight()) {
|
||||
Chassis.LightSwitch light = vehicleState.getLight();
|
||||
if (light != null) {
|
||||
bcmSystemStates = ChassisStatesOuterClass.BCMSystemStates.newBuilder();
|
||||
//转向灯数据
|
||||
bcmSystemStates.setTurnLightState(light);//鹰眼已用
|
||||
}
|
||||
}
|
||||
if (vehicleState.hasBrakeLightStatus()) {
|
||||
if (bcmSystemStates == null) {
|
||||
bcmSystemStates = ChassisStatesOuterClass.BCMSystemStates.newBuilder();
|
||||
}
|
||||
//刹车灯数据
|
||||
bcmSystemStates.setBrakeLightState(vehicleState.getBrakeLightStatus() ? 1 : 0);//鹰眼已用
|
||||
}
|
||||
if (vehicleState.hasHorn()) {
|
||||
if (bcmSystemStates == null) {
|
||||
bcmSystemStates = ChassisStatesOuterClass.BCMSystemStates.newBuilder();
|
||||
}
|
||||
//鸣笛
|
||||
bcmSystemStates.setHornState(vehicleState.getHorn() ? 1 : 0);
|
||||
}
|
||||
if (vehicleState.hasHighbeam()) {
|
||||
if (bcmSystemStates == null) {
|
||||
bcmSystemStates = ChassisStatesOuterClass.BCMSystemStates.newBuilder();
|
||||
}
|
||||
//远光灯
|
||||
bcmSystemStates.setHighbeamState(vehicleState.getHighbeam() ? 1 : 0);
|
||||
}
|
||||
if (vehicleState.hasLowbeam()) {
|
||||
if (bcmSystemStates == null) {
|
||||
bcmSystemStates = ChassisStatesOuterClass.BCMSystemStates.newBuilder();
|
||||
}
|
||||
//近光灯
|
||||
bcmSystemStates.setLowbeamState(vehicleState.getLowbeam() ? 1 : 0);
|
||||
}
|
||||
if (vehicleState.hasFoglight()) {
|
||||
if (bcmSystemStates == null) {
|
||||
bcmSystemStates = ChassisStatesOuterClass.BCMSystemStates.newBuilder();
|
||||
}
|
||||
//雾灯 新底盘分前后雾灯 老地盘只有一个 所以同时赋值
|
||||
bcmSystemStates.setFrontFoglightState(vehicleState.getFoglight() ? 1 : 0);
|
||||
bcmSystemStates.setBackFoglightState(vehicleState.getFoglight() ? 1 : 0);
|
||||
}
|
||||
if (vehicleState.hasClearanceLamps()) {
|
||||
if (bcmSystemStates == null) {
|
||||
bcmSystemStates = ChassisStatesOuterClass.BCMSystemStates.newBuilder();
|
||||
}
|
||||
//示廓灯
|
||||
bcmSystemStates.setClearanceLampsState(vehicleState.getClearanceLamps() ? 1 : 0);
|
||||
}
|
||||
if (vehicleState.hasWarnLight()) {
|
||||
if (bcmSystemStates == null) {
|
||||
bcmSystemStates = ChassisStatesOuterClass.BCMSystemStates.newBuilder();
|
||||
}
|
||||
//报警灯
|
||||
bcmSystemStates.setAlarmLightState(vehicleState.getWarnLight() ? 1 : 0);
|
||||
}
|
||||
if (bcmSystemStates != null) {
|
||||
builder.setBcmSystemStates(bcmSystemStates);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||