Robotics StackExchange | Archived questions

map does not show up on RVIZ while using hector_slam

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_ros/blob/master/launch/rplidar.launch 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 hectorslamlaunch 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: True

  NODES
    /
      hector_geotiff_node (hector_geotiff/geotiff_node)
      hector_mapping (hector_mapping/hector_mapping)
      hector_trajectory_server (hector_trajectory_server/hector_trajectory_server)
      map_nav_broadcaster (tf/static_transform_publisher)
      rviz (rviz/rviz)

  ROS_MASTER_URI=http://localhost:11311

  core service [/rosout] found
  process[rviz-1]: started with pid [2961]
  process[hector_mapping-2]: started with pid [2962]
  process[map_nav_broadcaster-3]: started with pid [2963]
  process[hector_trajectory_server-4]: started with pid [2964]
  process[hector_geotiff_node-5]: started with pid [2995]
  [ INFO] [1516607154.164305614]: 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
  HectorSM map lvl 1: cellLength: 0.1 res x:1024 res y: 1024
  [INFO] [1516607154.473640201]: HectorSM p_base_frame_: base_link
  [ INFO] [1516607154.473985848]: HectorSM p_map_frame_: map
  [ INFO] [1516607154.474065501]: HectorSM p_odom_frame_: nav
  [ INFO] [1516607154.474138367]: HectorSM p_scan_topic_: scan
  [ INFO] [1516607154.474426569]: HectorSM p_use_tf_scan_transformation_: true
  [ INFO] [1516607154.474568112]: HectorSM p_pub_map_odom_transform_: true
  [ INFO] [1516607154.474655361]: HectorSM p_scan_subscriber_queue_size_: 5
  [ INFO] [1516607154.474935408]: HectorSM p_map_pub_period_: 2.000000
  [ INFO] [1516607154.475020520]: HectorSM p_update_factor_free_: 0.400000
  [ INFO] [1516607154.475194516]: HectorSM p_update_factor_occupied_: 0.900000
  [ INFO] [1516607154.475280399]: HectorSM p_map_update_distance_threshold_: 0.400000 
  [ INFO] [1516607154.475563451]: HectorSM p_map_update_angle_threshold_: 0.060000
  [ INFO] [1516607154.475713128]: HectorSM p_laser_z_min_value_: -1.000000
  [ INFO] [1516607154.475856377]: HectorSM p_laser_z_max_value_: 1.000000
  [ INFO] [1516607154.551815279]: Successfully initialized hector_geotiff MapWriter plugin TrajectoryMapWriter.
  [ INFO] [1516607154.551977862]: Geotiff node started

and RVIZ open up but with no map or anything, even though i am sure the RPLIDAR is publishing through /scan i tried to follow the solution presented here https://hackaday.io/project/7284-oscar-omni-service-cooperative-assistant-robot/log/26164-first-foray-into-ros but id did not solve my problem, any help will be appreciate it. I have been trying to figure it out for 3 days now

Asked by Mohammedism on 2018-01-22 14:30:43 UTC

Comments

did you check which frame you selected in rviz?

Asked by aarontan on 2018-06-18 19:43:13 UTC

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

Asked by destogl on 2018-06-20 04:41:15 UTC

Answers