1、安裝
cd ~/ros2_ws/src/
sudo apt install ros-foxy-gazebo-ros-pkgs
git clone -b foxy-devel?https://github.com/ROBOTIS-GIT/DynamixelSDK.git
git clone -b foxy-devel?https://github.com/ROBOTIS-GIT/turtlebot3_msgs.git
git clone -b foxy-devel?https://github.com/ROBOTIS-GIT/turtlebot3.git
git clone -b foxy-devel https://github.com/ROBOTIS-GIT/turtlebot3_simulations.git
編譯
cd ..
colcon build --symlink-install
添加環(huán)境變量
echo 'source ~/ros2_ws/install/setup.bash' >> ~/.bashrc
echo 'export ROS_DOMAIN_ID=30 #TURTLEBOT3' >> ~/.bashrc
添加環(huán)境變量
echo 'export GAZEBO_MODEL_PATH=$GAZEBO_MODEL_PATH:~/ros2_ws/src/turtlebot3/turtlebot3_simulations/turtlebot3_gazebo/models' >> ~/.bashrc
source ~/.bashrc
依賴安裝:
sudo apt-get install ros-foxy-gazebo-*
sudo apt install ros-foxy-cartographer
sudo apt install ros-foxy-cartographer-ros
sudo apt install ros-foxy-navigation2
sudo apt install ros-foxy-nav2-bringup
2胜宇、運(yùn)行
運(yùn)行g(shù)azebo
ros2 launch turtlebot3_gazebo turtlebot3_world.launch.py
運(yùn)行鍵盤控制
ros2 run turtlebot3_teleop teleop_keyboard