[Upload]
删除旧版本的功能代码 Signed-off-by: donghongyu <donghongyu@zhidaoauto.com>
This commit is contained in:
@@ -61,65 +61,71 @@ public class OnAdasListenerAdapter implements OnAdasListener {
|
||||
|
||||
@Override
|
||||
public void onCarStateData(CarStateInfo carStateInfo) {
|
||||
if (HdMapBuildConfig.isMapLoaded) {
|
||||
// Logger.d(TAG, "--------carStateInfo.toString() = " + carStateInfo.toString());
|
||||
//can数据转发
|
||||
CarStateInfo.ValuesBean bean = carStateInfo.getValues();
|
||||
//can数据转发
|
||||
CarStateInfo.ValuesBean bean = carStateInfo.getValues();
|
||||
// Log.w("DHY-location", bean.getLon() + "," + bean.getLat() + " OnAdasListenerAdapter-onCarStateData:");
|
||||
|
||||
if (bean != null) {
|
||||
int turnLight = bean.getTurn_light(); //转向灯状态 0是正常 1是左转 2是右转
|
||||
AmiClientManager.getInstance().setTurnLightState(turnLight);
|
||||
int brakeLight = bean.getBrake_light(); //TODO
|
||||
if (bean != null) {
|
||||
int turnLight = bean.getTurn_light(); //转向灯状态 0是正常 1是左转 2是右转
|
||||
AmiClientManager.getInstance().setTurnLightState(turnLight);
|
||||
int brakeLight = bean.getBrake_light(); //TODO
|
||||
// Logger.d(TAG, "onCarStateData ---- turnLight = " + turnLight + "---brakeLight = " + brakeLight);
|
||||
|
||||
//设置转向灯
|
||||
CallerHmiManager.INSTANCE.showTurnLight(turnLight);
|
||||
//设置转向灯
|
||||
CallerHmiManager.INSTANCE.showTurnLight(turnLight);
|
||||
|
||||
//设置刹车信息
|
||||
CallerHmiManager.INSTANCE.showBrakeLight(brakeLight);
|
||||
} else {
|
||||
Logger.e(TAG, "bean == null ");
|
||||
//设置刹车信息
|
||||
CallerHmiManager.INSTANCE.showBrakeLight(brakeLight);
|
||||
} else {
|
||||
Logger.e(TAG, "bean == null ");
|
||||
}
|
||||
|
||||
AutopilotCarStateInfo autopilotCarStateInfo = AdasObjectUtils.INSTANCE.fromAdasCarStateInfoObject(carStateInfo);
|
||||
CallerAutopilotCarStatusListenerManager.INSTANCE.invokeAutopilotCarStateData(autopilotCarStateInfo);
|
||||
}
|
||||
|
||||
AutopilotCarStateInfo autopilotCarStateInfo = AdasObjectUtils.INSTANCE.fromAdasCarStateInfoObject(carStateInfo);
|
||||
CallerAutopilotCarStatusListenerManager.INSTANCE.invokeAutopilotCarStateData(autopilotCarStateInfo);
|
||||
}
|
||||
|
||||
@Override
|
||||
public void autopilotStatus(AutopilotStatus autopilotStatus) {
|
||||
AutopilotStatus.ValuesBean autopilotStatusValues = autopilotStatus.getValues();
|
||||
if (HdMapBuildConfig.isMapLoaded) {
|
||||
AutopilotStatus.ValuesBean autopilotStatusValues = autopilotStatus.getValues();
|
||||
|
||||
if (autopilotStatusValues != null) {
|
||||
// 初始化自动驾驶状态信息
|
||||
AutopilotStatusInfo autopilotStatusInfo = CallerAutoPilotStatusListenerManager.INSTANCE.getAutoPilotStatusInfo();
|
||||
autopilotStatusInfo.setState(autopilotStatusValues.getState());
|
||||
autopilotStatusInfo.setPilotmode(autopilotStatusValues.getPilotmode());
|
||||
autopilotStatusInfo.setControl_pilotmode(autopilotStatusValues.getControl_pilotmode());
|
||||
autopilotStatusInfo.setReason(autopilotStatusValues.getReason());
|
||||
autopilotStatusInfo.setCamera(autopilotStatusValues.getCamera());
|
||||
autopilotStatusInfo.setRtk(autopilotStatusValues.getRtk());
|
||||
autopilotStatusInfo.setRadar(autopilotStatusValues.getRadar());
|
||||
autopilotStatusInfo.setSpeed(autopilotStatusValues.getSpeed());
|
||||
// 初始化自动驾驶状态信息
|
||||
autopilotStatusInfo.setVersion(AdasManager.getInstance().getAdasConfig().getVersion());
|
||||
autopilotStatusInfo.setConnectIP(AdasManager.getInstance().getAdasConfig().getAddress());
|
||||
autopilotStatusInfo.setDockVersion(AdasManager.getInstance().getAdasConfig().getDockVersion());
|
||||
if (autopilotStatusValues != null) {
|
||||
// 初始化自动驾驶状态信息
|
||||
AutopilotStatusInfo autopilotStatusInfo = CallerAutoPilotStatusListenerManager.INSTANCE.getAutoPilotStatusInfo();
|
||||
autopilotStatusInfo.setState(autopilotStatusValues.getState());
|
||||
autopilotStatusInfo.setPilotmode(autopilotStatusValues.getPilotmode());
|
||||
autopilotStatusInfo.setControl_pilotmode(autopilotStatusValues.getControl_pilotmode());
|
||||
autopilotStatusInfo.setReason(autopilotStatusValues.getReason());
|
||||
autopilotStatusInfo.setCamera(autopilotStatusValues.getCamera());
|
||||
autopilotStatusInfo.setRtk(autopilotStatusValues.getRtk());
|
||||
autopilotStatusInfo.setRadar(autopilotStatusValues.getRadar());
|
||||
autopilotStatusInfo.setSpeed(autopilotStatusValues.getSpeed());
|
||||
// 初始化自动驾驶状态信息
|
||||
autopilotStatusInfo.setVersion(AdasManager.getInstance().getAdasConfig().getVersion());
|
||||
autopilotStatusInfo.setConnectIP(AdasManager.getInstance().getAdasConfig().getAddress());
|
||||
autopilotStatusInfo.setDockVersion(AdasManager.getInstance().getAdasConfig().getDockVersion());
|
||||
|
||||
CallerAutoPilotStatusListenerManager.INSTANCE.invokeAutoPilotStatus();
|
||||
CallerAutoPilotStatusListenerManager.INSTANCE.invokeAutoPilotStatus();
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
@Override
|
||||
public void autopilotArrive(AutopilotWayArrive autopilotWayArrive) {
|
||||
Logger.d(TAG, "autopilotArrive : " + autopilotWayArrive);
|
||||
if (autopilotWayArrive != null) {
|
||||
AutopilotWayArrive.ResultBean result = autopilotWayArrive.getResult();
|
||||
if (result != null) {
|
||||
AutopilotWayArrive.ResultBean.EndLatLonBean endLatLon = result.getEndLatLon();
|
||||
if (endLatLon != null) {
|
||||
AutopilotStationInfo stationInfo = new AutopilotStationInfo(result.getCarType(), endLatLon.getLon(), endLatLon.getLat());
|
||||
if (HdMapBuildConfig.isMapLoaded) {
|
||||
Logger.d(TAG, "autopilotArrive : " + autopilotWayArrive);
|
||||
if (autopilotWayArrive != null) {
|
||||
AutopilotWayArrive.ResultBean result = autopilotWayArrive.getResult();
|
||||
if (result != null) {
|
||||
AutopilotWayArrive.ResultBean.EndLatLonBean endLatLon = result.getEndLatLon();
|
||||
if (endLatLon != null) {
|
||||
AutopilotStationInfo stationInfo = new AutopilotStationInfo(result.getCarType(), endLatLon.getLon(), endLatLon.getLat());
|
||||
|
||||
CallerAutoPilotStatusListenerManager.INSTANCE.invokeArriveAtStation(stationInfo);
|
||||
CallerAutoPilotStatusListenerManager.INSTANCE.invokeArriveAtStation(stationInfo);
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -127,32 +133,36 @@ public class OnAdasListenerAdapter implements OnAdasListener {
|
||||
|
||||
@Override
|
||||
public void onAutopilotRoute(AutopilotRoute route) {
|
||||
Logger.d(TAG, "onAutopilotRoute : " + route.toString());
|
||||
AutopilotRouteInfo autopilotRoute = AdasObjectUtils.INSTANCE.fromAdasAutopilotRoute(route);
|
||||
CallerAutopilotPlanningListenerManager.INSTANCE.invokeAutopilotRotting(autopilotRoute);
|
||||
if (HdMapBuildConfig.isMapLoaded) {
|
||||
Logger.d(TAG, "onAutopilotRoute : " + route.toString());
|
||||
AutopilotRouteInfo autopilotRoute = AdasObjectUtils.INSTANCE.fromAdasAutopilotRoute(route);
|
||||
CallerAutopilotPlanningListenerManager.INSTANCE.invokeAutopilotRotting(autopilotRoute);
|
||||
}
|
||||
}
|
||||
|
||||
@Override
|
||||
public void onAutopilotTrajectory(List<TrajectoryInfo> trajectoryList) {
|
||||
Logger.d(TAG, "onAutopilotTrajectory : " + trajectoryList);
|
||||
ArrayList<ADASTrajectoryInfo> trajectoryInfoArrayList = new ArrayList<>();
|
||||
if (trajectoryList != null && trajectoryList.size() > 0) {
|
||||
for (TrajectoryInfo trajectory : trajectoryList) {
|
||||
ADASTrajectoryInfo adasTrajectoryInfo = new ADASTrajectoryInfo();
|
||||
adasTrajectoryInfo.setLat(trajectory.getLat());
|
||||
adasTrajectoryInfo.setLon(trajectory.getLon());
|
||||
adasTrajectoryInfo.setAcceleration(trajectory.getAcceleration());
|
||||
adasTrajectoryInfo.setAccumulatedDis(trajectory.getAccumulatedDis());
|
||||
adasTrajectoryInfo.setTime(trajectory.getTime());
|
||||
adasTrajectoryInfo.setVelocity(trajectory.getVelocity());
|
||||
adasTrajectoryInfo.setAlt(trajectory.getAlt());
|
||||
adasTrajectoryInfo.setKappa(trajectory.getKappa());
|
||||
adasTrajectoryInfo.setTheta(trajectory.getTheta());
|
||||
trajectoryInfoArrayList.add(adasTrajectoryInfo);
|
||||
if (HdMapBuildConfig.isMapLoaded) {
|
||||
Logger.d(TAG, "onAutopilotTrajectory : " + trajectoryList);
|
||||
ArrayList<ADASTrajectoryInfo> trajectoryInfoArrayList = new ArrayList<>();
|
||||
if (trajectoryList != null && trajectoryList.size() > 0) {
|
||||
for (TrajectoryInfo trajectory : trajectoryList) {
|
||||
ADASTrajectoryInfo adasTrajectoryInfo = new ADASTrajectoryInfo();
|
||||
adasTrajectoryInfo.setLat(trajectory.getLat());
|
||||
adasTrajectoryInfo.setLon(trajectory.getLon());
|
||||
adasTrajectoryInfo.setAcceleration(trajectory.getAcceleration());
|
||||
adasTrajectoryInfo.setAccumulatedDis(trajectory.getAccumulatedDis());
|
||||
adasTrajectoryInfo.setTime(trajectory.getTime());
|
||||
adasTrajectoryInfo.setVelocity(trajectory.getVelocity());
|
||||
adasTrajectoryInfo.setAlt(trajectory.getAlt());
|
||||
adasTrajectoryInfo.setKappa(trajectory.getKappa());
|
||||
adasTrajectoryInfo.setTheta(trajectory.getTheta());
|
||||
trajectoryInfoArrayList.add(adasTrajectoryInfo);
|
||||
}
|
||||
Log.e(TAG, "time:" + System.currentTimeMillis() + "trajectoryInfoArrayList:" + trajectoryInfoArrayList);
|
||||
}
|
||||
Log.e(TAG, "time:" + System.currentTimeMillis() + "trajectoryInfoArrayList:" + trajectoryInfoArrayList);
|
||||
CallerAutopilotPlanningListenerManager.INSTANCE.invokeAutopilotTrajectory(trajectoryInfoArrayList);
|
||||
}
|
||||
CallerAutopilotPlanningListenerManager.INSTANCE.invokeAutopilotTrajectory(trajectoryInfoArrayList);
|
||||
}
|
||||
|
||||
@Override
|
||||
@@ -162,8 +172,10 @@ public class OnAdasListenerAdapter implements OnAdasListener {
|
||||
|
||||
@Override
|
||||
public void onAutopilotGuardian(AutopilotGuardianInfo guardianInfo) {
|
||||
AutopilotGuardianStatusInfo autopilotRoute = AdasObjectUtils.INSTANCE.fromAutopilotGuardianInfo(guardianInfo);
|
||||
CallerAutoPilotStatusListenerManager.INSTANCE.invokeAutopilotGuardian(autopilotRoute);
|
||||
if (HdMapBuildConfig.isMapLoaded) {
|
||||
AutopilotGuardianStatusInfo autopilotRoute = AdasObjectUtils.INSTANCE.fromAutopilotGuardianInfo(guardianInfo);
|
||||
CallerAutoPilotStatusListenerManager.INSTANCE.invokeAutopilotGuardian(autopilotRoute);
|
||||
}
|
||||
}
|
||||
|
||||
@Override
|
||||
|
||||
Reference in New Issue
Block a user