Build maps using Ros Hector_mapping

Source: Internet
Author: User

There are two ways to build a map of Ros:

First of all 1, first download Hector_slam package to your work space under the SRC
Command:

Create a new demo.launch in ~/catkin_ws/src/hector_slam/hector_slam_launch/launch/

<?xml version= "1.0"?><launch> <include file= "$ (find Rplidar_ros)/launch/rplidar.launch"/>  <node pkg= "TF" type= "Static_transform_publisher" name= "Map_to_odom" args= "0.0 0.0 0.0 0 0 0.0/odom/base_link"/>  <node pkg= "TF" type= "Static_transform_publisher" name= "Base_frame_laser" args= "0 0 0 0 0 0/base_link/laser 10"/& gt;  <!--<node pkg= "Rviz" type= "Rviz" name= "Rviz"    args= "-D $ (find Hector_slam_launch)/rviz_cfg/mapping_ Demo.rviz "/>-->  <include file=" $ (find hector_mapping)/launch/mapping_default.launch "/>  < Node pkg= "Rviz" type= "Rviz" name= "Rviz" args= "-D rviz_cfg.rviz"/>  <include file= "$ (find Hector_geotiff)/ Launch/geotiff_mapper.launch "/></launch>

Modify ~/catkin_ws/src/hector_slam/hector_mapping/launch/mapping_default.launch

<?xml version= "1.0"?><launch> <arg name= "Tf_map_scanmatch_transform_frame_name" default= "/ Scanmatcher_frame "/><arg name=" Base_frame "default=" Base_link "/><arg name=" Odom_frame "default=" Base_ Link "/><arg name=" Pub_map_odom_transform "default=" true "/> <arg name=" Scan_subscriber_queue_size " default= "5"/><arg name= "scan_topic" default= "Scan"/><arg name= "map_size" default= "2048"/> <node Pkg= "hector_mapping" type= "hector_mapping" name= "hector_mapping" output= "screen" > <!--Frame names--&lt ;p Aram Name= "Map_frame" value= "map"/> <param name= "Base_frame" value= "$ (arg base_frame)"/> <param name= "od Om_frame "value=" $ (arg base_frame) "/> <!--Tf Use--and <param name=" Use_tf_scan_transformation "value=" True "/> <param name=" Use_tf_pose_start_estimate "value=" false "/> <param name=" Pub_map_odom_transform " Value= "$ (arg pub_map_odom_transform)"/> <!--map Size/start PoinT--<param name= "map_resolution" value= "0.050"/> <param name= "map_size" value= "$ (arg map_size)"/> <param name= "map_start_x" value= "0.5"/> <param name= "map_start_y" value= "0.5"/> <param name= "Map_mu Lti_res_levels "value=" 2 "/> <!--Map update parameters-to <param name=" Update_factor_free "value=" 0.4 "/ > <param name= "update_factor_occupied" value= "0.7"/> <param name= "Map_update_distance_thresh" value= "0 .2 "/><param name=" Map_update_angle_thresh "value=" 0.9 "/> <param name=" laser_z_min_value "value =" 1.0 "/&  Gt <param name= "Laser_z_max_value" value = "1.0"/> <!--advertising config---<param name= "Advertise_ma P_service "value=" true "/> <param name=" scan_subscriber_queue_size "value=" $ (arg scan_subscriber_queue_size) "/ > <param name= "scan_topic" value= "$ (arg scan_topic)"/> <param name= "tf_map_scanmatch_transform_frame_ Name "Value=" $ (arg tf_map_scanmatch_Transform_frame_name) "/> </node></launch> 

I use Rplidar lidar, the main price is relatively cheap

modifying Rplidar driver files
Found in Rplidar_ros/src/node.cpp
Nh_private.param<std::string> ("frame_id", frame_id, "laser_frame");
Change it to:
Nh_private.param<std::string> ("frame_id", frame_id, "laser");
Run after compilation:
Roslaunch Hector_slam_launch Demo.launch

Build maps using Ros Hector_mapping

Contact Us

The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.