Merge remote-tracking branch 'origin/dev_robobus-m1-p-app-module_1.1.0_230112_1.1.0' into dev_robobus-m1-p-app-module_1.1.0_230112_1.1.0
This commit is contained in:
@@ -1,5 +1,7 @@
|
||||
<?xml version="1.0" encoding="utf-8"?>
|
||||
<manifest xmlns:android="http://schemas.android.com/apk/res/android"
|
||||
package="com.mogo.och.bus.passenger">
|
||||
<uses-permission android:name="android.permission.MOUNT_UNMOUNT_FILESYSTEMS"/>
|
||||
<uses-permission android:name="android.permission.WRITE_EXTERNAL_STORAGE"/>
|
||||
|
||||
</manifest>
|
||||
@@ -1,9 +1,5 @@
|
||||
package com.mogo.och.bus.passenger.constant
|
||||
|
||||
import com.mogo.commons.debug.DebugConfig
|
||||
import com.mogo.eagle.core.data.config.FunctionBuildConfig
|
||||
import com.mogo.eagle.core.utilcode.mogo.AppIdentityModeUtils
|
||||
|
||||
/**
|
||||
* Created on 2021/12/6
|
||||
*/
|
||||
|
||||
@@ -101,7 +101,7 @@ class PM2DrivingModel private constructor() {
|
||||
|
||||
// 定位监听
|
||||
CallerChassisLocationGCJ02ListenerManager.addListener(TAG, mMapLocationListener)
|
||||
CallerChassisLocationGCJ02ListenerManager.setListenerHz(TAG,2)//设置2hz, 1s返回2次
|
||||
// CallerChassisLocationGCJ02ListenerManager.setListenerHz(TAG,2)//设置2hz, 1s返回2次
|
||||
|
||||
//司乘屏通信监听
|
||||
CallerTelematicListenerManager.addListener(TAG,mReceivedMsgListener)
|
||||
|
||||
@@ -84,11 +84,13 @@ class AdvanceGSYVideoPlayer: StandardGSYVideoPlayer {
|
||||
//失去焦点声音压低
|
||||
override fun onLossTransientCanDuck() {
|
||||
// setStreamVolume(0.2f)
|
||||
setNeedMute(true)
|
||||
}
|
||||
|
||||
//获取焦点声音恢复
|
||||
override fun onGankAudio() {
|
||||
// setStreamVolume(5.0f)
|
||||
setNeedMute(false)
|
||||
}
|
||||
|
||||
private fun setStreamVolume(percent: Float){
|
||||
@@ -100,4 +102,8 @@ class AdvanceGSYVideoPlayer: StandardGSYVideoPlayer {
|
||||
}
|
||||
mAudioManager.setStreamVolume(AudioManager.STREAM_MUSIC,volume,0)
|
||||
}
|
||||
|
||||
private fun setNeedMute(isMute: Boolean){
|
||||
gsyVideoManager?.player?.setNeedMute(isMute)
|
||||
}
|
||||
}
|
||||
@@ -2,24 +2,23 @@ package com.mogo.och.bus.passenger.ui.widget.video
|
||||
|
||||
import android.annotation.SuppressLint
|
||||
import android.content.Context
|
||||
import android.os.Environment
|
||||
import android.util.AttributeSet
|
||||
import android.widget.ImageView
|
||||
import android.widget.RelativeLayout
|
||||
import com.alibaba.idst.nui.FileUtil
|
||||
import com.bumptech.glide.Glide
|
||||
import com.bumptech.glide.request.RequestOptions
|
||||
import com.mogo.eagle.core.utilcode.breakpoint.Config
|
||||
import com.mogo.eagle.core.utilcode.breakpoint.bean.ThreadBean
|
||||
import com.mogo.eagle.core.utilcode.breakpoint.callback.IDownload
|
||||
import com.mogo.eagle.core.utilcode.breakpoint.utils.DownloadUtils
|
||||
import com.mogo.eagle.core.utilcode.mogo.logger.Logger
|
||||
import com.mogo.eagle.core.utilcode.util.BitmapHelper
|
||||
import com.mogo.eagle.core.utilcode.util.FileUtils
|
||||
import com.mogo.eagle.core.utilcode.util.ThreadPoolService
|
||||
import com.mogo.eagle.core.utilcode.util.ThreadUtils
|
||||
import com.mogo.och.bus.passenger.R
|
||||
import com.mogo.och.common.module.utils.OCHThreadPoolManager
|
||||
import com.shuyu.gsyvideoplayer.builder.GSYVideoOptionBuilder
|
||||
import com.shuyu.gsyvideoplayer.listener.GSYSampleCallBack
|
||||
import java.io.File
|
||||
import java.io.FilenameFilter
|
||||
import java.lang.Exception
|
||||
|
||||
/**
|
||||
@@ -38,8 +37,10 @@ class AdvanceVideoView @JvmOverloads constructor(
|
||||
private var downloadVideoName = ""
|
||||
private var fileNetPath: String? = ""
|
||||
private var cacheImageUrl: String? = ""
|
||||
private var mVideoDirPath: String? = ""
|
||||
|
||||
init {
|
||||
mVideoDirPath = context.getExternalFilesDir(Environment.DIRECTORY_DOWNLOADS)?.absolutePath + File.separator
|
||||
initView()
|
||||
}
|
||||
|
||||
@@ -110,8 +111,12 @@ class AdvanceVideoView @JvmOverloads constructor(
|
||||
|
||||
fun clearLocalErrorVideo(){
|
||||
if (downloadVideoName.isNotEmpty()
|
||||
&& FileUtils.isFileExists(Config.downLoadPath + downloadVideoName)){
|
||||
FileUtils.delete(Config.downLoadPath + downloadVideoName)
|
||||
&& FileUtil.isFileExist(mVideoDirPath + downloadVideoName)){
|
||||
FileUtil.delete(mVideoDirPath + downloadVideoName,object: FilenameFilter{
|
||||
override fun accept(dir: File?, name: String?): Boolean {
|
||||
return true
|
||||
}
|
||||
})
|
||||
}
|
||||
}
|
||||
|
||||
@@ -131,7 +136,11 @@ class AdvanceVideoView @JvmOverloads constructor(
|
||||
mOnCompletionListener = onCompletionListener
|
||||
//判断是否已经下载
|
||||
if (downloadVideoName.isNotEmpty()){
|
||||
if (FileUtils.isFileExists(Config.downLoadPath + downloadVideoName)){
|
||||
Logger.d(ImageAndVideoRotation.TAG,
|
||||
"video local url = $mVideoDirPath$downloadVideoName"
|
||||
)
|
||||
var file = File(mVideoDirPath,downloadVideoName)
|
||||
if (file.exists()){
|
||||
Logger.d(ImageAndVideoRotation.TAG, "have cache startPlay")
|
||||
startPlay()
|
||||
return
|
||||
@@ -143,7 +152,7 @@ class AdvanceVideoView @JvmOverloads constructor(
|
||||
private fun startDownLoadVideo(){
|
||||
//下载视频, 下载成功后再播放
|
||||
Logger.d(ImageAndVideoRotation.TAG, "startDownLoadVideo")
|
||||
DownloadUtils.downLoad(context,fileNetPath, Config.downLoadPath
|
||||
DownloadUtils.downLoad(context,fileNetPath,mVideoDirPath
|
||||
,downloadVideoName,5,downListener)
|
||||
}
|
||||
|
||||
@@ -151,7 +160,7 @@ class AdvanceVideoView @JvmOverloads constructor(
|
||||
try {
|
||||
Logger.d(ImageAndVideoRotation.TAG, "startPlay")
|
||||
gsyVideoOptionBuilder = GSYVideoOptionBuilder()
|
||||
gsyVideoOptionBuilder?.setUrl("file:///mnt/sdcard/downloads/$downloadVideoName")
|
||||
gsyVideoOptionBuilder?.setUrl("file://$mVideoDirPath$downloadVideoName") // "/data/user/0/com.mogo.launcher.f/files/downloads/"
|
||||
?.setPlayTag(downloadVideoName)
|
||||
?.setCacheWithPlay(false)
|
||||
?.setThumbPlay(false)
|
||||
@@ -192,7 +201,7 @@ class AdvanceVideoView @JvmOverloads constructor(
|
||||
}
|
||||
|
||||
override fun onProgress(url: String?, length: Int) {
|
||||
// Logger.d(ImageAndVideoRotation.TAG, "download-onProgress")
|
||||
Logger.d(ImageAndVideoRotation.TAG, "download-onProgress== $length")
|
||||
}
|
||||
|
||||
override fun onFinished(url: String?, threadBean: ThreadBean?) {
|
||||
|
||||
@@ -119,7 +119,7 @@
|
||||
app:layout_constraintLeft_toLeftOf="@+id/speed_tv"
|
||||
android:textColor="@color/m2_line_during_tv_color"/>
|
||||
|
||||
<com.mogo.och.common.module.wigets.MarqueeTextView
|
||||
<com.mogo.och.common.module.wigets.MoreFocusMarqueeTextView
|
||||
android:id="@+id/station_name_tv"
|
||||
android:layout_width="0dp"
|
||||
android:layout_height="wrap_content"
|
||||
@@ -164,7 +164,7 @@
|
||||
app:layout_constraintStart_toStartOf="@+id/speed_tv"
|
||||
app:layout_constraintEnd_toEndOf="@+id/img_line_location_bg"/>
|
||||
|
||||
<androidx.appcompat.widget.AppCompatTextView
|
||||
<TextView
|
||||
android:id="@+id/no_line_tv"
|
||||
android:layout_width="wrap_content"
|
||||
android:layout_height="wrap_content"
|
||||
@@ -176,7 +176,8 @@
|
||||
app:layout_constraintLeft_toLeftOf="@+id/speed_tv"
|
||||
android:textColor="@color/m2_no_line_tv_color"/>
|
||||
|
||||
<com.mogo.och.common.module.wigets.MarqueeTextView
|
||||
|
||||
<com.mogo.och.common.module.wigets.MoreFocusMarqueeTextView
|
||||
android:id="@+id/line_name_tv"
|
||||
android:layout_width="0dp"
|
||||
android:layout_height="wrap_content"
|
||||
|
||||
@@ -156,7 +156,7 @@ public class OrderModel {
|
||||
loginService = (LoginService) ARouter.getInstance().build(OchCommonConst.LOGINSERVICE).navigation();
|
||||
// 定位监听
|
||||
CallerChassisLocationGCJ02ListenerManager.INSTANCE.addListener(TAG, mMapLocationListener);
|
||||
CallerChassisLocationGCJ02ListenerManager.INSTANCE.setListenerHz(TAG,5);//设置5hz, 1s返回一次
|
||||
// CallerChassisLocationGCJ02ListenerManager.INSTANCE.setListenerHz(TAG,2);//设置5hz, 1s返回一次
|
||||
|
||||
MogoStatusManager.getInstance().registerStatusChangedListener(TAG, StatusDescriptor.VR_MODE, mMogoStatusChangedListener);
|
||||
|
||||
|
||||
@@ -75,7 +75,11 @@ class DriverM1Fragment : CharterBaseFragment<DriverM1Fragment?, DriverM1Presente
|
||||
}
|
||||
|
||||
fun updateCountDown(minutes: Long) {
|
||||
startCountDownTimer(minutes,LOOP_PERIOD_60S)
|
||||
if (minutes + LOOP_PERIOD_60S >= 0){
|
||||
startCountDownTimer(minutes + LOOP_PERIOD_60S,LOOP_PERIOD_60S)
|
||||
}else{
|
||||
clearCountDownTimer()
|
||||
}
|
||||
}
|
||||
|
||||
override fun onDestroyView() {
|
||||
@@ -165,10 +169,7 @@ class DriverM1Fragment : CharterBaseFragment<DriverM1Fragment?, DriverM1Presente
|
||||
|
||||
|
||||
private fun startCountDownTimer(total: Long, countDownInterval:Long){
|
||||
if (countDownTimer != null){
|
||||
countDownTimer?.cancel()
|
||||
countDownTimer = null
|
||||
}
|
||||
clearCountDownTimer()
|
||||
countDownTimer = object : CountDownTimer(total,countDownInterval){
|
||||
override fun onTick(millisUntilFinished: Long) {
|
||||
var minute = millisUntilFinished/1000/60
|
||||
@@ -189,4 +190,11 @@ class DriverM1Fragment : CharterBaseFragment<DriverM1Fragment?, DriverM1Presente
|
||||
|
||||
}.start()
|
||||
}
|
||||
|
||||
private fun clearCountDownTimer() {
|
||||
if (countDownTimer != null){
|
||||
countDownTimer?.cancel()
|
||||
countDownTimer = null
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -107,7 +107,7 @@ class DriverM1Model {
|
||||
mContext = context
|
||||
// 定位监听
|
||||
CallerChassisLocationGCJ02ListenerManager.addListener(TAG, mMapLocationListener)
|
||||
CallerChassisLocationGCJ02ListenerManager.setListenerHz(TAG,2)
|
||||
// CallerChassisLocationGCJ02ListenerManager.setListenerHz(TAG,2)
|
||||
|
||||
//开启自驾后 异常信息返回
|
||||
OCHAdasAbilityManager.getInstance().setAdasStartFailureCallback(mAdasStartFailureListener)
|
||||
@@ -655,9 +655,7 @@ class DriverM1Model {
|
||||
}
|
||||
d(SceneConstant.M_CHARTER_D,"checkOrderCountDown = "+ GsonUtils.toJson(data.data))
|
||||
val gap = data.data.endTime - data.data.currentTime
|
||||
if (gap >= 0){
|
||||
mOrderCallback?.updateOverCountDown(gap)
|
||||
}
|
||||
mOrderCallback?.updateOverCountDown(gap)
|
||||
}
|
||||
|
||||
override fun onFail(code: Int, msg: String?) {
|
||||
|
||||
@@ -0,0 +1,58 @@
|
||||
package com.mogo.och.common.module.wigets;
|
||||
|
||||
import android.content.Context;
|
||||
import android.graphics.Rect;
|
||||
import android.text.TextUtils;
|
||||
import android.util.AttributeSet;
|
||||
import android.view.ViewDebug;
|
||||
|
||||
|
||||
public class MoreFocusMarqueeTextView extends androidx.appcompat.widget.AppCompatTextView{
|
||||
|
||||
public MoreFocusMarqueeTextView(Context context) {
|
||||
this(context, null);
|
||||
}
|
||||
|
||||
public MoreFocusMarqueeTextView(Context context, AttributeSet attrs) {
|
||||
this(context, attrs, 0);
|
||||
}
|
||||
|
||||
public MoreFocusMarqueeTextView(Context context, AttributeSet attrs, int defStyle) {
|
||||
super(context, attrs, defStyle);
|
||||
|
||||
//设置文字内容超过textView宽度时候以跑马灯的形式
|
||||
setEllipsize(TextUtils.TruncateAt.MARQUEE);
|
||||
//设置焦点
|
||||
setFocusable(true);
|
||||
//设置触摸模式下是否可以获得焦点
|
||||
setFocusableInTouchMode(true);
|
||||
//设置跑马灯循环次数 -1为always 无限循环 3就是3次 4就是4次 0没试过
|
||||
setMarqueeRepeatLimit(-1);
|
||||
}
|
||||
|
||||
@Override
|
||||
@ViewDebug.ExportedProperty(category = "focus")
|
||||
public boolean isFocused() {
|
||||
return true;
|
||||
}
|
||||
|
||||
@Override
|
||||
protected void onFocusChanged(boolean focused, int direction, Rect previouslyFocusedRect) {
|
||||
if (focused)
|
||||
super.onFocusChanged(true, direction, previouslyFocusedRect);
|
||||
|
||||
}
|
||||
|
||||
@Override
|
||||
public void onWindowFocusChanged(boolean hasWindowFocus) {
|
||||
if (hasWindowFocus){}
|
||||
super.onWindowFocusChanged(true);
|
||||
}
|
||||
|
||||
@Override
|
||||
@ViewDebug.ExportedProperty
|
||||
public boolean isSelected() {
|
||||
return true;
|
||||
}
|
||||
|
||||
}
|
||||
@@ -117,8 +117,8 @@ public class TaxiPassengerModel implements IOCHTaxiPassengerNaviChangedCallback
|
||||
private IOCHTaxiPassengerADASStatusCallback mADASStatusCallback; //Model->Presenter:自动驾驶状态相关
|
||||
private IOCHTaxiPassengerAutopilotPlanningCallback mAutopilotPlanningCallback; //Model->Presenter:自动驾驶线路规划
|
||||
|
||||
private Map<String,IOCHTaxiPassengerOrderStatusCallback> mOrderStatusCallbackMap = new ConcurrentHashMap<>();
|
||||
private Map<String,IOCHTaxiPassengerControllerStatusCallback> mControllerStatusCallbackMap = new ConcurrentHashMap<>();
|
||||
private final Map<String,IOCHTaxiPassengerOrderStatusCallback> mOrderStatusCallbackMap = new ConcurrentHashMap<>();
|
||||
private final Map<String,IOCHTaxiPassengerControllerStatusCallback> mControllerStatusCallbackMap = new ConcurrentHashMap<>();
|
||||
|
||||
private ITaxiPassengerVeloctityCallback mVeloctityCallback;//道路限速返回
|
||||
|
||||
@@ -130,7 +130,7 @@ public class TaxiPassengerModel implements IOCHTaxiPassengerNaviChangedCallback
|
||||
private double mLongitude, mLatitude;
|
||||
private MogoLocation mLocation = null;
|
||||
|
||||
private List<MogoLocation> mLocationsModels = new ArrayList<>();
|
||||
private final List<MogoLocation> mLocationsModels = new ArrayList<>();
|
||||
|
||||
private TaxiPassengerModel() {
|
||||
}
|
||||
@@ -517,7 +517,6 @@ public class TaxiPassengerModel implements IOCHTaxiPassengerNaviChangedCallback
|
||||
|
||||
@Override
|
||||
public void onAutopilotStatusResponse(@NotNull AutopilotStatusInfo autopilotStatusInfo) {
|
||||
if (autopilotStatusInfo == null) return;
|
||||
int state = autopilotStatusInfo.getState();
|
||||
// CallerLogger.INSTANCE.d( M_TAXI_P + TAG, "state = %s", state );
|
||||
if (state == IMoGoAutopilotStatusListener.STATUS_AUTOPILOT_RUNNING) {
|
||||
|
||||
@@ -149,6 +149,7 @@ android {
|
||||
packagingOptions {
|
||||
exclude 'META-INF/proguard/coroutines.pro'
|
||||
exclude 'META-INF/*'
|
||||
exclude "/lib/armeabi-v7a/*.so"
|
||||
}
|
||||
|
||||
signingConfigs {
|
||||
|
||||
@@ -130,6 +130,7 @@ dependencies {
|
||||
androidTestImplementation 'androidx.test.ext:junit:1.1.3'
|
||||
androidTestImplementation 'androidx.test.espresso:espresso-core:3.4.0'
|
||||
implementation rootProject.ext.dependencies.gson
|
||||
implementation 'com.github.bumptech.glide:glide:4.11.0'
|
||||
implementation project(':libraries:mogo-adas')
|
||||
implementation project(':libraries:mogo-adas-data')
|
||||
implementation project(':libraries:mogo-obu')
|
||||
|
||||
@@ -9,7 +9,6 @@ import com.zhidao.adas.client.bean.ObuMap;
|
||||
import com.zhidao.adas.client.bean.ObuRsi;
|
||||
import com.zhidao.adas.client.bean.ObuRsm;
|
||||
import com.zhidao.adas.client.bean.ObuSpat;
|
||||
import com.zhidao.adas.client.bean.OriginalPointCloudData;
|
||||
import com.zhidao.adas.client.bean.PerceptionTrafficLight;
|
||||
import com.zhidao.adas.client.log.LogSave;
|
||||
import com.zhidao.adas.client.utils.Constants;
|
||||
@@ -109,6 +108,7 @@ public class DataDistribution {
|
||||
public final List<DataShow> listPlanningDecisionState = new ArrayList<>();
|
||||
public final List<DataShow> listChassisStates = new ArrayList<>();
|
||||
public final List<DataShow> listFSMFunctionStates = new ArrayList<>();
|
||||
public final List<DataShow> listBackCameraVideo = new ArrayList<>();
|
||||
public final List<DataShow> listRoboSweeperTaskIndex = new ArrayList<>();
|
||||
public final List<DataShow> listBagManagerCmd = new ArrayList<>();
|
||||
public final List<DataShow> listObuSpat = new ArrayList<>();
|
||||
@@ -136,6 +136,7 @@ public class DataDistribution {
|
||||
private long listPlanningDecisionStateSize = 0;
|
||||
private long listChassisStatesSize = 0;
|
||||
private long listFSMFunctionStatesSize = 0;
|
||||
private long listBackCameraVideoSize = 0;
|
||||
private long listRoboSweeperTaskIndexSize = 0;
|
||||
private long listBagManagerCmdSize = 0;
|
||||
private long listObuSpatSize = 0;
|
||||
@@ -165,6 +166,7 @@ public class DataDistribution {
|
||||
listPlanningDecisionStateSize = 1;
|
||||
listChassisStatesSize = 1;
|
||||
listFSMFunctionStatesSize = 1;
|
||||
listBackCameraVideoSize = 1;
|
||||
listRoboSweeperTaskIndexSize = 1;
|
||||
listBagManagerCmdSize = 1;
|
||||
listObuSpatSize = 1;
|
||||
@@ -192,14 +194,6 @@ public class DataDistribution {
|
||||
if (listener != null && Constants.TITLE.RECEIVE_ERROR.equals(listener.first)) {
|
||||
listener.second.onRefresh();
|
||||
}
|
||||
} else if (data instanceof OriginalPointCloudData) {
|
||||
listOriginalPointCloud.add(0, new DataShow(listOriginalPointCloudSize++, time + str));
|
||||
if (listOriginalPointCloud.size() > LIST_SIZE) {
|
||||
listOriginalPointCloud.remove(listOriginalPointCloud.size() - 1);
|
||||
}
|
||||
if (listener != null && Constants.TITLE.RECEIVE_POINT_CLOUD_ORIGINAL.equals(listener.first)) {
|
||||
listener.second.onRefresh();
|
||||
}
|
||||
}
|
||||
} else {
|
||||
MessagePad.MessageType messageType = data.header.getMsgType();
|
||||
@@ -359,6 +353,22 @@ public class DataDistribution {
|
||||
if (listener != null && Constants.TITLE.RECEIVE_FUNCTION_STATES.equals(listener.first)) {
|
||||
listener.second.onRefresh();
|
||||
}
|
||||
} else if (messageType == MessagePad.MessageType.MsgTypePointCloud) {
|
||||
listOriginalPointCloud.add(0, new DataShow(listOriginalPointCloudSize++, time + str));
|
||||
if (listOriginalPointCloud.size() > LIST_SIZE) {
|
||||
listOriginalPointCloud.remove(listOriginalPointCloud.size() - 1);
|
||||
}
|
||||
if (listener != null && Constants.TITLE.RECEIVE_POINT_CLOUD_ORIGINAL.equals(listener.first)) {
|
||||
listener.second.onRefresh();
|
||||
}
|
||||
} else if (messageType == MessagePad.MessageType.MsgTypeBackCameraVideo) {
|
||||
listBackCameraVideo.add(0, new DataShow(listBackCameraVideoSize++, time + str));
|
||||
if (listBackCameraVideo.size() > LIST_SIZE) {
|
||||
listBackCameraVideo.remove(listBackCameraVideo.size() - 1);
|
||||
}
|
||||
if (listener != null && Constants.TITLE.RECEIVE_BACK_CAMERA_VIDEO.equals(listener.first)) {
|
||||
listener.second.onRefresh();
|
||||
}
|
||||
} else if (data instanceof PerceptionTrafficLight) {
|
||||
listPerceptionTrafficLight.add(0, new DataShow(listPerceptionTrafficLightSize++, time + str));
|
||||
if (listPerceptionTrafficLight.size() > LIST_SIZE) {
|
||||
|
||||
@@ -18,7 +18,11 @@ public abstract class BaseInfo {
|
||||
this.action = action;
|
||||
this.payloadLen = len;
|
||||
nowTime = System.currentTimeMillis();
|
||||
this.len = 8 + header.getSerializedSize() + len;
|
||||
int headerSize = 0;
|
||||
if (header != null) {
|
||||
headerSize = header.getSerializedSize();
|
||||
}
|
||||
this.len = 8 + headerSize + len;
|
||||
this.header = header;
|
||||
this.sdf = sdf;
|
||||
}
|
||||
@@ -33,8 +37,12 @@ public abstract class BaseInfo {
|
||||
|
||||
@Override
|
||||
public String toString() {
|
||||
return "原始数据长度:" + len + "\tPayload数据长度:" + payloadLen + "\nHeader:[" + "MessageID:" + header.getMsgID() +
|
||||
" MessageType:" + header.getMsgType() + " 发送时间:" + sdf.format(new Date((long) (header.getTimestamp() * 1000)))
|
||||
+ " 数据源时间:" + sdf.format(new Date((long) (header.getSourceTimestamp() * 1000))) + "]\n";
|
||||
String str = "原始数据长度:" + len + "\tPayload数据长度:" + payloadLen + '\n';
|
||||
if (header != null) {
|
||||
str += "Header:[" + "MessageID:" + header.getMsgID() +
|
||||
" MessageType:" + header.getMsgType() + " 发送时间:" + sdf.format(new Date((long) (header.getTimestamp() * 1000)))
|
||||
+ " 数据源时间:" + sdf.format(new Date((long) (header.getSourceTimestamp() * 1000))) + "]\n";
|
||||
}
|
||||
return str;
|
||||
}
|
||||
}
|
||||
|
||||
@@ -15,6 +15,6 @@ public class ErrorData extends BaseInfo {
|
||||
|
||||
@Override
|
||||
public String toString() {
|
||||
return status + "\n原始数据:" + ByteUtil.byteArrToHex(bytes);
|
||||
return super.toString() + status + "\n原始数据:" + ByteUtil.byteArrToHex(bytes);
|
||||
}
|
||||
}
|
||||
|
||||
@@ -1,24 +0,0 @@
|
||||
package com.zhidao.adas.client.bean;
|
||||
|
||||
import com.google.protobuf.TextFormat;
|
||||
|
||||
import java.text.SimpleDateFormat;
|
||||
|
||||
import mogo.telematics.pad.MessagePad;
|
||||
import rule_segement.MogoPointCloudOuterClass;
|
||||
|
||||
public class MyPointCloud extends BaseInfo {
|
||||
public final MogoPointCloudOuterClass.MogoPointCloud bean;
|
||||
|
||||
public MyPointCloud(MessagePad.Header header, MogoPointCloudOuterClass.MogoPointCloud bean, SimpleDateFormat sdf) {
|
||||
super("接收", bean.getSerializedSize(), header, sdf);
|
||||
this.bean = bean;
|
||||
}
|
||||
|
||||
|
||||
@Override
|
||||
public String toString() {
|
||||
return super.toString() + TextFormat.printer().escapingNonAscii(false).printToString(bean);
|
||||
}
|
||||
|
||||
}
|
||||
@@ -1,17 +0,0 @@
|
||||
package com.zhidao.adas.client.bean;
|
||||
|
||||
import com.zhidao.support.adas.high.common.ByteUtil;
|
||||
|
||||
public class OriginalPointCloudData extends BaseInfo {
|
||||
private final byte[] pointCloud;
|
||||
|
||||
public OriginalPointCloudData(byte[] pointCloud) {
|
||||
super("接收", pointCloud.length);
|
||||
this.pointCloud = pointCloud;
|
||||
}
|
||||
|
||||
@Override
|
||||
public String toString() {
|
||||
return "\n" + ByteUtil.byteArrToHex(pointCloud);
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,23 @@
|
||||
package com.zhidao.adas.client.bean;
|
||||
|
||||
import com.zhidao.support.adas.high.common.ByteUtil;
|
||||
|
||||
import java.text.SimpleDateFormat;
|
||||
|
||||
import mogo.telematics.pad.MessagePad;
|
||||
|
||||
public class ReceiveBytesData extends BaseInfo {
|
||||
public final byte[] data;
|
||||
|
||||
public ReceiveBytesData(MessagePad.Header header, byte[] data, SimpleDateFormat sdf) {
|
||||
super("接收", data.length, header, sdf);
|
||||
this.data = data;
|
||||
}
|
||||
|
||||
|
||||
@Override
|
||||
public String toString() {
|
||||
return super.toString() + "Payload原始数据:" + ByteUtil.byteArrToHex(data);
|
||||
}
|
||||
|
||||
}
|
||||
@@ -0,0 +1,201 @@
|
||||
package com.zhidao.adas.client.ui;
|
||||
|
||||
import android.app.Activity;
|
||||
import android.graphics.PixelFormat;
|
||||
import android.os.Handler;
|
||||
import android.os.Message;
|
||||
import android.util.DisplayMetrics;
|
||||
import android.view.Gravity;
|
||||
import android.view.LayoutInflater;
|
||||
import android.view.MotionEvent;
|
||||
import android.view.View;
|
||||
import android.view.WindowManager;
|
||||
import android.widget.ImageView;
|
||||
|
||||
import com.zhidao.adas.client.R;
|
||||
import com.zhidao.adas.client.utils.SysBarUtil;
|
||||
import com.zhidao.adas.client.utils.image.ImageLoaderManager;
|
||||
|
||||
import java.lang.ref.WeakReference;
|
||||
|
||||
/**
|
||||
* 摄像头数据展示
|
||||
*
|
||||
* @author xuxinchao
|
||||
* @description
|
||||
* @since: 2022/4/20
|
||||
*/
|
||||
public class BackCameraFloatWindow implements View.OnTouchListener {
|
||||
|
||||
private final Activity mContext;
|
||||
private WindowManager.LayoutParams mWindowParams;
|
||||
private WindowManager mWindowManager;
|
||||
|
||||
private View mFloatLayout;
|
||||
private float mInViewX;
|
||||
private float mInViewY;
|
||||
private float mDownInScreenX;
|
||||
private float mDownInScreenY;
|
||||
private float mInScreenX;
|
||||
private float mInScreenY;
|
||||
private ImageView image_view;
|
||||
|
||||
public BackCameraFloatWindow(Activity context) {
|
||||
this.mContext = context;
|
||||
initHandler();
|
||||
initFloatWindow();
|
||||
}
|
||||
|
||||
|
||||
private void initFloatWindow() {
|
||||
LayoutInflater inflater = LayoutInflater.from(mContext);
|
||||
if (inflater == null)
|
||||
return;
|
||||
mFloatLayout = (View) inflater.inflate(R.layout.layout_back_camera, null);
|
||||
image_view = mFloatLayout.findViewById(R.id.image_view);
|
||||
mFloatLayout.setOnTouchListener(this);
|
||||
mWindowParams = new WindowManager.LayoutParams();
|
||||
// mWindowManager = (WindowManager) mContext.getSystemService(Context.WINDOW_SERVICE);
|
||||
// if (Build.VERSION.SDK_INT >= 26) {//8.0新特性
|
||||
// mWindowParams.type = WindowManager.LayoutParams.TYPE_APPLICATION_OVERLAY;
|
||||
// }else{
|
||||
// mWindowParams.type = WindowManager.LayoutParams.TYPE_SYSTEM_ALERT;
|
||||
// }
|
||||
|
||||
mWindowManager = mContext.getWindowManager();
|
||||
|
||||
mWindowParams.format = PixelFormat.RGBA_8888;
|
||||
mWindowParams.flags = WindowManager.LayoutParams.FLAG_NOT_FOCUSABLE;
|
||||
mWindowParams.gravity = Gravity.START | Gravity.TOP;
|
||||
// mWindowParams.width = WindowManager.LayoutParams.WRAP_CONTENT;
|
||||
// mWindowParams.height = WindowManager.LayoutParams.WRAP_CONTENT;
|
||||
mWindowParams.width = 1280;
|
||||
mWindowParams.height = 720;
|
||||
// mWindowParams.alpha = 0.9F;
|
||||
}
|
||||
|
||||
@Override
|
||||
public boolean onTouch(View view, MotionEvent motionEvent) {
|
||||
return floatLayoutTouch(motionEvent);
|
||||
}
|
||||
|
||||
private boolean floatLayoutTouch(MotionEvent motionEvent) {
|
||||
switch (motionEvent.getAction()) {
|
||||
case MotionEvent.ACTION_DOWN:
|
||||
// 获取相对View的坐标,即以此View左上角为原点
|
||||
mInViewX = motionEvent.getX();
|
||||
mInViewY = motionEvent.getY();
|
||||
// 获取相对屏幕的坐标,即以屏幕左上角为原点
|
||||
mDownInScreenX = motionEvent.getRawX();
|
||||
mDownInScreenY = motionEvent.getRawY() - SysBarUtil.getSysBarHeight(mContext);
|
||||
mInScreenX = motionEvent.getRawX();
|
||||
mInScreenY = motionEvent.getRawY() - SysBarUtil.getSysBarHeight(mContext);
|
||||
break;
|
||||
case MotionEvent.ACTION_MOVE:
|
||||
// 更新浮动窗口位置参数
|
||||
mInScreenX = motionEvent.getRawX();
|
||||
mInScreenY = motionEvent.getRawY() - SysBarUtil.getSysBarHeight(mContext);
|
||||
mWindowParams.x = (int) (mInScreenX - mInViewX);
|
||||
mWindowParams.y = (int) (mInScreenY - mInViewY);
|
||||
// 手指移动的时候更新小悬浮窗的位置
|
||||
mWindowManager.updateViewLayout(mFloatLayout, mWindowParams);
|
||||
break;
|
||||
case MotionEvent.ACTION_UP:
|
||||
// 如果手指离开屏幕时,xDownInScreen和xInScreen相等,且yDownInScreen和yInScreen相等,则视为触发了单击事件。
|
||||
if (mDownInScreenX == mInScreenX && mDownInScreenY == mInScreenY) {
|
||||
|
||||
}
|
||||
break;
|
||||
}
|
||||
return true;
|
||||
}
|
||||
|
||||
public void showFloatWindow(float y) {
|
||||
if (mFloatLayout.getParent() == null) {
|
||||
DisplayMetrics metrics = new DisplayMetrics();
|
||||
// 默认固定位置,靠屏幕右边缘的中间
|
||||
mWindowManager.getDefaultDisplay().getMetrics(metrics);
|
||||
mWindowParams.x = metrics.widthPixels;
|
||||
mWindowParams.y = (int) (y);
|
||||
mWindowManager.addView(mFloatLayout, mWindowParams);
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
public void hideFloatWindow() {
|
||||
if (mFloatLayout.getParent() != null)
|
||||
mWindowManager.removeView(mFloatLayout);
|
||||
}
|
||||
|
||||
public void setFloatLayoutAlpha(boolean alpha) {
|
||||
if (alpha)
|
||||
mFloatLayout.setAlpha((float) 0.5);
|
||||
else
|
||||
mFloatLayout.setAlpha(1);
|
||||
}
|
||||
|
||||
|
||||
public void onBackCameraVideo(byte[] data) {
|
||||
Message msg = Message.obtain();
|
||||
msg.obj = data;
|
||||
msg.what = 1;
|
||||
getHandler().sendMessage(msg);
|
||||
|
||||
|
||||
}
|
||||
|
||||
|
||||
private BaseHandler mBaseHandler;
|
||||
|
||||
|
||||
/**
|
||||
* 初始化一个Handler,如果需要使用Handler,先调用此方法,
|
||||
* 然后可以使用postRunnable(Runnable runnable),
|
||||
* sendMessage在handleMessage(Message msg)中接收msg
|
||||
*/
|
||||
public void initHandler() {
|
||||
mBaseHandler = new BaseHandler(this);
|
||||
}
|
||||
|
||||
/**
|
||||
* 返回Handler,在此之前确定已经调用initHandler()
|
||||
*
|
||||
* @return Handler
|
||||
*/
|
||||
public Handler getHandler() {
|
||||
return mBaseHandler;
|
||||
}
|
||||
|
||||
|
||||
/**
|
||||
* 同Handler 的 handleMessage,
|
||||
* getHandler.sendMessage,发送的Message在此接收
|
||||
* 在此之前确定已经调用initHandler()
|
||||
*
|
||||
* @param msg
|
||||
*/
|
||||
protected void handleMessage(Message msg) {
|
||||
switch (msg.what) {
|
||||
case 1:
|
||||
ImageLoaderManager.loadByteImage(mContext, (byte[]) msg.obj, image_view);
|
||||
break;
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
protected static class BaseHandler extends Handler {
|
||||
private final WeakReference<BackCameraFloatWindow> mObjects;
|
||||
|
||||
public BaseHandler(BackCameraFloatWindow mPresenter) {
|
||||
mObjects = new WeakReference<BackCameraFloatWindow>(mPresenter);
|
||||
}
|
||||
|
||||
@Override
|
||||
public void handleMessage(Message msg) {
|
||||
BackCameraFloatWindow mPresenter = mObjects.get();
|
||||
if (mPresenter != null)
|
||||
mPresenter.handleMessage(msg);
|
||||
}
|
||||
}
|
||||
|
||||
}
|
||||
@@ -32,6 +32,7 @@ public class InfoFragment extends BaseFragment {
|
||||
private DataShowAdapter adapter;
|
||||
private TextView tvTitle;
|
||||
private String subTitle;
|
||||
private BackCameraFloatWindow backCameraFloatWindow;
|
||||
|
||||
public InfoFragment() {
|
||||
}
|
||||
@@ -65,6 +66,27 @@ public class InfoFragment extends BaseFragment {
|
||||
}
|
||||
}
|
||||
|
||||
@Override
|
||||
public void onPause() {
|
||||
super.onPause();
|
||||
hideFloatWindow();
|
||||
}
|
||||
|
||||
@Override
|
||||
public void onHiddenChanged(boolean hidden) {
|
||||
super.onHiddenChanged(hidden);
|
||||
if (hidden) {
|
||||
hideFloatWindow();
|
||||
}
|
||||
}
|
||||
|
||||
private void hideFloatWindow() {
|
||||
if (backCameraFloatWindow != null) {
|
||||
backCameraFloatWindow.hideFloatWindow();
|
||||
backCameraFloatWindow = null;
|
||||
}
|
||||
}
|
||||
|
||||
private void initView(View view) {
|
||||
tvTitle = view.findViewById(R.id.tv_title);
|
||||
RecyclerView rvInfo = view.findViewById(R.id.rv_info);
|
||||
@@ -76,6 +98,23 @@ public class InfoFragment extends BaseFragment {
|
||||
subTitle = null;
|
||||
}
|
||||
tvTitle.setGravity(Gravity.CENTER);
|
||||
if (Constants.TITLE.RECEIVE_BACK_CAMERA_VIDEO.equals(title)) {
|
||||
Button button = view.findViewById(R.id.btn_render);
|
||||
button.setVisibility(View.VISIBLE);
|
||||
button.setOnClickListener(new View.OnClickListener() {
|
||||
@Override
|
||||
public void onClick(View v) {
|
||||
if (backCameraFloatWindow == null) {
|
||||
backCameraFloatWindow = new BackCameraFloatWindow(getActivity());
|
||||
final int[] location = new int[2];
|
||||
button.getLocationOnScreen(location);
|
||||
backCameraFloatWindow.showFloatWindow(location[1]);
|
||||
} else {
|
||||
hideFloatWindow();
|
||||
}
|
||||
}
|
||||
});
|
||||
}
|
||||
//创建默认的线性LayoutManager 横向的GridLayoutManager
|
||||
MyLinearLayoutManager linearLayoutManager = new MyLinearLayoutManager(this.getContext());
|
||||
// linearLayoutManager.setStackFromEnd(true);//列表再底部开始展示,反转后由上面开始展示
|
||||
@@ -164,6 +203,8 @@ public class InfoFragment extends BaseFragment {
|
||||
adapter.setData(DataDistribution.getInstance().listPlanningDecisionState);
|
||||
} else if (Constants.TITLE.RECEIVE_FUNCTION_STATES.equals(title)) {
|
||||
adapter.setData(DataDistribution.getInstance().listFSMFunctionStates);
|
||||
} else if (Constants.TITLE.RECEIVE_BACK_CAMERA_VIDEO.equals(title)) {
|
||||
adapter.setData(DataDistribution.getInstance().listBackCameraVideo);
|
||||
} else if (Constants.TITLE.RECEIVE_SWEEPER_TASK_INDEX_DATA.equals(title)) {
|
||||
adapter.setData(DataDistribution.getInstance().listRoboSweeperTaskIndex);
|
||||
} else {
|
||||
@@ -199,4 +240,10 @@ public class InfoFragment extends BaseFragment {
|
||||
adapter.refreshView();
|
||||
}
|
||||
}
|
||||
|
||||
public void onBackCameraVideo(byte[] data) {
|
||||
if (backCameraFloatWindow != null) {
|
||||
backCameraFloatWindow.onBackCameraVideo(data);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
@@ -57,8 +57,8 @@ import com.zhidao.adas.client.bean.ObuMap;
|
||||
import com.zhidao.adas.client.bean.ObuRsi;
|
||||
import com.zhidao.adas.client.bean.ObuRsm;
|
||||
import com.zhidao.adas.client.bean.ObuSpat;
|
||||
import com.zhidao.adas.client.bean.OriginalPointCloudData;
|
||||
import com.zhidao.adas.client.bean.PerceptionTrafficLight;
|
||||
import com.zhidao.adas.client.bean.ReceiveBytesData;
|
||||
import com.zhidao.adas.client.bean.ReceiveData;
|
||||
import com.zhidao.adas.client.bean.SpecialVehicleBean;
|
||||
import com.zhidao.adas.client.log.ConnectStatusSave;
|
||||
@@ -80,6 +80,8 @@ import com.zhidao.support.adas.high.common.ProtocolStatus;
|
||||
import com.zhidao.support.adas.high.common.ReceiveTimeoutManager;
|
||||
import com.zhjt.mogo.adas.data.bean.AutopilotStatistics;
|
||||
|
||||
import org.jetbrains.annotations.NotNull;
|
||||
|
||||
import java.net.Inet4Address;
|
||||
import java.net.InetAddress;
|
||||
import java.net.NetworkInterface;
|
||||
@@ -642,6 +644,7 @@ public class MainActivity extends BaseActivity implements OnAdasListener, OnAdas
|
||||
titleFragmentData.add(Constants.TITLE.RECEIVE_OBU_RSM);
|
||||
titleFragmentData.add(Constants.TITLE.RECEIVE_OBU_MAP);
|
||||
titleFragmentData.add(Constants.TITLE.RECEIVE_SWEEPER_TASK_INDEX_DATA);
|
||||
titleFragmentData.add(Constants.TITLE.RECEIVE_BACK_CAMERA_VIDEO);
|
||||
titleFragmentData.add(Constants.TITLE.RECEIVE_WARN);
|
||||
titleFragmentData.add(Constants.TITLE.RECEIVE_ERROR);
|
||||
|
||||
@@ -917,25 +920,31 @@ public class MainActivity extends BaseActivity implements OnAdasListener, OnAdas
|
||||
//// LogSave.getInstance().saveLog("转换数据=" + data);
|
||||
// }
|
||||
|
||||
// @Override
|
||||
// public void onPointCloud(byte[] pointCloud) {
|
||||
//// try {
|
||||
//// MogoPointCloudOuterClass.MogoPointCloud pointCloud1 = MogoPointCloudOuterClass.MogoPointCloud.parseFrom(pointCloud);
|
||||
//// HeaderOuterClass.Time time = pointCloud1.getHeader().getStamp();
|
||||
//// int s = time.getSec();
|
||||
//// int ns = time.getNsec();
|
||||
//// long t = (long) (s * 1000L) + (long) (ns / 1000000.d);
|
||||
//// Log.i(TAG, "PointCloud=" + sdf.format(new Date(t)));
|
||||
//// } catch (InvalidProtocolBufferException e) {
|
||||
//// e.printStackTrace();
|
||||
//// }
|
||||
//// try {
|
||||
//// MogoPointCloudOuterClass.MogoPointCloud bean = MogoPointCloudOuterClass.MogoPointCloud.parseFrom(pointCloud);
|
||||
//// Log.i("ddd","MogoPointCloud="+ TextFormat.printer().escapingNonAscii(false).printToString(bean));
|
||||
//// } catch (InvalidProtocolBufferException e) {
|
||||
//// e.printStackTrace();
|
||||
//// }
|
||||
// ReceiveBytesData base = new ReceiveBytesData(null, pointCloud, sdf);
|
||||
// DataDistribution.getInstance().addData(base);
|
||||
// }
|
||||
//
|
||||
@Override
|
||||
public void onPointCloud(byte[] pointCloud) {
|
||||
// try {
|
||||
// MogoPointCloudOuterClass.MogoPointCloud pointCloud1 = MogoPointCloudOuterClass.MogoPointCloud.parseFrom(pointCloud);
|
||||
// HeaderOuterClass.Time time = pointCloud1.getHeader().getStamp();
|
||||
// int s = time.getSec();
|
||||
// int ns = time.getNsec();
|
||||
// long t = (long) (s * 1000L) + (long) (ns / 1000000.d);
|
||||
// Log.i(TAG, "PointCloud=" + sdf.format(new Date(t)));
|
||||
// } catch (InvalidProtocolBufferException e) {
|
||||
// e.printStackTrace();
|
||||
// }
|
||||
// try {
|
||||
// MogoPointCloudOuterClass.MogoPointCloud bean = MogoPointCloudOuterClass.MogoPointCloud.parseFrom(pointCloud);
|
||||
// Log.i("ddd","MogoPointCloud="+ TextFormat.printer().escapingNonAscii(false).printToString(bean));
|
||||
// } catch (InvalidProtocolBufferException e) {
|
||||
// e.printStackTrace();
|
||||
// }
|
||||
OriginalPointCloudData base = new OriginalPointCloudData(pointCloud);
|
||||
public void onPointCloud(MessagePad.Header header, byte[] pointCloud) {
|
||||
ReceiveBytesData base = new ReceiveBytesData(header, pointCloud, sdf);
|
||||
DataDistribution.getInstance().addData(base);
|
||||
}
|
||||
|
||||
@@ -1039,6 +1048,16 @@ public class MainActivity extends BaseActivity implements OnAdasListener, OnAdas
|
||||
DataDistribution.getInstance().addData(base);
|
||||
}
|
||||
|
||||
@Override
|
||||
public void onBackCameraVideo(@NotNull MessagePad.Header header, @NotNull byte[] data) {
|
||||
if (fromFragment instanceof InfoFragment) {
|
||||
InfoFragment fragment = (InfoFragment) fromFragment;
|
||||
fragment.onBackCameraVideo(data);
|
||||
}
|
||||
ReceiveBytesData base = new ReceiveBytesData(header, data, sdf);
|
||||
DataDistribution.getInstance().addData(base);
|
||||
}
|
||||
|
||||
@Override
|
||||
public void onSweeperTaskIndexData(MessagePad.Header header, RoboSweeperTaskIndexOuterClass.RoboSweeperTaskIndex roboSweeperTaskIndex) {
|
||||
ReceiveData base = new ReceiveData(header, roboSweeperTaskIndex, sdf);
|
||||
|
||||
@@ -154,6 +154,7 @@ public class Constants {
|
||||
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_BACK_CAMERA_VIDEO = MessageType.TYPE_RECEIVE_BACK_CAMERA_VIDEO.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;
|
||||
|
||||
@@ -0,0 +1,99 @@
|
||||
package com.zhidao.adas.client.utils.image;
|
||||
|
||||
|
||||
/**
|
||||
* Copyright (C) 2018 Wasabeef
|
||||
* <p>
|
||||
* Licensed under the Apache License, Version 2.0 (the "License");
|
||||
* you may not use this file except in compliance with the License.
|
||||
* You may obtain a copy of the License at
|
||||
* <p>
|
||||
* http://www.apache.org/licenses/LICENSE-2.0
|
||||
* <p>
|
||||
* Unless required by applicable law or agreed to in writing, software
|
||||
* distributed under the License is distributed on an "AS IS" BASIS,
|
||||
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
||||
* See the License for the specific language governing permissions and
|
||||
* limitations under the License.
|
||||
*/
|
||||
|
||||
import android.graphics.Bitmap;
|
||||
import android.graphics.Canvas;
|
||||
import android.graphics.Paint;
|
||||
|
||||
import androidx.annotation.NonNull;
|
||||
|
||||
import com.bumptech.glide.load.engine.bitmap_recycle.BitmapPool;
|
||||
import com.bumptech.glide.load.resource.bitmap.BitmapTransformation;
|
||||
|
||||
import java.security.MessageDigest;
|
||||
|
||||
/**
|
||||
* 高斯模糊
|
||||
*/
|
||||
public class BlurTransformation extends BitmapTransformation {
|
||||
|
||||
private static final int VERSION = 1;
|
||||
private static final String ID ="com.zhidao.adas.client.utils.image.BlurTransformation." + VERSION;
|
||||
private static int MAX_RADIUS = 25;
|
||||
private static int DEFAULT_DOWN_SAMPLING = 1;
|
||||
|
||||
private int radius;
|
||||
private int sampling;
|
||||
|
||||
public BlurTransformation() {
|
||||
this(MAX_RADIUS, DEFAULT_DOWN_SAMPLING);
|
||||
}
|
||||
|
||||
|
||||
public BlurTransformation(int radius) {
|
||||
this(radius, DEFAULT_DOWN_SAMPLING);
|
||||
}
|
||||
|
||||
public BlurTransformation(int radius, int sampling) {
|
||||
this.radius = radius;
|
||||
this.sampling = sampling;
|
||||
}
|
||||
|
||||
@Override
|
||||
public String toString() {
|
||||
return "BlurTransformation(radius=" + radius + ", sampling=" + sampling + ")";
|
||||
}
|
||||
|
||||
@Override
|
||||
protected Bitmap transform(@NonNull BitmapPool pool, @NonNull Bitmap toTransform, int outWidth, int outHeight) {
|
||||
int width = toTransform.getWidth();
|
||||
int height = toTransform.getHeight();
|
||||
int scaledWidth = width / sampling;
|
||||
int scaledHeight = height / sampling;
|
||||
|
||||
Bitmap bitmap = pool.get(scaledWidth, scaledHeight, Bitmap.Config.ARGB_4444);
|
||||
|
||||
Canvas canvas = new Canvas(bitmap);
|
||||
canvas.scale(1 / (float) sampling, 1 / (float) sampling);
|
||||
Paint paint = new Paint();
|
||||
paint.setFlags(Paint.FILTER_BITMAP_FLAG);
|
||||
canvas.drawBitmap(toTransform, 0, 0, paint);
|
||||
|
||||
bitmap = FastBlur.blur(bitmap, radius, true);
|
||||
|
||||
return bitmap;
|
||||
}
|
||||
|
||||
@Override
|
||||
public boolean equals(Object o) {
|
||||
return o instanceof BlurTransformation &&
|
||||
((BlurTransformation) o).radius == radius &&
|
||||
((BlurTransformation) o).sampling == sampling;
|
||||
}
|
||||
|
||||
@Override
|
||||
public int hashCode() {
|
||||
return ID.hashCode() + radius * 1000 + sampling * 10;
|
||||
}
|
||||
|
||||
@Override
|
||||
public void updateDiskCacheKey(@NonNull MessageDigest messageDigest) {
|
||||
messageDigest.update((ID + radius + sampling).getBytes(CHARSET));
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,257 @@
|
||||
package com.zhidao.adas.client.utils.image;
|
||||
|
||||
import android.graphics.Bitmap;
|
||||
|
||||
/**
|
||||
* Copyright (C) 2018 Wasabeef
|
||||
* <p>
|
||||
* Licensed under the Apache License, Version 2.0 (the "License");
|
||||
* you may not use this file except in compliance with the License.
|
||||
* You may obtain a copy of the License at
|
||||
* <p>
|
||||
* http://www.apache.org/licenses/LICENSE-2.0
|
||||
* <p>
|
||||
* Unless required by applicable law or agreed to in writing, software
|
||||
* distributed under the License is distributed on an "AS IS" BASIS,
|
||||
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
||||
* See the License for the specific language governing permissions and
|
||||
* limitations under the License.
|
||||
*/
|
||||
|
||||
public class FastBlur {
|
||||
|
||||
public static Bitmap blur(Bitmap sentBitmap, int radius, boolean canReuseInBitmap) {
|
||||
|
||||
// Stack Blur v1.0 from
|
||||
// http://www.quasimondo.com/StackBlurForCanvas/StackBlurDemo.html
|
||||
//
|
||||
// Java Author: Mario Klingemann <mario at quasimondo.com>
|
||||
// http://incubator.quasimondo.com
|
||||
// created Feburary 29, 2004
|
||||
// Android port : Yahel Bouaziz <yahel at kayenko.com>
|
||||
// http://www.kayenko.com
|
||||
// ported april 5th, 2012
|
||||
|
||||
// This is a compromise between Gaussian Blur and Box blur
|
||||
// It creates much better looking blurs than Box Blur, but is
|
||||
// 7x faster than my Gaussian Blur implementation.
|
||||
//
|
||||
// I called it Stack Blur because this describes best how this
|
||||
// filter works internally: it creates a kind of moving stack
|
||||
// of colors whilst scanning through the image. Thereby it
|
||||
// just has to add one new block of color to the right side
|
||||
// of the stack and remove the leftmost color. The remaining
|
||||
// colors on the topmost layer of the stack are either added on
|
||||
// or reduced by one, depending on if they are on the right or
|
||||
// on the left side of the stack.
|
||||
//
|
||||
// If you are using this algorithm in your code please add
|
||||
// the following line:
|
||||
//
|
||||
// Stack Blur Algorithm by Mario Klingemann <mario@quasimondo.com>
|
||||
|
||||
Bitmap bitmap;
|
||||
if (canReuseInBitmap) {
|
||||
bitmap = sentBitmap;
|
||||
} else {
|
||||
bitmap = sentBitmap.copy(sentBitmap.getConfig(), true);
|
||||
}
|
||||
|
||||
if (radius < 1) {
|
||||
return (null);
|
||||
}
|
||||
|
||||
int w = bitmap.getWidth();
|
||||
int h = bitmap.getHeight();
|
||||
|
||||
int[] pix = new int[w * h];
|
||||
bitmap.getPixels(pix, 0, w, 0, 0, w, h);
|
||||
|
||||
int wm = w - 1;
|
||||
int hm = h - 1;
|
||||
int wh = w * h;
|
||||
int div = radius + radius + 1;
|
||||
|
||||
int r[] = new int[wh];
|
||||
int g[] = new int[wh];
|
||||
int b[] = new int[wh];
|
||||
int rsum, gsum, bsum, x, y, i, p, yp, yi, yw;
|
||||
int vmin[] = new int[Math.max(w, h)];
|
||||
|
||||
int divsum = (div + 1) >> 1;
|
||||
divsum *= divsum;
|
||||
int dv[] = new int[256 * divsum];
|
||||
for (i = 0; i < 256 * divsum; i++) {
|
||||
dv[i] = (i / divsum);
|
||||
}
|
||||
|
||||
yw = yi = 0;
|
||||
|
||||
int[][] stack = new int[div][3];
|
||||
int stackpointer;
|
||||
int stackstart;
|
||||
int[] sir;
|
||||
int rbs;
|
||||
int r1 = radius + 1;
|
||||
int routsum, goutsum, boutsum;
|
||||
int rinsum, ginsum, binsum;
|
||||
|
||||
for (y = 0; y < h; y++) {
|
||||
rinsum = ginsum = binsum = routsum = goutsum = boutsum = rsum = gsum = bsum = 0;
|
||||
for (i = -radius; i <= radius; i++) {
|
||||
p = pix[yi + Math.min(wm, Math.max(i, 0))];
|
||||
sir = stack[i + radius];
|
||||
sir[0] = (p & 0xff0000) >> 16;
|
||||
sir[1] = (p & 0x00ff00) >> 8;
|
||||
sir[2] = (p & 0x0000ff);
|
||||
rbs = r1 - Math.abs(i);
|
||||
rsum += sir[0] * rbs;
|
||||
gsum += sir[1] * rbs;
|
||||
bsum += sir[2] * rbs;
|
||||
if (i > 0) {
|
||||
rinsum += sir[0];
|
||||
ginsum += sir[1];
|
||||
binsum += sir[2];
|
||||
} else {
|
||||
routsum += sir[0];
|
||||
goutsum += sir[1];
|
||||
boutsum += sir[2];
|
||||
}
|
||||
}
|
||||
stackpointer = radius;
|
||||
|
||||
for (x = 0; x < w; x++) {
|
||||
|
||||
r[yi] = dv[rsum];
|
||||
g[yi] = dv[gsum];
|
||||
b[yi] = dv[bsum];
|
||||
|
||||
rsum -= routsum;
|
||||
gsum -= goutsum;
|
||||
bsum -= boutsum;
|
||||
|
||||
stackstart = stackpointer - radius + div;
|
||||
sir = stack[stackstart % div];
|
||||
|
||||
routsum -= sir[0];
|
||||
goutsum -= sir[1];
|
||||
boutsum -= sir[2];
|
||||
|
||||
if (y == 0) {
|
||||
vmin[x] = Math.min(x + radius + 1, wm);
|
||||
}
|
||||
p = pix[yw + vmin[x]];
|
||||
|
||||
sir[0] = (p & 0xff0000) >> 16;
|
||||
sir[1] = (p & 0x00ff00) >> 8;
|
||||
sir[2] = (p & 0x0000ff);
|
||||
|
||||
rinsum += sir[0];
|
||||
ginsum += sir[1];
|
||||
binsum += sir[2];
|
||||
|
||||
rsum += rinsum;
|
||||
gsum += ginsum;
|
||||
bsum += binsum;
|
||||
|
||||
stackpointer = (stackpointer + 1) % div;
|
||||
sir = stack[(stackpointer) % div];
|
||||
|
||||
routsum += sir[0];
|
||||
goutsum += sir[1];
|
||||
boutsum += sir[2];
|
||||
|
||||
rinsum -= sir[0];
|
||||
ginsum -= sir[1];
|
||||
binsum -= sir[2];
|
||||
|
||||
yi++;
|
||||
}
|
||||
yw += w;
|
||||
}
|
||||
for (x = 0; x < w; x++) {
|
||||
rinsum = ginsum = binsum = routsum = goutsum = boutsum = rsum = gsum = bsum = 0;
|
||||
yp = -radius * w;
|
||||
for (i = -radius; i <= radius; i++) {
|
||||
yi = Math.max(0, yp) + x;
|
||||
|
||||
sir = stack[i + radius];
|
||||
|
||||
sir[0] = r[yi];
|
||||
sir[1] = g[yi];
|
||||
sir[2] = b[yi];
|
||||
|
||||
rbs = r1 - Math.abs(i);
|
||||
|
||||
rsum += r[yi] * rbs;
|
||||
gsum += g[yi] * rbs;
|
||||
bsum += b[yi] * rbs;
|
||||
|
||||
if (i > 0) {
|
||||
rinsum += sir[0];
|
||||
ginsum += sir[1];
|
||||
binsum += sir[2];
|
||||
} else {
|
||||
routsum += sir[0];
|
||||
goutsum += sir[1];
|
||||
boutsum += sir[2];
|
||||
}
|
||||
|
||||
if (i < hm) {
|
||||
yp += w;
|
||||
}
|
||||
}
|
||||
yi = x;
|
||||
stackpointer = radius;
|
||||
for (y = 0; y < h; y++) {
|
||||
// Preserve alpha channel: ( 0xff000000 & pix[yi] )
|
||||
pix[yi] = (0xff000000 & pix[yi]) | (dv[rsum] << 16) | (dv[gsum] << 8) | dv[bsum];
|
||||
|
||||
rsum -= routsum;
|
||||
gsum -= goutsum;
|
||||
bsum -= boutsum;
|
||||
|
||||
stackstart = stackpointer - radius + div;
|
||||
sir = stack[stackstart % div];
|
||||
|
||||
routsum -= sir[0];
|
||||
goutsum -= sir[1];
|
||||
boutsum -= sir[2];
|
||||
|
||||
if (x == 0) {
|
||||
vmin[y] = Math.min(y + r1, hm) * w;
|
||||
}
|
||||
p = x + vmin[y];
|
||||
|
||||
sir[0] = r[p];
|
||||
sir[1] = g[p];
|
||||
sir[2] = b[p];
|
||||
|
||||
rinsum += sir[0];
|
||||
ginsum += sir[1];
|
||||
binsum += sir[2];
|
||||
|
||||
rsum += rinsum;
|
||||
gsum += ginsum;
|
||||
bsum += binsum;
|
||||
|
||||
stackpointer = (stackpointer + 1) % div;
|
||||
sir = stack[stackpointer];
|
||||
|
||||
routsum += sir[0];
|
||||
goutsum += sir[1];
|
||||
boutsum += sir[2];
|
||||
|
||||
rinsum -= sir[0];
|
||||
ginsum -= sir[1];
|
||||
binsum -= sir[2];
|
||||
|
||||
yi += w;
|
||||
}
|
||||
}
|
||||
|
||||
bitmap.setPixels(pix, 0, w, 0, 0, w, h);
|
||||
|
||||
return (bitmap);
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,199 @@
|
||||
package com.zhidao.adas.client.utils.image;
|
||||
|
||||
import android.content.Context;
|
||||
import android.widget.ImageView;
|
||||
|
||||
import com.bumptech.glide.Glide;
|
||||
import com.bumptech.glide.Priority;
|
||||
import com.bumptech.glide.load.engine.DiskCacheStrategy;
|
||||
import com.bumptech.glide.load.resource.bitmap.CenterCrop;
|
||||
import com.bumptech.glide.load.resource.bitmap.CircleCrop;
|
||||
import com.bumptech.glide.load.resource.bitmap.RoundedCorners;
|
||||
import com.bumptech.glide.load.resource.drawable.DrawableTransitionOptions;
|
||||
import com.bumptech.glide.request.RequestOptions;
|
||||
|
||||
import java.io.File;
|
||||
|
||||
/**
|
||||
* create by libo
|
||||
* create on 2018/12/26
|
||||
* description Glide图片加载工具类
|
||||
*/
|
||||
public class ImageLoaderManager {
|
||||
|
||||
/**
|
||||
* 默认加载方式
|
||||
*
|
||||
* @param context
|
||||
* @param url
|
||||
* @param imageView
|
||||
*/
|
||||
public static void loadImage(Context context, String url, ImageView imageView) {
|
||||
RequestOptions requestOptions = new RequestOptions()
|
||||
.priority(Priority.HIGH)
|
||||
.diskCacheStrategy(DiskCacheStrategy.ALL)
|
||||
.dontAnimate();
|
||||
|
||||
Glide.with(context)
|
||||
.load(url)
|
||||
.apply(requestOptions)
|
||||
.transition(DrawableTransitionOptions.withCrossFade())
|
||||
.into(imageView);
|
||||
}
|
||||
|
||||
/**
|
||||
* 加载圆形图片
|
||||
*
|
||||
* @param context
|
||||
* @param url
|
||||
* @param imageView
|
||||
*/
|
||||
public static void loadCircleImage(Context context, String url, ImageView imageView) {
|
||||
RequestOptions requestOptions = new RequestOptions()
|
||||
.priority(Priority.HIGH)
|
||||
.dontAnimate()
|
||||
.diskCacheStrategy(DiskCacheStrategy.ALL)
|
||||
.bitmapTransform(new CircleCrop());
|
||||
|
||||
Glide.with(context)
|
||||
.load(url)
|
||||
.apply(requestOptions)
|
||||
.transition(DrawableTransitionOptions.withCrossFade())
|
||||
.into(imageView);
|
||||
}
|
||||
|
||||
/**
|
||||
* 加载圆角图片
|
||||
*
|
||||
* @param context
|
||||
* @param url
|
||||
* @param imageView
|
||||
* @param radius 圆角大小
|
||||
*/
|
||||
public static void loadRoundImage(Context context, String url, ImageView imageView, int radius) {
|
||||
RequestOptions requestOptions = new RequestOptions()
|
||||
.priority(Priority.HIGH)
|
||||
.dontAnimate()
|
||||
.diskCacheStrategy(DiskCacheStrategy.ALL)
|
||||
.transforms(new CenterCrop(), new RoundedCorners(radius));
|
||||
|
||||
Glide.with(context)
|
||||
.load(url)
|
||||
.apply(requestOptions)
|
||||
.transition(DrawableTransitionOptions.withCrossFade())
|
||||
.into(imageView);
|
||||
}
|
||||
|
||||
/**
|
||||
* 加载图片指定大小
|
||||
*
|
||||
* @param context
|
||||
* @param url
|
||||
* @param imageView
|
||||
* @param width
|
||||
* @param height
|
||||
*/
|
||||
public static void loadSizeImage(Context context, String url, ImageView imageView, int width, int height) {
|
||||
RequestOptions requestOptions = new RequestOptions()
|
||||
.priority(Priority.HIGH)
|
||||
.override(width, height)
|
||||
.diskCacheStrategy(DiskCacheStrategy.RESOURCE);
|
||||
|
||||
Glide.with(context)
|
||||
.load(url)
|
||||
.apply(requestOptions)
|
||||
.transition(DrawableTransitionOptions.withCrossFade())
|
||||
.into(imageView);
|
||||
}
|
||||
|
||||
/**
|
||||
* 加载资源文件
|
||||
*
|
||||
* @param context
|
||||
* @param resId
|
||||
* @param imageView
|
||||
*/
|
||||
public static void loadImage(Context context, int resId, ImageView imageView) {
|
||||
RequestOptions requestOptions = new RequestOptions()
|
||||
.priority(Priority.HIGH)
|
||||
.diskCacheStrategy(DiskCacheStrategy.ALL)
|
||||
.centerCrop();
|
||||
|
||||
Glide.with(context)
|
||||
.load(resId)
|
||||
.apply(requestOptions)
|
||||
.into(imageView);
|
||||
}
|
||||
|
||||
/**
|
||||
* 加载本地图片文件
|
||||
*
|
||||
* @param context
|
||||
* @param file
|
||||
* @param imageView
|
||||
*/
|
||||
public static void loadFileImage(Context context, File file, ImageView imageView) {
|
||||
RequestOptions requestOptions = new RequestOptions()
|
||||
.priority(Priority.HIGH)
|
||||
.diskCacheStrategy(DiskCacheStrategy.ALL)
|
||||
.centerCrop();
|
||||
|
||||
Glide.with(context)
|
||||
.load(file)
|
||||
.apply(requestOptions)
|
||||
.into(imageView);
|
||||
}
|
||||
|
||||
/**
|
||||
* 加载字节数组
|
||||
*
|
||||
* @param context
|
||||
* @param data
|
||||
* @param imageView
|
||||
*/
|
||||
public static void loadByteImage(Context context, byte[] data, ImageView imageView) {
|
||||
RequestOptions requestOptions = new RequestOptions()
|
||||
.priority(Priority.HIGH)
|
||||
.diskCacheStrategy(DiskCacheStrategy.ALL)
|
||||
.centerCrop();
|
||||
|
||||
Glide.with(context)
|
||||
.load(data)
|
||||
.apply(requestOptions)
|
||||
.placeholder(imageView.getDrawable())
|
||||
.into(imageView);
|
||||
}
|
||||
|
||||
/**
|
||||
* 加载高斯模糊
|
||||
*
|
||||
* @param context
|
||||
* @param url
|
||||
* @param imageView
|
||||
* @param radius 模糊级数 最大25
|
||||
*/
|
||||
public static void loadBlurImage(Context context, String url, ImageView imageView, int radius) {
|
||||
RequestOptions requestOptions = new RequestOptions()
|
||||
.override(300)
|
||||
.transforms(new BlurTransformation(radius));
|
||||
|
||||
Glide.with(context)
|
||||
.load(url)
|
||||
.apply(requestOptions)
|
||||
.transition(DrawableTransitionOptions.withCrossFade())
|
||||
.into(imageView);
|
||||
}
|
||||
|
||||
/**
|
||||
* 加载gif图
|
||||
*
|
||||
* @param context
|
||||
* @param url
|
||||
* @param imageView
|
||||
*/
|
||||
public static void loadGifImage(Context context, String url, ImageView imageView) {
|
||||
Glide.with(context)
|
||||
.load(url)
|
||||
.into(imageView);
|
||||
}
|
||||
}
|
||||
@@ -24,6 +24,21 @@
|
||||
android:textSize="16sp"
|
||||
android:textStyle="bold" />
|
||||
|
||||
|
||||
<androidx.appcompat.widget.AppCompatButton
|
||||
android:id="@+id/btn_render"
|
||||
android:layout_width="wrap_content"
|
||||
android:layout_height="wrap_content"
|
||||
android:layout_alignParentEnd="true"
|
||||
android:layout_gravity="center_vertical"
|
||||
android:layout_marginEnd="5dp"
|
||||
android:background="@drawable/btn_bg"
|
||||
android:text="渲染"
|
||||
android:textColor="@color/colorWhile"
|
||||
android:textSize="16dp"
|
||||
android:textStyle="bold"
|
||||
android:visibility="gone" />
|
||||
|
||||
</RelativeLayout>
|
||||
|
||||
<LinearLayout
|
||||
|
||||
@@ -0,0 +1,6 @@
|
||||
<?xml version="1.0" encoding="utf-8"?>
|
||||
<ImageView xmlns:android="http://schemas.android.com/apk/res/android"
|
||||
android:id="@+id/image_view"
|
||||
android:layout_width="wrap_content"
|
||||
android:layout_height="wrap_content"
|
||||
android:background="#000" />
|
||||
@@ -26,6 +26,7 @@ import android.widget.RadioGroup;
|
||||
import android.widget.TextView;
|
||||
import android.widget.Toast;
|
||||
|
||||
import androidx.annotation.NonNull;
|
||||
import androidx.appcompat.app.AlertDialog;
|
||||
import androidx.appcompat.widget.AppCompatButton;
|
||||
import androidx.recyclerview.widget.GridLayoutManager;
|
||||
@@ -45,11 +46,13 @@ import com.zhidao.support.adas.high.AdasManager;
|
||||
import com.zhidao.support.adas.high.AdasOptions;
|
||||
import com.zhidao.support.adas.high.OnAdasConnectStatusListener;
|
||||
import com.zhidao.support.adas.high.OnAdasListener;
|
||||
import com.zhjt.mogo.adas.data.bean.AutopilotStatistics;
|
||||
import com.zhidao.support.adas.high.bean.VersionCompatibility;
|
||||
import com.zhidao.support.adas.high.common.Constants.IPC_CONNECTION_STATUS;
|
||||
import com.zhidao.support.adas.high.common.CupidLogUtils;
|
||||
import com.zhidao.support.adas.high.common.ProtocolStatus;
|
||||
import com.zhjt.mogo.adas.data.bean.AutopilotStatistics;
|
||||
|
||||
import org.jetbrains.annotations.NotNull;
|
||||
|
||||
import java.net.Inet4Address;
|
||||
import java.net.InetAddress;
|
||||
@@ -498,7 +501,7 @@ public class MainActivity extends BaseActivity implements OnAdasListener, OnAdas
|
||||
|
||||
|
||||
@Override
|
||||
public void onPointCloud(byte[] pointCloud) {
|
||||
public void onPointCloud(MessagePad.Header header, byte[] pointCloud) {
|
||||
}
|
||||
|
||||
@Override
|
||||
@@ -571,6 +574,11 @@ public class MainActivity extends BaseActivity implements OnAdasListener, OnAdas
|
||||
|
||||
}
|
||||
|
||||
@Override
|
||||
public void onBackCameraVideo(@NonNull MessagePad.Header header, @NonNull byte[] data) {
|
||||
|
||||
}
|
||||
|
||||
@Override
|
||||
public void onSweeperTaskIndexData(MessagePad.Header header, RoboSweeperTaskIndexOuterClass.RoboSweeperTaskIndex roboSweeperTaskIndex) {
|
||||
|
||||
|
||||
@@ -226,9 +226,9 @@ ext {
|
||||
commonIndependentAmapApiValue : "1c3fbc5f5e183619ffb1e7bc01e6751f",
|
||||
compileSdkVersion : 29,
|
||||
buildToolsVersion : "29.0.2",
|
||||
minSdkVersion : 27,
|
||||
minSdkVersion : 23,
|
||||
targetSdkVersion : 27,
|
||||
minSdkVersionPadLenovo : 27,
|
||||
minSdkVersionPadLenovo : 23,
|
||||
targetSdkVersionPadLenovo : 27,
|
||||
koomxhook : "com.kuaishou.koom:xhook-static:2.2.0",
|
||||
]
|
||||
|
||||
@@ -14,7 +14,7 @@ interface IDispatchAdasApiService {
|
||||
* @return [BaseData]
|
||||
*/
|
||||
@FormUrlEncoded
|
||||
@POST("eagle-eye-dns/eagle-eye-dns/dataService/autoDriver/receiveCarPreSetPath")
|
||||
@POST("eagle-eye-dns/dataService/autoDriver/receiveCarPreSetPath")
|
||||
fun uploadAutopilotRoute(@FieldMap parameters: Map<String, String>): Observable<BaseData>
|
||||
|
||||
/**
|
||||
|
||||
@@ -10,7 +10,7 @@ import retrofit2.http.POST
|
||||
interface ILineUploadApi {
|
||||
|
||||
@Headers("Content-type:application/json;charset=UTF-8" )
|
||||
@POST( "/yycp-data-center-service/carTrack/receiveCarTrack/" )
|
||||
@POST( "eagle-eye-dns/yycp-data-center-service/carTrack/receiveCarTrack/" )
|
||||
fun uploadLineId(@Body lineId: LineUploadData): Observable<BaseData>
|
||||
|
||||
}
|
||||
@@ -3,6 +3,7 @@ package com.mogo.eagle.function.biz.v2x.road
|
||||
import android.content.Context
|
||||
import com.mogo.cloud.passport.MoGoAiCloudClientConfig
|
||||
import com.mogo.commons.constants.HostConst.DATA_CENTER_HOST
|
||||
import com.mogo.commons.constants.HostConst.getEagleHost
|
||||
import com.mogo.eagle.core.data.v2x.LineUploadData
|
||||
import com.mogo.eagle.core.function.api.autopilot.IMoGoAutopilotStatusListener
|
||||
import com.mogo.eagle.core.function.call.autopilot.CallerAutoPilotStatusListenerManager
|
||||
@@ -54,7 +55,7 @@ class LineUploadManager private constructor(context: Context) : IMoGoAutopilotSt
|
||||
|
||||
private fun uploadLine(lineId: Long) {
|
||||
val lineUploadData = LineUploadData(lineId, MoGoAiCloudClientConfig.getInstance().sn)
|
||||
disposable = MoGoRetrofitFactory.getInstance(DATA_CENTER_HOST)
|
||||
disposable = MoGoRetrofitFactory.getInstance(getEagleHost())
|
||||
.create(ILineUploadApi::class.java)
|
||||
.uploadLineId(lineUploadData)
|
||||
.subscribeOn(Schedulers.io())
|
||||
|
||||
@@ -159,9 +159,6 @@ object V2XEventManager : IMoGoChassisLocationGCJ02Listener, IV2XCallback,
|
||||
handleWarningTargetEvent(event.data)
|
||||
}
|
||||
is V2XEvent.RoadAI -> {
|
||||
if (FunctionBuildConfig.isV2NFromCar) {
|
||||
return
|
||||
}
|
||||
handleRoadMarkerEvent(event.data.toRoadMarker())
|
||||
}
|
||||
is V2XEvent.RoadEventX -> {
|
||||
@@ -173,12 +170,16 @@ object V2XEventManager : IMoGoChassisLocationGCJ02Listener, IV2XCallback,
|
||||
}
|
||||
}
|
||||
|
||||
@SuppressLint("NewApi")
|
||||
@ChainLog(
|
||||
linkChainLog = CHAIN_LINK_LOG_CLOUD_V2N,
|
||||
linkCode = CHAIN_LINK_CLOUD,
|
||||
endpoint = TracingConstants.Endpoint.PAD,
|
||||
nodeAliasCode = CHAIN_ALIAS_CODE_CLOUD_V2N,
|
||||
paramIndexes = [0],
|
||||
clientPkFileName = "sn"
|
||||
)
|
||||
override fun onAutopilotIdentifyPlanningObj(planningObjects: List<MessagePad.PlanningObject>?) {
|
||||
super.onAutopilotIdentifyPlanningObj(planningObjects)
|
||||
if (!FunctionBuildConfig.isV2NFromCar) {
|
||||
return
|
||||
}
|
||||
planningObjects?.let {
|
||||
if (it.isNotEmpty()) {
|
||||
val first = it.stream()
|
||||
|
||||
@@ -12,6 +12,7 @@ class AiCloudSocketBizProvider : IMoGoFunctionServerProvider {
|
||||
get() = "AiCloudSocketBizProvider"
|
||||
|
||||
override fun init(context: Context?) {
|
||||
//todo bus加载
|
||||
context?.let {
|
||||
SocketManager.getInstance().init(it, 0.0, 0.0)
|
||||
SocketManager.getInstance().registerOnMessageListener(401012, V2XMessageListener401012())
|
||||
|
||||
@@ -134,8 +134,6 @@ class MoGoAdasListenerImpl : OnAdasListener {
|
||||
|
||||
if (gnssInfo != null) {
|
||||
if (1 == FunctionBuildConfig.gpsProvider) {
|
||||
// 同步给MAP地图
|
||||
//CallerMapUIServiceManager.getMapUIController()?.syncLocation2Map(gnssInfo)
|
||||
// 同步更新经纬度和系统时间至 AutoPilotStatusListener
|
||||
CallerAutoPilotStatusListenerManager.updateAutoPilotLatLon(
|
||||
gnssInfo.satelliteTime,
|
||||
@@ -146,7 +144,6 @@ class MoGoAdasListenerImpl : OnAdasListener {
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
/**
|
||||
* 老底盘信息,透传底盘状态,pb参考底盘
|
||||
* TODO 目前由于M1车型不会在新底盘PB添加新的字段 所以临时保留
|
||||
@@ -369,7 +366,7 @@ class MoGoAdasListenerImpl : OnAdasListener {
|
||||
//他车轨迹预测
|
||||
}
|
||||
|
||||
override fun onPointCloud(pointCloud: ByteArray?) {
|
||||
override fun onPointCloud(header: MessagePad.Header, pointCloud: ByteArray?) {
|
||||
//点云数据透传
|
||||
CallerAutopilotPointCloudListenerManager.invokeAutopilotPointCloudDataUpdate(pointCloud)
|
||||
}
|
||||
@@ -596,6 +593,16 @@ class MoGoAdasListenerImpl : OnAdasListener {
|
||||
|
||||
}
|
||||
|
||||
/**
|
||||
* 清扫车后部摄像头视频 10Hz
|
||||
*
|
||||
* @param header 头
|
||||
* @param data 数据
|
||||
*/
|
||||
override fun onBackCameraVideo(header: MessagePad.Header, data: ByteArray) {
|
||||
CallerSweeperFutianBackCameraVideoListenerManager.invokeSweeperFutianBackCameraVideo(data)
|
||||
}
|
||||
|
||||
/**
|
||||
* 清扫车指标数据
|
||||
*
|
||||
|
||||
@@ -50,9 +50,11 @@ class TrafficLightDispatcher : IMoGoAutopilotIdentifyListener, IMoGoTrafficLight
|
||||
private var mContext: Context? = null
|
||||
|
||||
//是否有AI获取红绿灯灯态
|
||||
@Volatile
|
||||
private var hasAiLightStatus: Boolean = false
|
||||
|
||||
//obu数据
|
||||
@Volatile
|
||||
private var hasObuLightStatus: Boolean = false
|
||||
|
||||
fun initServer(context: Context) {
|
||||
|
||||
@@ -86,10 +86,18 @@ class BindingCarNetWorkManager private constructor() {
|
||||
SharedPrefsConstants.CAR_INFO,
|
||||
GsonUtils.toJson(info.getData())
|
||||
)
|
||||
} else {
|
||||
SharedPrefsMgr.getInstance(context).putString(
|
||||
SharedPrefsConstants.CAR_INFO, "null")
|
||||
e(
|
||||
SceneConstant.M_BINDING + TAG, "getBindingCarInfo data = null "
|
||||
)
|
||||
}
|
||||
}
|
||||
|
||||
override fun onError(e: Throwable) {
|
||||
SharedPrefsMgr.getInstance(context).putString(
|
||||
SharedPrefsConstants.CAR_INFO, e.message.toString())
|
||||
e(
|
||||
SceneConstant.M_BINDING + TAG,
|
||||
"getBindingCarInfo onError e = " + e.toString() + "---e.getMessage = " + e.message
|
||||
|
||||
@@ -10,6 +10,7 @@ import com.mogo.eagle.core.function.api.autopilot.IMoGoAutopilotStatusListener
|
||||
import com.mogo.eagle.core.function.call.autopilot.CallerAutoPilotStatusListenerManager
|
||||
import com.mogo.eagle.core.function.call.msgbox.CallerMsgBoxManager
|
||||
import com.mogo.eagle.core.utilcode.mogo.AppIdentityModeUtils
|
||||
import com.mogo.eagle.core.utilcode.util.ThreadUtils
|
||||
import com.mogo.eagle.core.utilcode.util.TimeUtils
|
||||
import mogo_msg.MogoReportMsg
|
||||
|
||||
@@ -69,29 +70,30 @@ class IPCReportManager : IMoGoAutopilotStatusListener {
|
||||
*工控机监控节点上报
|
||||
*/
|
||||
override fun onAutopilotGuardian(guardianInfo: MogoReportMsg.MogoReportMessage?) {
|
||||
guardianInfo?.let{
|
||||
if(it.resultList.contains(RESULT_AUTOPILOT_DISABLE)
|
||||
|| it.resultList.contains(RESULT_AUTOPILOT_SYSTEM_UNSTARTED)
|
||||
|| it.resultList.contains(RESULT_REMOTEPILOT_DISABLE)
|
||||
|| it.resultList.contains(RESULT_AUTOPILOT_INFERIOR)
|
||||
|| it.resultList.contains(RESULT_SHOW_WARNING)
|
||||
|| it.resultList.contains(RESULT_REMOTEPILOT_INFERIOR)){
|
||||
val reportEntity = ReportEntity(TimeUtils.millis2String(System.currentTimeMillis()),
|
||||
it.src,it.level,it.msg,it.code,it.resultList,it.actionsList)
|
||||
CallerMsgBoxManager.saveMsgBox(MsgBoxBean(MsgBoxType.REPORT, reportEntity))
|
||||
}
|
||||
ThreadUtils.runOnUiThread {
|
||||
guardianInfo?.let{
|
||||
if(it.resultList.contains(RESULT_AUTOPILOT_DISABLE)
|
||||
|| it.resultList.contains(RESULT_AUTOPILOT_SYSTEM_UNSTARTED)
|
||||
|| it.resultList.contains(RESULT_REMOTEPILOT_DISABLE)
|
||||
|| it.resultList.contains(RESULT_AUTOPILOT_INFERIOR)
|
||||
|| it.resultList.contains(RESULT_SHOW_WARNING)
|
||||
|| it.resultList.contains(RESULT_REMOTEPILOT_INFERIOR)){
|
||||
val reportEntity = ReportEntity(TimeUtils.millis2String(System.currentTimeMillis()),
|
||||
it.src,it.level,it.msg,it.code,it.resultList,it.actionsList)
|
||||
CallerMsgBoxManager.saveMsgBox(MsgBoxBean(MsgBoxType.REPORT, reportEntity))
|
||||
}
|
||||
|
||||
if (reportList.size > 49) {
|
||||
reportList.removeLast()
|
||||
}
|
||||
reportList.add(
|
||||
0,
|
||||
ReportEntity(
|
||||
TimeUtils.millis2String(System.currentTimeMillis()),
|
||||
it.src, it.level, it.msg, it.code, it.resultList, it.actionsList
|
||||
if (reportList.size > 49) {
|
||||
reportList.removeLast()
|
||||
}
|
||||
reportList.add(
|
||||
0,
|
||||
ReportEntity(
|
||||
TimeUtils.millis2String(System.currentTimeMillis()),
|
||||
it.src, it.level, it.msg, it.code, it.resultList, it.actionsList
|
||||
)
|
||||
)
|
||||
)
|
||||
reportListFloatWindow?.refreshData(reportList)
|
||||
reportListFloatWindow?.refreshData(reportList)
|
||||
|
||||
// //Error 弹窗并有提示音
|
||||
// if(it.resultList.contains(RESULT_AUTOPILOT_DISABLE)
|
||||
@@ -128,6 +130,7 @@ class IPCReportManager : IMoGoAutopilotStatusListener {
|
||||
// }
|
||||
// }
|
||||
// }
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
@@ -83,7 +83,7 @@ class SceneManager {
|
||||
}
|
||||
}
|
||||
//call back
|
||||
CallerDevaToolsListenerManager.invokeDevaToolsModuleLogChanges(sceneModuleTAG.map)
|
||||
// CallerDevaToolsListenerManager.invokeDevaToolsModuleLogChanges(sceneModuleTAG.map)
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
@@ -1,8 +1,6 @@
|
||||
package com.zhjt.mogo_core_function_devatools.upgrade
|
||||
|
||||
import android.app.NotificationManager
|
||||
import android.content.Context
|
||||
import androidx.core.app.NotificationCompat
|
||||
import com.elegant.utils.UiThreadHandler
|
||||
import com.mogo.eagle.core.data.obu.MogoObuConst
|
||||
import com.mogo.eagle.core.function.api.devatools.IMogoDevaToolsUpgradeListener
|
||||
@@ -128,31 +126,20 @@ class UpgradeManager : IDownload {
|
||||
}
|
||||
|
||||
/**
|
||||
* 鹰眼app下载监听 liyz
|
||||
* 鹰眼app下载监听
|
||||
*/
|
||||
fun updateUpgradeProgress(context: Context) {
|
||||
val builder = NotificationCompat.Builder(context)
|
||||
// builder.setSmallIcon(R.mipmap.icon1001);//todo emArrow 更换图标,去除地图下载图标的依赖关系
|
||||
builder.setContentTitle("下载")
|
||||
builder.setContentText("正在下载")
|
||||
val manager = context.getSystemService(Context.NOTIFICATION_SERVICE) as NotificationManager
|
||||
CallerDevaToolsUpgradeListenerManager.addListener(
|
||||
TAG,
|
||||
object : IMogoDevaToolsUpgradeListener {
|
||||
override fun onStart(url: String?) {}
|
||||
override fun onPause(url: String?) {}
|
||||
override fun onProgress(url: String?, length: Int) {
|
||||
builder.setProgress(100, length, false)
|
||||
manager.notify(0x3, builder.build())
|
||||
//下载进度提示
|
||||
builder.setContentText("已下载$length%")
|
||||
updateStatusBarDownloadView(true, "download", length)
|
||||
}
|
||||
|
||||
override fun onFinished(url: String?) {
|
||||
builder.setContentText("已下载" + 100 + "%")
|
||||
UiThreadHandler.postDelayed({
|
||||
manager.cancel(0x3)
|
||||
updateStatusBarDownloadView(false, "download", 100)
|
||||
}, 1000)
|
||||
}
|
||||
|
||||
@@ -98,20 +98,20 @@
|
||||
|
||||
</activity>
|
||||
|
||||
<activity
|
||||
android:name="com.mogo.eagle.core.function.main.VideoAdAtc"
|
||||
android:configChanges="mcc|mnc|locale|touchscreen|keyboard|keyboardHidden|navigation|screenLayout|fontScale|uiMode|orientation|screenSize|smallestScreenSize"
|
||||
android:enabled="true"
|
||||
android:exported="true"
|
||||
android:process=":video_ad"
|
||||
android:resizeableActivity="false"
|
||||
android:resumeWhilePausing="true"
|
||||
android:screenOrientation="landscape"
|
||||
android:stateNotNeeded="true"
|
||||
android:theme="@style/Main"
|
||||
android:windowSoftInputMode="adjustPan|stateHidden">
|
||||
<!-- <activity-->
|
||||
<!-- android:name="com.mogo.eagle.core.function.main.VideoAdAtc"-->
|
||||
<!-- android:configChanges="mcc|mnc|locale|touchscreen|keyboard|keyboardHidden|navigation|screenLayout|fontScale|uiMode|orientation|screenSize|smallestScreenSize"-->
|
||||
<!-- android:enabled="true"-->
|
||||
<!-- android:exported="true"-->
|
||||
<!-- android:process=":video_ad"-->
|
||||
<!-- android:resizeableActivity="false"-->
|
||||
<!-- android:resumeWhilePausing="true"-->
|
||||
<!-- android:screenOrientation="landscape"-->
|
||||
<!-- android:stateNotNeeded="true"-->
|
||||
<!-- android:theme="@style/Main"-->
|
||||
<!-- android:windowSoftInputMode="adjustPan|stateHidden">-->
|
||||
|
||||
</activity>
|
||||
<!-- </activity>-->
|
||||
|
||||
<activity
|
||||
android:name="com.mogo.eagle.core.function.main.AppListActivity"
|
||||
|
||||
@@ -21,6 +21,7 @@ import chassis.Chassis
|
||||
import chassis.ChassisStatesOuterClass
|
||||
import com.mogo.cloud.passport.MoGoAiCloudClient
|
||||
import com.mogo.cloud.passport.MoGoAiCloudClientConfig
|
||||
import com.mogo.commons.constants.SharedPrefsConstants
|
||||
import com.mogo.commons.debug.DebugConfig
|
||||
import com.mogo.commons.module.status.MogoStatusManager
|
||||
import com.mogo.eagle.core.data.app.AppConfigInfo
|
||||
@@ -117,6 +118,7 @@ internal class DebugSettingView @JvmOverloads constructor(
|
||||
private var logInfoView: LogInfoView? = null
|
||||
private var logViewAttach = false
|
||||
|
||||
@Volatile
|
||||
private var mAutoPilotStatusInfo: AutopilotStatusInfo? = null
|
||||
private var mGnssInfo: MogoLocation? = null
|
||||
|
||||
@@ -126,15 +128,19 @@ internal class DebugSettingView @JvmOverloads constructor(
|
||||
private var accelerationThresholdNum: Double = 0.0
|
||||
|
||||
// 感知识别「已知类型」数据个数
|
||||
@Volatile
|
||||
private var mIdentifyDataSize = 0
|
||||
|
||||
// 感知识别「未知类型」数据个数
|
||||
@Volatile
|
||||
private var mUnknownIdentifyDataSize = 0
|
||||
|
||||
// 引导线点个数
|
||||
@Volatile
|
||||
private var mTrajectoryInfoSize = 0
|
||||
|
||||
// 全局路径规划点个数
|
||||
@Volatile
|
||||
private var mRouteInfoSize = 0
|
||||
|
||||
//日志过滤标签集合
|
||||
@@ -202,7 +208,6 @@ internal class DebugSettingView @JvmOverloads constructor(
|
||||
CallerChassisGearStateListenerManager.addListener(TAG, this)
|
||||
CallerChassisSteeringStateListenerManager.addListener(TAG, this)
|
||||
CallerChassisThrottleStateListenerManager.addListener(TAG, this)
|
||||
|
||||
//添加 开发套件工具接口 监听
|
||||
CallerDevaToolsListenerManager.addListener(TAG, this)
|
||||
//添加 底盘灯光数据 监听
|
||||
@@ -253,6 +258,7 @@ internal class DebugSettingView @JvmOverloads constructor(
|
||||
CallerChassisLamplightListenerManager.removeListener(TAG)
|
||||
// 移除 obu获取信息 监听
|
||||
CallerObuInfoListenerManager.removeListener(TAG)
|
||||
|
||||
// 移除 业务配置监听
|
||||
CallerDevaToolsFuncConfigListenerManager.unRegisterDevaToolsFuncConfigListener(
|
||||
FuncBizConfig.FOUNDATION,
|
||||
@@ -365,6 +371,7 @@ internal class DebugSettingView @JvmOverloads constructor(
|
||||
swDevelopMode.visibility = View.GONE
|
||||
}
|
||||
}
|
||||
|
||||
/**
|
||||
* 开发者模式
|
||||
*/
|
||||
@@ -638,12 +645,6 @@ internal class DebugSettingView @JvmOverloads constructor(
|
||||
FunctionBuildConfig.isBeautyMode = isChecked
|
||||
}
|
||||
|
||||
tbV2NFromCar.isChecked = FunctionBuildConfig.isV2NFromCar
|
||||
//v2n车端预警
|
||||
tbV2NFromCar.setOnCheckedChangeListener { _, isChecked ->
|
||||
FunctionBuildConfig.isV2NFromCar = isChecked
|
||||
}
|
||||
|
||||
tbDrawAiCloudFusion.isChecked = FunctionBuildConfig.isDrawAiCloudFusion
|
||||
//云端感知绘制
|
||||
tbDrawAiCloudFusion.setOnCheckedChangeListener { _, isChecked ->
|
||||
@@ -1601,6 +1602,7 @@ internal class DebugSettingView @JvmOverloads constructor(
|
||||
tvAutopilotInfo.text = autopilotJson
|
||||
tvIpcInfo.text = autopilotJson
|
||||
tvIpcInfoKey.text = autopilotJson
|
||||
tvCmdbCarInfoContent.text = SharedPrefsMgr.getInstance(context).getString(SharedPrefsConstants.CAR_INFO)
|
||||
|
||||
tvCarInfo.text =
|
||||
"GPS时间:${(mGnssInfo?.satelliteTime?.times(1000))?.toLong()}\n" +
|
||||
@@ -2058,4 +2060,5 @@ internal class DebugSettingView @JvmOverloads constructor(
|
||||
override fun onObuDeviceId(obuDeviceId: String) {
|
||||
mObuDeviceId = obuDeviceId
|
||||
}
|
||||
|
||||
}
|
||||
@@ -27,6 +27,7 @@ class SpeedPanelView @JvmOverloads constructor(
|
||||
|
||||
var mContext: Context
|
||||
var mSpeedChartView: SpeedChartView
|
||||
@Volatile
|
||||
var mLatLng: MogoLocation? = null
|
||||
|
||||
init {
|
||||
|
||||
@@ -11,19 +11,19 @@ import com.mogo.eagle.core.widget.TextureVideoView
|
||||
*/
|
||||
class VideoAdAtc : AppCompatActivity() {
|
||||
|
||||
private lateinit var svpFrame: TextureVideoView
|
||||
|
||||
override fun onCreate(savedInstanceState: Bundle?) {
|
||||
super.onCreate(savedInstanceState)
|
||||
setContentView(R.layout.activity_video_ad_atc)
|
||||
|
||||
svpFrame = findViewById(R.id.svp_frame)
|
||||
|
||||
val url = "android.resource://" + packageName + "/" + R.raw.mogo_ad
|
||||
svpFrame.videoPath = url
|
||||
svpFrame.start()
|
||||
|
||||
BarUtils.hideStatusBarAndSticky(this.window)
|
||||
}
|
||||
// private lateinit var svpFrame: TextureVideoView
|
||||
//
|
||||
// override fun onCreate(savedInstanceState: Bundle?) {
|
||||
// super.onCreate(savedInstanceState)
|
||||
// setContentView(R.layout.activity_video_ad_atc)
|
||||
//
|
||||
// svpFrame = findViewById(R.id.svp_frame)
|
||||
//
|
||||
// val url = "android.resource://" + packageName + "/" + R.raw.mogo_ad
|
||||
// svpFrame.videoPath = url
|
||||
// svpFrame.start()
|
||||
//
|
||||
// BarUtils.hideStatusBarAndSticky(this.window)
|
||||
// }
|
||||
|
||||
}
|
||||
@@ -207,6 +207,29 @@
|
||||
android:layout_height="1dp"
|
||||
android:background="#F0F0F0" />
|
||||
|
||||
<TextView
|
||||
android:id="@+id/tvCmdbCarInfo"
|
||||
style="@style/DebugSettingText"
|
||||
android:layout_width="match_parent"
|
||||
android:layout_height="wrap_content"
|
||||
android:text="车辆信息: " />
|
||||
|
||||
<View
|
||||
android:layout_width="match_parent"
|
||||
android:layout_height="1dp"
|
||||
android:background="#F0F0F0" />
|
||||
<TextView
|
||||
android:id="@+id/tvCmdbCarInfoContent"
|
||||
style="@style/DebugSettingText"
|
||||
android:layout_width="match_parent"
|
||||
android:layout_height="wrap_content"
|
||||
android:minLines="5" />
|
||||
|
||||
<View
|
||||
android:layout_width="match_parent"
|
||||
android:layout_height="1dp"
|
||||
android:background="#F0F0F0" />
|
||||
|
||||
<ToggleButton
|
||||
android:id="@+id/tbIsDemoMode"
|
||||
android:layout_width="match_parent"
|
||||
@@ -243,18 +266,6 @@
|
||||
android:textOn="关闭感知优化模式"
|
||||
android:textSize="@dimen/dp_24" />
|
||||
|
||||
<ToggleButton
|
||||
android:id="@+id/tbV2NFromCar"
|
||||
android:layout_width="match_parent"
|
||||
android:layout_height="wrap_content"
|
||||
android:layout_margin="@dimen/dp_10"
|
||||
android:padding="@dimen/dp_20"
|
||||
android:background="@drawable/radio_button_normal_background_right"
|
||||
android:textColor="#000"
|
||||
android:textOff="开启车端V2N预警"
|
||||
android:textOn="关闭车端V2N预警"
|
||||
android:textSize="@dimen/dp_24" />
|
||||
|
||||
<ToggleButton
|
||||
android:id="@+id/tbDrawAiCloudFusion"
|
||||
android:layout_width="match_parent"
|
||||
|
||||
@@ -217,8 +217,8 @@
|
||||
android:scaleY="1.2"
|
||||
android:scaleX="1.2"
|
||||
app:layout_constraintTop_toBottomOf="@id/tbObuWeaknessTrafficSop"
|
||||
app:layout_constraintLeft_toRightOf="@id/verticalGuideLine"
|
||||
app:layout_constraintRight_toRightOf="parent"
|
||||
app:layout_constraintRight_toLeftOf="@id/verticalGuideLine"
|
||||
app:layout_constraintLeft_toLeftOf="parent"
|
||||
/>
|
||||
|
||||
<TextView
|
||||
@@ -226,7 +226,7 @@
|
||||
android:layout_width="wrap_content"
|
||||
android:layout_height="wrap_content"
|
||||
app:layout_constraintLeft_toLeftOf="parent"
|
||||
app:layout_constraintTop_toBottomOf="@id/tbCloudWeaknessTrafficSop"
|
||||
app:layout_constraintTop_toBottomOf="@id/tbIPCReport"
|
||||
android:text="变道速度阈值:"
|
||||
android:textSize="@dimen/dp_36"
|
||||
android:textColor="#1A1A1A"
|
||||
|
||||
Binary file not shown.
@@ -23,7 +23,7 @@ public class SpeedLimitDataManager implements IMoGoChassisLocationGCJ02Listener
|
||||
|
||||
private final static String TAG = "SpeedLimitDataManager";
|
||||
private static volatile SpeedLimitDataManager instance;
|
||||
private MogoLocation mLocation;
|
||||
private volatile MogoLocation mLocation;
|
||||
|
||||
private SpeedLimitDataManager() {
|
||||
}
|
||||
|
||||
@@ -1,6 +1,7 @@
|
||||
package com.mogo.eagle.core.function.business.ai.net
|
||||
|
||||
import com.mogo.cloud.passport.MoGoAiCloudClientConfig
|
||||
import com.mogo.commons.constants.HostConst
|
||||
import com.mogo.commons.debug.DebugConfig
|
||||
import com.mogo.eagle.core.data.BaseResponse
|
||||
import com.mogo.eagle.core.function.business.ai.AiCloudIdentifyDataManager.Companion.END_METRE
|
||||
@@ -27,7 +28,7 @@ class AiCloudIdentifyNetWorkModel {
|
||||
return host
|
||||
}
|
||||
|
||||
private fun getNetWorkApi(baseUrl: String = getHost()): IAiCloudIdentifyApiService {
|
||||
private fun getNetWorkApi(baseUrl: String = HostConst.getEagleHost()): IAiCloudIdentifyApiService {
|
||||
return MoGoRetrofitFactory.getInstanceNoCallAdapter(baseUrl)
|
||||
.create(IAiCloudIdentifyApiService::class.java)
|
||||
}
|
||||
|
||||
@@ -8,6 +8,6 @@ import retrofit2.http.POST
|
||||
interface IAiCloudIdentifyApiService {
|
||||
|
||||
@Headers("Content-type:application/json;charset=UTF-8")
|
||||
@POST("yycp-c-v2x-service/dataFusion/remoteDrivingSet")
|
||||
@POST("eagle-eye-dns/yycp-c-v2x-service/dataFusion/remoteDrivingSet")
|
||||
suspend fun identifyRange(@Body map: MutableMap<String, Any>): BaseResponse<Any>
|
||||
}
|
||||
@@ -49,14 +49,6 @@ object FunctionBuildConfig {
|
||||
@JvmField
|
||||
var detouringSpeed = 3
|
||||
|
||||
/**
|
||||
* 是否从车端融合过来的v2n事件
|
||||
* 默认关闭,开启后接收车端融合预警,关闭云端长链V2N
|
||||
*/
|
||||
@Volatile
|
||||
@JvmField
|
||||
var isV2NFromCar = false
|
||||
|
||||
/**
|
||||
* 是否是感知优化模式
|
||||
* 默认开启
|
||||
|
||||
@@ -0,0 +1,11 @@
|
||||
package com.mogo.eagle.core.function.api.autopilot
|
||||
|
||||
/**
|
||||
* 清扫车(福田)后摄像头视频数据
|
||||
*/
|
||||
interface IMoGoSweeperFutianBackCameraVideoListener {
|
||||
/**
|
||||
* 清扫车(福田)后摄像头视频数据 10Hz 每一帧为一张图片
|
||||
*/
|
||||
fun onSweeperFutianBackCameraVideo(data: ByteArray)
|
||||
}
|
||||
@@ -0,0 +1,23 @@
|
||||
package com.mogo.eagle.core.function.call.autopilot
|
||||
|
||||
import chassis.ChassisStatesOuterClass
|
||||
import chassis.VehicleStateOuterClass
|
||||
import com.mogo.eagle.core.function.api.autopilot.IMoGoSweeperFutianBackCameraVideoListener
|
||||
import com.mogo.eagle.core.function.api.autopilot.IMoGoSweeperFutianCleanSystemListener
|
||||
import com.mogo.eagle.core.function.call.base.CallerBase
|
||||
|
||||
/**
|
||||
* 清扫车(福田)后摄像头视频数据
|
||||
*/
|
||||
object CallerSweeperFutianBackCameraVideoListenerManager : CallerBase<IMoGoSweeperFutianBackCameraVideoListener>() {
|
||||
|
||||
/**
|
||||
* 后摄像头视频数据
|
||||
*/
|
||||
fun invokeSweeperFutianBackCameraVideo(data: ByteArray) {
|
||||
M_LISTENERS.forEach {
|
||||
val listener = it.value
|
||||
listener.onSweeperFutianBackCameraVideo(data)
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -14,7 +14,7 @@ public class MogoLocationInfoServices {
|
||||
private static final String TAG = "MogoLocationInfoServices-sdk";
|
||||
|
||||
private static volatile MogoLocationInfoServices sInstance;
|
||||
private MogoLocation mLocation;
|
||||
private volatile MogoLocation mLocation;
|
||||
|
||||
private MogoLocationInfoServices() {
|
||||
}
|
||||
|
||||
@@ -6,7 +6,7 @@ import "geometry.proto";
|
||||
enum ProtocolVersion
|
||||
{
|
||||
Defaultver = 0;
|
||||
CurrentVersion = 10; //每次修改proto文件增加1
|
||||
CurrentVersion = 12; //每次修改proto文件增加1
|
||||
}
|
||||
|
||||
enum MessageType
|
||||
@@ -30,6 +30,7 @@ enum MessageType
|
||||
MsgTypeOBU = 0x1000a; //OBU
|
||||
MsgTypeChassisStates = 0x1000b; //重构后的底盘状态, 透传
|
||||
MsgTypeFunctionStates = 0x1000c; //重构后的功能状态, 透传
|
||||
MsgTypeBackCameraVideo = 0x1000d; //清扫车后部摄像头视频 10hz
|
||||
|
||||
MsgTypeBasicInfoReq = 0x10100; //自动驾驶设备基础信息请求
|
||||
MsgTypeBasicInfoResp = 0x10101; //自动驾驶设备基础信息应答
|
||||
@@ -60,6 +61,7 @@ enum MessageType
|
||||
MsgTypeTripInfoEvent = 0x1011a; //行程信息
|
||||
MsgTypeBagManagerCmd = 0x1011b; //bag管理
|
||||
MsgTypePlanningCmd = 0x1011c; //给planning的指令
|
||||
MsgTypeSetParamReqV2 = 0x1011d; //设置参数命令V2
|
||||
}
|
||||
|
||||
message Header
|
||||
@@ -139,9 +141,16 @@ message TrackedObject
|
||||
string strUuid = 101;//String类型车辆ID
|
||||
}
|
||||
|
||||
message BlindAreaData
|
||||
{
|
||||
float angleResolution = 1;
|
||||
repeated int32 distances = 2;
|
||||
}
|
||||
|
||||
message TrackedObjects
|
||||
{
|
||||
repeated TrackedObject objs = 1;
|
||||
BlindAreaData blindAreaData = 2;
|
||||
}
|
||||
|
||||
// message definition for MsgTypeGnssInfo
|
||||
@@ -598,4 +607,8 @@ message PlanningCmd
|
||||
PullOverCmd pullOverCmd = 1;
|
||||
}
|
||||
|
||||
//message definition for MsgTypeSetParamReqV2
|
||||
//refer to param_set_cmd.proto for details
|
||||
|
||||
//message definition for MsgTypeBackCameraVideo
|
||||
//payload:jpeg data
|
||||
|
||||
20
libraries/mogo-adas-data/src/main/proto/param_set_cmd.proto
Normal file
20
libraries/mogo-adas-data/src/main/proto/param_set_cmd.proto
Normal file
@@ -0,0 +1,20 @@
|
||||
syntax = "proto3";
|
||||
package mogo.telematics;
|
||||
|
||||
enum ParamSetType
|
||||
{
|
||||
ParamSetTypeNone = 0;
|
||||
ParamSetTypeBlindArea = 1;
|
||||
}
|
||||
|
||||
message ParamSetCmd
|
||||
{
|
||||
uint32 src = 1; // 0: none, 1:pad, 2:aicloud
|
||||
ParamSetType type = 2;
|
||||
oneof Value {
|
||||
bool boolValue = 3;
|
||||
int64 intValue = 4;
|
||||
double floatValue = 5;
|
||||
string stringValue = 6;
|
||||
}
|
||||
}
|
||||
@@ -21,7 +21,6 @@ import androidx.annotation.NonNull;
|
||||
import androidx.annotation.Nullable;
|
||||
|
||||
import com.google.protobuf.InvalidProtocolBufferException;
|
||||
import com.zhjt.mogo.adas.data.bean.AutopilotStatistics;
|
||||
import com.zhidao.support.adas.high.bean.VersionCompatibility;
|
||||
import com.zhidao.support.adas.high.common.AutopilotReview;
|
||||
import com.zhidao.support.adas.high.common.ByteUtil;
|
||||
@@ -45,6 +44,7 @@ import com.zhidao.support.adas.high.socket.FpgaSocket;
|
||||
import com.zhidao.support.adas.high.subscribe.SubscribeInterface;
|
||||
import com.zhidao.support.adas.high.subscribe.SubscribeInterfaceOptions;
|
||||
import com.zhidao.support.adas.high.thread.DispatchHandler;
|
||||
import com.zhjt.mogo.adas.data.bean.AutopilotStatistics;
|
||||
import com.zhjt.service.chain.ChainLog;
|
||||
import com.zhjt.service.chain.TracingConstants;
|
||||
|
||||
@@ -251,7 +251,8 @@ public class AdasChannel implements IAdasNetCommApi, FpgaSocket.IWebSocketConnec
|
||||
// dispatchHandlers.put(MessagePad.MessageType.MsgTypeRecordDataConfigResp, new DispatchHandler(MessagePad.MessageType.MsgTypeRecordDataConfigResp, this));
|
||||
//Planning决策状态
|
||||
// dispatchHandlers.put(MessagePad.MessageType.MsgTypePlanningDecisionState, new DispatchHandler(MessagePad.MessageType.MsgTypePlanningDecisionState, this));
|
||||
|
||||
//清扫车后摄像头数据
|
||||
dispatchHandlers.put(MessagePad.MessageType.MsgTypeBackCameraVideo, new DispatchHandler(MessagePad.MessageType.MsgTypeBackCameraVideo, this));
|
||||
}
|
||||
|
||||
/**
|
||||
@@ -446,32 +447,17 @@ public class AdasChannel implements IAdasNetCommApi, FpgaSocket.IWebSocketConnec
|
||||
public void onDispatchRaw(MessagePad.MessageType type, RawData raw) {
|
||||
// CupidLogUtils.i(TAG, "onDispatchRaw=" + Thread.currentThread().getName() + " TID=" + android.os.Process.myTid());
|
||||
try {
|
||||
//分发点云原始数据
|
||||
if (type == MessagePad.MessageType.MsgTypePointCloud) {
|
||||
int len = raw.getPackageLengthValue() - raw.getOffsetValue();
|
||||
byte[] bytes = new byte[len];
|
||||
System.arraycopy(raw.originalData.toByteArray(), raw.getOffsetValue(), bytes, 0, len);
|
||||
calculateTimeConsumingOnDispatchRaw("3D点云", raw.receiveTime);
|
||||
long nowTime = 0;
|
||||
if (CupidLogUtils.isEnableLog())
|
||||
nowTime = SystemClock.elapsedRealtime();
|
||||
mAdasListener.onPointCloud(bytes);
|
||||
calculateTimeConsumingBusiness("3D点云", nowTime);
|
||||
} else {
|
||||
if (rawUnpack != null) {
|
||||
if (raw.getProtocolStatus() == ProtocolStatus.SUCCEED) {
|
||||
MessagePad.Header header = raw.getHeader();
|
||||
MessagePad.MessageType messageType = header.getMsgType();
|
||||
IMsg iMsg = myMessageFactory.createMessage(messageType);
|
||||
if (iMsg == null) {
|
||||
callError(ProtocolStatus.MESSAGE_TYPE_UNKNOWN, raw.originalData.toByteArray());
|
||||
return;
|
||||
}
|
||||
iMsg.handlerMsg(raw, mAdasListener);
|
||||
} else {
|
||||
callError(raw.getProtocolStatus(), raw.originalData.toByteArray());
|
||||
}
|
||||
if (raw.getProtocolStatus() == ProtocolStatus.SUCCEED) {
|
||||
MessagePad.Header header = raw.getHeader();
|
||||
MessagePad.MessageType messageType = header.getMsgType();
|
||||
IMsg iMsg = myMessageFactory.createMessage(messageType);
|
||||
if (iMsg == null) {
|
||||
callError(ProtocolStatus.MESSAGE_TYPE_UNKNOWN, raw.originalData.toByteArray());
|
||||
return;
|
||||
}
|
||||
iMsg.handlerMsg(raw, mAdasListener);
|
||||
} else {
|
||||
callError(raw.getProtocolStatus(), raw.originalData.toByteArray());
|
||||
}
|
||||
} catch (Exception e) {
|
||||
callError(ProtocolStatus.BUSINESS_DATA_PARSE_FAILED, raw.originalData.toByteArray());
|
||||
|
||||
@@ -1,15 +1,16 @@
|
||||
package com.zhidao.support.adas.high;
|
||||
|
||||
import com.mogo.support.obu.ObuScene;
|
||||
import com.zhjt.mogo.adas.data.bean.AutopilotStatistics;
|
||||
import com.zhidao.support.adas.high.common.ProtocolStatus;
|
||||
import com.zhjt.mogo.adas.data.bean.AutopilotStatistics;
|
||||
|
||||
import org.jetbrains.annotations.NotNull;
|
||||
|
||||
import bag_manager.BagManagerOuterClass;
|
||||
import chassis.ChassisStatesOuterClass;
|
||||
import chassis.VehicleStateOuterClass;
|
||||
import function_state_management.FunctionStates;
|
||||
import mogo.telematics.pad.MessagePad;
|
||||
import mogo.v2x.ObuWarningEvent;
|
||||
import mogo_msg.MogoReportMsg;
|
||||
import perception.TrafficLightOuterClass;
|
||||
import planning.RoboSweeperTaskIndexOuterClass;
|
||||
@@ -108,9 +109,10 @@ public interface OnAdasListener {
|
||||
/**
|
||||
* 透传的点云数据
|
||||
*
|
||||
* @param header 头
|
||||
* @param pointCloud 原始数据 只包含PointCloud数据
|
||||
*/
|
||||
void onPointCloud(byte[] pointCloud);
|
||||
void onPointCloud(MessagePad.Header header, byte[] pointCloud);
|
||||
|
||||
/**
|
||||
* planning障碍物
|
||||
@@ -231,10 +233,18 @@ public interface OnAdasListener {
|
||||
* 重构后的功能状态
|
||||
*
|
||||
* @param header 头
|
||||
* @param functionStates 头
|
||||
* @param functionStates 数据
|
||||
*/
|
||||
void onFunctionStates(MessagePad.Header header, FunctionStates.FSMFunctionStates functionStates);
|
||||
|
||||
/**
|
||||
* 清扫车后部摄像头视频 10Hz
|
||||
*
|
||||
* @param header 头
|
||||
* @param data 数据
|
||||
*/
|
||||
void onBackCameraVideo(@NotNull MessagePad.Header header, @NotNull byte[] data);
|
||||
|
||||
/**
|
||||
* 清扫车指标数据
|
||||
*
|
||||
|
||||
@@ -25,6 +25,7 @@ public enum MessageType {
|
||||
TYPE_RECEIVE_PLANNING_OBJECTS(MessagePad.MessageType.MsgTypePlanningObjects, "Planning障碍物"),
|
||||
TYPE_RECEIVE_CHASSIS_STATES(MessagePad.MessageType.MsgTypeChassisStates, "底盘状态"),
|
||||
TYPE_RECEIVE_FUNCTION_STATES(MessagePad.MessageType.MsgTypeFunctionStates, "重构后功能状态"),
|
||||
TYPE_RECEIVE_BACK_CAMERA_VIDEO(MessagePad.MessageType.MsgTypeBackCameraVideo, "清扫车后摄像头"),
|
||||
|
||||
TYPE_RECEIVE_BASIC_INFO_REQ(MessagePad.MessageType.MsgTypeBasicInfoReq, "自动驾驶设备基础信息请求"),
|
||||
TYPE_SEND_BASIC_INFO_RESP(MessagePad.MessageType.MsgTypeBasicInfoResp, "自动驾驶设备基础信息应答"),
|
||||
|
||||
@@ -0,0 +1,33 @@
|
||||
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;
|
||||
|
||||
/**
|
||||
* 清扫车后摄像头
|
||||
*/
|
||||
public class BackCameraVideoMessage extends MyAbstractMessageHandler {
|
||||
|
||||
public BackCameraVideoMessage() {
|
||||
}
|
||||
|
||||
@Override
|
||||
public void handlerMsg(RawData raw, OnAdasListener adasListener) throws InvalidProtocolBufferException {
|
||||
int len = raw.getPackageLengthValue() - raw.getOffsetValue();
|
||||
byte[] data = new byte[len];
|
||||
System.arraycopy(raw.originalData.toByteArray(), raw.getOffsetValue(), data, 0, len);
|
||||
AdasChannel.calculateTimeConsumingOnDispatchRaw("清扫车后摄像头", raw.receiveTime);
|
||||
long nowTime = 0;
|
||||
if (CupidLogUtils.isEnableLog())
|
||||
nowTime = SystemClock.elapsedRealtime();
|
||||
if (adasListener != null) {
|
||||
adasListener.onBackCameraVideo(raw.getHeader(), data);
|
||||
}
|
||||
AdasChannel.calculateTimeConsumingBusiness("清扫车后摄像头", nowTime);
|
||||
}
|
||||
}
|
||||
@@ -36,6 +36,8 @@ public class MyMessageFactory implements IMyMessageFactory {
|
||||
private IMsg functionStatesMessage;//重构后的功能状态
|
||||
private IMsg sweeperTaskIndexDataMessage;//清扫车指标数据
|
||||
private IMsg bagManagerMessage;//Bag管理应答
|
||||
private IMsg backCameraVideoMessage;//清扫车后摄像头
|
||||
private IMsg pointCloudMessage;//3D点云
|
||||
|
||||
private final AutopilotReview autopilotReview;
|
||||
|
||||
@@ -99,6 +101,12 @@ public class MyMessageFactory implements IMyMessageFactory {
|
||||
predictionObstacleTrajectoryMessage = new PredictionObstacleTrajectoryMessage();
|
||||
}
|
||||
return predictionObstacleTrajectoryMessage;
|
||||
} else if (messageType == MessageType.TYPE_RECEIVE_POINT_CLOUD.typeCode) {
|
||||
//3D点云
|
||||
if (pointCloudMessage == null) {
|
||||
pointCloudMessage = new PointCloudMessage();
|
||||
}
|
||||
return pointCloudMessage;
|
||||
} else if (messageType == MessageType.TYPE_RECEIVE_PLANNING_OBJECTS.typeCode) {
|
||||
//planning障碍物
|
||||
if (planningObjectsMessage == null) {
|
||||
@@ -183,6 +191,12 @@ public class MyMessageFactory implements IMyMessageFactory {
|
||||
bagManagerMessage = new BagManagerMessage();
|
||||
}
|
||||
return bagManagerMessage;
|
||||
} else if (messageType == MessageType.TYPE_RECEIVE_BACK_CAMERA_VIDEO.typeCode) {
|
||||
//清扫车后摄像头
|
||||
if (backCameraVideoMessage == null) {
|
||||
backCameraVideoMessage = new BackCameraVideoMessage();
|
||||
}
|
||||
return backCameraVideoMessage;
|
||||
} else {
|
||||
//MessageType.TYPE_DEFAULT.typeCode
|
||||
return null;
|
||||
|
||||
@@ -0,0 +1,34 @@
|
||||
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;
|
||||
|
||||
/**
|
||||
* 3D点云原始数据
|
||||
*/
|
||||
public class PointCloudMessage extends MyAbstractMessageHandler {
|
||||
|
||||
public PointCloudMessage() {
|
||||
}
|
||||
|
||||
@Override
|
||||
public void handlerMsg(RawData raw, OnAdasListener adasListener) throws InvalidProtocolBufferException {
|
||||
int len = raw.getPackageLengthValue() - raw.getOffsetValue();
|
||||
byte[] data = new byte[len];
|
||||
System.arraycopy(raw.originalData.toByteArray(), raw.getOffsetValue(), data, 0, len);
|
||||
AdasChannel.calculateTimeConsumingOnDispatchRaw("3D点云", raw.receiveTime);
|
||||
long nowTime = 0;
|
||||
if (CupidLogUtils.isEnableLog())
|
||||
nowTime = SystemClock.elapsedRealtime();
|
||||
if (adasListener != null) {
|
||||
adasListener.onPointCloud(raw.getHeader(), data);
|
||||
|
||||
}
|
||||
AdasChannel.calculateTimeConsumingBusiness("3D点云", nowTime);
|
||||
}
|
||||
}
|
||||
Reference in New Issue
Block a user