fix: align MKMini lidar and world obstacles

This commit is contained in:
2026-08-06 14:45:51 +09:00
parent 8789bf6085
commit 83c92463c8
2 changed files with 19 additions and 1 deletions
@@ -220,6 +220,24 @@ def create_mkmini_world(gazebo_dir):
except ValueError:
continue
# The MKMini lidar is centered at 0.52 m. Raise the original 0.5 m white
# pillars so they remain observable obstacles instead of falling below the
# scan plane.
for element in (*model.findall('.//collision'), *model.findall('.//visual')):
cylinder = element.find('./geometry/cylinder')
if cylinder is None:
continue
if cylinder.findtext('radius') != '0.15' or cylinder.findtext('length') != '0.5':
continue
cylinder.find('length').text = '0.8'
pose = element.find('pose')
if pose is None:
continue
values = pose.text.split()
if len(values) == 6:
values[2] = '0.4'
pose.text = ' '.join(values)
model_tree.write(
os.path.join(model_dir, 'model.sdf'),
encoding='utf-8',