diff --git a/Code/MowingRobot/PIBot_ROS/ros_ws/src/pibot_bringup/launch/bringup_with_imu.launch b/Code/MowingRobot/PIBot_ROS/ros_ws/src/pibot_bringup/launch/bringup_with_imu.launch index 37001bb..1899147 100644 --- a/Code/MowingRobot/PIBot_ROS/ros_ws/src/pibot_bringup/launch/bringup_with_imu.launch +++ b/Code/MowingRobot/PIBot_ROS/ros_ws/src/pibot_bringup/launch/bringup_with_imu.launch @@ -1,3 +1,9 @@ + @@ -19,7 +25,13 @@ - + + imu/accelerometer_bias: {x: 0.005436, y: 0.014684, z: -0.395418} @@ -61,16 +73,22 @@ + - + + diff --git a/Code/MowingRobot/PIBot_ROS/ros_ws/src/pibot_bringup/scripts/odom_ekf.py b/Code/MowingRobot/PIBot_ROS/ros_ws/src/pibot_bringup/scripts/odom_ekf.py index 9db038d..938dafd 100644 --- a/Code/MowingRobot/PIBot_ROS/ros_ws/src/pibot_bringup/scripts/odom_ekf.py +++ b/Code/MowingRobot/PIBot_ROS/ros_ws/src/pibot_bringup/scripts/odom_ekf.py @@ -8,19 +8,6 @@ Created for the Pi Robot Project: http://www.pirobot.org Copyright (c) 2012 Patrick Goebel. All rights reserved. - - This program is free software; you can redistribute it and/or modify - it under the terms of the GNU General Public License as published by - the Free Software Foundation; either version 2 of the License, or - (at your option) any later version.5 - - This program is distributed in the hope that it will be useful, - but WITHOUT ANY WARRANTY; without even the implied warranty of - MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the - GNU General Public License for more details at: - - http://www.gnu.org/licenses/gpl.html - """ import rospy diff --git a/Code/MowingRobot/PIBot_ROS/ros_ws/src/pibot_bringup/src/base_driver.cpp b/Code/MowingRobot/PIBot_ROS/ros_ws/src/pibot_bringup/src/base_driver.cpp index 4bbce0a..8366987 100644 --- a/Code/MowingRobot/PIBot_ROS/ros_ws/src/pibot_bringup/src/base_driver.cpp +++ b/Code/MowingRobot/PIBot_ROS/ros_ws/src/pibot_bringup/src/base_driver.cpp @@ -114,6 +114,14 @@ void BaseDriver::init_pid_debug() } } +/**---------------------------------------------------------------------- +* Function : init_imu +* Description : 初始化IMU,创建话题raw_imu,设置50个缓存的队列大小, raw_imu + 会在pibot_imu里面做校准处理然后发布为imu/data_raw提供给ROS + 中的其他节点使用 +* Author : pibot +* Review : 2023/04/22 zhanli,Add Description. +*---------------------------------------------------------------------**/ void BaseDriver::init_imu() { raw_imu_pub = nh.advertise("raw_imu", 50); diff --git a/Code/MowingRobot/PIBot_ROS/ros_ws/src/pibot_imu/src/pibot_imu.cpp b/Code/MowingRobot/PIBot_ROS/ros_ws/src/pibot_imu/src/pibot_imu.cpp index 7c706b8..109af78 100644 --- a/Code/MowingRobot/PIBot_ROS/ros_ws/src/pibot_imu/src/pibot_imu.cpp +++ b/Code/MowingRobot/PIBot_ROS/ros_ws/src/pibot_imu/src/pibot_imu.cpp @@ -1,5 +1,8 @@ #include "pibot_imu/pibot_imu.h" + + +// 订阅节点: raw_imu 这个话题是 PibotIMU::PibotIMU(ros::NodeHandle nh, ros::NodeHandle pnh): // Members default values nh_(nh), @@ -16,9 +19,12 @@ PibotIMU::PibotIMU(ros::NodeHandle nh, ros::NodeHandle pnh): pnh_.param("imu/use_magnetometer", use_magnetometer_, use_magnetometer_); pnh_.param("imu/perform_calibration", perform_calibration_, perform_calibration_); + // 功能2 :原始IMU的减零偏操作 // 订阅pibot_driver串口读取原始imu数据 + // 当raw_imu有数据时会调用rawCallback raw_sub_ = nh_.subscribe("raw_imu", 5, &PibotIMU::rawCallback, this); + // 功能3 :接收IMU校准服务的校准请求 // 创建一个服务,用于接收运行中的校准请求, 可以rosservice命令查看 imu_cal_srv_ = nh_.advertiseService("imu/calibrate_imu", &PibotIMU::calibrateCallback, this); @@ -95,6 +101,7 @@ void PibotIMU::rawCallback(const pibot_msgs::RawImuConstPtr& raw_msg) static int taken_samples; + // 功能1: 静态零偏校准 if (taken_samples < calibration_samples_) { acceleration_bias_["x"] += raw_msg->raw_linear_acceleration.x; acceleration_bias_["y"] += raw_msg->raw_linear_acceleration.y; diff --git a/Code/MowingRobot/PIBot_ROS/ros_ws/src/pibot_imu/src/pibot_imu_node.cpp b/Code/MowingRobot/PIBot_ROS/ros_ws/src/pibot_imu/src/pibot_imu_node.cpp index 27e564d..e1594ac 100644 --- a/Code/MowingRobot/PIBot_ROS/ros_ws/src/pibot_imu/src/pibot_imu_node.cpp +++ b/Code/MowingRobot/PIBot_ROS/ros_ws/src/pibot_imu/src/pibot_imu_node.cpp @@ -1,3 +1,9 @@ +/*-------------------------------------------------------------- +* Node Desc : 1.IMU的初始静态零偏校准 + 2.原始IMU的减零偏操作 + 3.接收IMU校准服务的校准请求 +* Review : zhanli.2024.02.28 +---------------------------------------------------------------*/ #include "pibot_imu/pibot_imu.h" int main(int argc, char **argv) diff --git a/Docs/4. 割草机器人运行指导.md b/Docs/4. 割草机器人运行指导.md new file mode 100644 index 0000000..740dc34 --- /dev/null +++ b/Docs/4. 割草机器人运行指导.md @@ -0,0 +1,15 @@ +# 割草机器人运行指导: + +### 一、全覆盖 + +```shell +# 进入home目录 +cd ~ +# 运行全覆盖server,Server负责路径的规划和小车命令控制 +./runRoomExplorationServer.sh +# 运行全覆盖Client, Client主要负责地图的生成 +./runRoomExplorationClient.sh +# 运行双目摄像头检测节点 +./runStereo.sh +``` +