A ROS package to process PointCloud2 and build OctoMap
- merge or concatinate multiple
PointCloud2s, with optional ICP algorithm, and publishPointCloud2in another frame - build
OctoMapfromPointCloud2
sudo apt install libpcl-devcd ~/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/buildpc2_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.launchYou are trying to invoke
octomap_saveras an argument to theoctomap_servernode. However,octomap_saveris a node of its own, so you only have to start it from a separate terminal whileoctomap_serveris 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.pyEGO-Planner等规划器要求点云发布在world坐标系下,因此需要将原本发布在lidar_frame的点云转发到world下
rosrun easondrone_mapping pub_pcl_world.py
