1 Star 2 Fork 3

Qingwen/mapping_ws

加入 Gitee
与超过 1200万 开发者一起发现、参与优秀开源项目,私有仓库也完全免费 :)
免费加入
克隆/下载
贡献代码
同步代码
取消
提示: 由于 Git 不支持空文件夾,创建文件夹后会生成空的 .keep 文件
Loading...
README
MIT

简易版建图/定位 Simple-ndt-Slam

English version on readme, please check on personal website: projects/simple_ndt_slam ; Update: download test Kitti dataset bag: onedrive link: kitti_sequence11_half.bag and follow building steps, modify the bag path in ndt_mapping_kitti.launch and roslaunch it.

主要从autoware.ai 1.14版本core_perception 抽取并重构 速度上得到了一定的提升 仅留下与slam相关代码 较为简洁 容易部署版并拿到odom;已测试平台 1x1m 小车(Velodyne-16),机器狗(Robosense-16)主要注意topic name对应即可使用

测试系统:

  • Ubuntu 20.04 ROS noetic
  • Ubuntu 18.04 ROS melodic
  • Ubuntu 16.04 ROS kinetic

测试截图:

使用说明

Option: docker

image pull/build

推荐使用 这样就不用担心自己的环境了

docker pull zhangkin/simple_ndt

或者docker build也行 注意把dockerfile 复制一下 然后build

docker build -t zhangkin/simple_ndt .

run container

docker run -it --net=host --name ndt_slam zhangkin/simple_ndt /bin/zsh
cd src && git pull && cd ..
catkin build -DCMAKE_BUILD_TYPE=Release
roscore

# 另开一个终端
docker exec -it ndt_slam /bin/zsh
source devel/setup.zsh
roslaunch lidar_localizer ndt_mapping_docker.launch

然后在自身系统正常播包即可,如下图所示

拉取 && 编译

注意,如果使用的是docker内无需进行pull操作 直接编译即可

mkdir -p ~/workspace/mapping_ws/src
cd ~/workspace/mapping_ws/src
git clone --recurse-submodules https://github.com/Kin-Zhang/simple_ndt_slam

安装相关依赖(一些ROS包和glog)

cd simple_ndt_slam
sudo chmod +x ./assets/scripts/setup_lib.sh
./assets/scripts/setup_lib.sh

最后编译 然后经过如下调整相关topic name,参数 和bag包路径设置即可直接运行

cd ~/workspace/mapping_ws
catkin build -DCMAKE_BUILD_TYPE=Release
source devel/setup.zsh
roslaunch lidar_localizer ndt_mapping.launch

调参

  1. 首先检查数据包有激光雷达信息,sensor_msgs/PointCloud2 格式

    rosbag info xxx.bag
    
    # ======== 示例输出 ======= topics名字可在config内修改 无需提前规定
    types:       sensor_msgs/PointCloud2 [xxx]
    topics:      /velodyne_points     5359 msgs    : sensor_msgs/PointCloud2

    打开src/packages/lidar_localizer/config/ndt_mapping.yaml 配置文件,修改

    lidar_topic: "/velodyne_points"
  2. 需要根据不同的建图场景进行调节,主要调节计入的最大最小距离等

    # Ignore points closer than this value (meters) (default 5.0)
    min_scan_range: 1.0
    # Ignore points far than this value (meters) (default 200.0)
    max_scan_range: 50.0
    # Minimum distance between points to be added to the final map (default 1.0)
    min_add_scan_shift: 0.5
  3. 如果无需建图,可开启保存一定数量的点云进行运算,把旧时刻的清除

    save_frame_point: 10

在 Launch 中可以直接play bag,请修改路径即可

source ~/workspace/mapping_ws/devel/setup.zsh
roslaunch lidar_localizer ndt_mapping.launch

如需要保存建图结果的pcd, 请暂停bag包(因为map资源会lock住),再开一个终端并运行:

rosservice call /save_map '/home/kin/bags/autoware/cones_people.pcd' 0.0
rosservice call /save_map '/home/kin/ri_dog.pcd' 0.2 # save around 20cm filter voxel

如图所示:


博文及视频补充

相关参数介绍均在博客中进行了详细介绍:

  1. CSDN: 【Autoware】之ndt_mapping理论公式及代码对比

    这篇全文比较长,如果想简单使用而已,可以直接点链接看参数即可

相关使用视频:

  1. Autoware原装GUI配合使用 bilibili
  2. 此分支安装及使用视频

后续继续补充时,也会更新相关博文或视频进行说明

计划

  1. 参考开源包,后续加入回环(g2o/gtsam方式)
  2. 做一个建图的GUI以方便大家使用,提供安装包直接安装 无需源码编译版

Acknowledgement

MIT License Copyright (c) 2022 张聪明 Permission is hereby granted, free of charge, to any person obtaining a copy of this software and associated documentation files (the "Software"), to deal in the Software without restriction, including without limitation the rights to use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of the Software, and to permit persons to whom the Software is furnished to do so, subject to the following conditions: The above copyright notice and this permission notice shall be included in all copies or substantial portions of the Software. THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.

简介

简易版三维激光点云建图包(来源至autoware.ai) 展开 收起
MIT
取消

发行版

暂无发行版

贡献者

全部

近期动态

加载更多
不能加载更多了
马建仓 AI 助手
尝试更多
代码解读
代码找茬
代码优化
1
https://gitee.com/kin-zhang/mapping_ws.git
git@gitee.com:kin-zhang/mapping_ws.git
kin-zhang
mapping_ws
mapping_ws
master

搜索帮助