From c6f04197a52ae80a7924646638770ddcf11a356e Mon Sep 17 00:00:00 2001 From: mmporong Date: Wed, 12 Aug 2026 22:21:14 +0900 Subject: [PATCH] Do not require LDS_MODEL to be set in robot.launch.py The Bringup page of the e-Manual documents the startup sequence as export TURTLEBOT3_MODEL=burger ros2 launch turtlebot3_bringup robot.launch.py and never mentions LDS_MODEL. Following it exactly fails before any node starts: KeyError: 'LDS_MODEL' InvalidFrontendLaunchFileError: The launch file may have a syntax error, or its format is unknown The second line is misleading, since the launch file is fine and only an environment variable is missing. robot.launch.py already defines what to do with an unrecognised LDS_MODEL: the final else branch selects hls_lfcd_lds_driver, the same driver as the 'LDS-01' branch. An unset variable is the only case that raises instead of reaching that fallback. Reading it with os.environ.get() lets None fall into the existing else branch, which is also consistent with the ROS_DISTRO lookup two lines above. Explicit values are unaffected: 'LDS-02' still selects ld08_driver and 'LDS-03' still selects coin_d4_driver. Signed-off-by: mmporong --- turtlebot3_bringup/launch/robot.launch.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/turtlebot3_bringup/launch/robot.launch.py b/turtlebot3_bringup/launch/robot.launch.py index 0bbcee1f..73ec289f 100644 --- a/turtlebot3_bringup/launch/robot.launch.py +++ b/turtlebot3_bringup/launch/robot.launch.py @@ -32,7 +32,7 @@ def generate_launch_description(): TURTLEBOT3_MODEL = os.environ['TURTLEBOT3_MODEL'] ROS_DISTRO = os.environ.get('ROS_DISTRO') - LDS_MODEL = os.environ['LDS_MODEL'] + LDS_MODEL = os.environ.get('LDS_MODEL') LDS_LAUNCH_FILE = '/hlds_laser.launch.py' namespace = LaunchConfiguration('namespace', default='')