Merge branch 'dev_robotaxi-d_230612_3.3.0' into dev_saasbus-d_230607_from3.2.0
# Conflicts: # gradle.properties
This commit is contained in:
@@ -1,5 +1,14 @@
|
||||
package com.mogo.aicloud.services.socket;
|
||||
|
||||
import static com.mogo.eagle.core.data.deva.chain.ChainConstant.CHAIN_CODE_CLOUD_CONNECT_ERROR;
|
||||
import static com.mogo.eagle.core.data.deva.chain.ChainConstant.CHAIN_CODE_CLOUD_CONNECT_FAIL;
|
||||
import static com.mogo.eagle.core.data.deva.chain.ChainConstant.CHAIN_CODE_CLOUD_CONNECT_LOST;
|
||||
import static com.mogo.eagle.core.data.deva.chain.ChainConstant.CHAIN_CODE_CLOUD_CONNECT_SUCCESS;
|
||||
import static com.mogo.eagle.core.data.deva.chain.ChainConstant.CHAIN_CODE_CLOUD_PASSPORT_TOKEN;
|
||||
import static com.mogo.eagle.core.data.deva.chain.ChainConstant.CHAIN_CODE_CLOUD_SOCKET_INIT;
|
||||
import static com.mogo.eagle.core.data.deva.chain.ChainConstant.CHAIN_SOURCE_CLOUD;
|
||||
import static com.mogo.eagle.core.data.deva.chain.ChainConstant.CHAIN_TYPE_INIT_STATUS;
|
||||
|
||||
import android.content.Context;
|
||||
|
||||
import androidx.annotation.Keep;
|
||||
@@ -13,6 +22,7 @@ import com.mogo.eagle.core.utilcode.mogo.logger.CallerLogger;
|
||||
import com.mogo.eagle.core.utilcode.util.ProcessUtils;
|
||||
import com.zhidao.ptech.connsvr.commom.protocol.MogoCommon;
|
||||
import com.zhidao.socket.ConnectionLifecycleListener;
|
||||
import com.zhjt.service.chain.ChainLog;
|
||||
|
||||
import java.util.ArrayList;
|
||||
import java.util.List;
|
||||
@@ -67,9 +77,17 @@ public class MogoAiCloudSocketManager extends ConnectionLifecycleListener implem
|
||||
*/
|
||||
private final Map<Long, IMogoMsgAckListener> mAckListeners = new ConcurrentHashMap<>();
|
||||
|
||||
@ChainLog(
|
||||
linkChainLog = CHAIN_TYPE_INIT_STATUS,
|
||||
linkCode = CHAIN_SOURCE_CLOUD,
|
||||
parentNodeAliasCode = CHAIN_CODE_CLOUD_PASSPORT_TOKEN,
|
||||
nodeAliasCode = CHAIN_CODE_CLOUD_SOCKET_INIT,
|
||||
paramIndexes = {1, 2, 3, 4},
|
||||
endPoint = false
|
||||
)
|
||||
@Override
|
||||
public void init(Context context, String sn, String appId, double lat, double lon) {
|
||||
if(!ProcessUtils.isMainProcess()){
|
||||
if (!ProcessUtils.isMainProcess()) {
|
||||
return;
|
||||
}
|
||||
this.mAppId = appId;
|
||||
@@ -184,7 +202,7 @@ public class MogoAiCloudSocketManager extends ConnectionLifecycleListener implem
|
||||
if (listeners != null && !listeners.isEmpty()) {
|
||||
for (IMogoOnMessageListener listener : listeners) {
|
||||
if (listener != null) {
|
||||
CallerLogger.INSTANCE.d(TAG, "received msgId = " + mAckListeners.get(msgType) + " content = " + obj.toString());
|
||||
// CallerLogger.INSTANCE.d(TAG, "received msgId = " + mAckListeners.get(msgType) + " content = " + obj.toString());
|
||||
listener.onMsgReceived(obj);
|
||||
}
|
||||
}
|
||||
@@ -192,6 +210,12 @@ public class MogoAiCloudSocketManager extends ConnectionLifecycleListener implem
|
||||
}
|
||||
};
|
||||
|
||||
@ChainLog(
|
||||
linkChainLog = CHAIN_TYPE_INIT_STATUS,
|
||||
linkCode = CHAIN_SOURCE_CLOUD,
|
||||
nodeAliasCode = CHAIN_CODE_CLOUD_CONNECT_SUCCESS,
|
||||
paramIndexes = {-1}
|
||||
)
|
||||
@Override
|
||||
public void onConnectSuccess() {
|
||||
if (mLifeCycleListeners.size() > 0) {
|
||||
@@ -203,6 +227,12 @@ public class MogoAiCloudSocketManager extends ConnectionLifecycleListener implem
|
||||
}
|
||||
}
|
||||
|
||||
@ChainLog(
|
||||
linkChainLog = CHAIN_TYPE_INIT_STATUS,
|
||||
linkCode = CHAIN_SOURCE_CLOUD,
|
||||
nodeAliasCode = CHAIN_CODE_CLOUD_CONNECT_FAIL,
|
||||
paramIndexes = {-1}
|
||||
)
|
||||
@Override
|
||||
public void onConnectFailure() {
|
||||
if (mLifeCycleListeners.size() > 0) {
|
||||
@@ -214,6 +244,12 @@ public class MogoAiCloudSocketManager extends ConnectionLifecycleListener implem
|
||||
}
|
||||
}
|
||||
|
||||
@ChainLog(
|
||||
linkChainLog = CHAIN_TYPE_INIT_STATUS,
|
||||
linkCode = CHAIN_SOURCE_CLOUD,
|
||||
nodeAliasCode = CHAIN_CODE_CLOUD_CONNECT_LOST,
|
||||
paramIndexes = {-1}
|
||||
)
|
||||
@Override
|
||||
public void onConnectLost(boolean reconnect) {
|
||||
if (mLifeCycleListeners.size() > 0) {
|
||||
@@ -225,6 +261,13 @@ public class MogoAiCloudSocketManager extends ConnectionLifecycleListener implem
|
||||
}
|
||||
}
|
||||
|
||||
@ChainLog(
|
||||
linkChainLog = CHAIN_TYPE_INIT_STATUS,
|
||||
linkCode = CHAIN_SOURCE_CLOUD,
|
||||
parentNodeAliasCode = CHAIN_CODE_CLOUD_SOCKET_INIT,
|
||||
nodeAliasCode = CHAIN_CODE_CLOUD_CONNECT_ERROR,
|
||||
paramIndexes = {0, 1}
|
||||
)
|
||||
@Override
|
||||
public void onError(int code, String msg) {
|
||||
if (mLifeCycleListeners.size() > 0) {
|
||||
|
||||
@@ -4,24 +4,6 @@ import com.mogo.commons.debug.DebugConfig;
|
||||
import com.mogo.eagle.core.data.config.FunctionBuildConfig;
|
||||
|
||||
public class HostConst {
|
||||
public static final String DEVA_HOST = "http://dzt-deva.zhidaozhixing.com";
|
||||
public static final String DATA_SERVICE_HOST = "http://dzt-dataService.zhidaozhixing.com";
|
||||
public static final String REALTIME_LOCATION_HOST = "http://dzt-realtimeLocation.zhidaozhixing.com";
|
||||
public static final String GEOFENCE_HOST = "http://dzt-geoFenceCarService.zhidaozhixing.com";
|
||||
public static final String CARLIFE_HOST = "http://dzt-carlife.zhidaozhixing.com";
|
||||
public static final String STRATEGY_PUSH_HOST = "http://dzt-strategyPush.zhidaozhixing.com";
|
||||
public static final String CAMERA_STREAM_HOST = "http://dzt-smartTransportationAiCloud.zhidaozhixing.com";
|
||||
public static final String OPEN_CAMERA_STREAM_HOST = "http://10.0.16.6:18080";
|
||||
|
||||
public static final String DATA_CENTER_HOST = "http://dzt-data-center.zhidaozhixing.com";
|
||||
public static final String CITY_HOST = "http://dzt-city.zhidaozhixing.com";
|
||||
public static final String SOCKET_CENTER_DOMAIN = "socketRegion";
|
||||
|
||||
// public static final String UPGRADE_APP_HOST_TEST = "http://10.0.200.12:32423?/";
|
||||
public static final String UPGRADE_APP_HOST = "http://eagle-mis.zhidaozhixing.com/";
|
||||
|
||||
public static final String CMDB_HOST = "http://eagle-mis.zhidaozhixing.com/eagleEye-mis/cmdbapi/";
|
||||
|
||||
public static final String HOST_DEV = "http://eagle-qa.zhidaozhixing.com";
|
||||
public static final String HOST_RELEASE = "http://eagle-mis.zhidaozhixing.com";
|
||||
|
||||
|
||||
@@ -18,11 +18,6 @@ public class MogoModule {
|
||||
*/
|
||||
private String mName;
|
||||
|
||||
/**
|
||||
* 广播接收者
|
||||
*/
|
||||
private String mBroadcastAction;
|
||||
|
||||
/**
|
||||
* @param path 模块加载路径
|
||||
* @param name 模块名称
|
||||
@@ -51,13 +46,5 @@ public class MogoModule {
|
||||
return this;
|
||||
}
|
||||
|
||||
public String getBroadcastAction() {
|
||||
return mBroadcastAction;
|
||||
}
|
||||
|
||||
public MogoModule setBroadcastAction( String broadcastAction ) {
|
||||
this.mBroadcastAction = broadcastAction;
|
||||
return this;
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
@@ -13,8 +13,6 @@ import java.util.List;
|
||||
*/
|
||||
public class MogoModulePaths {
|
||||
|
||||
private static final List<MogoModule> mMogoModules = new ArrayList<>();
|
||||
|
||||
// 不需要启动APP也能运行的模块
|
||||
private static final List<MogoModule> mMogoBaseModules = new ArrayList<>();
|
||||
|
||||
@@ -22,18 +20,6 @@ public class MogoModulePaths {
|
||||
|
||||
private static final List<MogoModule> mModuleFunctionServers = new ArrayList<>();
|
||||
|
||||
/**
|
||||
* 添加卡片模块
|
||||
*
|
||||
* @param module
|
||||
*/
|
||||
public static void addModule(MogoModule module) {
|
||||
if (module == null || TextUtils.isEmpty(module.getPath().replace(" ", ""))) {
|
||||
throw new IllegalArgumentException("module path can't be empty or null or blank");
|
||||
}
|
||||
mMogoModules.add(module);
|
||||
}
|
||||
|
||||
/**
|
||||
* 添加模块功能
|
||||
*
|
||||
@@ -70,10 +56,6 @@ public class MogoModulePaths {
|
||||
mMogoBaseModules.add(module);
|
||||
}
|
||||
|
||||
public static List<MogoModule> getModules() {
|
||||
return mMogoModules;
|
||||
}
|
||||
|
||||
public static List<MogoModule> getBaseModules() {
|
||||
return mMogoBaseModules;
|
||||
}
|
||||
|
||||
@@ -1,7 +1,5 @@
|
||||
package com.mogo.commons.module;
|
||||
|
||||
import static com.mogo.eagle.core.utilcode.mogo.logger.scene.SceneConstant.M_OLD_OTHER;
|
||||
|
||||
import android.content.Context;
|
||||
import android.content.Intent;
|
||||
import android.content.IntentFilter;
|
||||
@@ -14,12 +12,8 @@ import com.mogo.commons.module.intent.IntentManager;
|
||||
import com.mogo.commons.module.status.MogoStatusManager;
|
||||
import com.mogo.commons.module.receiver.MogoReceiver;
|
||||
import com.mogo.commons.voice.AIAssist;
|
||||
import com.mogo.eagle.core.data.config.CloudPoiManager;
|
||||
import com.mogo.eagle.core.utilcode.mogo.logger.CallerLogger;
|
||||
import com.mogo.eagle.core.utilcode.util.NetworkUtils;
|
||||
|
||||
import java.util.List;
|
||||
|
||||
|
||||
public class MogoServices implements IMogoIntentListener {
|
||||
|
||||
@@ -43,7 +37,6 @@ public class MogoServices implements IMogoIntentListener {
|
||||
public void init(Context context) {
|
||||
mContext = context;
|
||||
MogoStatusManager.getInstance().setAIAssistReady(TAG, AIAssist.getInstance(mContext).hasFlush());
|
||||
CloudPoiManager.getInstance().updateFromConfig(context);
|
||||
|
||||
registerMogoReceiver(context);
|
||||
|
||||
@@ -51,30 +44,15 @@ public class MogoServices implements IMogoIntentListener {
|
||||
mIntentManager.registerIntentListener(MogoReceiver.ACTION_VOICE_UI, this);
|
||||
mIntentManager.registerIntentListener(MogoReceiver.ACTION_VOICE_READY, this);
|
||||
mIntentManager.registerIntentListener(ConnectivityManager.CONNECTIVITY_ACTION, this);
|
||||
|
||||
Intent intent = new Intent("com.freedom.ser.ACTION");
|
||||
intent.addFlags(Intent.FLAG_INCLUDE_STOPPED_PACKAGES);
|
||||
mContext.sendBroadcast(intent);
|
||||
}
|
||||
|
||||
private void registerMogoReceiver(Context context) {
|
||||
if (context == null) {
|
||||
return;
|
||||
}
|
||||
List<MogoModule> modules = MogoModulePaths.getModules();
|
||||
if (modules.isEmpty()) {
|
||||
return;
|
||||
}
|
||||
MogoReceiver receiver = new MogoReceiver(context);
|
||||
IntentFilter filter = new IntentFilter();
|
||||
if (!modules.isEmpty()) {
|
||||
for (MogoModule module : modules) {
|
||||
if (TextUtils.isEmpty(module.getBroadcastAction())) {
|
||||
continue;
|
||||
}
|
||||
filter.addAction(module.getBroadcastAction());
|
||||
}
|
||||
}
|
||||
|
||||
filter.addAction(MogoReceiver.VOICE_ACTION);
|
||||
// 小智语音
|
||||
filter.addAction(MogoReceiver.ACTION_VOICE_UI);
|
||||
@@ -84,7 +62,6 @@ public class MogoServices implements IMogoIntentListener {
|
||||
try {
|
||||
context.getApplicationContext().registerReceiver(receiver, filter);
|
||||
} catch (Exception e) {
|
||||
CallerLogger.INSTANCE.e(M_OLD_OTHER + TAG, "registerMogoReceiver error : " + e);
|
||||
}
|
||||
}
|
||||
|
||||
@@ -97,8 +74,4 @@ public class MogoServices implements IMogoIntentListener {
|
||||
IntentHandlerFactory.getInstance().handle(mContext, command, intent);
|
||||
}
|
||||
|
||||
public void destroy() {
|
||||
CallerLogger.INSTANCE.d(M_OLD_OTHER + TAG, "MogoServices do nothings.");
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
@@ -31,11 +31,6 @@ public class IntentHandlerFactory {
|
||||
return InstanceHolder.INSTANCE;
|
||||
}
|
||||
|
||||
private Object readResolve() {
|
||||
// 阻止反序列化,必须实现 Serializable 接口
|
||||
return InstanceHolder.INSTANCE;
|
||||
}
|
||||
|
||||
private final Map< String, IntentHandler > mHandlers = new HashMap<>();
|
||||
|
||||
private final IntentHandler DEFAULT = new EmptyIntentHandler();
|
||||
|
||||
@@ -1,44 +0,0 @@
|
||||
package com.mogo.commons.utils;
|
||||
|
||||
import static com.mogo.eagle.core.utilcode.mogo.logger.scene.SceneConstant.M_V2X;
|
||||
|
||||
import com.mogo.eagle.core.data.map.MogoLatLng;
|
||||
import com.mogo.eagle.core.data.map.MogoLocation;
|
||||
import com.mogo.eagle.core.utilcode.mogo.logger.CallerLogger;
|
||||
import com.mogo.eagle.core.utilcode.util.DrivingDirectionUtils;
|
||||
|
||||
/**
|
||||
* author : donghongyu
|
||||
* e-mail : 1358506549@qq.com
|
||||
* date : 2020/5/15 10:31 AM
|
||||
* desc : 基于位置工具类
|
||||
* version: 1.0
|
||||
*/
|
||||
public class LocationUtils {
|
||||
private static final String TAG = "LocationUtils";
|
||||
|
||||
/**
|
||||
* 获取传入的经纬度在车辆的什么位置
|
||||
*
|
||||
* @return 顺时针,true-前,false-后
|
||||
*/
|
||||
public static boolean isPointOnCarFront(MogoLocation carLocal, MogoLatLng pointLocal) {
|
||||
double carLon = carLocal.getLongitude();
|
||||
double carLat = carLocal.getLatitude();
|
||||
double poiLon = pointLocal.getLon();
|
||||
double poiLat = pointLocal.getLat();
|
||||
double carAngle = carLocal.getHeading();
|
||||
|
||||
// 计算车辆与点之间的夹角
|
||||
int diffAngle = DrivingDirectionUtils.getDegreeOfCar2Poi(
|
||||
carLon, carLat, poiLon, poiLat, (int) carAngle);
|
||||
|
||||
if (diffAngle <= 90) {
|
||||
CallerLogger.INSTANCE.i(M_V2X + TAG, "目标点在车辆--前方");
|
||||
return true;
|
||||
} else {
|
||||
CallerLogger.INSTANCE.i(M_V2X + TAG, "目标点在车辆--后方");
|
||||
return false;
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -1,53 +0,0 @@
|
||||
package com.mogo.commons.utils;
|
||||
|
||||
import com.mogo.eagle.core.data.map.MogoLatLng;
|
||||
|
||||
/**
|
||||
* @author liujing
|
||||
* @description 描述
|
||||
* @since: 2021/4/13
|
||||
*/
|
||||
public class Trigonometric {
|
||||
private final static double radius_b = 6378137;//大半径
|
||||
private final static double radius_s = 6356725;//小半径
|
||||
private static double mRadLo;
|
||||
private static double mRadLa;
|
||||
private static double Ec;
|
||||
private static double Ed;
|
||||
|
||||
/**
|
||||
* 计算两点间的角度
|
||||
*/
|
||||
public static double getAngle(double lon1, double lat1, double lon2,
|
||||
double lat2) {
|
||||
double fLat = Math.PI * (lat1) / 180.0;
|
||||
double fLng = Math.PI * (lon1) / 180.0;
|
||||
double tLat = Math.PI * (lat2) / 180.0;
|
||||
double tLng = Math.PI * (lon2) / 180.0;
|
||||
|
||||
double degree = (Math.atan2(Math.sin(tLng - fLng) * Math.cos(tLat), Math.cos(fLat) * Math.sin(tLat) -
|
||||
Math.sin(fLat) * Math.cos(tLat) * Math.cos(tLng - fLng))) * 180.0 / Math.PI;
|
||||
if (degree >= 0) {
|
||||
return degree;
|
||||
} else {
|
||||
return 360 + degree;
|
||||
}
|
||||
}
|
||||
|
||||
/**
|
||||
* 根据角度获取指定距离点的经纬度
|
||||
*/
|
||||
public static MogoLatLng getNewLocation(double lon, double lat, double distance, double angle) {
|
||||
mRadLo = lon * Math.PI / 180.;
|
||||
mRadLa = lat * Math.PI / 180.;
|
||||
Ec = radius_s + (radius_b - radius_s) * (90. - lat) / 90;
|
||||
Ed = Ec * Math.cos(mRadLa);
|
||||
|
||||
double dx = distance * Math.sin(Math.toRadians(angle));
|
||||
double dy = distance * Math.cos(Math.toRadians(angle));
|
||||
double lon_new = (dx / Ed + mRadLo) * 180. / Math.PI;
|
||||
double lat_new = (dy / Ec + mRadLa) * 180. / Math.PI;
|
||||
return new MogoLatLng(lat_new, lon_new);
|
||||
}
|
||||
|
||||
}
|
||||
Reference in New Issue
Block a user