diff --git a/src/nav2_turtlebot_simulator/launch/simulator.launch.py b/src/nav2_turtlebot_simulator/launch/simulator.launch.py index 480ea60..7c9bf3a 100644 --- a/src/nav2_turtlebot_simulator/launch/simulator.launch.py +++ b/src/nav2_turtlebot_simulator/launch/simulator.launch.py @@ -203,6 +203,23 @@ def create_mkmini_world(gazebo_dir): continue pose.text = ' '.join(values) + # The black wall is centered at the origin, so its pose is unaffected by + # the spacing expansion. Enlarge both its visual and collision mesh to + # retain the same relationship with the widened green obstacles. + for mesh in model.findall('.//mesh'): + if not (mesh.findtext('uri', default='').endswith('/wall.dae')): + continue + scale = mesh.find('scale') + if scale is None: + continue + values = scale.text.split() + if len(values) != 3: + continue + try: + scale.text = ' '.join(str(float(value) * MKMINI_WORLD_SPACING_SCALE) for value in values) + except ValueError: + continue + model_tree.write( os.path.join(model_dir, 'model.sdf'), encoding='utf-8',