map does not show up on RVIZ while using hector_slam

asked 2018-01-22 13:30:43 -0500

Mohammedism gravatar image

updated 2018-01-22 13:32:04 -0500

Hello everyone, i am using RPLIDAR A1 and hector_slam but so for there is no luck, RVIZ will start with nothing and no map in it. Here is the details:

from this topic https://github.com/robopeak/rplidar_r... roslaunch rplidar rplidar.launch

  <launch>
    <node name="rplidarNode"          pkg="rplidar_ros"  type="rplidarNode" output="screen">
     <param name="serial_port"         type="string" value="/dev/ttyUSB0"/>  
     <param name="serial_baudrate"     type="int"    value="115200"/>
     <param name="frame_id"            type="string" value="laser"/>
     <param name="inverted"            type="bool"   value="false"/>
     <param name="angle_compensate"    type="bool"   value="true"/>
    </node>
  </launch>

and i think it runs fine because i get this

  SUMMARY
  ========

  PARAMETERS
   * /rosdistro: kinetic
   * /rosversion: 1.12.7
   * /rplidarNode/angle_compensate: True
   * /rplidarNode/frame_id: laser
   * /rplidarNode/inverted: False
   * /rplidarNode/serial_baudrate: 115200
   * /rplidarNode/serial_port: /dev/ttyUSB0

  NODES
    /
      rplidarNode (rplidar_ros/rplidarNode)

  auto-starting new master
  process[master]: started with pid [2876]
  ROS_MASTER_URI=http://localhost:11311

  setting /run_id to 4191033a-ff48-11e7-a91f-08002791f4c4
  process[rosout-1]: started with pid [2889]
  started core service [/rosout]
  process[rplidarNode-2]: started with pid [2903]
  RPLIDAR running on ROS package rplidar_ros
  SDK Version: 1.5.7
  RPLIDAR S/N: 4450FBF2C8E49CCFC6E49FF1BA82530D
  Firmware Ver: 1.20
  Hardware Rev: 0
  RPLidar health status : 0

then i run roslaunch hector_slam_launch tutorial.launch

 <launch>
  <arg name="tf_map_scanmatch_transform_frame_name" default="scanmatcher_frame"/>
  <arg name="base_frame" default="base_link"/>
  <arg name="odom_frame" default="odom"/>
  <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="base_link" />
  <param name="odom_frame" value="odom" />

  <!-- 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="$(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" />
  </node>

  <node pkg="tf" type="static_transform_publisher" name="base_to_laser_broadcaster"      args="0 0 0 0 0 0 /           base_link /laser 100" />

  <node pkg="tf" type="static_transform_publisher" name="scanmatcher_odom_broadcaster" args="0 0 0 0 0 0       /odom /map 100"/>

  </launch>

and i get

  SUMMARY
  ========

  PARAMETERS
   * /hector_geotiff_node/draw_background_checkerboard: True
   * /hector_geotiff_node/draw_free_space_grid: True
   * /hector_geotiff_node/geotiff_save_period: 0.0
   * /hector_geotiff_node/map_file_base_name: hector_slam_map
   * /hector_geotiff_node/map_file_path: /home/mohamed/cat...
   * /hector_geotiff_node/plugins: hector_geotiff_pl...
   * /hector_mapping/advertise_map_service: True
   * /hector_mapping/base_frame: base_link
   * /hector_mapping/laser_z_max_value: 1.0
   * /hector_mapping/laser_z_min_value: -1.0
   * /hector_mapping/map_frame: map
   * /hector_mapping/map_multi_res_levels: 2
   * /hector_mapping/map_resolution: 0.05
   * /hector_mapping/map_size: 2048
   * /hector_mapping/map_start_x: 0.5
   * /hector_mapping/map_start_y: 0.5
   * /hector_mapping/map_update_angle_thresh: 0.06
   * /hector_mapping/map_update_distance_thresh: 0.4
   * /hector_mapping/odom_frame: nav
   * /hector_mapping/pub_map_odom_transform: True
   * /hector_mapping/scan_subscriber_queue_size: 5
   * /hector_mapping/scan_topic: scan
   * /hector_mapping/tf_map_scanmatch_transform_frame_name: scanmatcher_frame
   * /hector_mapping/update_factor_free: 0.4
   * /hector_mapping/update_factor_occupied: 0.9
   * /hector_mapping/use_tf_pose_start_estimate: False
   * /hector_mapping/use_tf_scan_transformation: True
   * /hector_trajectory_server/source_frame_name: scanmatcher_frame
   * /hector_trajectory_server/target_frame_name: /map
   * /hector_trajectory_server/trajectory_publish_rate: 0.25
   * /hector_trajectory_server/trajectory_update_rate: 4.0
   * /rosdistro: kinetic
   * /rosversion: 1.12.7
   * /use_sim_time ...
(more)
edit retag flag offensive close merge delete

Comments

1

did you check which frame you selected in rviz?

aarontan gravatar imageaarontan ( 2018-06-18 19:43:13 -0500 )edit

You should check the "map" frame in rviz and check you are subscribed on the topic.

destogl gravatar imagedestogl ( 2018-06-20 04:41:15 -0500 )edit