“ros2 launch turtlebot3_gazebo turtlebot3_world.launch.py​​”导致找不到包

Posted

技术标签:

【中文标题】“ros2 launch turtlebot3_gazebo turtlebot3_world.launch.py​​”导致找不到包【英文标题】:"ros2 launch turtlebot3_gazebo turtlebot3_world.launch.py" results in package not found 【发布时间】:2021-02-28 16:30:12 【问题描述】:

这些是使用的命令:

$ source /opt/ros/foxy/setup.bash
ROS_DISTRO was set to 'noetic' before. Please make sure that the environment does not mix paths from different distributions.
$ export GAZEBO_MODEL_PATH=$GAZEBO_MODEL_PATH:~/turtlebot3_ws/src/turtlebot3_simulations/turtlebot3_gazebo/models
$ export TURTLEBOT3_MODEL=burger
$ ros2 launch turtlebot3_gazebo turtlebot3_world.launch.py
Package 'turtlebot3_gazebo' not found: "package 'turtlebot3_gazebo' not found, searching: ['/opt/ros/foxy']"

【问题讨论】:

【参考方案1】:

路径中是否可能缺少子目录?

export GAZEBO_MODEL_PATH=$GAZEBO_MODEL_PATH:~/turtlebot3_ws/src/turtlebot3/turtlebot3_simulations/turtlebot3_gazebo/models

或者,如果您不需要工作区,您可以使用以下内容:

export GAZEBO_MODEL_PATH=$GAZEBO_MODEL_PATH:/opt/ros/foxy/share/turtlebot3_gazebo/models

【讨论】:

您应该将答案的内容限制在需要的范围内。不需要对该站点的引用,因此请编辑答案以反映这一点。

以上是关于“ros2 launch turtlebot3_gazebo turtlebot3_world.launch.py​​”导致找不到包的主要内容,如果未能解决你的问题,请参考以下文章