I want to visualization for my self-built lidarscanner in rviz. Right now display the **LaserScan** message in Rviz looks pretty good. Then I want to improve it with a slam demo.
First I download a scan rosbag from [laser_pipeline](http://wiki.ros.org/laser_pipeline/Tutorials/IntroductionToWorkingWithLaserScannerData), actually this rosbag also included odometry message. But in my case I just want to use **LaserScan** without **odom**. The launch file is use the **tutorial.launch** but just modified a little bit in **mapping_default.launch** from **hector_mapping** package.
**mapping_default.launch**:
Then everything works fine. I can see the map, path, pose display well.
The tf trees:

The ROSINFO:
> [ INFO] [1494990764.272355175]: Waiting for tf transform data between frames /map and scanmatcher_frame to become available
>HectorSM map lvl 0: cellLength: 0.05 res x:2048 res y: 2048
>[ WARN] [1494990765.274379213, 85.089103132]: No transform between frames /map and scanmatcher_frame available after 85.089103 seconds of waiting. This warning only prints once.
>[ INFO] [1494990765.618476795, 85.428863537]: Successfully initialized hector_geotiff MapWriter plugin TrajectoryMapWriter.
>[ INFO] [1494990765.618565763, 85.441192962]: Geotiff node started
>HectorSM map lvl 1: cellLength: 0.1 res x:1024 res y: 1024
[ INFO] [1494990768.046593954, 87.863962405]: HectorSM p_base_frame_: base_link
[ INFO] [1494990768.046779571, 87.863962405]: HectorSM p_map_frame_: map
[ INFO] [1494990768.047534968, 87.863962405]: HectorSM p_odom_frame_: base_link
[ INFO] [1494990768.047574313, 87.863962405]: HectorSM p_scan_topic_: base_scan
[ INFO] [1494990768.047588757, 87.863962405]: HectorSM p_use_tf_scan_transformation_: true
[ INFO] [1494990768.047600146, 87.863962405]: HectorSM p_pub_map_odom_transform_: true
[ INFO] [1494990768.047612050, 87.863962405]: HectorSM p_scan_subscriber_queue_size_: 5
[ INFO] [1494990768.047625655, 87.863962405]: HectorSM p_map_pub_period_: 2.000000
[ INFO] [1494990768.047637559, 87.863962405]: HectorSM p_update_factor_free_: 0.400000
[ INFO] [1494990768.047655522, 87.863962405]: HectorSM p_update_factor_occupied_: 0.700000
[ INFO] [1494990768.047666643, 87.863962405]: HectorSM p_map_update_distance_threshold_: 0.200000
[ INFO] [1494990768.047677684, 87.863962405]: HectorSM p_map_update_angle_threshold_: 0.060000
[ INFO] [1494990768.047689360, 87.863962405]: HectorSM p_laser_z_min_value_: -1.000000
[ INFO] [1494990768.047699443, 87.863962405]: HectorSM p_laser_z_max_value_: 1.000000
>[ INFO] [1494990769.280947421, 89.100331294]: Finished waiting for tf, waited 89.100331 seconds
Then I changed the **mapping_default.launch** file a little to fit my llidarscanner.
The changes:
Basically, just change the frame_id and LaserScan topic. After launch, In Rviz getting the error:
>"No tf data. Actual error: Fixed Frame [map] does not exist."
The ROSINFO:
>[ INFO] [1494991685.913714504]: Waiting for tf transform data between frames /map and scanmatcher_frame to become available
HectorSM map lvl 0: cellLength: 0.05 res x:2048 res y: 2048
[ INFO] [1494991686.044524236]: Successfully initialized hector_geotiff MapWriter plugin TrajectoryMapWriter.
[ INFO] [1494991686.044672266]: Geotiff node started
HectorSM map lvl 1: cellLength: 0.1 res x:1024 res y: 1024
[ INFO] [1494991687.097869224]: HectorSM p_base_frame_: base_link
[ INFO] [1494991687.098014701]: HectorSM p_map_frame_: map
[ INFO] [1494991687.098062504]: HectorSM p_odom_frame_: base_link
[ INFO] [1494991687.098152040]: HectorSM p_scan_topic_: scan
[ INFO] [1494991687.098197173]: HectorSM p_use_tf_scan_transformation_: true
[ INFO] [1494991687.098263787]: HectorSM p_pub_map_odom_transform_: true
[ INFO] [1494991687.098342346]: HectorSM p_scan_subscriber_queue_size_: 5
[ INFO] [1494991687.098421148]: HectorSM p_map_pub_period_: 2.000000
[ INFO] [1494991687.098485353]: HectorSM p_update_factor_free_: 0.400000
[ INFO] [1494991687.098547951]: HectorSM p_update_factor_occupied_: 0.700000
[ INFO] [1494991687.098610449]: HectorSM p_map_update_distance_threshold_: 0.200000
[ INFO] [1494991687.098674217]: HectorSM p_map_update_angle_threshold_: 0.060000
[ INFO] [1494991687.098736552]: HectorSM p_laser_z_min_value_: -1.000000
>[ INFO] [1494991687.098798347]: HectorSM p_laser_z_max_value_: 1.000000
I checked and no tf existed.
↧