# ros2_patrol_robot_test **Repository Path**: chugc/ros2_patrol_robot_test ## Basic Information - **Project Name**: ros2_patrol_robot_test - **Description**: ros2小鱼案例 - **Primary Language**: Unknown - **License**: Not specified - **Default Branch**: master - **Homepage**: None - **GVP Project**: No ## Statistics - **Stars**: 1 - **Forks**: 0 - **Created**: 2025-02-08 - **Last Updated**: 2025-05-19 ## Categories & Tags **Categories**: Uncategorized **Tags**: None ## README __7.0 自主导航__ 当前位置 目标点位置 __7.1 机器人自主导航解释__ 里程计 惯性传感器 -> 位置信息 激光雷达 ->地图信息 路径规划 恢复行为 __7.2.1 构建导航地图__ sudo apt install ros-$ROS_DISTRO-slam-toolbox >ros2 launch slam_toolbox online_async_launch.py use_sim_time:=True >rviz2 > colcon build > source install/setup.bash > ros2 launch fishbot_description gazebo_sim.launch.py >ros2 run teleop_twist_keyboard teleop_twist_keyboard __7.2.2 保存地图文件__ sudo apt install ros-$ROS_DISTRO-nav2-map-server ros2 pkg create fishbot_navigation2 >ros2 run nav2_map_server map_saver_cli -f room `到maps文件夹下` 得到room.pgm room.yaml __7.3.1 Navigation2安装以及介绍__ sudo apt install ros-$ROS_DISTRO-navigation2 sudo apt install ros-$ROS_DISTRO-nav2-bringup 实体功能包 __7.3.2 编写launch并启动导航__ cp /opt/ros/foxy/share/nav2_bringup/params/nav2_params.yaml . `config` __7.3.3 编写launch并启动导航__ `launch` > colcon build > source install/setup.bash ros2 launch fishbot_navigation2 navigation2.launch.py 给一个预估位置 > ros2 launch fishbot_description gazebo_sim.launch.py __7.3.4 进行单点与路点导航__ __7.3.5 导航动态避障__ __7.3.6 导航速度及膨胀半价__ controller_server: inflation_radius __7.3.7 优化到点精度__ goal_checker xy_goal_tolerance: 0.25 __7.4.1 用话题初始化机器人位姿__ ros2 node info /amcl ros2 topic pub / ros2 topic pub /initialpose geometry_msgs/msg/PoseWithCovarianceStamped "{header:{frame_id: map}}" --once ros2 pkg create fishbot_application --build-type ament_python --license Apache-2.0 ros2 run fishbot_application init_robot_pose __7.4.2 使用TF获取机器人实时位姿__ __7.4.3 调用接口进行单点导航__ action ros2 action list ros2 action list -t ros2 interface show nav2_msgs/action/NavigateToPose ros2 action send_goal /navigate_to_pose nav2_msgs/action/NavigateToPose "{pose: {header: {frame_id: map},pose:{position:{x: 2.0,y: 1.0}}}}" --feedback `ros2 interface proto` __7.4.4 使用接口完成多点导航__ ros2 action send_goal /FollowWaypoints nav2_msgs/action/FollowWaypoints __7.5.1 完成机器人系统架构设计__ ros2 pkg create autopatrol_robot --build-type ament_python --license Apache-2.0 __7.5.2 编写巡检控制节点__ ros2 run autopatrol_robot patrol_node ros2 param list ros2 param dump /patrol_node >setup.py config文件 > ros2 launch fishbot_description gazebo_sim.launch.py >ros2 launch fishbot_navigation2 navigation2.launch.py >ros2 run autopatrol_robot patrol_node >ros2 run autopatrol_robot patrol_node --ros-args --params-file /home/chu/code/ros2_1/chapt_7/workspace/install/autopatrol_robot/share/autopatrol_robot/config/patrol_config.yaml __7.5.3.1 添加语音播报功能1__ ros2 pkg create autopatrol_interfaces --dependencies rosidl_default_generators `--license Apache-2.0` <-这个不能要 >srv >cmake >package.xml __7.5.3.2 添加语音播报功能2__ ros2 run autopatrol_robot speaker source install/setup.bash ros2 service list -t ros2 service call /speech_text autopatrol_interfaces/srv/SpeachText "{text: 你好}" __7.5.3.3 添加语音播报功能3__ >launch > ros2 launch fishbot_description gazebo_sim.launch.py >ros2 launch fishbot_navigation2 navigation2.launch.py > ros2 launch __7.5.4 订阅图像并记录__ __7.6.1 添加自描述文件__ - git init - git add . ```python git status git commit -m "feat:初始化提交,完成巡检机器人基本功能" git config --global user.name chu git config --global user.email "cgc2399433028@gmail.com" git config --global user.password "xxxxx密码" ``` 查看用户名 :git config user.name 查看密码: git config user.password 查看邮箱:git config user.email 使用 git config --list 查看已设配置 - []() __7.6.2 托管到Gitee__ __7.6.3 托管到Github__