ROS2下使用TurtleBot3

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

添加环境变量

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

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

添加环境变量

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、运行

运行gazebo
ros2 launch turtlebot3_gazebo turtlebot3_world.launch.py

运行键盘控制

ros2 run turtlebot3_teleop teleop_keyboard

©著作权归作者所有,转载或内容合作请联系作者
【社区内容提示】社区部分内容疑似由AI辅助生成,浏览时请结合常识与多方信息审慎甄别。
平台声明:文章内容(如有图片或视频亦包括在内)由作者上传并发布,文章内容仅代表作者本人观点,简书系信息发布平台,仅提供信息存储服务。

相关阅读更多精彩内容

友情链接更多精彩内容