diff --git a/waypoint_manager/scripts/devel_GUI.py b/waypoint_manager/scripts/devel_GUI.py index c995c6b..05b3fc2 100755 --- a/waypoint_manager/scripts/devel_GUI.py +++ b/waypoint_manager/scripts/devel_GUI.py @@ -76,11 +76,12 @@ self.point_rad = 10 origin = self.__map_yaml['origin'] # originは地図上の原点から画像の左下までの距離[x,y](m) self.map_resolution = self.__map_yaml['resolution'] + # 画像上の原点座標を保持(左上から横x, 縦y) self.img_origin = [-origin[0]/self.map_resolution, self.__map_img_pil.height+origin[1]/self.map_resolution, 1] self.plot_origin() ## waypoints.yamlからウェイポイント情報を取得し、画像にポイントを描画 - self.waypoints_id = np.array([], np.uint8) + self.waypoints_id = np.array([], np.uint16) self.plot_waypoints() ## マウスイベントに対するコールバックを設定 @@ -111,7 +112,7 @@ map_img_pil = Image.open(Path(str(map_path)+'.pgm')) # .pgmをplillowで読み込む with open(str(map_path)+'.yaml') as file: # .yamlを読み込む map_yaml = ruamel.yaml.YAML().load(file) - + self.master.title(map_path.name + " - " + self.master.title()) return map_img_pil, map_yaml # この2つの変数を戻り値とする @@ -124,6 +125,7 @@ file_path = Path('..','..','waypoint_nav','param','waypoints.yaml') with open(file_path) as file: waypoints = ruamel.yaml.YAML().load(file) + self.master.title(file_path.name + " - " + self.master.title()) return waypoints, file_path @@ -156,7 +158,7 @@ if len(self.waypoints_id) != len(points): for id in self.waypoints_id: self.canvas.delete(id) - self.waypoints_id = np.array([], np.uint8) + self.waypoints_id = np.array([], np.uint16) # 全てのウェイポイントを描画 for i in range(len(points)): img_x = float(points[i]['point']['x']) / self.map_resolution + self.img_origin[0]