系统相关
首页 > 系统相关> > Turtlebot3+ubuntu20.04+ROS noetic环境搭建

Turtlebot3+ubuntu20.04+ROS noetic环境搭建

作者:互联网

使用turtlebot3 burger进行实验,PC机已经安装好了ubuntu20.04环境

PC端安装ROS noetic

参考官方文档http://wiki.ros.org/noetic/Installation/Ubuntu

sudo sh -c 'echo "deb http://packages.ros.org/ros/ubuntu $(lsb_release -sc) main" > /etc/apt/sources.list.d/ros-latest.list'
sudo apt-key adv --keyserver 'hkp://keyserver.ubuntu.com:80' --recv-key C1CF6E31E6BADE8868B172B4F42ED6FBAB17C654
sudo apt update
sudo apt install ros-noetic-desktop-full
source /opt/ros/noetic/setup.bash
sudo apt-get install ros-noetic-joy ros-noetic-teleop-twist-joy \
  ros-noetic-teleop-twist-keyboard ros-noetic-laser-proc \
  ros-noetic-rgbd-launch ros-noetic-rosserial-arduino \
  ros-noetic-rosserial-python ros-noetic-rosserial-client \
  ros-noetic-rosserial-msgs ros-noetic-amcl ros-noetic-map-server \
  ros-noetic-move-base ros-noetic-urdf ros-noetic-xacro \
  ros-noetic-compressed-image-transport ros-noetic-rqt* ros-noetic-rviz \
  ros-noetic-gmapping ros-noetic-navigation ros-noetic-interactive-markers
sudo apt install ros-noetic-dynamixel-sdk
sudo apt install ros-noetic-turtlebot3-msgs
sudo apt install ros-noetic-turtlebot3

树莓派环境安装

sudo apt install ros-noetic-rosserial-python ros-noetic-tf
sudo apt install ros-noetic-hls-lfcd-lds-driver
sudo apt install ros-noetic-turtlebot3-msgs
sudo apt install ros-noetic-dynamixel-sdk
cd ~/catkin_ws/src/
git clone -b noetic-devel https://github.com/ROBOTIS-GIT/turtlebot3.git
cd ~/catkin_ws/src/turtlebot3
rm -r turtlebot3_description/ turtlebot3_teleop/ turtlebot3_navigation/ turtlebot3_slam/ turtlebot3_example/
cd ~/catkin_ws && catkin_make -j1
source ~/.bashrc
sudo apt install python3-rosdep2 ros-noetic-rosbash
cd ~/catkin_ws && rosdep update && rosdep install --from-paths src --ignore-src -r -y
cd ~/catkin_ws/src/turtlebot3/turtlebot3_bringup
sudo cp ./99-turtlebot3-cdc.rules /etc/udev/rules.d/
sudo udevadm control --reload-rules
sudo udevadm trigger

不进行这一步,后续rosrun会报checksum error,仍然按照官方文档进行,需要注意的是

wget https://github.com/ROBOTIS-GIT/OpenCR-Binaries/raw/master/turtlebot3/ROS1/latest/opencr_update.tar.bz2 

在进行这一步时,会connect refuse,按照网上其他改host ip映射也不行,于是选择手动去下载。

网络设置

树莓派

sudo vim ~/.bashrc #编辑修改
export ROS_MASTER_URI=http://{IP_ADDRESS_OF_REMOTE_PC}:11311
export ROS_HOSTNAME={IP_ADDRESS_OF_RASPBERRY_PI_3}
source ~/.bashrc

远程PC

sudo vim ~/.bashrc #编辑修改
export ROS_MASTER_URI=http://{IP_ADDRESS_OF_REMOTE_PC}:11311
export ROS_HOSTNAME={IP_ADDRESS_OF_REMOTE_PC}
source ~/.bashrc

开始使用

远程PC

roscore

TurtleBot3 SBC

roslaunch turtlebot3_bringup turtlebot3_robot.launch

远程PC新开一个terminal

export TURTLEBOT3_MODEL=burger
roslaunch turtlebot3_bringup turtlebot3_model.launch

安装问题

谨记

网上教程很多,主要还是要以官方文档为主

标签:ubuntu20.04,noetic,Turtlebot3,sudo,turtlebot3,apt,install,ros
来源: https://www.cnblogs.com/realtxy/p/14659507.html