障碍物检测初始化
This commit is contained in:
@@ -344,6 +344,7 @@ export default function DeviceStatusPage() {
|
||||
const controllerRef = useRef<DeviceController | null>(null);
|
||||
|
||||
const isFirstConnect = useRef(true);
|
||||
const [detectReportInfo, setDeportInfo] = useState<any>(null);
|
||||
|
||||
// 标记本次会话是否已经发起过控制权限申请,避免手柄/方向盘高频更新时重复申请
|
||||
|
||||
@@ -1184,6 +1185,11 @@ export default function DeviceStatusPage() {
|
||||
mapRef.current?.flyToPosition?.(realtimePosition, { height: 300 });
|
||||
|
||||
};
|
||||
const handleDetectionReport = (res) => {
|
||||
setDeportInfo(res);
|
||||
console.log("获取障碍物信息", res)
|
||||
|
||||
}
|
||||
|
||||
|
||||
|
||||
@@ -1207,6 +1213,9 @@ export default function DeviceStatusPage() {
|
||||
|
||||
controller.handleArrivedPoint = handleFinishEdPoint;
|
||||
|
||||
controller.onDetectionReport = handleDetectionReport;
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
@@ -1511,6 +1520,14 @@ export default function DeviceStatusPage() {
|
||||
|
||||
return;
|
||||
|
||||
}
|
||||
console.log(realtimePosition?.controlMode, "现在的控制controlmode")
|
||||
if (realtimePosition?.controlMode != 3 || realtimePosition?.control_mode != 3) {
|
||||
|
||||
messageApi.warning(t('devices.noRemoteControl'));
|
||||
|
||||
return;
|
||||
|
||||
}
|
||||
|
||||
console.log('Gamepad state updated:', state);
|
||||
@@ -2433,6 +2450,8 @@ export default function DeviceStatusPage() {
|
||||
ifClearNavLine={clearNavLine}
|
||||
|
||||
ifClearPlanLine={clearPlanLine}
|
||||
detectReportInfo={detectReportInfo}
|
||||
|
||||
|
||||
from="deviceStatus" onMarkPoint={handleMapMarkPoint} onClearDraw={(fn) => { clearDrawRef.current = fn; }}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user