Merge branch 'jk' into dev2_aiSdk

This commit is contained in:
liujing
2021-04-19 17:08:10 +08:00
7 changed files with 20 additions and 12 deletions

View File

@@ -42,7 +42,7 @@ enum AdasRecognizedType {
}
public static AdasRecognizedType[] VAL = {
classIdBackground,
classIdBackground,//0
classIdPerson,
classIdBicycle,
classIdCar,

View File

@@ -229,7 +229,7 @@ class BaseDrawer {
} else if (recognizedType == AdasRecognizedType.classIdStopLine) {
return R.raw.stopline;
} else if (recognizedType == AdasRecognizedType.classIdWarningArrows) {
return R.raw.stopline;
return R.raw.arraw;
}
return R.raw.people;
}

View File

@@ -125,12 +125,16 @@ public class V2XWarnDataDrawer extends BaseDrawer implements IMogoStatusChangedL
return marker;
}
public void drawerArrowsMarkerWithLocation(MogoLatLng location, String markerType, int type) {
public void drawerArrowsMarkerWithLocation(MogoLatLng location, String markerType, int type, int rotate) {
MogoMarkerOptions options = new MogoMarkerOptions()
.latitude(location.getLat())
.longitude(location.getLon());
options.icon3DRes(getModelRes(type)); //TODO
options.anchorColor("#FB3C3CFF"); //红色#FF3036 蓝色:#256BFF
.longitude(location.getLon())
.set3DMode(true)
.controlAngle(true)
.rotate(rotate);
options.icon3DRes(getModelRes(type));
options.flat(true);
options.anchorColor("#FB3C3CFF");
IMogoMarker marker = MogoApisHandler.getInstance().getApis().getMapServiceApi().getMarkerManager(mContext).addMarker(markerType, options);
marker.setToTop();
}

Binary file not shown.

View File

@@ -7,6 +7,8 @@ import android.util.Log;
import com.alibaba.android.arouter.facade.annotation.Route;
import com.mogo.cloud.commons.utils.CoordinateUtils;
import com.mogo.map.MogoLatLng;
import com.mogo.map.marker.IMogoMarker;
import com.mogo.map.marker.MogoMarkerOptions;
import com.mogo.map.navi.IMogoCarLocationChangedListener2;
import com.mogo.map.overlay.IMogoPolyline;
import com.mogo.module.common.MogoApisHandler;
@@ -158,7 +160,7 @@ public class MoGoV2XCloundDataManager implements IMoGoV2XCloundDataManager, IMog
MogoLatLng endLatlng = new MogoLatLng(mogoLatLng.lat, mogoLatLng.lon);
float distance = CoordinateUtils.calculateLineDistance(startLatLng.lon, startLatLng.lat, endLatlng.lon, endLatlng.lat);
MogoLatLng addMiddleLoc = Trigonometric.getNewLocation(startLatLng, distance / 2, mCloundWarningInfo.getAngle());
Log.d(V2XConst.LOG_NAME_WARN, "红色区域起始点 = " + startLatLng.lon + "," + startLatLng.lat +
Log.d(TAG, "红色区域起始点 = " + startLatLng.lon + "," + startLatLng.lat +
"中间点坐标:" + addMiddleLoc.lon + "," + addMiddleLoc.lat
+ "终点" + endLatlng.lon + "," + endLatlng.lat);
if (polyLine != null) {
@@ -224,13 +226,15 @@ public class MoGoV2XCloundDataManager implements IMoGoV2XCloundDataManager, IMog
private void addArrows(MogoLatLng startLatLng, MogoLatLng endLatLng) {
float distance = CoordinateUtils.calculateLineDistance(
startLatLng.lon, startLatLng.lat, endLatLng.lon, endLatLng.lat);
double rotate = Trigonometric.getAngle(startLatLng.lon, startLatLng.lat, endLatLng.lon, endLatLng.lat);
Log.d(TAG, "添加小箭头--目标物与预碰撞点之间的距离是" + String.valueOf(distance));
if (distance > 5) {
int count = (int) (distance / 5);
for (int i = 0; i < count - 1; i++) {
for (int i = 0; i < count; i++) {
MogoLatLng newLo = Trigonometric.getNewLocation(
startLatLng, 5 * (i + 1), 120);
V2XWarnDataDrawer.getInstance().drawerArrowsMarkerWithLocation(newLo, WARNING_ARROWS, 10);
startLatLng, 5 * (i + 1), Trigonometric.getAngle(startLatLng.lon,startLatLng.lat,endLatLng.lon,endLatLng.lat));
Log.d(TAG, "小箭头位置" + newLo);
V2XWarnDataDrawer.getInstance().drawerArrowsMarkerWithLocation(newLo, WARNING_ARROWS, 10, new Double(rotate).intValue());
}
}
//延迟3秒清理线

View File

@@ -482,7 +482,7 @@
android:layout_marginBottom="@dimen/dp_10"
android:background="#8BC34A"
android:padding="@dimen/dp_10"
android:text="adas预警数据发送"
android:text="车路云场景预警"
android:textColor="#FFFFFF"
android:textSize="@dimen/dp_22"
app:layout_constraintBottom_toBottomOf="parent"

View File

@@ -17,7 +17,7 @@
],
"from": 1,
"angle": 0,
"direction": 1,
"direction": 2,
"speed": 11.108121,
"targetColor": "#FF4040",
"stopLineDistance": 60,