diff --git a/robowaiter/proto/camera.py b/robowaiter/proto/camera.py index 8161f06..67e5a52 100644 --- a/robowaiter/proto/camera.py +++ b/robowaiter/proto/camera.py @@ -480,7 +480,7 @@ def get_obstacle_point(sence, db, scene, cur_obstacle_world_points, map_ratio): # plt.text(0, 0.7, f'检测物体数量:{obj_detect_count}', fontsize=10) # plt.show() - return cur_obstacle_world_points, cur_objs_id + return cur_obstacle_world_points, cur_objs_id, obj_detect_count diff --git a/robowaiter/scene/scene.py b/robowaiter/scene/scene.py index 42030d5..8108ae3 100644 --- a/robowaiter/scene/scene.py +++ b/robowaiter/scene/scene.py @@ -1,4 +1,5 @@ import io +import json import pickle import sys import time @@ -1180,7 +1181,7 @@ class Scene: # cur_obstacle_world_points, cur_objs_id = camera.get_obstacle_point(plt, db, scene, # cur_obstacle_world_points, map_ratio) - cur_obstacle_world_points, cur_objs_id = camera.get_obstacle_point(self, db, scene, + cur_obstacle_world_points, cur_objs_id, obj_detect_count= camera.get_obstacle_point(self, db, scene, cur_obstacle_world_points, map_ratio) # cur_obstacle_world_points, cur_objs_id = self.get_obstacle_point(db, scene, map_ratio) # # self.get_obstacle_point(db, scene, cur_obstacle_world_points, map_ratio) @@ -1206,12 +1207,12 @@ class Scene: # cur_objs, objs_name_set = camera.get_semantic_map(GrabSim_pb2.CameraName.Head_Segment, cur_objs, # objs_name_set) - cur_obstacle_world_points, cur_objs_id = camera.get_obstacle_point(self, db, scene, + cur_obstacle_world_points, cur_objs_id, obj_detect_count= camera.get_obstacle_point(self, db, scene, cur_obstacle_world_points, map_ratio) # if scene.info == "Unreachable": print(scene.info) - return cur_obstacle_world_points, cur_objs_id + return cur_obstacle_world_points, cur_objs_id, obj_detect_count def isOutMap(self, pos, min_x=-200, max_x=600, min_y=-250, max_y=1300): if pos[0] <= min_x or pos[0] >= max_x or pos[1] <= min_y or pos[1] >= max_y: @@ -1610,7 +1611,12 @@ class Scene: semantic_info_str+= f'检测行人数量:{walker_detect_count}'+"\n\n" semantic_info_str += f'检测物体数量:{obj_detect_count}' + "\n\n" semantic_info_str += f'更新语义信息:{update_info_count}' + "\n\n" - semantic_info_str += f'已存语义信息:{self.infoCount}' + "\n" + + + file_json_name = os.path.join(root_path, 'robowaiter/proto/objs.json') + with open(file_json_name) as f: + data = json.load(f) + semantic_info_str += f'已存语义信息:{len(data)}' + "\n" # print("======semantic_info_str===========") diff --git a/robowaiter/scene/ui/scene_ui.py b/robowaiter/scene/ui/scene_ui.py index b070a3a..78d557f 100644 --- a/robowaiter/scene/ui/scene_ui.py +++ b/robowaiter/scene/ui/scene_ui.py @@ -77,7 +77,7 @@ class SceneUI(Scene): break # cur_obstacle_world_points, cur_objs_id = self.navigation_move(plt, cur_objs, cur_obstacle_world_points, # [[goal[0], goal[1]]], map_ratio, db, 0, 11) - cur_obstacle_world_points, cur_objs_id = self.navigation_move(self, cur_objs, cur_obstacle_world_points, + cur_obstacle_world_points, cur_objs_id, obj_detect_count = self.navigation_move(self, cur_objs, cur_obstacle_world_points, [[goal[0], goal[1]]], map_ratio, db, 0, 11) for point in cur_obstacle_world_points: if point[0] < -350 or point[0] > 600 or point[1] < -400 or point[1] > 1450: @@ -113,7 +113,19 @@ class SceneUI(Scene): # 已存语义信息 added_info += new_add_info # plt.text(0, 0.3, f'已存语义信息:{added_info}', fontsize=10) # 在图中添加文字,x和y坐标是在这个图片大小内的相对位置,fontsize是字体大小 + + + semantic_info_str = "" + # semantic_info_str += f'检测行人数量:{walker_detect_count}' + "\n\n" + semantic_info_str += f'检测物体数量:{obj_detect_count}' + "\n\n" + semantic_info_str += f'更新语义信息:{new_add_info}' + "\n\n" + semantic_info_str += f'已存语义信息:{self.infoCount}' + "\n" + self.infoCount = added_info + + # print("======semantic_info_str===========") + + self.ui_func(("get_semantic_info", semantic_info_str)) plt.axis("off") # plt.show() print("------------当前检测到的物品信息--------------") diff --git a/robowaiter/scene/ui/window.py b/robowaiter/scene/ui/window.py index 17505f9..6a8ef1a 100644 --- a/robowaiter/scene/ui/window.py +++ b/robowaiter/scene/ui/window.py @@ -344,7 +344,7 @@ class Ui_MainWindow(object): self.btn_VLN.setText(_translate("MainWindow", "视觉语言导航")) self.btn_VLM.setText(_translate("MainWindow", "视觉语言操作")) self.btn_GQA.setText(_translate("MainWindow", "具身多轮对话")) - self.btn_OT.setText(_translate("MainWindow", "开放具身任务")) + self.btn_OT.setText(_translate("MainWindow", "复杂具身任务")) self.btn_AT.setText(_translate("MainWindow", "自主具身任务")) self.cb_task.setPlaceholderText(_translate("MainWindow", "其他任务")) diff --git a/robowaiter/scene/ui/window.ui b/robowaiter/scene/ui/window.ui index 85e9bbd..71a2855 100644 --- a/robowaiter/scene/ui/window.ui +++ b/robowaiter/scene/ui/window.ui @@ -496,7 +496,7 @@ p, li { white-space: pre-wrap; } - 开放具身任务 + 复杂具身任务