From 4adc78553c8d48ff122506195fa33641134bd7b1 Mon Sep 17 00:00:00 2001
From: yincheng.zhong <634916154@qq.com>
Date: 星期六, 13 十二月 2025 18:55:14 +0800
Subject: [PATCH] 路径点不重复的控制算法测试通了,但是好像不如之前路径点重复的版本好。增加了蓝牙接口部分。准备移植外包的MQTT。

---
 python/hitl/run_sim.py |   28 ++++++++++++++++++++++++----
 1 files changed, 24 insertions(+), 4 deletions(-)

diff --git a/python/hitl/run_sim.py b/python/hitl/run_sim.py
index 284a9cf..2e14e09 100644
--- a/python/hitl/run_sim.py
+++ b/python/hitl/run_sim.py
@@ -339,14 +339,27 @@
         self.view.sceneMouseMoved.connect(self._update_mouse_pos)
         left_layout.addWidget(self.view, stretch=1)
 
+        # Bottom bar for map controls
+        bottom_bar = QtWidgets.QWidget()
+        bottom_layout = QtWidgets.QHBoxLayout(bottom_bar)
+        bottom_layout.setContentsMargins(0, 4, 0, 0)
+
         self.follow_checkbox = QtWidgets.QCheckBox("鑷姩璺熼殢杞﹁締")
         self.follow_checkbox.setChecked(True)
         self.follow_checkbox.toggled.connect(self._on_follow_toggled)
-        left_layout.addWidget(self.follow_checkbox, alignment=QtCore.Qt.AlignLeft)
+        bottom_layout.addWidget(self.follow_checkbox)
+
+        self.clear_trail_btn = QtWidgets.QPushButton("娓呴櫎杞ㄨ抗")
+        self.clear_trail_btn.clicked.connect(self._clear_trail)
+        bottom_layout.addWidget(self.clear_trail_btn)
+
+        bottom_layout.addStretch(1)
 
         self.mouse_pos_label = QtWidgets.QLabel("E: 0.00  N: 0.00")
         self.mouse_pos_label.setStyleSheet("color:#222; background:rgba(255,255,255,190); padding:2px 6px; border-radius:4px;")
-        left_layout.addWidget(self.mouse_pos_label, alignment=QtCore.Qt.AlignRight)
+        bottom_layout.addWidget(self.mouse_pos_label)
+
+        left_layout.addWidget(bottom_bar)
 
         layout.addWidget(left_panel, stretch=3)
 
@@ -430,12 +443,13 @@
         status_layout = QtWidgets.QVBoxLayout(status_group)
         self.info_label = QtWidgets.QLabel("绛夊緟鏁版嵁...")
         self.info_label.setAlignment(QtCore.Qt.AlignTop | QtCore.Qt.AlignLeft)
-        self.info_label.setStyleSheet("font-family: Consolas, 'Courier New'; font-size: 12px;")
+        self.info_label.setStyleSheet("font-family: Consolas, 'Courier New'; font-size: 14px;")
         info_scroll = QtWidgets.QScrollArea()
         info_scroll.setWidgetResizable(True)
         info_scroll.setWidget(self.info_label)
+        info_scroll.setMinimumHeight(500)  # 杩涗竴姝ュ鍔犳渶灏忛珮搴�
         status_layout.addWidget(info_scroll)
-        right_layout.addWidget(status_group, stretch=1)
+        right_layout.addWidget(status_group, stretch=4)  # 杩涗竴姝ュ鍔犲竷灞�鏉冮噸锛屼粠2澧炲姞鍒�4
 
         # Stack table
         stack_group = QtWidgets.QGroupBox("鍫嗘爤鐩戞祴")
@@ -556,6 +570,12 @@
         if checked and self.pose_status:
             self.view.centerOn(self.pose_status.east, -self.pose_status.north)
 
+    def _clear_trail(self):
+        """娓呴櫎鍦板浘涓婄殑杞ㄨ抗鐐�"""
+        self.trail_points = []
+        # Update scene to remove trail
+        self._update_scene()
+
     def _update_mouse_pos(self, east: float, scene_y: float):
         north = -scene_y
         self.mouse_pos_label.setText(f"E: {east: .2f}  N: {north: .2f}")

--
Gitblit v1.10.0