Merge branch 'dev_robotaxi-d-app-module_2110_220915_2.11.0_gkjpb' into dev_robotaxi-d-app-module_2120_221017_2.12.0
This commit is contained in:
@@ -101,6 +101,7 @@ import java.net.NetworkInterface;
|
||||
import java.net.SocketException;
|
||||
import java.text.SimpleDateFormat;
|
||||
import java.util.ArrayList;
|
||||
import java.util.Arrays;
|
||||
import java.util.Date;
|
||||
import java.util.Enumeration;
|
||||
import java.util.List;
|
||||
@@ -647,6 +648,11 @@ public class MainActivity extends BaseActivity implements OnAdasListener, OnAdas
|
||||
titleBtnData.add(Constants.TITLE.SEND_SET_DEMO_MODE_REQ_CLOSE);
|
||||
titleBtnData.add(Constants.TITLE.SEND_SET_RAIN_MODE_REQ_OPEN);
|
||||
titleBtnData.add(Constants.TITLE.SEND_SET_RAIN_MODE_REQ_CLOSE);
|
||||
titleBtnData.add(Constants.TITLE.SEND_DETOURING_OPEN);
|
||||
titleBtnData.add(Constants.TITLE.SEND_DETOURING_CLOSE);
|
||||
titleBtnData.add(Constants.TITLE.SEND_DETOURING_SPEED);
|
||||
titleBtnData.add(Constants.TITLE.SEND_TRIP_INFO);
|
||||
|
||||
}
|
||||
|
||||
private void initBtnRecyclerView() {
|
||||
@@ -1186,7 +1192,7 @@ public class MainActivity extends BaseActivity implements OnAdasListener, OnAdas
|
||||
msg = "未连接司机端";
|
||||
}
|
||||
showToastCenter(msg);
|
||||
return;
|
||||
// return;
|
||||
}
|
||||
switch (data) {
|
||||
case Constants.TITLE.SEND_SET_AUTOPILOT_MODE_REQ:
|
||||
@@ -1345,12 +1351,100 @@ public class MainActivity extends BaseActivity implements OnAdasListener, OnAdas
|
||||
AdasManager.getInstance().sendRainModeReq(0);
|
||||
break;
|
||||
case Constants.TITLE.SEND_RECORD_DATA_CONFIG_RESP:
|
||||
//关闭雨天模式
|
||||
AdasManager.getInstance().sendRecordDataConfigReq();
|
||||
//数据采集配置
|
||||
showRecordDataConfigRespDialog();
|
||||
break;
|
||||
case Constants.TITLE.SEND_DETOURING_OPEN:
|
||||
//绕障类功能开
|
||||
AdasManager.getInstance().sendDetouring(1);
|
||||
break;
|
||||
case Constants.TITLE.SEND_DETOURING_CLOSE:
|
||||
//绕障类功能关
|
||||
AdasManager.getInstance().sendDetouring(0);
|
||||
break;
|
||||
case Constants.TITLE.SEND_DETOURING_SPEED:
|
||||
//绕障速度设置
|
||||
showDetouringSpeedDialog();
|
||||
break;
|
||||
case Constants.TITLE.SEND_TRIP_INFO:
|
||||
//行程信息
|
||||
AdasManager.getInstance().sendTripInfoReq(1, "", "", false);
|
||||
break;
|
||||
}
|
||||
}
|
||||
|
||||
private void showDetouringSpeedDialog() {
|
||||
AlertDialog.Builder builder1 = new AlertDialog.Builder(this);
|
||||
builder1.setTitle("绕障速度");
|
||||
View view1 = getLayoutInflater().inflate(R.layout.dialog_detouring_speed, null);
|
||||
final EditText et1 = (EditText) view1.findViewById(R.id.et);
|
||||
builder1.setView(view1);//
|
||||
builder1.setCancelable(false);//
|
||||
builder1.setPositiveButton("设置", null);
|
||||
//设置反面按钮,并做事件处理
|
||||
builder1.setNegativeButton("取消", null);
|
||||
AlertDialog alertDialog1 = builder1.show();//显示Dialog对话框
|
||||
alertDialog1.getButton(AlertDialog.BUTTON_POSITIVE).setOnClickListener(new View.OnClickListener() {
|
||||
@Override
|
||||
public void onClick(View v) {
|
||||
Editable editable = et1.getText();
|
||||
if (TextUtils.isEmpty(editable)) {
|
||||
// 条件不成立不能关闭 AlertDialog 窗口
|
||||
Toast.makeText(MainActivity.this, "请输入速度", Toast.LENGTH_SHORT).show();
|
||||
return;
|
||||
}
|
||||
String temp = et1.getText().toString().trim();
|
||||
double speed = Double.parseDouble(temp);
|
||||
AdasManager.getInstance().sendDetouringSpeed(speed);
|
||||
alertDialog1.dismiss();
|
||||
}
|
||||
});
|
||||
}
|
||||
|
||||
private void showRecordDataConfigRespDialog() {
|
||||
AlertDialog.Builder builder = new AlertDialog.Builder(this);
|
||||
builder.setTitle(Constants.TITLE.SEND_RECORD_DATA_CONFIG_RESP);
|
||||
View view = getLayoutInflater().inflate(R.layout.dialog_record_data_config_resp, null);
|
||||
final EditText reqTypeView = view.findViewById(R.id.reqType);
|
||||
final EditText recordTypeView = view.findViewById(R.id.recordType);
|
||||
final EditText topicsNeedToCacheView = view.findViewById(R.id.topicsNeedToCache);
|
||||
builder.setView(view);//
|
||||
builder.setCancelable(false);//
|
||||
builder.setPositiveButton("发送", null);
|
||||
//设置反面按钮,并做事件处理
|
||||
builder.setNegativeButton("取消", null);
|
||||
AlertDialog alertDialog = builder.show();//显示Dialog对话框
|
||||
alertDialog.getButton(AlertDialog.BUTTON_POSITIVE).setOnClickListener(new View.OnClickListener() {
|
||||
@Override
|
||||
public void onClick(View v) {
|
||||
Editable editable = reqTypeView.getText();
|
||||
if (TextUtils.isEmpty(editable)) {
|
||||
// 条件不成立不能关闭 AlertDialog 窗口
|
||||
Toast.makeText(MainActivity.this, "请输入ReqType", Toast.LENGTH_SHORT).show();
|
||||
return;
|
||||
}
|
||||
int reqType = Integer.parseInt(editable.toString().trim());
|
||||
editable = recordTypeView.getText();
|
||||
if (TextUtils.isEmpty(editable)) {
|
||||
Toast.makeText(MainActivity.this, "请输入RecordType", Toast.LENGTH_SHORT).show();
|
||||
return;
|
||||
}
|
||||
int recordType = Integer.parseInt(editable.toString().trim());
|
||||
List<String> topicsNeedToCache = null;
|
||||
editable = topicsNeedToCacheView.getText();
|
||||
if (!TextUtils.isEmpty(editable)) {
|
||||
String cache = editable.toString().trim();
|
||||
cache = cache.replace(",", " ").replace(",", " ");
|
||||
String[] caches = cache.split(" ");
|
||||
topicsNeedToCache = Arrays.asList(caches);
|
||||
}
|
||||
AdasManager.getInstance().sendRecordDataConfigReq(reqType, recordType, topicsNeedToCache);
|
||||
alertDialog.dismiss();
|
||||
}
|
||||
});
|
||||
|
||||
}
|
||||
|
||||
|
||||
@Override
|
||||
protected void handleMessage(Message msg) {
|
||||
|
||||
@@ -187,6 +187,10 @@ public class Constants {
|
||||
String SEND_SET_RAIN_MODE_REQ_OPEN = "打开雨天模式";
|
||||
String SEND_SET_RAIN_MODE_REQ_CLOSE = "关闭雨天模式";
|
||||
String SEND_RECORD_DATA_CONFIG_RESP = "数据采集配置";
|
||||
String SEND_DETOURING_OPEN = "绕障类功能开";
|
||||
String SEND_DETOURING_CLOSE = "绕障类功能关";
|
||||
String SEND_DETOURING_SPEED = "绕障速度阈值";
|
||||
String SEND_TRIP_INFO = "行程信息";
|
||||
|
||||
|
||||
}
|
||||
|
||||
@@ -0,0 +1,30 @@
|
||||
<?xml version="1.0" encoding="utf-8"?>
|
||||
<LinearLayout xmlns:android="http://schemas.android.com/apk/res/android"
|
||||
android:layout_width="match_parent"
|
||||
android:layout_height="wrap_content"
|
||||
android:gravity="center"
|
||||
android:layout_gravity="center">
|
||||
|
||||
<EditText
|
||||
android:id="@+id/et"
|
||||
android:layout_width="wrap_content"
|
||||
android:layout_height="wrap_content"
|
||||
android:digits="0123456789."
|
||||
android:gravity="center"
|
||||
android:hint="变道绕障的目标障碍物速度阈值"
|
||||
android:imeOptions="flagNoExtractUi"
|
||||
android:inputType="number"
|
||||
android:maxLength="10"
|
||||
android:maxLines="1"
|
||||
android:minWidth="100dp"
|
||||
android:textColor="#000"
|
||||
android:textSize="16sp" />
|
||||
|
||||
<TextView
|
||||
android:layout_width="wrap_content"
|
||||
android:layout_height="wrap_content"
|
||||
android:layout_marginStart="5dp"
|
||||
android:text="m/s"
|
||||
android:textColor="#000"
|
||||
android:textSize="16sp" />
|
||||
</LinearLayout>
|
||||
@@ -0,0 +1,93 @@
|
||||
<?xml version="1.0" encoding="utf-8"?>
|
||||
<LinearLayout xmlns:android="http://schemas.android.com/apk/res/android"
|
||||
android:layout_width="match_parent"
|
||||
android:layout_height="wrap_content"
|
||||
android:layout_gravity="center"
|
||||
android:gravity="center"
|
||||
android:orientation="vertical">
|
||||
|
||||
<LinearLayout
|
||||
android:layout_width="match_parent"
|
||||
android:layout_height="wrap_content"
|
||||
android:orientation="horizontal">
|
||||
|
||||
<TextView
|
||||
android:layout_width="0dp"
|
||||
android:layout_height="wrap_content"
|
||||
android:layout_weight="0.2"
|
||||
android:gravity="right"
|
||||
android:text="ReqType:"
|
||||
android:textColor="#000000" />
|
||||
|
||||
<EditText
|
||||
android:id="@+id/reqType"
|
||||
android:layout_width="0dp"
|
||||
android:layout_height="wrap_content"
|
||||
android:layout_weight="1"
|
||||
android:gravity="center"
|
||||
android:hint="0: all,1:获取当前所有topic列表,2:配置需要预加载的topic组合"
|
||||
android:imeOptions="actionNext"
|
||||
android:inputType="number"
|
||||
android:maxLines="1"
|
||||
android:minWidth="100dp"
|
||||
android:textColor="#000"
|
||||
android:textSize="15sp" />
|
||||
</LinearLayout>
|
||||
|
||||
<LinearLayout
|
||||
android:layout_width="match_parent"
|
||||
android:layout_height="wrap_content"
|
||||
android:orientation="horizontal">
|
||||
|
||||
<TextView
|
||||
android:layout_width="0dp"
|
||||
android:layout_height="wrap_content"
|
||||
android:layout_weight="0.2"
|
||||
android:gravity="right"
|
||||
android:text="RecordType:"
|
||||
android:textColor="#000000" />
|
||||
|
||||
<EditText
|
||||
android:id="@+id/recordType"
|
||||
android:layout_width="0dp"
|
||||
android:layout_height="wrap_content"
|
||||
android:layout_weight="1"
|
||||
android:gravity="center"
|
||||
android:hint="0:不需要修改内置类型的topic组合, 1:需要修改内置类型的topic组合"
|
||||
android:imeOptions="actionNext"
|
||||
android:inputType="number"
|
||||
android:maxLines="1"
|
||||
android:minWidth="100dp"
|
||||
android:textColor="#000"
|
||||
android:textSize="15sp" />
|
||||
</LinearLayout>
|
||||
|
||||
<LinearLayout
|
||||
android:layout_width="match_parent"
|
||||
android:layout_height="wrap_content"
|
||||
android:orientation="horizontal">
|
||||
|
||||
<TextView
|
||||
android:layout_width="0dp"
|
||||
android:layout_height="wrap_content"
|
||||
android:layout_weight="0.2"
|
||||
android:gravity="right"
|
||||
android:textSize="8sp"
|
||||
android:text="TopicsNeedToCache:"
|
||||
android:textColor="#000000" />
|
||||
|
||||
<EditText
|
||||
android:id="@+id/topicsNeedToCache"
|
||||
android:layout_width="0dp"
|
||||
android:layout_height="wrap_content"
|
||||
android:layout_weight="1"
|
||||
android:gravity="center"
|
||||
android:hint="逗号间隔"
|
||||
android:imeOptions="actionNext"
|
||||
android:inputType="text"
|
||||
android:maxLines="1"
|
||||
android:minWidth="100dp"
|
||||
android:textColor="#000"
|
||||
android:textSize="15sp" />
|
||||
</LinearLayout>
|
||||
</LinearLayout>
|
||||
@@ -379,6 +379,16 @@ class MoGoAutopilotProvider :
|
||||
return AdasManager.getInstance().startRecordPackage(id, duration, type, bduration)
|
||||
}
|
||||
|
||||
override fun recordPackage(
|
||||
type: Int,
|
||||
id: Int,
|
||||
duration: Int,
|
||||
bduration: Int,
|
||||
topics: List<String>
|
||||
): Boolean {
|
||||
return AdasManager.getInstance().startRecordPackage(id, duration, type, bduration, topics)
|
||||
}
|
||||
|
||||
override fun stopRecord(type: Int, id: Int): Boolean {
|
||||
return AdasManager.getInstance().stopRecordPackage(id, type)
|
||||
}
|
||||
@@ -497,10 +507,37 @@ class MoGoAutopilotProvider :
|
||||
}
|
||||
|
||||
/**
|
||||
* 获取数据采集录制模式配置列表
|
||||
* 绕障类功能开关
|
||||
* isEnable = true 开启
|
||||
* isEnable = false 关闭
|
||||
* @return boolean
|
||||
*/
|
||||
override fun getBadCaseConfig() {
|
||||
AdasManager.getInstance().sendRecordDataConfigReq()
|
||||
override fun sendDetouring(isEnable: Boolean): Boolean {
|
||||
return if(isEnable){
|
||||
AdasManager.getInstance().sendDetouring(1)
|
||||
}else{
|
||||
AdasManager.getInstance().sendDetouring(0)
|
||||
}
|
||||
}
|
||||
|
||||
/**
|
||||
* 变道绕障的目标障碍物速度阈值
|
||||
* @param speed 速度阈值 m/s
|
||||
* @return boolean
|
||||
*/
|
||||
override fun sendDetouringSpeed(speed: Double): Boolean {
|
||||
return AdasManager.getInstance().sendDetouringSpeed(speed)
|
||||
}
|
||||
|
||||
/**
|
||||
* 获取数据采集录制模式配置列表
|
||||
* @param reqType 0: all, 1:获取当前所有topic列表, 2:配置需要预加载的topic组合
|
||||
* @param recordType 0:不需要修改内置类型的topic组合, 1:需要修改内置类型的topic组合
|
||||
* @param topicsNeedToCache
|
||||
* @return boolean
|
||||
*/
|
||||
override fun getBadCaseConfig(reqType: Int,recordType: Int,topicsNeedToCache: List<String>): Boolean{
|
||||
return AdasManager.getInstance().sendRecordDataConfigReq(reqType, recordType, topicsNeedToCache)
|
||||
}
|
||||
|
||||
/**
|
||||
@@ -531,6 +568,18 @@ class MoGoAutopilotProvider :
|
||||
AdasManager.getInstance().sendOperatorCmdSetHorn(value)
|
||||
}
|
||||
|
||||
/**
|
||||
* 行程信息
|
||||
* @param type 事件类型, 1:行程开始, 2:行程结束, 3:出站, 4:进站, 5:城市占道施工预警
|
||||
* @param lineName 路线名, for type 1, 2
|
||||
* @param stopName 站点名, for type 3, 4
|
||||
* @param isLastStop
|
||||
* @return
|
||||
*/
|
||||
override fun sendTripInfo(type: Int, lineName: String, stopName: String, isLastStop: Boolean) {
|
||||
AdasManager.getInstance().sendTripInfoReq(type, lineName, stopName, isLastStop)
|
||||
}
|
||||
|
||||
/**
|
||||
* 发送工控机所有节点重启命令
|
||||
*/
|
||||
|
||||
@@ -46,6 +46,7 @@ import com.mogo.eagle.core.function.call.autopilot.CallerAutopilotPlanningAction
|
||||
import com.mogo.eagle.core.function.call.autopilot.CallerAutopilotPlanningListenerManager.invokeAutopilotRotting
|
||||
import com.mogo.eagle.core.function.call.autopilot.CallerAutopilotPlanningListenerManager.invokeAutopilotTrajectory
|
||||
import com.mogo.eagle.core.function.call.autopilot.CallerAutopilotPointCloudListenerManager
|
||||
import com.mogo.eagle.core.function.call.autopilot.CallerAutopilotRecordListenerManager.invokeAutopilotRecordConfig
|
||||
import com.mogo.eagle.core.function.call.autopilot.CallerAutopilotRecordListenerManager.invokeAutopilotRecordResult
|
||||
import com.mogo.eagle.core.function.call.autopilot.CallerAutopilotVehicleStateListenerManager
|
||||
import com.mogo.eagle.core.function.call.map.CallerMapUIServiceManager
|
||||
@@ -409,7 +410,9 @@ class MoGoAdasListenerImpl : OnAdasListener {
|
||||
header: MessagePad.Header?,
|
||||
config: MessagePad.RecordDataConfig?
|
||||
) {
|
||||
|
||||
if(config!=null){
|
||||
invokeAutopilotRecordConfig(config)
|
||||
}
|
||||
}
|
||||
|
||||
/**
|
||||
|
||||
@@ -252,8 +252,8 @@ defStyleAttr: Int = 0
|
||||
override fun onAttachedToWindow() {
|
||||
super.onAttachedToWindow()
|
||||
CallerAutopilotRecordListenerManager.addListener(TAG, this)
|
||||
//获取数据采集录制模式配置列表
|
||||
CallerAutoPilotManager.getBadCaseConfig()
|
||||
//获取数据采集录制模式配置列表 TODO
|
||||
// CallerAutoPilotManager.getBadCaseConfig()
|
||||
}
|
||||
|
||||
override fun onDetachedFromWindow() {
|
||||
|
||||
@@ -0,0 +1,159 @@
|
||||
package com.mogo.eagle.core.function.hmi.ui.setting
|
||||
|
||||
import android.content.Context
|
||||
import android.util.AttributeSet
|
||||
import android.view.LayoutInflater
|
||||
import android.view.View
|
||||
import androidx.constraintlayout.widget.ConstraintLayout
|
||||
import com.mogo.eagle.core.data.config.FunctionBuildConfig
|
||||
import com.mogo.eagle.core.data.config.HmiBuildConfig
|
||||
import com.mogo.eagle.core.function.call.autopilot.CallerAutoPilotManager
|
||||
import com.mogo.eagle.core.function.call.hmi.CallerHmiManager
|
||||
import com.mogo.eagle.core.function.call.obu.CallerOBUManager
|
||||
import com.mogo.eagle.core.function.hmi.R
|
||||
import com.mogo.eagle.core.utilcode.mogo.AppIdentityModeUtils
|
||||
import com.mogo.eagle.core.utilcode.util.ToastUtils
|
||||
import com.mogo.module.service.routeoverlay.RouteStrategy
|
||||
import kotlinx.android.synthetic.main.view_sop_setting.view.*
|
||||
|
||||
/**
|
||||
* SOP设置窗口
|
||||
*/
|
||||
class SOPSettingView @JvmOverloads constructor(
|
||||
context: Context,
|
||||
attrs: AttributeSet? = null,
|
||||
defStyleAttr: Int = 0
|
||||
) : ConstraintLayout(context, attrs, defStyleAttr){
|
||||
|
||||
init {
|
||||
LayoutInflater.from(context).inflate(R.layout.view_sop_setting, this, true)
|
||||
initView()
|
||||
}
|
||||
|
||||
private fun initView() {
|
||||
//绕障类功能开关
|
||||
tbObstacleAvoidance.isChecked = FunctionBuildConfig.isDetouring
|
||||
tbObstacleAvoidance.setOnCheckedChangeListener { _, isChecked ->
|
||||
CallerAutoPilotManager.sendDetouring(isChecked)
|
||||
FunctionBuildConfig.isDetouring = isChecked
|
||||
}
|
||||
|
||||
//危险障碍物颜色标记开关
|
||||
tbMarkingObstacles.setOnCheckedChangeListener { _, isChecked ->
|
||||
|
||||
}
|
||||
|
||||
//引导线动态效果
|
||||
tbRouteDynamicEffect.isChecked =
|
||||
AppIdentityModeUtils.isDriver(FunctionBuildConfig.appIdentityMode) && !AppIdentityModeUtils.isBus(
|
||||
FunctionBuildConfig.appIdentityMode
|
||||
)
|
||||
tbRouteDynamicEffect.setOnCheckedChangeListener { _, isChecked ->
|
||||
if (isChecked) {
|
||||
RouteStrategy.enable(true)
|
||||
} else {
|
||||
RouteStrategy.enable(false)
|
||||
}
|
||||
}
|
||||
|
||||
//红绿灯标识
|
||||
tbTrafficLight.isChecked = HmiBuildConfig.isShowTrafficLightView
|
||||
tbTrafficLight.setOnCheckedChangeListener { _, isChecked ->
|
||||
if(!isChecked){
|
||||
HmiBuildConfig.isShowTrafficLightView = false
|
||||
}else{
|
||||
HmiBuildConfig.isShowTrafficLightView = true
|
||||
CallerHmiManager.disableWarningTrafficLight()
|
||||
}
|
||||
}
|
||||
|
||||
//限速标识
|
||||
tbSpeedLimit.isChecked = HmiBuildConfig.isShowLimitingVelocityView
|
||||
tbSpeedLimit.setOnCheckedChangeListener { _, isChecked ->
|
||||
if(isChecked){
|
||||
HmiBuildConfig.isShowLimitingVelocityView = true
|
||||
}else{
|
||||
HmiBuildConfig.isShowLimitingVelocityView = false
|
||||
CallerHmiManager.disableLimitingVelocity()
|
||||
}
|
||||
}
|
||||
|
||||
//自车感知到的他车碰撞预警
|
||||
tbCollisionWarning.setOnCheckedChangeListener { buttonView, isChecked ->
|
||||
|
||||
}
|
||||
|
||||
// 演示模式,上一次勾选的数据
|
||||
tbDemoMode.isChecked = FunctionBuildConfig.isDemoMode
|
||||
// 演示模式
|
||||
tbDemoMode.setOnCheckedChangeListener { _, isChecked ->
|
||||
CallerAutoPilotManager.setDemoMode(isChecked)
|
||||
if (!isChecked) {
|
||||
//关闭美化模式时,通知工控机
|
||||
CallerAutoPilotManager.setIPCDemoMode(isChecked)
|
||||
}
|
||||
FunctionBuildConfig.isDemoMode = isChecked
|
||||
}
|
||||
//只在司机端设置美化模式开关功能
|
||||
if (AppIdentityModeUtils.isPassenger(FunctionBuildConfig.appIdentityMode)) {
|
||||
tbDemoMode.visibility = View.GONE
|
||||
}
|
||||
|
||||
|
||||
// 雨天模式,上一次勾选的数据
|
||||
tbRainMode.isChecked = FunctionBuildConfig.isRainMode
|
||||
//雨天模式
|
||||
tbRainMode.setOnCheckedChangeListener { _, isChecked ->
|
||||
CallerAutoPilotManager.setRainMode(isChecked)
|
||||
FunctionBuildConfig.isRainMode = isChecked
|
||||
}
|
||||
//雨天模式按钮只在司机屏生效,乘客屏不显示
|
||||
if (AppIdentityModeUtils.isPassenger(FunctionBuildConfig.appIdentityMode)) {
|
||||
tbRainMode.visibility = View.GONE
|
||||
}
|
||||
|
||||
//OBU控制总开关
|
||||
tbObu.isChecked = CallerOBUManager.isConnected()
|
||||
tbObu.setOnCheckedChangeListener { _, isChecked ->
|
||||
if(!isChecked){
|
||||
if(AppIdentityModeUtils.isTaxi(FunctionBuildConfig.appIdentityMode)){
|
||||
CallerOBUManager.resetObuIpAddress("192.168.1.199")
|
||||
}else if(AppIdentityModeUtils.isBus(FunctionBuildConfig.appIdentityMode)){
|
||||
CallerOBUManager.resetObuIpAddress("192.168.8.199")
|
||||
}
|
||||
}else{
|
||||
//断开链接
|
||||
CallerOBUManager.disConnectObu()
|
||||
}
|
||||
}
|
||||
|
||||
//变道绕障的目标障碍物速度阈值
|
||||
tvSpeed.text = "${FunctionBuildConfig.detouringSpeed} m/s"
|
||||
ivSpeedReduce.setOnClickListener {
|
||||
if(FunctionBuildConfig.detouringSpeed<=3){
|
||||
ToastUtils.showShort("阈值小可为3 m/s")
|
||||
}else{
|
||||
FunctionBuildConfig.detouringSpeed--
|
||||
tvSpeed.text = "${FunctionBuildConfig.detouringSpeed} m/s"
|
||||
}
|
||||
}
|
||||
ivSpeedAdd.setOnClickListener {
|
||||
if(FunctionBuildConfig.detouringSpeed>=7){
|
||||
ToastUtils.showShort("阈值最大可为7 m/s")
|
||||
}else{
|
||||
FunctionBuildConfig.detouringSpeed++
|
||||
tvSpeed.text = "${FunctionBuildConfig.detouringSpeed} m/s"
|
||||
}
|
||||
}
|
||||
btnSpeedSet.setOnClickListener {
|
||||
val isSuccess = CallerAutoPilotManager.sendDetouringSpeed(FunctionBuildConfig.detouringSpeed.toDouble())
|
||||
if(isSuccess == true){
|
||||
ToastUtils.showShort("变道绕障的目标障碍物速度阈值设置成功")
|
||||
}else{
|
||||
ToastUtils.showShort("变道绕障的目标障碍物速度阈值设置失败")
|
||||
}
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
}
|
||||
Binary file not shown.
|
After Width: | Height: | Size: 387 B |
Binary file not shown.
|
After Width: | Height: | Size: 302 B |
@@ -0,0 +1,196 @@
|
||||
<?xml version="1.0" encoding="utf-8"?>
|
||||
<androidx.constraintlayout.widget.ConstraintLayout xmlns:android="http://schemas.android.com/apk/res/android"
|
||||
xmlns:app="http://schemas.android.com/apk/res-auto"
|
||||
android:layout_width="@dimen/dp_800"
|
||||
android:layout_height="@dimen/dp_1100"
|
||||
android:background="#FFFFFF">
|
||||
<!--绕障类功能-->
|
||||
<ToggleButton
|
||||
android:id="@+id/tbObstacleAvoidance"
|
||||
android:layout_width="match_parent"
|
||||
android:layout_height="wrap_content"
|
||||
android:layout_margin="@dimen/dp_10"
|
||||
android:background="@drawable/radio_button_normal_background_right"
|
||||
android:textColor="#000"
|
||||
android:textOff="开启绕障类功能"
|
||||
android:textOn="关闭绕障类功能"
|
||||
android:textSize="@dimen/dp_24"
|
||||
app:layout_constraintTop_toTopOf="parent"
|
||||
/>
|
||||
<!--危险障碍物颜色标记-->
|
||||
<ToggleButton
|
||||
android:id="@+id/tbMarkingObstacles"
|
||||
android:layout_width="match_parent"
|
||||
android:layout_height="wrap_content"
|
||||
android:layout_margin="@dimen/dp_10"
|
||||
android:background="@drawable/radio_button_normal_background_right"
|
||||
android:textColor="#000"
|
||||
android:textOff="开启「危险障碍物颜色标记」"
|
||||
android:textOn="关闭「危险障碍物颜色标记」"
|
||||
android:textSize="@dimen/dp_24"
|
||||
app:layout_constraintTop_toBottomOf="@id/tbObstacleAvoidance"
|
||||
/>
|
||||
<!--引导线动态效果-->
|
||||
<ToggleButton
|
||||
android:id="@+id/tbRouteDynamicEffect"
|
||||
android:layout_width="match_parent"
|
||||
android:layout_height="wrap_content"
|
||||
android:layout_margin="@dimen/dp_10"
|
||||
android:background="@drawable/radio_button_normal_background_right"
|
||||
android:textColor="#000"
|
||||
android:textOff="开启「引导线动态效果」"
|
||||
android:textOn="关闭「引导线动态效果」"
|
||||
android:textSize="@dimen/dp_24"
|
||||
app:layout_constraintTop_toBottomOf="@id/tbMarkingObstacles"
|
||||
/>
|
||||
<!--红绿灯标识-->
|
||||
<ToggleButton
|
||||
android:id="@+id/tbTrafficLight"
|
||||
android:layout_width="match_parent"
|
||||
android:layout_height="wrap_content"
|
||||
android:layout_margin="@dimen/dp_10"
|
||||
android:background="@drawable/radio_button_normal_background_right"
|
||||
android:textColor="#000"
|
||||
android:textOff="隐藏红绿灯标识"
|
||||
android:textOn="展示红绿灯标识"
|
||||
android:textSize="@dimen/dp_24"
|
||||
app:layout_constraintTop_toBottomOf="@id/tbRouteDynamicEffect"
|
||||
/>
|
||||
<!--限速标识-->
|
||||
<ToggleButton
|
||||
android:id="@+id/tbSpeedLimit"
|
||||
android:layout_width="match_parent"
|
||||
android:layout_height="wrap_content"
|
||||
android:layout_margin="@dimen/dp_10"
|
||||
android:background="@drawable/radio_button_normal_background_right"
|
||||
android:textColor="#000"
|
||||
android:textOff="展示限速标识"
|
||||
android:textOn="隐藏限速标识"
|
||||
android:textSize="@dimen/dp_24"
|
||||
app:layout_constraintTop_toBottomOf="@id/tbTrafficLight"
|
||||
/>
|
||||
<!--自车感知到的他车碰撞预警-->
|
||||
<ToggleButton
|
||||
android:id="@+id/tbCollisionWarning"
|
||||
android:layout_width="match_parent"
|
||||
android:layout_height="wrap_content"
|
||||
android:layout_margin="@dimen/dp_10"
|
||||
android:background="@drawable/radio_button_normal_background_right"
|
||||
android:textColor="#000"
|
||||
android:textOff="开启「自车感知到的他车碰撞预警」"
|
||||
android:textOn="关闭「自车感知到的他车碰撞预警」"
|
||||
android:textSize="@dimen/dp_24"
|
||||
app:layout_constraintTop_toBottomOf="@id/tbSpeedLimit"
|
||||
/>
|
||||
|
||||
<ToggleButton
|
||||
android:id="@+id/tbDemoMode"
|
||||
android:layout_width="match_parent"
|
||||
android:layout_height="wrap_content"
|
||||
android:layout_margin="@dimen/dp_10"
|
||||
android:background="@drawable/radio_button_normal_background_right"
|
||||
android:textColor="#000"
|
||||
android:textOff="开启美化模式"
|
||||
android:textOn="关闭美化模式"
|
||||
android:textSize="@dimen/dp_24"
|
||||
app:layout_constraintTop_toBottomOf="@id/tbCollisionWarning"
|
||||
/>
|
||||
|
||||
<ToggleButton
|
||||
android:id="@+id/tbRainMode"
|
||||
android:layout_width="match_parent"
|
||||
android:layout_height="wrap_content"
|
||||
android:layout_margin="@dimen/dp_10"
|
||||
android:background="@drawable/radio_button_normal_background_right"
|
||||
android:textColor="#000"
|
||||
android:textOff="开启雨天模式"
|
||||
android:textOn="关闭雨天模式"
|
||||
android:textSize="@dimen/dp_24"
|
||||
app:layout_constraintTop_toBottomOf="@id/tbDemoMode"
|
||||
/>
|
||||
|
||||
<ToggleButton
|
||||
android:id="@+id/tbObu"
|
||||
android:layout_width="match_parent"
|
||||
android:layout_height="wrap_content"
|
||||
android:layout_margin="@dimen/dp_10"
|
||||
android:background="@drawable/radio_button_normal_background_right"
|
||||
android:textColor="#000"
|
||||
android:textOff="关闭OBU"
|
||||
android:textOn="开启OBU"
|
||||
android:textSize="@dimen/dp_24"
|
||||
app:layout_constraintTop_toBottomOf="@id/tbRainMode"
|
||||
/>
|
||||
|
||||
<TextView
|
||||
android:id="@+id/tvSpeedThresholdTitle"
|
||||
android:layout_width="wrap_content"
|
||||
android:layout_height="wrap_content"
|
||||
app:layout_constraintLeft_toLeftOf="parent"
|
||||
app:layout_constraintTop_toBottomOf="@id/tbObu"
|
||||
android:text="变道速度阈值:"
|
||||
android:textSize="18sp"
|
||||
android:textColor="#1A1A1A"
|
||||
android:layout_margin="10dp"
|
||||
/>
|
||||
|
||||
<ImageView
|
||||
android:id="@+id/ivSpeedReduce"
|
||||
android:layout_width="wrap_content"
|
||||
android:layout_height="wrap_content"
|
||||
app:layout_constraintLeft_toRightOf="@id/tvSpeedThresholdTitle"
|
||||
app:layout_constraintTop_toTopOf="@id/tvSpeedThresholdTitle"
|
||||
app:layout_constraintBottom_toBottomOf="@id/tvSpeedThresholdTitle"
|
||||
android:src="@drawable/icon_reduce"
|
||||
android:padding="10dp"
|
||||
/>
|
||||
|
||||
<TextView
|
||||
android:id="@+id/tvSpeed"
|
||||
android:layout_width="wrap_content"
|
||||
android:layout_height="0dp"
|
||||
app:layout_constraintTop_toTopOf="@id/ivSpeedReduce"
|
||||
app:layout_constraintBottom_toBottomOf="@id/ivSpeedReduce"
|
||||
app:layout_constraintLeft_toRightOf="@id/ivSpeedReduce"
|
||||
android:textSize="18sp"
|
||||
android:gravity="center"
|
||||
android:background="@drawable/debug_setting_edit_bg"
|
||||
android:paddingStart="10dp"
|
||||
android:paddingEnd="10dp"
|
||||
android:layout_marginTop="5dp"
|
||||
android:layout_marginBottom="5dp"
|
||||
/>
|
||||
|
||||
<ImageView
|
||||
android:id="@+id/ivSpeedAdd"
|
||||
android:layout_width="wrap_content"
|
||||
android:layout_height="wrap_content"
|
||||
app:layout_constraintTop_toTopOf="@id/tvSpeed"
|
||||
app:layout_constraintBottom_toBottomOf="@id/tvSpeed"
|
||||
app:layout_constraintLeft_toRightOf="@id/tvSpeed"
|
||||
android:src="@drawable/icon_add"
|
||||
android:padding="10dp"
|
||||
/>
|
||||
|
||||
<Button
|
||||
android:id="@+id/btnSpeedSet"
|
||||
android:layout_width="wrap_content"
|
||||
android:layout_height="wrap_content"
|
||||
app:layout_constraintTop_toTopOf="@id/ivSpeedAdd"
|
||||
app:layout_constraintBottom_toBottomOf="@id/ivSpeedAdd"
|
||||
app:layout_constraintLeft_toRightOf="@id/ivSpeedAdd"
|
||||
android:text="设置阈值"
|
||||
android:layout_marginStart="10dp"
|
||||
/>
|
||||
|
||||
<View
|
||||
android:layout_width="match_parent"
|
||||
android:layout_height="1dp"
|
||||
android:layout_margin="10dp"
|
||||
android:background="#F0F0F0"
|
||||
app:layout_constraintLeft_toLeftOf="parent"
|
||||
app:layout_constraintRight_toRightOf="parent"
|
||||
app:layout_constraintTop_toBottomOf="@id/btnSpeedSet"
|
||||
/>
|
||||
|
||||
</androidx.constraintlayout.widget.ConstraintLayout>
|
||||
@@ -54,5 +54,12 @@ class MoGoObuProvider : IMoGoObuProvider {
|
||||
|
||||
}
|
||||
|
||||
override fun disConnect() {
|
||||
MogoPrivateObuManager.INSTANCE.disConnectObu()
|
||||
}
|
||||
|
||||
override fun isConnected(): Boolean {
|
||||
return MogoPrivateObuManager.INSTANCE.isConnected()
|
||||
}
|
||||
|
||||
}
|
||||
@@ -77,6 +77,14 @@ class MogoPrivateObuManager private constructor() {
|
||||
}
|
||||
}
|
||||
|
||||
fun disConnectObu(){
|
||||
MogoObuManager.getInstance().disConnect()
|
||||
}
|
||||
|
||||
fun isConnected(): Boolean{
|
||||
return MogoObuManager.getInstance().isConnected
|
||||
}
|
||||
|
||||
private val mogoObuListener: OnMogoObuListener = object : OnMogoObuListener() {
|
||||
// OBU连接成功
|
||||
override fun onConnected() {
|
||||
|
||||
@@ -29,6 +29,22 @@ object FunctionBuildConfig {
|
||||
@JvmField
|
||||
var isRainMode = false
|
||||
|
||||
/**
|
||||
* 是否开启绕障类功能
|
||||
* 默认开启
|
||||
*/
|
||||
@Volatile
|
||||
@JvmField
|
||||
var isDetouring = true
|
||||
|
||||
/**
|
||||
* 变道绕障的目标障碍物速度阈值
|
||||
* 默认 3 m/s
|
||||
*/
|
||||
@Volatile
|
||||
@JvmField
|
||||
var detouringSpeed = 3
|
||||
|
||||
/**
|
||||
* 是否是感知优化模式
|
||||
* 默认开启
|
||||
|
||||
@@ -88,6 +88,17 @@ interface IMoGoAutopilotProvider : IMoGoFunctionServerProvider {
|
||||
*/
|
||||
fun recordPackage(type: Int,id: Int,duration: Int,bduration: Int): Boolean
|
||||
|
||||
/**
|
||||
* 开启域控制器录制bag包
|
||||
* @param type 录制类型 1: badcase 2:map 3:rests
|
||||
* @param id 指令/任务 ID
|
||||
* @param duration 录制时长
|
||||
* @param bduration 录制前溯时长
|
||||
* @param topics 录制Topic集合
|
||||
* @return true-成功,false-失败
|
||||
*/
|
||||
fun recordPackage(type: Int,id: Int,duration: Int,bduration: Int,topics: List<String>): Boolean
|
||||
|
||||
/**
|
||||
* Log 是否显示
|
||||
*
|
||||
@@ -152,9 +163,28 @@ interface IMoGoAutopilotProvider : IMoGoFunctionServerProvider {
|
||||
fun setRainMode(isEnable: Boolean)
|
||||
|
||||
/**
|
||||
* 获取数据采集录制模式配置列表
|
||||
* 绕障类功能开关
|
||||
* isEnable = true 开启
|
||||
* isEnable = false 关闭
|
||||
* @return boolean
|
||||
*/
|
||||
fun getBadCaseConfig()
|
||||
fun sendDetouring(isEnable: Boolean): Boolean
|
||||
|
||||
/**
|
||||
* 变道绕障的目标障碍物速度阈值
|
||||
* @param speed 速度阈值 m/s
|
||||
* @return boolean
|
||||
*/
|
||||
fun sendDetouringSpeed(speed: Double): Boolean
|
||||
|
||||
/**
|
||||
* 获取数据采集录制模式配置列表
|
||||
* @param reqType 0: all, 1:获取当前所有topic列表, 2:配置需要预加载的topic组合
|
||||
* @param recordType 0:不需要修改内置类型的topic组合, 1:需要修改内置类型的topic组合
|
||||
* @param topicsNeedToCache
|
||||
* @return boolean
|
||||
*/
|
||||
fun getBadCaseConfig(reqType: Int,recordType: Int,topicsNeedToCache: List<String>): Boolean
|
||||
|
||||
/**
|
||||
* 发送工控机所有节点重启命令
|
||||
@@ -232,4 +262,14 @@ interface IMoGoAutopilotProvider : IMoGoFunctionServerProvider {
|
||||
* 鸣笛 开始:1,结束:2
|
||||
*/
|
||||
fun sendOperatorSetHorn(value: Double)
|
||||
|
||||
/**
|
||||
* 行程信息
|
||||
* @param type 事件类型, 1:行程开始, 2:行程结束, 3:出站, 4:进站, 5:城市占道施工预警
|
||||
* @param lineName 路线名, for type 1, 2
|
||||
* @param stopName 站点名, for type 3, 4
|
||||
* @param isLastStop 是否是最后一站
|
||||
* @return
|
||||
*/
|
||||
fun sendTripInfo(type: Int, lineName: String, stopName: String, isLastStop: Boolean)
|
||||
}
|
||||
@@ -11,4 +11,7 @@ interface IMoGoObuProvider : IMoGoFunctionServerProvider {
|
||||
|
||||
fun connect(ipAddress: String)
|
||||
|
||||
fun disConnect()
|
||||
|
||||
fun isConnected(): Boolean
|
||||
}
|
||||
@@ -136,6 +136,12 @@ object CallerAutoPilotManager {
|
||||
}
|
||||
}
|
||||
|
||||
fun recordPackage(type: Int,id: Int,duration: Int,bduration: Int,topics: List<String>){
|
||||
if (AppIdentityModeUtils.isDriver(FunctionBuildConfig.appIdentityMode)){
|
||||
providerApi?.recordPackage(type, id, duration, bduration, topics)
|
||||
}
|
||||
}
|
||||
|
||||
/**
|
||||
* 停止录制bag包
|
||||
*/
|
||||
@@ -229,12 +235,34 @@ object CallerAutoPilotManager {
|
||||
}
|
||||
|
||||
/**
|
||||
* 获取数据采集录制模式配置列表
|
||||
* 绕障类功能开关
|
||||
* isEnable = true 开启
|
||||
* isEnable = false 关闭
|
||||
* @return boolean
|
||||
*/
|
||||
fun getBadCaseConfig() {
|
||||
fun sendDetouring(isEnable: Boolean): Boolean?{
|
||||
return providerApi?.sendDetouring(isEnable)
|
||||
}
|
||||
|
||||
/**
|
||||
* 变道绕障的目标障碍物速度阈值
|
||||
* @param speed 速度阈值 m/s
|
||||
* @return boolean
|
||||
*/
|
||||
fun sendDetouringSpeed(speed: Double): Boolean?{
|
||||
return providerApi?.sendDetouringSpeed(speed)
|
||||
}
|
||||
|
||||
/**
|
||||
* 获取数据采集录制模式配置列表
|
||||
* @param reqType 0: all, 1:获取当前所有topic列表, 2:配置需要预加载的topic组合
|
||||
* @param recordType 0:不需要修改内置类型的topic组合, 1:需要修改内置类型的topic组合
|
||||
* @param topicsNeedToCache
|
||||
*/
|
||||
fun getBadCaseConfig(reqType: Int,recordType: Int,topicsNeedToCache: List<String>){
|
||||
// 司机屏才能查询数据采集的配置
|
||||
if (AppIdentityModeUtils.isDriver(FunctionBuildConfig.appIdentityMode)) {
|
||||
providerApi?.getBadCaseConfig()
|
||||
providerApi?.getBadCaseConfig(reqType, recordType, topicsNeedToCache)
|
||||
}
|
||||
}
|
||||
|
||||
@@ -266,6 +294,18 @@ object CallerAutoPilotManager {
|
||||
providerApi?.sendOperatorSetHorn(value)
|
||||
}
|
||||
|
||||
/**
|
||||
* 行程信息
|
||||
* @param type 事件类型, 1:行程开始, 2:行程结束, 3:出站, 4:进站, 5:城市占道施工预警
|
||||
* @param lineName 路线名, for type 1, 2
|
||||
* @param stopName 站点名, for type 3, 4
|
||||
* @param isLastStop 是否终点站
|
||||
* @return
|
||||
*/
|
||||
fun sendTripInfo(type: Int, lineName: String, stopName: String, isLastStop: Boolean) {
|
||||
providerApi?.sendTripInfo(type, lineName, stopName, isLastStop)
|
||||
}
|
||||
|
||||
/**
|
||||
* 发送工控机所有节点重启命令
|
||||
*/
|
||||
|
||||
@@ -26,4 +26,19 @@ object CallerOBUManager {
|
||||
providerApi.connect(ipAddress)
|
||||
}
|
||||
|
||||
/**
|
||||
* 断开OBU连接
|
||||
*/
|
||||
fun disConnectObu(){
|
||||
providerApi.disConnect()
|
||||
}
|
||||
|
||||
/**
|
||||
* 获取OBU连接状态
|
||||
* @return boolean 连接状态
|
||||
*/
|
||||
fun isConnected(): Boolean{
|
||||
return providerApi.isConnected()
|
||||
}
|
||||
|
||||
}
|
||||
@@ -4,7 +4,7 @@ package mogo.telematics.pad;
|
||||
enum ProtocolVersion
|
||||
{
|
||||
Defaultver = 0;
|
||||
CurrentVersion = 7; //每次修改proto文件增加1
|
||||
CurrentVersion = 8; //每次修改proto文件增加1
|
||||
}
|
||||
|
||||
enum MessageType
|
||||
@@ -50,6 +50,8 @@ enum MessageType
|
||||
MsgTypeOperatorCmdReq = 0x10116; //操控指令
|
||||
MsgTypeSubscribeDataReq = 0x10117; //数据订阅、取消订阅请求
|
||||
MsgTypeSpecialVehicleTaskCmd = 0x10118; //特种车辆命令
|
||||
MsgTypeSetParamReq = 0x10119; //设置参数命令
|
||||
MsgTypeTripInfoEvent = 0x1011a; //行程信息
|
||||
}
|
||||
|
||||
message Header
|
||||
@@ -286,6 +288,7 @@ message RecordData
|
||||
bool isRecord = 4; //采集指令, true: 采集, false: 停止采集
|
||||
bool sustain = 5; //是否持续采集
|
||||
uint32 bduration = 6; //前溯时长
|
||||
repeated string topics = 7; //topic列表
|
||||
}
|
||||
|
||||
// message definition for MsgTypeRecordResult
|
||||
@@ -385,7 +388,9 @@ message SetRainModeReq
|
||||
// message definition for MsgTypeRecordDataConfigReq
|
||||
message RecordDataConfigReq
|
||||
{
|
||||
uint32 reqType = 1; // 0: all, 其他保留
|
||||
uint32 reqType = 1; // 0: all, 1:获取当前所有topic列表, 2:配置需要预加载的topic组合
|
||||
uint32 recordType = 2; // 0:不需要修改内置类型的topic组合, 1:需要修改内置类型的topic组合
|
||||
repeated string topicsNeedToCache = 3;
|
||||
}
|
||||
|
||||
// message definition for MsgTypeRecordDataConfigResp
|
||||
@@ -393,11 +398,13 @@ message RecordDataType
|
||||
{
|
||||
uint32 id = 1; //采集类型id
|
||||
string desc = 2; //采集类型描述
|
||||
repeated string topics = 3; //采集类型必须采集的topic列表
|
||||
}
|
||||
|
||||
message RecordDataConfig
|
||||
{
|
||||
repeated RecordDataType recordTypes = 1;
|
||||
repeated string allTopics = 2; //当前所有topic列表
|
||||
}
|
||||
|
||||
// message definition for MsgTypeSubscribeDataReq
|
||||
@@ -466,3 +473,26 @@ message PlanningActionMsg
|
||||
//message definition for MsgTypeSpecialVehicleTaskCmd
|
||||
//refer to special_vehicle_task_cmd.proto for details
|
||||
|
||||
//message definition for MsgTypeSetParamReq
|
||||
message SetOneParam
|
||||
{
|
||||
uint32 type = 1; // 0:default 1:绕障类功能开关(bool) 2:变道绕障的目标障碍物速度阈值(double, m/s)
|
||||
string value = 2; // 转成字符串的值
|
||||
}
|
||||
|
||||
message SetParamReq
|
||||
{
|
||||
repeated SetOneParam reqs = 1;
|
||||
}
|
||||
|
||||
//message definition for MsgTypeTripInfoEvent
|
||||
message TripInfoEvent
|
||||
{
|
||||
uint32 type = 1; //事件类型, 1:行程开始, 2:行程结束, 3:出站, 4:进站, 5:城市占道施工预警
|
||||
string lineName = 2; //路线名, for type 1, 2
|
||||
string stopName = 3; //站点名, for type 3, 4
|
||||
bool isLastStop = 4; //是否最终站, for type 3, 4
|
||||
}
|
||||
|
||||
|
||||
|
||||
|
||||
@@ -14,6 +14,7 @@ import static com.zhidao.support.adas.high.chain.AdasChain.CHAIN_LINK_LOG_WEB_SO
|
||||
|
||||
import android.os.SystemClock;
|
||||
import android.text.TextUtils;
|
||||
import android.util.Log;
|
||||
|
||||
import androidx.annotation.NonNull;
|
||||
import androidx.annotation.Nullable;
|
||||
@@ -46,6 +47,7 @@ import com.zhjt.service.chain.TracingConstants;
|
||||
|
||||
import java.util.HashMap;
|
||||
import java.util.HashSet;
|
||||
import java.util.List;
|
||||
import java.util.Map;
|
||||
import java.util.Set;
|
||||
import java.util.Timer;
|
||||
@@ -300,6 +302,7 @@ public class AdasChannel implements IAdasNetCommApi, FpgaSocket.IWebSocketConnec
|
||||
if (mSocket == null || bytes == null || bytes.length <= 0) {
|
||||
return false;
|
||||
}
|
||||
Log.d("liyz", "sendWsMessag bytes = " + bytes); //TODO
|
||||
ByteString byteString = ByteString.of(bytes);
|
||||
if (!byteString.startsWith(Constants.RAW_MG)) {
|
||||
CupidLogUtils.e(TAG, "协议不匹配,命令下发失败 bytes=" + ByteUtil.byteArrToHex(bytes));
|
||||
@@ -362,6 +365,7 @@ public class AdasChannel implements IAdasNetCommApi, FpgaSocket.IWebSocketConnec
|
||||
CupidLogUtils.i("TimeConsuming", who + " 从接收到解析耗时=" + time + "毫秒");
|
||||
}
|
||||
}
|
||||
|
||||
//TODO 计算耗时 临时测试
|
||||
public static void calculateTimeConsumingBusiness(String who, long receiveTime) {
|
||||
if (CupidLogUtils.isEnableLog()) {
|
||||
@@ -369,6 +373,7 @@ public class AdasChannel implements IAdasNetCommApi, FpgaSocket.IWebSocketConnec
|
||||
CupidLogUtils.i("TimeConsuming", who + " 业务处理耗时=" + time + "毫秒");
|
||||
}
|
||||
}
|
||||
|
||||
/**
|
||||
* 分发和解析
|
||||
*
|
||||
@@ -817,25 +822,39 @@ public class AdasChannel implements IAdasNetCommApi, FpgaSocket.IWebSocketConnec
|
||||
|
||||
@Override
|
||||
public boolean startRecordPackage(int id, int type) {
|
||||
return sendRecordData(id, 0, type, true, -1);
|
||||
return sendRecordData(id, 0, type, true, -1, null);
|
||||
}
|
||||
|
||||
@Override
|
||||
public boolean startRecordPackage(int id, int duration, int type) {
|
||||
return sendRecordData(id, duration, type, true, -1);
|
||||
return sendRecordData(id, duration, type, true, -1, null);
|
||||
}
|
||||
|
||||
@Override
|
||||
public boolean startRecordPackage(int id, int duration, int type, int bduration) {
|
||||
return sendRecordData(id, duration, type, true, bduration);
|
||||
return sendRecordData(id, duration, type, true, bduration, null);
|
||||
}
|
||||
|
||||
@Override
|
||||
public boolean startRecordPackage(int id, int type, List<String> topics) {
|
||||
return sendRecordData(id, 0, type, true, -1, topics);
|
||||
}
|
||||
|
||||
@Override
|
||||
public boolean startRecordPackage(int id, int duration, int type, List<String> topics) {
|
||||
return sendRecordData(id, duration, type, true, -1, topics);
|
||||
}
|
||||
|
||||
@Override
|
||||
public boolean startRecordPackage(int id, int duration, int type, int bduration, List<String> topics) {
|
||||
return sendRecordData(id, duration, type, true, bduration, topics);
|
||||
}
|
||||
|
||||
@Override
|
||||
public boolean stopRecordPackage(int id, int type) {
|
||||
return sendRecordData(id, 0, type, false, -1);
|
||||
return sendRecordData(id, 0, type, false, -1, null);
|
||||
}
|
||||
|
||||
|
||||
/**
|
||||
* 数据采集请求 主动录制Bag包
|
||||
* sustain为true时 duration无效
|
||||
@@ -846,10 +865,11 @@ public class AdasChannel implements IAdasNetCommApi, FpgaSocket.IWebSocketConnec
|
||||
* @param isRecord 采集指令, true: 采集, false: 停止采集
|
||||
* @param bduration 前溯时长
|
||||
* @param sustain 是否持续采集
|
||||
* @param topics 要录制的Topic列表
|
||||
* @return boolean
|
||||
*/
|
||||
@Override
|
||||
public boolean sendRecordData(int id, int duration, int type, boolean isRecord, int bduration) {
|
||||
public boolean sendRecordData(int id, int duration, int type, boolean isRecord, int bduration, List<String> topics) {
|
||||
boolean sustain = false;
|
||||
if (isRecord) {
|
||||
if (duration <= 0) {
|
||||
@@ -867,6 +887,9 @@ public class AdasChannel implements IAdasNetCommApi, FpgaSocket.IWebSocketConnec
|
||||
if (bduration > -1) {
|
||||
builder.setBduration(bduration);
|
||||
}
|
||||
if (topics != null && !topics.isEmpty()) {
|
||||
builder.addAllTopics(topics);
|
||||
}
|
||||
MessagePad.RecordData req = builder.build();
|
||||
return sendPBMessage(MessageType.TYPE_SEND_RECORD_DATA.typeCode, req.toByteArray());
|
||||
}
|
||||
@@ -1031,14 +1054,20 @@ public class AdasChannel implements IAdasNetCommApi, FpgaSocket.IWebSocketConnec
|
||||
/**
|
||||
* 数据采集配置查询
|
||||
*
|
||||
* @param reqType 0: all, 1:获取当前所有topic列表, 2:配置需要预加载的topic组合
|
||||
* @param recordType 0:不需要修改内置类型的topic组合, 1:需要修改内置类型的topic组合
|
||||
* @param topicsNeedToCache
|
||||
* @return boolean
|
||||
*/
|
||||
@Override
|
||||
public boolean sendRecordDataConfigReq() {
|
||||
MessagePad.RecordDataConfigReq req = MessagePad.RecordDataConfigReq
|
||||
public boolean sendRecordDataConfigReq(int reqType, int recordType, List<String> topicsNeedToCache) {
|
||||
MessagePad.RecordDataConfigReq.Builder builder = MessagePad.RecordDataConfigReq
|
||||
.newBuilder()
|
||||
.setReqType(0)
|
||||
.build();
|
||||
.setReqType(reqType)
|
||||
.setRecordType(recordType);
|
||||
if (topicsNeedToCache != null && !topicsNeedToCache.isEmpty())
|
||||
builder.addAllTopicsNeedToCache(topicsNeedToCache);
|
||||
MessagePad.RecordDataConfigReq req = builder.build();
|
||||
return sendPBMessage(MessageType.TYPE_SEND_RECORD_DATA_CONFIG_REQ.typeCode, req.toByteArray());
|
||||
}
|
||||
|
||||
@@ -1194,5 +1223,66 @@ public class AdasChannel implements IAdasNetCommApi, FpgaSocket.IWebSocketConnec
|
||||
public boolean sendOperatorCmdStopHonking() {
|
||||
return sendOperatorCmdSetHorn(2);
|
||||
}
|
||||
|
||||
/**
|
||||
* 设置参数命令
|
||||
*
|
||||
* @param type 0:default 1:绕障类功能开关(bool) 2:变道绕障的目标障碍物速度阈值(double, m/s)
|
||||
* @param value 转成字符串的值
|
||||
* @return boolean
|
||||
*/
|
||||
@Override
|
||||
public boolean sendSetParamReq(int type, String value) {
|
||||
MessagePad.SetOneParam oneParam = MessagePad.SetOneParam
|
||||
.newBuilder().setType(type).setValue(value).build();
|
||||
MessagePad.SetParamReq req = MessagePad.SetParamReq
|
||||
.newBuilder()
|
||||
.addReqs(oneParam)
|
||||
.build();
|
||||
return sendPBMessage(MessageType.TYPE_SEND_SET_PARAM_REQ.typeCode, req.toByteArray());
|
||||
}
|
||||
|
||||
/**
|
||||
* 绕障类功能开关
|
||||
*
|
||||
* @param enable 0:关闭,1:开启
|
||||
* @return boolean
|
||||
*/
|
||||
@Override
|
||||
public boolean sendDetouring(int enable) {
|
||||
return sendSetParamReq(1, String.valueOf(enable));
|
||||
}
|
||||
|
||||
/**
|
||||
* 变道绕障的目标障碍物速度阈值
|
||||
*
|
||||
* @param speed 速度阈值 m/s
|
||||
* @return boolean
|
||||
*/
|
||||
@Override
|
||||
public boolean sendDetouringSpeed(double speed) {
|
||||
return sendSetParamReq(2, String.valueOf(speed));
|
||||
}
|
||||
|
||||
/**
|
||||
*
|
||||
* @param type 事件类型, 1:行程开始, 2:行程结束, 3:出站, 4:进站, 5:城市占道施工预警
|
||||
* @param lineName 路线名, for type 1, 2
|
||||
* @param stopName 站点名, for type 3, 4
|
||||
* @param isLastStop
|
||||
* @return
|
||||
*/
|
||||
@Override
|
||||
public boolean sendTripInfoReq(int type, String lineName, String stopName, boolean isLastStop) {
|
||||
MessagePad.TripInfoEvent req = MessagePad.TripInfoEvent
|
||||
.newBuilder()
|
||||
.setType(type)
|
||||
.setLineName(lineName)
|
||||
.setStopName(stopName)
|
||||
.setIsLastStop(isLastStop)
|
||||
.build();
|
||||
return sendPBMessage(MessageType.TYPE_SEND_TRIP_INFO_REQ.typeCode, req.toByteArray());
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
|
||||
@@ -12,6 +12,7 @@ import com.zhidao.support.adas.high.common.MessageType;
|
||||
import com.zhidao.support.adas.high.common.ReceiveTimeoutManager;
|
||||
|
||||
import java.util.HashSet;
|
||||
import java.util.List;
|
||||
import java.util.Set;
|
||||
|
||||
import mogo.telematics.pad.MessagePad;
|
||||
@@ -332,6 +333,7 @@ public class AdasManager implements IAdasNetCommApi {
|
||||
* 同下
|
||||
*
|
||||
* @param id
|
||||
* @param duration
|
||||
* @param type
|
||||
* @return
|
||||
*/
|
||||
@@ -344,7 +346,9 @@ public class AdasManager implements IAdasNetCommApi {
|
||||
* 同下
|
||||
*
|
||||
* @param id
|
||||
* @param duration
|
||||
* @param type
|
||||
* @param bduration
|
||||
* @return
|
||||
*/
|
||||
@Override
|
||||
@@ -352,6 +356,48 @@ public class AdasManager implements IAdasNetCommApi {
|
||||
return mChannel != null && mChannel.startRecordPackage(id, duration, type, bduration);
|
||||
}
|
||||
|
||||
/**
|
||||
* 同下
|
||||
*
|
||||
* @param id
|
||||
* @param type
|
||||
* @param topics
|
||||
* @return
|
||||
*/
|
||||
@Override
|
||||
public boolean startRecordPackage(int id, int type, List<String> topics) {
|
||||
return mChannel != null && mChannel.startRecordPackage(id, type, topics);
|
||||
}
|
||||
|
||||
/**
|
||||
* 同下
|
||||
*
|
||||
* @param id
|
||||
* @param duration
|
||||
* @param type
|
||||
* @param topics
|
||||
* @return
|
||||
*/
|
||||
@Override
|
||||
public boolean startRecordPackage(int id, int duration, int type, List<String> topics) {
|
||||
return mChannel != null && mChannel.startRecordPackage(id, duration, type, topics);
|
||||
}
|
||||
|
||||
/**
|
||||
* 同下
|
||||
*
|
||||
* @param id
|
||||
* @param duration
|
||||
* @param type
|
||||
* @param bduration
|
||||
* @param topics
|
||||
* @return
|
||||
*/
|
||||
@Override
|
||||
public boolean startRecordPackage(int id, int duration, int type, int bduration, List<String> topics) {
|
||||
return mChannel != null && mChannel.startRecordPackage(id, duration, type, bduration, topics);
|
||||
}
|
||||
|
||||
/**
|
||||
* 同下
|
||||
*
|
||||
@@ -375,8 +421,8 @@ public class AdasManager implements IAdasNetCommApi {
|
||||
* @return boolean
|
||||
*/
|
||||
@Override
|
||||
public boolean sendRecordData(int id, int duration, int type, boolean isRecord, int bduration) {
|
||||
return mChannel != null && mChannel.sendRecordData(id, duration, type, isRecord, bduration);
|
||||
public boolean sendRecordData(int id, int duration, int type, boolean isRecord, int bduration, List<String> topics) {
|
||||
return mChannel != null && mChannel.sendRecordData(id, duration, type, isRecord, bduration, topics);
|
||||
}
|
||||
|
||||
/**
|
||||
@@ -469,11 +515,14 @@ public class AdasManager implements IAdasNetCommApi {
|
||||
/**
|
||||
* 数据采集配置查询
|
||||
*
|
||||
* @param reqType 0: all, 1:获取当前所有topic列表, 2:配置需要预加载的topic组合
|
||||
* @param recordType 0:不需要修改内置类型的topic组合, 1:需要修改内置类型的topic组合
|
||||
* @param topicsNeedToCache
|
||||
* @return boolean
|
||||
*/
|
||||
@Override
|
||||
public boolean sendRecordDataConfigReq() {
|
||||
return mChannel != null && mChannel.sendRecordDataConfigReq();
|
||||
public boolean sendRecordDataConfigReq(int reqType, int recordType, List<String> topicsNeedToCache) {
|
||||
return mChannel != null && mChannel.sendRecordDataConfigReq(reqType, recordType, topicsNeedToCache);
|
||||
}
|
||||
|
||||
/**
|
||||
@@ -570,6 +619,52 @@ public class AdasManager implements IAdasNetCommApi {
|
||||
return mChannel != null && mChannel.sendOperatorCmdStopHonking();
|
||||
}
|
||||
|
||||
/**
|
||||
* 设置参数命令
|
||||
*
|
||||
* @param type 0:default 1:绕障类功能开关(bool) 2:变道绕障的目标障碍物速度阈值(double, m/s)
|
||||
* @param value 转成字符串的值
|
||||
* @return boolean
|
||||
*/
|
||||
@Override
|
||||
public boolean sendSetParamReq(int type, String value) {
|
||||
return mChannel != null && mChannel.sendSetParamReq(type, value);
|
||||
}
|
||||
|
||||
/**
|
||||
* 绕障类功能开关
|
||||
*
|
||||
* @param enable 0:关闭,1:开启
|
||||
* @return boolean
|
||||
*/
|
||||
@Override
|
||||
public boolean sendDetouring(int enable) {
|
||||
return mChannel != null && mChannel.sendDetouring(enable);
|
||||
}
|
||||
|
||||
/**
|
||||
* 变道绕障的目标障碍物速度阈值
|
||||
*
|
||||
* @param speed 速度阈值 m/s
|
||||
* @return boolean
|
||||
*/
|
||||
@Override
|
||||
public boolean sendDetouringSpeed(double speed) {
|
||||
return mChannel != null && mChannel.sendDetouringSpeed(speed);
|
||||
}
|
||||
|
||||
/**
|
||||
* 行程信息
|
||||
* @param type 事件类型, 1:行程开始, 2:行程结束, 3:出站, 4:进站, 5:城市占道施工预警
|
||||
* @param lineName 路线名, for type 1, 2
|
||||
* @param stopName 站点名, for type 3, 4
|
||||
* @param isLastStop 是否终点站
|
||||
* @return
|
||||
*/
|
||||
@Override
|
||||
public boolean sendTripInfoReq(int type, String lineName, String stopName, boolean isLastStop) {
|
||||
return mChannel != null && mChannel.sendTripInfoReq(type,lineName,stopName,isLastStop);
|
||||
}
|
||||
|
||||
/**
|
||||
* 获取工控机固定IP列表
|
||||
|
||||
@@ -7,6 +7,7 @@ import com.zhidao.support.adas.high.common.Constants;
|
||||
import com.zhidao.support.adas.high.common.Define;
|
||||
import com.zhidao.support.adas.high.common.MessageType;
|
||||
|
||||
import java.util.List;
|
||||
import java.util.Set;
|
||||
|
||||
import mogo.telematics.pad.MessagePad;
|
||||
@@ -132,6 +133,38 @@ public interface IAdasNetCommApi {
|
||||
*/
|
||||
boolean startRecordPackage(int id, int duration, int type, int bduration);
|
||||
|
||||
/**
|
||||
* 同下
|
||||
*
|
||||
* @param id
|
||||
* @param type
|
||||
* @param topics
|
||||
* @return 加入WS发送消息队列是否成功
|
||||
*/
|
||||
boolean startRecordPackage(int id, int type, List<String> topics);
|
||||
|
||||
/**
|
||||
* 同下
|
||||
*
|
||||
* @param id
|
||||
* @param type
|
||||
* @param topics
|
||||
* @return 加入WS发送消息队列是否成功
|
||||
*/
|
||||
boolean startRecordPackage(int id, int duration, int type, List<String> topics);
|
||||
|
||||
/**
|
||||
* 同下
|
||||
*
|
||||
* @param id
|
||||
* @param duration
|
||||
* @param type
|
||||
* @param bduration
|
||||
* @param topics
|
||||
* @return 加入WS发送消息队列是否成功
|
||||
*/
|
||||
boolean startRecordPackage(int id, int duration, int type, int bduration, List<String> topics);
|
||||
|
||||
/**
|
||||
* 同下
|
||||
*
|
||||
@@ -151,7 +184,7 @@ public interface IAdasNetCommApi {
|
||||
* @param bduration 前溯时长
|
||||
* @return 加入WS发送消息队列是否成功
|
||||
*/
|
||||
boolean sendRecordData(int id, int duration, int type, boolean isRecord, int bduration);
|
||||
boolean sendRecordData(int id, int duration, int type, boolean isRecord, int bduration, List<String> topics);
|
||||
|
||||
/**
|
||||
* 设置自动驾驶最大速度
|
||||
@@ -223,11 +256,13 @@ public interface IAdasNetCommApi {
|
||||
|
||||
/**
|
||||
* 数据采集配置查询
|
||||
* 0: all, 其他保留
|
||||
*
|
||||
* @param reqType 0: all, 1:获取当前所有topic列表, 2:配置需要预加载的topic组合
|
||||
* @param recordType 0:不需要修改内置类型的topic组合, 1:需要修改内置类型的topic组合
|
||||
* @param topicsNeedToCache
|
||||
* @return 加入WS发送消息队列是否成功
|
||||
*/
|
||||
boolean sendRecordDataConfigReq();
|
||||
boolean sendRecordDataConfigReq(int reqType, int recordType, List<String> topicsNeedToCache);
|
||||
|
||||
/**
|
||||
* 获取已注册接口
|
||||
@@ -319,6 +354,43 @@ public interface IAdasNetCommApi {
|
||||
* @return boolean
|
||||
*/
|
||||
boolean sendOperatorCmdStopHonking();
|
||||
|
||||
/**
|
||||
* 设置参数命令
|
||||
*
|
||||
* @param type 0:default 1:绕障类功能开关(bool) 2:变道绕障的目标障碍物速度阈值(double, m/s)
|
||||
* @param value 转成字符串的值
|
||||
* @return boolean
|
||||
*/
|
||||
boolean sendSetParamReq(int type, String value);
|
||||
|
||||
/**
|
||||
* 绕障类功能开关
|
||||
*
|
||||
* @param enable 0:关闭,1:开启
|
||||
* @return boolean
|
||||
*/
|
||||
boolean sendDetouring(int enable);
|
||||
|
||||
/**
|
||||
* 变道绕障的目标障碍物速度阈值
|
||||
*
|
||||
* @param speed 速度阈值 m/s
|
||||
* @return boolean
|
||||
*/
|
||||
boolean sendDetouringSpeed(double speed);
|
||||
|
||||
/**
|
||||
* 发生行程相关
|
||||
*
|
||||
* @param type 事件类型, 1:行程开始, 2:行程结束, 3:出站, 4:进站, 5:城市占道施工预警
|
||||
* @param lineName 路线名, for type 1, 2
|
||||
* @param stopName 站点名, for type 3, 4
|
||||
* @return boolean 是否最终站, for type 3, 4
|
||||
*/
|
||||
boolean sendTripInfoReq(int type, String lineName, String stopName, boolean isLastStop);
|
||||
|
||||
|
||||
// TODO 需求暂停 待讨论
|
||||
// boolean getRoutes();
|
||||
|
||||
@@ -349,6 +421,7 @@ public interface IAdasNetCommApi {
|
||||
*/
|
||||
void setEnableLog(boolean isEnableLog);
|
||||
|
||||
|
||||
/**
|
||||
* 获取与当前连接工控机兼容性
|
||||
* 连接状态=已连接 时正常返回,其他状态全部为null
|
||||
|
||||
@@ -49,6 +49,8 @@ public enum MessageType {
|
||||
TYPE_SEND_RECORD_DATA_CONFIG_REQ(MessagePad.MessageType.MsgTypeRecordDataConfigReq, "数据采集配置查询"),
|
||||
TYPE_RECEIVE_RECORD_DATA_CONFIG_RESP(MessagePad.MessageType.MsgTypeRecordDataConfigResp, "数据采集配置"),
|
||||
TYPE_SEND_SUBSCRIBE_DATA_REQ(MessagePad.MessageType.MsgTypeSubscribeDataReq, "数据订阅、取消订阅请求"),
|
||||
TYPE_SEND_SET_PARAM_REQ(MessagePad.MessageType.MsgTypeSetParamReq, "设置参数命令"),
|
||||
TYPE_SEND_TRIP_INFO_REQ(MessagePad.MessageType.MsgTypeTripInfoEvent, "行程信息"),
|
||||
//透传 原始pb文件中不存在以下type。由于Java中无法强转所以在mogo-adas-data message_pad.proto中放开注释
|
||||
TYPE_RECEIVE_PLANNING_DECISION_STATE(MessagePad.MessageType.MsgTypePlanningDecisionState, "Planning决策状态");
|
||||
|
||||
|
||||
Reference in New Issue
Block a user