[opt3.0_back_camera] 福田清扫车后摄像头数据接收
This commit is contained in:
@@ -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) {
|
||||
|
||||
|
||||
@@ -369,7 +369,7 @@ class MoGoAdasListenerImpl : OnAdasListener {
|
||||
//他车轨迹预测
|
||||
}
|
||||
|
||||
override fun onPointCloud(pointCloud: ByteArray?) {
|
||||
override fun onPointCloud(header: MessagePad.Header, pointCloud: ByteArray?) {
|
||||
//点云数据透传
|
||||
CallerAutopilotPointCloudListenerManager.invokeAutopilotPointCloudDataUpdate(pointCloud)
|
||||
}
|
||||
@@ -596,6 +596,16 @@ class MoGoAdasListenerImpl : OnAdasListener {
|
||||
|
||||
}
|
||||
|
||||
/**
|
||||
* 清扫车后部摄像头视频 10Hz
|
||||
*
|
||||
* @param header 头
|
||||
* @param data 数据
|
||||
*/
|
||||
override fun onBackCameraVideo(header: MessagePad.Header, data: ByteArray) {
|
||||
CallerSweeperFutianBackCameraVideoListenerManager.invokeSweeperFutianBackCameraVideo(data)
|
||||
}
|
||||
|
||||
/**
|
||||
* 清扫车指标数据
|
||||
*
|
||||
|
||||
@@ -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)
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -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