1. 下載安裝包
官網地址:
http://wiki.ros.org/action/show/Robots/TurtleBot?action=show&redirect=TurtleBot
所有相關的包都在這里, 按需下載(注意選擇melodic-devel分支):
我全部下載了, 所有的下載鏈接如下:
- turtlebot3: https://github.com/ROBOTIS-GIT/turtlebot3/tree/melodic-devel
- turtlebot3_msgs: https://github.com/ROBOTIS-GIT/turtlebot3_msgs/tree/melodic-devel
- turtlebot3_simulations: https://github.com/ROBOTIS-GIT/turtlebot3_simulations/tree/melodic-devel
- turtlebot3_applications: https://github.com/ROBOTIS-GIT/turtlebot3_applications/tree/melodic-devel
- turtlebot3_autorace: https://github.com/ROBOTIS-GIT/turtlebot3_autorace/tree/melodic-devel
- hls_lfcd_lds_driver: https://github.com/ROBOTIS-GIT/hls_lfcd_lds_driver/tree/melodic-devel
- open_manipulator: https://github.com/ROBOTIS-GIT/open_manipulator/tree/melodic-devel
- dynamixel_sdk: https://github.com/ROBOTIS-GIT/DynamixelSDK/tree/melodic-devel
下載完成后解壓, 並重命名把后面的"-melodic-devel"刪掉(不重命名也不影響, 只是我有強迫症), 然后把這些文件夾放到一個文件夾下, 方便后面的操作:
2. 安裝
Ctrl+Alt+T 打開終端, 輸入:
echo $ROS_PACKAGE_PATH
/opt/ros/melodic/share
為ROS包的路徑, 現在我們把這些解壓后的文件夾復制到這個路徑下:
先cd到你放那些包的文件夾下,
sudo chmod 755 -R *
sudo cp -r * /opt/ros/melodic/share/
看看復制成功沒有
ls /opt/ros/melodic/share/
3. 驗證和仿真
運行rospack list
, 有我們安裝的那些包就行了
rospack list
部分截圖如下:
我們來運行仿真:
roslaunch turtlebot3_gazebo turtlebot3_world.launch
報了錯誤:
RLException: Invalid <arg> tag: environment variable 'TURTLEBOT3_MODEL' is not set.
Arg xml is <arg default="$(env TURTLEBOT3_MODEL)" doc="model type [burger, waffle, waffle_pi]" name="model"/>
The traceback for the exception was written to the log file
TURTLEBOT3_MODEL
沒有設置, 需要給它指定[burger, waffle, waffle_pi]中的一個, 我們隨便指定一個:
在終端輸入:
export TURTLEBOT3_MODEL=burger
再次運行上面的命令:
roslaunch turtlebot3_gazebo turtlebot3_world.launch
等待一會兒, 看, 我們的TurtleBot3 Burger和一些障礙物出現了:
最后我們把"export TURTLEBOT3_MODEL=burger"添加到.bashrc文件, 免得每次重新設置這個變量:
echo "export TURTLEBOT3_MODEL=burger" >> ~/.bashrc
此文原創禁止轉載,轉載文章請聯系博主並注明來源和出處,謝謝!
作者: Raina_RLN https://www.cnblogs.com/raina/