Merge branch 'dev_robotaxi-d_230912_6.1.0' into dev_minibus-d_230919_6.1.0
This commit is contained in:
@@ -6,7 +6,6 @@ import androidx.annotation.Nullable;
|
||||
|
||||
import com.mogo.eagle.core.function.api.autopilot.IMoGoAutopilotActionsListener;
|
||||
import com.mogo.eagle.core.function.api.autopilot.IMoGoAutopilotStatisticsListener;
|
||||
import com.mogo.eagle.core.function.api.autopilot.IMoGoParallelDrivingActionsListener;
|
||||
import com.mogo.eagle.core.function.call.autopilot.CallerAutoPilotStatusListenerManager;
|
||||
import com.mogo.eagle.core.function.call.autopilot.CallerAutopilotActionsListenerManager;
|
||||
import com.mogo.eagle.core.function.call.autopilot.CallerAutopilotStatisticsListenerManager;
|
||||
@@ -24,7 +23,7 @@ import java.util.ArrayList;
|
||||
* 工控机状态信息回调(判断是否能否启动自动驾驶的回调)
|
||||
* 目前定的是3秒回调一次
|
||||
*/
|
||||
public class OCHAdasAbilityManager implements IMoGoAutopilotActionsListener, IMoGoAutopilotStatisticsListener, IMoGoParallelDrivingActionsListener {
|
||||
public class OCHAdasAbilityManager implements IMoGoAutopilotActionsListener, IMoGoAutopilotStatisticsListener {
|
||||
|
||||
private static final String TAG = OCHAdasAbilityManager.class.getSimpleName();
|
||||
|
||||
@@ -89,8 +88,6 @@ public class OCHAdasAbilityManager implements IMoGoAutopilotActionsListener, IMo
|
||||
//2022.10.9 工控机状态信息回调(判断是否能否启动自动驾驶的回调), 目前定的是3秒回调一次
|
||||
CallerAutopilotActionsListenerManager.INSTANCE.addListener(TAG, this);
|
||||
CallerAutopilotStatisticsListenerManager.INSTANCE.addListener(TAG,this);
|
||||
//map3.6.0且是东风或者红旗的时候返回
|
||||
CallerParallelDrivingActionsListenerManager.INSTANCE.addListener(TAG,this);
|
||||
}
|
||||
|
||||
private void releaseListeners() {
|
||||
@@ -115,7 +112,6 @@ public class OCHAdasAbilityManager implements IMoGoAutopilotActionsListener, IMo
|
||||
|
||||
}
|
||||
}
|
||||
|
||||
@Override
|
||||
public void onAutopilotStatistics(@Nullable AutopilotStatistics statistics) {
|
||||
if (statistics == null) return;
|
||||
@@ -129,20 +125,6 @@ public class OCHAdasAbilityManager implements IMoGoAutopilotActionsListener, IMo
|
||||
}
|
||||
}
|
||||
|
||||
@Override
|
||||
public void onParallelDrivingAbility(boolean isParallelDrivingAbility, @Nullable ArrayList<UnableLaunchReason> unableParallelDrivingReasons) {
|
||||
if (unableParallelDrivingReasons != null && getMapVersion() >= 30600) {
|
||||
//刹车变化回调
|
||||
Logger.d(TAG,"onParallelDrivingAbility = " + isParallelDrivingAbility +
|
||||
" unableParallelDrivingReasons =" + unableParallelDrivingReasons.toString());
|
||||
if (unableParallelDrivingReasons.toString().contains(UnableLaunchReason.SourceType.CHASSIS.name())
|
||||
&& unableParallelDrivingReasons.toString().contains(UnableLaunchReason.UnableType.BRAKE.name())) {
|
||||
failureCallback.brakeStatusChanged(isParallelDrivingAbility);
|
||||
}
|
||||
|
||||
}
|
||||
}
|
||||
|
||||
private int getMapVersion(){
|
||||
return ParseVersionUtils.parseVersion(true, CallerAutoPilotStatusListenerManager.INSTANCE.getDockerVersion());
|
||||
}
|
||||
|
||||
@@ -283,12 +283,12 @@ class TaxiFragment : BaseTaxiTabFragment<TaxiFragment, TaxiPresenter>(),
|
||||
findViewById<View>(R.id.test_bar_route)?.setOnClickListener {
|
||||
testRouteInfoUpload()
|
||||
}
|
||||
findViewById<View>(R.id.test_brake)?.setOnClickListener {
|
||||
TaxiTaskModel.handleBrakeStatusChange(false)
|
||||
}
|
||||
findViewById<View>(R.id.test_resume_brake)?.setOnClickListener {
|
||||
TaxiTaskModel.handleBrakeStatusChange(true)
|
||||
}
|
||||
// findViewById<View>(R.id.test_brake)?.setOnClickListener {
|
||||
// TaxiTaskModel.handleBrakeStatusChange(false)
|
||||
// }
|
||||
// findViewById<View>(R.id.test_resume_brake)?.setOnClickListener {
|
||||
// TaxiTaskModel.handleBrakeStatusChange(true)
|
||||
// }
|
||||
findViewById<View>(R.id.test_parallel_driver)?.setOnClickListener {
|
||||
stopAutoStartAutopilot()
|
||||
}
|
||||
|
||||
@@ -117,18 +117,14 @@ class TaxiCurrentTaskFragment : BaseFragment(),
|
||||
TAG,
|
||||
"hasCurrentTask = $hasCurrentTask"
|
||||
)
|
||||
try {
|
||||
if (hasCurrentTask) {
|
||||
noTaskData.visibility = View.GONE
|
||||
mCurrentTaskLayout.visibility = View.VISIBLE
|
||||
} else {
|
||||
noTaskData.visibility = View.VISIBLE
|
||||
noOrderDataTv.text = "暂无进行中订单"
|
||||
mCurrentTaskLayout.visibility = View.GONE
|
||||
taskOtherInfo.text = "距离 -- 公里, 用时 -- 分钟"
|
||||
}
|
||||
} catch (e: NullPointerException) { //可能会出现订单信息已经轮询回来,但进行中页面控件还未初始化完成的情况
|
||||
TaxiTaskModel.clearCurrentOCHOrder()
|
||||
if (hasCurrentTask) {
|
||||
noTaskData.visibility = View.GONE
|
||||
mCurrentTaskLayout.visibility = View.VISIBLE
|
||||
} else {
|
||||
noTaskData.visibility = View.VISIBLE
|
||||
noOrderDataTv.text = "暂无进行中订单"
|
||||
mCurrentTaskLayout.visibility = View.GONE
|
||||
taskOtherInfo.text = "距离 -- 公里, 用时 -- 分钟"
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
@@ -88,6 +88,7 @@ import system_master.SsmInfo
|
||||
import system_master.SystemStatusInfo
|
||||
import java.util.concurrent.ConcurrentHashMap
|
||||
import java.util.concurrent.TimeUnit
|
||||
import kotlin.math.ceil
|
||||
|
||||
/**
|
||||
* @author: wangmingjun
|
||||
@@ -270,6 +271,7 @@ object TaxiTaskModel {
|
||||
|
||||
override fun onAutopilotStatusResponse(autoPilotStatusInfo: AutopilotStatusInfo) {}
|
||||
override fun onAutopilotStatusResponse(state: Int) {
|
||||
i(TAG, "onAutopilotStatusResponse autopilotsState= $state")
|
||||
if (state == IMoGoAutopilotStatusListener.STATUS_AUTOPILOT_RUNNING) {
|
||||
DebugView.printInfoMsg("[自驾状态变化] afterValue=STATUS_AUTOPILOT_RUNNING,meaning=自动驾驶中")
|
||||
mADASStatusCallback?.onAutopilotRunning()
|
||||
@@ -442,8 +444,8 @@ object TaxiTaskModel {
|
||||
}
|
||||
|
||||
override fun brakeStatusChanged(isBrakeAvailable: Boolean) {
|
||||
//刹车: true 松开, false 踩下
|
||||
handleBrakeStatusChange(isBrakeAvailable)
|
||||
//刹车: true 松开, false 踩下 2020.9.23刹车需求暂时下掉
|
||||
// handleBrakeStatusChange(isBrakeAvailable)
|
||||
}
|
||||
}
|
||||
|
||||
@@ -724,6 +726,7 @@ object TaxiTaskModel {
|
||||
listener.onTaskWithOrderDataChanged(null)
|
||||
}
|
||||
}
|
||||
clearCurrentOCHOrder()
|
||||
return
|
||||
}
|
||||
|
||||
@@ -856,7 +859,7 @@ object TaxiTaskModel {
|
||||
val listener = it.value
|
||||
listener.onOrderTripInfoChanged(
|
||||
data.data.mileage,
|
||||
data.data.duration.toInt()
|
||||
ceil(data.data.duration.toDouble()).toInt() //向上取整
|
||||
)
|
||||
}
|
||||
}
|
||||
@@ -1329,18 +1332,14 @@ object TaxiTaskModel {
|
||||
* 清除任务订单信息
|
||||
*/
|
||||
fun clearCurrentOCHOrder() {
|
||||
mCurrentTaskWithOrder = null
|
||||
mDriveToNearestStationTask = null
|
||||
clearAutopilotControlParameters()
|
||||
TaxiTrajectoryManager.getInstance().syncTrajectoryInfo()
|
||||
SharedPrefsMgr.getInstance(mContext).remove(TaxiUnmannedConst.SP_KEY_OCH_TAXI_ORDER)
|
||||
isRestartAutopilot = false
|
||||
if (FunctionBuildConfig.isDemoMode) {
|
||||
// 当美化模式(演示模式)开启时: 取消或订单已完成时,置false
|
||||
FunctionBuildConfig.isIgnoreConditionsDrawAutopilotTrajectoryData = false
|
||||
CallerAutoPilotControlManager.setIgnoreConditionDraw(false)
|
||||
CallerAutoPilotControlManager.setIPCDemoMode(false)
|
||||
d(TAG, "美化模式-ignore:置为false(已完成or清除当前订单)")
|
||||
d(TAG, "美化模式-ignore:置为false(已完成or清除当前任务)")
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
@@ -30,24 +30,24 @@ object MapMakerManager {
|
||||
.anchor(0.5f, 0.5f)
|
||||
.set3DMode(true)
|
||||
.isUseGps(true)
|
||||
.controlAngle(true)
|
||||
.controlAngle(false)
|
||||
.icon3DRes(resourceId)
|
||||
.latitude(lat)
|
||||
.longitude(lon)
|
||||
val mapUIController =
|
||||
CallerMapUIServiceManager.getMapUIController()
|
||||
if (mapUIController != null) {
|
||||
val centerLine =
|
||||
mapUIController.getCenterLineInfo(
|
||||
lon, lat, -1f
|
||||
)
|
||||
if (null != centerLine) { // 有可能鹰眼map为空没有角度。判空使用后可能造成maker角度跟道路角度不一致
|
||||
val angle = centerLine.angle
|
||||
if (angle != null) {
|
||||
builder.rotate(angle.toFloat())
|
||||
}
|
||||
}
|
||||
}
|
||||
// val mapUIController =
|
||||
// CallerMapUIServiceManager.getMapUIController()
|
||||
// if (mapUIController != null) {
|
||||
// val centerLine =
|
||||
// mapUIController.getCenterLineInfo(
|
||||
// lon, lat, -1f
|
||||
// )
|
||||
// if (null != centerLine) { // 有可能鹰眼map为空没有角度。判空使用后可能造成maker角度跟道路角度不一致
|
||||
// val angle = centerLine.angle
|
||||
// if (angle != null) {
|
||||
// builder.rotate(angle.toFloat())
|
||||
// }
|
||||
// }
|
||||
// }
|
||||
val overlayManager =
|
||||
CallerMapUIServiceManager.getOverlayManager()
|
||||
overlayManager?.showOrUpdatePoint(builder.build())
|
||||
|
||||
@@ -57,6 +57,7 @@
|
||||
android:layout_width="wrap_content"
|
||||
android:layout_height="wrap_content"
|
||||
android:text="Mock刹车"
|
||||
android:visibility="gone"
|
||||
android:textSize="12sp" />
|
||||
|
||||
<Button
|
||||
@@ -64,6 +65,7 @@
|
||||
android:layout_width="wrap_content"
|
||||
android:layout_height="wrap_content"
|
||||
android:text="Mock松开刹车"
|
||||
android:visibility="gone"
|
||||
android:textSize="12sp" />
|
||||
|
||||
<Button
|
||||
|
||||
Reference in New Issue
Block a user