[dev_arch_opt_3.0]

[Change]
[
1、修复在斑马线修改了高德坐标系的自车位置导致,其它地方监听异常。
]

Signed-off-by: donghongyu <donghongyu@zhidaoauto.com>
This commit is contained in:
donghongyu
2023-03-17 18:00:04 +08:00
parent 8988688660
commit ef80aa8281
4 changed files with 80 additions and 58 deletions

View File

@@ -24,7 +24,6 @@ import android.util.Log;
import android.view.MotionEvent;
import android.view.View;
import androidx.annotation.MainThread;
import androidx.annotation.NonNull;
import com.mogo.commons.debug.DebugConfig;
@@ -34,7 +33,7 @@ import com.mogo.eagle.core.data.map.CenterLine;
import com.mogo.eagle.core.data.map.MapRoadInfo;
import com.mogo.eagle.core.data.map.MogoLatLng;
import com.mogo.eagle.core.data.map.MogoLocation;
import com.mogo.eagle.core.function.call.autopilot.CallerChassisLocationGCJ02ListenerManager;
import com.mogo.eagle.core.function.call.autopilot.CallerChassisLocationWGS84ListenerManager;
import com.mogo.eagle.core.function.call.map.CallerMapDataCollectorManager;
import com.mogo.eagle.core.function.call.map.CallerMapDevaListenerManager;
import com.mogo.eagle.core.function.call.map.CallerMapRoadListenerManager;
@@ -212,28 +211,11 @@ public class AMapViewWrapper implements IMogoMapView,
@Override
public void onStopLineInfo(@androidx.annotation.Nullable StopLine stopLine) {
MogoLocation carLoc = CallerChassisLocationGCJ02ListenerManager.INSTANCE.getChassisLocationGCJ02();
MogoLocation carLoc = CallerChassisLocationWGS84ListenerManager.INSTANCE.getChassisLocationWGS84();
if (stopLine != null && stopLine.road_id != null && !stopLine.road_id.isEmpty() && stopLine.points != null && stopLine.points.size() > 0) {
ArrayList<LonLatPoint> points = stopLine.points;
if (carLoc != null) {
/**
* //地图组提供的高德坐标切到WGS84坐标系
* var cal = LonLatPoint(point!!.lon, point!!.lat)
* if(!point!!.provider.equals(MapAutoApi.GPS_FLAG)){
* cal = MapTools.switchLonLatWGS84(cal)
* }
*/
String provider = carLoc.getProvider();
//CallerLogger.INSTANCE.d(M_MAP + TAG, "car_loc: " + carLoc + "");
if (!MapAutoApi.GPS_FLAG.equals(provider)) {
//CallerLogger.INSTANCE.d(M_MAP + TAG, "convert before: car_loc: {lon: " + carLoc.getLongitude() + ", lat: " + carLoc.getLatitude() + "}");
LonLatPoint p = new LonLatPoint(carLoc.getLongitude(), carLoc.getLatitude());
p = MapTools.INSTANCE.switchLonLatWGS84(p);
carLoc.setLongitude(p.longitude);
carLoc.setLatitude(p.latitude);
//CallerLogger.INSTANCE.d(M_MAP + TAG, "convert after: car_loc: {lon: " + carLoc.getLongitude() + ", lat: " + carLoc.getLatitude() + "}");
}
//CallerLogger.INSTANCE.d(M_MAP + TAG, "onStopLineInfo:stop_line" + stopLine + ", car_loc:{lon: " + carLoc.getLatitude() + ", lat: " + carLoc.getLongitude() + "}");
// //CallerLogger.INSTANCE.d(M_MAP + TAG, "onStopLineInfo:stop_line" + stopLine + ", car_loc:{lon: " + carLoc.getLatitude() + ", lat: " + carLoc.getLongitude() + "}");
MapRoadInfo.StopLine stopInfo = convert(stopLine);
LonLatPoint p1 = points.get(0);
LonLatPoint p2 = points.get(points.size() - 1);