Merge remote-tracking branch 'origin/dev2_aiSdk' into dev2_aiSdk

This commit is contained in:
wujifei
2021-04-09 11:28:32 +08:00
6 changed files with 36 additions and 22 deletions

View File

@@ -19,10 +19,15 @@ class DataTypes {
public static final String TYPE_MARKER_CLOUD_DATA = "TYPE_MARKER_CLOUD_DATA";
/**
* 云端下发数据
* 云端下发警告数据
*/
public static final String TYPE_MARKER_CLOUD_WARN_DATA = "TYPE_MARKER_CLOUD_WARN_DATA";
/**
* 云端下发停止线数据
*/
public static final String TYPE_MARKER_CLOUD_STOP_LINE_DATA = "TYPE_MARKER_CLOUD_STOP_LINE_DATA";
/**
* Push 事件场景 VR
*/

View File

@@ -14,9 +14,9 @@ import com.mogo.module.common.entity.V2XWarningEntity;
import com.mogo.service.statusmanager.IMogoStatusChangedListener;
import com.mogo.service.statusmanager.StatusDescriptor;
import com.mogo.utils.UiThreadHandler;
import com.mogo.utils.WorkThreadHandler;
import com.mogo.utils.logger.Logger;
import static com.mogo.module.common.constants.DataTypes.TYPE_MARKER_CLOUD_STOP_LINE_DATA;
import static com.mogo.module.common.constants.DataTypes.TYPE_MARKER_CLOUD_WARN_DATA;
@@ -65,7 +65,7 @@ public class V2XWarnDataDrawer extends BaseDrawer implements IMogoStatusChangedL
/**
* 绘制行人和二轮车
* 绘制行人和二轮车,前方和左右
*
* @param data
*/
@@ -79,7 +79,7 @@ public class V2XWarnDataDrawer extends BaseDrawer implements IMogoStatusChangedL
markerShowEntity.setMarkerType(TYPE_MARKER_CLOUD_WARN_DATA);
IMogoMarker marker = drawMarker(markerShowEntity);
Log.d("liyz", "renderWarnData marker != null ");
Log.d("liyz", "renderWarnData marker != null direction = " + data.getDirection());
marker.addDynamicAnchorPosition(new MogoLatLng(
data.getDirection() == 1 ? data.getStopLines().get(1).lat : data.getCollisionLat(),
data.getDirection() == 1 ? data.getStopLines().get(1).lon : data.getCollisionLon()), (float) data.getHeading(), 5000);
@@ -109,7 +109,7 @@ public class V2XWarnDataDrawer extends BaseDrawer implements IMogoStatusChangedL
}
/**
* 绘制停止线
* 绘制停止线 marker
*
* @param data
*/
@@ -120,7 +120,7 @@ public class V2XWarnDataDrawer extends BaseDrawer implements IMogoStatusChangedL
MarkerShowEntity markerShowEntity = new MarkerShowEntity();
markerShowEntity.setMarkerLocation(location);
markerShowEntity.setMarkerType(TYPE_MARKER_CLOUD_WARN_DATA);
markerShowEntity.setMarkerType(TYPE_MARKER_CLOUD_STOP_LINE_DATA);
IMogoMarker marker = drawStopLineMarker(markerShowEntity);

View File

@@ -841,23 +841,25 @@ public class MockIntentHandler implements IntentHandler {
}
}
// List< ADASRecognizedResult > allList = new ArrayList<>();
JSONArray jsonArray = new JSONArray( );
List< ADASRecognizedResult > allList = new ArrayList<>();
for ( BufferedReader reader : readers ) {
String line = reader.readLine();
// ADASRecognizedResult adasRecognizedResult = GsonUtil.objectFromJson( line, ADASRecognizedResult.class );
jsonArray.put( line );
// if ( adasRecognizedResult != null ) {
// allList.add( adasRecognizedResult );
// }
ADASRecognizedResult adasRecognizedResult = GsonUtil.objectFromJson( line, ADASRecognizedResult.class );
if ( adasRecognizedResult != null ) {
allList.add( adasRecognizedResult );
}
}
JSONObject object = new JSONObject();
object.put( "action", "view" );
object.put( "models", jsonArray );
AdasRec adasRec = new AdasRec();
adasRec.models = allList;
MogoApisHandler.getInstance().getApis().getAdasControllerApi().mockAdasRecognized( object.toString() );
MogoApisHandler.getInstance().getApis().getAdasControllerApi().mockAdasRecognized( GsonUtil.jsonFromObject( adasRec ) );
Log.i( "mock-timer-adas", "cost " + ( System.currentTimeMillis() - start ) + "ms" );
return true;
}
public static class AdasRec{
public String action = "view";
public List<ADASRecognizedResult> models;
}
}

View File

@@ -166,6 +166,7 @@ public class V2XWaringManager {
// } );
//
//adas自车定位
// MogoApisHandler.getInstance().getApis().getMapServiceApi().getSingletonLocationClient().getLastKnowLocation()
// double lon = MogoApisHandler.getInstance().getApis().getAdasControllerApi().getLastLon();
// double lat = MogoApisHandler.getInstance().getApis().getAdasControllerApi().getLastLat();
}

View File

@@ -59,7 +59,7 @@ public class MoGoV2XCloundDataManager implements IMoGoV2XCloundDataManager, IMog
pointsBetween();
//发送预警提示
MarkerServiceHandler.getApis().getV2XListenerManager().warningChangedForListenerWithDirection(cloundWarningInfo.getDirection(), MogoReceiver.ACTION_V2X_FRONT_WARNING);
MarkerServiceHandler.getApis().getV2XListenerManager().warningChangedForListenerWithDirection(cloundWarningInfo.getType(), MogoReceiver.ACTION_V2X_FRONT_WARNING);
isSelfLineClear = false;
@@ -108,8 +108,9 @@ public class MoGoV2XCloundDataManager implements IMoGoV2XCloundDataManager, IMog
for (int i = 0; i < fillPoints.size(); i++) {
V2XWarningEntity entity = new V2XWarningEntity();
MogoLatLng latLng = (MogoLatLng) fillPoints.get(i);
Log.d("liyz", "handleStopLine lat = " + latLng.lat + "--lon =" + latLng.lon);
entity.setLat(latLng.lat);
entity.setLat(latLng.lon);
entity.setLon(latLng.lon);
entity.setCollisionLat(mCloundWarningInfo.getCollisionLat());
entity.setCollisionLon(mCloundWarningInfo.getCollisionLon());
entity.heading = mCloundWarningInfo.heading;
@@ -194,7 +195,6 @@ public class MoGoV2XCloundDataManager implements IMoGoV2XCloundDataManager, IMog
public void onCarLocationChanged2(Location latLng) {
// Log.d(V2XConst.LOG_NAME_WARN, "onCarLocationChanged2 latLng = " + latLng.getLatitude() + "--" + latLng.getLongitude() + "---isSelfLineClear = " + isSelfLineClear);
//当行人经纬度交点 经纬度不为空,开始画线,否则清理
//自车只需要关注移动
if (!isSelfLineClear) {
IMogoPolyline mogoPolyline = V2XServiceManager.getMoGoWarnPolylineManager().getMogoWarnPolyline();
if (mCloundWarningInfo != null) {
@@ -258,4 +258,10 @@ public class MoGoV2XCloundDataManager implements IMoGoV2XCloundDataManager, IMog
}
private MogoLatLng getMogoLat(MogoLatLng latlng) {
MogoLatLng newLocation = LocationUtils.getNewLocation(latlng, mCloundWarningInfo.getDistance(), mCloundWarningInfo.getDirection());
return newLocation;
}
}

View File

@@ -1,5 +1,5 @@
{
"type": 2,
"type": 10013,
"lat": 39.977148,
"lon": 116.417478,
"distance": 2,
@@ -20,7 +20,7 @@
"direction": 1,
"speed": 11.108121,
"targetColor": "#FF4040",
"stopLineDistance": 30,
"stopLineDistance": 15,
"warningContent": "小心行人",
"heading": 0,
"showTime": 3000,