# ros2_exercise **Repository Path**: XIAO_LU_sama/ros2_exercise ## Basic Information - **Project Name**: ros2_exercise - **Description**: 鱼香肉丝ros2的练习,可以进行简单路径规划导航的机器人 - **Primary Language**: Unknown - **License**: Not specified - **Default Branch**: master - **Homepage**: None - **GVP Project**: No ## Statistics - **Stars**: 1 - **Forks**: 0 - **Created**: 2026-03-23 - **Last Updated**: 2026-05-31 ## Categories & Tags **Categories**: Uncategorized **Tags**: None ## README # 基于ros 2和Navagation 2的导航机器人 Ps.在vscode中使用Ctrl + shift + v可以预览md文件 ## 1.项目介绍 本项目截取自Fishros的自动巡检机器人,完成了其中路径规划的核心框架和代码编写 ## 2.使用方法 本项目开发平台信息如下: - 系统版本: Ubunt22.04 - ROS 版本:ROS 2 Humble ### 2.1安装 本项目建图采用 slam-toolbox,导航采用 Navigation 2 ,仿真采用 Gazebo,运动控制采用 ros2-control 实现,构建之前请先安装依赖,指令如下: 1. 安装 SLAM 和 Navigation 2 ``` sudo apt install ros-$ROS_DISTRO-nav2-bringup ros-$ROS_DISTRO-slam-toolbox ``` 2. 安装仿真相关功能包 ``` sudo apt install ros-$ROS_DISTRO-robot-state-publisher ros-$ROS_DISTRO-joint-state-publisher ros-$ROS_DISTRO-gazebo-ros-pkgs ros-$ROS_DISTRO-ros2-controllers ros-$ROS_DISTRO-xacro ``` ### 2.2运行 安装完成依赖后,可以使用 colcon 工具进行构建和运行。 构建功能包 ``` colcon build ``` 运行仿真 ``` source install/setup.bash ros2 launch fishbot_description gazebo_sim.launch.py ``` 运行导航 ``` source install/setup.bash ros2 launch fishbot_navigation2 navigation2.launch.py ``` 运行多指定点导航 ``` source install/setup.bash ros2 run fishbot_application waypoint_follower ``` 可以在rviz2和gazebo中观察机器人的运动轨迹(指定了三个目标点) ## 3.作者 - 原作者:[fishros](https://gitee.com/fishros) - 学习与摘取:[XIAO_LU_sama](https://gitee.com/XIAO_LU_sama)