TurtleBot3 ROS2入门教程-6.安装TurtleBot3软件包

安装所需的TurtleBot3包。

[远程电脑]

sudo apt install git -y

sudo apt install terminator -y

 

source /opt/ros/humble/setup.bash

创建工程目录,下载功能包

mkdir -p ~/turtlebot3_ws/src

cd ~/turtlebot3_ws/src/

 

git clone -b humble https://ghfast.top/https://github.com/ROBOTIS-GIT/DynamixelSDK.git

git clone -b humble https://ghfast.top/https://github.com/ROBOTIS-GIT/turtlebot3_msgs.git

git clone -b humble https://ghfast.top/https://github.com/ROBOTIS-GIT/turtlebot3.git

git clone -b humble https://ghfast.top/https://github.com/ROBOTIS-GIT/ld08_driver.git

sudo chmod 777 /dev/ttyUSB0

需要修改代码波特率 

sudo apt install python3-colcon-common-extensions

 

cd ~/turtlebot3_ws

colcon build --symlink-install

 

echo 'source ~/turtlebot3_ws/install/setup.bash' >> ~/.bashrc

source ~/.bashrc

 

环境配置

为远程PC设置ROS环境。

[远程PC]

echo 'source /usr/share/gazebo/setup.sh' >> ~/.bashrc

echo 'source ~/turtlebot3_ws/install/setup.bash' >> ~/.bashrc

echo '#export LDS_MODEL=LDS-02' >> ~/.bashrc

echo 'export LDS_MODEL=RPLIDAR' >> ~/.bashrc

echo 'export ROS_DOMAIN_ID=30 #TURTLEBOT3' >> ~/.bashrc

echo '#export TURTLEBOT3_MODEL=burger' >> ~/.bashrc

echo 'export TURTLEBOT3_MODEL=waffle_pi' >> ~/.bashrc

source ~/.bashrc