diff --git a/gen_locations_on_mesh/gen_locations_on_mesh/gen_locations_on_mesh_node.py b/gen_locations_on_mesh/gen_locations_on_mesh/gen_locations_on_mesh_node.py index edc1946..ef1733a 100644 --- a/gen_locations_on_mesh/gen_locations_on_mesh/gen_locations_on_mesh_node.py +++ b/gen_locations_on_mesh/gen_locations_on_mesh/gen_locations_on_mesh_node.py @@ -185,7 +185,6 @@ class GenLocationsOnMeshNode(Node): self.dropped_points = {} self.declare_parameter('mesh_filename', '') - self.declare_parameter('cache_filename', '') self.declare_parameter('init_number_of_points', 10) self.declare_parameter('max_z_coord', 2.) self.declare_parameter('min_distance_between_points', 2.) @@ -246,7 +245,7 @@ class GenLocationsOnMeshNode(Node): def _load_data(self): '''загрузка мэша и его предобработка''' # сначала пытаемся загрузить кэшированный вариант - cache_filename = self.get_parameter('cache_filename').get_parameter_value().string_value + cache_filename = self.get_parameter('mesh_filename').get_parameter_value().string_value + '.pkl' try: with open(cache_filename, 'rb') as f: dt = pickle.load(f) @@ -260,10 +259,11 @@ class GenLocationsOnMeshNode(Node): self.vs = mesh.vertices self.trs = get_all_triangles_with_correct_orientation(mesh.vertices, mesh.faces, - 0.1) - conns = calc_connections(self.trs) - pieces = calc_pieces(self.trs, conns) - self.the_piece = find_largest_piece(pieces) + 1.5) + #conns = calc_connections(self.trs) + #pieces = calc_pieces(self.trs, conns) + #self.the_piece = find_largest_piece(pieces) + self.the_piece = list(range(len(self.trs))) # сохраняем кэш try: with open(cache_filename, 'wb') as f: diff --git a/gen_locations_on_mesh/launch/mesh_loc_generator.py b/gen_locations_on_mesh/launch/mesh_loc_generator.py index 9ed206c..0ce1c9a 100644 --- a/gen_locations_on_mesh/launch/mesh_loc_generator.py +++ b/gen_locations_on_mesh/launch/mesh_loc_generator.py @@ -6,21 +6,17 @@ from launch_ros.substitutions import FindPackageShare def generate_launch_description(): package_name = 'gen_locations_on_mesh' - #mesh_file = 'raw_surface.ply' - mesh_file = 'sirius_scene_floor.ply' - cache_file = 'cache.pkl' + mesh_file = 'sirius_scene_floor_and_objs.ply' # файл карты для загрузки pkg_share = FindPackageShare(package=package_name).find(package_name) mesh_path = os.path.join(pkg_share, 'share', mesh_file) - cache_path = os.path.join(pkg_share, 'share', cache_file) start_gen_location_on_mesh_cmd = Node( name='gen_locations_on_mesh', package='gen_locations_on_mesh', executable='gen_locations_on_mesh', parameters=[{'mesh_filename': mesh_path, - 'cache_filename': cache_path, 'init_number_of_points': 20, 'max_z_coord': 2.}]) diff --git a/gen_locations_on_mesh/share/raw_surface.ply b/gen_locations_on_mesh/share/sirius_scene_floor_and_objs.ply similarity index 55% rename from gen_locations_on_mesh/share/raw_surface.ply rename to gen_locations_on_mesh/share/sirius_scene_floor_and_objs.ply index e1d96de..65636e1 100644 Binary files a/gen_locations_on_mesh/share/raw_surface.ply and b/gen_locations_on_mesh/share/sirius_scene_floor_and_objs.ply differ