下载 turtlebot3 功能包
turtlebot 太老了可能,仿真只有indigo版本 ,直接用 3吧
ros的turtlebot wiki
turtlebot官网教程
开始安装
turtlebot3 git网址
git上下载指定版本
git clone -b 版本名 总网址
git clone -b kinetic-devel https://github.com/ROBOTIS-GIT/turtlebot3.git
然后就等着下吧
下载完编译
报这个错误
CMake Warning at /opt/ros/kinetic/share/catkin/cmake/catkinConfig.cmake:76 (find_package):
Could not find a package configuration file provided by "turtlebot3_msgs"
with any of the following names:
turtlebot3_msgsConfig.cmake
turtlebot3_msgs-config.cmake
Add the installation prefix of "turtlebot3_msgs" to CMAKE_PREFIX_PATH or
set "turtlebot3_msgs_DIR" to a directory containing one of the above files.
If "turtlebot3_msgs" provides a separate development package or SDK, be
sure it has been installed.
Call Stack (most recent call first):
turtlebot3/turtlebot3_bringup/CMakeLists.txt:13 (find_package)
-- Could not find the required component 'turtlebot3_msgs'. The following CMake error indicates that you either need to install the package with the same name or change your environment so that it can be found.
CMake Error at /opt/ros/kinetic/share/catkin/cmake/catkinConfig.cmake:83 (find_package):
Could not find a package configuration file provided by "turtlebot3_msgs"
with any of the following names:
turtlebot3_msgsConfig.cmake
turtlebot3_msgs-config.cmake
Add the installation prefix of "turtlebot3_msgs" to CMAKE_PREFIX_PATH or
set "turtlebot3_msgs_DIR" to a directory containing one of the above files.
If "turtlebot3_msgs" provides a separate development package or SDK, be
sure it has been installed.
Call Stack (most recent call first):
turtlebot3/turtlebot3_bringup/CMakeLists.txt:13 (find_package)
-- Configuring incomplete, errors occurred!
See also "/home/jone/tutorial_ws/build/CMakeFiles/CMakeOutput.log".
See also "/home/jone/tutorial_ws/build/CMakeFiles/CMakeError.log".
Invoking "cmake" failed
感觉是少 turtlebot3_msgs 功能包
查看的确
turtlebot3_bringup 这个功能包 编译需要 turtlebot3_msgs
下载 turtlebot3_msgs 功能包
git clone -b kinetic-devel https://github.com/ROBOTIS-GIT/turtlebot3_msgs
再编译 就成功了 !
因为要在仿真里做东西 所以继续下载 turtlebot3_simulations 里面有gazebo的内容
继续下载 turtlebot3_simulations
git clone -b kinetic-devel https://github.com/ROBOTIS-GIT/turtlebot3_simulations
再编译 也成功了
至此 turtlebot3 仿真 安装 成功了
试运行 一个 gazebo 仿真
roslaunch turtlebot3_gazebo turtlebot3_world.launch
报错
不用担心
打开 turtlebot3_world.launch 这个文件
看到第一行
就是 TURTLEBOT3_MODEL 这个环境变量 没有被 指定 。 有这三个选择 burger, waffle, waffle_pi
一种解决办法就是 启动 roslaunch 前
在终端 定义 TURTLEBOT3_MODEL 变量 ,
export TURTLEBOT3_MODEL=burger
加入用 burger 的话
第二种方法:
但是这样不是在启动的时候很麻烦 , 假如固定用一个的话,不如直接在launch文件里改
这样改就行 就是给 model 赋值 配置 robot_description
注释掉第一行 加入未注释内容
<!-- <arg name="model" default="$(env TURTLEBOT3_MODEL)" doc="model type [burger, waffle, waffle_pi]"/> -->
<arg name="model" default="burger"/>
在运行
roslaunch turtlebot3_gazebo turtlebot3_world.launch
成功启动
查看 topic list
有节点在订阅 cmd_vel
用个节点发布 速度信息 就可以走了 应该