Robotics StackExchange | Archived questions

Turtlebot3 bringup won't launch (raises exception)

Hello, I have just received a turtlebot3 burger. It came with a raspberry pi 4B, on which I installed Ubuntu 22.04. I installed all the relevant humble packages with sudo apt install ros-humble-turtlebot3*

I am unable to launch turtlebot3bringup, it gives an error, seemingly looking for an environment variable 'LDSMODEL'. The full error with --debug is the following:

turtlebot@turtlebot-pi:~$ ros2 launch turtlebot3_bringup robot.launch.py --debug
[DEBUG] [launch.launch_context]: emitting event synchronously: 'launch.events.IncludeLaunchDescription'
[INFO] [launch]: All log files can be found below /home/turtlebot/.ros/log/2023-04-19-13-36-51-092069-turtlebot-pi-13675
[INFO] [launch]: Default logging verbosity is set to DEBUG
[DEBUG] [launch]: processing event: '<launch.events.include_launch_description.IncludeLaunchDescription object at 0xffffb15d05e0>'
[DEBUG] [launch]: processing event: '<launch.events.include_launch_description.IncludeLaunchDescription object at 0xffffb15d05e0>' ✓ '<launch.event_handlers.on_include_launch_description.OnIncludeLaunchDescription object at 0xffffb15d2980>'
Executing <Task finished name='Task-2' coro=<LaunchService._process_one_event() done, defined at /opt/ros/humble/lib/python3.10/site-packages/launch/launch_service.py:228> exception=InvalidLaunchFileError('py') created at /opt/ros/humble/lib/python3.10/site-packages/launch/launch_service.py:318> took 0.308 seconds
[DEBUG] [launch]: An exception was raised in an async action/event
[DEBUG] [launch]: Traceback (most recent call last):
  File "/opt/ros/humble/lib/python3.10/site-packages/launch/launch_description_sources/any_launch_file_utilities.py", line 54, in get_launch_description_from_any_launch_file
    return loader(launch_file_path)
  File "/opt/ros/humble/lib/python3.10/site-packages/launch/launch_description_sources/python_launch_file_utilities.py", line 68, in get_launch_description_from_python_launch_file
    return getattr(launch_file_module, 'generate_launch_description')()
  File "/opt/ros/humble/share/turtlebot3_bringup/launch/robot.launch.py", line 33, in generate_launch_description
    LDS_MODEL = os.environ['LDS_MODEL']
  File "/usr/lib/python3.10/os.py", line 679, in __getitem__
    raise KeyError(key) from None
KeyError: 'LDS_MODEL'

The above exception was the direct cause of the following exception:

Traceback (most recent call last):
  File "/opt/ros/humble/lib/python3.10/site-packages/launch/launch_service.py", line 336, in run_async
    raise completed_tasks_exceptions[0]
  File "/opt/ros/humble/lib/python3.10/site-packages/launch/launch_service.py", line 230, in _process_one_event
    await self.__process_event(next_event)
  File "/opt/ros/humble/lib/python3.10/site-packages/launch/launch_service.py", line 250, in __process_event
    visit_all_entities_and_collect_futures(entity, self.__context))
  File "/opt/ros/humble/lib/python3.10/site-packages/launch/utilities/visit_all_entities_and_collect_futures_impl.py", line 45, in visit_all_entities_and_collect_futures
    futures_to_return += visit_all_entities_and_collect_futures(sub_entity, context)
  File "/opt/ros/humble/lib/python3.10/site-packages/launch/utilities/visit_all_entities_and_collect_futures_impl.py", line 45, in visit_all_entities_and_collect_futures
    futures_to_return += visit_all_entities_and_collect_futures(sub_entity, context)
  File "/opt/ros/humble/lib/python3.10/site-packages/launch/utilities/visit_all_entities_and_collect_futures_impl.py", line 38, in visit_all_entities_and_collect_futures
    sub_entities = entity.visit(context)
  File "/opt/ros/humble/lib/python3.10/site-packages/launch/action.py", line 108, in visit
    return self.execute(context)
  File "/opt/ros/humble/lib/python3.10/site-packages/launch/actions/include_launch_description.py", line 148, in execute
    launch_description = self.__launch_description_source.get_launch_description(context)
  File "/opt/ros/humble/lib/python3.10/site-packages/launch/launch_description_source.py", line 84, in get_launch_description
    self._get_launch_description(self.__expanded_location)
  File "/opt/ros/humble/lib/python3.10/site-packages/launch/launch_description_sources/any_launch_description_source.py", line 53, in _get_launch_description
    return get_launch_description_from_any_launch_file(location)
  File "/opt/ros/humble/lib/python3.10/site-packages/launch/launch_description_sources/any_launch_file_utilities.py", line 57, in get_launch_description_from_any_launch_file
    raise InvalidLaunchFileError(extension, likely_errors=exceptions)
launch.invalid_launch_file_error.InvalidLaunchFileError: Caught exception when trying to load file of format [py]: 'LDS_MODEL'

[ERROR] [launch]: Caught exception in launch (see debug for traceback): Caught exception when trying to load file of format [py]: 'LDS_MODEL'
[DEBUG] [launch.launch_context]: emitting event: 'launch.events.Shutdown'
[DEBUG] [launch]: processing event: '<launch.events.shutdown.Shutdown object at 0xffffb16cd870>'
[DEBUG] [launch]: processing event: '<launch.events.shutdown.Shutdown object at 0xffffb16cd870>' ✓ '<launch.event_handlers.on_shutdown.OnShutdown object at 0xffffb15d1e70>'

At this point I am not sure what to do, I haven't found anyone online who ran into this issue. I am assuming LDSMODEL is an environment variable (as a similar error occurs when TURTLEBOT3MODEL isn't set for example), but I don't know what its value should be.

Asked by lois_R on 2023-04-19 06:49:02 UTC

Comments

Answers

the error is caused by LDS_MODEL = os.environ['LDS_MODEL'] a missing environment variable.

Try export LDS_MODEL="none"

before running

ros2 launch turtlebot3_bringup robot.launch.py

that solved it for me. (mine turtlebot3 does not have a lidar, that's why I went with "none", you might need to figure it out). Note that on Foxy there is no such variable.

Asked by sjev on 2023-05-26 13:50:18 UTC

Comments