Merge remote-tracking branch 'origin/release_robotaxi-d-app-module_2120_221017_2.12.0.1'
# Conflicts: # core/function-impl/mogo-core-function-hmi/src/main/java/com/mogo/eagle/core/function/main/MainLauncherActivity.java # core/mogo-core-function-api/src/main/java/com/mogo/eagle/core/function/api/autopilot/IMoGoAutopilotProvider.kt # libraries/mogo-adas/src/main/java/com/zhidao/support/adas/high/common/MessageType.java
This commit is contained in:
@@ -129,6 +129,14 @@ public class AutoPilotModeDialog extends Dialog {
|
||||
getContext().startActivity(new Intent(getContext(), AutopilotConfigActivity.class));
|
||||
}
|
||||
});
|
||||
findViewById(R.id.cancel).setOnClickListener(new View.OnClickListener() {
|
||||
@Override
|
||||
public void onClick(View v) {
|
||||
MessagePad.RouteInfo.Builder builder = MessagePad.RouteInfo.newBuilder();
|
||||
AdasManager.getInstance().sendAutoPilotModeReq(0, 0, builder.build());
|
||||
AutoPilotModeDialog.this.dismiss();
|
||||
}
|
||||
});
|
||||
}
|
||||
|
||||
|
||||
|
||||
@@ -42,6 +42,7 @@ import androidx.recyclerview.widget.LinearLayoutManager;
|
||||
import androidx.recyclerview.widget.RecyclerView;
|
||||
import androidx.recyclerview.widget.SimpleItemAnimator;
|
||||
|
||||
import com.google.protobuf.TextFormat;
|
||||
import com.mogo.telematic.MogoProtocolMsg;
|
||||
import com.mogo.telematic.NSDNettyManager;
|
||||
import com.mogo.telematic.client.listener.NettyClientListener;
|
||||
@@ -87,6 +88,7 @@ import com.zhidao.support.adas.high.OnAdasConnectStatusListener;
|
||||
import com.zhidao.support.adas.high.OnAdasListener;
|
||||
import com.zhidao.support.adas.high.OnMultiDeviceListener;
|
||||
import com.zhidao.support.adas.high.bean.AutopilotAbility;
|
||||
import com.zhidao.support.adas.high.bean.AutopilotStatistics;
|
||||
import com.zhidao.support.adas.high.bean.VersionCompatibility;
|
||||
import com.zhidao.support.adas.high.common.ByteUtil;
|
||||
import com.zhidao.support.adas.high.common.Constants.IPC_CONNECTION_STATUS;
|
||||
@@ -103,6 +105,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;
|
||||
@@ -414,7 +417,7 @@ public class MainActivity extends BaseActivity implements OnAdasListener, OnAdas
|
||||
|
||||
//初始化fragment
|
||||
manager = getSupportFragmentManager();
|
||||
|
||||
cb_print.setChecked(CupidLogUtils.isEnableLog());
|
||||
cb_print.setOnCheckedChangeListener(new CompoundButton.OnCheckedChangeListener() {
|
||||
@Override
|
||||
public void onCheckedChanged(CompoundButton buttonView, boolean isChecked) {
|
||||
@@ -660,6 +663,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() {
|
||||
@@ -846,13 +854,23 @@ public class MainActivity extends BaseActivity implements OnAdasListener, OnAdas
|
||||
for (SystemStatusInfo.HealthInfo healthInfo : ability.statusInfo.getHealthInfoList()) {
|
||||
if (healthInfo.getState() == SystemStatusInfo.HealthState.FAULT) {
|
||||
isAutopilotAbility = false;
|
||||
autopilotAbilityReason = healthInfo.getName() + " Topic异常";
|
||||
autopilotAbilityReason = healthInfo.getName() + " 节点异常";
|
||||
break;
|
||||
}
|
||||
}
|
||||
Log.i(TAG, "是否可以启动自动驾驶=" + isAutopilotAbility + " 原因=" + autopilotAbilityReason);
|
||||
}
|
||||
|
||||
@Override
|
||||
public void onStartAutopilotFailed(MogoReportMsg.MogoReportMessage message) {
|
||||
|
||||
}
|
||||
|
||||
@Override
|
||||
public void onAutopilotStatistics(AutopilotStatistics statistics) {
|
||||
Log.i(TAG, "启动自动驾驶状态=" + statistics.status + " 用时=" + statistics.usedTime + " SetAutopilotModeReq=" + TextFormat.printer().escapingNonAscii(false).printToString(statistics.req) + " failedMessage=" + (statistics.failedMessage == null ? null : TextFormat.printer().escapingNonAscii(false).printToString(statistics.failedMessage)));
|
||||
}
|
||||
|
||||
@Override
|
||||
public void onTrajectory(MessagePad.Header header, MessagePad.Trajectory trajectory) {
|
||||
Trajectory base = new Trajectory(header, trajectory, sdf);
|
||||
@@ -1200,7 +1218,7 @@ public class MainActivity extends BaseActivity implements OnAdasListener, OnAdas
|
||||
msg = "未连接司机端";
|
||||
}
|
||||
showToastCenter(msg);
|
||||
return;
|
||||
// return;
|
||||
}
|
||||
switch (data) {
|
||||
case Constants.TITLE.SEND_SET_AUTOPILOT_MODE_REQ:
|
||||
@@ -1370,12 +1388,104 @@ 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, "x10", "x11", "x12", false);
|
||||
AdasManager.getInstance().sendTripInfoReq(2, "x13", "x14", "x15", true);
|
||||
AdasManager.getInstance().sendTripInfoReq(3, "x16", "x17", "x18", false);
|
||||
AdasManager.getInstance().sendTripInfoReq(4, "x19", "x20", "x21", true);
|
||||
AdasManager.getInstance().sendTripInfoReq(5, "x22", "x23", "x24", 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) {
|
||||
|
||||
@@ -188,6 +188,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 = "行程信息";
|
||||
|
||||
|
||||
}
|
||||
|
||||
@@ -4,7 +4,20 @@
|
||||
android:layout_width="match_parent"
|
||||
android:layout_height="wrap_content"
|
||||
android:background="@drawable/bg_adas_dialog">
|
||||
|
||||
<androidx.appcompat.widget.AppCompatButton
|
||||
android:id="@+id/cancel"
|
||||
android:layout_width="wrap_content"
|
||||
android:layout_height="wrap_content"
|
||||
android:layout_marginEnd="15dp"
|
||||
android:layout_toEndOf="@+id/title"
|
||||
android:background="@drawable/btn_bg"
|
||||
android:text="取消"
|
||||
android:textColor="@color/colorWhile"
|
||||
android:textSize="16dp"
|
||||
android:textStyle="bold"
|
||||
app:layout_constraintBottom_toBottomOf="@+id/title"
|
||||
app:layout_constraintEnd_toStartOf="@+id/title"
|
||||
app:layout_constraintTop_toTopOf="@+id/title" />
|
||||
<TextView
|
||||
android:id="@+id/title"
|
||||
android:layout_width="wrap_content"
|
||||
|
||||
@@ -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>
|
||||
Reference in New Issue
Block a user