I'm trying to do this as well with the RPLIDAR. I've been struggling for weeks to little avail.
I cannot seem to get a live SLAM map onto rvis. I'm not using lidar for mechatronics, I'm using it as a tool for creating fast models of interior spaces - so basically, this is all I need. I also haven't successfully sent a .bag file through any of the slam algorithm plugins. With my current launch file all i get is a real time map.
Here is my .launch file:
<!--
Used for visualising rplidar in action.
It requires rplidar.launch.
-->
<launch>
<include file="$(find rplidar_ros)/launch/rplidar.launch" />
<node name="rviz" pkg="rviz" type="rviz" args="-d $(find rplidar_ros)/rviz/rplidar.rviz" />
<node pkg="hector_mapping" type="hector_mapping" name="hector_mapping" output="screen">
<!-- Frame Names -->
<param name="base_frame" value="base_link" />
<!-- param name="base_frame" value="/laser" -->
<param name="map_frame" value="map" />
<param name="odom_frame" value="base-link" />
<!-- param name="odom_frame" value="/laser" -->
<!-- Tf use -->
<param name="use_tf_scan_transformation" value="true"/>
<param name="use_tf_pose_start_estimate" value="false"/>
<param name="pub_map_odom_transform" value="true"/>
<!-- Map size / start point -->
<param name="map_resolution" value="0.050"/>
<param name="map_size" value="2048"/>
<param name="map_start_x" value="0.5"/>
<param name="map_start_y" value="0.5" />
<param name="map_multi_res_levels" value="2" />
<!-- Map update parameters -->
<param name="update_factor_free" value="0.4"/>
<param name="update_factor_occupied" value="0.9" />
<param name="map_update_distance_thresh" value="0.4"/>
<param name="map_update_angle_thresh" value="0.06" />
<param name="laser_z_min_value" value = "-1.0" />
<param name="laser_z_max_value" value = "1.0" />
<!-- Advertising config -->
<param name="advertise_map_service" value="true"/>
<param name="scan_subscriber_queue_size" value="5"/>
<param name="scan_topic" value="/laser/scan"/>
<!-- param name="scan_topic" value="/laser/scan" -->
<param name="tf_map_scanmatch_transform_frame_name" value="scanmatcher_frame" />
</node>
<node pkg="tf" type="static_transform_publisher" name="base_to_laser_broadcaster" args="0 0 0 0 0 0 /base_link /laser 50" />
<node pkg="tf" type="static_transform_publisher" name="laser_link" args="0.031 0.0 0.251 0.0 0.0 0.0 /base_frame /laser 100" />
<node pkg="tf" type="static_transform_publisher" name="map_2_base_footprint" args="0 0 0 0 0 0 /map /base_footprint 100"/>
<node pkg="tf" type="static_transform_publisher" name="base_footprint_2_base_link" args="0 0 0 0 0 0 /base_footprint /base_link 100"/>
<node pkg="tf" type="static_transform_publisher" name="base_link_2_base_stabilized_link" args="0 0 0 0 0 0 /base_link /base_stabilized 100"/>
<node pkg="tf" type="static_transform_publisher" name="base_stablized_2_base_frame" args="0 0 0 0 0 0 /base_stabilized /base_frame 100"/>
<node pkg="tf" type="static_transform_publisher" name="base_2_nav_link" args="0 0 0 0 0 0 /base_frame /nav 100"/>
<node pkg="tf" type="static_transform_publisher" name="base_frame_2_laser_link" args="0 0 0 0 0 0 /base_frame /laser_link 100"/>
<!-- cnode pkg="tf" type="static_transform_publisher" name="imu_link" args="-0.049 0.0 0.180 0.0 0.0 0.0 /base_link /imu 50" -->
<!--
<node pkg="hector_trajectory_server" type="hector_trajectory_server" name="hector_trajectory_server" output="screen">
<param name="target_frame_name" type="string" value="/map" />
<param name="source_frame_name" type="string" value="laser" />
<param name="trajectory_update_rate" type="double" value="4" />
<param name="trajectory_publish_rate" type="double" value="0.25" />
</node>
<node pkg="hector_geotiff" type="geotiff_node" name="hector_geotiff_node" output="screen" launch-prefix="nice -n 15">
<remap from="map" to="/dynamic_map" />
<param name="map_file_path" type="string" value="$(find hector_geotiff)/maps" />
<param name="map_file_base_name" type="string" value="hector_slam_map" />
<param name="geotiff_save_period" type="double" value="10" />
<param name="draw_background_checkerboard" type="bool" value="true" />
<param name="draw_free_space_grid" type="bool" value="true" />
<param name="plugins" type="string" value="hector_geotiff_plugins/TrajectoryMapWriter" />
</node>
-->
</launch>
Originally posted by casper911ca with karma: 21 on 2015-08-04
This answer was NOT ACCEPTED on the original site
Post score: 1