ros2 config_error ai_generated true

[ERROR] [turtlebot3_gazebo]: No robot spawned. Check TURTLEBOT3_MODEL environment variable.

ID: ros2/turtlebot3-gazebo-no-robot-spawned

Also available as: JSON · Markdown · 中文
85%Fix Rate
88%Confidence
1Evidence
2023-06-15First Seen

Version Compatibility

VersionStatusIntroducedDeprecatedNotes
ROS2 Humble (Ubuntu 22.04) active
ROS2 Iron (Ubuntu 22.04) active
turtlebot3 2.2.x active
Gazebo 11.x active

Root Cause

The TURTLEBOT3_MODEL environment variable is not set or set to an invalid model name (e.g., 'burger', 'waffle', 'waffle_pi') before launching Gazebo simulation.

generic

中文

在启动 Gazebo 仿真之前,TURTLEBOT3_MODEL 环境变量未设置或设置为无效的模型名称(例如 'burger'、'waffle'、'waffle_pi')。

Official Documentation

https://emanual.robotis.com/docs/en/platform/turtlebot3/quick-start/

Workarounds

  1. 90% success export TURTLEBOT3_MODEL=burger
    export TURTLEBOT3_MODEL=burger
  2. 95% success Add export to .bashrc: echo 'export TURTLEBOT3_MODEL=burger' >> ~/.bashrc && source ~/.bashrc
    Add export to .bashrc: echo 'export TURTLEBOT3_MODEL=burger' >> ~/.bashrc && source ~/.bashrc

中文步骤

  1. export TURTLEBOT3_MODEL=burger
  2. 将导出命令添加到 .bashrc:echo 'export TURTLEBOT3_MODEL=burger' >> ~/.bashrc && source ~/.bashrc

Dead Ends

Common approaches that don't work:

  1. 95% fail

    The launch file reads TURTLEBOT3_MODEL at startup; without it, no robot URDF is loaded.

  2. 90% fail

    Only 'burger', 'waffle', 'waffle_pi' are valid; typos or unsupported models cause spawn failure.

  3. 80% fail

    The environment variable must be set in the same shell session before launch, not sourced from a different workspace.