A ROS package to process PointCloud2
and build OctoMap
- merge or concatinate multiple
PointCloud2
s, with optional ICP algorithm, and publishPointCloud2
in another frame - build
OctoMap
fromPointCloud2
sudo apt install libpcl-dev
cd ~/easondrone_ws/reconstruct
git clone https://github.com/HuaYuXiao/easondrone_mapping.git
cd ~/easondrone_ws
catkin_make --source reconstruct/easondrone_mapping --build reconstruct/easondrone_mapping/build
pc2_topics_in:
- /livox/lidar
- /realsense/depth_camera/depth/points
timeout: 0.5
tf_duration: 0.05
# The Iterative Closest Point algorithm
icp_enable: true
icp_max_iter: 1
icp_tf_epsilon: 1e-8
icp_euclidean_fitness_epsilon: 1e-5
icp_max_corr_d: 0.05
pc2_topic_out: /sensor/pc2_out
pc2_frame_out: base_link
<launch>
<node pkg="easondrone_mapping" type="merge_pc2" name="merge_pc2">
<rosparam command="load" file="$(find easondrone_mapping)/config/merge_pc2.yaml" />
</node>
</launch>
roslaunch easondrone_mapping octomap_server.launch
You are trying to invoke
octomap_saver
as an argument to theoctomap_server
node. However,octomap_saver
is a node of its own, so you only have to start it from a separate terminal whileoctomap_server
is running. Check the documentation at http://wiki.ros.org/octomap_server#octomap_saver
控制无人机完成建图后,用以下指令保存.ot(或者.bt,相较于.ot体积更小)格式的地图文件
rosrun octomap_server octomap_saver -f ~/easondrone_ws/reconstruct/easondrone_mapping/map.ot
参考:
- https://octomap.github.io/octomap/doc
- ⭐️ https://wiki.ros.org/octomap
- ⭐️ https://github.com/OctoMap/octomap_mapping/blob/kinetic-devel/octomap_server/src/OctomapServer.cpp
- ⭐️ https://groups.google.com/g/octomap/c/ZyfNzcuGlY0?pli=1
方法1:octovis
也可以借助octovis
工具查看
octovis ~/easondrone_ws/reconstruct/easondrone_mapping/map.bt
方法2:rviz
一种方法是在rviz
中查看
rviz
rosrun octomap_server octomap_server_node ~/easondrone_ws/reconstruct/easondrone_mapping/map.bt
添加OccupancyGrid
,话题选择/octomap_binary
,
参考:
参考:
rosrun easondrone_mapping laser_to_pointcloud.py
EGO-Planner等规划器要求点云发布在world坐标系下,因此需要将原本发布在lidar_frame的点云转发到world下
rosrun easondrone_mapping pub_pcl_world.py