LOAM系列——FLOAM配置、安装、问题解决及VLP16测试效果
安装依赖
- Ubuntu and ROS
- Ceres Solver
- PCL
- Trajectory visualization
sudo apt-get install ros-melodic-hector-trajectory-server
安装
cd ~/test_ws/src
git clone https://github.com/wh200720041/floam.git
cd ..
catkin_make -DCATKIN_WHITELIST_PACKAGES="floam"
KITTI sequence 07
source ~/test_ws/devel/setup.bash
roslaunch floam floam.launch #launch文件中包含bag的运行
如若想同时生成地图,则运行下面命令
roslaunch floam floam_mapping.launch
其中 floam.launch文件内容如下:
<?xml version="1.0"?>
<launch>
<node pkg="rosbag" type="play" name="rosbag_play" args="--clock $(env HOME)/test_bag/2011_09_30_0027.bag"/>
<!-- For Velodyne VLP-16
<param name="scan_line" value="16" />
-->
<!-- For Velodyne HDL-32
<param name="scan_line" value="32" />
-->
<!-- For Velodyne HDL-64 -->
<param name="scan_line" value="64" />
<!--- Sim Time -->
<param name="/use_sim_time" value="true" />
<param name="scan_period" value="0.1" />
<param name="vertical_angle" type="double" value="2.0" />
<param name="max_dis" type="double" value="90.0" />
<param name="min_dis" type="double" value="3.0" />
<!--- -->
<node pkg="floam" type="floam_odom_estimation_node" name="floam_odom_estimation_node" output="screen"/>
<node pkg="floam" type="floam_laser_processing_node" name="floam_laser_processing_node" output="screen"/>
<node pkg="tf" type="static_transform_publisher" name="word2map_tf" args="0 0 0 0 0 0 /world /map 10" />
<arg name="rviz" default="true" />
<group if="$(arg rviz)">
<node launch-prefix="nice" pkg="rviz" type="rviz" name="rviz" args="-d $(find floam)/rviz/floam.rviz" />
</group>
<node pkg="hector_trajectory_server" type="hector_trajectory_server" name="trajectory_server_loam" ns="gt" >
<param name="/target_frame_name" value="world" />
<param name="/source_frame_name" value="velodyne" />
<param name="/trajectory_update_rate" value="10.0" />
<param name="/trajectory_publish_rate" value="10.0" />
</node>
<node pkg="hector_trajectory_server" type="hector_trajectory_server" name="trajectory_server_loam" ns="base_link" >
<param name="/target_frame_name" value="world" />
<param name="/source_frame_name" value="base_link" />
<param name="/trajectory_update_rate" value="10.0" />
<param name="/trajectory_publish_rate" value="10.0" />
</node>
</launch>
其中 floam_mapping.launch内容如下:
<?xml version="1.0"?>
<launch>
<node pkg="rosbag" type="play" name="rosbag_play" args="--clock -r 0.5 $(env HOME)/test_bag/2011_09_30_0027.bag"/>
<!-- For Velodyne VLP-16
<param name="scan_line" value="16" />
-->
<!-- For Velodyne HDL-32
<param name="scan_line" value="32" />
-->
<!-- For Velodyne HDL-64 -->
<param name="scan_line" value="64" />
<!--- Sim Time -->
<param name="/use_sim_time" value="true" />
<param name="scan_period" value="0.1" />
<param name="vertical_angle" type="double" value="2.0" />
<param name="max_dis" type="double" value="90.0" />
<param name="map_resolution" type="double" value="0.4" />
<param name="min_dis" type="double" value="3.0" />
<!--- -->
<node pkg="floam" type="floam_odom_estimation_node" name="floam_odom_estimation_node" output="screen"/>
<node pkg="floam" type="floam_laser_processing_node" name="floam_laser_processing_node" output="screen"/>
<node pkg="floam" type="floam_laser_mapping_node" name="floam_laser_mapping_node" output="screen"/>
<node pkg="tf" type="static_transform_publisher" name="word2map_tf" args="0 0 0 0 0 0 /world /map 10" />
<arg name="rviz" default="true" />
<group if="$(arg rviz)">
<node launch-prefix="nice" pkg="rviz" type="rviz" name="rviz" args="-d $(find floam)/rviz/floam_mapping.rviz" />
</group>
<node pkg="hector_trajectory_server" type="hector_trajectory_server" name="trajectory_server_loam" ns="gt" >
<param name="/target_frame_name" value="world" />
<param name="/source_frame_name" value="velodyne" />
<param name="/trajectory_update_rate" value="10.0" />
<param name="/trajectory_publish_rate" value="10.0" />
</node>
<node pkg="hector_trajectory_server" type="hector_trajectory_server" name="trajectory_server_loam" ns="base_link" >
<param name="/target_frame_name" value="world" />
<param name="/source_frame_name" value="base_link" />
<param name="/trajectory_update_rate" value="10.0" />
<param name="/trajectory_publish_rate" value="10.0" />
</node>
</launch>
VLP16 bag测试
source ~/test_ws/devel/setup.bash
roslaunch floam floam_velodyne.launch
cd ~/test_bag
rosbag play indoor_2021-03-30-15-27-23.bag
或者
roslaunch floam floam_velodyne_with_bag.launch
其中 floam_velodyne.launch 内容如下:
<?xml version="1.0"?>
<launch>
<param name="/use_sim_time" value="true" />
<!-- launch your velodyne here
<include file="$(find velodyne_pointcloud)/launch/VLP16_points.launch"/>
-->
<!-- For Velodyne VLP-16 -->
<param name="scan_line" value="16" />
<!-- For Velodyne HDL-32
<param name="scan_line" value="32" />
-->
<!-- For Velodyne HDL-64
<param name="scan_line" value="64" />
-->
<!--- Sim Time -->
<param name="scan_period" value="0.1" />
<param name="vertical_angle" type="double" value="2.0" />
<param name="map_resolution" type="double" value="0.2" />
<param name="max_dis" type="double" value="90.0" />
<param name="min_dis" type="double" value="0.5" />
<!--- -->
<node pkg="floam" type="floam_odom_estimation_node" name="floam_odom_estimation_node" output="screen"/>
<node pkg="floam" type="floam_laser_processing_node" name="floam_laser_processing_node" output="screen"/>
<node pkg="floam" type="floam_laser_mapping_node" name="floam_laser_mapping_node" output="screen"/>
<node pkg="tf" type="static_transform_publisher" name="word2map_tf" args="0 0 0 0 0 0 /world /map 10" />
<arg name="rviz" default="true" />
<group if="$(arg rviz)">
<node launch-prefix="nice" pkg="rviz" type="rviz" name="rviz" args="-d $(find floam)/rviz/floam_velodyne.rviz" />
</group>
<node pkg="hector_trajectory_server" type="hector_trajectory_server" name="trajectory_server_loam" ns="base_link" >
<!-- <param name="/target_frame_name" value="world" /> -->
<param name="/target_frame_name" value="map" />
<param name="/source_frame_name" value="base_link" />
<param name="/trajectory_update_rate" value="10.0" />
<param name="/trajectory_publish_rate" value="10.0" />
</node>
</launch>
其中 loam_velodyne_with_bag.launch 内容如下:
<?xml version="1.0"?>
<launch>
<param name="/use_sim_time" value="true" />
<node pkg="rosbag" type="play" name="rosbag_play" args="--clock -r 0.5 $(env HOME)/test_bag/indoor_2021-03-30-15-27-23.bag"/>
<!-- For Velodyne VLP-16 -->
<param name="scan_line" value="16" />
<!-- For Velodyne HDL-32
<param name="scan_line" value="32" />
-->
<!-- For Velodyne HDL-64
<param name="scan_line" value="64" />
-->
<!--- Sim Time -->
<param name="scan_period" value="0.1" />
<param name="vertical_angle" type="double" value="2.0" />
<param name="map_resolution" type="double" value="0.2" />
<param name="max_dis" type="double" value="90.0" />
<param name="min_dis" type="double" value="0.5" />
<!--- -->
<node pkg="floam" type="floam_odom_estimation_node" name="floam_odom_estimation_node" output="screen"/>
<node pkg="floam" type="floam_laser_processing_node" name="floam_laser_processing_node" output="screen"/>
<node pkg="floam" type="floam_laser_mapping_node" name="floam_laser_mapping_node" output="screen"/>
<node pkg="tf" type="static_transform_publisher" name="word2map_tf" args="0 0 0 0 0 0 /world /map 10" />
<arg name="rviz" default="true" />
<group if="$(arg rviz)">
<node launch-prefix="nice" pkg="rviz" type="rviz" name="rviz" args="-d $(find floam)/rviz/floam_velodyne.rviz" />
</group>
<node pkg="hector_trajectory_server" type="hector_trajectory_server" name="trajectory_server_loam" ns="base_link" >
<param name="/target_frame_name" value="world" />
<param name="/source_frame_name" value="base_link" />
<param name="/trajectory_update_rate" value="10.0" />
<param name="/trajectory_publish_rate" value="10.0" />
</node>
</launch>
测试视频链接
floam
问题解决
问题1
问题: floam_laser_mapping_node节点,可能会出现运行一段时间就报错,崩溃了
版权声明:本文内容由互联网用户自发贡献,该文观点仅代表作者本人。本站仅提供信息存储空间服务,不拥有所有权,不承担相关法律责任。如发现本站有涉嫌侵权/违法违规的内容, 请发送邮件至 举报,一经查实,本站将立刻删除。
文章由极客之音整理,本文链接:https://www.bmabk.com/index.php/post/130123.html