判空容错
This commit is contained in:
@@ -169,17 +169,19 @@ public class NoticeTrafficDialog extends BaseFloatDialog implements LifecycleObs
|
||||
* 开启自动驾驶
|
||||
*/
|
||||
private void startAutoPilot() {
|
||||
AutopilotControlParameters parameters = new AutopilotControlParameters();
|
||||
parameters.isSpeakVoice = false;
|
||||
parameters.vehicleType = 10;
|
||||
//云平台使用的是火星坐标,自动驾驶需要wgs84
|
||||
double[] gcj02 = CoordinateUtils.transformGcj02toWgs84(mTrafficStyleInfo.getLat(), mTrafficStyleInfo.getLon());
|
||||
parameters.startLatLon = new AutopilotControlParameters.AutoPilotLonLat
|
||||
(CallerAutoPilotStatusListenerManager.INSTANCE.getCurWgs84Lat(),
|
||||
CallerAutoPilotStatusListenerManager.INSTANCE.getCurWgs84Lon());
|
||||
parameters.endLatLon = new AutopilotControlParameters.AutoPilotLonLat
|
||||
(gcj02[0], gcj02[1]);
|
||||
CallerAutoPilotManager.INSTANCE.startAutoPilot(parameters);
|
||||
if (mTrafficStyleInfo != null){
|
||||
AutopilotControlParameters parameters = new AutopilotControlParameters();
|
||||
parameters.isSpeakVoice = false;
|
||||
parameters.vehicleType = 10;
|
||||
//云平台使用的是火星坐标,自动驾驶需要wgs84
|
||||
double[] gcj02 = CoordinateUtils.transformGcj02toWgs84(mTrafficStyleInfo.getLat(), mTrafficStyleInfo.getLon());
|
||||
parameters.startLatLon = new AutopilotControlParameters.AutoPilotLonLat
|
||||
(CallerAutoPilotStatusListenerManager.INSTANCE.getCurWgs84Lat(),
|
||||
CallerAutoPilotStatusListenerManager.INSTANCE.getCurWgs84Lon());
|
||||
parameters.endLatLon = new AutopilotControlParameters.AutoPilotLonLat
|
||||
(gcj02[0], gcj02[1]);
|
||||
CallerAutoPilotManager.INSTANCE.startAutoPilot(parameters);
|
||||
}
|
||||
}
|
||||
|
||||
/**
|
||||
|
||||
Reference in New Issue
Block a user