draw the path with hector slam
hello every one, I am using the hector slam with hokuyo. i do have have the map but i need to see the path of the robot on Rviz can anyone help me please
ROS Resources: Documentation | Support | Discussion Forum | Index | Service Status | ros @ Robotics Stack Exchange |
hello every one, I am using the hector slam with hokuyo. i do have have the map but i need to see the path of the robot on Rviz can anyone help me please
To get the trajectory, you have to initialize hector_trajectory_server node.To do this you can directly call "geotiff_mapper.launch" file in "hector_geotiff" package. After launching this node, to visualize the path in rviz add "Path" and select topic as /trajectory.
Edit:
Working Launch files
hector_hokuyo.launch
<launch>
<param name="pub_map_odom_transform" value="true"/>
<param name="map_frame" value="map"/>
<param name="base_frame" value="base_frame"/>
<param name="odom_frame" value="odom"/>
<node pkg="hokuyo_node" type="hokuyo_node" name="hokuyo_node"/>
<node pkg="tf" type="static_transform_publisher" name="map_2_odom" args="0 0 0 0 0 0 /map /odom 100"/>
<node pkg="tf" type="static_transform_publisher" name="odom_2_base_footprint" args="0 0 0 0 0 0 /odom /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_frame_2_laser_link" args="0 0 0 0 0 0 /base_frame /laser 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="rviz" type="rviz" name="rviz" args="-d <path_to_folder>/rviz_cfg.rviz"/>
<include file="<path_to_folder>/default_mapping.launch"/>
<include file="<path_to_folder>/geotiff_mapper.launch"/>
</launch>
default_mapping.launch
<launch>
<arg name="tf_map_scanmatch_transform_frame_name" default="scanmatcher_frame"/>
<arg name="base_frame" default="base_frame"/>
<arg name="odom_frame" default="base_frame"/>
<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="map_nav_broadcaster" args="0 0 0 0 0 0 map nav 100"/>-->
</launch>
geotiff_mapper.launch
<launch>
<arg name="trajectory_source_frame_name" default="/scanmatcher_frame"/>
<arg name="trajectory_update_rate" default="4"/>
<arg name="trajectory_publish_rate" default="0.25"/>
<arg name="map_file_path" default="$(find hector_geotiff)/maps"/>
<arg name="map_file_base_name" default="hector_slam_map"/>
<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="$(arg trajectory_source_frame_name)" />
<param name="trajectory_update_rate" type="double" value="$(arg trajectory_update_rate)" />
<param name="trajectory_publish_rate" type ...
(more)first i run the file of hokuyo and hector_mapping that i obtained here
https://github.com/DaikiMaekawa/hecto...
and than i run the launch file provided in the hector_mapping package
<launch> <arg name="trajectory_source_frame_name" default="/base_link"/> <arg name="trajectory_update_rate" default="4"/> <arg name="trajectory_publish_rate" default="0.25"/> <arg name="map_file_path" default="$(find hector_geotiff)/maps"/> <arg name="map_file_base_name" default="hector_slam_map"/>
<node pkg="hector_trajectory_server" type="hector_trajectory_server" name="hector_trajectory_server" output="screen"> </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"/> </node>
</launch<>
i have added launch files in my answer. These are working for me. Save these in any folder with same file names, edit "path_to_folder" in hector_hokuyo.launch and just launch the file 'hector_hokuyo.launch' it will initialise hokuyo, hector_slam node , rviz and also display the path in the map.
hello
you could use another package named hector_trajectory_server
.
You could also find many information in hector_slam
Asked: 2016-05-22 05:47:49 -0500
Seen: 2,149 times
Last updated: Jun 09 '16
(solved) Slam Generated Map Does Not Appear
how can we get accurate orientation data when we use hector slam
Getting up and running with SLAM
problem building my map using SLAM
Android_tutorial_pubsub errors on Eclipse
How to do GMapping and SLAM Navigation using RPLIDAR A2 and Kobuki?
Coordinate frame transforms: /odom to /map? [closed]
SBC for SLAM with LiDAR and multiple realsense depth cameras