一、配置并编译
1. 安装 ros
略
2. 安装 protoc
git clone https://gitcode.net/mirrors/protocolbuffers/protobuf.git
cd protobuf
git submodule update --init --recursive
./autogen.sh
./configure
make
make check
sudo make install
sudo ldconfig
protoc --version # verify
3. 安装 protobuf
sudo apt install libprotobuf-dev libignition-msgs* ros-foxy-gazebo-dev
4. 编译turtlebot3(noetic)
mkdir -p ~/catkin_ws/src && cd ~/catkin_ws/src
git clone -b noetic-devel https://gitcode.net/mirrors/ROBOTIS-GIT/turtlebot3_msgs.git
git clone -b noetic-devel https://gitcode.net/mirrors/ROBOTIS-GIT/turtlebot3.git
cd ~/catkin_ws
rosdep install --from-paths src -i -y
catkin_make
source devel/setup.bash
export TURTLEBOT3_MODEL=waffle
cd ~/catkin_ws/src
git clone -b noetic-devel https://ghproxy.com/https://github.com/ROBOTIS-GIT/turtlebot3_simulations.git
cd .. && catkin_make
cd && export TURTLEBOT3_MODEL=waffle && source ~/catkin_ws/devel/setup.bash
5. 编译github上的代码
将github上的包解压到~/catkin_ws/src
中,再cd ~/catkin_ws && catkin_make
二、运行并调试
1. 运行代码
在两个终端中分别运行
roslaunch tb3_control control.launch
roslaunch turtlebot3_fake turtlebot3_fake.launch
作者视频:video.
2. 调整参数
最后修改为 Kp = 0.3, Ki = 0.01, Kd = 0.1