Merge branch 'dev/dev_eagle_architecture_upgrade2' into 'master'
Dev/dev eagle architecture upgrade2 See merge request zhjt/AndroidApp/MoGoEagleEye!1
This commit is contained in:
1
.gitignore
vendored
1
.gitignore
vendored
@@ -9,6 +9,7 @@
|
||||
/.idea/assetWizardSettings.xml
|
||||
.idea
|
||||
.DS_Store
|
||||
._.DS_Store
|
||||
/build
|
||||
/captures
|
||||
.externalNativeBuild
|
||||
|
||||
3
.idea/gradle.xml
generated
3
.idea/gradle.xml
generated
@@ -4,7 +4,7 @@
|
||||
<component name="GradleSettings">
|
||||
<option name="linkedExternalProjectsSettings">
|
||||
<GradleProjectSettings>
|
||||
<option name="testRunner" value="GRADLE" />
|
||||
<option name="testRunner" value="PLATFORM" />
|
||||
<option name="distributionType" value="DEFAULT_WRAPPED" />
|
||||
<option name="externalProjectPath" value="$PROJECT_DIR$" />
|
||||
<option name="modules">
|
||||
@@ -81,6 +81,7 @@
|
||||
</set>
|
||||
</option>
|
||||
<option name="resolveModulePerSourceSet" value="false" />
|
||||
<option name="useQualifiedModuleNames" value="true" />
|
||||
</GradleProjectSettings>
|
||||
</option>
|
||||
</component>
|
||||
|
||||
1
.idea/misc.xml
generated
1
.idea/misc.xml
generated
@@ -13,6 +13,7 @@
|
||||
<map>
|
||||
<entry key="../../../../../../layout/custom_preview.xml" value="0.390625" />
|
||||
<entry key="../../../../../layout/custom_preview.xml" value="0.19947916666666668" />
|
||||
<entry key="OCH/mogo-och/src/main/res/layout/module_mogo_och_base_fragment.xml" value="0.24010416666666667" />
|
||||
<entry key="core/function-impl/mogo-core-function-hmi/src/main/res/layout/fragment_hmi.xml" value="0.33" />
|
||||
<entry key="core/function-impl/mogo-core-function-hmi/src/main/res/layout/view_autopilot_status.xml" value="0.25833333333333336" />
|
||||
<entry key="core/function-impl/mogo-core-function-hmi/src/main/res/layout/view_check_status.xml" value="1.0" />
|
||||
|
||||
@@ -30,8 +30,8 @@ import com.mogo.och.bus.bean.UpdateSiteStatusRequest;
|
||||
import com.mogo.och.bus.fragment.OchBusFragment;
|
||||
import com.mogo.och.bus.net.IOchBusApiService;
|
||||
import com.mogo.service.adas.IMogoAdasOCHCallback;
|
||||
import com.mogo.eagle.core.data.autopilot.AutoPilotControlParameters;
|
||||
import com.mogo.eagle.core.data.autopilot.AutoPilotStationInfo;
|
||||
import com.mogo.eagle.core.data.autopilot.AutopilotControlParameters;
|
||||
import com.mogo.eagle.core.data.autopilot.AutopilotStationInfo;
|
||||
import com.mogo.utils.logger.Logger;
|
||||
import com.mogo.utils.network.RequestOptions;
|
||||
import com.mogo.utils.network.utils.GsonUtil;
|
||||
@@ -307,10 +307,10 @@ public class OchBusPresenter extends Presenter< OchBusFragment > implements IMog
|
||||
currentStation.setIsCurrentSite( STATION_STATUS_LEAVING );
|
||||
nextStation.setIsCurrentSite( STATION_STATUS_ARRIVING );
|
||||
|
||||
AutoPilotControlParameters currentAutopilot = new AutoPilotControlParameters();
|
||||
AutopilotControlParameters currentAutopilot = new AutopilotControlParameters();
|
||||
currentAutopilot.isSpeakVoice = !isRestart;
|
||||
currentAutopilot.startLatLon = new AutoPilotControlParameters.AutoPilotLonLat( currentStation.getLat(), currentStation.getLon() );
|
||||
currentAutopilot.endLatLon = new AutoPilotControlParameters.AutoPilotLonLat( nextStation.getLat(), nextStation.getLon() );
|
||||
currentAutopilot.startLatLon = new AutopilotControlParameters.AutoPilotLonLat( currentStation.getLat(), currentStation.getLon() );
|
||||
currentAutopilot.endLatLon = new AutopilotControlParameters.AutoPilotLonLat( nextStation.getLat(), nextStation.getLon() );
|
||||
currentAutopilot.vehicleType = VEHICLE_TYPE;
|
||||
Logger.d( TAG, "开启自动驾驶====" + currentAutopilot );
|
||||
MogoApisHandler.getInstance().getApis().getAdasControllerApi().aiCloudToAdasData( currentAutopilot );
|
||||
@@ -354,7 +354,7 @@ public class OchBusPresenter extends Presenter< OchBusFragment > implements IMog
|
||||
}
|
||||
|
||||
@Override
|
||||
public void onArriveAt( AutoPilotStationInfo data ) {
|
||||
public void onArriveAt( AutopilotStationInfo data ) {
|
||||
if ( currentStationIndex >= stationList.size() - 1 ) {
|
||||
Logger.e( TAG, "到站异常,取消后续操作" );
|
||||
return;
|
||||
|
||||
@@ -15,8 +15,8 @@ import com.mogo.module.common.MogoApisHandler;
|
||||
import com.mogo.module.common.constants.HostConst;
|
||||
import com.mogo.och.taxi.ui.OCHTaxiUiController;
|
||||
import com.mogo.service.adas.IMogoAdasOCHCallback;
|
||||
import com.mogo.eagle.core.data.autopilot.AutoPilotControlParameters;
|
||||
import com.mogo.eagle.core.data.autopilot.AutoPilotStationInfo;
|
||||
import com.mogo.eagle.core.data.autopilot.AutopilotControlParameters;
|
||||
import com.mogo.eagle.core.data.autopilot.AutopilotStationInfo;
|
||||
import com.mogo.service.cloud.socket.IMogoLifecycleListener;
|
||||
import com.mogo.service.cloud.socket.IMogoOnMessageListener;
|
||||
import com.mogo.service.intent.IMogoIntentListener;
|
||||
@@ -714,7 +714,7 @@ class MogoOCHTaxiModel {
|
||||
*/
|
||||
private class OCHArriveNotifyCallback implements IMogoAdasOCHCallback {
|
||||
@Override
|
||||
public void onArriveAt( AutoPilotStationInfo data ) {
|
||||
public void onArriveAt( AutopilotStationInfo data ) {
|
||||
if ( data == null ) {
|
||||
return;
|
||||
}
|
||||
@@ -853,10 +853,10 @@ class MogoOCHTaxiModel {
|
||||
return;
|
||||
}
|
||||
|
||||
AutoPilotControlParameters parameters = new AutoPilotControlParameters();
|
||||
AutopilotControlParameters parameters = new AutopilotControlParameters();
|
||||
parameters.vehicleType = mCurrentOCHOrder.orderType;
|
||||
parameters.startLatLon = new AutoPilotControlParameters.AutoPilotLonLat( mCurrentOCHOrder.drivingRoutes.get( 0 ).wgsLat, mCurrentOCHOrder.drivingRoutes.get( 0 ).wgsLon );
|
||||
parameters.endLatLon = new AutoPilotControlParameters.AutoPilotLonLat( mCurrentOCHOrder.drivingRoutes.get( 1 ).wgsLat, mCurrentOCHOrder.drivingRoutes.get( 1 ).wgsLon );
|
||||
parameters.startLatLon = new AutopilotControlParameters.AutoPilotLonLat( mCurrentOCHOrder.drivingRoutes.get( 0 ).wgsLat, mCurrentOCHOrder.drivingRoutes.get( 0 ).wgsLon );
|
||||
parameters.endLatLon = new AutopilotControlParameters.AutoPilotLonLat( mCurrentOCHOrder.drivingRoutes.get( 1 ).wgsLat, mCurrentOCHOrder.drivingRoutes.get( 1 ).wgsLon );
|
||||
MogoApisHandler.getInstance()
|
||||
.getApis()
|
||||
.getAdasControllerApi()
|
||||
|
||||
@@ -26,7 +26,7 @@ import com.mogo.och.taxi.R;
|
||||
import com.mogo.och.view.SlidePanelView;
|
||||
import com.mogo.service.adas.IMogoAdasOCHCallback;
|
||||
import com.mogo.service.adas.IMogoAdasRouteCallBack;
|
||||
import com.mogo.eagle.core.data.autopilot.AutoPilotStationInfo;
|
||||
import com.mogo.eagle.core.data.autopilot.AutopilotStationInfo;
|
||||
import com.mogo.service.statusmanager.IMogoStatusChangedListener;
|
||||
import com.mogo.service.statusmanager.StatusDescriptor;
|
||||
import com.mogo.utils.logger.Logger;
|
||||
@@ -524,7 +524,7 @@ class OCHTaxiFragment extends BaseOchFragment< OCHTaxiView, OCHTaxiPresenter > i
|
||||
}
|
||||
|
||||
@Override
|
||||
public void onArriveAt(AutoPilotStationInfo data) {
|
||||
public void onArriveAt(AutopilotStationInfo data) {
|
||||
Logger.d( TAG, "行程结束");
|
||||
MogoApisHandler.getInstance().getApis().getAdasControllerApi().cancelAutopilot();
|
||||
}
|
||||
|
||||
@@ -17,7 +17,7 @@ import com.mogo.module.common.MogoApisHandler;
|
||||
import com.mogo.module.common.view.OnPreventFastClickListener;
|
||||
import com.mogo.och.view.SlidePanelView;
|
||||
import com.mogo.service.adas.IMogoAdasOCHCallback;
|
||||
import com.mogo.eagle.core.data.autopilot.AutoPilotControlParameters;
|
||||
import com.mogo.eagle.core.data.autopilot.AutopilotControlParameters;
|
||||
import com.mogo.utils.logger.Logger;
|
||||
|
||||
/**
|
||||
@@ -135,12 +135,12 @@ public abstract class BaseOchFragment<V extends IView, P extends Presenter<V>> e
|
||||
findViewById(R.id.btnAutopilotControl).setOnClickListener(view ->
|
||||
{
|
||||
// Logger.d("lianglihui","模拟 站点下发工控");
|
||||
AutoPilotControlParameters currentAutopilot = new AutoPilotControlParameters();
|
||||
AutopilotControlParameters currentAutopilot = new AutopilotControlParameters();
|
||||
currentAutopilot.isSpeakVoice = true;
|
||||
// 万集东门站
|
||||
currentAutopilot.startLatLon = new AutoPilotControlParameters.AutoPilotLonLat(40.194795425,116.724476409);
|
||||
currentAutopilot.startLatLon = new AutopilotControlParameters.AutoPilotLonLat(40.194795425,116.724476409);
|
||||
// 市政府前街18号
|
||||
currentAutopilot.endLatLon = new AutoPilotControlParameters.AutoPilotLonLat(40.1939540844,116.720067);
|
||||
currentAutopilot.endLatLon = new AutopilotControlParameters.AutoPilotLonLat(40.1939540844,116.720067);
|
||||
// 订单运营类型 (9出租车,10小巴)
|
||||
currentAutopilot.vehicleType = 10;
|
||||
Logger.d(TAG, "模拟 订单站点下发:" + currentAutopilot);
|
||||
|
||||
@@ -167,7 +167,7 @@ ext {
|
||||
// obu sdk
|
||||
obusdk : "com.zhidao.enterprise.smartv2x:smartv2x:1.0.0.3",
|
||||
mogoobu : 'com.zhidao.support.obu:mogoobu:1.0.0.16',
|
||||
mogoami : 'com.zhidao.support.obu.ami:mogoami:1.0.0.3',
|
||||
mogoami : 'com.zhidao.support.obu.ami:mogoami:1.0.0.4',
|
||||
adasHigh : 'com.zhidao.support.adas:high:1.2.0.4',
|
||||
|
||||
// 左侧面板
|
||||
|
||||
@@ -2,10 +2,10 @@ package com.mogo.eagle.core.function.autopilot
|
||||
|
||||
import android.content.Context
|
||||
import com.alibaba.android.arouter.facade.annotation.Route
|
||||
import com.mogo.eagle.core.data.autopilot.AutoPilotControlCmdParameter
|
||||
import com.mogo.eagle.core.data.autopilot.AutoPilotControlParameters
|
||||
import com.mogo.eagle.core.data.autopilot.AutopilotControlCmdParameter
|
||||
import com.mogo.eagle.core.data.autopilot.AutopilotControlParameters
|
||||
import com.mogo.eagle.core.data.constants.MogoServicePaths
|
||||
import com.mogo.eagle.core.function.api.autopilot.IMoGoAutoPilotProvider
|
||||
import com.mogo.eagle.core.function.api.autopilot.IMoGoAutopilotProvider
|
||||
import com.mogo.eagle.core.utilcode.util.GsonUtils
|
||||
import com.mogo.eagle.core.utilcode.util.LogUtils
|
||||
import com.zhidao.support.adas.high.AdasManager
|
||||
@@ -13,9 +13,11 @@ import com.zhidao.support.adas.high.AdasManager
|
||||
/**
|
||||
* @author xiaoyuzhou
|
||||
* @date 2021/9/22 8:43 下午
|
||||
* 域控制器
|
||||
*/
|
||||
@Route(path = MogoServicePaths.PATH_AUTO_PILOT)
|
||||
class MoGoAutoPilotProvider : IMoGoAutoPilotProvider {
|
||||
class MoGoAutopilotProvider :
|
||||
IMoGoAutopilotProvider {
|
||||
private val TAG = "MoGoAutoPilotProvider"
|
||||
|
||||
override val functionName: String
|
||||
@@ -24,7 +26,7 @@ class MoGoAutoPilotProvider : IMoGoAutoPilotProvider {
|
||||
|
||||
override fun init(context: Context) {
|
||||
// 初始化ADAS 域控制器
|
||||
AdasManager.getInstance().create(context)
|
||||
//AdasManager.getInstance().create(context)
|
||||
|
||||
}
|
||||
|
||||
@@ -35,10 +37,10 @@ class MoGoAutoPilotProvider : IMoGoAutoPilotProvider {
|
||||
}
|
||||
|
||||
|
||||
override fun startAutoPilot(result: AutoPilotControlParameters) {
|
||||
override fun startAutoPilot(result: AutopilotControlParameters) {
|
||||
if (AdasManager.getInstance().isSocketConnect) {
|
||||
val parameter =
|
||||
AutoPilotControlCmdParameter(
|
||||
AutopilotControlCmdParameter(
|
||||
TAG,
|
||||
result
|
||||
)
|
||||
@@ -0,0 +1,10 @@
|
||||
package com.mogo.eagle.core.function.autopilot.utils
|
||||
|
||||
/**
|
||||
* @author xiaoyuzhou
|
||||
* @date 2021/10/18 1:32 下午
|
||||
*/
|
||||
class AdasObjectConvertUtils {
|
||||
|
||||
}
|
||||
|
||||
@@ -22,7 +22,7 @@ object CheckNetWork {
|
||||
//网络请求,获取自车检测结果(工控机上报云端)
|
||||
fun checkNetWork(context: Context, callbackFlow: ICheckResultCallBack) {
|
||||
val params = ParamsBuilder.of(false)
|
||||
.append("sn", MoGoAiCloudClientConfig.getInstance().sn)
|
||||
.append("sn", "X20202108044A6797CFE6F8E899")
|
||||
.build()
|
||||
CheckApiServiceFactory.getDataApiService(context).loadMonitorDetail(params)
|
||||
.subscribeOn(Schedulers.io())
|
||||
|
||||
@@ -5,6 +5,7 @@ import android.view.LayoutInflater;
|
||||
import android.view.View;
|
||||
import android.view.ViewGroup;
|
||||
import android.widget.ImageView;
|
||||
import android.widget.ScrollView;
|
||||
import android.widget.TextView;
|
||||
|
||||
import androidx.annotation.NonNull;
|
||||
@@ -25,6 +26,11 @@ public class CheckInfoAdapter extends RecyclerView.Adapter {
|
||||
private Context mContext;
|
||||
private String mStyle;
|
||||
private List<CheckResultData.CheckListItem> showData;
|
||||
//item类型
|
||||
public static final int ITEM_TYPE_CONTENT = 0;//内容
|
||||
public static final int ITEM_TYPE_BOTTOM = 1;//footer类型
|
||||
//底部View个数
|
||||
private int mBottomCount = 1;
|
||||
|
||||
public CheckInfoAdapter(Context context, String style, List checkResultData) {
|
||||
mContext = context;
|
||||
@@ -36,6 +42,12 @@ public class CheckInfoAdapter extends RecyclerView.Adapter {
|
||||
@NonNull
|
||||
@Override
|
||||
public RecyclerView.ViewHolder onCreateViewHolder(@NonNull ViewGroup parent, int viewType) {
|
||||
if (viewType == ITEM_TYPE_BOTTOM) {
|
||||
View v = mLayoutInflater.inflate(R.layout.check_recycler_footer, parent,
|
||||
false);
|
||||
CheckInfoAdapter.CheckInfoFooter holder = new CheckInfoAdapter.CheckInfoFooter(v);
|
||||
return holder;
|
||||
}
|
||||
View v = mLayoutInflater.inflate(R.layout.check_info_adapter, parent,
|
||||
false);
|
||||
CheckInfoAdapter.CheckInfoViewHolder holder = new CheckInfoAdapter.CheckInfoViewHolder(v);
|
||||
@@ -46,23 +58,25 @@ public class CheckInfoAdapter extends RecyclerView.Adapter {
|
||||
@Override
|
||||
public void onBindViewHolder(@NonNull RecyclerView.ViewHolder holder, int position) {
|
||||
try {
|
||||
if (position < showData.size() * 2) {
|
||||
int index = position / 2;
|
||||
CheckResultData.CheckListItem positionItem = showData.get(index);
|
||||
if (isEven(position) == true) {//偶数隐藏图片显示检测指标
|
||||
((CheckInfoViewHolder) holder).checkIcon.setVisibility(View.GONE);
|
||||
((CheckInfoViewHolder) holder).mTextView.setText(positionItem.getName());
|
||||
} else {//奇数显示图片和检测指标结果
|
||||
((CheckInfoViewHolder) holder).checkIcon.setVisibility(View.VISIBLE);
|
||||
String state = (String) positionItem.getStateValue();
|
||||
if (state.equals("1")) {
|
||||
((CheckInfoViewHolder) holder).mTextView.setText("正常");
|
||||
((CheckInfoViewHolder) holder).checkIcon.setImageResource(R.drawable.check_right);
|
||||
} else if ((state.equals("0"))) {
|
||||
((CheckInfoViewHolder) holder).mTextView.setText("异常");
|
||||
((CheckInfoViewHolder) holder).checkIcon.setImageResource(R.drawable.check_wrong);
|
||||
} else {
|
||||
((CheckInfoViewHolder) holder).mTextView.setText(state);
|
||||
if (holder instanceof CheckInfoAdapter.CheckInfoViewHolder) {
|
||||
if (position < showData.size() * 2) {
|
||||
int index = position / 2;
|
||||
CheckResultData.CheckListItem positionItem = showData.get(index);
|
||||
if (isEven(position) == true) {//偶数隐藏图片显示检测指标
|
||||
((CheckInfoViewHolder) holder).checkIcon.setVisibility(View.GONE);
|
||||
((CheckInfoViewHolder) holder).mTextView.setText(positionItem.getName());
|
||||
} else {//奇数显示图片和检测指标结果
|
||||
((CheckInfoViewHolder) holder).checkIcon.setVisibility(View.VISIBLE);
|
||||
String state = (String) positionItem.getStateValue();
|
||||
if (state.equals("1")) {
|
||||
((CheckInfoViewHolder) holder).mTextView.setText("正常");
|
||||
((CheckInfoViewHolder) holder).checkIcon.setImageResource(R.drawable.check_right);
|
||||
} else if ((state.equals("0"))) {
|
||||
((CheckInfoViewHolder) holder).mTextView.setText("异常");
|
||||
((CheckInfoViewHolder) holder).checkIcon.setImageResource(R.drawable.check_wrong);
|
||||
} else {
|
||||
((CheckInfoViewHolder) holder).mTextView.setText(state);
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -83,7 +97,7 @@ public class CheckInfoAdapter extends RecyclerView.Adapter {
|
||||
|
||||
@Override
|
||||
public int getItemCount() {
|
||||
return showData.size() * 2;
|
||||
return showData.size() * 2 + mBottomCount;
|
||||
}
|
||||
|
||||
public class CheckInfoViewHolder extends RecyclerView.ViewHolder {
|
||||
@@ -97,8 +111,17 @@ public class CheckInfoAdapter extends RecyclerView.Adapter {
|
||||
}
|
||||
}
|
||||
|
||||
public class CheckInfoFooter extends RecyclerView.ViewHolder {
|
||||
public CheckInfoFooter(View v) {
|
||||
super(v);
|
||||
}
|
||||
}
|
||||
|
||||
@Override
|
||||
public int getItemViewType(int position) {
|
||||
return position;
|
||||
if (position > showData.size() * 2) {
|
||||
return ITEM_TYPE_BOTTOM;
|
||||
}
|
||||
return ITEM_TYPE_CONTENT;
|
||||
}
|
||||
}
|
||||
|
||||
@@ -6,6 +6,7 @@ import android.graphics.Canvas;
|
||||
import android.graphics.Rect;
|
||||
import android.graphics.drawable.Drawable;
|
||||
import android.graphics.drawable.GradientDrawable;
|
||||
import android.util.Log;
|
||||
import android.view.View;
|
||||
|
||||
import androidx.recyclerview.widget.GridLayoutManager;
|
||||
@@ -105,18 +106,6 @@ public class CheckInfoGridItemDivider extends RecyclerView.ItemDecoration {
|
||||
divider.draw(c);
|
||||
}
|
||||
|
||||
//待修改为右侧
|
||||
private void drawVerticalForLastColum(Canvas c, View child) {
|
||||
final RecyclerView.LayoutParams params = (RecyclerView.LayoutParams) child
|
||||
.getLayoutParams();
|
||||
int left = child.getRight() - params.leftMargin - divider.getIntrinsicWidth();
|
||||
int top = child.getTop() - params.topMargin;
|
||||
int right = child.getRight() - params.leftMargin + divider.getIntrinsicWidth();
|
||||
int bottom = top + child.getHeight() + divider.getIntrinsicHeight();
|
||||
divider.setBounds(left, top, right, bottom);
|
||||
divider.draw(c);
|
||||
}
|
||||
|
||||
public void drawVertical(Canvas c, RecyclerView parent) {
|
||||
final int childCount = parent.getChildCount();
|
||||
for (int i = 0; i < childCount; i++) {
|
||||
@@ -133,62 +122,9 @@ public class CheckInfoGridItemDivider extends RecyclerView.ItemDecoration {
|
||||
if (isFirstColum(parent, i, getSpanCount(parent))) { //画第一列左边分割线
|
||||
drawVerticalForFirstColum(c, child);
|
||||
}
|
||||
if (isLastColum(parent, i, getSpanCount(parent), childCount)) {//画最后一列右侧分割线
|
||||
drawVerticalForLastColum(c, child);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
private boolean isLastColum(RecyclerView parent, int pos, int spanCount,
|
||||
int childCount) {
|
||||
RecyclerView.LayoutManager layoutManager = parent.getLayoutManager();
|
||||
if (layoutManager instanceof GridLayoutManager) {
|
||||
if ((pos + 1) % spanCount == 0)// 如果是最后一列,则不需要绘制右边
|
||||
{
|
||||
return true;
|
||||
}
|
||||
} else if (layoutManager instanceof StaggeredGridLayoutManager) {
|
||||
int orientation = ((StaggeredGridLayoutManager) layoutManager)
|
||||
.getOrientation();
|
||||
if (orientation == StaggeredGridLayoutManager.VERTICAL) {
|
||||
if ((pos + 1) % spanCount == 0)// 如果是最后一列,则不需要绘制右边
|
||||
{
|
||||
return true;
|
||||
}
|
||||
} else {
|
||||
childCount = childCount - childCount % spanCount;
|
||||
if (pos >= childCount)// 如果是最后一列,则不需要绘制右边
|
||||
return true;
|
||||
}
|
||||
}
|
||||
return false;
|
||||
}
|
||||
|
||||
private boolean isLastRaw(RecyclerView parent, int pos, int spanCount,
|
||||
int childCount) {
|
||||
RecyclerView.LayoutManager layoutManager = parent.getLayoutManager();
|
||||
if (layoutManager instanceof GridLayoutManager) {
|
||||
childCount = childCount - childCount % spanCount;
|
||||
if (pos >= childCount)// 如果是最后一行,则不需要绘制底部
|
||||
return true;
|
||||
} else if (layoutManager instanceof StaggeredGridLayoutManager) {
|
||||
int orientation = ((StaggeredGridLayoutManager) layoutManager)
|
||||
.getOrientation();
|
||||
if (orientation == StaggeredGridLayoutManager.VERTICAL) {
|
||||
childCount = childCount - childCount % spanCount;
|
||||
// 如果是最后一行,则不需要绘制底部
|
||||
if (pos >= childCount)
|
||||
return true;
|
||||
} else {
|
||||
// 如果是最后一行,则不需要绘制底部
|
||||
if ((pos + 1) % spanCount == 0) {
|
||||
return true;
|
||||
}
|
||||
}
|
||||
}
|
||||
return false;
|
||||
}
|
||||
|
||||
//是否为第一列
|
||||
private boolean isFirstColum(RecyclerView parent, int pos, int spanCount) {
|
||||
RecyclerView.LayoutManager layoutManager = parent.getLayoutManager();
|
||||
|
||||
@@ -0,0 +1,28 @@
|
||||
package com.mogo.eagle.core.function.check.view;
|
||||
|
||||
import android.content.Context;
|
||||
import android.util.AttributeSet;
|
||||
import android.view.LayoutInflater;
|
||||
import android.view.View;
|
||||
|
||||
import com.mogo.eagle.core.function.check.R;
|
||||
|
||||
import java.util.jar.Attributes;
|
||||
|
||||
/**
|
||||
* @author liujing
|
||||
* @description 描述
|
||||
* @since: 10/13/21
|
||||
*/
|
||||
public class CheckRecyclerFooter extends View {
|
||||
|
||||
public CheckRecyclerFooter(Context context, AttributeSet attributes) {
|
||||
super(context, attributes);
|
||||
LayoutInflater.from(context).inflate(R.layout.check_recycler_footer, null);
|
||||
}
|
||||
|
||||
@Override
|
||||
protected void onMeasure(int widthMeasureSpec, int heightMeasureSpec) {
|
||||
super.onMeasure(widthMeasureSpec, heightMeasureSpec);
|
||||
}
|
||||
}
|
||||
@@ -33,51 +33,52 @@
|
||||
android:layout_height="wrap_content"
|
||||
android:layout_marginStart="@dimen/dp_97"
|
||||
android:layout_marginTop="@dimen/dp_225"
|
||||
android:visibility="invisible"
|
||||
android:visibility="visible"
|
||||
app:layout_constraintStart_toStartOf="parent"
|
||||
app:layout_constraintTop_toTopOf="parent">
|
||||
|
||||
<ImageView
|
||||
android:id="@+id/error_image"
|
||||
android:layout_width="@dimen/dp_56"
|
||||
android:layout_height="@dimen/dp_56"
|
||||
android:layout_marginTop="@dimen/dp_15"
|
||||
android:src="@drawable/check_wrong"
|
||||
app:layout_constraintTop_toTopOf="@id/error_view" />
|
||||
|
||||
<TextView
|
||||
android:id="@+id/error_title"
|
||||
android:layout_width="wrap_content"
|
||||
android:layout_height="wrap_content"
|
||||
android:layout_marginStart="@dimen/dp_15"
|
||||
android:text="自动驾驶车辆存在风险"
|
||||
android:textColor="@color/module_commons_wm_dialog_text_textColor"
|
||||
android:textSize="@dimen/dp_54"
|
||||
android:textStyle="bold"
|
||||
app:layout_constraintStart_toEndOf="@id/error_image"
|
||||
app:layout_constraintStart_toStartOf="@id/error_view"
|
||||
app:layout_constraintTop_toTopOf="@id/error_view" />
|
||||
|
||||
<ImageView
|
||||
android:id="@+id/error_image"
|
||||
android:layout_width="@dimen/dp_56"
|
||||
android:layout_height="@dimen/dp_56"
|
||||
android:layout_marginTop="@dimen/dp_25"
|
||||
android:src="@drawable/check_wrong"
|
||||
app:layout_constraintTop_toBottomOf="@id/error_title" />
|
||||
|
||||
<TextView
|
||||
android:id="@+id/error_txt"
|
||||
android:layout_width="wrap_content"
|
||||
android:layout_height="wrap_content"
|
||||
android:layout_marginLeft="@dimen/dp_26"
|
||||
android:layout_marginTop="@dimen/dp_23"
|
||||
android:text="软件运行异常"
|
||||
android:textColor="@color/check_tip_error_color"
|
||||
android:textSize="@dimen/dp_38"
|
||||
app:layout_constraintLeft_toRightOf="@+id/error_image"
|
||||
app:layout_constraintTop_toBottomOf="@id/error_title" />
|
||||
|
||||
<TextView
|
||||
android:id="@+id/check_detail"
|
||||
android:layout_width="@dimen/dp_287"
|
||||
android:layout_height="@dimen/dp_100"
|
||||
android:layout_marginTop="@dimen/check_button_bottom"
|
||||
android:layout_marginTop="@dimen/dp_70"
|
||||
android:background="@drawable/check_detail"
|
||||
android:gravity="center"
|
||||
android:text="查看详情"
|
||||
android:textColor="@color/module_commons_wm_dialog_text_textColor"
|
||||
android:textSize="@dimen/check_button_text_size"
|
||||
app:layout_constraintTop_toBottomOf="@id/error_txt" />
|
||||
app:layout_constraintTop_toBottomOf="@id/error_image" />
|
||||
|
||||
</androidx.constraintlayout.widget.ConstraintLayout>
|
||||
|
||||
@@ -87,6 +88,7 @@
|
||||
android:layout_height="wrap_content"
|
||||
android:layout_marginStart="@dimen/dp_133"
|
||||
android:layout_marginTop="@dimen/dp_200"
|
||||
android:visibility="invisible"
|
||||
app:layout_constraintStart_toStartOf="parent"
|
||||
app:layout_constraintTop_toTopOf="parent">
|
||||
|
||||
@@ -102,7 +104,7 @@
|
||||
android:id="@+id/check_button"
|
||||
android:layout_width="@dimen/dp_287"
|
||||
android:layout_height="@dimen/dp_100"
|
||||
android:layout_marginTop="@dimen/check_button_bottom"
|
||||
android:layout_marginTop="@dimen/dp_70"
|
||||
android:background="@drawable/check_button"
|
||||
android:gravity="center"
|
||||
android:text="立即体检"
|
||||
|
||||
@@ -42,6 +42,18 @@
|
||||
app:layout_constraintRight_toRightOf="parent"
|
||||
app:layout_constraintTop_toBottomOf="@+id/check_info_title"></include>
|
||||
|
||||
<View
|
||||
android:id="@+id/line_top"
|
||||
android:layout_width="3px"
|
||||
android:layout_height="@dimen/dp_127"
|
||||
android:layout_marginTop="@dimen/dp_66"
|
||||
android:background="@color/check_info_shape_color"
|
||||
app:layout_constraintBottom_toBottomOf="@+id/check_list_recycler"
|
||||
app:layout_constraintEnd_toEndOf="parent"
|
||||
app:layout_constraintStart_toStartOf="parent"
|
||||
app:layout_constraintTop_toBottomOf="@+id/check_info_title"
|
||||
app:layout_constraintVertical_bias="0.0" />
|
||||
|
||||
<com.mogo.eagle.core.function.check.view.CheckInfoRecyclerView
|
||||
android:id="@+id/check_list_recycler"
|
||||
android:layout_width="match_parent"
|
||||
@@ -54,5 +66,13 @@
|
||||
app:layout_constraintRight_toRightOf="parent"
|
||||
app:layout_constraintTop_toBottomOf="@+id/check_title_item" />
|
||||
|
||||
<View
|
||||
android:layout_width="3px"
|
||||
android:layout_height="0dp"
|
||||
android:background="@color/check_info_shape_color"
|
||||
app:layout_constraintBottom_toBottomOf="@+id/check_list_recycler"
|
||||
app:layout_constraintEnd_toEndOf="@id/check_list_recycler"
|
||||
app:layout_constraintStart_toStartOf="@id/check_list_recycler"
|
||||
app:layout_constraintTop_toTopOf="@id/check_list_recycler" />
|
||||
|
||||
</androidx.constraintlayout.widget.ConstraintLayout>
|
||||
@@ -0,0 +1,8 @@
|
||||
<?xml version="1.0" encoding="utf-8"?>
|
||||
<androidx.constraintlayout.widget.ConstraintLayout xmlns:android="http://schemas.android.com/apk/res/android"
|
||||
android:layout_width="match_parent"
|
||||
android:layout_height="@dimen/dp_300"
|
||||
android:background="@color/check_list_item_back">
|
||||
|
||||
|
||||
</androidx.constraintlayout.widget.ConstraintLayout>
|
||||
@@ -2,7 +2,6 @@
|
||||
<resources>
|
||||
<dimen name="check_item_space_vr">30px</dimen>
|
||||
<dimen name="check_button_text_size">38px</dimen>
|
||||
<dimen name="check_button_bottom">70px</dimen>
|
||||
<dimen name="check_button_left">133px</dimen>
|
||||
<dimen name="check_image_bottom">50px</dimen>
|
||||
<dimen name="check_image_right">50px</dimen>
|
||||
|
||||
@@ -11,7 +11,7 @@
|
||||
<color name="check_icon_error_color">#EE3132</color>
|
||||
<color name="check_info_position_line_color">#666DA5</color>
|
||||
<color name="check_info_shape_color">#767FCD</color>
|
||||
<color name="check_info_title_back">#151738</color>
|
||||
<color name="check_info_title_back">#1C2149</color>
|
||||
|
||||
|
||||
</resources>
|
||||
@@ -7,11 +7,11 @@ import androidx.constraintlayout.widget.ConstraintLayout
|
||||
import com.mogo.cloud.passport.MoGoAiCloudClient
|
||||
import com.mogo.commons.AbsMogoApplication
|
||||
import com.mogo.eagle.core.data.app.AppConfigInfo
|
||||
import com.mogo.eagle.core.data.autopilot.AutoPilotStationInfo
|
||||
import com.mogo.eagle.core.data.autopilot.AutoPilotStatusInfo
|
||||
import com.mogo.eagle.core.data.autopilot.*
|
||||
import com.mogo.eagle.core.data.constants.MoGoConfig
|
||||
import com.mogo.eagle.core.data.obu.ObuStatusInfo
|
||||
import com.mogo.eagle.core.function.api.autopilot.IMoGoAutoPilotStatusListener
|
||||
import com.mogo.eagle.core.data.traffic.TrafficData
|
||||
import com.mogo.eagle.core.function.api.autopilot.IMoGoAutopilotStatusListener
|
||||
import com.mogo.eagle.core.function.api.obu.IMoGoObuStatusListener
|
||||
import com.mogo.eagle.core.function.call.autopilot.CallerAutoPilotManager
|
||||
import com.mogo.eagle.core.function.call.autopilot.CallerAutoPilotStatusListenerManager
|
||||
@@ -38,7 +38,7 @@ class DebugSettingView @JvmOverloads constructor(
|
||||
attrs: AttributeSet? = null,
|
||||
defStyleAttr: Int = 0
|
||||
) : ConstraintLayout(context, attrs, defStyleAttr), IMoGoObuStatusListener,
|
||||
IMoGoAutoPilotStatusListener {
|
||||
IMoGoAutopilotStatusListener {
|
||||
|
||||
private val TAG = "DebugSettingView"
|
||||
|
||||
@@ -107,19 +107,37 @@ class DebugSettingView @JvmOverloads constructor(
|
||||
tvObuInfo.text = GsonUtils.toJson(obuStatusInfo)
|
||||
}
|
||||
|
||||
/**
|
||||
* 自动驾驶相关回调
|
||||
*/
|
||||
override fun onAutoPilotArriveAtStation(data: AutoPilotStationInfo?) {
|
||||
|
||||
}
|
||||
|
||||
override fun onAutoPilotStateChanged(state: Int, reason: String?) {
|
||||
|
||||
}
|
||||
|
||||
override fun onAutoPilotStatusResponse(autoPilotStatusInfo: AutoPilotStatusInfo?) {
|
||||
override fun onAutopilotStatusResponse(autoPilotStatusInfo: AutopilotStatusInfo) {
|
||||
tvAutopilotInfo.text = GsonUtils.toJson(autoPilotStatusInfo)
|
||||
}
|
||||
|
||||
override fun onAutopilotArriveAtStation(autopilotWayArrive: AutopilotStationInfo?) {
|
||||
|
||||
}
|
||||
|
||||
override fun onAutopilotCarStateData(autoPilotCarStateInfo: AutopilotCarStateInfo?) {
|
||||
|
||||
}
|
||||
|
||||
override fun onAutopilotRoute(autopilotRoute: AutopilotRouteInfo?) {
|
||||
|
||||
}
|
||||
|
||||
override fun onAutopilotSNRequest() {
|
||||
|
||||
}
|
||||
|
||||
override fun onAutopilotGuardian(guardianInfo: AutopilotGuardianStatusInfo?) {
|
||||
|
||||
}
|
||||
|
||||
override fun onAutopilotIdentifyDataUpdate(trafficData: List<TrafficData>?) {
|
||||
|
||||
}
|
||||
|
||||
override fun onAutopilotWarnMessage(autopilotWarnMessage: AutopilotWarnMessage?) {
|
||||
|
||||
}
|
||||
|
||||
|
||||
}
|
||||
@@ -5,8 +5,8 @@ import android.util.AttributeSet
|
||||
import android.view.LayoutInflater
|
||||
import android.view.View
|
||||
import androidx.constraintlayout.widget.ConstraintLayout
|
||||
import com.mogo.eagle.core.data.autopilot.AutoPilotControlParameters
|
||||
import com.mogo.eagle.core.data.autopilot.AutoPilotStationInfo
|
||||
import com.mogo.eagle.core.data.autopilot.AutopilotControlParameters
|
||||
import com.mogo.eagle.core.data.autopilot.AutopilotStationInfo
|
||||
import com.mogo.eagle.core.function.call.hmi.CallerHmiListenerManager
|
||||
import com.mogo.eagle.core.function.hmi.R
|
||||
import com.mogo.eagle.core.utilcode.util.LogUtils
|
||||
@@ -68,10 +68,10 @@ class AutoPilotStatusView @JvmOverloads constructor(
|
||||
}
|
||||
private fun startAutoPilot() {
|
||||
val currentAutopilot =
|
||||
AutoPilotControlParameters()
|
||||
AutopilotControlParameters()
|
||||
currentAutopilot.isSpeakVoice = false
|
||||
currentAutopilot.startLatLon = AutoPilotControlParameters.AutoPilotLonLat(40.199157289445921,116.73675895051454);
|
||||
currentAutopilot.endLatLon = AutoPilotControlParameters.AutoPilotLonLat(40.199255159538758,116.73274535677977);
|
||||
currentAutopilot.startLatLon = AutopilotControlParameters.AutoPilotLonLat(40.199157289445921,116.73675895051454);
|
||||
currentAutopilot.endLatLon = AutopilotControlParameters.AutoPilotLonLat(40.199255159538758,116.73274535677977);
|
||||
currentAutopilot.vehicleType = 10
|
||||
MogoApisHandler.getInstance().apis.adasControllerApi.aiCloudToAdasData(currentAutopilot)
|
||||
}
|
||||
@@ -103,7 +103,7 @@ class AutoPilotStatusView @JvmOverloads constructor(
|
||||
}
|
||||
}
|
||||
|
||||
override fun onArriveAt(data: AutoPilotStationInfo?) {
|
||||
override fun onArriveAt(data: AutopilotStationInfo?) {
|
||||
|
||||
}
|
||||
|
||||
|
||||
@@ -1,6 +1,7 @@
|
||||
package com.mogo.eagle.core.function.obu.mogo
|
||||
|
||||
import android.content.Context
|
||||
import android.text.TextUtils
|
||||
import com.alibaba.android.arouter.launcher.ARouter
|
||||
import com.mogo.eagle.core.data.enums.WarningDirectionEnum
|
||||
import com.mogo.eagle.core.function.api.hmi.warning.IMoGoWarningStatusListener
|
||||
@@ -117,11 +118,12 @@ class MogoPrivateObuManager private constructor() {
|
||||
override fun onCvxAppInitIndInfo(info: CvxAppInitIndInfo) {
|
||||
super.onCvxAppInitIndInfo(info)
|
||||
Logger.d(MogoObuConst.TAG_MOGO_OBU, "onCvxAppInitIndInfo ------> $info")
|
||||
mObuStatusInfo.stackInfo = info.stack_info
|
||||
mObuStatusInfo.appInfo = info.app_info
|
||||
mObuStatusInfo.hliInfo = info.hli_info
|
||||
mObuStatusInfo.otherInfo = info.other_info
|
||||
CallerObuListenerManager.invokeListener(mObuStatusInfo)
|
||||
if (info != null) {
|
||||
mObuStatusInfo.stackInfo = info.stack_info
|
||||
mObuStatusInfo.appInfo = info.app_info
|
||||
mObuStatusInfo.hliInfo = info.hli_info
|
||||
CallerObuListenerManager.invokeListener(mObuStatusInfo)
|
||||
}
|
||||
}
|
||||
|
||||
// (2) 车辆信息:CVX_HV_INFO_IND
|
||||
|
||||
@@ -45,6 +45,9 @@ dependencies {
|
||||
implementation fileTree(dir: 'libs', include: ['*.jar'])
|
||||
implementation rootProject.ext.dependencies.kotlinstdlibjdk7
|
||||
implementation rootProject.ext.dependencies.androidxappcompat
|
||||
|
||||
implementation rootProject.ext.dependencies.gson
|
||||
|
||||
if (Boolean.valueOf(RELEASE)) {
|
||||
|
||||
} else {
|
||||
|
||||
@@ -1,19 +0,0 @@
|
||||
package com.mogo.eagle.core.data.autopilot;
|
||||
|
||||
public
|
||||
/**
|
||||
* @author congtaowang
|
||||
* @since 2020/10/22
|
||||
*
|
||||
* 域控制器 控制指令发送
|
||||
*/
|
||||
class AutoPilotControlCmdParameter {
|
||||
|
||||
public String action;
|
||||
public Object result;
|
||||
|
||||
public AutoPilotControlCmdParameter(String action, Object result ) {
|
||||
this.action = action;
|
||||
this.result = result;
|
||||
}
|
||||
}
|
||||
@@ -1,21 +0,0 @@
|
||||
package com.mogo.eagle.core.data.autopilot;
|
||||
|
||||
public
|
||||
/**
|
||||
* @author congtaowang
|
||||
* @since 2021/1/18
|
||||
*
|
||||
* 自动驾驶网约车回调数据
|
||||
*/
|
||||
class AutoPilotStationInfo {
|
||||
|
||||
public int type;
|
||||
public double lon;
|
||||
public double lat;
|
||||
|
||||
public AutoPilotStationInfo(int type, double lon, double lat ) {
|
||||
this.type = type;
|
||||
this.lon = lon;
|
||||
this.lat = lat;
|
||||
}
|
||||
}
|
||||
@@ -1,14 +1,13 @@
|
||||
package com.mogo.service.adas.entity;
|
||||
package com.mogo.eagle.core.data.autopilot;
|
||||
|
||||
import java.io.Serializable;
|
||||
|
||||
/**
|
||||
* @author nie yunlong
|
||||
* @des 车辆状态
|
||||
* @date 2020/3/12
|
||||
* @author donghongyu
|
||||
* @des 自车辆状态
|
||||
* @date 2021/10/18
|
||||
*/
|
||||
public class ADASCarStateInfo implements Serializable {
|
||||
|
||||
public class AutopilotCarStateInfo implements Serializable {
|
||||
|
||||
/**
|
||||
* action : “state”
|
||||
@@ -17,6 +16,15 @@ public class ADASCarStateInfo implements Serializable {
|
||||
|
||||
private String action;
|
||||
private ValuesBean values;
|
||||
private float fps;
|
||||
|
||||
public float getFps() {
|
||||
return fps;
|
||||
}
|
||||
|
||||
public void setFps(float fps) {
|
||||
this.fps = fps;
|
||||
}
|
||||
|
||||
public String getAction() {
|
||||
return action;
|
||||
@@ -52,46 +60,105 @@ public class ADASCarStateInfo implements Serializable {
|
||||
private double yaw_rate;
|
||||
//惯导车速 m/s
|
||||
private float gnss_speed;
|
||||
//gps 时间
|
||||
//车辆车速 m/s
|
||||
private float vehicle_speed;
|
||||
//gps时间
|
||||
private String satelliteTime;
|
||||
|
||||
//UTC时间差
|
||||
private long utcTimeDiffer;
|
||||
//系统时间
|
||||
private String systemTime;
|
||||
//接收到数据的时间
|
||||
private String receiverDataTime;
|
||||
// udp收到数据的时间
|
||||
private String startReceiverDataTime;
|
||||
//接收到gps时间
|
||||
private String adasSatelliteTime;
|
||||
//开始接收数据时间
|
||||
private String startReceiverDataTime;
|
||||
//时间延迟
|
||||
private long timeDiff=0;
|
||||
private int turn_light; //转向灯状态 0是正常 1是左转 2是右转
|
||||
private int flash_light; //双闪灯状态
|
||||
private int brake_light; //刹车灯状态
|
||||
private int frame_num;//统计发包个数
|
||||
|
||||
public int getFrame_num() {
|
||||
return frame_num;
|
||||
}
|
||||
|
||||
public void setFrame_num(int frame_num) {
|
||||
this.frame_num = frame_num;
|
||||
}
|
||||
|
||||
public long getTimeDiff() {
|
||||
return timeDiff;
|
||||
}
|
||||
|
||||
public void setTimeDiff(long timeDiff) {
|
||||
this.timeDiff = timeDiff;
|
||||
}
|
||||
|
||||
public String getReceiverDataTime() {
|
||||
return receiverDataTime;
|
||||
}
|
||||
|
||||
public void setReceiverDataTime(String receiverDataTime) {
|
||||
this.receiverDataTime = receiverDataTime;
|
||||
}
|
||||
|
||||
public String getAdasSatelliteTime() {
|
||||
return adasSatelliteTime;
|
||||
}
|
||||
|
||||
public void setAdasSatelliteTime( String adasSatelliteTime ) {
|
||||
public void setAdasSatelliteTime(String adasSatelliteTime) {
|
||||
this.adasSatelliteTime = adasSatelliteTime;
|
||||
}
|
||||
|
||||
public String getStartReceiverDataTime() {
|
||||
return startReceiverDataTime;
|
||||
public String getSystemTime() {
|
||||
return systemTime;
|
||||
}
|
||||
|
||||
public void setStartReceiverDataTime( String startReceiverDataTime ) {
|
||||
this.startReceiverDataTime = startReceiverDataTime;
|
||||
public void setSystemTime(String systemTime) {
|
||||
this.systemTime = systemTime;
|
||||
}
|
||||
|
||||
public float getGnss_speed() {
|
||||
return gnss_speed;
|
||||
}
|
||||
|
||||
public void setGnss_speed( float gnss_speed ) {
|
||||
public void setGnss_speed(float gnss_speed) {
|
||||
this.gnss_speed = gnss_speed;
|
||||
}
|
||||
|
||||
public String getSatelliteTime() {
|
||||
return satelliteTime;
|
||||
public float getVehicle_speed() {
|
||||
return vehicle_speed;
|
||||
}
|
||||
|
||||
public void setSatelliteTime( String satelliteTime ) {
|
||||
this.satelliteTime = satelliteTime;
|
||||
public void setVehicle_speed(float vehicle_speed) {
|
||||
this.vehicle_speed = vehicle_speed;
|
||||
}
|
||||
|
||||
public int getTurn_light() {
|
||||
return turn_light;
|
||||
}
|
||||
|
||||
public void setTurn_light(int turn_light) {
|
||||
this.turn_light = turn_light;
|
||||
}
|
||||
|
||||
public int getFlash_light() {
|
||||
return flash_light;
|
||||
}
|
||||
|
||||
public void setFlash_light(int flash_light) {
|
||||
this.flash_light = flash_light;
|
||||
}
|
||||
|
||||
public int getBrake_light() {
|
||||
return brake_light;
|
||||
}
|
||||
|
||||
public void setBrake_light(int brake_light) {
|
||||
this.brake_light = brake_light;
|
||||
}
|
||||
|
||||
public double getLon() {
|
||||
@@ -142,22 +209,31 @@ public class ADASCarStateInfo implements Serializable {
|
||||
this.yaw_rate = yaw_rate;
|
||||
}
|
||||
|
||||
public String getSystemTime() {
|
||||
return systemTime;
|
||||
public String getSatelliteTime() {
|
||||
return satelliteTime;
|
||||
}
|
||||
|
||||
public void setSystemTime( String systemTime ) {
|
||||
this.systemTime = systemTime;
|
||||
public void setSatelliteTime(String satelliteTime) {
|
||||
this.satelliteTime = satelliteTime;
|
||||
}
|
||||
|
||||
public String getReceiverDataTime() {
|
||||
return receiverDataTime;
|
||||
public long getUtcTimeDiffer() {
|
||||
return utcTimeDiffer;
|
||||
}
|
||||
|
||||
public void setReceiverDataTime( String receiverDataTime ) {
|
||||
this.receiverDataTime = receiverDataTime;
|
||||
public void setUtcTimeDiffer(long utcTimeDiffer) {
|
||||
this.utcTimeDiffer = utcTimeDiffer;
|
||||
}
|
||||
|
||||
public String getStartReceiverDataTime() {
|
||||
return startReceiverDataTime;
|
||||
}
|
||||
|
||||
public void setStartReceiverDataTime(String startReceiverDataTime) {
|
||||
this.startReceiverDataTime = startReceiverDataTime;
|
||||
}
|
||||
|
||||
|
||||
@Override
|
||||
public String toString() {
|
||||
return "ValuesBean{" +
|
||||
@@ -167,6 +243,18 @@ public class ADASCarStateInfo implements Serializable {
|
||||
", heading=" + heading +
|
||||
", acceleration=" + acceleration +
|
||||
", yaw_rate=" + yaw_rate +
|
||||
", gnss_speed=" + gnss_speed +
|
||||
", vehicle_speed=" + vehicle_speed +
|
||||
", satelliteTime='" + satelliteTime + '\'' +
|
||||
", utcTimeDiffer='" + utcTimeDiffer + '\'' +
|
||||
", systemTime='" + systemTime + '\'' +
|
||||
", receiverDataTime='" + receiverDataTime + '\'' +
|
||||
", startReceiverDataTime='" + startReceiverDataTime + '\'' +
|
||||
", timeDiff=" + timeDiff +
|
||||
", turn_light=" + turn_light +
|
||||
", flash_light=" + flash_light +
|
||||
", brake_light=" + brake_light +
|
||||
", frame_num=" + frame_num +
|
||||
'}';
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,28 @@
|
||||
package com.mogo.eagle.core.data.autopilot;
|
||||
|
||||
|
||||
/**
|
||||
* @author congtaowang
|
||||
* @since 2020/10/22
|
||||
*
|
||||
* 域控制器 控制指令发送
|
||||
*
|
||||
*/
|
||||
public class AutopilotControlCmdParameter {
|
||||
|
||||
public String action;
|
||||
public Object result;
|
||||
|
||||
public AutopilotControlCmdParameter(String action, Object result) {
|
||||
this.action = action;
|
||||
this.result = result;
|
||||
}
|
||||
|
||||
@Override
|
||||
public String toString() {
|
||||
return "AutoPilotControlCmdParameter{" +
|
||||
"action='" + action + '\'' +
|
||||
", result=" + result +
|
||||
'}';
|
||||
}
|
||||
}
|
||||
@@ -7,8 +7,9 @@ import java.util.List;
|
||||
* @since 2021/09/22
|
||||
* <p>
|
||||
* 启动自动驾驶参数
|
||||
*
|
||||
*/
|
||||
public class AutoPilotControlParameters {
|
||||
public class AutopilotControlParameters {
|
||||
|
||||
public AutoPilotLonLat startLatLon;
|
||||
public List<AutoPilotLonLat> wayLatLons;
|
||||
@@ -43,7 +44,7 @@ public class AutoPilotControlParameters {
|
||||
|
||||
@Override
|
||||
public String toString() {
|
||||
return "RemoteControlAutoPilotParameters{" +
|
||||
return "AutopilotControlParameters{" +
|
||||
"startLatLon=" + startLatLon +
|
||||
", wayLatLons=" + wayLatLons +
|
||||
", endLatLon=" + endLatLon +
|
||||
@@ -0,0 +1,164 @@
|
||||
package com.mogo.eagle.core.data.autopilot;
|
||||
|
||||
import com.google.gson.annotations.SerializedName;
|
||||
import com.mogo.eagle.core.data.autopilot.guardian.AutopilotCpuState;
|
||||
import com.mogo.eagle.core.data.autopilot.guardian.AutopilotDiskState;
|
||||
import com.mogo.eagle.core.data.autopilot.guardian.AutopilotHardwareState;
|
||||
import com.mogo.eagle.core.data.autopilot.guardian.AutopilotMemState;
|
||||
import com.mogo.eagle.core.data.autopilot.guardian.AutopilotNetFlowState;
|
||||
import com.mogo.eagle.core.data.autopilot.guardian.AutopilotNodeState;
|
||||
import com.mogo.eagle.core.data.autopilot.guardian.AutopilotProgramState;
|
||||
import com.mogo.eagle.core.data.autopilot.guardian.AutopilotTopicState;
|
||||
|
||||
import java.io.Serializable;
|
||||
import java.util.List;
|
||||
|
||||
/**
|
||||
* @author xiaoyuzhou
|
||||
* @date 2021/10/18 12:54 下午
|
||||
* 工控机节点状态信息
|
||||
*/
|
||||
public class AutopilotGuardianStatusInfo implements Serializable {
|
||||
@SerializedName("action")
|
||||
private String action;
|
||||
@SerializedName("value")
|
||||
private AutopilotGuardianResult value;
|
||||
|
||||
public static class AutopilotGuardianResult {
|
||||
//车辆类型 WEY-长城 DF-东风 BYD-比亚迪 JINLV-金旅
|
||||
@SerializedName("cartype")
|
||||
private String carType;
|
||||
//车牌号
|
||||
@SerializedName("carnum")
|
||||
private String carNum;
|
||||
//ws连接状态 0-非链接 1-链接
|
||||
@SerializedName("websocket_state")
|
||||
private String wsState;
|
||||
//ai云长链状态 0-非链接 1-链接
|
||||
@SerializedName("aicloud_state")
|
||||
private String aiCloudState;
|
||||
//感知 eagle_hz
|
||||
@SerializedName("eagle_hz")
|
||||
private String eagleHz;
|
||||
//软件节点
|
||||
@SerializedName("nodestate")
|
||||
private List<AutopilotNodeState> nodeState;
|
||||
//topic
|
||||
@SerializedName("topicstate")
|
||||
private List<AutopilotTopicState> topicState;
|
||||
//硬件节点
|
||||
@SerializedName("hardwarestate")
|
||||
private List<AutopilotHardwareState> hardwareState;
|
||||
//CPU
|
||||
@SerializedName("cpustate")
|
||||
private AutopilotCpuState cpuState;
|
||||
//内存
|
||||
@SerializedName("memstate")
|
||||
private AutopilotMemState memState;
|
||||
//硬盘状态
|
||||
@SerializedName("diskstate")
|
||||
private List<AutopilotDiskState> diskState;
|
||||
//占CPU最多的10个程序
|
||||
@SerializedName("programcpustate")
|
||||
private List<AutopilotProgramState> programCpuState;
|
||||
//占内存最多的10个程序
|
||||
@SerializedName("programmemstate")
|
||||
private List<AutopilotProgramState> programMemState;
|
||||
//流量
|
||||
@SerializedName("netflowstate")
|
||||
private List<AutopilotNetFlowState> netFlowState;
|
||||
|
||||
|
||||
public String getCarType() {
|
||||
return carType;
|
||||
}
|
||||
|
||||
public String getCarNum() {
|
||||
return carNum;
|
||||
}
|
||||
|
||||
public String getWsState() {
|
||||
return wsState;
|
||||
}
|
||||
|
||||
public String getAiCloudState() {
|
||||
return aiCloudState;
|
||||
}
|
||||
|
||||
public List<AutopilotNodeState> getNodeState() {
|
||||
return nodeState;
|
||||
}
|
||||
|
||||
public List<AutopilotHardwareState> getHardwareState() {
|
||||
return hardwareState;
|
||||
}
|
||||
|
||||
public AutopilotCpuState getCpuState() {
|
||||
return cpuState;
|
||||
}
|
||||
|
||||
public AutopilotMemState getMemState() {
|
||||
return memState;
|
||||
}
|
||||
|
||||
public List<AutopilotDiskState> getDiskState() {
|
||||
return diskState;
|
||||
}
|
||||
|
||||
public String getEagleHz() {
|
||||
return eagleHz;
|
||||
}
|
||||
|
||||
public List<AutopilotProgramState> getProgramCpuState() {
|
||||
return programCpuState;
|
||||
}
|
||||
|
||||
public List<AutopilotProgramState> getProgramMemState() {
|
||||
return programMemState;
|
||||
}
|
||||
|
||||
public List<AutopilotNetFlowState> getNetFlowState() {
|
||||
return netFlowState;
|
||||
}
|
||||
|
||||
public List<AutopilotTopicState> getTopicState() {
|
||||
return topicState;
|
||||
}
|
||||
|
||||
@Override
|
||||
public String toString() {
|
||||
return "AutopilotGuardianResult{" +
|
||||
"carType='" + carType + '\'' +
|
||||
", carNum='" + carNum + '\'' +
|
||||
", wsState='" + wsState + '\'' +
|
||||
", aiCloudState='" + aiCloudState + '\'' +
|
||||
", eagleHz='" + eagleHz + '\'' +
|
||||
", nodeState=" + nodeState +
|
||||
", topicState=" + topicState +
|
||||
", hardwareState=" + hardwareState +
|
||||
", cpuState=" + cpuState +
|
||||
", memState=" + memState +
|
||||
", diskState=" + diskState +
|
||||
", programCpuState=" + programCpuState +
|
||||
", programMemState=" + programMemState +
|
||||
", netFlowState=" + netFlowState +
|
||||
'}';
|
||||
}
|
||||
}
|
||||
|
||||
public String getAction() {
|
||||
return action;
|
||||
}
|
||||
|
||||
public AutopilotGuardianResult getValue() {
|
||||
return value;
|
||||
}
|
||||
|
||||
@Override
|
||||
public String toString() {
|
||||
return "AutopilotGuardianInfo{" +
|
||||
"action='" + action + '\'' +
|
||||
", value=" + value +
|
||||
'}';
|
||||
}
|
||||
}
|
||||
@@ -1,6 +1,5 @@
|
||||
package com.mogo.module.service.dispatch.bean;
|
||||
package com.mogo.eagle.core.data.autopilot;
|
||||
|
||||
import com.google.gson.annotations.SerializedName;
|
||||
|
||||
import java.util.List;
|
||||
|
||||
@@ -10,17 +9,13 @@ import java.util.List;
|
||||
* @date 2021/6/21
|
||||
*/
|
||||
|
||||
public class AutopilotRoute {
|
||||
public class AutopilotRouteInfo {
|
||||
|
||||
@SerializedName("action")
|
||||
private String action;
|
||||
@SerializedName("models")
|
||||
private List<RouteModels> models;
|
||||
|
||||
public static class RouteModels {
|
||||
@SerializedName("lat")
|
||||
private Double lat;
|
||||
@SerializedName("lon")
|
||||
private Double lon;
|
||||
|
||||
public Double getLat() {
|
||||
@@ -0,0 +1,54 @@
|
||||
package com.mogo.eagle.core.data.autopilot;
|
||||
|
||||
/**
|
||||
* @author congtaowang
|
||||
* @since 2021/1/18
|
||||
* <p>
|
||||
* 自动驾驶网约车回调数据
|
||||
*
|
||||
*/
|
||||
public class AutopilotStationInfo {
|
||||
|
||||
private int type;
|
||||
private double lon;
|
||||
private double lat;
|
||||
|
||||
public AutopilotStationInfo(int type, double lon, double lat) {
|
||||
this.type = type;
|
||||
this.lon = lon;
|
||||
this.lat = lat;
|
||||
}
|
||||
|
||||
public int getType() {
|
||||
return type;
|
||||
}
|
||||
|
||||
public void setType(int type) {
|
||||
this.type = type;
|
||||
}
|
||||
|
||||
public double getLon() {
|
||||
return lon;
|
||||
}
|
||||
|
||||
public void setLon(double lon) {
|
||||
this.lon = lon;
|
||||
}
|
||||
|
||||
public double getLat() {
|
||||
return lat;
|
||||
}
|
||||
|
||||
public void setLat(double lat) {
|
||||
this.lat = lat;
|
||||
}
|
||||
|
||||
@Override
|
||||
public String toString() {
|
||||
return "AutoPilotStationInfo{" +
|
||||
"type=" + type +
|
||||
", lon=" + lon +
|
||||
", lat=" + lat +
|
||||
'}';
|
||||
}
|
||||
}
|
||||
@@ -1,4 +1,4 @@
|
||||
package com.mogo.module.service.dispatch.bean;
|
||||
package com.mogo.eagle.core.data.autopilot;
|
||||
|
||||
import java.io.Serializable;
|
||||
|
||||
@@ -1,12 +1,15 @@
|
||||
package com.mogo.eagle.core.data.autopilot
|
||||
|
||||
import java.io.Serializable
|
||||
|
||||
/**
|
||||
* @author xiaoyuzhou
|
||||
* @date 2021/10/12 8:16 下午
|
||||
* 域控制器状态信息
|
||||
* 不建议自己初始化此对象,建议使用 CallerAutoPilotStatusListenerManager.INSTANCE.getAutoPilotStatusInfo();
|
||||
*
|
||||
*/
|
||||
class AutoPilotStatusInfo {
|
||||
class AutopilotStatusInfo : Serializable {
|
||||
/**
|
||||
* 当前链接的IP地址, 默认地址 192.168.1.102
|
||||
*/
|
||||
@@ -29,17 +32,12 @@ class AutoPilotStatusInfo {
|
||||
/**
|
||||
* 自动驾驶状态 0是不可用 1是ready 2是自动驾驶start
|
||||
*/
|
||||
var autopilotStatus = 0
|
||||
|
||||
/**
|
||||
* 自动驾驶状态 0非自动驾驶,1自动驾驶
|
||||
*/
|
||||
var autoDriveStatus = 0
|
||||
var state = 0
|
||||
|
||||
/**
|
||||
* 不可用原因
|
||||
*/
|
||||
var errorReason: String = ""
|
||||
var reason: String = ""
|
||||
|
||||
/**
|
||||
* 摄像头状态 1代表开启,0代表关闭
|
||||
@@ -55,4 +53,10 @@ class AutoPilotStatusInfo {
|
||||
* RTK状态 1代表开启,0代表关闭
|
||||
*/
|
||||
var rtk = 0
|
||||
|
||||
/**
|
||||
* 自动驾驶状态 0非自动驾驶,1自动驾驶
|
||||
*/
|
||||
var pilotmode = 0
|
||||
|
||||
}
|
||||
@@ -1,13 +1,13 @@
|
||||
package com.mogo.service.adas.entity;
|
||||
package com.mogo.eagle.core.data.autopilot;
|
||||
|
||||
|
||||
public
|
||||
/**
|
||||
* @author congtaowang
|
||||
* @since 2020/10/25
|
||||
*
|
||||
* <p>
|
||||
* 描述
|
||||
*/
|
||||
class ADASWarnMessage {
|
||||
public class AutopilotWarnMessage {
|
||||
|
||||
public String content;
|
||||
public String level;
|
||||
@@ -15,7 +15,7 @@ class ADASWarnMessage {
|
||||
/**
|
||||
* 警告消息类型
|
||||
* <p>
|
||||
* {@link com.mogo.service.adas.MogoADASWarnType}
|
||||
* {@link MogoADASWarnType}
|
||||
*/
|
||||
public int type;
|
||||
public String value;
|
||||
@@ -1,13 +1,13 @@
|
||||
package com.mogo.service.adas;
|
||||
package com.mogo.eagle.core.data.autopilot;
|
||||
|
||||
|
||||
public
|
||||
/**
|
||||
* @author congtaowang
|
||||
* @since 2020/10/25
|
||||
*
|
||||
* <p>
|
||||
* 描述
|
||||
*/
|
||||
interface MogoADASWarnType {
|
||||
public interface MogoADASWarnType {
|
||||
|
||||
/**
|
||||
* 行人报警
|
||||
@@ -0,0 +1,81 @@
|
||||
package com.mogo.eagle.core.data.autopilot.guardian;
|
||||
|
||||
import com.google.gson.annotations.SerializedName;
|
||||
|
||||
/**
|
||||
* @author song kenan
|
||||
* @des CPU状态
|
||||
* @date 2021/8/11
|
||||
*/
|
||||
public class AutopilotCpuState {
|
||||
//cup总使用率
|
||||
@SerializedName("all")
|
||||
private Double all;
|
||||
@SerializedName("cpu1")
|
||||
private Double cpu1;
|
||||
@SerializedName("cpu2")
|
||||
private Double cpu2;
|
||||
@SerializedName("cpu3")
|
||||
private Double cpu3;
|
||||
@SerializedName("cpu4")
|
||||
private Double cpu4;
|
||||
@SerializedName("cpu5")
|
||||
private Double cpu5;
|
||||
@SerializedName("cpu6")
|
||||
private Double cpu6;
|
||||
@SerializedName("cpu7")
|
||||
private Double cpu7;
|
||||
@SerializedName("cpu8")
|
||||
private Double cpu8;
|
||||
|
||||
public Double getAll() {
|
||||
return all;
|
||||
}
|
||||
|
||||
public Double getCpu1() {
|
||||
return cpu1;
|
||||
}
|
||||
|
||||
public Double getCpu2() {
|
||||
return cpu2;
|
||||
}
|
||||
|
||||
public Double getCpu3() {
|
||||
return cpu3;
|
||||
}
|
||||
|
||||
public Double getCpu4() {
|
||||
return cpu4;
|
||||
}
|
||||
|
||||
public Double getCpu5() {
|
||||
return cpu5;
|
||||
}
|
||||
|
||||
public Double getCpu6() {
|
||||
return cpu6;
|
||||
}
|
||||
|
||||
public Double getCpu7() {
|
||||
return cpu7;
|
||||
}
|
||||
|
||||
public Double getCpu8() {
|
||||
return cpu8;
|
||||
}
|
||||
|
||||
@Override
|
||||
public String toString() {
|
||||
return "AutopilotCpuState{" +
|
||||
"all=" + all +
|
||||
", cpu1=" + cpu1 +
|
||||
", cpu2=" + cpu2 +
|
||||
", cpu3=" + cpu3 +
|
||||
", cpu4=" + cpu4 +
|
||||
", cpu5=" + cpu5 +
|
||||
", cpu6=" + cpu6 +
|
||||
", cpu7=" + cpu7 +
|
||||
", cpu8=" + cpu8 +
|
||||
'}';
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,65 @@
|
||||
package com.mogo.eagle.core.data.autopilot.guardian;
|
||||
|
||||
import com.google.gson.annotations.SerializedName;
|
||||
|
||||
/**
|
||||
* @author song kenan
|
||||
* @des 磁盘信息
|
||||
* @date 2021/8/11
|
||||
*/
|
||||
public class AutopilotDiskState {
|
||||
//磁盘总大小
|
||||
@SerializedName("diskall")
|
||||
private String diskall;
|
||||
//磁盘空闲大小
|
||||
@SerializedName("diskfree")
|
||||
private String diskfree;
|
||||
//磁盘挂在目录
|
||||
@SerializedName("diskmount")
|
||||
private String diskmount;
|
||||
//磁盘名称
|
||||
@SerializedName("diskname")
|
||||
private String diskname;
|
||||
//磁盘使用百分比
|
||||
@SerializedName("diskpercent")
|
||||
private String diskpercent;
|
||||
//磁盘已使用大小
|
||||
@SerializedName("diskuse")
|
||||
private String diskuse;
|
||||
|
||||
public String getDiskall() {
|
||||
return diskall;
|
||||
}
|
||||
|
||||
public String getDiskfree() {
|
||||
return diskfree;
|
||||
}
|
||||
|
||||
public String getDiskmount() {
|
||||
return diskmount;
|
||||
}
|
||||
|
||||
public String getDiskname() {
|
||||
return diskname;
|
||||
}
|
||||
|
||||
public String getDiskpercent() {
|
||||
return diskpercent;
|
||||
}
|
||||
|
||||
public String getDiskuse() {
|
||||
return diskuse;
|
||||
}
|
||||
|
||||
@Override
|
||||
public String toString() {
|
||||
return "AutopilotDiskState{" +
|
||||
"diskall='" + diskall + '\'' +
|
||||
", diskfree='" + diskfree + '\'' +
|
||||
", diskmount='" + diskmount + '\'' +
|
||||
", diskname='" + diskname + '\'' +
|
||||
", diskpercent='" + diskpercent + '\'' +
|
||||
", diskuse='" + diskuse + '\'' +
|
||||
'}';
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,41 @@
|
||||
package com.mogo.eagle.core.data.autopilot.guardian;
|
||||
|
||||
import com.google.gson.annotations.SerializedName;
|
||||
|
||||
/**
|
||||
* @author song kenan
|
||||
* @des 硬件状态
|
||||
* @date 2021/7/26
|
||||
*/
|
||||
public class AutopilotHardwareState {
|
||||
/**
|
||||
* 0不正常
|
||||
*/
|
||||
@SerializedName("run_hz")
|
||||
private String runHz;
|
||||
@SerializedName("set_hz")
|
||||
private String setHz;
|
||||
@SerializedName("topic_name")
|
||||
private String topicName;
|
||||
|
||||
public String getRunHz() {
|
||||
return runHz;
|
||||
}
|
||||
|
||||
public String getSetHz() {
|
||||
return setHz;
|
||||
}
|
||||
|
||||
public String getTopicName() {
|
||||
return topicName;
|
||||
}
|
||||
|
||||
@Override
|
||||
public String toString() {
|
||||
return "AutopilotHardwareState{" +
|
||||
"runHz='" + runHz + '\'' +
|
||||
", setHz='" + setHz + '\'' +
|
||||
", topicName='" + topicName + '\'' +
|
||||
'}';
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,49 @@
|
||||
package com.mogo.eagle.core.data.autopilot.guardian;
|
||||
|
||||
import com.google.gson.annotations.SerializedName;
|
||||
|
||||
/**
|
||||
* @author song kenan
|
||||
* @des 内存状态
|
||||
* @date 2021/8/11
|
||||
*/
|
||||
public class AutopilotMemState {
|
||||
//空闲内存(M)
|
||||
@SerializedName("free")
|
||||
private String free;
|
||||
//内存使用百分比
|
||||
@SerializedName("percent_mem")
|
||||
private String percentMem;
|
||||
//总内存(M)
|
||||
@SerializedName("total_mem")
|
||||
private String totalMem;
|
||||
//使用的内存(M)
|
||||
@SerializedName("used_mem")
|
||||
private String usedMem;
|
||||
|
||||
public String getFree() {
|
||||
return free;
|
||||
}
|
||||
|
||||
public String getPercentMem() {
|
||||
return percentMem;
|
||||
}
|
||||
|
||||
public String getTotalMem() {
|
||||
return totalMem;
|
||||
}
|
||||
|
||||
public String getUsedMem() {
|
||||
return usedMem;
|
||||
}
|
||||
|
||||
@Override
|
||||
public String toString() {
|
||||
return "AutopilotMemState{" +
|
||||
"free='" + free + '\'' +
|
||||
", percentMem='" + percentMem + '\'' +
|
||||
", totalMem='" + totalMem + '\'' +
|
||||
", usedMem='" + usedMem + '\'' +
|
||||
'}';
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,38 @@
|
||||
package com.mogo.eagle.core.data.autopilot.guardian;
|
||||
|
||||
import com.google.gson.annotations.SerializedName;
|
||||
|
||||
/**
|
||||
* @author song kenan
|
||||
* @des 占用内存的程序
|
||||
* @date 2021/8/16
|
||||
*/
|
||||
public class AutopilotNetFlowState {
|
||||
@SerializedName("netname")
|
||||
private String netName;
|
||||
@SerializedName("recv_flow")
|
||||
private String recvFlow;
|
||||
@SerializedName("send_flow")
|
||||
private String sendFlow;
|
||||
|
||||
public String getNetName() {
|
||||
return netName;
|
||||
}
|
||||
|
||||
public String getRecvFlow() {
|
||||
return recvFlow;
|
||||
}
|
||||
|
||||
public String getSendFlow() {
|
||||
return sendFlow;
|
||||
}
|
||||
|
||||
@Override
|
||||
public String toString() {
|
||||
return "AutopilotNetFlowState{" +
|
||||
"netName='" + netName + '\'' +
|
||||
", recvFlow='" + recvFlow + '\'' +
|
||||
", sendFlow='" + sendFlow + '\'' +
|
||||
'}';
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,34 @@
|
||||
package com.mogo.eagle.core.data.autopilot.guardian;
|
||||
|
||||
import com.google.gson.annotations.SerializedName;
|
||||
|
||||
/**
|
||||
* @author song kenan
|
||||
* @des 工控机节点状态
|
||||
* @date 2021/7/7
|
||||
*/
|
||||
public class AutopilotNodeState {
|
||||
/**
|
||||
* -on-开启, off-关闭
|
||||
*/
|
||||
@SerializedName("node_name")
|
||||
private String nodeName;
|
||||
@SerializedName("node_state")
|
||||
private String nodeState;
|
||||
|
||||
public String getNodeName() {
|
||||
return nodeName;
|
||||
}
|
||||
|
||||
public String getNodeState() {
|
||||
return nodeState;
|
||||
}
|
||||
|
||||
@Override
|
||||
public String toString() {
|
||||
return "AutopilotNodeState{" +
|
||||
"nodeName='" + nodeName + '\'' +
|
||||
", nodeState='" + nodeState + '\'' +
|
||||
'}';
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,41 @@
|
||||
package com.mogo.eagle.core.data.autopilot.guardian;
|
||||
|
||||
import com.google.gson.annotations.SerializedName;
|
||||
|
||||
/**
|
||||
* @author song kenan
|
||||
* @des 占用内存的程序
|
||||
* @date 2021/8/16
|
||||
*/
|
||||
public class AutopilotProgramState {
|
||||
//cpu
|
||||
@SerializedName("cpu_percent")
|
||||
private String cpuPercent;
|
||||
//内存
|
||||
@SerializedName("mem_percent")
|
||||
private String memPercent;
|
||||
//name
|
||||
@SerializedName("prog_name")
|
||||
private String progName;
|
||||
|
||||
public String getCpuPercent() {
|
||||
return cpuPercent;
|
||||
}
|
||||
|
||||
public String getMemPercent() {
|
||||
return memPercent;
|
||||
}
|
||||
|
||||
public String getProgName() {
|
||||
return progName;
|
||||
}
|
||||
|
||||
@Override
|
||||
public String toString() {
|
||||
return "AutopilotProgramState{" +
|
||||
"cpuPercent='" + cpuPercent + '\'' +
|
||||
", memPercent='" + memPercent + '\'' +
|
||||
", progName='" + progName + '\'' +
|
||||
'}';
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,39 @@
|
||||
package com.mogo.eagle.core.data.autopilot.guardian;
|
||||
|
||||
import com.google.gson.annotations.SerializedName;
|
||||
|
||||
/**
|
||||
* @author song kenan
|
||||
* @des topic info
|
||||
* @date 2021/8/16
|
||||
*/
|
||||
public class AutopilotTopicState {
|
||||
|
||||
@SerializedName("run_hz")
|
||||
private String runHz;
|
||||
@SerializedName("set_hz")
|
||||
private String setHz;
|
||||
@SerializedName("topic_name")
|
||||
private String topicName;
|
||||
|
||||
public String getRunHz() {
|
||||
return runHz;
|
||||
}
|
||||
|
||||
public String getSetHz() {
|
||||
return setHz;
|
||||
}
|
||||
|
||||
public String getTopicName() {
|
||||
return topicName;
|
||||
}
|
||||
|
||||
@Override
|
||||
public String toString() {
|
||||
return "AutopilotTopicState{" +
|
||||
"runHz='" + runHz + '\'' +
|
||||
", setHz='" + setHz + '\'' +
|
||||
", topicName='" + topicName + '\'' +
|
||||
'}';
|
||||
}
|
||||
}
|
||||
@@ -74,6 +74,25 @@ enum class TrafficTypeEnum(
|
||||
"道路施工",
|
||||
R.raw.v2x_shigong_warning,
|
||||
R.raw.v2x_shigong_warning
|
||||
)
|
||||
);
|
||||
|
||||
companion object {
|
||||
@JvmStatic
|
||||
fun getType(type: Int): TrafficTypeEnum {
|
||||
return when (type) {
|
||||
TYPE_TRAFFIC_ID_WEI_ZHI.type -> TYPE_TRAFFIC_ID_WEI_ZHI
|
||||
TYPE_TRAFFIC_ID_PEOPLE.type -> TYPE_TRAFFIC_ID_PEOPLE
|
||||
TYPE_TRAFFIC_ID_BICYCLE.type -> TYPE_TRAFFIC_ID_BICYCLE
|
||||
TYPE_TRAFFIC_ID_TA_CHE.type -> TYPE_TRAFFIC_ID_TA_CHE
|
||||
TYPE_TRAFFIC_ID_MOTO.type -> TYPE_TRAFFIC_ID_MOTO
|
||||
TYPE_TRAFFIC_ID_BUS.type -> TYPE_TRAFFIC_ID_BUS
|
||||
TYPE_TRAFFIC_ID_TRUCK.type -> TYPE_TRAFFIC_ID_TRUCK
|
||||
TYPE_TRAFFIC_ID_CAMERA.type -> TYPE_TRAFFIC_ID_CAMERA
|
||||
TYPE_TRAFFIC_ID_SPECIAL_VEHICLE.type -> TYPE_TRAFFIC_ID_SPECIAL_VEHICLE
|
||||
TYPE_TRAFFIC_ID_DAO_LU_SHI_GONG.type -> TYPE_TRAFFIC_ID_DAO_LU_SHI_GONG
|
||||
else -> TYPE_TRAFFIC_ID_WEI_ZHI
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
}
|
||||
@@ -18,6 +18,16 @@ class TrafficData {
|
||||
*/
|
||||
var uuid: String = ""
|
||||
|
||||
/**
|
||||
* 车牌id
|
||||
*/
|
||||
var carId: String = ""
|
||||
|
||||
/**
|
||||
* 数据来源精度 0 - 普通定位、1 - 高精定位
|
||||
*/
|
||||
var dataAccuracy = 1
|
||||
|
||||
/**
|
||||
* 识别物体的纬度
|
||||
*/
|
||||
|
||||
@@ -1,22 +0,0 @@
|
||||
package com.mogo.eagle.core.function.api.autopilot;
|
||||
|
||||
import com.mogo.eagle.core.data.traffic.TrafficData;
|
||||
|
||||
import java.util.List;
|
||||
|
||||
/**
|
||||
* @author xiaoyuzhou
|
||||
* @date 2021/9/23 11:23 上午
|
||||
* 自动驾驶识别数据监听,回调后做数据可视化呈现
|
||||
*/
|
||||
public interface IMoGoAutoPilotIdentifyListener {
|
||||
|
||||
/**
|
||||
* 识别交通元素数据发生更新
|
||||
*
|
||||
* @param trafficData 交通元素信息列表
|
||||
*/
|
||||
void onIdentifyDataUpdate(List<TrafficData> trafficData);
|
||||
|
||||
|
||||
}
|
||||
@@ -1,48 +0,0 @@
|
||||
package com.mogo.eagle.core.function.api.autopilot;
|
||||
|
||||
import com.mogo.eagle.core.data.autopilot.AutoPilotStationInfo;
|
||||
import com.mogo.eagle.core.data.autopilot.AutoPilotStatusInfo;
|
||||
|
||||
/**
|
||||
* @author xiaoyuzhou
|
||||
* @date 2021/9/22 8:59 下午
|
||||
* 自动驾驶状态回调监听
|
||||
*/
|
||||
public interface IMoGoAutoPilotStatusListener {
|
||||
|
||||
/**
|
||||
* 不可自动驾驶,目前场景是刚开机,adas还未和工控机连接
|
||||
*/
|
||||
int STATUS_AUTOPILOT_DISABLE = 0;
|
||||
/**
|
||||
* 可自动驾驶,工控机连接正常,且处于人工干预状态
|
||||
*/
|
||||
int STATUS_AUTOPILOT_ENABLE = 1;
|
||||
/**
|
||||
* 自动驾驶中,可能是停车,可能是行进,但是是机器在处理车的前进后退,不是人
|
||||
*/
|
||||
int STATUS_AUTOPILOT_RUNNING = 2;
|
||||
|
||||
|
||||
/**
|
||||
* 自动驾驶到站
|
||||
*
|
||||
* @param data 所到车站的简单信息
|
||||
*/
|
||||
void onAutoPilotArriveAtStation(AutoPilotStationInfo data);
|
||||
|
||||
/**
|
||||
* 自动驾驶状态发生改变
|
||||
*
|
||||
* @param state {@link #STATUS_AUTOPILOT_DISABLE}
|
||||
* @param reason 不能自动驾驶的原因
|
||||
*/
|
||||
void onAutoPilotStateChanged(int state, String reason);
|
||||
|
||||
/**
|
||||
* 自动驾驶状态信息
|
||||
*
|
||||
* @param autoPilotStatusInfo 状态信息
|
||||
*/
|
||||
void onAutoPilotStatusResponse(AutoPilotStatusInfo autoPilotStatusInfo);
|
||||
}
|
||||
@@ -1,14 +1,15 @@
|
||||
package com.mogo.eagle.core.function.api.autopilot;
|
||||
|
||||
import com.mogo.eagle.core.data.autopilot.AutoPilotControlParameters;
|
||||
import com.mogo.eagle.core.data.autopilot.AutopilotControlParameters;
|
||||
import com.mogo.eagle.core.function.api.base.IMoGoFunctionServerProvider;
|
||||
|
||||
/**
|
||||
* @author xiaoyuzhou
|
||||
* @date 2021/9/22 8:27 下午
|
||||
* 自动驾驶节点
|
||||
*
|
||||
*/
|
||||
public interface IMoGoAutoPilotProvider extends IMoGoFunctionServerProvider {
|
||||
public interface IMoGoAutopilotProvider extends IMoGoFunctionServerProvider {
|
||||
|
||||
/**
|
||||
* 连接自动驾驶域控制器
|
||||
@@ -20,7 +21,7 @@ public interface IMoGoAutoPilotProvider extends IMoGoFunctionServerProvider {
|
||||
*
|
||||
* @param result
|
||||
*/
|
||||
void startAutoPilot(AutoPilotControlParameters result);
|
||||
void startAutoPilot(AutopilotControlParameters result);
|
||||
|
||||
/**
|
||||
* 结束自动驾驶
|
||||
@@ -0,0 +1,83 @@
|
||||
package com.mogo.eagle.core.function.api.autopilot
|
||||
|
||||
import com.mogo.eagle.core.data.autopilot.*
|
||||
import com.mogo.eagle.core.data.traffic.TrafficData
|
||||
|
||||
/**
|
||||
* @author xiaoyuzhou
|
||||
* @date 2021/9/22 8:59 下午
|
||||
* 自动驾驶状态回调监听
|
||||
*/
|
||||
interface IMoGoAutopilotStatusListener {
|
||||
|
||||
/**
|
||||
* 自动驾驶状态信息
|
||||
*
|
||||
* @param autoPilotStatusInfo 状态信息
|
||||
*/
|
||||
fun onAutopilotStatusResponse(autoPilotStatusInfo: AutopilotStatusInfo)
|
||||
|
||||
/**
|
||||
* 自动驾驶到站
|
||||
*
|
||||
* @param autopilotWayArrive 所到车站的简单信息
|
||||
*/
|
||||
fun onAutopilotArriveAtStation(autopilotWayArrive: AutopilotStationInfo?)
|
||||
|
||||
|
||||
/**
|
||||
* 车辆状态数据
|
||||
*
|
||||
* @param autoPilotCarStateInfo
|
||||
*/
|
||||
fun onAutopilotCarStateData(autoPilotCarStateInfo: AutopilotCarStateInfo?)
|
||||
|
||||
/**
|
||||
* 自动驾驶路径
|
||||
*
|
||||
* @param autopilotRoute
|
||||
*/
|
||||
fun onAutopilotRoute(autopilotRoute: AutopilotRouteInfo?)
|
||||
|
||||
/**
|
||||
* 工控机获取SN
|
||||
*/
|
||||
fun onAutopilotSNRequest()
|
||||
|
||||
/**
|
||||
* 工控机监控节点
|
||||
*/
|
||||
fun onAutopilotGuardian(guardianInfo: AutopilotGuardianStatusInfo?)
|
||||
|
||||
/**
|
||||
* 识别交通元素数据发生更新
|
||||
*
|
||||
* @param trafficData 交通元素信息列表
|
||||
*/
|
||||
fun onAutopilotIdentifyDataUpdate(trafficData: List<TrafficData>?)
|
||||
|
||||
/**
|
||||
* 报警信息
|
||||
*
|
||||
* @param autopilotWarnMessage 预警信息
|
||||
*/
|
||||
fun onAutopilotWarnMessage(autopilotWarnMessage: AutopilotWarnMessage?)
|
||||
|
||||
|
||||
companion object {
|
||||
/**
|
||||
* 不可自动驾驶,目前场景是刚开机,adas还未和工控机连接
|
||||
*/
|
||||
const val STATUS_AUTOPILOT_DISABLE = 0
|
||||
|
||||
/**
|
||||
* 可自动驾驶,工控机连接正常,且处于人工干预状态
|
||||
*/
|
||||
const val STATUS_AUTOPILOT_ENABLE = 1
|
||||
|
||||
/**
|
||||
* 自动驾驶中,可能是停车,可能是行进,但是是机器在处理车的前进后退,不是人
|
||||
*/
|
||||
const val STATUS_AUTOPILOT_RUNNING = 2
|
||||
}
|
||||
}
|
||||
@@ -1,7 +1,7 @@
|
||||
package com.mogo.eagle.core.function.call.autopilot
|
||||
|
||||
import com.mogo.eagle.core.data.constants.MogoServicePaths
|
||||
import com.mogo.eagle.core.function.api.autopilot.IMoGoAutoPilotProvider
|
||||
import com.mogo.eagle.core.function.api.autopilot.IMoGoAutopilotProvider
|
||||
import com.mogo.eagle.core.function.call.base.CallerBase
|
||||
|
||||
/**
|
||||
@@ -10,9 +10,9 @@ import com.mogo.eagle.core.function.call.base.CallerBase
|
||||
* 域控制器管理
|
||||
*/
|
||||
object CallerAutoPilotManager {
|
||||
private val providerApi: IMoGoAutoPilotProvider
|
||||
private val providerApi: IMoGoAutopilotProvider
|
||||
get() = CallerBase.getApiInstance(
|
||||
IMoGoAutoPilotProvider::class.java,
|
||||
IMoGoAutopilotProvider::class.java,
|
||||
MogoServicePaths.PATH_AUTO_PILOT
|
||||
)
|
||||
|
||||
|
||||
@@ -1,9 +1,9 @@
|
||||
package com.mogo.eagle.core.function.call.autopilot
|
||||
|
||||
import androidx.annotation.Nullable
|
||||
import com.mogo.eagle.core.data.autopilot.AutoPilotStationInfo
|
||||
import com.mogo.eagle.core.data.autopilot.AutoPilotStatusInfo
|
||||
import com.mogo.eagle.core.function.api.autopilot.IMoGoAutoPilotStatusListener
|
||||
import com.mogo.eagle.core.data.autopilot.*
|
||||
import com.mogo.eagle.core.data.traffic.TrafficData
|
||||
import com.mogo.eagle.core.function.api.autopilot.IMoGoAutopilotStatusListener
|
||||
import com.mogo.eagle.core.function.api.obu.IMoGoObuStatusListener
|
||||
import com.mogo.eagle.core.function.call.base.CallerBase
|
||||
import com.mogo.eagle.core.utilcode.util.GsonUtils
|
||||
@@ -15,26 +15,27 @@ import com.mogo.eagle.core.utilcode.util.LogUtils
|
||||
* 域控制器相关的回调监听
|
||||
*/
|
||||
object CallerAutoPilotStatusListenerManager : CallerBase() {
|
||||
private val TAG = "CallerAutopilotListenerManager"
|
||||
private val TAG = "CallerAutoPilotStatusListenerManager"
|
||||
|
||||
// 存储最后一次回调的数据,当有新当位置注册了监听将此数据回调过去,防止有些模块注册顺序问题导致无法获取最新状态
|
||||
private var mAutoPilotStatusInfo: AutoPilotStatusInfo = AutoPilotStatusInfo()
|
||||
private var mAutopilotStatusInfo: AutopilotStatusInfo = AutopilotStatusInfo()
|
||||
|
||||
// 存储所有注册了监听的对象,invokeXXXX进行遍历回调,将信息同步
|
||||
private val mAutoPilotStatusListeners: HashMap<String, IMoGoAutoPilotStatusListener> = HashMap()
|
||||
private val M_AUTOPILOT_STATUS_LISTENERS: HashMap<String, IMoGoAutopilotStatusListener> =
|
||||
HashMap()
|
||||
|
||||
/**
|
||||
* 查询AutoPilot状态
|
||||
*/
|
||||
fun getAutoPilotStatusInfo(): AutoPilotStatusInfo {
|
||||
return mAutoPilotStatusInfo
|
||||
fun getAutoPilotStatusInfo(): AutopilotStatusInfo {
|
||||
return mAutopilotStatusInfo
|
||||
}
|
||||
|
||||
/**
|
||||
* 查询AutoPilot状态
|
||||
*/
|
||||
fun getAutoPilotStatusInfoJsonString(): String {
|
||||
return GsonUtils.toJson(mAutoPilotStatusInfo)
|
||||
return GsonUtils.toJson(mAutopilotStatusInfo)
|
||||
}
|
||||
|
||||
/**
|
||||
@@ -44,10 +45,10 @@ object CallerAutoPilotStatusListenerManager : CallerBase() {
|
||||
*/
|
||||
fun addListener(
|
||||
@Nullable tag: String,
|
||||
@Nullable listener: IMoGoAutoPilotStatusListener
|
||||
@Nullable listener: IMoGoAutopilotStatusListener
|
||||
) {
|
||||
mAutoPilotStatusListeners[tag] = listener
|
||||
listener.onAutoPilotStatusResponse(mAutoPilotStatusInfo)
|
||||
M_AUTOPILOT_STATUS_LISTENERS[tag] = listener
|
||||
listener.onAutopilotStatusResponse(mAutopilotStatusInfo)
|
||||
}
|
||||
|
||||
/**
|
||||
@@ -55,7 +56,7 @@ object CallerAutoPilotStatusListenerManager : CallerBase() {
|
||||
* @param tag 标记,用来注销监听使用
|
||||
*/
|
||||
fun removeListener(@Nullable tag: String) {
|
||||
mAutoPilotStatusListeners.remove(tag)
|
||||
M_AUTOPILOT_STATUS_LISTENERS.remove(tag)
|
||||
}
|
||||
|
||||
/**
|
||||
@@ -63,9 +64,9 @@ object CallerAutoPilotStatusListenerManager : CallerBase() {
|
||||
* @param listener 要删除的监听对象
|
||||
*/
|
||||
fun removeListener(@Nullable listener: IMoGoObuStatusListener) {
|
||||
mAutoPilotStatusListeners.forEach {
|
||||
M_AUTOPILOT_STATUS_LISTENERS.forEach {
|
||||
if (it.value == listener) {
|
||||
mAutoPilotStatusListeners.remove(it.key)
|
||||
M_AUTOPILOT_STATUS_LISTENERS.remove(it.key)
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -74,53 +75,125 @@ object CallerAutoPilotStatusListenerManager : CallerBase() {
|
||||
* 自动驾驶状态信息回调
|
||||
*/
|
||||
@Synchronized
|
||||
fun invokeAutoPilotStatusListener() {
|
||||
LogUtils.dTag(TAG, "$mAutoPilotStatusInfo")
|
||||
invokeAutoPilotStatusListener(mAutoPilotStatusInfo)
|
||||
fun invokeAutoPilotStatus() {
|
||||
LogUtils.dTag(TAG, "$mAutopilotStatusInfo")
|
||||
invokeAutoPilotStatus(mAutopilotStatusInfo)
|
||||
}
|
||||
|
||||
/**
|
||||
* 自动驾驶状态信息回调
|
||||
* @param autoPilotStatusInfo 自动驾驶状态信息
|
||||
* 自动驾驶状态信息 回调
|
||||
* @param autopilotStatusInfo 自动驾驶状态信息
|
||||
*/
|
||||
@Synchronized
|
||||
fun invokeAutoPilotStatusListener(autoPilotStatusInfo: AutoPilotStatusInfo) {
|
||||
LogUtils.dTag(TAG, "$autoPilotStatusInfo")
|
||||
mAutoPilotStatusInfo = autoPilotStatusInfo
|
||||
mAutoPilotStatusListeners.forEach {
|
||||
fun invokeAutoPilotStatus(autopilotStatusInfo: AutopilotStatusInfo) {
|
||||
LogUtils.dTag(TAG, "$autopilotStatusInfo")
|
||||
mAutopilotStatusInfo = autopilotStatusInfo
|
||||
M_AUTOPILOT_STATUS_LISTENERS.forEach {
|
||||
val tag = it.key
|
||||
val listener = it.value
|
||||
LogUtils.dTag(TAG, "tag:$tag listener:$listener")
|
||||
listener.onAutoPilotStatusResponse(mAutoPilotStatusInfo)
|
||||
listener.onAutopilotStatusResponse(mAutopilotStatusInfo)
|
||||
}
|
||||
}
|
||||
|
||||
/**
|
||||
* 自动驾驶网约车回调数据 回调
|
||||
* @param autoPilotStationInfo 自动驾驶网约车回调数据
|
||||
* 自动驾驶站点信息 回调
|
||||
* @param autopilotStationInfo 自动驾驶网约车回调数据
|
||||
*/
|
||||
fun invokeArriveAtStationListener(autoPilotStationInfo: AutoPilotStationInfo) {
|
||||
LogUtils.dTag(TAG, "$autoPilotStationInfo")
|
||||
mAutoPilotStatusListeners.forEach {
|
||||
@Synchronized
|
||||
fun invokeArriveAtStation(autopilotStationInfo: AutopilotStationInfo) {
|
||||
LogUtils.dTag(TAG, "$autopilotStationInfo")
|
||||
M_AUTOPILOT_STATUS_LISTENERS.forEach {
|
||||
val tag = it.key
|
||||
val listener = it.value
|
||||
LogUtils.dTag(TAG, "tag:$tag listener:$listener")
|
||||
listener.onAutoPilotArriveAtStation(autoPilotStationInfo)
|
||||
listener.onAutopilotArriveAtStation(autopilotStationInfo)
|
||||
}
|
||||
}
|
||||
|
||||
/**
|
||||
* 自动驾驶状态回调
|
||||
* @param state
|
||||
* @param reason
|
||||
* 车辆状态数据 回调
|
||||
* @param autoPilotCarStateInfo
|
||||
*/
|
||||
fun invokeStateChangedListener(state: Int, reason: String) {
|
||||
LogUtils.dTag(TAG, "$state $reason")
|
||||
mAutoPilotStatusListeners.forEach {
|
||||
@Synchronized
|
||||
fun invokeAutopilotCarStateData(autoPilotCarStateInfo: AutopilotCarStateInfo?) {
|
||||
LogUtils.dTag(TAG, "$autoPilotCarStateInfo")
|
||||
M_AUTOPILOT_STATUS_LISTENERS.forEach {
|
||||
val tag = it.key
|
||||
val listener = it.value
|
||||
LogUtils.dTag(TAG, "tag:$tag listener:$listener")
|
||||
listener.onAutoPilotStateChanged(state, reason)
|
||||
listener.onAutopilotCarStateData(autoPilotCarStateInfo)
|
||||
}
|
||||
}
|
||||
|
||||
/**
|
||||
* 自动驾驶路径 回调
|
||||
* @param routeInfo
|
||||
*/
|
||||
@Synchronized
|
||||
fun invokeAutopilotRoute(routeInfo: AutopilotRouteInfo?) {
|
||||
LogUtils.dTag(TAG, "$routeInfo")
|
||||
M_AUTOPILOT_STATUS_LISTENERS.forEach {
|
||||
val tag = it.key
|
||||
val listener = it.value
|
||||
LogUtils.dTag(TAG, "tag:$tag listener:$listener")
|
||||
listener.onAutopilotRoute(routeInfo)
|
||||
}
|
||||
}
|
||||
|
||||
/**
|
||||
* 工控机获取SN 回调
|
||||
*/
|
||||
@Synchronized
|
||||
fun invokeAutopilotSNRequest() {
|
||||
LogUtils.dTag(TAG, "")
|
||||
M_AUTOPILOT_STATUS_LISTENERS.forEach {
|
||||
val tag = it.key
|
||||
val listener = it.value
|
||||
LogUtils.dTag(TAG, "tag:$tag listener:$listener")
|
||||
listener.onAutopilotSNRequest()
|
||||
}
|
||||
}
|
||||
|
||||
/**
|
||||
* 工控机监控节点 回调
|
||||
*/
|
||||
@Synchronized
|
||||
fun invokeAutopilotGuardian(guardianInfo: AutopilotGuardianStatusInfo?) {
|
||||
LogUtils.dTag(TAG, "$guardianInfo")
|
||||
M_AUTOPILOT_STATUS_LISTENERS.forEach {
|
||||
val tag = it.key
|
||||
val listener = it.value
|
||||
LogUtils.dTag(TAG, "tag:$tag listener:$listener")
|
||||
listener.onAutopilotGuardian(guardianInfo)
|
||||
}
|
||||
}
|
||||
|
||||
/**
|
||||
* 识别交通元素数据发生更新 回调
|
||||
*/
|
||||
@Synchronized
|
||||
fun invokeAutopilotIdentifyDataUpdate(trafficData: List<TrafficData>?) {
|
||||
LogUtils.dTag(TAG, "$trafficData")
|
||||
M_AUTOPILOT_STATUS_LISTENERS.forEach {
|
||||
val tag = it.key
|
||||
val listener = it.value
|
||||
LogUtils.dTag(TAG, "tag:$tag listener:$listener")
|
||||
listener.onAutopilotIdentifyDataUpdate(trafficData)
|
||||
}
|
||||
}
|
||||
|
||||
/**
|
||||
* 报警信息 回调
|
||||
*/
|
||||
@Synchronized
|
||||
fun invokeAutopilotWarnMessage(autopilotWarnMessage: AutopilotWarnMessage?) {
|
||||
LogUtils.dTag(TAG, "$autopilotWarnMessage")
|
||||
M_AUTOPILOT_STATUS_LISTENERS.forEach {
|
||||
val tag = it.key
|
||||
val listener = it.value
|
||||
LogUtils.dTag(TAG, "tag:$tag listener:$listener")
|
||||
listener.onAutopilotWarnMessage(autopilotWarnMessage)
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
@@ -182,11 +182,11 @@ MOGO_TRAFFICLIVE_VERSION=1.1.46
|
||||
# 定位服务
|
||||
MOGO_LOCATION_VERSION=1.1.46
|
||||
# 自研地图
|
||||
MAP_SDK_VERSION=1.0.1-vr-1.1.3
|
||||
MAP_SDK_VERSION=1.0.1-vr-1.1.5
|
||||
#################架构升级新的版本号
|
||||
MOGO_CORE_FUNCTION_HMI_VERSION=1.0.0
|
||||
## 产品库必备配置,产品库自动对versionCode和versionName版本进行升级
|
||||
applicationId=com.mogo.launcer
|
||||
applicationName=IntelligentPilot
|
||||
versionCode=80007
|
||||
versionName=8.0.12
|
||||
versionName=8.0.13
|
||||
@@ -349,28 +349,28 @@ public class AMapViewWrapper implements IMogoMapView,
|
||||
Logger.d(TAG, "设置的样式 = %s", ui);
|
||||
if (checkAMapView()) {
|
||||
switch (ui) {
|
||||
case CarUp_2D:
|
||||
case CarUp_3D:
|
||||
case NorthUP_2D:
|
||||
setUIMode(ui);
|
||||
break;
|
||||
// case CarUp_2D:
|
||||
// case CarUp_3D:
|
||||
// case NorthUP_2D:
|
||||
// setUIMode(ui);
|
||||
// break;
|
||||
case Type_VR:
|
||||
mMapView.getMapAutoViewHelper().setScaleVRMode(true);
|
||||
mMapView.getMapAutoViewHelper().setMapStyle(MapAutoApi.MAP_STYLE_VR);
|
||||
return;
|
||||
case Type_Light:
|
||||
mMapView.getMapAutoViewHelper().setAutoSwitchStyle(false);
|
||||
mMapView.getMapAutoViewHelper().setMapStyle(MapAutoApi.MAP_STYLE_DAY);
|
||||
mIsLightStyle = true;
|
||||
break;
|
||||
case Type_Night:
|
||||
mMapView.getMapAutoViewHelper().setAutoSwitchStyle(false);
|
||||
mMapView.getMapAutoViewHelper().setMapStyle(MapAutoApi.MAP_STYLE_NIGHT);
|
||||
mIsLightStyle = false;
|
||||
break;
|
||||
case Type_AUTO_LIGHT_Night:
|
||||
mMapView.getMapAutoViewHelper().setAutoSwitchStyle(true);
|
||||
break;
|
||||
// case Type_Light:
|
||||
// mMapView.getMapAutoViewHelper().setAutoSwitchStyle(false);
|
||||
// mMapView.getMapAutoViewHelper().setMapStyle(MapAutoApi.MAP_STYLE_DAY);
|
||||
// mIsLightStyle = true;
|
||||
// break;
|
||||
// case Type_Night:
|
||||
// mMapView.getMapAutoViewHelper().setAutoSwitchStyle(false);
|
||||
// mMapView.getMapAutoViewHelper().setMapStyle(MapAutoApi.MAP_STYLE_NIGHT);
|
||||
// mIsLightStyle = false;
|
||||
// break;
|
||||
// case Type_AUTO_LIGHT_Night:
|
||||
// mMapView.getMapAutoViewHelper().setAutoSwitchStyle(true);
|
||||
// break;
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
@@ -1,6 +1,10 @@
|
||||
apply plugin: 'com.android.library'
|
||||
apply plugin: 'com.alibaba.arouter'
|
||||
|
||||
plugins {
|
||||
id 'com.android.library'
|
||||
id 'kotlin-android'
|
||||
id 'kotlin-android-extensions'
|
||||
id 'kotlin-kapt'
|
||||
id 'com.alibaba.arouter'
|
||||
}
|
||||
android {
|
||||
compileSdkVersion rootProject.ext.android.compileSdkVersion
|
||||
// buildToolsVersion rootProject.ext.android.buildToolsVersion
|
||||
@@ -10,14 +14,15 @@ android {
|
||||
versionCode Integer.valueOf(VERSION_CODE)
|
||||
versionName getValueFromRootProperties("${project.name.replace("-", "_").toUpperCase()}_VERSION")
|
||||
|
||||
javaCompileOptions {
|
||||
annotationProcessorOptions {
|
||||
arguments = [AROUTER_MODULE_NAME: project.getName()]
|
||||
}
|
||||
}
|
||||
|
||||
testInstrumentationRunner "androidx.test.runner.AndroidJUnitRunner"
|
||||
consumerProguardFiles 'consumer-rules.pro'
|
||||
//ARouter apt 参数
|
||||
kapt {
|
||||
useBuildCache = false
|
||||
arguments {
|
||||
arg("AROUTER_MODULE_NAME", project.getName())
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
buildTypes {
|
||||
@@ -37,10 +42,10 @@ dependencies {
|
||||
|
||||
implementation rootProject.ext.dependencies.androidxappcompat
|
||||
implementation rootProject.ext.dependencies.androidxconstraintlayout
|
||||
implementation rootProject.ext.dependencies.arouter
|
||||
implementation rootProject.ext.dependencies.rxandroid
|
||||
|
||||
annotationProcessor rootProject.ext.dependencies.aroutercompiler
|
||||
implementation rootProject.ext.dependencies.arouter
|
||||
kapt rootProject.ext.dependencies.aroutercompiler
|
||||
|
||||
// 现有的ADAS的通讯SDK,需要将里面的东西融合到我们项目中
|
||||
compileOnly rootProject.ext.dependencies.adasapi
|
||||
@@ -61,6 +66,7 @@ dependencies {
|
||||
implementation project(':modules:mogo-module-common')
|
||||
|
||||
implementation project(':core:mogo-core-data')
|
||||
implementation project(':core:mogo-core-function-api')
|
||||
implementation project(':core:mogo-core-function-call')
|
||||
}
|
||||
}
|
||||
|
||||
@@ -12,6 +12,8 @@ import android.location.Location;
|
||||
import android.os.Handler;
|
||||
import android.os.Message;
|
||||
|
||||
import com.mogo.eagle.core.data.autopilot.AutopilotRouteInfo;
|
||||
import com.mogo.eagle.core.data.autopilot.AutopilotStatusInfo;
|
||||
import com.mogo.eagle.core.data.map.MogoLatLng;
|
||||
import com.mogo.map.location.MogoLocation;
|
||||
import com.mogo.map.navi.IMogoCarLocationChangedListener2;
|
||||
@@ -29,7 +31,6 @@ import com.mogo.service.cloud.socket.IMogoOnMessageListener;
|
||||
import com.mogo.utils.logger.Logger;
|
||||
import com.mogo.utils.network.utils.GsonUtil;
|
||||
import com.zhidao.support.adas.high.bean.AutopilotRoute;
|
||||
import com.zhidao.support.adas.high.bean.AutopilotStatus;
|
||||
|
||||
import java.util.ArrayList;
|
||||
import java.util.List;
|
||||
@@ -129,12 +130,12 @@ public class AdasAutoPilotManager implements IMogoOnMessageListener<DispatchAdas
|
||||
}
|
||||
|
||||
@Override
|
||||
public void notifyAutopilotState(AutopilotStatus autopilotStatus) {
|
||||
public void notifyAutopilotState(AutopilotStatusInfo autopilotStatus) {
|
||||
AdasServiceModel.getInstance().uploadAutopilotStatus(autopilotStatus);
|
||||
}
|
||||
|
||||
@Override
|
||||
public void autopilotRoute(AutopilotRoute autopilotRoute) {
|
||||
public void autopilotRoute(AutopilotRouteInfo autopilotRoute) {
|
||||
// if (autopilotRoute == null || autopilotRoute.getModels() == null || autopilotRoute.getModels().size() == 0) {
|
||||
// return;
|
||||
// }
|
||||
@@ -226,12 +227,10 @@ public class AdasAutoPilotManager implements IMogoOnMessageListener<DispatchAdas
|
||||
}
|
||||
|
||||
public void testNotifyAutopilotState() {
|
||||
AutopilotStatus autopilotStatus = new AutopilotStatus();
|
||||
AutopilotStatus.ValuesBean valuesBean = new AutopilotStatus.ValuesBean();
|
||||
valuesBean.setReason("123");
|
||||
valuesBean.setSpeed(123);
|
||||
valuesBean.setState(0);
|
||||
autopilotStatus.setValues(valuesBean);
|
||||
AutopilotStatusInfo autopilotStatus = new AutopilotStatusInfo();
|
||||
autopilotStatus.setReason("123");
|
||||
autopilotStatus.setSpeed(123);
|
||||
autopilotStatus.setState(0);
|
||||
AdasServiceModel.getInstance().uploadAutopilotStatus(autopilotStatus);
|
||||
}
|
||||
|
||||
|
||||
@@ -1,29 +1,33 @@
|
||||
package com.mogo.module.adas;
|
||||
|
||||
import android.util.Log;
|
||||
|
||||
import androidx.annotation.NonNull;
|
||||
import androidx.annotation.Nullable;
|
||||
|
||||
import com.google.gson.Gson;
|
||||
import com.mogo.eagle.core.data.autopilot.AutoPilotStatusInfo;
|
||||
import com.mogo.commons.debug.DebugConfig;
|
||||
import com.mogo.eagle.core.data.autopilot.AutopilotCarStateInfo;
|
||||
import com.mogo.eagle.core.data.autopilot.AutopilotGuardianStatusInfo;
|
||||
import com.mogo.eagle.core.data.autopilot.AutopilotRouteInfo;
|
||||
import com.mogo.eagle.core.data.autopilot.AutopilotStationInfo;
|
||||
import com.mogo.eagle.core.data.autopilot.AutopilotStatusInfo;
|
||||
import com.mogo.eagle.core.data.autopilot.AutopilotWarnMessage;
|
||||
import com.mogo.eagle.core.data.traffic.TrafficData;
|
||||
import com.mogo.eagle.core.function.api.autopilot.IMoGoAutopilotStatusListener;
|
||||
import com.mogo.eagle.core.function.call.autopilot.CallerAutoPilotStatusListenerManager;
|
||||
import com.mogo.module.adas.model.AdasServiceModel;
|
||||
import com.mogo.module.common.drawer.IdentifyDataDrawer;
|
||||
import com.mogo.service.statusmanager.IMogoStatusManager;
|
||||
import com.mogo.utils.logger.Logger;
|
||||
import com.mogo.utils.network.utils.GsonUtil;
|
||||
import com.zhidao.autopilotservice.model.AdasAIDLAutopilotArriveModel;
|
||||
import com.zhidao.autopilotservice.model.AdasAIDLAutopilotStateModel;
|
||||
import com.zhidao.support.adas.high.AdasManager;
|
||||
import com.zhidao.support.adas.high.OnAdasListener;
|
||||
import com.zhidao.support.adas.high.OnAdasMsgConnectStatusListener;
|
||||
import com.zhidao.support.adas.high.bean.AutopilotRoute;
|
||||
import com.zhidao.support.adas.high.bean.AutopilotStatus;
|
||||
import com.zhidao.support.adas.high.bean.AutopilotWayArrive;
|
||||
import com.zhidao.support.adas.high.bean.CarLaneInfo;
|
||||
import com.zhidao.support.adas.high.bean.CarStateInfo;
|
||||
import com.zhidao.support.adas.high.bean.LightStatueInfo;
|
||||
import com.zhidao.support.adas.high.bean.ObstaclesInfo;
|
||||
import com.zhidao.support.adas.high.bean.RectInfo;
|
||||
import com.zhidao.support.adas.high.bean.WarnMessageInfo;
|
||||
import com.zhidao.support.adas.high.bean.guardian.AutopilotGuardianInfo;
|
||||
import com.zhidao.support.obu.ami.AmiClientManager;
|
||||
|
||||
import java.util.ArrayList;
|
||||
import java.util.List;
|
||||
import java.util.concurrent.TimeUnit;
|
||||
|
||||
import io.reactivex.Flowable;
|
||||
@@ -33,7 +37,7 @@ import io.reactivex.schedulers.Schedulers;
|
||||
/**
|
||||
* Created by XuYong on 2021/4/25 14:43
|
||||
*/
|
||||
public class AdasEventManager implements OnAdasListener, OnAdasMsgConnectStatusListener {
|
||||
public class AdasEventManager implements OnAdasMsgConnectStatusListener, IMoGoAutopilotStatusListener {
|
||||
|
||||
private final String TAG = "AdasEventManager";
|
||||
|
||||
@@ -48,12 +52,13 @@ public class AdasEventManager implements OnAdasListener, OnAdasMsgConnectStatusL
|
||||
//自动驾驶车速度
|
||||
private float mCurrentAutopilotSpeed = 0;
|
||||
//自动驾驶状态
|
||||
private AutopilotStatus.ValuesBean mAutopilotValuesStatus = null;
|
||||
private AutopilotStatusInfo mAutopilotValuesStatus = null;
|
||||
|
||||
private IAdasProviderBizListener providerBizListener;
|
||||
|
||||
private AdasEventManager() {
|
||||
gson = GsonUtil.getGson();
|
||||
CallerAutoPilotStatusListenerManager.INSTANCE.addListener(TAG, this);
|
||||
}
|
||||
|
||||
public static AdasEventManager getInstance() {
|
||||
@@ -98,157 +103,6 @@ public class AdasEventManager implements OnAdasListener, OnAdasMsgConnectStatusL
|
||||
iAdasStatusListeners.clear();
|
||||
}
|
||||
|
||||
@Override
|
||||
public void onWarnMessage(WarnMessageInfo warnMessageInfo) {
|
||||
Logger.d(TAG, "onWarnMessage " + warnMessageInfo);
|
||||
//报警model
|
||||
for (IAdasDataListener listener : iAdasEventListeners) {
|
||||
if (listener != null) {
|
||||
listener.onWarnMessage(warnMessageInfo);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
@Override
|
||||
public void onVideoSize(int width, int height) {
|
||||
Logger.d(TAG, "onVideoSize");
|
||||
for (IAdasDataListener listener : iAdasEventListeners) {
|
||||
if (listener != null) {
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
@Override
|
||||
public void onRectData(RectInfo rectInfo) {
|
||||
Logger.d(TAG, "onRectData " + rectInfo);
|
||||
try {
|
||||
for (IAdasDataListener listener : iAdasEventListeners) {
|
||||
if (listener != null) {
|
||||
listener.onRectData(rectInfo);
|
||||
}
|
||||
}
|
||||
} catch (Exception e) {
|
||||
e.printStackTrace();
|
||||
}
|
||||
}
|
||||
|
||||
@Override
|
||||
public void onCarStateData(CarStateInfo carStateInfo) {
|
||||
//Logger.d(TAG, "onCarStateData " + carStateInfo);
|
||||
for (IAdasDataListener listener : iAdasEventListeners) {
|
||||
if (listener != null) {
|
||||
listener.ownerCarStateInfo(gson.toJson(carStateInfo));
|
||||
}
|
||||
}
|
||||
|
||||
//can数据转发
|
||||
CarStateInfo.ValuesBean bean = carStateInfo.getValues();
|
||||
if (bean != null) {
|
||||
int turn_light = bean.getTurn_light(); //转向灯状态 0是正常 1是左转 2是右转
|
||||
AmiClientManager.getInstance().setTurnLightState(turn_light);
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
@Override
|
||||
public void onLightStateData(LightStatueInfo lightStatueInfo) {
|
||||
Logger.d(TAG, "onLightStateData " + lightStatueInfo);
|
||||
for (IAdasDataListener listener : iAdasEventListeners) {
|
||||
if (listener != null) {
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
@Override
|
||||
public void onObstaclesInfo(ObstaclesInfo obstaclesInfo) {
|
||||
Logger.d(TAG, "onObstaclesInfo " + obstaclesInfo);
|
||||
for (IAdasDataListener listener : iAdasEventListeners) {
|
||||
if (listener != null) {
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
@Override
|
||||
public void onCarLaneInfo(CarLaneInfo carLaneInfo) {
|
||||
Logger.d(TAG, "onCarLaneInfo " + carLaneInfo);
|
||||
for (IAdasDataListener listener : iAdasEventListeners) {
|
||||
if (listener != null) {
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
@Override
|
||||
public void autopilotStatus(AutopilotStatus autopilotStatus) {
|
||||
Logger.d(TAG, "autopilotStatus " + autopilotStatus);
|
||||
AutopilotStatus.ValuesBean autopilotStatusValues = autopilotStatus.getValues();
|
||||
if (autopilotStatusValues != null) {
|
||||
// 初始化自动驾驶状态信息
|
||||
AutoPilotStatusInfo autopilotStatusInfo = CallerAutoPilotStatusListenerManager.INSTANCE.getAutoPilotStatusInfo();
|
||||
autopilotStatusInfo.setAutopilotStatus(autopilotStatusValues.getState());
|
||||
autopilotStatusInfo.setAutoDriveStatus(autopilotStatusValues.getPilotmode());
|
||||
autopilotStatusInfo.setErrorReason(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());
|
||||
|
||||
CallerAutoPilotStatusListenerManager.INSTANCE.invokeAutoPilotStatusListener();
|
||||
|
||||
int state = autopilotStatusValues.getState();
|
||||
float speed = autopilotStatusValues.getSpeed();
|
||||
mCurrentAutopilotStatus = state;
|
||||
mCurrentAutopilotSpeed = speed;
|
||||
this.mAutopilotValuesStatus = autopilotStatus.getValues();
|
||||
for (IAdasDataListener listener : iAdasEventListeners) {
|
||||
if (listener != null) {
|
||||
listener.notifyAutopilotState(autopilotStatus);
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
@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) {
|
||||
AdasAIDLAutopilotArriveModel adasAIDLAutopilotArriveModel = new AdasAIDLAutopilotArriveModel();
|
||||
adasAIDLAutopilotArriveModel.setCarType(result.getCarType());
|
||||
double lon = endLatLon.getLon();
|
||||
double lat = endLatLon.getLat();
|
||||
adasAIDLAutopilotArriveModel.setLat(lat);
|
||||
adasAIDLAutopilotArriveModel.setLon(lon);
|
||||
Logger.d(TAG, "autopilotArrive reportSite");
|
||||
reportSite(lon, lat);
|
||||
for (IAdasDataListener listener : iAdasEventListeners) {
|
||||
if (listener != null) {
|
||||
listener.autopilotArrive(adasAIDLAutopilotArriveModel);
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
@Override
|
||||
public void onAutopilotRoute(AutopilotRoute autopilotRoute) {
|
||||
if (autopilotRoute.getModels() == null || autopilotRoute.getModels().size() == 0) {
|
||||
Logger.d(TAG, "onAutopilotRoute is null !");
|
||||
return;
|
||||
}
|
||||
Logger.d(TAG, "onAutopilotRoute : " + autopilotRoute.toString());
|
||||
for (IAdasDataListener listener : iAdasEventListeners) {
|
||||
if (listener != null) {
|
||||
listener.autopilotRoute(autopilotRoute);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
@Override
|
||||
public void onAutopilotSNRequest() {
|
||||
@@ -259,11 +113,6 @@ public class AdasEventManager implements OnAdasListener, OnAdasMsgConnectStatusL
|
||||
}
|
||||
}
|
||||
|
||||
@Override
|
||||
public void onAutopilotGuardian(AutopilotGuardianInfo guardianInfo) {
|
||||
|
||||
}
|
||||
|
||||
@Override
|
||||
public void onWebSocketConnectSuccess() {
|
||||
Logger.d(TAG, "webSocket 连接成功");
|
||||
@@ -271,7 +120,7 @@ public class AdasEventManager implements OnAdasListener, OnAdasMsgConnectStatusL
|
||||
CallerAutoPilotStatusListenerManager.INSTANCE.getAutoPilotStatusInfo().setConnectIP(AdasManager.getInstance().getAdasConfig().getAddress());
|
||||
CallerAutoPilotStatusListenerManager.INSTANCE.getAutoPilotStatusInfo().setConnectStatus(true);
|
||||
|
||||
CallerAutoPilotStatusListenerManager.INSTANCE.invokeAutoPilotStatusListener();
|
||||
CallerAutoPilotStatusListenerManager.INSTANCE.invokeAutoPilotStatus();
|
||||
for (IAdasStatusListener listener : iAdasStatusListeners) {
|
||||
listener.onServiceConnected();
|
||||
}
|
||||
@@ -283,7 +132,7 @@ public class AdasEventManager implements OnAdasListener, OnAdasMsgConnectStatusL
|
||||
Logger.d(TAG, "webSocket 连接失败 reason:" + reason);
|
||||
CallerAutoPilotStatusListenerManager.INSTANCE.getAutoPilotStatusInfo().setConnectIP(AdasManager.getInstance().getAdasConfig().getAddress());
|
||||
CallerAutoPilotStatusListenerManager.INSTANCE.getAutoPilotStatusInfo().setConnectStatus(false);
|
||||
CallerAutoPilotStatusListenerManager.INSTANCE.invokeAutoPilotStatusListener();
|
||||
CallerAutoPilotStatusListenerManager.INSTANCE.invokeAutoPilotStatus();
|
||||
for (IAdasStatusListener listener : iAdasStatusListeners) {
|
||||
listener.onServiceDisconnected();
|
||||
}
|
||||
@@ -319,4 +168,108 @@ public class AdasEventManager implements OnAdasListener, OnAdasMsgConnectStatusL
|
||||
public void setProviderBizListener(IAdasProviderBizListener listener) {
|
||||
providerBizListener = listener;
|
||||
}
|
||||
|
||||
@Override
|
||||
public void onAutopilotStatusResponse(@NonNull AutopilotStatusInfo autoPilotStatusInfo) {
|
||||
Logger.d(TAG, "autopilotStatus " + autoPilotStatusInfo);
|
||||
int state = autoPilotStatusInfo.getState();
|
||||
float speed = autoPilotStatusInfo.getSpeed();
|
||||
mCurrentAutopilotStatus = state;
|
||||
mCurrentAutopilotSpeed = speed;
|
||||
this.mAutopilotValuesStatus = autoPilotStatusInfo;
|
||||
for (IAdasDataListener listener : iAdasEventListeners) {
|
||||
if (listener != null) {
|
||||
listener.notifyAutopilotState(autoPilotStatusInfo);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
@Override
|
||||
public void onAutopilotArriveAtStation(AutopilotStationInfo autopilotWayArrive) {
|
||||
Logger.d(TAG, "autopilotArrive " + autopilotWayArrive);
|
||||
if (autopilotWayArrive != null) {
|
||||
double lon = autopilotWayArrive.getLon();
|
||||
double lat = autopilotWayArrive.getLat();
|
||||
Logger.d(TAG, "autopilotArrive reportSite");
|
||||
reportSite(lon, lat);
|
||||
for (IAdasDataListener listener : iAdasEventListeners) {
|
||||
if (listener != null) {
|
||||
listener.autopilotArrive(autopilotWayArrive);
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
@Override
|
||||
public void onAutopilotCarStateData(@Nullable AutopilotCarStateInfo autoPilotCarStateInfo) {
|
||||
Logger.d(TAG, "onCarStateData " + autoPilotCarStateInfo);
|
||||
for (IAdasDataListener listener : iAdasEventListeners) {
|
||||
if (listener != null) {
|
||||
listener.ownerCarStateInfo(gson.toJson(autoPilotCarStateInfo));
|
||||
}
|
||||
}
|
||||
|
||||
//can数据转发
|
||||
AutopilotCarStateInfo.ValuesBean bean = autoPilotCarStateInfo.getValues();
|
||||
if (bean != null) {
|
||||
int turn_light = bean.getTurn_light(); //转向灯状态 0是正常 1是左转 2是右转
|
||||
AmiClientManager.getInstance().setTurnLightState(turn_light);
|
||||
}
|
||||
}
|
||||
|
||||
@Override
|
||||
public void onAutopilotRoute(@Nullable AutopilotRouteInfo autopilotRoute) {
|
||||
if (autopilotRoute.getModels() == null || autopilotRoute.getModels().size() == 0) {
|
||||
Logger.d(TAG, "onAutopilotRoute is null !");
|
||||
return;
|
||||
}
|
||||
Logger.d(TAG, "onAutopilotRoute : " + autopilotRoute.toString());
|
||||
for (IAdasDataListener listener : iAdasEventListeners) {
|
||||
if (listener != null) {
|
||||
listener.autopilotRoute(autopilotRoute);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
@Override
|
||||
public void onAutopilotGuardian(@Nullable AutopilotGuardianStatusInfo guardianInfo) {
|
||||
|
||||
}
|
||||
|
||||
@Override
|
||||
public void onAutopilotIdentifyDataUpdate(@Nullable List<TrafficData> trafficData) {
|
||||
Logger.d(TAG, "onRectData " + trafficData);
|
||||
// 仅在 vr 模式下显示 adas 识别车辆
|
||||
if (trafficData == null) {
|
||||
Logger.w(TAG, "--->action is null");
|
||||
} else {
|
||||
final long start = System.nanoTime();
|
||||
try {
|
||||
IdentifyDataDrawer.getInstance().renderAdasRecognizedResult(trafficData);
|
||||
Log.i(TAG, "接收数据 -> 发出 cost :" + TimeUnit.NANOSECONDS.toMillis((System.nanoTime() - start)) + "ms");
|
||||
} catch (Exception e) {
|
||||
e.printStackTrace();
|
||||
}
|
||||
}
|
||||
try {
|
||||
for (IAdasDataListener listener : iAdasEventListeners) {
|
||||
if (listener != null) {
|
||||
listener.onRectData(trafficData);
|
||||
}
|
||||
}
|
||||
} catch (Exception e) {
|
||||
e.printStackTrace();
|
||||
}
|
||||
}
|
||||
|
||||
@Override
|
||||
public void onAutopilotWarnMessage(@Nullable AutopilotWarnMessage autopilotWarnMessage) {
|
||||
Logger.d(TAG, "onWarnMessage " + autopilotWarnMessage);
|
||||
//报警model
|
||||
for (IAdasDataListener listener : iAdasEventListeners) {
|
||||
if (listener != null) {
|
||||
listener.onWarnMessage(autopilotWarnMessage);
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
@@ -0,0 +1,110 @@
|
||||
package com.mogo.module.adas
|
||||
|
||||
import android.util.Log
|
||||
import com.mogo.eagle.core.data.autopilot.AutopilotWarnMessage
|
||||
import com.mogo.eagle.core.data.autopilot.AutopilotCarStateInfo
|
||||
import com.mogo.eagle.core.data.autopilot.AutopilotGuardianStatusInfo
|
||||
import com.mogo.eagle.core.data.autopilot.AutopilotRouteInfo
|
||||
import com.mogo.eagle.core.data.enums.TrafficTypeEnum
|
||||
import com.mogo.eagle.core.data.traffic.TrafficData
|
||||
import com.mogo.utils.network.utils.GsonUtil
|
||||
import com.zhidao.support.adas.high.bean.AutopilotRoute
|
||||
import com.zhidao.support.adas.high.bean.CarStateInfo
|
||||
import com.zhidao.support.adas.high.bean.RectInfo.RectBean
|
||||
import com.zhidao.support.adas.high.bean.WarnMessageInfo
|
||||
import com.zhidao.support.adas.high.bean.guardian.AutopilotGuardianInfo
|
||||
import java.util.*
|
||||
import java.util.concurrent.TimeUnit
|
||||
|
||||
/**
|
||||
* @author congtaowang
|
||||
* @since 2020/10/25
|
||||
*
|
||||
* 对象转换类
|
||||
*/
|
||||
object AdasObjectUtils {
|
||||
|
||||
fun fromAutopilotGuardianInfo(autopilotGuardianInfo: AutopilotGuardianInfo): AutopilotGuardianStatusInfo? {
|
||||
return GsonUtil.objectFromJson(
|
||||
GsonUtil.jsonFromObject(autopilotGuardianInfo),
|
||||
AutopilotGuardianStatusInfo::class.java
|
||||
)
|
||||
}
|
||||
|
||||
fun fromAdasAutopilotRoute(carStateInfo: AutopilotRoute): AutopilotRouteInfo? {
|
||||
return GsonUtil.objectFromJson(
|
||||
GsonUtil.jsonFromObject(carStateInfo),
|
||||
AutopilotRouteInfo::class.java
|
||||
)
|
||||
}
|
||||
|
||||
fun fromAdasCarStateInfoObject(carStateInfo: CarStateInfo): AutopilotCarStateInfo? {
|
||||
return GsonUtil.objectFromJson(
|
||||
GsonUtil.jsonFromObject(carStateInfo),
|
||||
AutopilotCarStateInfo::class.java
|
||||
)
|
||||
}
|
||||
|
||||
fun fromAdasObject(info: WarnMessageInfo?): AutopilotWarnMessage? {
|
||||
if (info == null) {
|
||||
return null
|
||||
}
|
||||
val warnMessage =
|
||||
AutopilotWarnMessage()
|
||||
warnMessage.content = info.content
|
||||
warnMessage.level = info.level
|
||||
try {
|
||||
warnMessage.type = info.type.toInt()
|
||||
} catch (e: NumberFormatException) {
|
||||
return null
|
||||
}
|
||||
warnMessage.value = info.value
|
||||
return warnMessage
|
||||
}
|
||||
|
||||
fun regroupTrafficDataData(datums: List<RectBean?>?): List<TrafficData>? {
|
||||
if (datums == null || datums.isEmpty()) {
|
||||
return null
|
||||
}
|
||||
val recognizedListResults: MutableList<TrafficData> = ArrayList()
|
||||
for (model in datums) {
|
||||
if (model == null) {
|
||||
continue
|
||||
}
|
||||
val recognizedListResult = fromAdasTrafficDataObject(model)
|
||||
if (recognizedListResult != null) {
|
||||
recognizedListResults.add(recognizedListResult)
|
||||
}
|
||||
}
|
||||
return recognizedListResults
|
||||
}
|
||||
|
||||
fun fromAdasTrafficDataObject(model: RectBean?): TrafficData? {
|
||||
if (model == null) {
|
||||
return null
|
||||
}
|
||||
val start = System.nanoTime()
|
||||
val result = TrafficData()
|
||||
result.uuid = model.uuid
|
||||
result.lat = model.lat
|
||||
result.lon = model.lon
|
||||
result.type = TrafficTypeEnum.getType(model.type.toInt())
|
||||
result.heading = model.heading
|
||||
result.systemTime = model.systemTime.toLong()
|
||||
result.satelliteTime = model.satelliteTime.toLong()
|
||||
result.alt = model.alt
|
||||
result.speed = model.speed
|
||||
result.carId = model.carId
|
||||
result.dataAccuracy = model.dataAccuracy
|
||||
result.distance = model.distance
|
||||
result.threatLevel = model.drawlevel
|
||||
Log.d(
|
||||
"ADAS数据延时", "fromAdasObject cost : " + TimeUnit.NANOSECONDS.toMillis(
|
||||
System.nanoTime() - start
|
||||
)
|
||||
)
|
||||
return result
|
||||
}
|
||||
|
||||
|
||||
}
|
||||
@@ -9,7 +9,9 @@ import com.mogo.eagle.core.data.constants.MogoServicePaths;
|
||||
import com.mogo.utils.logger.Logger;
|
||||
import com.zhidao.autopilotservice.model.AdasAIDLAutopilotStateModel;
|
||||
import com.zhidao.support.adas.high.AdasManager;
|
||||
import com.zhidao.support.adas.high.bean.AutopilotRoute;
|
||||
import com.zhidao.support.adas.high.bean.BasicInfo;
|
||||
import com.zhidao.support.adas.high.bean.guardian.AutopilotGuardianInfo;
|
||||
|
||||
|
||||
/**
|
||||
@@ -45,7 +47,7 @@ public class AdasProvider implements IProvider {
|
||||
|
||||
private void initAdas(Context context, AdasEventManager adasEventManager) {
|
||||
AdasManager.getInstance().create(context);
|
||||
AdasManager.getInstance().setOnAdasListener(adasEventManager);
|
||||
AdasManager.getInstance().setOnAdasListener(new OnAdasListenerAdapter());
|
||||
AdasManager.getInstance().setOnAdasConnectStatusListener(adasEventManager);
|
||||
adasEventManager.setProviderBizListener(this::setBasicInfo);
|
||||
}
|
||||
|
||||
@@ -1,41 +0,0 @@
|
||||
package com.mogo.module.adas;
|
||||
|
||||
/**
|
||||
* Created by XuYong on 2021/5/28 16:12
|
||||
*/
|
||||
public class AutonomousDriveStatusBean {
|
||||
|
||||
private String sn;
|
||||
private int status;
|
||||
private float vehicleSpeed;
|
||||
|
||||
public AutonomousDriveStatusBean(String sn, int status, float vehicleSpeed) {
|
||||
this.sn = sn;
|
||||
this.status = status;
|
||||
this.vehicleSpeed = vehicleSpeed;
|
||||
}
|
||||
|
||||
public String getSn() {
|
||||
return sn;
|
||||
}
|
||||
|
||||
public void setSn(String sn) {
|
||||
this.sn = sn;
|
||||
}
|
||||
|
||||
public int getStatus() {
|
||||
return status;
|
||||
}
|
||||
|
||||
public void setStatus(int status) {
|
||||
this.status = status;
|
||||
}
|
||||
|
||||
public float getVehicleSpeed() {
|
||||
return vehicleSpeed;
|
||||
}
|
||||
|
||||
public void setVehicleSpeed(float vehicleSpeed) {
|
||||
this.vehicleSpeed = vehicleSpeed;
|
||||
}
|
||||
}
|
||||
@@ -1,10 +1,12 @@
|
||||
package com.mogo.module.adas;
|
||||
|
||||
import com.zhidao.autopilotservice.model.AdasAIDLAutopilotArriveModel;
|
||||
import com.zhidao.support.adas.high.bean.AutopilotRoute;
|
||||
import com.zhidao.support.adas.high.bean.AutopilotStatus;
|
||||
import com.zhidao.support.adas.high.bean.RectInfo;
|
||||
import com.zhidao.support.adas.high.bean.WarnMessageInfo;
|
||||
import com.mogo.eagle.core.data.autopilot.AutopilotRouteInfo;
|
||||
import com.mogo.eagle.core.data.autopilot.AutopilotStationInfo;
|
||||
import com.mogo.eagle.core.data.autopilot.AutopilotStatusInfo;
|
||||
import com.mogo.eagle.core.data.autopilot.AutopilotWarnMessage;
|
||||
import com.mogo.eagle.core.data.traffic.TrafficData;
|
||||
|
||||
import java.util.List;
|
||||
|
||||
|
||||
public interface IAdasDataListener {
|
||||
@@ -13,11 +15,11 @@ public interface IAdasDataListener {
|
||||
|
||||
}
|
||||
|
||||
default void onRectData(RectInfo rectInfo) {
|
||||
default void onRectData(List<TrafficData> trafficData) {
|
||||
|
||||
}
|
||||
|
||||
default void onWarnMessage(WarnMessageInfo warnMessageInfo) {
|
||||
default void onWarnMessage(AutopilotWarnMessage autopilotWarnMessage) {
|
||||
|
||||
}
|
||||
|
||||
@@ -25,17 +27,17 @@ public interface IAdasDataListener {
|
||||
/**
|
||||
* 自动驾驶到达站点回调接口
|
||||
*
|
||||
* @param autopilotArriveModel
|
||||
* @param autopilotWayArrive
|
||||
*/
|
||||
default void autopilotArrive(AdasAIDLAutopilotArriveModel autopilotArriveModel) {
|
||||
default void autopilotArrive(AutopilotStationInfo autopilotWayArrive) {
|
||||
}
|
||||
|
||||
/**
|
||||
* 自动驾驶路线回调
|
||||
*
|
||||
* @param autopilotRoute {@link AutopilotRoute}
|
||||
* @param autopilotRoute {@link AutopilotRouteInfo}
|
||||
*/
|
||||
default void autopilotRoute(AutopilotRoute autopilotRoute) {
|
||||
default void autopilotRoute(AutopilotRouteInfo autopilotRoute) {
|
||||
|
||||
}
|
||||
|
||||
@@ -50,9 +52,9 @@ public interface IAdasDataListener {
|
||||
/**
|
||||
* 自动驾驶状态信息
|
||||
*
|
||||
* @param autopilotStatus {@link AutopilotStatus}
|
||||
* @param autopilotStatus {@link AutopilotStatusInfo}
|
||||
*/
|
||||
default void notifyAutopilotState(AutopilotStatus autopilotStatus) {
|
||||
default void notifyAutopilotState(AutopilotStatusInfo autopilotStatus) {
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
@@ -0,0 +1,141 @@
|
||||
package com.mogo.module.adas;
|
||||
|
||||
import com.mogo.eagle.core.data.autopilot.AutopilotCarStateInfo;
|
||||
import com.mogo.eagle.core.data.autopilot.AutopilotGuardianStatusInfo;
|
||||
import com.mogo.eagle.core.data.autopilot.AutopilotRouteInfo;
|
||||
import com.mogo.eagle.core.data.autopilot.AutopilotStationInfo;
|
||||
import com.mogo.eagle.core.data.autopilot.AutopilotStatusInfo;
|
||||
import com.mogo.eagle.core.data.autopilot.AutopilotWarnMessage;
|
||||
import com.mogo.eagle.core.data.traffic.TrafficData;
|
||||
import com.mogo.eagle.core.function.call.autopilot.CallerAutoPilotStatusListenerManager;
|
||||
import com.mogo.utils.logger.Logger;
|
||||
import com.zhidao.support.adas.high.AdasManager;
|
||||
import com.zhidao.support.adas.high.OnAdasListener;
|
||||
import com.zhidao.support.adas.high.bean.AutopilotRoute;
|
||||
import com.zhidao.support.adas.high.bean.AutopilotStatus;
|
||||
import com.zhidao.support.adas.high.bean.AutopilotWayArrive;
|
||||
import com.zhidao.support.adas.high.bean.CarLaneInfo;
|
||||
import com.zhidao.support.adas.high.bean.CarStateInfo;
|
||||
import com.zhidao.support.adas.high.bean.LightStatueInfo;
|
||||
import com.zhidao.support.adas.high.bean.ObstaclesInfo;
|
||||
import com.zhidao.support.adas.high.bean.RectInfo;
|
||||
import com.zhidao.support.adas.high.bean.WarnMessageInfo;
|
||||
import com.zhidao.support.adas.high.bean.guardian.AutopilotGuardianInfo;
|
||||
import com.zhidao.support.obu.ami.AmiClientManager;
|
||||
|
||||
import java.util.List;
|
||||
|
||||
/**
|
||||
* @author congtaowang
|
||||
* @since 2020/10/22
|
||||
* <p>
|
||||
* 适配ADAS 回调监听分发
|
||||
*/
|
||||
public class OnAdasListenerAdapter implements OnAdasListener {
|
||||
private final String TAG = "OnAdasListenerAdapter";
|
||||
|
||||
@Override
|
||||
public void onRectData(RectInfo rectInfo) {
|
||||
List<TrafficData> recognizedListResults = AdasObjectUtils.INSTANCE.regroupTrafficDataData(rectInfo.getModels());
|
||||
CallerAutoPilotStatusListenerManager.INSTANCE.invokeAutopilotIdentifyDataUpdate(recognizedListResults);
|
||||
}
|
||||
|
||||
@Override
|
||||
public void onCarStateData(CarStateInfo carStateInfo) {
|
||||
AutopilotCarStateInfo autopilotCarStateInfo = AdasObjectUtils.INSTANCE.fromAdasCarStateInfoObject(carStateInfo);
|
||||
CallerAutoPilotStatusListenerManager.INSTANCE.invokeAutopilotCarStateData(autopilotCarStateInfo);
|
||||
|
||||
//can数据转发
|
||||
CarStateInfo.ValuesBean bean = carStateInfo.getValues();
|
||||
if (bean != null) {
|
||||
int turn_light = bean.getTurn_light(); //转向灯状态 0是正常 1是左转 2是右转
|
||||
AmiClientManager.getInstance().setTurnLightState(turn_light);
|
||||
}
|
||||
}
|
||||
|
||||
@Override
|
||||
public void autopilotStatus(AutopilotStatus autopilotStatus) {
|
||||
AutopilotStatus.ValuesBean autopilotStatusValues = autopilotStatus.getValues();
|
||||
|
||||
if (autopilotStatusValues != null) {
|
||||
// 初始化自动驾驶状态信息
|
||||
AutopilotStatusInfo autopilotStatusInfo = CallerAutoPilotStatusListenerManager.INSTANCE.getAutoPilotStatusInfo();
|
||||
autopilotStatusInfo.setState(autopilotStatusValues.getState());
|
||||
autopilotStatusInfo.setPilotmode(autopilotStatusValues.getPilotmode());
|
||||
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());
|
||||
|
||||
CallerAutoPilotStatusListenerManager.INSTANCE.invokeAutoPilotStatus();
|
||||
}
|
||||
}
|
||||
|
||||
@Override
|
||||
public void autopilotArrive(AutopilotWayArrive 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);
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
@Override
|
||||
public void onAutopilotRoute(AutopilotRoute route) {
|
||||
Logger.d(TAG, "onAutopilotRoute : " + route.toString());
|
||||
AutopilotRouteInfo autopilotRoute = AdasObjectUtils.INSTANCE.fromAdasAutopilotRoute(route);
|
||||
CallerAutoPilotStatusListenerManager.INSTANCE.invokeAutopilotRoute(autopilotRoute);
|
||||
}
|
||||
|
||||
@Override
|
||||
public void onAutopilotSNRequest() {
|
||||
CallerAutoPilotStatusListenerManager.INSTANCE.invokeAutopilotSNRequest();
|
||||
}
|
||||
|
||||
@Override
|
||||
public void onAutopilotGuardian(AutopilotGuardianInfo guardianInfo) {
|
||||
AutopilotGuardianStatusInfo autopilotRoute = AdasObjectUtils.INSTANCE.fromAutopilotGuardianInfo(guardianInfo);
|
||||
CallerAutoPilotStatusListenerManager.INSTANCE.invokeAutopilotGuardian(autopilotRoute);
|
||||
}
|
||||
|
||||
|
||||
@Override
|
||||
public void onLightStateData(LightStatueInfo lightStatueInfo) {
|
||||
|
||||
}
|
||||
|
||||
@Override
|
||||
public void onObstaclesInfo(ObstaclesInfo obstaclesInfo) {
|
||||
|
||||
}
|
||||
|
||||
@Override
|
||||
public void onCarLaneInfo(CarLaneInfo carLaneInfo) {
|
||||
|
||||
}
|
||||
|
||||
|
||||
@Override
|
||||
public void onWarnMessage(WarnMessageInfo warnMessageInfo) {
|
||||
final AutopilotWarnMessage warnMessage = AdasObjectUtils.INSTANCE.fromAdasObject(warnMessageInfo);
|
||||
CallerAutoPilotStatusListenerManager.INSTANCE.invokeAutopilotWarnMessage(warnMessage);
|
||||
|
||||
}
|
||||
|
||||
@Override
|
||||
public void onVideoSize(int width, int height) {
|
||||
|
||||
}
|
||||
|
||||
|
||||
}
|
||||
@@ -1,40 +0,0 @@
|
||||
package com.mogo.module.adas;
|
||||
|
||||
/**
|
||||
* Created by XuYong on 2021/5/31 16:24
|
||||
*/
|
||||
public class ReportSiteBean {
|
||||
private String sn;
|
||||
private double lon;
|
||||
private double lat;
|
||||
|
||||
public ReportSiteBean(String sn, double lon, double lat) {
|
||||
this.sn = sn;
|
||||
this.lon = lon;
|
||||
this.lat = lat;
|
||||
}
|
||||
|
||||
public String getSn() {
|
||||
return sn;
|
||||
}
|
||||
|
||||
public void setSn(String sn) {
|
||||
this.sn = sn;
|
||||
}
|
||||
|
||||
public double getLon() {
|
||||
return lon;
|
||||
}
|
||||
|
||||
public void setLon(double lon) {
|
||||
this.lon = lon;
|
||||
}
|
||||
|
||||
public double getLat() {
|
||||
return lat;
|
||||
}
|
||||
|
||||
public void setLat(double lat) {
|
||||
this.lat = lat;
|
||||
}
|
||||
}
|
||||
@@ -1,17 +1,17 @@
|
||||
package com.mogo.module.adas.entity;
|
||||
|
||||
|
||||
import com.zhidao.support.adas.high.bean.AutopilotStatus;
|
||||
import com.mogo.eagle.core.data.autopilot.AutopilotStatusInfo;
|
||||
|
||||
/**
|
||||
* 上报自动驾驶规划的路径
|
||||
*/
|
||||
public class ReportedRoute {
|
||||
private String sn;
|
||||
private AutopilotStatus.ValuesBean bean;
|
||||
private AutopilotStatusInfo bean;
|
||||
private String siteList;
|
||||
|
||||
public ReportedRoute(String sn, AutopilotStatus.ValuesBean bean) {
|
||||
public ReportedRoute(String sn, AutopilotStatusInfo bean) {
|
||||
this.sn = sn;
|
||||
this.bean = bean;
|
||||
}
|
||||
|
||||
@@ -1,31 +0,0 @@
|
||||
package com.mogo.module.adas.entity;
|
||||
|
||||
import com.zhidao.support.adas.high.bean.WarnMessageInfo;
|
||||
|
||||
/**
|
||||
* @author nie yunlong
|
||||
* @des
|
||||
* @date 2020/10/22
|
||||
*/
|
||||
public class WarnMessageModel {
|
||||
|
||||
private String action;
|
||||
|
||||
private WarnMessageInfo values;
|
||||
|
||||
public String getAction() {
|
||||
return action;
|
||||
}
|
||||
|
||||
public void setAction(String action) {
|
||||
this.action = action;
|
||||
}
|
||||
|
||||
public WarnMessageInfo getValues() {
|
||||
return values;
|
||||
}
|
||||
|
||||
public void setValues(WarnMessageInfo values) {
|
||||
this.values = values;
|
||||
}
|
||||
}
|
||||
@@ -3,6 +3,7 @@ package com.mogo.module.adas.model;
|
||||
import com.mogo.cloud.passport.MoGoAiCloudClientConfig;
|
||||
import com.mogo.commons.data.BaseData;
|
||||
import com.mogo.commons.network.SubscribeImpl;
|
||||
import com.mogo.eagle.core.data.autopilot.AutopilotStatusInfo;
|
||||
import com.mogo.module.adas.entity.AutonomousDriveStatusBean;
|
||||
import com.mogo.module.adas.entity.ReportDispatchResult;
|
||||
import com.mogo.module.adas.entity.ReportSiteBean;
|
||||
@@ -59,9 +60,9 @@ public class AdasServiceModel {
|
||||
*
|
||||
* @param autopilotStatus {@link AutopilotStatus}
|
||||
*/
|
||||
public void uploadAutopilotStatus(AutopilotStatus autopilotStatus) {
|
||||
public void uploadAutopilotStatus(AutopilotStatusInfo autopilotStatus) {
|
||||
String sn = MoGoAiCloudClientConfig.getInstance().getSn();
|
||||
ReportedRoute reportedRoute = new ReportedRoute(sn, autopilotStatus.getValues());
|
||||
ReportedRoute reportedRoute = new ReportedRoute(sn, autopilotStatus);
|
||||
Map<String, Object> map = new HashMap<>();
|
||||
map.put("sn", sn);
|
||||
map.put("data", GsonUtil.jsonFromObject(reportedRoute));
|
||||
|
||||
@@ -1,216 +0,0 @@
|
||||
原数据
|
||||
26.820175208327566,112.57748204198309
|
||||
26.82009891465042,112.57735739748664
|
||||
26.820022750763542,112.57723266155585
|
||||
26.81994655656347,112.57710795477944
|
||||
26.81987031666393,112.57698328267305
|
||||
26.819793988171348,112.57685866945901
|
||||
26.819717530408877,112.57673414980971
|
||||
26.819635079638967,112.57661462149986
|
||||
26.819532022659132,112.5765234581422
|
||||
26.819488197195188,112.5764835085963
|
||||
26.81947053563866,112.57645743645142
|
||||
26.81945285740347,112.5764313389555
|
||||
26.81941584428336,112.57637074918446
|
||||
26.819355855639404,112.57626774620917
|
||||
26.8193352833325,112.57623094969783
|
||||
26.819315738575742,112.57619587959701
|
||||
26.81929619389902,112.5761608096667
|
||||
26.819276064037396,112.5761245744324
|
||||
26.819221654527443,112.5760208132482
|
||||
26.819153675938914,112.5758903945585
|
||||
26.8190859083974,112.57576035026403
|
||||
26.81904791926707,112.57568644394968
|
||||
26.819047477540156,112.57568591545105
|
||||
26.819047035811135,112.57568538694994
|
||||
26.819046594080046,112.57568485844635
|
||||
26.81902999052958,112.57568137976324
|
||||
26.818966668056316,112.57572279587626
|
||||
26.81896660310204,112.57572518130716
|
||||
26.81896683258833,112.57572606581252
|
||||
26.81896706207354,112.57572695031374
|
||||
26.818971211272444,112.57573544393973
|
||||
26.819027657144368,112.57584589447032
|
||||
26.819095546341085,112.57597644303986
|
||||
26.8191650468231,112.57610591408428
|
||||
26.819236806047,112.5762338575302
|
||||
26.819310184480436,112.57636063880027
|
||||
26.819384451187933,112.5764867800095
|
||||
26.819460642360763,112.57661149583805
|
||||
26.819536878267925,112.57673619431976
|
||||
26.819613220428206,112.57686079387894
|
||||
26.819689146973122,112.57698570087358
|
||||
26.819765257290772,112.57711047564952
|
||||
26.81984156841068,112.57723510283108
|
||||
26.819916608456698,112.57735767331373
|
||||
26.819990868286688,112.57747918205983
|
||||
26.82006704845146,112.57760363217366
|
||||
26.820142688927376,112.57772676391022
|
||||
26.820220480866162,112.57784947830805
|
||||
26.82029609426984,112.57797111160743
|
||||
26.820372540342063,112.57809575812311
|
||||
26.820449035279513,112.57822036992494
|
||||
26.82052479395364,112.5783432083879
|
||||
26.820600741070034,112.57846626552721
|
||||
26.820676451505513,112.57858892597905
|
||||
26.820750627333855,112.57870908764811
|
||||
26.820788099971104,112.57876896886103
|
||||
26.82079340880141,112.57877600898784
|
||||
26.82079871765643,112.57878304914836
|
||||
26.820804096213536,112.57879017489086
|
||||
26.820866626548845,112.5788587003478
|
||||
26.820983640738305,112.57893123552938
|
||||
26.82111632395692,112.57893777257203
|
||||
26.82117204164965,112.57891747212024
|
||||
26.821184743761496,112.57890962148315
|
||||
26.821197445813166,112.57890177088103
|
||||
26.821210607045213,112.57889357476125
|
||||
26.821290516628242,112.57883467623317
|
||||
26.82140278979742,112.57875048180252
|
||||
26.821515292745254,112.57866667791178
|
||||
26.821628395747688,112.5785838835907
|
||||
26.82174189376551,112.57850175198458
|
||||
26.82185566968843,112.57842010282002
|
||||
26.82196987298559,112.57833919555353
|
||||
26.822083935682734,112.5782580474171
|
||||
26.822198178890964,112.57817722472228
|
||||
26.82231299206679,112.5780973993899
|
||||
26.822427661696032,112.57801732090307
|
||||
26.82254293064344,112.57793832470455
|
||||
26.822658717481524,112.57786026718888
|
||||
26.822774624402133,112.57778243034805
|
||||
26.82289066838358,112.57770484656757
|
||||
26.823007036027615,112.57762787191734
|
||||
26.823123797760537,112.57755163699323
|
||||
26.82324089700492,112.57747604255579
|
||||
26.823355874237176,112.57740187937155
|
||||
26.823470001455,112.57732986163221
|
||||
26.82358841433288,112.57725688653507
|
||||
26.823706827172103,112.5771839112856
|
||||
26.82382523997266,112.57711093588388
|
||||
26.823943652734542,112.57703796032986
|
||||
26.824062065457753,112.57696498462354
|
||||
26.824180478142292,112.57689200876496
|
||||
26.82429889078817,112.57681903275407
|
||||
26.824416715403633,112.5767464980989
|
||||
26.824533859020413,112.57667699873441
|
||||
26.824651399274774,112.57660868246823
|
||||
26.824762900762973,112.57658692553045
|
||||
26.824968687097577,112.57656763804074
|
||||
26.825104150528567,112.57650684107888
|
||||
26.82522465989416,112.57643823074989
|
||||
26.825345659446693,112.57637072881484
|
||||
26.8255763298452,112.57624421893341
|
||||
|
||||
|
||||
排序数据:
|
||||
26.81896660310204,112.57568137976324
|
||||
26.818966668056316,112.57568485844635
|
||||
26.81896683258833,112.57568538694994
|
||||
26.81896706207354,112.57568591545105
|
||||
26.818971211272444,112.57568644394968
|
||||
26.819027657144368,112.57572279587626
|
||||
26.81902999052958,112.57572518130716
|
||||
26.819046594080046,112.57572606581252
|
||||
26.819047035811135,112.57572695031374
|
||||
26.819047477540156,112.57573544393973
|
||||
26.81904791926707,112.57576035026403
|
||||
26.8190859083974,112.57584589447032
|
||||
26.819095546341085,112.5758903945585
|
||||
26.819153675938914,112.57597644303986
|
||||
26.8191650468231,112.5760208132482
|
||||
26.819221654527443,112.57610591408428
|
||||
26.819236806047,112.5761245744324
|
||||
26.819276064037396,112.5761608096667
|
||||
26.81929619389902,112.57619587959701
|
||||
26.819310184480436,112.57623094969783
|
||||
26.819315738575742,112.5762338575302
|
||||
26.8193352833325,112.57624421893341
|
||||
26.819355855639404,112.57626774620917
|
||||
26.819384451187933,112.57636063880027
|
||||
26.81941584428336,112.57637072881484
|
||||
26.81945285740347,112.57637074918446
|
||||
26.819460642360763,112.5764313389555
|
||||
26.81947053563866,112.57643823074989
|
||||
26.819488197195188,112.57645743645142
|
||||
26.819532022659132,112.5764835085963
|
||||
26.819536878267925,112.5764867800095
|
||||
26.819613220428206,112.57650684107888
|
||||
26.819635079638967,112.5765234581422
|
||||
26.819689146973122,112.57656763804074
|
||||
26.819717530408877,112.57658692553045
|
||||
26.819765257290772,112.57660868246823
|
||||
26.819793988171348,112.57661149583805
|
||||
26.81984156841068,112.57661462149986
|
||||
26.81987031666393,112.57667699873441
|
||||
26.819916608456698,112.57673414980971
|
||||
26.81994655656347,112.57673619431976
|
||||
26.819990868286688,112.5767464980989
|
||||
26.820022750763542,112.57681903275407
|
||||
26.82006704845146,112.57685866945901
|
||||
26.82009891465042,112.57686079387894
|
||||
26.820142688927376,112.57689200876496
|
||||
26.820175208327566,112.57696498462354
|
||||
26.820220480866162,112.57698328267305
|
||||
26.82029609426984,112.57698570087358
|
||||
26.820372540342063,112.57703796032986
|
||||
26.820449035279513,112.57710795477944
|
||||
26.82052479395364,112.57711047564952
|
||||
26.820600741070034,112.57711093588388
|
||||
26.820676451505513,112.5771839112856
|
||||
26.820750627333855,112.57723266155585
|
||||
26.820788099971104,112.57723510283108
|
||||
26.82079340880141,112.57725688653507
|
||||
26.82079871765643,112.57732986163221
|
||||
26.820804096213536,112.57735739748664
|
||||
26.820866626548845,112.57735767331373
|
||||
26.820983640738305,112.57740187937155
|
||||
26.82111632395692,112.57747604255579
|
||||
26.82117204164965,112.57747918205983
|
||||
26.821184743761496,112.57748204198309
|
||||
26.821197445813166,112.57755163699323
|
||||
26.821210607045213,112.57760363217366
|
||||
26.821290516628242,112.57762787191734
|
||||
26.82140278979742,112.57770484656757
|
||||
26.821515292745254,112.57772676391022
|
||||
26.821628395747688,112.57778243034805
|
||||
26.82174189376551,112.57784947830805
|
||||
26.82185566968843,112.57786026718888
|
||||
26.82196987298559,112.57793832470455
|
||||
26.822083935682734,112.57797111160743
|
||||
26.822198178890964,112.57801732090307
|
||||
26.82231299206679,112.57809575812311
|
||||
26.822427661696032,112.5780973993899
|
||||
26.82254293064344,112.57817722472228
|
||||
26.822658717481524,112.57822036992494
|
||||
26.822774624402133,112.5782580474171
|
||||
26.82289066838358,112.57833919555353
|
||||
26.823007036027615,112.5783432083879
|
||||
26.823123797760537,112.57842010282002
|
||||
26.82324089700492,112.57846626552721
|
||||
26.823355874237176,112.57850175198458
|
||||
26.823470001455,112.5785838835907
|
||||
26.82358841433288,112.57858892597905
|
||||
26.823706827172103,112.57866667791178
|
||||
26.82382523997266,112.57870908764811
|
||||
26.823943652734542,112.57875048180252
|
||||
26.824062065457753,112.57876896886103
|
||||
26.824180478142292,112.57877600898784
|
||||
26.82429889078817,112.57878304914836
|
||||
26.824416715403633,112.57879017489086
|
||||
26.824533859020413,112.57883467623317
|
||||
26.824651399274774,112.5788587003478
|
||||
26.824762900762973,112.57889357476125
|
||||
26.824968687097577,112.57890177088103
|
||||
26.825104150528567,112.57890962148315
|
||||
26.82522465989416,112.57891747212024
|
||||
26.825345659446693,112.57893123552938
|
||||
26.8255763298452,112.57893777257203
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
@@ -2,7 +2,7 @@ package com.mogo.module.common.datacenter;
|
||||
|
||||
import com.mogo.commons.FunctionBuildConfig;
|
||||
import com.mogo.commons.debug.DebugConfig;
|
||||
import com.mogo.eagle.core.data.autopilot.AutoPilotStatusInfo;
|
||||
import com.mogo.eagle.core.data.autopilot.AutopilotStatusInfo;
|
||||
import com.mogo.eagle.core.function.call.autopilot.CallerAutoPilotStatusListenerManager;
|
||||
import com.mogo.module.common.MogoApisHandler;
|
||||
import com.mogo.service.cloud.location.CloudLocationInfo;
|
||||
@@ -94,10 +94,10 @@ public class SnapshotLocationDataCenter {
|
||||
// 使用与渠道配置一样的gps提供者提供的数据
|
||||
if (gpsProvider == FunctionBuildConfig.gpsProvider) {
|
||||
//测试面板状态同步
|
||||
AutoPilotStatusInfo autopilotStatusInfo = CallerAutoPilotStatusListenerManager.INSTANCE.getAutoPilotStatusInfo();
|
||||
AutopilotStatusInfo autopilotStatusInfo = CallerAutoPilotStatusListenerManager.INSTANCE.getAutoPilotStatusInfo();
|
||||
autopilotStatusInfo.setLocationLat(lat);
|
||||
autopilotStatusInfo.setLocationLon(lon);
|
||||
CallerAutoPilotStatusListenerManager.INSTANCE.invokeAutoPilotStatusListener();
|
||||
CallerAutoPilotStatusListenerManager.INSTANCE.invokeAutoPilotStatus();
|
||||
|
||||
DebugConfig.setStatusData(DebugConfig.sLon, lon);
|
||||
DebugConfig.setStatusData(DebugConfig.sLat, lat);
|
||||
|
||||
@@ -1,5 +1,7 @@
|
||||
package com.mogo.module.common.drawer;
|
||||
|
||||
import static com.mogo.cloud.socket.entity.SocketDownDataHelper.FROM_ADAS;
|
||||
|
||||
import android.os.Build;
|
||||
import android.text.TextUtils;
|
||||
import android.util.Log;
|
||||
@@ -7,12 +9,12 @@ import android.util.Log;
|
||||
import com.mogo.cloud.commons.utils.CoordinateUtils;
|
||||
import com.mogo.commons.debug.DebugConfig;
|
||||
import com.mogo.eagle.core.data.map.MogoLatLng;
|
||||
import com.mogo.eagle.core.data.traffic.TrafficData;
|
||||
import com.mogo.map.marker.IMogoMarker;
|
||||
import com.mogo.map.marker.MogoMarkerOptions;
|
||||
import com.mogo.module.common.MogoApisHandler;
|
||||
import com.mogo.module.common.constants.DataTypes;
|
||||
import com.mogo.module.common.utils.Trigonometric;
|
||||
import com.mogo.service.adas.entity.ADASRecognizedResult;
|
||||
|
||||
import java.util.ArrayList;
|
||||
import java.util.Iterator;
|
||||
@@ -21,18 +23,15 @@ import java.util.Map;
|
||||
import java.util.concurrent.ConcurrentHashMap;
|
||||
import java.util.concurrent.TimeUnit;
|
||||
|
||||
import static com.mogo.cloud.socket.entity.SocketDownDataHelper.FROM_ADAS;
|
||||
|
||||
public
|
||||
/**
|
||||
* @author congtaowang
|
||||
* @since 2020/10/28
|
||||
*
|
||||
* <p>
|
||||
* 绘制adas近景识别到的车辆
|
||||
*/
|
||||
class AdasRecognizedResultDrawer extends BaseDrawer {
|
||||
public class AdasRecognizedResultDrawer extends BaseDrawer {
|
||||
|
||||
private static final String TAG = "RecognizedResultDrawer";
|
||||
private static final String TAG = "AdasRecognizedResultDrawer";
|
||||
|
||||
private static volatile AdasRecognizedResultDrawer sInstance;
|
||||
|
||||
@@ -45,7 +44,7 @@ class AdasRecognizedResultDrawer extends BaseDrawer {
|
||||
super();
|
||||
}
|
||||
|
||||
private final Map<String, ADASRecognizedResult> mLastPositions = new ConcurrentHashMap<>();
|
||||
private final Map<String, TrafficData> mLastPositions = new ConcurrentHashMap<>();
|
||||
|
||||
public static AdasRecognizedResultDrawer getInstance() {
|
||||
if (sInstance == null) {
|
||||
@@ -76,7 +75,7 @@ class AdasRecognizedResultDrawer extends BaseDrawer {
|
||||
*
|
||||
* @param resultList adas感知融合数据
|
||||
*/
|
||||
public void renderAdasRecognizedResult(List<ADASRecognizedResult> resultList) {
|
||||
public void renderAdasRecognizedResult(List<TrafficData> resultList) {
|
||||
|
||||
final long start = System.nanoTime();
|
||||
if (resultList == null || resultList.isEmpty() || !DebugConfig.isUseAdasRecognize()) {
|
||||
@@ -91,18 +90,18 @@ class AdasRecognizedResultDrawer extends BaseDrawer {
|
||||
return;
|
||||
}
|
||||
|
||||
// List<ADASRecognizedResult> allDatumsList = new ArrayList<>();
|
||||
// List<TrafficData> allDatumsList = new ArrayList<>();
|
||||
// prepareData(resultList, allDatumsList);
|
||||
|
||||
Map<String, IMogoMarker> newAdasRecognizedMarkersCaches = new ConcurrentHashMap<>();
|
||||
List<ADASRecognizedResult> newDiffSet = new ArrayList<>();
|
||||
for (ADASRecognizedResult recognizedListResult : resultList) {
|
||||
List<TrafficData> newDiffSet = new ArrayList<>();
|
||||
for (TrafficData recognizedListResult : resultList) {
|
||||
|
||||
if (isUselessValue(recognizedListResult)) {
|
||||
continue;
|
||||
}
|
||||
// 复用之前存在的 marker
|
||||
String uniqueKey = recognizedListResult.uuid;
|
||||
String uniqueKey = recognizedListResult.getUuid();
|
||||
IMogoMarker marker = mMarkersCaches.remove(uniqueKey);
|
||||
if (marker != null && !marker.isDestroyed()) {
|
||||
// Log.d(TAG, "发现缓存marker id : " + uniqueKey);
|
||||
@@ -120,8 +119,8 @@ class AdasRecognizedResultDrawer extends BaseDrawer {
|
||||
// 复用过期 marker
|
||||
if (newDiffSetSize > 0) {
|
||||
for (int i = 0; i < newDiffSetSize; i++) {
|
||||
ADASRecognizedResult recognizedListResult = newDiffSet.get(i);
|
||||
String uniqueKey = recognizedListResult.uuid;
|
||||
TrafficData recognizedListResult = newDiffSet.get(i);
|
||||
String uniqueKey = recognizedListResult.getUuid();
|
||||
IMogoMarker marker = drawAdasRecognizedDataMarker(recognizedListResult);
|
||||
if (marker == null) {
|
||||
continue;
|
||||
@@ -142,7 +141,7 @@ class AdasRecognizedResultDrawer extends BaseDrawer {
|
||||
* @param in
|
||||
* @param out
|
||||
*/
|
||||
private void prepareData(List<ADASRecognizedResult> in, List<ADASRecognizedResult> out) {
|
||||
private void prepareData(List<TrafficData> in, List<TrafficData> out) {
|
||||
// foreCastPoint(in);
|
||||
out.addAll(in);
|
||||
}
|
||||
@@ -154,22 +153,22 @@ class AdasRecognizedResultDrawer extends BaseDrawer {
|
||||
*
|
||||
* @param in 数据源
|
||||
*/
|
||||
private void foreCastPoint(List<ADASRecognizedResult> in) {
|
||||
private void foreCastPoint(List<TrafficData> in) {
|
||||
if (Build.VERSION.SDK_INT >= Build.VERSION_CODES.N) {
|
||||
for (ADASRecognizedResult adasResult : in) {
|
||||
Log.d(FORECAST, "ready to foreCast current uuid : " + adasResult.uuid);
|
||||
long internal = getCurSatelliteTime() - adasResult.satelliteTime;
|
||||
for (TrafficData adasResult : in) {
|
||||
Log.d(FORECAST, "ready to foreCast current uuid : " + adasResult.getUuid());
|
||||
long internal = getCurSatelliteTime() - adasResult.getSatelliteTime();
|
||||
if (internal <= 0) {
|
||||
Log.d(FORECAST, "time internal less than 0 , uuid : " + adasResult.uuid);
|
||||
Log.d(FORECAST, "time internal less than 0 , uuid : " + adasResult.getUuid());
|
||||
continue;
|
||||
}
|
||||
long startTime = System.currentTimeMillis();
|
||||
// 预测点
|
||||
Log.d(FORECAST, "time internal : " + internal + " speed : " + adasResult.speed);
|
||||
double foreCastDistance = adasResult.speed * internal / 1000;
|
||||
Log.d(FORECAST, "time internal : " + internal + " speed : " + adasResult.getSpeed());
|
||||
double foreCastDistance = adasResult.getSpeed() * internal / 1000;
|
||||
Log.d(FORECAST, "foreCastDistance : " + foreCastDistance);
|
||||
MogoLatLng mogoLatLng = new MogoLatLng(adasResult.lat, adasResult.lon);
|
||||
MogoLatLng foreCastMogoLatLon = Trigonometric.getNewLocation(mogoLatLng, foreCastDistance, adasResult.heading);
|
||||
MogoLatLng mogoLatLng = new MogoLatLng(adasResult.getLat(), adasResult.getLon());
|
||||
MogoLatLng foreCastMogoLatLon = Trigonometric.getNewLocation(mogoLatLng, foreCastDistance, adasResult.getHeading());
|
||||
|
||||
// 计算与自车距离
|
||||
float distanceFromSelf = CoordinateUtils.calculateLineDistance(getCurCoordinates()[0], getCurCoordinates()[1]
|
||||
@@ -178,10 +177,10 @@ class AdasRecognizedResultDrawer extends BaseDrawer {
|
||||
long foreCastInternal = System.currentTimeMillis() - startTime;
|
||||
Log.d(FORECAST, "foreCastInternal :" + foreCastInternal); //todo 耗时1~2毫秒 需要测试是否由于补点算法造成
|
||||
|
||||
adasResult.lat = foreCastMogoLatLon.getLat();
|
||||
adasResult.lon = foreCastMogoLatLon.getLon();
|
||||
adasResult.satelliteTime = (getCurSatelliteTime() - foreCastInternal);
|
||||
adasResult.distance = distanceFromSelf;
|
||||
adasResult.setLat(foreCastMogoLatLon.getLat());
|
||||
adasResult.setLon(foreCastMogoLatLon.getLon());
|
||||
adasResult.setSatelliteTime((getCurSatelliteTime() - foreCastInternal));
|
||||
adasResult.setDistance(distanceFromSelf);
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -192,9 +191,9 @@ class AdasRecognizedResultDrawer extends BaseDrawer {
|
||||
* @param marker
|
||||
* @param recognizedListResult
|
||||
*/
|
||||
private void updateCacheMarkerRes(IMogoMarker marker, ADASRecognizedResult recognizedListResult) {
|
||||
private void updateCacheMarkerRes(IMogoMarker marker, TrafficData recognizedListResult) {
|
||||
String resIdVal;
|
||||
int resId = getModelRes(recognizedListResult.type);
|
||||
int resId = getModelRes(recognizedListResult.getType().getType());
|
||||
resIdVal = resId + "";
|
||||
String resName = mMarkerCachesResMd5Values.get(resIdVal);
|
||||
if (!TextUtils.isEmpty(resName)) {
|
||||
@@ -211,11 +210,11 @@ class AdasRecognizedResultDrawer extends BaseDrawer {
|
||||
if (mLastPositions.isEmpty()) {
|
||||
return;
|
||||
}
|
||||
Iterator<ADASRecognizedResult> iterator = mLastPositions.values().iterator();
|
||||
Iterator<TrafficData> iterator = mLastPositions.values().iterator();
|
||||
Log.d("EmArrow", "removeUselessLastRecord size : " + mLastPositions.size());
|
||||
while (iterator.hasNext()) {
|
||||
ADASRecognizedResult result = iterator.next();
|
||||
long internal = result.satelliteTime - getCurSatelliteTime();
|
||||
TrafficData result = iterator.next();
|
||||
long internal = result.getSatelliteTime() - getCurSatelliteTime();
|
||||
if (internal > 3000) { //防止帧率过低导致误删除上一个节点对象,从而出现跳跃现象
|
||||
iterator.remove();
|
||||
}
|
||||
@@ -225,33 +224,33 @@ class AdasRecognizedResultDrawer extends BaseDrawer {
|
||||
/**
|
||||
* 过滤无用数据
|
||||
*
|
||||
* @param recognizedListResult {@link ADASRecognizedResult}
|
||||
* @param recognizedListResult {@link TrafficData}
|
||||
* @return useless
|
||||
*/
|
||||
private boolean isUselessValue(ADASRecognizedResult recognizedListResult) {
|
||||
private boolean isUselessValue(TrafficData recognizedListResult) {
|
||||
if (recognizedListResult == null) {
|
||||
return true;
|
||||
}
|
||||
if (nonRenderType(recognizedListResult.type)) {
|
||||
if (nonRenderType(recognizedListResult.getType().getType())) {
|
||||
return true;
|
||||
}
|
||||
String uniqueKey = recognizedListResult.uuid;
|
||||
String uniqueKey = recognizedListResult.getUuid();
|
||||
return TextUtils.isEmpty(uniqueKey);
|
||||
}
|
||||
|
||||
/**
|
||||
* 绘制某个物体的一个数据
|
||||
*
|
||||
* @param recognizedListResult {@link ADASRecognizedResult}
|
||||
* @param recognizedListResult {@link TrafficData}
|
||||
* @param newAdasRecognizedMarkersCaches 缓存集合
|
||||
*/
|
||||
private void renderAdasOneFrame(IMogoMarker marker,
|
||||
String uniqueKey,
|
||||
ADASRecognizedResult recognizedListResult,
|
||||
TrafficData recognizedListResult,
|
||||
Map<String, IMogoMarker> newAdasRecognizedMarkersCaches) {
|
||||
final long start = System.nanoTime();
|
||||
// Log.d(TAG, "renderAdasOneFrame uuid : " + uniqueKey + " type : " + recognizedListResult.type + " heading : " + recognizedListResult.heading);
|
||||
ADASRecognizedResult lastPosition = mLastPositions.remove(uniqueKey);
|
||||
TrafficData lastPosition = mLastPositions.remove(uniqueKey);
|
||||
// 道路吸附
|
||||
// double lastLon = -1;
|
||||
// double lastLat = -1;
|
||||
@@ -269,18 +268,15 @@ class AdasRecognizedResultDrawer extends BaseDrawer {
|
||||
// Log.d(TAG, "使用缓存 id : " + uniqueKey);
|
||||
long interval = 45;
|
||||
if (lastPosition != null) {
|
||||
interval = computeAnimDuration(lastPosition.satelliteTime, recognizedListResult.satelliteTime);
|
||||
interval = computeAnimDuration(lastPosition.getSatelliteTime(), recognizedListResult.getSatelliteTime());
|
||||
}
|
||||
final MogoLatLng renderLoc = new MogoLatLng(recognizedListResult.lat, recognizedListResult.lon);
|
||||
final MogoLatLng renderLoc = new MogoLatLng(recognizedListResult.getLat(), recognizedListResult.getLon());
|
||||
long cost = TimeUnit.NANOSECONDS.toMillis(System.nanoTime() - start);
|
||||
Log.d("ADAS动画数据","cost : " + cost);
|
||||
Log.d("ADAS动画数据", "cost : " + cost);
|
||||
final long intervalRef = interval - cost;
|
||||
Log.d("ADAS动画数据", "最终赋值 : " + intervalRef + " 两帧间隔 : " + interval + " uuid : " + recognizedListResult.uuid);
|
||||
marker.addDynamicAnchorPosition(renderLoc, (float) recognizedListResult.heading, intervalRef);
|
||||
String carColor = recognizedListResult.color;
|
||||
if (TextUtils.isEmpty(carColor)) {
|
||||
carColor = getModelRenderColor(recognizedListResult.type, FROM_ADAS, recognizedListResult.drawlevel);
|
||||
}
|
||||
Log.d("ADAS动画数据", "最终赋值 : " + intervalRef + " 两帧间隔 : " + interval + " uuid : " + recognizedListResult.getUuid());
|
||||
marker.addDynamicAnchorPosition(renderLoc, (float) recognizedListResult.getHeading(), intervalRef);
|
||||
String carColor = getModelRenderColor(recognizedListResult.getType().getType(), FROM_ADAS, recognizedListResult.getThreatLevel());
|
||||
marker.setAnchorColor(carColor);
|
||||
|
||||
newAdasRecognizedMarkersCaches.put(uniqueKey, marker);
|
||||
@@ -302,22 +298,19 @@ class AdasRecognizedResultDrawer extends BaseDrawer {
|
||||
/**
|
||||
* 绘制 marker
|
||||
*
|
||||
* @param recognizedListResult {@link ADASRecognizedResult}
|
||||
* @param recognizedListResult {@link TrafficData}
|
||||
* @return {@link IMogoMarker}
|
||||
*/
|
||||
private IMogoMarker drawAdasRecognizedDataMarker(ADASRecognizedResult recognizedListResult) {
|
||||
private IMogoMarker drawAdasRecognizedDataMarker(TrafficData recognizedListResult) {
|
||||
long start = System.nanoTime();
|
||||
if (recognizedListResult == null) {
|
||||
return null;
|
||||
}
|
||||
|
||||
int resId = getModelRes(recognizedListResult.type);
|
||||
int resId = getModelRes(recognizedListResult.getType().getType());
|
||||
String resIdVal = resId + "";
|
||||
|
||||
String carColor = recognizedListResult.color;
|
||||
if (TextUtils.isEmpty(carColor)) {
|
||||
carColor = getModelRenderColor(recognizedListResult.type, FROM_ADAS, recognizedListResult.drawlevel);
|
||||
}
|
||||
String carColor = getModelRenderColor(recognizedListResult.getType().getType(), FROM_ADAS, recognizedListResult.getThreatLevel());
|
||||
MogoMarkerOptions options = new MogoMarkerOptions()
|
||||
.owner(DataTypes.TYPE_MARKER_ADAS)
|
||||
.anchor(0.5f, 0.5f)
|
||||
@@ -327,8 +320,8 @@ class AdasRecognizedResultDrawer extends BaseDrawer {
|
||||
.controlAngle(true)
|
||||
.resName(mMarkerCachesResMd5Values.get(resIdVal))
|
||||
.icon3DRes(resId)
|
||||
.rotate((float) recognizedListResult.heading)
|
||||
.position(new MogoLatLng(recognizedListResult.lat, recognizedListResult.lon));
|
||||
.rotate((float) recognizedListResult.getHeading())
|
||||
.position(new MogoLatLng(recognizedListResult.getLat(), recognizedListResult.getLon()));
|
||||
IMogoMarker marker = MogoApisHandler.getInstance().getApis().getMapServiceApi().getMarkerManager(mContext).addMarker(DataTypes.TYPE_MARKER_ADAS, options);
|
||||
cacheMarkerIconResMd5Val(resIdVal, marker);
|
||||
Log.d("ADAS数据延时", "创建一个新 marker cost : " + TimeUnit.NANOSECONDS.toMillis((System.nanoTime() - start)));
|
||||
|
||||
@@ -0,0 +1,252 @@
|
||||
package com.mogo.module.common.drawer;
|
||||
|
||||
import static com.mogo.cloud.socket.entity.SocketDownDataHelper.FROM_ADAS;
|
||||
|
||||
import android.text.TextUtils;
|
||||
import android.util.Log;
|
||||
|
||||
import com.mogo.commons.debug.DebugConfig;
|
||||
import com.mogo.eagle.core.data.map.MogoLatLng;
|
||||
import com.mogo.eagle.core.data.traffic.TrafficData;
|
||||
import com.mogo.map.marker.IMogoMarker;
|
||||
import com.mogo.map.marker.MogoMarkerOptions;
|
||||
import com.mogo.module.common.MogoApisHandler;
|
||||
import com.mogo.module.common.constants.DataTypes;
|
||||
|
||||
import java.util.ArrayList;
|
||||
import java.util.Iterator;
|
||||
import java.util.List;
|
||||
import java.util.Map;
|
||||
import java.util.concurrent.ConcurrentHashMap;
|
||||
import java.util.concurrent.TimeUnit;
|
||||
|
||||
/**
|
||||
* @author xiaoyuzhou
|
||||
* @date 2021/10/19 10:45 上午
|
||||
* 域控制器识别信息绘制
|
||||
*/
|
||||
public class IdentifyDataDrawer extends BaseDrawer {
|
||||
|
||||
private static final String TAG = "IdentifyDataDrawer";
|
||||
|
||||
private static volatile IdentifyDataDrawer sInstance;
|
||||
|
||||
/**
|
||||
* 上一帧数据的缓存
|
||||
*/
|
||||
private static Map<String, IMogoMarker> mMarkersCaches = new ConcurrentHashMap<>();
|
||||
|
||||
public IdentifyDataDrawer() {
|
||||
super();
|
||||
}
|
||||
|
||||
private final Map<String, TrafficData> mLastPositions = new ConcurrentHashMap<>();
|
||||
|
||||
public static IdentifyDataDrawer getInstance() {
|
||||
if (sInstance == null) {
|
||||
synchronized (IdentifyDataDrawer.class) {
|
||||
if (sInstance == null) {
|
||||
sInstance = new IdentifyDataDrawer();
|
||||
}
|
||||
}
|
||||
}
|
||||
return sInstance;
|
||||
}
|
||||
|
||||
public synchronized void release() {
|
||||
sInstance = null;
|
||||
}
|
||||
|
||||
/**
|
||||
* 渲染 adas 识别的数据
|
||||
*
|
||||
* @param resultList adas感知融合数据
|
||||
*/
|
||||
public void renderAdasRecognizedResult(List<TrafficData> resultList) {
|
||||
|
||||
final long start = System.nanoTime();
|
||||
if (resultList == null || resultList.isEmpty() || !DebugConfig.isUseAdasRecognize()) {
|
||||
clearOldMarker();
|
||||
Log.w("ADAS数据延时绘制", "resultList==>" + resultList + " DebugConfig.isUseAdasRecognize()==>" + DebugConfig.isUseAdasRecognize());
|
||||
return;
|
||||
}
|
||||
|
||||
if (!MogoApisHandler.getInstance().getApis().getStatusManagerApi().isVrMode()) {
|
||||
clearOldMarker();
|
||||
Log.w("ADAS数据延时绘制", "当前不是VR模式");
|
||||
return;
|
||||
}
|
||||
|
||||
|
||||
Map<String, IMogoMarker> newAdasRecognizedMarkersCaches = new ConcurrentHashMap<>();
|
||||
List<TrafficData> newDiffSet = new ArrayList<>();
|
||||
for (TrafficData recognizedListResult : resultList) {
|
||||
|
||||
if (isUselessValue(recognizedListResult)) {
|
||||
continue;
|
||||
}
|
||||
// 复用之前存在的 marker
|
||||
String uniqueKey = recognizedListResult.getUuid();
|
||||
IMogoMarker marker = mMarkersCaches.remove(uniqueKey);
|
||||
if (marker != null && !marker.isDestroyed()) {
|
||||
// Log.d(TAG, "发现缓存marker id : " + uniqueKey);
|
||||
updateCacheMarkerRes(marker, recognizedListResult);
|
||||
renderAdasOneFrame(marker, uniqueKey, recognizedListResult, newAdasRecognizedMarkersCaches);
|
||||
} else {
|
||||
// 新增添加进差集
|
||||
newDiffSet.add(recognizedListResult);
|
||||
}
|
||||
}
|
||||
removeUselessMarker(mMarkersCaches);
|
||||
removeUselessLastRecord();
|
||||
int newDiffSetSize = newDiffSet.size();
|
||||
// Log.d(TAG, "原数据量 : " + resultList.size() + " 新增marker数量 : " + newDiffSetSize);
|
||||
// 复用过期 marker
|
||||
if (newDiffSetSize > 0) {
|
||||
for (int i = 0; i < newDiffSetSize; i++) {
|
||||
TrafficData recognizedListResult = newDiffSet.get(i);
|
||||
String uniqueKey = recognizedListResult.getUuid();
|
||||
IMogoMarker marker = drawAdasRecognizedDataMarker(recognizedListResult);
|
||||
if (marker == null) {
|
||||
continue;
|
||||
}
|
||||
// Log.d(TAG, "新增marker id : " + uniqueKey);
|
||||
renderAdasOneFrame(marker, uniqueKey, recognizedListResult, newAdasRecognizedMarkersCaches);
|
||||
}
|
||||
}
|
||||
sendMessage(MSG_REMOVE_DIRTY_MARKERS, mMarkersCaches);
|
||||
mMarkersCaches.clear();
|
||||
mMarkersCaches = newAdasRecognizedMarkersCaches;
|
||||
Log.d("ADAS数据延时绘制", "render 接收数据 -> 处理结束 " + TimeUnit.NANOSECONDS.toMillis((System.nanoTime() - start)) + "ms");
|
||||
}
|
||||
|
||||
/**
|
||||
* todo 后面涉及到此类变化的数据均改动
|
||||
*
|
||||
* @param marker
|
||||
* @param recognizedListResult
|
||||
*/
|
||||
private void updateCacheMarkerRes(IMogoMarker marker, TrafficData recognizedListResult) {
|
||||
String resIdVal;
|
||||
int resId = getModelRes(recognizedListResult.getType().getType());
|
||||
resIdVal = resId + "";
|
||||
String resName = mMarkerCachesResMd5Values.get(resIdVal);
|
||||
if (!TextUtils.isEmpty(resName)) {
|
||||
if (!TextUtils.equals(resName, marker.getMarkerResName())) {
|
||||
marker.use3DResource(resName);
|
||||
}
|
||||
} else {
|
||||
resName = marker.use3DResource(resId);
|
||||
mMarkerCachesResMd5Values.put(resIdVal, resName);
|
||||
}
|
||||
}
|
||||
|
||||
private void removeUselessLastRecord() { // todo 最好重新设计一个数据结构,用于多线程数据过期失效的场景,参见redis数据过期
|
||||
if (mLastPositions.isEmpty()) {
|
||||
return;
|
||||
}
|
||||
Iterator<TrafficData> iterator = mLastPositions.values().iterator();
|
||||
Log.d("EmArrow", "removeUselessLastRecord size : " + mLastPositions.size());
|
||||
while (iterator.hasNext()) {
|
||||
TrafficData result = iterator.next();
|
||||
long internal = result.getSatelliteTime() - getCurSatelliteTime();
|
||||
if (internal > 3000) { //防止帧率过低导致误删除上一个节点对象,从而出现跳跃现象
|
||||
iterator.remove();
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
/**
|
||||
* 过滤无用数据
|
||||
*
|
||||
* @param recognizedListResult {@link TrafficData}
|
||||
* @return useless
|
||||
*/
|
||||
private boolean isUselessValue(TrafficData recognizedListResult) {
|
||||
if (recognizedListResult == null) {
|
||||
return true;
|
||||
}
|
||||
if (nonRenderType(recognizedListResult.getType().getType())) {
|
||||
return true;
|
||||
}
|
||||
String uniqueKey = recognizedListResult.getUuid();
|
||||
return TextUtils.isEmpty(uniqueKey);
|
||||
}
|
||||
|
||||
/**
|
||||
* 绘制某个物体的一个数据
|
||||
*
|
||||
* @param recognizedListResult {@link TrafficData}
|
||||
* @param newAdasRecognizedMarkersCaches 缓存集合
|
||||
*/
|
||||
private void renderAdasOneFrame(IMogoMarker marker,
|
||||
String uniqueKey,
|
||||
TrafficData recognizedListResult,
|
||||
Map<String, IMogoMarker> newAdasRecognizedMarkersCaches) {
|
||||
final long start = System.nanoTime();
|
||||
// Log.d(TAG, "renderAdasOneFrame uuid : " + uniqueKey + " type : " + recognizedListResult.type + " heading : " + recognizedListResult.heading);
|
||||
TrafficData lastPosition = mLastPositions.remove(uniqueKey);
|
||||
|
||||
mLastPositions.put(uniqueKey, recognizedListResult);
|
||||
// Log.d(TAG, "使用缓存 id : " + uniqueKey);
|
||||
long interval = 45;
|
||||
if (lastPosition != null) {
|
||||
interval = computeAnimDuration(lastPosition.getSatelliteTime(), recognizedListResult.getSatelliteTime());
|
||||
}
|
||||
final MogoLatLng renderLoc = new MogoLatLng(recognizedListResult.getLat(), recognizedListResult.getLon());
|
||||
long cost = TimeUnit.NANOSECONDS.toMillis(System.nanoTime() - start);
|
||||
Log.d("ADAS动画数据", "cost : " + cost);
|
||||
final long intervalRef = interval - cost;
|
||||
Log.d("ADAS动画数据", "最终赋值 : " + intervalRef + " 两帧间隔 : " + interval + " uuid : " + recognizedListResult.getUuid());
|
||||
marker.addDynamicAnchorPosition(renderLoc, (float) recognizedListResult.getHeading(), intervalRef);
|
||||
String carColor = getModelRenderColor(recognizedListResult.getType().getType(), FROM_ADAS, recognizedListResult.getThreatLevel());
|
||||
marker.setAnchorColor(carColor);
|
||||
|
||||
newAdasRecognizedMarkersCaches.put(uniqueKey, marker);
|
||||
Log.d("ADAS数据延时", "render 刷新一台车 cost : " + TimeUnit.NANOSECONDS.toMillis((System.nanoTime() - start)));
|
||||
}
|
||||
|
||||
/**
|
||||
* 绘制 marker
|
||||
*
|
||||
* @param recognizedListResult {@link TrafficData}
|
||||
* @return {@link IMogoMarker}
|
||||
*/
|
||||
private IMogoMarker drawAdasRecognizedDataMarker(TrafficData recognizedListResult) {
|
||||
long start = System.nanoTime();
|
||||
if (recognizedListResult == null) {
|
||||
return null;
|
||||
}
|
||||
|
||||
int resId = getModelRes(recognizedListResult.getType().getType());
|
||||
String resIdVal = resId + "";
|
||||
|
||||
String carColor = getModelRenderColor(recognizedListResult.getType().getType(), FROM_ADAS, recognizedListResult.getThreatLevel());
|
||||
MogoMarkerOptions options = new MogoMarkerOptions()
|
||||
.owner(DataTypes.TYPE_MARKER_ADAS)
|
||||
.anchor(0.5f, 0.5f)
|
||||
.set3DMode(true)
|
||||
.gps(true)
|
||||
.anchorColor(carColor)
|
||||
.controlAngle(true)
|
||||
.resName(mMarkerCachesResMd5Values.get(resIdVal))
|
||||
.icon3DRes(resId)
|
||||
.rotate((float) recognizedListResult.getHeading())
|
||||
.position(new MogoLatLng(recognizedListResult.getLat(), recognizedListResult.getLon()));
|
||||
IMogoMarker marker = MogoApisHandler.getInstance().getApis().getMapServiceApi().getMarkerManager(mContext).addMarker(DataTypes.TYPE_MARKER_ADAS, options);
|
||||
cacheMarkerIconResMd5Val(resIdVal, marker);
|
||||
Log.d("ADAS数据延时", "创建一个新 marker cost : " + TimeUnit.NANOSECONDS.toMillis((System.nanoTime() - start)));
|
||||
return marker;
|
||||
}
|
||||
|
||||
/**
|
||||
* 清除旧的 marker 数据
|
||||
*/
|
||||
public void clearOldMarker() {
|
||||
if (mMarkersCaches != null) {
|
||||
mMarkersCaches.clear();
|
||||
}
|
||||
mLastPositions.clear();
|
||||
sendMessage(MSG_REMOVE_DIRTY_MARKERS, DataTypes.TYPE_MARKER_ADAS);
|
||||
}
|
||||
}
|
||||
@@ -223,7 +223,7 @@ enum class EventTypeEnum(
|
||||
"车内标牌",
|
||||
poiTypeSrcVr=R.drawable.icon_warning_v2x_road_construction,
|
||||
content="车内标牌",
|
||||
tts="车内标牌"
|
||||
tts=""
|
||||
),
|
||||
TYPE_USECASE_ID_TJW(
|
||||
ObuConstants.USE_CASE_ID.TJW.toString(),
|
||||
|
||||
@@ -14,8 +14,8 @@ import com.mogo.module.common.MogoApisHandler;
|
||||
import com.mogo.module.extensions.navi.VrModeNavInfoView;
|
||||
import com.mogo.realtime.socket.IMogoCloudOnMsgListener;
|
||||
import com.mogo.service.adas.IMogoAdasWarnMessageCallback;
|
||||
import com.mogo.service.adas.MogoADASWarnType;
|
||||
import com.mogo.service.adas.entity.ADASWarnMessage;
|
||||
import com.mogo.eagle.core.data.autopilot.MogoADASWarnType;
|
||||
import com.mogo.eagle.core.data.autopilot.AutopilotWarnMessage;
|
||||
import com.mogo.utils.logger.Logger;
|
||||
|
||||
import org.json.JSONArray;
|
||||
@@ -92,7 +92,7 @@ public class AdasNoticeHelper implements IMogoAdasWarnMessageCallback, IMogoLoca
|
||||
}
|
||||
|
||||
@Override
|
||||
public void onReceiveData(ADASWarnMessage msg) {
|
||||
public void onReceiveData(AutopilotWarnMessage msg) {
|
||||
Logger.d(TAG, "收到adas warn message, isVrMode: " + isVrMode + " msg: " + msg);
|
||||
if (!isVrMode) {
|
||||
return;
|
||||
|
||||
@@ -253,6 +253,7 @@ public class MainActivity extends MvpActivity<MainView, MainPresenter> implement
|
||||
loadContainerModules();
|
||||
MogoModulesManager.getInstance().loadModules();
|
||||
MogoModulesManager.getInstance().loadFunctionModules();
|
||||
MogoModulesManager.getInstance().loadFunctionModulesServer();
|
||||
mPresenter.delayOperations();
|
||||
|
||||
// 启动一些基本的服务:定位等
|
||||
|
||||
@@ -1,5 +1,5 @@
|
||||
#-----ServiceModule-----
|
||||
-keep class com.mogo.module.service.carinfo.CarStateInfo{*;}
|
||||
-keep class com.mogo.eagle.core.data.autopilot.AutopilotCarStateInfo{*;}
|
||||
-keep class com.mogo.module.service.launchercard.LauncherCardRefreshType{*;}
|
||||
-keep class com.mogo.module.service.network.bean.*{*;}
|
||||
-keep class com.mogo.module.service.network.RefreshBody{*;}
|
||||
|
||||
@@ -21,7 +21,7 @@
|
||||
#-renamesourcefileattribute SourceFile
|
||||
|
||||
#-----ServiceModule-----
|
||||
-keep class com.mogo.module.service.carinfo.CarStateInfo.*{*;}
|
||||
-keep class com.mogo.eagle.core.data.autopilot.AutopilotCarStateInfo.*{*;}
|
||||
-keep class com.mogo.module.service.network.RefreshBody.*{*;}
|
||||
-keep class com.mogo.module.service.network.bean.DemoUserInfoEntity.*{*;}
|
||||
-keep interface com.mogo.module.service.intent.IntentHandler
|
||||
|
||||
@@ -53,7 +53,7 @@ import com.mogo.module.service.ttsConfig.TtsConfigModleData;
|
||||
import com.mogo.realtime.api.MoGoAiCloudRealTime;
|
||||
import com.mogo.service.adas.IMogoADASController;
|
||||
import com.mogo.service.adas.IMogoAdasCarDataCallback;
|
||||
import com.mogo.service.adas.entity.ADASCarStateInfo;
|
||||
import com.mogo.eagle.core.data.autopilot.AutopilotCarStateInfo;
|
||||
import com.mogo.service.fragmentmanager.FragmentStackTransactionListener;
|
||||
import com.mogo.service.fragmentmanager.IMogoFragmentManager;
|
||||
import com.mogo.service.intent.IMogoIntentListener;
|
||||
@@ -970,7 +970,7 @@ public class MogoServices implements IMogoMapListener,
|
||||
}
|
||||
|
||||
@Override
|
||||
public void onAdasCarDataCallback( ADASCarStateInfo stateInfo ) {
|
||||
public void onAdasCarDataCallback( AutopilotCarStateInfo stateInfo ) {
|
||||
|
||||
if(TimeDelayUploadManager.getInstance().isMock()){ //模拟数据时,不更新由工控机传输的自车位置
|
||||
return;
|
||||
|
||||
@@ -2,7 +2,7 @@ package com.mogo.module.service.autopilot;
|
||||
|
||||
import com.mogo.commons.AbsMogoApplication;
|
||||
import com.mogo.module.common.MogoApisHandler;
|
||||
import com.mogo.eagle.core.data.autopilot.AutoPilotControlParameters;
|
||||
import com.mogo.eagle.core.data.autopilot.AutopilotControlParameters;
|
||||
import com.mogo.service.cloud.socket.IMogoOnMessageListener;
|
||||
import com.mogo.service.cloud.socket.IMogoSocketManager;
|
||||
import com.mogo.utils.logger.Logger;
|
||||
@@ -23,14 +23,14 @@ class AutoPilotRemoteController {
|
||||
|
||||
private IMogoSocketManager mMogoSocketManager;
|
||||
|
||||
private IMogoOnMessageListener<AutoPilotControlParameters> mParametersListener = new IMogoOnMessageListener<AutoPilotControlParameters>() {
|
||||
private IMogoOnMessageListener<AutopilotControlParameters> mParametersListener = new IMogoOnMessageListener<AutopilotControlParameters>() {
|
||||
@Override
|
||||
public Class<AutoPilotControlParameters> target() {
|
||||
return AutoPilotControlParameters.class;
|
||||
public Class<AutopilotControlParameters> target() {
|
||||
return AutopilotControlParameters.class;
|
||||
}
|
||||
|
||||
@Override
|
||||
public void onMsgReceived( AutoPilotControlParameters obj ) {
|
||||
public void onMsgReceived( AutopilotControlParameters obj ) {
|
||||
if ( obj == null ) {
|
||||
Logger.e( TAG, "远端控制参数为null", new NullPointerException() );
|
||||
return;
|
||||
|
||||
@@ -1,142 +0,0 @@
|
||||
package com.mogo.module.service.carinfo;
|
||||
|
||||
import java.io.Serializable;
|
||||
|
||||
/**
|
||||
* @author nie yunlong
|
||||
* @des 车辆状态
|
||||
* @date 2020/3/12
|
||||
*/
|
||||
public class CarStateInfo implements Serializable {
|
||||
|
||||
|
||||
/**
|
||||
* action : “state”
|
||||
* values : {"lon":116.8,"lat":39.4,"alt":22.3,"heading":87.5,"acceleration":0.5,"yaw_rate":0.3}
|
||||
*/
|
||||
|
||||
private String action;
|
||||
private ValuesBean values;
|
||||
|
||||
public String getAction() {
|
||||
return action;
|
||||
}
|
||||
|
||||
public void setAction(String action) {
|
||||
this.action = action;
|
||||
}
|
||||
|
||||
public ValuesBean getValues() {
|
||||
return values;
|
||||
}
|
||||
|
||||
public void setValues(ValuesBean values) {
|
||||
this.values = values;
|
||||
}
|
||||
|
||||
public static class ValuesBean {
|
||||
/**
|
||||
* lon : 116.8
|
||||
* lat : 39.4
|
||||
* alt : 22.3
|
||||
* heading : 87.5
|
||||
* acceleration : 0.5
|
||||
* yaw_rate : 0.3
|
||||
*/
|
||||
|
||||
private double lon;
|
||||
private double lat;
|
||||
private double alt;
|
||||
private double heading;
|
||||
private double acceleration;
|
||||
private double yaw_rate;
|
||||
//惯导车速 m/s
|
||||
private float gnss_speed;
|
||||
//gps 时间
|
||||
private String satelliteTime;
|
||||
|
||||
public float getGnss_speed() {
|
||||
return gnss_speed;
|
||||
}
|
||||
|
||||
public void setGnss_speed( float gnss_speed ) {
|
||||
this.gnss_speed = gnss_speed;
|
||||
}
|
||||
|
||||
public String getSatelliteTime() {
|
||||
return satelliteTime;
|
||||
}
|
||||
|
||||
public void setSatelliteTime( String satelliteTime ) {
|
||||
this.satelliteTime = satelliteTime;
|
||||
}
|
||||
|
||||
public double getLon() {
|
||||
return lon;
|
||||
}
|
||||
|
||||
public void setLon(double lon) {
|
||||
this.lon = lon;
|
||||
}
|
||||
|
||||
public double getLat() {
|
||||
return lat;
|
||||
}
|
||||
|
||||
public void setLat(double lat) {
|
||||
this.lat = lat;
|
||||
}
|
||||
|
||||
public double getAlt() {
|
||||
return alt;
|
||||
}
|
||||
|
||||
public void setAlt(double alt) {
|
||||
this.alt = alt;
|
||||
}
|
||||
|
||||
public double getHeading() {
|
||||
return heading;
|
||||
}
|
||||
|
||||
public void setHeading(double heading) {
|
||||
this.heading = heading;
|
||||
}
|
||||
|
||||
public double getAcceleration() {
|
||||
return acceleration;
|
||||
}
|
||||
|
||||
public void setAcceleration(double acceleration) {
|
||||
this.acceleration = acceleration;
|
||||
}
|
||||
|
||||
public double getYaw_rate() {
|
||||
return yaw_rate;
|
||||
}
|
||||
|
||||
public void setYaw_rate(double yaw_rate) {
|
||||
this.yaw_rate = yaw_rate;
|
||||
}
|
||||
|
||||
@Override
|
||||
public String toString() {
|
||||
return "ValuesBean{" +
|
||||
"lon=" + lon +
|
||||
", lat=" + lat +
|
||||
", alt=" + alt +
|
||||
", heading=" + heading +
|
||||
", acceleration=" + acceleration +
|
||||
", yaw_rate=" + yaw_rate +
|
||||
'}';
|
||||
}
|
||||
}
|
||||
|
||||
@Override
|
||||
public String toString() {
|
||||
return "CarStateInfo{" +
|
||||
"action='" + action + '\'' +
|
||||
", values=" + values +
|
||||
'}';
|
||||
}
|
||||
}
|
||||
@@ -10,8 +10,8 @@ import android.os.Handler;
|
||||
import android.os.Message;
|
||||
|
||||
import com.mogo.cloud.commons.utils.CoordinateUtils;
|
||||
import com.mogo.eagle.core.data.autopilot.AutoPilotStationInfo;
|
||||
import com.mogo.eagle.core.data.autopilot.AutoPilotControlParameters;
|
||||
import com.mogo.eagle.core.data.autopilot.AutopilotStationInfo;
|
||||
import com.mogo.eagle.core.data.autopilot.AutopilotControlParameters;
|
||||
import com.mogo.eagle.core.data.map.MogoLatLng;
|
||||
import com.mogo.eagle.core.function.api.hmi.autopilot.IMoGoCheckAutoPilotBtnListener;
|
||||
import com.mogo.eagle.core.function.call.hmi.CallerHmiListenerManager;
|
||||
@@ -137,17 +137,17 @@ public class DispatchAutoPilotManager implements IMogoOnMessageListener<Dispatch
|
||||
}
|
||||
|
||||
private void startAutoPilot() {
|
||||
AutoPilotControlParameters currentAutopilot = new AutoPilotControlParameters();
|
||||
AutopilotControlParameters currentAutopilot = new AutopilotControlParameters();
|
||||
currentAutopilot.isSpeakVoice = false;
|
||||
List<AutoPilotControlParameters.AutoPilotLonLat> wayLatLon = new ArrayList<>();
|
||||
List<AutopilotControlParameters.AutoPilotLonLat> wayLatLon = new ArrayList<>();
|
||||
if (receiverBean!=null && receiverBean.getStopsList()!= null){
|
||||
for (MogoLatLng mogoLatLng : receiverBean.getStopsList()) {
|
||||
wayLatLon.add(new AutoPilotControlParameters.AutoPilotLonLat(mogoLatLng.lat, mogoLatLng.lon));
|
||||
wayLatLon.add(new AutopilotControlParameters.AutoPilotLonLat(mogoLatLng.lat, mogoLatLng.lon));
|
||||
}
|
||||
}
|
||||
currentAutopilot.wayLatLons = wayLatLon;
|
||||
currentAutopilot.startLatLon = new AutoPilotControlParameters.AutoPilotLonLat(receiverBean.getStartLat(), receiverBean.getStartLon());
|
||||
currentAutopilot.endLatLon = new AutoPilotControlParameters.AutoPilotLonLat(receiverBean.getEndLat(), receiverBean.getEndLon());
|
||||
currentAutopilot.startLatLon = new AutopilotControlParameters.AutoPilotLonLat(receiverBean.getStartLat(), receiverBean.getStartLon());
|
||||
currentAutopilot.endLatLon = new AutopilotControlParameters.AutoPilotLonLat(receiverBean.getEndLat(), receiverBean.getEndLon());
|
||||
currentAutopilot.vehicleType = 10;
|
||||
Logger.d(TAG, "开启自动驾驶====" + currentAutopilot);
|
||||
mApis.getAdasControllerApi().aiCloudToAdasData(currentAutopilot);
|
||||
@@ -191,10 +191,10 @@ public class DispatchAutoPilotManager implements IMogoOnMessageListener<Dispatch
|
||||
}
|
||||
|
||||
@Override
|
||||
public void onArriveAt(AutoPilotStationInfo data) {
|
||||
public void onArriveAt(AutopilotStationInfo data) {
|
||||
Logger.d(TAG, "onArriveAt data : " + data.toString());
|
||||
double endLat = data.lat;
|
||||
double endLon = data.lon;
|
||||
double endLat = data.getLat();
|
||||
double endLon = data.getLon();
|
||||
// 计算是不是到了终点
|
||||
float distanceFromSelf = CoordinateUtils.calculateLineDistance(receiverBean.getEndLon(), receiverBean.getEndLat()
|
||||
, endLon, endLat);
|
||||
|
||||
@@ -1,41 +0,0 @@
|
||||
package com.mogo.module.service.dispatch.bean;
|
||||
|
||||
/**
|
||||
* Created by XuYong on 2021/5/28 16:12
|
||||
*/
|
||||
public class AutonomousDriveStatusBean {
|
||||
|
||||
private String sn;
|
||||
private int status;
|
||||
private float vehicleSpeed;
|
||||
|
||||
public AutonomousDriveStatusBean(String sn, int status, float vehicleSpeed) {
|
||||
this.sn = sn;
|
||||
this.status = status;
|
||||
this.vehicleSpeed = vehicleSpeed;
|
||||
}
|
||||
|
||||
public String getSn() {
|
||||
return sn;
|
||||
}
|
||||
|
||||
public void setSn(String sn) {
|
||||
this.sn = sn;
|
||||
}
|
||||
|
||||
public int getStatus() {
|
||||
return status;
|
||||
}
|
||||
|
||||
public void setStatus(int status) {
|
||||
this.status = status;
|
||||
}
|
||||
|
||||
public float getVehicleSpeed() {
|
||||
return vehicleSpeed;
|
||||
}
|
||||
|
||||
public void setVehicleSpeed(float vehicleSpeed) {
|
||||
this.vehicleSpeed = vehicleSpeed;
|
||||
}
|
||||
}
|
||||
@@ -1,38 +0,0 @@
|
||||
package com.mogo.module.service.dispatch.bean;
|
||||
|
||||
import com.mogo.module.service.dispatch.model.DispatchResult;
|
||||
|
||||
public class DispatchData {
|
||||
|
||||
private String action;
|
||||
private DispatchResult result;
|
||||
|
||||
public DispatchData(String action, DispatchResult result) {
|
||||
this.action = action;
|
||||
this.result = result;
|
||||
}
|
||||
|
||||
public String getAction() {
|
||||
return action;
|
||||
}
|
||||
|
||||
public void setAction(String action) {
|
||||
this.action = action;
|
||||
}
|
||||
|
||||
public DispatchResult getResult() {
|
||||
return result;
|
||||
}
|
||||
|
||||
public void setResult(DispatchResult result) {
|
||||
this.result = result;
|
||||
}
|
||||
|
||||
@Override
|
||||
public String toString() {
|
||||
return "DispatchData{" +
|
||||
"action='" + action + '\'' +
|
||||
", result=" + result +
|
||||
'}';
|
||||
}
|
||||
}
|
||||
@@ -1,40 +0,0 @@
|
||||
package com.mogo.module.service.dispatch.bean;
|
||||
|
||||
/**
|
||||
* Created by XuYong on 2021/5/31 16:24
|
||||
*/
|
||||
public class ReportSiteBean {
|
||||
private String sn;
|
||||
private double lon;
|
||||
private double lat;
|
||||
|
||||
public ReportSiteBean(String sn, double lon, double lat) {
|
||||
this.sn = sn;
|
||||
this.lon = lon;
|
||||
this.lat = lat;
|
||||
}
|
||||
|
||||
public String getSn() {
|
||||
return sn;
|
||||
}
|
||||
|
||||
public void setSn(String sn) {
|
||||
this.sn = sn;
|
||||
}
|
||||
|
||||
public double getLon() {
|
||||
return lon;
|
||||
}
|
||||
|
||||
public void setLon(double lon) {
|
||||
this.lon = lon;
|
||||
}
|
||||
|
||||
public double getLat() {
|
||||
return lat;
|
||||
}
|
||||
|
||||
public void setLat(double lat) {
|
||||
this.lat = lat;
|
||||
}
|
||||
}
|
||||
@@ -1,6 +1,8 @@
|
||||
package com.mogo.module.service.dispatch.bean;
|
||||
|
||||
|
||||
import com.mogo.eagle.core.data.autopilot.AutopilotStatus;
|
||||
|
||||
/**
|
||||
* 上报自动驾驶规划的路径
|
||||
*/
|
||||
|
||||
@@ -1,39 +0,0 @@
|
||||
package com.mogo.module.service.dispatch.model;
|
||||
|
||||
import com.mogo.module.service.dispatch.bean.EndLatLon;
|
||||
import com.mogo.module.service.dispatch.bean.StartLatLon;
|
||||
|
||||
public class DispatchResult {
|
||||
|
||||
private StartLatLon startLatLon;
|
||||
private EndLatLon endLatLon;
|
||||
|
||||
public DispatchResult(StartLatLon startLatLon, EndLatLon endLatLon) {
|
||||
this.startLatLon = startLatLon;
|
||||
this.endLatLon = endLatLon;
|
||||
}
|
||||
|
||||
public StartLatLon getStartLatLon() {
|
||||
return startLatLon;
|
||||
}
|
||||
|
||||
public void setStartLatLon(StartLatLon startLatLon) {
|
||||
this.startLatLon = startLatLon;
|
||||
}
|
||||
|
||||
public EndLatLon getEndLatLon() {
|
||||
return endLatLon;
|
||||
}
|
||||
|
||||
public void setEndLatLon(EndLatLon endLatLon) {
|
||||
this.endLatLon = endLatLon;
|
||||
}
|
||||
|
||||
@Override
|
||||
public String toString() {
|
||||
return "DispatchResult{" +
|
||||
"startLatLon=" + startLatLon +
|
||||
", endLatLon=" + endLatLon +
|
||||
'}';
|
||||
}
|
||||
}
|
||||
@@ -6,9 +6,9 @@ import static com.mogo.module.common.constants.HostConst.DATA_SERVICE_HOST;
|
||||
import com.mogo.cloud.passport.MoGoAiCloudClientConfig;
|
||||
import com.mogo.commons.data.BaseData;
|
||||
import com.mogo.commons.network.SubscribeImpl;
|
||||
import com.mogo.eagle.core.data.autopilot.AutopilotStatus;
|
||||
import com.mogo.module.common.MogoApisHandler;
|
||||
import com.mogo.module.service.dispatch.bean.AutopilotRoute;
|
||||
import com.mogo.module.service.dispatch.bean.AutopilotStatus;
|
||||
import com.mogo.eagle.core.data.autopilot.AutopilotRouteInfo;
|
||||
import com.mogo.module.service.dispatch.bean.ReportDispatchResult;
|
||||
import com.mogo.module.service.dispatch.bean.ReportedRoute;
|
||||
import com.mogo.utils.logger.Logger;
|
||||
@@ -93,7 +93,7 @@ public class DispatchServiceModel {
|
||||
*
|
||||
* @param list 路线集合
|
||||
*/
|
||||
public void uploadAutopilotRoute(List<AutopilotRoute.RouteModels> list) {
|
||||
public void uploadAutopilotRoute(List<AutopilotRouteInfo.RouteModels> list) {
|
||||
String sn = MoGoAiCloudClientConfig.getInstance().getSn();
|
||||
ReportedRoute reportedRoute = new ReportedRoute(sn, GsonUtil.jsonFromObject(list));
|
||||
Map<String, Object> map = new HashMap<>();
|
||||
|
||||
@@ -4,24 +4,23 @@ import android.content.Context;
|
||||
import android.content.Intent;
|
||||
import android.text.TextUtils;
|
||||
|
||||
import com.mogo.eagle.core.data.autopilot.AutopilotCarStateInfo;
|
||||
import com.mogo.module.common.datacenter.SnapshotLocationDataCenter;
|
||||
import com.mogo.module.service.MarkerServiceHandler;
|
||||
import com.mogo.module.service.ServiceConst;
|
||||
import com.mogo.module.service.carinfo.CarStateInfo;
|
||||
import com.mogo.module.service.receiver.MogoReceiver;
|
||||
import com.mogo.utils.logger.Logger;
|
||||
import com.mogo.utils.network.utils.GsonUtil;
|
||||
|
||||
import org.json.JSONObject;
|
||||
|
||||
public
|
||||
/**
|
||||
* @author congtaowang
|
||||
* @since 2020/6/5
|
||||
* <p>
|
||||
* 描述
|
||||
*/
|
||||
class ADASStatusIntentHandler implements IntentHandler {
|
||||
public class ADASStatusIntentHandler implements IntentHandler {
|
||||
|
||||
private static volatile ADASStatusIntentHandler sInstance;
|
||||
|
||||
@@ -29,9 +28,9 @@ class ADASStatusIntentHandler implements IntentHandler {
|
||||
}
|
||||
|
||||
public static ADASStatusIntentHandler getInstance() {
|
||||
if ( sInstance == null ) {
|
||||
synchronized ( ADASStatusIntentHandler.class ) {
|
||||
if ( sInstance == null ) {
|
||||
if (sInstance == null) {
|
||||
synchronized (ADASStatusIntentHandler.class) {
|
||||
if (sInstance == null) {
|
||||
sInstance = new ADASStatusIntentHandler();
|
||||
}
|
||||
}
|
||||
@@ -44,38 +43,40 @@ class ADASStatusIntentHandler implements IntentHandler {
|
||||
}
|
||||
|
||||
@Override
|
||||
public void handle( Context context, Intent intent ) {
|
||||
if ( intent == null ) {
|
||||
public void handle(Context context, Intent intent) {
|
||||
if (intent == null) {
|
||||
return;
|
||||
}
|
||||
|
||||
if ( MogoReceiver.ACTIION_ADAS.equals( intent.getAction() ) ) {
|
||||
if (MogoReceiver.ACTIION_ADAS.equals(intent.getAction())) {
|
||||
|
||||
int status = intent.getIntExtra( MogoReceiver.PARAM_ADAS_STATUS, 0 );
|
||||
MarkerServiceHandler.getMogoStatusManager().setADASUIShow( ServiceConst.TYPE, status == 1 );
|
||||
int status = intent.getIntExtra(MogoReceiver.PARAM_ADAS_STATUS, 0);
|
||||
MarkerServiceHandler.getMogoStatusManager().setADASUIShow(ServiceConst.TYPE, status == 1);
|
||||
}
|
||||
// 由于adas可能调高此处的调用频率,存在anr风险,且此处没有作用,所以暂时注释掉
|
||||
else {
|
||||
String msg = intent.getStringExtra( "adasMsg" );
|
||||
if ( TextUtils.isEmpty( msg ) ) {
|
||||
String msg = intent.getStringExtra("adasMsg");
|
||||
if (TextUtils.isEmpty(msg)) {
|
||||
return;
|
||||
}
|
||||
Logger.d( "ADASCOOR", msg );
|
||||
CarStateInfo stateInfo = GsonUtil.objectFromJson( msg, CarStateInfo.class );
|
||||
if ( stateInfo != null && stateInfo.getValues() != null ) {
|
||||
Logger.d("ADAS COOR", msg);
|
||||
|
||||
AutopilotCarStateInfo stateInfo = GsonUtil.objectFromJson(msg, AutopilotCarStateInfo.class);
|
||||
if (stateInfo != null && stateInfo.getValues() != null) {
|
||||
JSONObject data = new JSONObject();
|
||||
try {
|
||||
data.putOpt( "lon", stateInfo.getValues().getLon() );
|
||||
data.putOpt( "lat", stateInfo.getValues().getLat() );
|
||||
data.putOpt( "alt", stateInfo.getValues().getAlt() );
|
||||
data.putOpt( "speed", stateInfo.getValues().getGnss_speed() );
|
||||
data.putOpt( "satelliteTime", stateInfo.getValues().getSatelliteTime() );
|
||||
data.putOpt( "heading", stateInfo.getValues().getHeading() );
|
||||
data.putOpt( "acceleration", stateInfo.getValues().getAcceleration() );
|
||||
data.putOpt( "yawRate", stateInfo.getValues().getYaw_rate() );
|
||||
MarkerServiceHandler.getApis().getMapServiceApi().getMapUIController().syncLocation2Map( data );
|
||||
SnapshotLocationDataCenter.getInstance().syncAdasLocationInfo( data );
|
||||
} catch ( Exception e ) {
|
||||
data.putOpt("lon", stateInfo.getValues().getLon());
|
||||
data.putOpt("lat", stateInfo.getValues().getLat());
|
||||
data.putOpt("alt", stateInfo.getValues().getAlt());
|
||||
data.putOpt("speed", stateInfo.getValues().getGnss_speed());
|
||||
data.putOpt("satelliteTime", stateInfo.getValues().getSatelliteTime());
|
||||
data.putOpt("heading", stateInfo.getValues().getHeading());
|
||||
data.putOpt("acceleration", stateInfo.getValues().getAcceleration());
|
||||
data.putOpt("yawRate", stateInfo.getValues().getYaw_rate());
|
||||
|
||||
MarkerServiceHandler.getApis().getMapServiceApi().getMapUIController().syncLocation2Map(data);
|
||||
SnapshotLocationDataCenter.getInstance().syncAdasLocationInfo(data);
|
||||
} catch (Exception e) {
|
||||
e.printStackTrace();
|
||||
}
|
||||
}
|
||||
|
||||
@@ -18,8 +18,9 @@ import com.mogo.cloud.socket.entity.SocketDownDataHelper;
|
||||
import com.mogo.commons.AbsMogoApplication;
|
||||
import com.mogo.commons.debug.DebugConfig;
|
||||
import com.mogo.commons.voice.AIAssist;
|
||||
import com.mogo.eagle.core.data.autopilot.AutoPilotControlParameters;
|
||||
import com.mogo.eagle.core.data.autopilot.AutopilotControlParameters;
|
||||
import com.mogo.eagle.core.data.map.MogoLatLng;
|
||||
import com.mogo.eagle.core.data.traffic.TrafficData;
|
||||
import com.mogo.map.marker.IMogoMarker;
|
||||
import com.mogo.map.marker.MogoMarkerOptions;
|
||||
import com.mogo.map.navi.IMogoNaviListener;
|
||||
@@ -39,8 +40,7 @@ import com.mogo.module.service.MarkerServiceHandler;
|
||||
import com.mogo.module.service.R;
|
||||
import com.mogo.module.service.status.EnvStatusManager;
|
||||
import com.mogo.module.service.timedelay.TimeDelayUploadManager;
|
||||
import com.mogo.service.adas.entity.ADASCarStateInfo;
|
||||
import com.mogo.service.adas.entity.ADASRecognizedResult;
|
||||
import com.mogo.eagle.core.data.autopilot.AutopilotCarStateInfo;
|
||||
import com.mogo.service.entrance.ButtonIndex;
|
||||
import com.mogo.utils.TipToast;
|
||||
import com.mogo.utils.WorkThreadHandler;
|
||||
@@ -492,17 +492,17 @@ public class MockIntentHandler implements IntentHandler {
|
||||
InputStream is = context.getAssets().open("coors.json");
|
||||
BufferedReader br = new BufferedReader(new InputStreamReader(is));
|
||||
String line = "";
|
||||
List<ADASCarStateInfo> vals = new ArrayList<>();
|
||||
List<AutopilotCarStateInfo> vals = new ArrayList<>();
|
||||
while ((line = br.readLine()) != null) {
|
||||
String[] json = line.split(" - ");
|
||||
long time = Long.parseLong(json[0]);
|
||||
ADASCarStateInfo si = GsonUtil.objectFromJson(json[1], ADASCarStateInfo.class);
|
||||
AutopilotCarStateInfo si = GsonUtil.objectFromJson(json[1], AutopilotCarStateInfo.class);
|
||||
// si.getValues().setSatelliteTime( time + "" );
|
||||
vals.add(si);
|
||||
}
|
||||
long interval = -1;
|
||||
ADASCarStateInfo last = null;
|
||||
for (ADASCarStateInfo val : vals) {
|
||||
AutopilotCarStateInfo last = null;
|
||||
for (AutopilotCarStateInfo val : vals) {
|
||||
if (last == null) {
|
||||
interval = 0;
|
||||
} else {
|
||||
@@ -523,10 +523,10 @@ public class MockIntentHandler implements IntentHandler {
|
||||
.onAutopilotArriveLike(intent.getIntExtra("type", 8));
|
||||
break;
|
||||
case 44:// 控制自动驾驶
|
||||
AutoPilotControlParameters parameters = new AutoPilotControlParameters();
|
||||
AutopilotControlParameters parameters = new AutopilotControlParameters();
|
||||
parameters.vehicleType = 9;
|
||||
parameters.startLatLon = new AutoPilotControlParameters.AutoPilotLonLat(40.1690522746, 116.567374558);
|
||||
parameters.endLatLon = new AutoPilotControlParameters.AutoPilotLonLat(40.1651999405, 116.567217441);
|
||||
parameters.startLatLon = new AutopilotControlParameters.AutoPilotLonLat(40.1690522746, 116.567374558);
|
||||
parameters.endLatLon = new AutopilotControlParameters.AutoPilotLonLat(40.1651999405, 116.567217441);
|
||||
MogoApisHandler.getInstance()
|
||||
.getApis()
|
||||
.getAdasControllerApi()
|
||||
@@ -664,7 +664,7 @@ public class MockIntentHandler implements IntentHandler {
|
||||
}
|
||||
|
||||
|
||||
public void onAdasCarDataCallback(ADASCarStateInfo stateInfo) {
|
||||
public void onAdasCarDataCallback(AutopilotCarStateInfo stateInfo) {
|
||||
if (stateInfo != null && stateInfo.getValues() != null) {
|
||||
JSONObject data = new JSONObject();
|
||||
try {
|
||||
@@ -905,10 +905,10 @@ public class MockIntentHandler implements IntentHandler {
|
||||
}
|
||||
}
|
||||
|
||||
List<ADASRecognizedResult> allList = new ArrayList<>();
|
||||
List<TrafficData> allList = new ArrayList<>();
|
||||
for (BufferedReader reader : readers) {
|
||||
String line = reader.readLine();
|
||||
ADASRecognizedResult adasRecognizedResult = GsonUtil.objectFromJson(line, ADASRecognizedResult.class);
|
||||
TrafficData adasRecognizedResult = GsonUtil.objectFromJson(line, TrafficData.class);
|
||||
if (adasRecognizedResult != null) {
|
||||
allList.add(adasRecognizedResult);
|
||||
}
|
||||
@@ -932,10 +932,10 @@ public class MockIntentHandler implements IntentHandler {
|
||||
}
|
||||
}
|
||||
|
||||
List<ADASRecognizedResult> allList = new ArrayList<>();
|
||||
List<TrafficData> allList = new ArrayList<>();
|
||||
for (BufferedReader reader : readers2) {
|
||||
String line = reader.readLine();
|
||||
ADASRecognizedResult adasRecognizedResult = GsonUtil.objectFromJson(line, ADASRecognizedResult.class);
|
||||
TrafficData adasRecognizedResult = GsonUtil.objectFromJson(line, TrafficData.class);
|
||||
if (adasRecognizedResult != null) {
|
||||
allList.add(adasRecognizedResult);
|
||||
}
|
||||
|
||||
@@ -17,6 +17,7 @@ import com.mogo.module.common.ModuleNames;
|
||||
import com.mogo.module.common.MogoApisHandler;
|
||||
import com.mogo.module.common.api.CallChatApi;
|
||||
import com.mogo.module.common.drawer.AdasRecognizedResultDrawer;
|
||||
import com.mogo.module.common.drawer.IdentifyDataDrawer;
|
||||
import com.mogo.module.common.drawer.MarkerDrawer;
|
||||
import com.mogo.module.common.drawer.OnlineCarDrawer;
|
||||
import com.mogo.module.common.drawer.RoadConditionDrawer;
|
||||
@@ -184,7 +185,7 @@ public class MapMarkerManager implements IMogoMarkerClickListener,
|
||||
// 使用与渠道配置一样的gps提供者提供的数据 修改fPadLenovo.gradle文件中的GPS_PROVIDER字段控制渲染来源
|
||||
Logger.d(TAG, "result.addAdasRecognizedDataCallback == 3 ------> ");
|
||||
if (FunctionBuildConfig.gpsProvider != 2) {
|
||||
AdasRecognizedResultDrawer.getInstance().renderAdasRecognizedResult(resultList);
|
||||
IdentifyDataDrawer.getInstance().renderAdasRecognizedResult(resultList);
|
||||
}
|
||||
|
||||
//添加自车的定位图标,碰撞只有一个预警,还需要和adas 联调,
|
||||
|
||||
@@ -1,9 +1,9 @@
|
||||
package com.mogo.service.adas;
|
||||
|
||||
import com.alibaba.android.arouter.facade.template.IProvider;
|
||||
import com.mogo.eagle.core.data.autopilot.AutoPilotControlParameters;
|
||||
import com.mogo.eagle.core.data.autopilot.AutopilotControlParameters;
|
||||
import com.mogo.eagle.core.data.traffic.TrafficData;
|
||||
import com.mogo.map.uicontroller.EnumMapUI;
|
||||
import com.mogo.service.adas.entity.ADASRecognizedResult;
|
||||
|
||||
import java.util.List;
|
||||
|
||||
@@ -57,7 +57,7 @@ public interface IMogoADASController extends IProvider {
|
||||
*
|
||||
* @param result
|
||||
*/
|
||||
void aiCloudToAdasData(AutoPilotControlParameters result);
|
||||
void aiCloudToAdasData(AutopilotControlParameters result);
|
||||
|
||||
/**
|
||||
* 添加adas数据回调接口
|
||||
@@ -183,6 +183,6 @@ public interface IMogoADASController extends IProvider {
|
||||
*/
|
||||
void cancelAutopilot();
|
||||
|
||||
void mockAdasRecognized(List<ADASRecognizedResult> recognizedResults);
|
||||
void mockAdasRecognized(List<TrafficData> recognizedResults);
|
||||
|
||||
}
|
||||
|
||||
@@ -1,6 +1,6 @@
|
||||
package com.mogo.service.adas;
|
||||
|
||||
import com.mogo.service.adas.entity.ADASCarStateInfo;
|
||||
import com.mogo.eagle.core.data.autopilot.AutopilotCarStateInfo;
|
||||
|
||||
/**
|
||||
* adas 自车位置数据回调
|
||||
@@ -13,5 +13,5 @@ public interface IMogoAdasCarDataCallback {
|
||||
*
|
||||
* @param msg 具体数据
|
||||
*/
|
||||
void onAdasCarDataCallback( ADASCarStateInfo msg );
|
||||
void onAdasCarDataCallback( AutopilotCarStateInfo msg );
|
||||
}
|
||||
|
||||
@@ -1,6 +1,6 @@
|
||||
package com.mogo.service.adas;
|
||||
|
||||
import com.mogo.eagle.core.data.autopilot.AutoPilotStationInfo;
|
||||
import com.mogo.eagle.core.data.autopilot.AutopilotStationInfo;
|
||||
|
||||
public
|
||||
/**
|
||||
@@ -29,7 +29,7 @@ interface IMogoAdasOCHCallback {
|
||||
* 到站
|
||||
* @param data 所到车站的简单信息
|
||||
*/
|
||||
void onArriveAt( AutoPilotStationInfo data );
|
||||
void onArriveAt( AutopilotStationInfo data );
|
||||
|
||||
/**
|
||||
* 自动驾驶状态发生改变
|
||||
|
||||
@@ -1,7 +1,7 @@
|
||||
package com.mogo.service.adas;
|
||||
|
||||
|
||||
import com.mogo.service.adas.entity.ADASRecognizedResult;
|
||||
import com.mogo.eagle.core.data.traffic.TrafficData;
|
||||
|
||||
import java.util.List;
|
||||
|
||||
@@ -16,5 +16,5 @@ public interface IMogoAdasRecognizedDataCallback {
|
||||
*
|
||||
* @param resultList 具体识别的物体数据
|
||||
*/
|
||||
void onAdasDataCallback(List<ADASRecognizedResult> resultList);
|
||||
void onAdasDataCallback(List<TrafficData> resultList);
|
||||
}
|
||||
@@ -1,6 +1,6 @@
|
||||
package com.mogo.service.adas;
|
||||
|
||||
import com.mogo.service.adas.entity.ADASWarnMessage;
|
||||
import com.mogo.eagle.core.data.autopilot.AutopilotWarnMessage;
|
||||
|
||||
/**
|
||||
* adas 数据回调接口
|
||||
@@ -12,5 +12,5 @@ public interface IMogoAdasWarnMessageCallback {
|
||||
* adas 数据回调
|
||||
* @param msg 具体数据
|
||||
*/
|
||||
void onReceiveData( ADASWarnMessage msg );
|
||||
void onReceiveData( AutopilotWarnMessage msg );
|
||||
}
|
||||
@@ -1,115 +0,0 @@
|
||||
package com.mogo.service.adas.entity;
|
||||
|
||||
/*
|
||||
* adas 识别物体参数
|
||||
*/
|
||||
public class ADASRecognizedResult {
|
||||
|
||||
/**
|
||||
* 识别物体类型
|
||||
*/
|
||||
public int type;
|
||||
|
||||
/**
|
||||
* 识别物体唯一标识
|
||||
*/
|
||||
public String uuid;
|
||||
|
||||
/**
|
||||
* 红绿灯颜色
|
||||
*/
|
||||
public String color;
|
||||
|
||||
/**
|
||||
* 车ID
|
||||
*/
|
||||
public String carId;
|
||||
|
||||
/**
|
||||
* 识别物体的纬度
|
||||
*/
|
||||
public double lat;
|
||||
|
||||
/**
|
||||
* 识别物体的经度
|
||||
*/
|
||||
public double lon;
|
||||
|
||||
/**
|
||||
* 车头朝向
|
||||
*/
|
||||
public double heading;
|
||||
|
||||
/**
|
||||
* 系统时间
|
||||
*/
|
||||
public long systemTime;
|
||||
|
||||
/**
|
||||
* 定位卫星时间
|
||||
*/
|
||||
public long satelliteTime;
|
||||
|
||||
/**
|
||||
* 海拔
|
||||
*/
|
||||
public double alt;
|
||||
|
||||
/**
|
||||
* 速度
|
||||
*/
|
||||
public double speed;
|
||||
|
||||
/**
|
||||
* 莫顿码
|
||||
*/
|
||||
public long mortonCode;
|
||||
|
||||
/**
|
||||
* 实际距离
|
||||
* 使用distanceX和distanceY计算
|
||||
*/
|
||||
public double distance;
|
||||
|
||||
/**
|
||||
* 数据来源精度
|
||||
* 0:普通定位
|
||||
* 1:高精定位
|
||||
*/
|
||||
public int dataAccuracy;
|
||||
|
||||
/**
|
||||
* 道路ID
|
||||
*/
|
||||
public String roadId;
|
||||
|
||||
/**
|
||||
* 车道ID-2D路段
|
||||
*/
|
||||
public String laneId;
|
||||
|
||||
/**
|
||||
* 车道号:中心线编号为0,中心线右侧编号为负数,3车道通行Road的车道编号,0,-1,-2,-3
|
||||
*/
|
||||
public int laneNum;
|
||||
|
||||
/**
|
||||
* 限速
|
||||
*/
|
||||
public double rateLimiting;
|
||||
|
||||
/**
|
||||
* 瓦片id
|
||||
*/
|
||||
public String tileId;
|
||||
|
||||
/**
|
||||
* 车道宽度
|
||||
*/
|
||||
public double roadWidth;
|
||||
|
||||
/**
|
||||
* 1 绿, 2 黄, 3 红
|
||||
*/
|
||||
public int drawlevel;
|
||||
}
|
||||
@@ -1,90 +0,0 @@
|
||||
package com.mogo.service.impl.adas;
|
||||
|
||||
import android.util.Log;
|
||||
|
||||
import com.alibaba.android.arouter.launcher.ARouter;
|
||||
import com.mogo.commons.utils.MortonCode;
|
||||
import com.mogo.map.uicontroller.IMogoMapUIController;
|
||||
import com.mogo.service.IMogoServiceApis;
|
||||
import com.mogo.service.adas.entity.ADASRecognizedResult;
|
||||
import com.mogo.service.adas.entity.ADASWarnMessage;
|
||||
import com.zhidao.support.adas.high.bean.RectInfo;
|
||||
import com.zhidao.support.adas.high.bean.WarnMessageInfo;
|
||||
|
||||
import java.util.ArrayList;
|
||||
import java.util.List;
|
||||
import java.util.concurrent.TimeUnit;
|
||||
|
||||
|
||||
/*
|
||||
* @author congtaowang
|
||||
* @since 2020/10/25
|
||||
*
|
||||
* 对象转换类
|
||||
*/
|
||||
public class AdasObjectUtils {
|
||||
|
||||
public static ADASWarnMessage fromAdasObject(WarnMessageInfo info) {
|
||||
if (info == null) {
|
||||
return null;
|
||||
}
|
||||
ADASWarnMessage warnMessage = new ADASWarnMessage();
|
||||
warnMessage.content = info.getContent();
|
||||
warnMessage.level = info.getLevel();
|
||||
try {
|
||||
warnMessage.type = Integer.parseInt(info.getType());
|
||||
} catch (NumberFormatException e) {
|
||||
return null;
|
||||
}
|
||||
warnMessage.value = info.getValue();
|
||||
return warnMessage;
|
||||
}
|
||||
|
||||
public static List<ADASRecognizedResult> regroupData(List<RectInfo.RectBean> datums) {
|
||||
if (datums == null || datums.isEmpty()) {
|
||||
return null;
|
||||
}
|
||||
List<ADASRecognizedResult> recognizedListResults = new ArrayList<>();
|
||||
for (RectInfo.RectBean model : datums) {
|
||||
if (model == null) {
|
||||
continue;
|
||||
}
|
||||
ADASRecognizedResult recognizedListResult = fromAdasObject(model);
|
||||
if (recognizedListResult != null) {
|
||||
recognizedListResults.add(recognizedListResult);
|
||||
}
|
||||
}
|
||||
return recognizedListResults;
|
||||
}
|
||||
|
||||
public static ADASRecognizedResult fromAdasObject(RectInfo.RectBean model) {
|
||||
if (model == null) {
|
||||
return null;
|
||||
}
|
||||
long start = System.nanoTime();
|
||||
ADASRecognizedResult result = new ADASRecognizedResult();
|
||||
result.uuid = model.getUuid();
|
||||
result.lat = model.getLat();
|
||||
result.lon = model.getLon();
|
||||
result.type = Integer.parseInt(model.getType());
|
||||
result.heading = model.getHeading();
|
||||
result.systemTime = Long.parseLong(model.getSystemTime());
|
||||
result.satelliteTime = Long.parseLong(model.getSatelliteTime());
|
||||
result.alt = model.getAlt();
|
||||
result.color = model.getColor();
|
||||
result.speed = model.getSpeed();
|
||||
result.carId = model.getCarId();
|
||||
result.dataAccuracy = model.dataAccuracy;
|
||||
result.distance = model.distance;
|
||||
result.drawlevel = model.getDrawlevel();
|
||||
// result.mortonCode = MortonCode.wrapEncodeMorton(result.lon, result.lat);
|
||||
Log.d("ADAS数据延时","fromAdasObject cost : " + TimeUnit.NANOSECONDS.toMillis((System.nanoTime() - start)));
|
||||
// IMogoMapUIController mogoMapUIController = ARouter.getInstance().navigation(IMogoServiceApis.class).getMapServiceApi().getMapUIController();
|
||||
// if (mogoMapUIController != null) {
|
||||
// long start = System.currentTimeMillis();
|
||||
// result.tileId = String.valueOf(mogoMapUIController.getTileId(result.lon, result.lat));
|
||||
// Log.d("ADAS数据延时", "getTileId 耗时 : " + (System.currentTimeMillis() - start) + "ms");
|
||||
// }
|
||||
return result;
|
||||
}
|
||||
}
|
||||
@@ -5,18 +5,22 @@ import android.content.Context;
|
||||
import android.content.Intent;
|
||||
import android.os.Handler;
|
||||
import android.os.Message;
|
||||
import android.text.TextUtils;
|
||||
import android.util.Log;
|
||||
|
||||
import com.alibaba.android.arouter.facade.annotation.Route;
|
||||
import com.alibaba.android.arouter.launcher.ARouter;
|
||||
import com.mogo.commons.AbsMogoApplication;
|
||||
import com.mogo.commons.debug.DebugConfig;
|
||||
import com.mogo.eagle.core.data.autopilot.AutoPilotControlCmdParameter;
|
||||
import com.mogo.eagle.core.data.autopilot.AutoPilotControlParameters;
|
||||
import com.mogo.eagle.core.data.autopilot.AutoPilotStationInfo;
|
||||
import com.mogo.eagle.core.data.autopilot.AutopilotCarStateInfo;
|
||||
import com.mogo.eagle.core.data.autopilot.AutopilotControlCmdParameter;
|
||||
import com.mogo.eagle.core.data.autopilot.AutopilotControlParameters;
|
||||
import com.mogo.eagle.core.data.autopilot.AutopilotRouteInfo;
|
||||
import com.mogo.eagle.core.data.autopilot.AutopilotStationInfo;
|
||||
import com.mogo.eagle.core.data.autopilot.AutopilotStatusInfo;
|
||||
import com.mogo.eagle.core.data.autopilot.AutopilotWarnMessage;
|
||||
import com.mogo.eagle.core.data.constants.MogoServicePaths;
|
||||
import com.mogo.eagle.core.data.map.MogoLatLng;
|
||||
import com.mogo.eagle.core.data.traffic.TrafficData;
|
||||
import com.mogo.map.uicontroller.EnumMapUI;
|
||||
import com.mogo.module.adas.AdasProvider;
|
||||
import com.mogo.module.adas.IAdasDataListener;
|
||||
@@ -28,9 +32,6 @@ import com.mogo.service.adas.IMogoAdasOCHCallback;
|
||||
import com.mogo.service.adas.IMogoAdasRecognizedDataCallback;
|
||||
import com.mogo.service.adas.IMogoAdasRouteCallBack;
|
||||
import com.mogo.service.adas.IMogoAdasWarnMessageCallback;
|
||||
import com.mogo.service.adas.entity.ADASCarStateInfo;
|
||||
import com.mogo.service.adas.entity.ADASRecognizedResult;
|
||||
import com.mogo.service.adas.entity.ADASWarnMessage;
|
||||
import com.mogo.service.impl.singleton.SingletonsHolder;
|
||||
import com.mogo.service.statusmanager.IMogoStatusManager;
|
||||
import com.mogo.utils.UiThreadHandler;
|
||||
@@ -41,11 +42,6 @@ import com.zhidao.adasconfig.api.AdasConfigApiController;
|
||||
import com.zhidao.adasconfig.common.config.EnumCarHeading;
|
||||
import com.zhidao.adasconfig.common.config.EnumSkinStyle;
|
||||
import com.zhidao.autopilot.support.api.AutopilotServiceManage;
|
||||
import com.zhidao.autopilotservice.model.AdasAIDLAutopilotArriveModel;
|
||||
import com.zhidao.support.adas.high.bean.AutopilotRoute;
|
||||
import com.zhidao.support.adas.high.bean.AutopilotStatus;
|
||||
import com.zhidao.support.adas.high.bean.RectInfo;
|
||||
import com.zhidao.support.adas.high.bean.WarnMessageInfo;
|
||||
|
||||
import org.json.JSONObject;
|
||||
|
||||
@@ -71,8 +67,6 @@ public class MogoADASController implements IMogoADASController {
|
||||
|
||||
private final IMogoStatusManager mStatusManager = SingletonsHolder.get(IMogoStatusManager.class);
|
||||
|
||||
private boolean mIsReleased = true;
|
||||
|
||||
private AdasProvider adasProvider;
|
||||
|
||||
/**
|
||||
@@ -131,7 +125,7 @@ public class MogoADASController implements IMogoADASController {
|
||||
public void handleMessage(Message msg) {
|
||||
super.handleMessage(msg);
|
||||
if (msg.obj instanceof List) {
|
||||
handleAdasRecognizedData((List<RectInfo.RectBean>) msg.obj);
|
||||
handleAdasRecognizedData((List<TrafficData>) msg.obj);
|
||||
} else if (msg.obj == null) {
|
||||
handleAdasRecognizedData(null);
|
||||
}
|
||||
@@ -147,7 +141,7 @@ public class MogoADASController implements IMogoADASController {
|
||||
super.handleMessage(msg);
|
||||
final long start = System.currentTimeMillis();
|
||||
|
||||
ADASCarStateInfo stateInfo = GsonUtil.objectFromJson(((String) msg.obj), ADASCarStateInfo.class);
|
||||
AutopilotCarStateInfo stateInfo = GsonUtil.objectFromJson(((String) msg.obj), AutopilotCarStateInfo.class);
|
||||
if (stateInfo == null || stateInfo.getValues() == null) {
|
||||
// Logger.d(TAG, "ADAS-LOC-timer", "upd 到 aidl 传输数据 stateInfo or stateInfo.getValues() is null");
|
||||
return;
|
||||
@@ -174,7 +168,7 @@ public class MogoADASController implements IMogoADASController {
|
||||
*
|
||||
* @param models
|
||||
*/
|
||||
private void handleAdasRecognizedData(List<RectInfo.RectBean> models) {
|
||||
private void handleAdasRecognizedData(List<TrafficData> models) {
|
||||
if (models == null
|
||||
|| models.isEmpty()) {
|
||||
invokeCallbackPerSecond(null);
|
||||
@@ -183,14 +177,13 @@ public class MogoADASController implements IMogoADASController {
|
||||
invokeCallbackPerSecond(models);
|
||||
}
|
||||
|
||||
private void invokeCallbackPerSecond(List<RectInfo.RectBean> models) {
|
||||
List<ADASRecognizedResult> recognizedListResults = AdasObjectUtils.regroupData(models);
|
||||
private void invokeCallbackPerSecond(List<TrafficData> models) {
|
||||
if (!mMogoAdasRecognizedDataCallbacks.isEmpty()) {
|
||||
for (IMogoAdasRecognizedDataCallback callback : mMogoAdasRecognizedDataCallbacks) {
|
||||
if (callback == null) {
|
||||
continue;
|
||||
}
|
||||
callback.onAdasDataCallback(recognizedListResults);
|
||||
callback.onAdasDataCallback(models);
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -243,58 +236,30 @@ public class MogoADASController implements IMogoADASController {
|
||||
}
|
||||
|
||||
@Override
|
||||
public void onRectData(RectInfo rectInfo) {
|
||||
// 仅在 vr 模式下显示 adas 识别车辆
|
||||
if (!SingletonsHolder.get(IMogoStatusManager.class).isVrMode()) {
|
||||
return;
|
||||
}
|
||||
if (!SingletonsHolder.get(IMogoStatusManager.class).isMainPageLaunched()) {
|
||||
return;
|
||||
}
|
||||
if (rectInfo == null || TextUtils.isEmpty(rectInfo.getAction())) {
|
||||
Logger.w(TAG, "--->action is null");
|
||||
return;
|
||||
}
|
||||
final long start = System.nanoTime();
|
||||
if (rectInfo.getModels() != null && !rectInfo.getModels().isEmpty()) {
|
||||
List<RectInfo.RectBean> beans = rectInfo.getModels();
|
||||
try {
|
||||
Message message = mAdasRecognizedRecHandler.obtainMessage();
|
||||
message.obj = beans;
|
||||
message.sendToTarget();
|
||||
Log.i("ADAS数据延时", "接收数据 -> 发出 cost :" + TimeUnit.NANOSECONDS.toMillis((System.nanoTime() - start)) + "ms");
|
||||
} catch (Exception e) {
|
||||
e.printStackTrace();
|
||||
}
|
||||
}
|
||||
DebugConfig.setStatus(DebugConfig.sAdasRecognized, true);
|
||||
public void onRectData(List<TrafficData> trafficData) {
|
||||
}
|
||||
|
||||
@Override
|
||||
public void onWarnMessage(WarnMessageInfo warnMessageInfo) {
|
||||
if (warnMessageInfo == null) {
|
||||
public void onWarnMessage(AutopilotWarnMessage autopilotWarnMessage) {
|
||||
if (autopilotWarnMessage == null) {
|
||||
return;
|
||||
}
|
||||
// 警告消息
|
||||
Logger.d(TAG, "onWarnMessage = %s", warnMessageInfo.toString());
|
||||
Logger.d(TAG, "onWarnMessage = %s", autopilotWarnMessage.toString());
|
||||
if (mMogoAdasWarnMessageCallbackList.isEmpty()) {
|
||||
return;
|
||||
}
|
||||
final ADASWarnMessage warnMessage = AdasObjectUtils.fromAdasObject(warnMessageInfo);
|
||||
if (warnMessage == null) {
|
||||
return;
|
||||
}
|
||||
UiThreadHandler.post(() -> {
|
||||
for (IMogoAdasWarnMessageCallback callback : mMogoAdasWarnMessageCallbackList) {
|
||||
if (callback != null) {
|
||||
callback.onReceiveData(warnMessage);
|
||||
callback.onReceiveData(autopilotWarnMessage);
|
||||
}
|
||||
}
|
||||
});
|
||||
}
|
||||
|
||||
@Override
|
||||
public void autopilotArrive(AdasAIDLAutopilotArriveModel autopilotArriveModel) {
|
||||
public void autopilotArrive(AutopilotStationInfo autopilotArriveModel) {
|
||||
Logger.d(TAG, "autopilotArriveModel " + autopilotArriveModel);
|
||||
if (autopilotArriveModel == null) {
|
||||
Logger.d(TAG, "autopilotArrive autopilotArriveModel is null");
|
||||
@@ -303,8 +268,8 @@ public class MogoADASController implements IMogoADASController {
|
||||
Logger.d(TAG, "autopilotArrive : " + autopilotArriveModel.toString());
|
||||
if (!mAdasOCHCallback.isEmpty()) {
|
||||
for (IMogoAdasOCHCallback cb : mAdasOCHCallback) {
|
||||
cb.onArriveAt(new AutoPilotStationInfo(
|
||||
autopilotArriveModel.getCarType(),
|
||||
cb.onArriveAt(new AutopilotStationInfo(
|
||||
autopilotArriveModel.getType(),
|
||||
autopilotArriveModel.getLon(),
|
||||
autopilotArriveModel.getLat())
|
||||
);
|
||||
@@ -313,12 +278,12 @@ public class MogoADASController implements IMogoADASController {
|
||||
}
|
||||
|
||||
@Override
|
||||
public void autopilotRoute(AutopilotRoute autopilotRoute) {
|
||||
public void autopilotRoute(AutopilotRouteInfo autopilotRoute) {
|
||||
if (autopilotRoute.getModels() == null || autopilotRoute.getModels().size() == 0) {
|
||||
return;
|
||||
}
|
||||
List<MogoLatLng> latLngList = new ArrayList<>();
|
||||
for (AutopilotRoute.RouteModels routeModel : autopilotRoute.getModels()) {
|
||||
for (AutopilotRouteInfo.RouteModels routeModel : autopilotRoute.getModels()) {
|
||||
latLngList.add(new MogoLatLng(routeModel.getLat(), routeModel.getLon()));
|
||||
}
|
||||
for (IMogoAdasRouteCallBack callback : mMogoAdasRouteCallBacks) {
|
||||
@@ -338,13 +303,13 @@ public class MogoADASController implements IMogoADASController {
|
||||
}
|
||||
|
||||
@Override
|
||||
public void notifyAutopilotState(AutopilotStatus autopilotStatus) {
|
||||
public void notifyAutopilotState(AutopilotStatusInfo autopilotStatus) {
|
||||
Logger.d(TAG, "notifyAutopilotState: " + GsonUtil.jsonFromObject(autopilotStatus));
|
||||
DebugConfig.setAutoPilotStatus(autopilotStatus.getValues().getState() + "");
|
||||
DebugConfig.setAutoPilotStatus(autopilotStatus.getState() + "");
|
||||
|
||||
if (!mAdasOCHCallback.isEmpty()) {
|
||||
for (IMogoAdasOCHCallback cb : mAdasOCHCallback) {
|
||||
cb.onStateChanged(autopilotStatus.getValues().getState(), autopilotStatus.getValues().getReason());
|
||||
cb.onStateChanged(autopilotStatus.getState(), autopilotStatus.getReason());
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -422,7 +387,6 @@ public class MogoADASController implements IMogoADASController {
|
||||
|
||||
@Override
|
||||
public void init(Context context) {
|
||||
mIsReleased = false;
|
||||
adasProvider = ARouter.getInstance().navigation(AdasProvider.class);
|
||||
}
|
||||
|
||||
@@ -464,7 +428,7 @@ public class MogoADASController implements IMogoADASController {
|
||||
}
|
||||
|
||||
@Override
|
||||
public void aiCloudToAdasData(AutoPilotControlParameters result) {
|
||||
public void aiCloudToAdasData(AutopilotControlParameters result) {
|
||||
try {
|
||||
syncControlCmdToADAS("aiCloudToStartAutopilot", result);
|
||||
} catch (Exception e) {
|
||||
@@ -477,7 +441,7 @@ public class MogoADASController implements IMogoADASController {
|
||||
* @param result
|
||||
*/
|
||||
private void syncControlCmdToADAS(String action, Object result) {
|
||||
AutoPilotControlCmdParameter parameter = new AutoPilotControlCmdParameter(action, result);
|
||||
AutopilotControlCmdParameter parameter = new AutopilotControlCmdParameter(action, result);
|
||||
//位置信息 action是aiCloudToStartAutopilot
|
||||
try {
|
||||
adasProvider.sendWsMessage(GsonUtil.jsonFromObject(parameter));
|
||||
@@ -488,7 +452,6 @@ public class MogoADASController implements IMogoADASController {
|
||||
|
||||
@Override
|
||||
public void release() {
|
||||
mIsReleased = true;
|
||||
adasProvider.removeAdasEventListener(mAdasDataListener);
|
||||
adasProvider.removeAdasStatusListener();
|
||||
AutopilotServiceManage.getInstance().release();
|
||||
@@ -593,7 +556,7 @@ public class MogoADASController implements IMogoADASController {
|
||||
public void onAutopilotArriveLike(int carType) {
|
||||
if (!mAdasOCHCallback.isEmpty()) {
|
||||
for (IMogoAdasOCHCallback cb : mAdasOCHCallback) {
|
||||
cb.onArriveAt(new AutoPilotStationInfo(
|
||||
cb.onArriveAt(new AutopilotStationInfo(
|
||||
carType,
|
||||
116.09888888,
|
||||
39.999999)
|
||||
@@ -623,7 +586,7 @@ public class MogoADASController implements IMogoADASController {
|
||||
if (state == -1) {
|
||||
if (!mAdasOCHCallback.isEmpty()) {
|
||||
for (IMogoAdasOCHCallback cb : mAdasOCHCallback) {
|
||||
cb.onArriveAt(new AutoPilotStationInfo(1, 1d, 1d));
|
||||
cb.onArriveAt(new AutopilotStationInfo(1, 1d, 1d));
|
||||
}
|
||||
}
|
||||
} else {
|
||||
@@ -642,7 +605,7 @@ public class MogoADASController implements IMogoADASController {
|
||||
}
|
||||
|
||||
@Override
|
||||
public void mockAdasRecognized(List<ADASRecognizedResult> recognizedResults) {
|
||||
public void mockAdasRecognized(List<TrafficData> recognizedResults) {
|
||||
if (!mMogoAdasRecognizedDataCallbacks.isEmpty()) {
|
||||
for (IMogoAdasRecognizedDataCallback callback : mMogoAdasRecognizedDataCallbacks) {
|
||||
if (callback == null) {
|
||||
|
||||
@@ -1,66 +0,0 @@
|
||||
package com.mogo.service.impl.adas;
|
||||
|
||||
import com.zhidao.support.adas.high.OnAdasListener;
|
||||
import com.zhidao.support.adas.high.bean.AutopilotStatus;
|
||||
import com.zhidao.support.adas.high.bean.AutopilotWayArrive;
|
||||
import com.zhidao.support.adas.high.bean.CarLaneInfo;
|
||||
import com.zhidao.support.adas.high.bean.CarStateInfo;
|
||||
import com.zhidao.support.adas.high.bean.LightStatueInfo;
|
||||
import com.zhidao.support.adas.high.bean.ObstaclesInfo;
|
||||
import com.zhidao.support.adas.high.bean.RectInfo;
|
||||
import com.zhidao.support.adas.high.bean.WarnMessageInfo;
|
||||
|
||||
public
|
||||
/**
|
||||
* @author congtaowang
|
||||
* @since 2020/10/22
|
||||
*
|
||||
* 适配ADAS 回调监听分发
|
||||
*/
|
||||
abstract class OnAdasListenerAdapter implements OnAdasListener {
|
||||
|
||||
@Override
|
||||
public void onWarnMessage(WarnMessageInfo warnMessageInfo) {
|
||||
|
||||
}
|
||||
|
||||
@Override
|
||||
public void onVideoSize(int width, int height) {
|
||||
|
||||
}
|
||||
|
||||
@Override
|
||||
public void onRectData(RectInfo rectInfo) {
|
||||
|
||||
}
|
||||
|
||||
@Override
|
||||
public void onCarStateData(CarStateInfo carStateInfo) {
|
||||
|
||||
}
|
||||
|
||||
@Override
|
||||
public void onLightStateData(LightStatueInfo lightStatueInfo) {
|
||||
|
||||
}
|
||||
|
||||
@Override
|
||||
public void onObstaclesInfo(ObstaclesInfo obstaclesInfo) {
|
||||
|
||||
}
|
||||
|
||||
@Override
|
||||
public void onCarLaneInfo(CarLaneInfo carLaneInfo) {
|
||||
|
||||
}
|
||||
|
||||
@Override
|
||||
public void autopilotStatus(AutopilotStatus autopilotStatus) {
|
||||
|
||||
}
|
||||
|
||||
@Override
|
||||
public void autopilotArrive(AutopilotWayArrive autopilotWayArrive) {
|
||||
|
||||
}
|
||||
}
|
||||
@@ -123,7 +123,11 @@ public class MogoMapService implements IMogoMapService {
|
||||
|
||||
@Override
|
||||
public String getMapVersion() {
|
||||
return MogoMap.getInstance().getMogoMap().getMapVersion();
|
||||
if (MogoMap.getInstance().getMogoMap() != null) {
|
||||
return MogoMap.getInstance().getMogoMap().getMapVersion();
|
||||
} else {
|
||||
return "0";
|
||||
}
|
||||
}
|
||||
|
||||
@Override
|
||||
|
||||
Reference in New Issue
Block a user