Merge branch 'dev_robotaxi-d-app-module_2100_220816_2.10.0' into 'test_robotaxi-d-app-module_2100_220816_2.10.0.1'

Dev robotaxi d app module 2100 220816 2.10.0

See merge request zhjt/AndroidApp/MoGoEagleEye!147
This commit is contained in:
wangmingjun
2022-09-05 12:08:04 +00:00
18 changed files with 194 additions and 63 deletions

View File

@@ -44,5 +44,7 @@ class BusPassengerConst {
// 订单总里程
const val BUS_SP_KEY_ORDER_SUM_DIS = "BUS_SP_KEY_ORDER_SUM_DIS"
const val QUERY_BUS_P_STATION_DELAY = 5 * 1000L
}
}

View File

@@ -4,6 +4,8 @@ import android.content.Context;
import android.content.Intent;
import android.location.Location;
import android.net.ConnectivityManager;
import android.os.Handler;
import android.os.Message;
import androidx.annotation.NonNull;
import androidx.annotation.Nullable;
@@ -56,6 +58,7 @@ import mogo_msg.MogoReportMsg;
import system_master.SystemStatusInfo;
import static com.mogo.eagle.core.utilcode.mogo.logger.scene.SceneConstant.M_BUS_P;
import static com.mogo.och.bus.passenger.constant.BusPassengerConst.QUERY_BUS_P_STATION_DELAY;
import static com.mogo.och.bus.passenger.constant.BusPassengerConst.STATION_STATUS_STOPPED;
/**
@@ -88,6 +91,18 @@ public class BusPassengerModel {
private int mNextStationIndex = 0;// 要到达站的index
private List<LatLng> mTwoStationsRouts = new ArrayList<>();
private static final int MSG_QUERY_BUS_P_STATION = 1001;
private final Handler handler = new Handler(new Handler.Callback() {
@Override
public boolean handleMessage(Message msg) {
if ( msg.what == MSG_QUERY_BUS_P_STATION ) {
queryDriverOperationStatus();
return true;
}
return false;
}
});
private BusPassengerModel() {
}
@@ -106,6 +121,10 @@ public class BusPassengerModel {
this.mRouteLineInfoCallback = callback;
}
private void queryDriverOperationDelay() {
handler.sendEmptyMessageDelayed( MSG_QUERY_BUS_P_STATION, QUERY_BUS_P_STATION_DELAY );
}
private void queryDriverOperationStatus() {
BusPassengerServiceManager.getInstance().queryDriverOperationStatus(mContext
, new BusPassengerServiceCallback<BusPassengerOperationStatusResponse>() {
@@ -121,7 +140,8 @@ public class BusPassengerModel {
@Override
public void onFail(int code, String msg) {
queryDriverOperationStatus();
//延迟3s再次查询
queryDriverOperationDelay();
}
});
}

View File

@@ -35,7 +35,7 @@ public class AnimatorDrawableUtil {
//图片资源的ID列表
private List<Integer> mResourceIdList = null;
//定时任务器
private Timer mTimer = null;
private final Timer mTimer = new Timer();
//定时任务
private AnimTimerTask mTimeTask = null;
//记录播放位置
@@ -44,7 +44,7 @@ public class AnimatorDrawableUtil {
private boolean isLooping = false;
public AnimatorDrawableUtil() {
mTimer = new Timer();
// mTimer = new Timer();
}
/**
@@ -139,18 +139,25 @@ public class AnimatorDrawableUtil {
*/
public void start(boolean loop, int duration, AnimationLisenter lisenter) {
this.lisenter = lisenter;
stop();
// stop();
if (mResourceIdList == null || mResourceIdList.size() == 0) {
return;
}
if (mTimer == null) {
mTimer = new Timer();
// if (mTimer == null) {
// mTimer = new Timer();
// }
try {
isLooping = loop;
mFrameIndex = 0;
mState = STATE_RUNNING;
if (mTimeTask != null){
return;
}
mTimeTask = new AnimTimerTask();
mTimer.schedule(mTimeTask, 0, duration);
}catch (Exception e){
e.printStackTrace();
}
isLooping = loop;
mFrameIndex = 0;
mState = STATE_RUNNING;
mTimeTask = new AnimTimerTask();
mTimer.schedule(mTimeTask, 0, duration);
if (lisenter != null){
lisenter.startAnimation();
}
@@ -163,7 +170,7 @@ public class AnimatorDrawableUtil {
if (mTimer != null) {
mTimer.purge();
mTimer.cancel();
mTimer = null;
// mTimer = null;
}
if (mTimeTask != null) {
mFrameIndex = 0;

View File

@@ -67,7 +67,10 @@ import java.util.Collections;
import java.util.List;
import java.util.Map;
import java.util.concurrent.ConcurrentHashMap;
import java.util.concurrent.TimeUnit;
import io.reactivex.Observable;
import io.reactivex.disposables.Disposable;
import io.reactivex.exceptions.UndeliverableException;
import io.reactivex.functions.Consumer;
import io.reactivex.plugins.RxJavaPlugins;
@@ -108,6 +111,9 @@ public class TaxiPassengerModel implements IOCHTaxiPassengerNaviChangedCallback
private ITaxiPassengerVeloctityCallback mVeloctityCallback;//道路限速返回
private Disposable subscribe;
private int delayTime = 2;
private double mLongitude, mLatitude;
private List<LatLng> mLocationsModels = new ArrayList<>();
@@ -209,6 +215,9 @@ public class TaxiPassengerModel implements IOCHTaxiPassengerNaviChangedCallback
startOrStopOrderLoop(false);
startOrStopQueryOrderRemaining(false);
releaseListeners();
if(subscribe!=null&&!subscribe.isDisposed()){
subscribe.dispose();
}
}
private void initListeners() {
@@ -720,13 +729,17 @@ public class TaxiPassengerModel implements IOCHTaxiPassengerNaviChangedCallback
startOrStopRouteAndWipe(true);
}
}else {
queryOrderRouteList();
subscribe = Observable.timer(delayTime, TimeUnit.SECONDS).subscribe(aLong -> {
queryOrderRouteList();
});
}
}
@Override
public void onFail(int code, String msg) {
queryOrderRouteList();
subscribe = Observable.timer(delayTime, TimeUnit.SECONDS).subscribe(aLong -> {
queryOrderRouteList();
});
}
});
}

View File

@@ -24,11 +24,8 @@ import com.mogo.och.taxi.passenger.model.TaxiPassengerGeocodeSearchModel;
import com.mogo.och.taxi.passenger.model.TaxiPassengerModel;
import com.mogo.och.taxi.passenger.ui.TaxiPassengerServingOrderFragment;
import java.util.ArrayList;
import java.util.List;
import mogo.telematics.pad.MessagePad;
import static com.mogo.eagle.core.utilcode.mogo.logger.scene.SceneConstant.M_TAXI_P;
/**
@@ -54,9 +51,11 @@ public class TaxiPassengerServingOrderPresenter extends Presenter<TaxiPassengerS
}
private void initListener() {
// 设置起点和终点marker和实时车辆位置
TaxiPassengerModel.getInstance().setMoGoAutopilotPlanningListener(this);
TaxiPassengerModel.getInstance().setOrderStatusCallback("TaxiPassengerServingOrderPresenter",this);
TaxiPassengerModel.getInstance().setControllerStatusCallback("TaxiPassengerServingOrderPresenter",this);
// 获取道路限速
TaxiPassengerModel.getInstance().setVeloctityCallback(this);
}
@@ -132,10 +131,19 @@ public class TaxiPassengerServingOrderPresenter extends Presenter<TaxiPassengerS
}
private long startTime = 0;
private static final long TIMEINTERVAL = 4000;
@Override
public void onCarLocationChanged(Location location) {
if (location != null){
runOnUIThread(() -> mView.onCarLocationChanged(location));
long currentTimeMillis = System.currentTimeMillis();
if(currentTimeMillis-startTime<TIMEINTERVAL){
return;
}
CallerLogger.INSTANCE.d(M_TAXI_P + TAG,"onCarLocationChanged 获取当前路的信息");
startTime = currentTimeMillis;
TaxiPassengerGeocodeSearchModel.getInstance(getContext()).searchLocationInfo(location.getLatitude(),location.getLongitude());
}
}

View File

@@ -101,9 +101,9 @@ public class TaxiPassengerStartAutopilotView extends RelativeLayout implements V
mAutopilotBtnBg = view.findViewById(R.id.taxi_p_autopilot_btn_bg);
mCarIv = view.findViewById(R.id.taxi_p_autopilot_starting);
initBtnAnimatonDrawable();
initCarStartingFrame();
// initBtnAnimatonDrawable();
//
// initCarStartingFrame();
}
private void initCarStartingFrame() {

View File

@@ -42,6 +42,7 @@ public class TaxiPresenter extends Presenter<TaxiFragment> implements ITaxiADASS
private static final String TAG = TaxiPresenter.class.getSimpleName();
private boolean isFirstShow = true;
private int preAutopilotStatus = 0;
public TaxiPresenter(TaxiFragment view) {
super(view);
@@ -191,24 +192,30 @@ public class TaxiPresenter extends Presenter<TaxiFragment> implements ITaxiADASS
public void onAutopilotEnable() {
runOnUIThread(() -> mView.updateAutopilotStatus(
IMoGoAutopilotStatusListener.STATUS_AUTOPILOT_ENABLE));
preAutopilotStatus = IMoGoAutopilotStatusListener.STATUS_AUTOPILOT_ENABLE;
}
@Override
public void onAutopilotDisable() {
runOnUIThread(() -> mView.updateAutopilotStatus(
IMoGoAutopilotStatusListener.STATUS_AUTOPILOT_DISABLE));
preAutopilotStatus = IMoGoAutopilotStatusListener.STATUS_AUTOPILOT_DISABLE;
}
@Override
public void onAutopilotRunning() {
runOnUIThread(() -> mView.updateAutopilotStatus(
IMoGoAutopilotStatusListener.STATUS_AUTOPILOT_RUNNING));
if (preAutopilotStatus != IMoGoAutopilotStatusListener.STATUS_AUTOPILOT_RUNNING){
runOnUIThread(() -> mView.updateAutopilotStatus(
IMoGoAutopilotStatusListener.STATUS_AUTOPILOT_RUNNING));
}
preAutopilotStatus = IMoGoAutopilotStatusListener.STATUS_AUTOPILOT_RUNNING;
}
@Override
public void onManMachineCoDriving() {
runOnUIThread(() -> mView.onManMachineCoDriving(IMoGoAutopilotStatusListener.STATUS_PARALLEL_DRIVING));
preAutopilotStatus = IMoGoAutopilotStatusListener.STATUS_PARALLEL_DRIVING;
}
@Override

View File

@@ -396,8 +396,8 @@ public class TaxiFragment extends BaseTaxiTabFragment<TaxiFragment, TaxiPresente
}
taxiLoginDialog.show(getParentFragmentManager(), taxiLoginDialog.getTag());
taxiLoginDialog.setOnDismissListener(dialog -> {
mPresenter.queryLoginStatus();
taxiLoginDialogFragment.clear();
mPresenter.queryLoginStatus();
});
}
}

View File

@@ -16,6 +16,11 @@ if (!isAndroidTestBuild()) {
logLevel "DEBUG"
}
}
if (!isAndroidTestBuild()) {
apply plugin: 'bytex.notsticky.service'
}
if (!isAndroidTestBuild()) {
apply plugin: 'chain.log.hook'
hooklog{
@@ -34,7 +39,6 @@ if (!isAndroidTestBuild()) {
enable true
enableInDebug true
logLevel "DEBUG"
threadNameMaxLength 1000
//白名单中的类不进行替换
white_list = [
'leakcanary.*',

View File

@@ -32,9 +32,10 @@ buildscript {
classpath "com.bytedance.android.byteX:base-plugin:0.3.0"
classpath "com.mogo.cloud:hook:${HOOK_LOG_VERSION}"
classpath 'com.volcengine:apm_insight_plugin:1.4.1'
classpath 'com.mogo.thread.opt:plg:2.1.3'
classpath 'com.mogo.thread.opt:plg:2.1.6'
classpath 'com.mogo.cloud:systrace:1.0.1'
classpath 'com.google.protobuf:protobuf-gradle-plugin:0.8.18'
classpath 'com.mogo.sticky:service:1.0.8'
// classpath ("com.tencent.matrix:matrix-gradle-plugin:0.6.6") { changing = true }
}

View File

@@ -2,10 +2,11 @@ package com.mogo.eagle.core.function.hmi.ui.tools
import android.annotation.SuppressLint
import android.content.Context
import android.content.Intent
import android.graphics.Color
import android.graphics.drawable.ColorDrawable
import android.os.Process
import android.util.AttributeSet
import android.util.Log
import android.view.LayoutInflater
import android.view.View
import android.widget.FrameLayout
@@ -29,6 +30,7 @@ import com.mogo.eagle.core.utilcode.util.UiThreadHandler
import kotlinx.android.synthetic.main.view_auto_pilot_check.view.*
import mogo.telematics.pad.MessagePad
import org.greenrobot.eventbus.EventBus
import kotlin.system.exitProcess
/**
* @author ChenFufeng
@@ -97,6 +99,9 @@ class AutoPilotAndCheckView @JvmOverloads constructor(
ivCloseIcon.setOnClickListener {
clickListener?.onClose(it)
}
rlKillLayout.setOnClickListener {
killApp()
}
viewCheckStatus.setOnClickListener {
clickListener?.go2CheckPage()
}
@@ -170,6 +175,16 @@ class AutoPilotAndCheckView @JvmOverloads constructor(
}
}
private fun killApp() {
Intent(Intent.ACTION_MAIN).apply {
addCategory(Intent.CATEGORY_HOME)
flags = Intent.FLAG_ACTIVITY_NEW_TASK
context.startActivity(this)
Process.killProcess(Process.myPid())
exitProcess(0)
}
}
fun setClickListener(clickListener: ClickListener) {
this.clickListener = clickListener
}

View File

@@ -67,7 +67,7 @@ class MogoMainService extends Service implements IMogoLocationListener {
@Override
public int onStartCommand(Intent intent, int flags, int startId) {
return START_STICKY;
return START_NOT_STICKY;
}
private void initAndStartLocation() {

Binary file not shown.

After

Width:  |  Height:  |  Size: 24 KiB

View File

@@ -107,6 +107,31 @@
android:textSize="32px" />
</RelativeLayout>
<RelativeLayout
android:id="@+id/rlKillLayout"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_marginStart="142px">
<ImageView
android:id="@+id/ivKillImg"
android:layout_width="150px"
android:layout_height="150px"
android:layout_centerHorizontal="true"
android:background="@drawable/close_nor" />
<TextView
android:id="@+id/tvKillContent"
android:layout_width="wrap_content"
android:layout_height="42px"
android:layout_alignParentBottom="true"
android:layout_centerHorizontal="true"
android:layout_marginTop="23px"
android:text="杀死APP"
android:textColor="@color/color_FFA7B6F0"
android:textSize="32px" />
</RelativeLayout>
</LinearLayout>
<TextView

View File

@@ -1,13 +1,14 @@
package com.mogo.eagle.core.function.map
import com.mogo.eagle.core.data.autopilot.AutopilotStatusInfo
import com.mogo.eagle.core.data.config.FunctionBuildConfig
import com.mogo.eagle.core.function.api.autopilot.IMoGoAutopilotPointCloudListener
import com.mogo.eagle.core.function.api.autopilot.IMoGoAutopilotStatusListener
import com.mogo.eagle.core.function.api.base.IMoGoSubscriber
import com.mogo.eagle.core.function.call.autopilot.CallerAutoPilotStatusListenerManager
import com.mogo.eagle.core.function.call.autopilot.CallerAutopilotPointCloudListenerManager
import com.mogo.eagle.core.utilcode.mogo.logger.Logger
import com.zhidaoauto.map.sdk.open.business.PointCloudHelper
import mogo.telematics.pad.MessagePad
import rule_segement.MogoPointCloudOuterClass
import java.math.BigDecimal
/**
@@ -16,12 +17,15 @@ import java.math.BigDecimal
*
* @author donghongyu
*/
class MapPointCloudSubscriber private constructor() : IMoGoSubscriber, IMoGoAutopilotPointCloudListener {
class MapPointCloudSubscriber private constructor()
: IMoGoSubscriber, IMoGoAutopilotPointCloudListener, IMoGoAutopilotStatusListener {
private val TAG = "MapPointCloudSubscriber"
private var isDrawPointCloud = false
private var mAutoPilotStatusInfo: AutopilotStatusInfo? = null
init {
onCrate()
}
@@ -34,16 +38,18 @@ class MapPointCloudSubscriber private constructor() : IMoGoSubscriber, IMoGoAuto
override fun onCrate() {
CallerAutopilotPointCloudListenerManager.addListener(TAG, this)
// 添加 ADAS状态 监听
CallerAutoPilotStatusListenerManager.addListener(TAG, this)
}
override fun onDestroy() {
CallerAutopilotPointCloudListenerManager.removeListener(TAG)
CallerAutoPilotStatusListenerManager.removeListener(TAG)
}
override fun onAutopilotPointCloudDataUpdate(pointCloud: ByteArray?) {
try {// 根据配置动态控制点云是否绘制
if (FunctionBuildConfig.isDrawPointCloudData) {
if (FunctionBuildConfig.isDrawPointCloudData && isDrawCloudPointDockerVersion()) {
if (!isDrawPointCloud) {
Logger.d(TAG, "====开启点云渲染====")
isDrawPointCloud = true
@@ -74,13 +80,53 @@ class MapPointCloudSubscriber private constructor() : IMoGoSubscriber, IMoGoAuto
}
}
override fun onAutopilotPointCloudDataUpdate(header: MessagePad.Header?, pointCloud: MogoPointCloudOuterClass.MogoPointCloud?) {
// Logger.d(TAG, "数据对比:"
// + "\n自车定位自车的 satelliteTime==${getPrettyNumber(CallerAutoPilotStatusListenerManager.getAutoPilotStatusInfo().satelliteTime.toString())} 经纬度:${CallerAutoPilotStatusListenerManager.getAutoPilotStatusInfo().locationLat},${CallerAutoPilotStatusListenerManager.getAutoPilotStatusInfo().locationLon}"
// + "\n点云数据点云的 header?.timestamp==${getPrettyNumber(header?.timestamp.toString())} 经纬度:${pointCloud?.selfLatitude},${pointCloud?.selfLongitude} 点云数量addDataCount==${pointCloud?.addDataCount} delDataCount===${pointCloud?.delDataCount} "
// )
override fun onAutopilotStatusResponse(autoPilotStatusInfo: AutopilotStatusInfo) {
mAutoPilotStatusInfo = autoPilotStatusInfo
}
/**
* 判断是否是260之后但版本
*/
fun isDrawCloudPointDockerVersion(): Boolean {
// 由于Docker命名规则不统一但核心版本是统一但采用"."分割,如下
// MAP-taxi_RoboTaxi_Default_2.2.0_badcasetest_20220215_dev
val dockerVersionName = mAutoPilotStatusInfo?.dockVersion
// "." 分割,取前两位
val dockerVersionNameArray = dockerVersionName?.split(".")
var dockerVersionCode = ""
dockerVersionNameArray?.let {
if (it.size > 3) {
for (index in 0 until 3) {
dockerVersionCode +=
when (index) {
0 -> {
it[index].substring(it[index].lastIndex)
}
it.size - 1 -> {
it[index].substring(0, 1)
}
else -> {
it[index]
}
}
}
}
}
val dockerVersion =
if (dockerVersionCode.isNotEmpty()) {
dockerVersionCode.toInt()
} else {
0
}
if (dockerVersion >= 260) {
return true
}
return false
}
fun getPrettyNumber(number: String): String {
return BigDecimal.valueOf(number.toDouble())
.stripTrailingZeros().toPlainString()

View File

@@ -18,9 +18,4 @@ interface IMoGoAutopilotPointCloudListener {
*/
fun onAutopilotPointCloudDataUpdate(pointCloud: ByteArray?)
/**
*
*/
fun onAutopilotPointCloudDataUpdate(header: MessagePad.Header?, pointCloud: MogoPointCloudOuterClass.MogoPointCloud?)
}

View File

@@ -68,16 +68,4 @@ object CallerAutopilotPointCloudListenerManager : CallerBase() {
}
}
/**
* 点云数据 回调
*/
@Synchronized
fun invokeAutopilotPointCloudDataUpdate(header: MessagePad.Header?, pointCloud: MogoPointCloudOuterClass.MogoPointCloud?) {
M_POINT_CLOUD_LISTENERS.forEach {
val tag = it.key
val listener = it.value
listener.onAutopilotPointCloudDataUpdate(header, pointCloud)
}
}
}

View File

@@ -63,23 +63,23 @@ SERVICE_CHAIN_VERSION=1.1.0
LOGLIB_VERSION=1.3.38
######## MogoAiCloudSDK Version ########
# 网络请求LOGLIB_VERSION
MOGO_NETWORK_VERSION=1.4.3.23
MOGO_NETWORK_VERSION=1.4.3.26
# 鉴权
MOGO_PASSPORT_VERSION=1.4.3.23
MOGO_PASSPORT_VERSION=1.4.3.26
# 常链接
MOGO_SOCKET_VERSION=1.4.3.23
MOGO_SOCKET_VERSION=1.4.3.26
# 数据采集
MOGO_REALTIME_VERSION=1.4.3.23
MOGO_REALTIME_VERSION=1.4.3.26
# 探路,道路事件发布,获取
MOGO_TANLU_VERSION=1.4.3.23
MOGO_TANLU_VERSION=1.4.3.26
# 直播推流
MOGO_LIVE_VERSION=1.4.3.23
MOGO_LIVE_VERSION=1.4.3.26
# 直播拉流
MOGO_TRAFFICLIVE_VERSION=1.4.3.23
MOGO_TRAFFICLIVE_VERSION=1.4.3.26
# 定位服务
MOGO_LOCATION_VERSION=1.4.3.23
MOGO_LOCATION_VERSION=1.4.3.26
# 远程通讯模块
MOGO_TELEMATIC_VERSION=1.4.3.23
MOGO_TELEMATIC_VERSION=1.4.3.26
######## MogoAiCloudSDK Version ########
# 自研地图
MAP_SDK_VERSION=2.4.2.3