fix: publish MKMini lidar transform for SLAM

This commit is contained in:
2026-08-06 15:09:49 +09:00
parent 83c92463c8
commit 6a09e31967
@@ -368,11 +368,23 @@ def launch_gazebo(context):
entity_name = 'mkmini_gazebo' entity_name = 'mkmini_gazebo'
model_directory = os.path.join(simulator_dir, 'models') model_directory = os.path.join(simulator_dir, 'models')
model_path = os.path.join(model_directory, 'mkmini_gazebo', 'model.sdf') model_path = os.path.join(model_directory, 'mkmini_gazebo', 'model.sdf')
# Keep the default spawn point proportional to the expanded MKMini map. # The world obstacles are spread out for MKMini, but the original
if spawn_x == '-2.0' and spawn_y == '-0.5': # TurtleBot spawn is already inside the navigable centre of that map.
spawn_x = str(-2.0 * MKMINI_WORLD_SPACING_SCALE) # Scaling it as well placed the robot against the generated map edge.
spawn_y = str(-0.5 * MKMINI_WORLD_SPACING_SCALE) # Gazebo's fixed joint does not reliably publish this transform to the
static_transforms = [] # separate SLAM container. Publish the sensor mounting point explicitly.
static_transforms = [
Node(
package='tf2_ros',
executable='static_transform_publisher',
name='mkmini_lidar_tf',
arguments=[
'--x', '0', '--y', '0', '--z', '0.6',
'--roll', '0', '--pitch', '0', '--yaw', '0',
'--frame-id', 'base_link', '--child-frame-id', 'os_lidar',
],
),
]
else: else:
raise RuntimeError('platform must be turtlebot3 or mkmini') raise RuntimeError('platform must be turtlebot3 or mkmini')