fix: align MKMini lidar and world obstacles
This commit is contained in:
@@ -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',
|
||||
|
||||
Reference in New Issue
Block a user