fix: publish MKMini lidar transform for SLAM
This commit is contained in:
@@ -368,11 +368,23 @@ def launch_gazebo(context):
|
||||
entity_name = 'mkmini_gazebo'
|
||||
model_directory = os.path.join(simulator_dir, 'models')
|
||||
model_path = os.path.join(model_directory, 'mkmini_gazebo', 'model.sdf')
|
||||
# Keep the default spawn point proportional to the expanded MKMini map.
|
||||
if spawn_x == '-2.0' and spawn_y == '-0.5':
|
||||
spawn_x = str(-2.0 * MKMINI_WORLD_SPACING_SCALE)
|
||||
spawn_y = str(-0.5 * MKMINI_WORLD_SPACING_SCALE)
|
||||
static_transforms = []
|
||||
# The world obstacles are spread out for MKMini, but the original
|
||||
# TurtleBot spawn is already inside the navigable centre of that map.
|
||||
# Scaling it as well placed the robot against the generated map edge.
|
||||
# Gazebo's fixed joint does not reliably publish this transform to the
|
||||
# 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:
|
||||
raise RuntimeError('platform must be turtlebot3 or mkmini')
|
||||
|
||||
|
||||
Reference in New Issue
Block a user