主要分享机器人/自动驾驶智能控制等相关技术。
目录
相关文章推荐
今天看啥  ›  专栏  ›  机器人规划与控制研究所

机器人导航地图——Obstacle层的障碍物-Bresenham算法详细解释

机器人规划与控制研究所  · 公众号  ·  · 2023-12-01 16:19
“ 作者在读源代码时,遇到了下述的代码raytraceFreespace,不是很好理解,有很多疑惑,于是打算对此部分进行详解,并记下笔记。”void ObstacleLayer::raytraceFreespace(const Observation& clearing_observation, double* min_x, double* min_y, double* max_x, double* max_y){ clearing_observation的origin_是传感器坐标,传入 double ox = clearing_observation.origin_.x; double oy = clearing_observation.origin_.y; pcl::PointCloud cloud = *(clearing_observation.cloud_); //得到传感器原点在地图上的坐标 // get the map coordinates of the origin of the sensor unsigned int x0, y0; if (!worldToMap(ox, oy, x0, y0)) { ROS_WARN_THROTTLE( 1.0, "The origin for the sensor at (%.2f, %.2f) is out of map bounds. So, the costmap cannot raytrace for it.", ox, oy); return; } // we can pre-compute the enpoints of the map outside of the inner loop... we'll need these later ………………………………

原文地址:访问原文地址
快照地址: 访问文章快照