Hector_Slam to AMCL
Hi All,
I am a newbie to ROS, but i was able to create a map with hector slam using RPlidarA2M6 on ros kinetic, Issues: - Mapping was smooth till it get a certain point where the robot was moving with the lidar but movement on the map was static hence mapping just a single point.. (Though i was able to maneuver my way through this by staying at this point for a while before finally moving) How do i fix this? - I created a fake odometry using laser_scan_matcher but the odometry was stuck at the same point where it was stuck while mapping. how do i fix this? _ amcl is totally wrong,
I need help with these issues, please see the various launch files below.. Thanks
Hector SLAM - launch file
<?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 -->
<param name="map_frame" value="map" />
<param name="base_frame" value="$(arg base_frame)" />
<param name="odom_frame" value="$(arg odom_frame)" />
<!-- 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="$(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_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="$(arg scan_subscriber_queue_size)"/>
<param name="scan_topic" value="$(arg scan_topic)"/>
<!-- Debug parameters -->
<!--
<param name="output_timing" value="false"/>
<param name="pub_drawings" value="true"/>
<param name="pub_debug_output" value="true"/>
-->
<param name="tf_map_scanmatch_transform_frame_name" value="$(arg tf_map_scanmatch_transform_frame_name)" />
</node>
<node pkg="tf" type="static_transform_publisher" name="base_to_laser_broadcaster" args="0 0 0 0 0 0 base_link laser 100" />
</launch>
Laser_Scan_matcher Launch file: < <launch>
<node pkg="laser_scan_matcher" type="laser_scan_matcher_node"
name="laser_scan_matcher_node" output="screen">
<param name="base_frame" value="base_link"/>
<param name="fixed_frame" value="odom"/>
<param name="use_alpha_beta" value="false"/>
<param name="use_odom" value="true"/>
<param name="use_imu" value="false"/>
<param name="max_iterations" value="4"/>
<param name="publish_pose" value="true"/>
<param name="publish_tf" value="true"/>
</node>
<node pkg="tf" type="static_transform_publisher" name="base_to_laser_broadcaster" args="0 0 0 0 0 0 base_link laser 100" />
</launch>
/>
AMCL Launch file:
<launch>
<node pkg="amcl" type="amcl" name="amcl" output="screen ...
I editted your title to follow our community guidelines. Please do not add excessive "!", its not productive.
Hi, there can be many reasons why your setup is not working. Please post your launch files and error messages to give any sort of useful answer.
Thanks Namal for your comment.. I have edited the post and posted the launch files..
I used laser_match to create a fake odometry, but it seems to be stuck at a place on the map and the amcl is totally wrong..what could be wrong?
@femitof: could you clarify how #q342504 and this question are related?
@gvdhoorn deleted... Can you please help me? @Namal Senarathne@gvdhoorn
Thanks
Thanks for uploading the launch files, but I don't see any error messages apart form your description of the error. Can you post any error messages you see and better yet upload a rosbag file capturing the exact erroneous phase during localization.
Anyway my hunch is that your robot is passing through a "feature sparse" location which both hector mapping and amcl is finding difficult to match to its existing map. May be you can try using some other tool for mapping and localization like https://github.com/SteveMacenski/slam_toolbox
Yeah, there are no error messages, but AMCL just doesn't localize correctly..it is totally incorrect.. Any ideas what could be wrong? Also do you haver an idea of how i could upload a video or something? @Namal Senarathne
Hi, you can probably upload your bag files and videos to some web storage (like google drive, dropbox) and provide a link in your question. Also please update your question with information about how you initialize AMCL with the initial pose of the robot to figure out the reasons for failure in localization.