Skip to content

Commit

Permalink
fixed errors for not saving model files for png map files
Browse files Browse the repository at this point in the history
  • Loading branch information
ZealousGinger committed Jul 3, 2024
1 parent 948676a commit 097dd6f
Showing 1 changed file with 3 additions and 3 deletions.
6 changes: 3 additions & 3 deletions linorobot2_gazebo/scripts/map2gazebo.py
Original file line number Diff line number Diff line change
Expand Up @@ -288,8 +288,8 @@ def map_callback(self):
if not os.path.exists(self.world_dir):
os.makedirs(self.world_dir)

stl_dir = self.export_dir + f'{key}/meshes/' + map_info['image'].replace('pgm','stl')
sdf_dir = self.export_dir + f'{key}/' + map_info['image'].replace('pgm','sdf')
stl_dir = self.export_dir + f'{key}/meshes/' + f'{key}.stl'
sdf_dir = self.export_dir + f'{key}/' + f'{key}.sdf'
config_dir = self.export_dir + f'{key}/model.config'

sdf_data = XML_SDF_TEMPLATE.format(name=key)
Expand All @@ -307,7 +307,7 @@ def map_callback(self):

# create world file create new parameter to save this files.
world_data = XML_WORLD_TEMPLATE.format(name=key)
world_dir = self.world_dir + map_info['image'].replace('pgm','world')
world_dir = self.world_dir + f'{key}.world'
with open(world_dir, 'w') as f:
f.write(world_data)

Expand Down

0 comments on commit 097dd6f

Please sign in to comment.