merge
This commit is contained in:
@@ -94,7 +94,7 @@ public class V2XWarnDataDrawer extends BaseDrawer implements IMogoStatusChangedL
|
||||
MogoLatLng stopLineNew = Trigonometric.getNewLocation(data.getStopLines().get(1), 5, 180);
|
||||
MogoLatLng newLocation = Trigonometric.getNewLocation(mogoLatLng, 5, 180);
|
||||
|
||||
IMogoMarker marker = drawMarker(markerShowEntity);
|
||||
IMogoMarker marker = drawMarker(markerShowEntity, modeResType(data.getType()));
|
||||
//识别物
|
||||
marker.addDynamicAnchorPosition(new MogoLatLng(
|
||||
data.getDirection() == 1 ? data.getStopLines().get(1).lat : data.getCollisionLat(),
|
||||
@@ -111,14 +111,31 @@ public class V2XWarnDataDrawer extends BaseDrawer implements IMogoStatusChangedL
|
||||
|
||||
}
|
||||
|
||||
//根据识别物类型 (行人0/自行车1/摩托车2/小汽车3/公交车4)获取3D模型(对应查看getModelRes)
|
||||
private int modeResType(int dataType) {
|
||||
switch (dataType) {
|
||||
case 0:
|
||||
return 1;
|
||||
case 1:
|
||||
return 2;
|
||||
case 2:
|
||||
return 4;
|
||||
case 3:
|
||||
return 3;
|
||||
case 4:
|
||||
return 6;
|
||||
}
|
||||
return 1;
|
||||
}
|
||||
|
||||
public IMogoMarker drawMarker(MarkerShowEntity markerShowEntity) {
|
||||
|
||||
public IMogoMarker drawMarker(MarkerShowEntity markerShowEntity, int modeResType) {
|
||||
MogoMarkerOptions options = new MogoMarkerOptions()
|
||||
.object(markerShowEntity)
|
||||
.latitude(markerShowEntity.getMarkerLocation().getLat())
|
||||
.longitude(markerShowEntity.getMarkerLocation().getLon());
|
||||
IMarkerView iMarkerView = MapMarkerAdapter.getMarkerView(mContext, markerShowEntity, options);
|
||||
options.icon3DRes(getModelRes(1)); //TODO
|
||||
options.icon3DRes(getModelRes(modeResType)); //TODO
|
||||
|
||||
options.anchorColor("#FB3C3CFF"); //红色#FF3036 蓝色:#256BFF
|
||||
IMogoMarker marker = MogoApisHandler.getInstance().getApis().getMapServiceApi().getMarkerManager(mContext).addMarker(markerShowEntity.getMarkerType(), options);
|
||||
|
||||
@@ -10,14 +10,13 @@ import org.json.JSONObject;
|
||||
import java.util.ArrayList;
|
||||
import java.util.List;
|
||||
|
||||
public
|
||||
/*
|
||||
* @author congtaowang
|
||||
* @since 2020/12/14
|
||||
*
|
||||
* 实时坐标数据处理中心
|
||||
*/
|
||||
class SnapshotLocationController {
|
||||
/*
|
||||
* @author congtaowang
|
||||
* @since 2020/12/14
|
||||
*
|
||||
* 实时坐标数据处理中心
|
||||
*/
|
||||
public class SnapshotLocationController {
|
||||
|
||||
private static final String TAG = "SnapshotLocationController";
|
||||
|
||||
@@ -141,7 +140,7 @@ class SnapshotLocationController {
|
||||
mLastLocationInfo = null;
|
||||
}
|
||||
}
|
||||
Logger.d(TAG, "upload loc size = %s", list == null ? 0 : list.size());
|
||||
//Logger.d( TAG, "upload loc size = %s", list == null ? 0 : list.size() );
|
||||
return list;
|
||||
}
|
||||
|
||||
@@ -151,7 +150,7 @@ class SnapshotLocationController {
|
||||
* @return 精度
|
||||
*/
|
||||
public int getDataAccuracy() {
|
||||
Logger.d(TAG, "upload loc accuracy = %s", mDataAccuracy);
|
||||
//Logger.d( TAG, "upload loc accuracy = %s", mDataAccuracy );
|
||||
return mDataAccuracy;
|
||||
}
|
||||
|
||||
|
||||
@@ -185,12 +185,12 @@ public class CameraLiveNoticeHelper implements IMogoCloudOnMsgListener {
|
||||
|
||||
@Override
|
||||
public void onMsgSend(long id) {
|
||||
Logger.d(TAG, "onMsgSend id : " + id);
|
||||
//Logger.d(TAG, "onMsgSend id : " + id);
|
||||
}
|
||||
|
||||
@Override
|
||||
public void onMsgReceived(MogoSnapshotSetData mogoSnapshotSetData) {
|
||||
Logger.d(TAG, "onMsgReceived mogoSnapshotSetData : " + mogoSnapshotSetData);
|
||||
//Logger.d(TAG, "onMsgReceived mogoSnapshotSetData : " + mogoSnapshotSetData);
|
||||
renderMarker(mogoSnapshotSetData);
|
||||
}
|
||||
}
|
||||
|
||||
@@ -31,7 +31,9 @@ import com.mogo.service.adas.IMogoADASControlStatusChangedListener;
|
||||
import com.mogo.service.fragmentmanager.FragmentStackTransactionListener;
|
||||
import com.mogo.service.fragmentmanager.IMogoFragmentManager;
|
||||
import com.mogo.service.module.IMogoModuleProvider;
|
||||
import com.mogo.service.statusmanager.IMogoStatusChangedListener;
|
||||
import com.mogo.service.statusmanager.IMogoStatusManager;
|
||||
import com.mogo.service.statusmanager.StatusDescriptor;
|
||||
import com.mogo.service.v2x.IV2XListener;
|
||||
import com.mogo.skin.support.SkinMode;
|
||||
import com.mogo.utils.NetworkUtils;
|
||||
@@ -50,6 +52,7 @@ import java.util.List;
|
||||
*/
|
||||
public class MainActivity extends MvpActivity<MainView, MainPresenter> implements MainView,
|
||||
IMogoLocationListener,
|
||||
IMogoStatusChangedListener,
|
||||
IMogoADASControlStatusChangedListener,
|
||||
FragmentStackTransactionListener {
|
||||
|
||||
@@ -151,8 +154,9 @@ public class MainActivity extends MvpActivity<MainView, MainPresenter> implement
|
||||
super.onCreate(savedInstanceState);
|
||||
ContextHolderUtil.holdContext(this);
|
||||
mPresenter.postLoadModuleMsg();
|
||||
|
||||
NetworkUtils.listenNetStrength(this);
|
||||
DisplayEffectsHelper.getInstance().init(clSpecialEffect);
|
||||
mServiceApis.getStatusManagerApi().registerStatusChangedListener(TAG, StatusDescriptor.VR_MODE, this);
|
||||
}
|
||||
|
||||
private void init() {
|
||||
@@ -402,4 +406,23 @@ public class MainActivity extends MvpActivity<MainView, MainPresenter> implement
|
||||
mServiceApis.getShareManager().releaseContext();
|
||||
mServiceApis.getSkinSupportInstallerApi().onDestroy();
|
||||
}
|
||||
|
||||
@Override
|
||||
public void onStatusChanged(StatusDescriptor descriptor, boolean isTrue) {
|
||||
FrameLayout.LayoutParams entranceParams = ((FrameLayout.LayoutParams) mEntrance.getLayoutParams());
|
||||
if (isTrue) {
|
||||
entranceParams.leftMargin = getResources().getDimensionPixelSize(R.dimen.module_main_entrance_fragment_container_marginLeft_in_vr_mode);
|
||||
} else {
|
||||
entranceParams.leftMargin = getResources().getDimensionPixelSize(R.dimen.module_main_id_entrance_fragment_container_marginLeft);
|
||||
}
|
||||
mEntrance.setLayoutParams(entranceParams);
|
||||
if (descriptor == StatusDescriptor.VR_MODE) {
|
||||
if (isTrue) {
|
||||
clSpecialEffect.setVisibility(View.VISIBLE);
|
||||
} else {
|
||||
clSpecialEffect.setVisibility(View.GONE);
|
||||
}
|
||||
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
@@ -21,6 +21,7 @@
|
||||
<dimen name="module_main_header_fragment_container_marginTop">15px</dimen>
|
||||
<dimen name="module_main_header_fragment_container_marginLeft">460px</dimen>
|
||||
<dimen name="module_main_id_entrance_fragment_container_marginLeft">444px</dimen>
|
||||
<dimen name="module_main_entrance_fragment_container_marginLeft_in_vr_mode" >0px</dimen>
|
||||
<dimen name="module_main_id_left_panel_fragment_container_width">350px</dimen>
|
||||
<dimen name="module_main_entrance_fragment_container_padding">10px</dimen>
|
||||
<dimen name="module_main_entrance_fragment_container_padding_top">16px</dimen>
|
||||
|
||||
@@ -20,6 +20,7 @@
|
||||
<dimen name="module_main_header_fragment_container_marginTop">30px</dimen>
|
||||
<dimen name="module_main_header_fragment_container_marginLeft">830px</dimen>
|
||||
<dimen name="module_main_id_entrance_fragment_container_marginLeft">590px</dimen>
|
||||
<dimen name="module_main_entrance_fragment_container_marginLeft_in_vr_mode" >0px</dimen>
|
||||
<dimen name="module_main_entrance_fragment_container_padding">30px</dimen>
|
||||
<dimen name="module_main_entrance_fragment_container_padding_top">70px</dimen>
|
||||
|
||||
|
||||
@@ -20,6 +20,7 @@
|
||||
<dimen name="module_main_header_fragment_container_marginTop">30px</dimen>
|
||||
<dimen name="module_main_header_fragment_container_marginLeft">830px</dimen>
|
||||
<dimen name="module_main_id_entrance_fragment_container_marginLeft">800px</dimen>
|
||||
<dimen name="module_main_entrance_fragment_container_marginLeft_in_vr_mode" >0px</dimen>
|
||||
<dimen name="module_main_entrance_fragment_container_padding">20px</dimen>
|
||||
<dimen name="module_main_entrance_fragment_container_padding_top">30px</dimen>
|
||||
|
||||
|
||||
@@ -21,6 +21,7 @@
|
||||
<dimen name="module_main_header_fragment_container_marginTop">15px</dimen>
|
||||
<dimen name="module_main_header_fragment_container_marginLeft">460px</dimen>
|
||||
<dimen name="module_main_id_entrance_fragment_container_marginLeft">444px</dimen>
|
||||
<dimen name="module_main_entrance_fragment_container_marginLeft_in_vr_mode" >0px</dimen>
|
||||
<dimen name="module_main_id_left_panel_fragment_container_width">350px</dimen>
|
||||
<dimen name="module_main_entrance_fragment_container_padding">10px</dimen>
|
||||
<dimen name="module_main_entrance_fragment_container_padding_top">16px</dimen>
|
||||
|
||||
@@ -11,7 +11,21 @@ public
|
||||
* @author congtaowang
|
||||
* @since 2021/3/26
|
||||
*
|
||||
* 描述
|
||||
* 生成测试数据,执行指令
|
||||
* java LocParse.java
|
||||
*
|
||||
* loc.txt
|
||||
* adas0.txt
|
||||
* adas1.txt
|
||||
* adas2.txt
|
||||
* adas3.txt
|
||||
* adas4.txt
|
||||
* adas5.txt
|
||||
* adas6.txt
|
||||
* adas7.txt
|
||||
* adas8.txt
|
||||
* adas9.txt
|
||||
*
|
||||
*/
|
||||
class LocParse {
|
||||
|
||||
|
||||
File diff suppressed because it is too large
Load Diff
File diff suppressed because it is too large
Load Diff
File diff suppressed because it is too large
Load Diff
File diff suppressed because it is too large
Load Diff
File diff suppressed because it is too large
Load Diff
File diff suppressed because it is too large
Load Diff
File diff suppressed because it is too large
Load Diff
File diff suppressed because it is too large
Load Diff
File diff suppressed because it is too large
Load Diff
File diff suppressed because it is too large
Load Diff
31501
modules/mogo-module-service/src/main/assets/heng_0327.csv
Normal file
31501
modules/mogo-module-service/src/main/assets/heng_0327.csv
Normal file
File diff suppressed because it is too large
Load Diff
File diff suppressed because it is too large
Load Diff
File diff suppressed because it is too large
Load Diff
@@ -626,6 +626,9 @@ public class MockIntentHandler implements IntentHandler {
|
||||
private BufferedReader roadSizeBr;
|
||||
private JSONObject locJo = null;
|
||||
|
||||
/**
|
||||
* 处理模拟单Loc数据意图
|
||||
*/
|
||||
private void handleMockSingleLocDataIntent() throws Exception {
|
||||
if (locJo == null) {
|
||||
String locLine = "{\"systemTime\":1615529718585,\"satelliteTime\":1615529718585,\"lon\":116.73573385415098,\"lat\":40.19907712731953,\"alt\":34.4018669128417,\"heading\":0.342695406938048,\"speed\":0.003303937}";
|
||||
@@ -637,6 +640,9 @@ public class MockIntentHandler implements IntentHandler {
|
||||
mLocationMockHandler.sendEmptyMessageDelayed(100, 50L);
|
||||
}
|
||||
|
||||
/**
|
||||
* 处理路侧模拟数据意图
|
||||
*/
|
||||
private void handleRoadSideMockDataIntent() throws Exception {
|
||||
if (roadSizeBr == null) {
|
||||
roadSizeBr = new BufferedReader(new InputStreamReader(AbsMogoApplication.getApp().getAssets().open("roadSide.txt")));
|
||||
@@ -680,6 +686,7 @@ public class MockIntentHandler implements IntentHandler {
|
||||
@Override
|
||||
public void handleMessage(Message msg) {
|
||||
super.handleMessage(msg);
|
||||
// 模拟处理当前车辆位置
|
||||
if (msg.what == 1) {
|
||||
try {
|
||||
if (!handleMockLocationIntent()) {
|
||||
@@ -694,7 +701,9 @@ public class MockIntentHandler implements IntentHandler {
|
||||
}
|
||||
br = null;
|
||||
}
|
||||
} else if (msg.what == 21) {
|
||||
}
|
||||
// 模拟远端数据
|
||||
else if (msg.what == 21) {
|
||||
try {
|
||||
handleMockSnapshotIntent2();
|
||||
} catch (Exception e) {
|
||||
@@ -705,7 +714,9 @@ public class MockIntentHandler implements IntentHandler {
|
||||
}
|
||||
|
||||
}
|
||||
} else if (msg.what == 3) {
|
||||
}
|
||||
// 模拟ADAS数据
|
||||
else if (msg.what == 3) {
|
||||
try {
|
||||
handleMockAdasIntent();
|
||||
} catch (Exception e) {
|
||||
@@ -720,13 +731,17 @@ public class MockIntentHandler implements IntentHandler {
|
||||
}
|
||||
readers = null;
|
||||
}
|
||||
} else if (msg.what == 100) {
|
||||
}
|
||||
// 模拟单个车数据
|
||||
else if (msg.what == 100) {
|
||||
try {
|
||||
handleMockSingleLocDataIntent();
|
||||
} catch (Exception e) {
|
||||
e.printStackTrace();
|
||||
}
|
||||
} else if (msg.what == 101) {
|
||||
}
|
||||
// 处理路侧模拟数据意图
|
||||
else if (msg.what == 101) {
|
||||
try {
|
||||
handleRoadSideMockDataIntent();
|
||||
} catch (Exception e) {
|
||||
@@ -737,7 +752,9 @@ public class MockIntentHandler implements IntentHandler {
|
||||
}
|
||||
roadSizeBr = null;
|
||||
}
|
||||
} else if (msg.what == 8) {
|
||||
}
|
||||
// 处理模拟Adas汽车意图
|
||||
else if (msg.what == 8) {
|
||||
try {
|
||||
handleMockAdasCarIntent();
|
||||
} catch (Exception e) {
|
||||
@@ -788,10 +805,12 @@ public class MockIntentHandler implements IntentHandler {
|
||||
public void handleMessage(Message msg) {
|
||||
super.handleMessage(msg);
|
||||
mLocDelay += 50;
|
||||
// 这里处理自车移动,延时4秒
|
||||
if (mLocDelay > 4_000L) {
|
||||
mLocationMockHandler1.sendEmptyMessageDelayed(1, 0L);
|
||||
}
|
||||
mLocationMockHandler.sendEmptyMessageDelayed(3, 0L);
|
||||
// 延时50毫秒重复发送自己
|
||||
mTimeTickHandler.sendEmptyMessageDelayed(0, 50L);
|
||||
}
|
||||
};
|
||||
@@ -811,6 +830,9 @@ public class MockIntentHandler implements IntentHandler {
|
||||
|
||||
private BufferedReader br;
|
||||
|
||||
/**
|
||||
* 处理模拟位置意图
|
||||
*/
|
||||
private boolean handleMockLocationIntent() throws Exception {
|
||||
if (br == null) {
|
||||
br = new BufferedReader(new InputStreamReader(AbsMogoApplication.getApp().getAssets().open("loc.txt")));
|
||||
@@ -826,12 +848,16 @@ public class MockIntentHandler implements IntentHandler {
|
||||
Log.i("mock-timer-loc-map", "cost " + (System.currentTimeMillis() - start) + "ms");
|
||||
SnapshotLocationController.getInstance().syncAdasLocationInfo(jo);
|
||||
Log.i("mock-timer-loc", "cost " + (System.currentTimeMillis() - start) + "ms");
|
||||
Log.i("mock-timer-loc-info",jo.toString());
|
||||
return true;
|
||||
}
|
||||
|
||||
|
||||
private BufferedReader br4;
|
||||
|
||||
/**
|
||||
* 模拟快照意图
|
||||
*/
|
||||
private boolean handleMockSnapshotIntent2() throws Exception {
|
||||
if (br4 == null) {
|
||||
br4 = new BufferedReader(new InputStreamReader(AbsMogoApplication.getApp().getAssets().open("snapshot.txt")));
|
||||
@@ -862,6 +888,9 @@ public class MockIntentHandler implements IntentHandler {
|
||||
private BufferedReader[] readers = null;
|
||||
private BufferedReader[] readers2 = null;
|
||||
|
||||
/**
|
||||
* 处理模拟ADAS数据意图
|
||||
*/
|
||||
private boolean handleMockAdasIntent() throws Exception {
|
||||
final long start = System.currentTimeMillis();
|
||||
|
||||
@@ -889,6 +918,9 @@ public class MockIntentHandler implements IntentHandler {
|
||||
return true;
|
||||
}
|
||||
|
||||
/**
|
||||
* 处理模拟Adas汽车意图
|
||||
*/
|
||||
private boolean handleMockAdasCarIntent() throws Exception {
|
||||
final long start = System.currentTimeMillis();
|
||||
|
||||
|
||||
@@ -59,6 +59,7 @@ import com.mogo.utils.ThreadPoolService;
|
||||
import com.mogo.utils.UiThreadHandler;
|
||||
import com.mogo.utils.ViewUtils;
|
||||
import com.mogo.utils.WorkThreadHandler;
|
||||
import com.mogo.utils.logger.Logger;
|
||||
import com.mogo.utils.network.utils.GsonUtil;
|
||||
import com.zhidao.carchattingprovider.ICallChatResponse;
|
||||
|
||||
@@ -173,22 +174,18 @@ public class MapMarkerManager implements IMogoMarkerClickListener,
|
||||
// 绘制近景识别到的车辆
|
||||
AdasRecognizedResultDrawer.getInstance().renderAdasRecognizedResult( resultList );
|
||||
|
||||
//添加自车的定位图标,碰撞只有一个预警,还需要和adas 联调,还需要改 liyz
|
||||
// ADASRecognizedResult result = null;
|
||||
// for (int i = 0; i < resultList.size(); i++) {
|
||||
// result = resultList.get(i);
|
||||
// if (result.type) { //找出可能碰撞的车
|
||||
// result = resultList.get(i);
|
||||
//添加自车的定位图标,碰撞只有一个预警,还需要和adas 联调,
|
||||
// for ( ADASRecognizedResult result : resultList) {
|
||||
// if (result.drawlevel == 3) { //找出可能碰撞的车
|
||||
// Logger.d("liyz", "result.drawlevel == 3 ------> ");
|
||||
//// 绘制他车的线,从列表中查出可能碰撞的车的经纬度(没有或者只有一个),然后预设20米的长度
|
||||
//// 绘制碰撞的他车指引线,需要实时给数据更新 TODO
|
||||
// drawLimberCollisionPolyline(result);
|
||||
// //通过这个传值到 AMapViewWrapper,根据数据更新自车的模型数据
|
||||
// MarkerServiceHandler.getApis().getMapServiceApi().getMapUIController().setAdasRecognizedResult(result);
|
||||
// }
|
||||
|
||||
//绘制他车的线,从列表中查出可能碰撞的车的经纬度(没有或者只有一个),然后预设20米的长度
|
||||
//绘制碰撞的他车指引线,需要实时给数据更新 TODO
|
||||
// drawLimberCollisionPolyline(result);
|
||||
// }
|
||||
|
||||
// //通过这个传值到 AMapViewWrapper,根据数据更新自车的模型数据 ADASRecognizedResult
|
||||
// MarkerServiceHandler.getApis().getMapServiceApi().getMapUIController().setAdasRecognizedResult(result);
|
||||
|
||||
|
||||
} );
|
||||
}
|
||||
|
||||
|
||||
@@ -75,7 +75,7 @@ public class MogoReceiver extends BroadcastReceiver {
|
||||
@Override
|
||||
public void onReceive(Context context, Intent intent) {
|
||||
final String action = intent.getAction();
|
||||
Logger.d( TAG, action );
|
||||
//Logger.d( TAG, action );
|
||||
if (TextUtils.equals(VOICE_ACTION, action)) {
|
||||
String cmd = intent.getStringExtra(PARAM_COMMAND);
|
||||
if (!TextUtils.isEmpty(cmd)) {
|
||||
|
||||
@@ -64,7 +64,7 @@ public class V2XSocketManager {
|
||||
}
|
||||
register401007();
|
||||
register401009();
|
||||
register401019();
|
||||
register401020();
|
||||
|
||||
// TODO 这里是前瞻需求,量产版本需要注释
|
||||
register401003();
|
||||
@@ -230,7 +230,7 @@ public class V2XSocketManager {
|
||||
* * http://wiki.zhidaohulian.com/pages/viewpage.action?pageId=52829799
|
||||
* * 最优路线推荐
|
||||
*/
|
||||
public void register401019() {
|
||||
public void register401020() {
|
||||
mV2XMessageListener_401020 = new V2XMessageListener_401020();
|
||||
// 道路事件,在线车辆绘制
|
||||
V2XServiceManager
|
||||
|
||||
@@ -54,7 +54,7 @@ public class V2XStatusManager {
|
||||
if (mLocation == null) {
|
||||
mLocation = new MogoLocation();
|
||||
}
|
||||
Logger.d(V2XConst.MODULE_NAME, "当前车辆位置:" + mLocation.toString());
|
||||
//Logger.d(V2XConst.MODULE_NAME, "当前车辆位置:" + mLocation.toString());
|
||||
return mLocation;
|
||||
}
|
||||
|
||||
|
||||
@@ -4,37 +4,14 @@ import android.content.Context;
|
||||
import android.content.Intent;
|
||||
import android.util.Log;
|
||||
|
||||
import com.mogo.map.MogoLatLng;
|
||||
import com.mogo.map.marker.IMogoMarker;
|
||||
import com.mogo.map.marker.MogoMarkerOptions;
|
||||
import com.mogo.map.overlay.IMogoPolyline;
|
||||
import com.mogo.module.common.MogoApisHandler;
|
||||
import com.mogo.module.common.drawer.AdasRecognizedResultDrawer;
|
||||
import com.mogo.module.common.drawer.MarkerDrawer;
|
||||
import com.mogo.module.common.drawer.marker.AheadCollisionView;
|
||||
import com.mogo.module.common.drawer.marker.AheadCollisionWindow3DAdapter;
|
||||
import com.mogo.module.common.drawer.marker.EmptyMarkerView;
|
||||
import com.mogo.module.common.drawer.marker.SimpleWindow3DAdapter;
|
||||
import com.mogo.module.common.entity.MarkerShowEntity;
|
||||
import com.mogo.module.common.entity.V2XMessageEntity;
|
||||
import com.mogo.module.common.entity.V2XWarningEntity;
|
||||
import com.mogo.module.common.utils.Trigonometric;
|
||||
import com.mogo.module.common.view.MarkerBaseFloor;
|
||||
import com.mogo.module.v2x.entity.model.DrawLineInfo;
|
||||
import com.mogo.module.v2x.listener.V2XWarnMessageListener;
|
||||
import com.mogo.module.v2x.utils.V2XUtils;
|
||||
import com.mogo.realtime.entity.ADASRecognizedResult;
|
||||
import com.mogo.utils.UiThreadHandler;
|
||||
import com.mogo.utils.ViewUtils;
|
||||
import com.mogo.utils.logger.Logger;
|
||||
import com.mogo.utils.network.utils.GsonUtil;
|
||||
|
||||
import java.io.ByteArrayOutputStream;
|
||||
import java.io.InputStream;
|
||||
import java.util.ArrayList;
|
||||
import java.util.List;
|
||||
|
||||
import static com.mogo.module.v2x.V2XServiceManager.getContext;
|
||||
|
||||
/**
|
||||
* desc : V2X报警事件管理,这里进行报警事件的分发处理,包括了adas数据
|
||||
@@ -83,7 +60,7 @@ public class V2XWaringManager {
|
||||
private void testData(String adasResult) {
|
||||
|
||||
try {
|
||||
int id = R.raw.scenario_warning_event_data;
|
||||
int id = R.raw.scenario_warning_event_data_right;
|
||||
switch (adasResult) {
|
||||
case "left":
|
||||
id = R.raw.scenario_warning_event_data_left;
|
||||
|
||||
@@ -70,6 +70,12 @@ public class MoGoV2XCloundDataManager implements IMoGoV2XCloundDataManager, IMog
|
||||
|
||||
@Override
|
||||
public void analysisV2XCloundDataEvent(V2XWarningEntity cloundWarningInfo) {
|
||||
//测试数据
|
||||
MogoLatLng s = new MogoLatLng(26.88394048,112.5678959);
|
||||
MogoLatLng t = new MogoLatLng(26.88393912,112.5678793);
|
||||
Double b = Trigonometric.getAngle(s.lon,s.lat,t.lon,t.lat);
|
||||
|
||||
|
||||
if (MogoApisHandler.getInstance().getApis().getStatusManagerApi().isVrMode()) {
|
||||
mCloundWarningInfo = cloundWarningInfo;
|
||||
showTime = mCloundWarningInfo.getShowTime();
|
||||
@@ -100,7 +106,7 @@ public class MoGoV2XCloundDataManager implements IMoGoV2XCloundDataManager, IMog
|
||||
//添加停止线marker
|
||||
handleStopLine();
|
||||
//自车画线
|
||||
drawSlefCarLine(carLocation.lon, carLocation.lat, bearing);
|
||||
drawSelfCarLine(carLocation.lon, carLocation.lat, bearing);
|
||||
}, 500);
|
||||
|
||||
UiThreadHandler.postDelayed(() -> {
|
||||
@@ -119,7 +125,7 @@ public class MoGoV2XCloundDataManager implements IMoGoV2XCloundDataManager, IMog
|
||||
V2XWarnDataDrawer.getInstance().renderWarnData(cloundWarningInfo);
|
||||
|
||||
//车辆静止的时候
|
||||
drawSlefCarLine(carLocation.lon, carLocation.lat, bearing);
|
||||
drawSelfCarLine(carLocation.lon, carLocation.lat, bearing);
|
||||
|
||||
}, 500);
|
||||
|
||||
@@ -261,13 +267,13 @@ public class MoGoV2XCloundDataManager implements IMoGoV2XCloundDataManager, IMog
|
||||
@Override
|
||||
public void onCarLocationChanged2(Location latLng) {
|
||||
// Log.d(V2XConst.LOG_NAME_WARN, "onCarLocationChanged2 lat = " + latLng.getLatitude() + "--lon =" + latLng.getLongitude() + "---isSelfLineClear = " + isSelfLineClear);
|
||||
if (MogoApisHandler.getInstance().getApis().getStatusManagerApi().isVrMode()) {
|
||||
// if (MogoApisHandler.getInstance().getApis().getStatusManagerApi().isVrMode()) {
|
||||
//当行人经纬度交点 开始画线,否则清理
|
||||
if (mCloundWarningInfo != null) {
|
||||
mCloundWarningInfo.setCarLocation(new MogoLatLng(latLng.getLatitude(), latLng.getLongitude()));
|
||||
}
|
||||
drawSlefCarLine(latLng.getLongitude(), latLng.getLatitude(), latLng.getBearing());
|
||||
}
|
||||
drawSelfCarLine(latLng.getLongitude(), latLng.getLatitude(), latLng.getBearing());
|
||||
// }
|
||||
carLocation = new MogoLatLng(latLng.getLatitude(), latLng.getLongitude());
|
||||
}
|
||||
|
||||
@@ -278,7 +284,7 @@ public class MoGoV2XCloundDataManager implements IMoGoV2XCloundDataManager, IMog
|
||||
/**
|
||||
* 自车为起点绘制(根据设计,前方行人/弱势交通参与者预警 getDirection() == ALERT_THE_FRONT_CRASH_WARNING_TOP自车与停止线之间为蓝色预警;其他侧方预警自车与预碰撞点之间显示红色预警)
|
||||
*/
|
||||
private void drawSlefCarLine(double lon, double lat, float bearing) {
|
||||
private void drawSelfCarLine(double lon, double lat, float bearing) {
|
||||
if (!isSelfLineClear) {
|
||||
IMogoPolyline mogoPolyline = V2XServiceManager.getMoGoWarnPolylineManager().getMogoWarnPolyline();
|
||||
if (mCloundWarningInfo != null) {
|
||||
@@ -291,9 +297,9 @@ public class MoGoV2XCloundDataManager implements IMoGoV2XCloundDataManager, IMog
|
||||
isFirstLocation = true;
|
||||
}
|
||||
|
||||
//自车位置
|
||||
endLatlng = new MogoLatLng(mCloundWarningInfo.getDirection() == ALERT_THE_FRONT_CRASH_WARNING_TOP ? middleLocationInStopLine.lat : mCloundWarningInfo.getCollisionLat(),
|
||||
mCloundWarningInfo.getDirection() == ALERT_THE_FRONT_CRASH_WARNING_TOP ? middleLocationInStopLine.lon : mCloundWarningInfo.getCollisionLon());
|
||||
//自车位置
|
||||
startLatlng = new MogoLatLng(lat, lon);
|
||||
float distance = CoordinateUtils.calculateLineDistance(startLatlng.lon, startLatlng.lat, endLatlng.lon, endLatlng.lat);
|
||||
addMiddleLoc = Trigonometric.getNewLocation(startLatlng, distance / 2, Trigonometric.getAngle(startLatlng.lon, startLatlng.lat, endLatlng.lon, endLatlng.lat));
|
||||
|
||||
@@ -263,7 +263,7 @@ public class V2XObuEventScenario extends AbsV2XScenario<V2XObuEventEntity> imple
|
||||
crossing.getLat(),
|
||||
(int) currentLocation.getBearing()
|
||||
);
|
||||
Logger.d("V2X_OBU_VIP", "监测是否需要进行vip弹框提醒\ndistance: " + distance + "\neventAngle: " + eventAngle + "\ntarget: " + crossing + "\ncurrent: " + currentLatLng);
|
||||
//Logger.d("V2X_OBU_VIP", "监测是否需要进行vip弹框提醒\ndistance: " + distance + "\neventAngle: " + eventAngle + "\ntarget: " + crossing + "\ncurrent: " + currentLatLng);
|
||||
if (distance <= DEFAULT_VIP_CROSSING_DISTANCE && 0 <= eventAngle && eventAngle <= 20) {
|
||||
//距离小于DEFAULT_VIP_CROSSING_DISTANCE,且夹角在0~20(说明在前方),则触发vip通行
|
||||
defaultTarget = crossing;
|
||||
|
||||
@@ -59,6 +59,7 @@ public class V2XWarningWindow extends V2XBasWindow implements IV2XWindow {
|
||||
private void initView(Context context) {
|
||||
LayoutInflater.from(context).inflate(R.layout.v2x_road_front_warning_vr, this);
|
||||
typeImage = findViewById(R.id.warning_type_image);
|
||||
|
||||
warningTextView = findViewById(R.id.warning_content_text);
|
||||
distance = findViewById(R.id.warning_distance);
|
||||
}
|
||||
|
||||
@@ -1,15 +1,12 @@
|
||||
package com.mogo.module.v2x.utils;
|
||||
|
||||
import com.mogo.module.common.entity.MarkerExploreWay;
|
||||
import com.mogo.module.common.entity.MarkerLocation;
|
||||
import com.mogo.module.common.entity.MarkerResponse;
|
||||
import com.mogo.module.common.entity.MarkerShowEntity;
|
||||
import com.mogo.module.common.entity.V2XMessageEntity;
|
||||
import com.mogo.module.common.entity.V2XPushMessageEntity;
|
||||
import com.mogo.module.common.entity.V2XRoadEventEntity;
|
||||
import com.mogo.module.common.entity.V2XWarningEntity;
|
||||
import com.mogo.module.v2x.R;
|
||||
import com.mogo.module.v2x.V2XConst;
|
||||
import com.mogo.module.v2x.entity.net.V2XOptimalRouteDataRes;
|
||||
import com.mogo.module.v2x.entity.net.V2XSpecialCarRes;
|
||||
import com.mogo.utils.network.utils.GsonUtil;
|
||||
@@ -165,7 +162,7 @@ public class TestOnLineCarUtils {
|
||||
try {
|
||||
InputStream inputStream = V2XUtils.getApp()
|
||||
.getResources()
|
||||
.openRawResource(R.raw.scenario_warning_event_data);
|
||||
.openRawResource(R.raw.scenario_warning_event_data_right);
|
||||
ByteArrayOutputStream baos = new ByteArrayOutputStream();
|
||||
int len = -1;
|
||||
byte[] buffer = new byte[1024];
|
||||
|
||||
@@ -33,7 +33,7 @@
|
||||
android:paddingLeft="@dimen/dp_40"
|
||||
android:paddingRight="@dimen/dp_40"
|
||||
android:text="正在为您发起求助"
|
||||
android:textColor="@color/v2x_white"
|
||||
android:textColor="@color/v2x_white_color"
|
||||
android:textSize="@dimen/dp_32"
|
||||
app:layout_constraintBottom_toBottomOf="parent"
|
||||
app:layout_constraintStart_toEndOf="@+id/iv_event"
|
||||
|
||||
@@ -1,28 +0,0 @@
|
||||
{
|
||||
"type": 1,
|
||||
"lat": 26.88299257,
|
||||
"lon": 112.5642132,
|
||||
"distance": 2,
|
||||
"collisionLat": 26.88299257,
|
||||
"collisionLon": 112.5642132,
|
||||
"stopLines": [
|
||||
{
|
||||
"lat": 26.88299297,
|
||||
"lon": 112.5642142
|
||||
},
|
||||
{
|
||||
"lat": 26.88299287,
|
||||
"lon": 112.5642132
|
||||
}
|
||||
],
|
||||
"from": 1,
|
||||
"angle": 0,
|
||||
"direction": 10015,
|
||||
"speed": 11.108121,
|
||||
"targetColor": "#FF4040",
|
||||
"stopLineDistance": 60,
|
||||
"warningContent": "注意自行车",
|
||||
"heading": 0,
|
||||
"showTime": 8000,
|
||||
"roadwidth": 4.0
|
||||
}
|
||||
@@ -1,18 +1,18 @@
|
||||
{
|
||||
"type": 2,
|
||||
"lat": 26.88299257,
|
||||
"lon": 112.5642132,
|
||||
"type": 1,
|
||||
"lat": 26.879390180525974,
|
||||
"lon": 112.56927332599024,
|
||||
"distance": 2,
|
||||
"collisionLat": 26.88299257,
|
||||
"collisionLon": 112.5642132,
|
||||
"collisionLat": 26.879413602631494,
|
||||
"collisionLon": 112.56942224899758,
|
||||
"stopLines": [
|
||||
{
|
||||
"lat": 26.88299297,
|
||||
"lon": 112.5642142
|
||||
"lat": 26.88008312,
|
||||
"lon": 112.57147295
|
||||
},
|
||||
{
|
||||
"lat": 26.88299287,
|
||||
"lon": 112.5642132
|
||||
"lat": 26.88008302,
|
||||
"lon": 112.57147295
|
||||
}
|
||||
],
|
||||
"from": 1,
|
||||
@@ -21,7 +21,7 @@
|
||||
"speed": 11.108121,
|
||||
"targetColor": "#FF4040",
|
||||
"stopLineDistance": 60,
|
||||
"warningContent": "注意摩托车",
|
||||
"warningContent": "注意自行车",
|
||||
"heading": 0,
|
||||
"showTime": 8000,
|
||||
"roadwidth": 4.0
|
||||
|
||||
@@ -1,27 +1,27 @@
|
||||
{
|
||||
"type": 0,
|
||||
"lat": 26.88299257,
|
||||
"lon": 112.5642132,
|
||||
"lat": 26.91837250865101,
|
||||
"lon": 112.5631081,
|
||||
"distance": 2,
|
||||
"collisionLat": 26.88299257,
|
||||
"collisionLon": 112.5642132,
|
||||
"collisionLat": 26.91837250865101,
|
||||
"collisionLon": 112.5631081,
|
||||
"stopLines": [
|
||||
{
|
||||
"lat": 26.88299297,
|
||||
"lon": 112.5642142
|
||||
"lat": 26.91837250865101,
|
||||
"lon": 112.5631081
|
||||
},
|
||||
{
|
||||
"lat": 26.88299287,
|
||||
"lon": 112.5642132
|
||||
"lat": 26.91840847737797,
|
||||
"lon": 112.5631081
|
||||
}
|
||||
],
|
||||
"from": 1,
|
||||
"angle": 0,
|
||||
"angle": 264,
|
||||
"direction": 10013,
|
||||
"speed": 11.108121,
|
||||
"targetColor": "#FF4040",
|
||||
"stopLineDistance": 60,
|
||||
"warningContent": "注意行人",
|
||||
"warningContent": "小心行人",
|
||||
"heading": 0,
|
||||
"showTime": 8000,
|
||||
"roadwidth": 4.0
|
||||
|
||||
@@ -0,0 +1,28 @@
|
||||
{
|
||||
"type": 2,
|
||||
"lat": 26.879413602631494,
|
||||
"lon": 112.56942224899758,
|
||||
"distance": 2,
|
||||
"collisionLat": 26.879393211872856,
|
||||
"collisionLon": 112.56917110603266,
|
||||
"stopLines": [
|
||||
{
|
||||
"lat": 26.88008312,
|
||||
"lon": 112.57147295
|
||||
},
|
||||
{
|
||||
"lat": 26.88008302,
|
||||
"lon": 112.57147295
|
||||
}
|
||||
],
|
||||
"from": 1,
|
||||
"angle": 0,
|
||||
"direction": 10015,
|
||||
"speed": 11.108121,
|
||||
"targetColor": "#FF4040",
|
||||
"stopLineDistance": 60,
|
||||
"warningContent": "注意摩托车",
|
||||
"heading": 0,
|
||||
"showTime": 8000,
|
||||
"roadwidth": 4.0
|
||||
}
|
||||
Reference in New Issue
Block a user