ROS Resources: Documentation | Support | Discussion Forum | Index | Service Status | ros @ Robotics Stack Exchange
Ask Your Question


asked 2015-08-04 19:12:20 -0500

casper911ca gravatar image

I've been posting similar questions on open topics, but that may have not been the proper way to address the forum.

This may seen like a data dump, but I'm trying to be as complete as possible here so that one can see as much about what I have going on as possible. Of course, I will provide if more information if more is needed.

Thank you guys in advance for any help or leads you can provide.

Using ros indigo

I've seen several examples of real-time and post-processed slam with RPLIDAR. Just a few:

Now I've been fiddling with launch files for a couple months now on my free time with little luck as I know very little about how ros is structured and how to tie one tool to another. I've been basically making a Frankenstein Monster launch file and crossing my fingers.

I'm not receiving any errors and RVIS launches with out any problems and I can see the realtime data plotted on the 2D plane as red squares. I set the Global Fixed Frame to "map" and the RPLidarLaserScan display (really just LaserScan) Topic to "/scan". Then I add the "Map" display and set the topic to "/map". And press "Reset" at the bottom. The 2D plane on the display changes color to the "map" color, but I still do not see an occupancy grid, just the same red squares.

I feel like I'm missing something simple, like I'm not listening in on the right published topic. I've tried all the permuations of topic combinations but I cannot get a nice slam occupancy grid or map.

It might be easier to make a .bag file and post process it through hector mapping. Does anyone

Here is my current launch file:

  Used for visualising rplidar in action.  

  It requires rplidar.launch.
  <include file="$(find rplidar_ros)/launch/rplidar.launch" />
  <node name="rviz" pkg="rviz" type="rviz" args="-d $(find rplidar_ros)/rviz/rplidar.rviz" />
  <node pkg="hector_mapping" type="hector_mapping" name="hector_mapping" output="screen">
    <!-- Frame Names -->
    <param name="base_frame" value="base_link" />
    <!-- param name="base_frame" value="/laser" -->
    <param name="map_frame" value="map" />
    <param name="odom_frame" value="base-link" />
    <!-- param name="odom_frame" value="/laser" -->

    <!-- 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="2048"/>
    <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 = "-.5" />
    <param name="laser_z_max_value" value = "0.5" />

    <!-- Advertising config -->
    <param name="advertise_map_service" value="true"/>

    <param name="scan_subscriber_queue_size" value="5"/>
    <param name="scan_topic" value="/laser/scan"/>
    <!-- param name="scan_topic" value ...
edit retag flag offensive close merge delete

1 Answer

Sort by ยป oldest newest most voted

answered 2015-09-01 10:35:30 -0500

Jhair gravatar image

You are making a mistake here:

param name="base_frame" value="base_link"

param name="odom_frame" value="base-link"

It should be the same "base_link" for both.

I don't understand very well your launch file. I did it writing 3 launch files. The first one to setup the RVIZ, launch the hector_mapping.launch and the geotiff_mapper.launch. The second one to setup the hector_mapping parameters and also to launch the urg node. And the third one to setup the geotiff parameters. Those are mi files. I hope it helps.



<param name="/use_sim_time" value="false"/>ros
<node pkg="rviz" type="rviz" name="rviz" 
args="-d $(find hector_slam_launch)/rviz_cfg/mapping_demo.rviz"/>
<include file="$(find laser_prueba)/hector_mapping.launch"/>

<include file="$(find laser_prueba)/geotiff_mapper.launch">
<arg name="trajectory_source_frame_name" value="scanmatcher_frame"/> 




<node pkg="urg_node" type="urg_node" name="laser_scan">
  <param name="port" value="/dev/ttyACM0"/>
  <param name="frame_id" value="laser"/>
  <param name="calibrate_time" type="bool" value="true"/>  
  <param name="intensity" type="bool" value="false"/>
  <param name="min_ang" value="-2.356194437"/>   
  <param name="max_ang" value="2.35619443"/>    
  <param name="cluster" value="1"/>

<node pkg="hector_mapping" type="hector_mapping" name="hector_mapping"    output="screen">
  <param name="pub_map_odom_transform" value="true"/>
  <param name="map_frame" value="map" />
  <param name="base_frame" value="base_link" />
  <param name="odom_frame" value="base_link" />
  <!-- Map size / start point -->
  <param name="map_resolution" value="0.025"/>
  <param name="map_size" value="2048"/>
  <param name="map_start_x" value="0.5"/>
  <param name="map_start_y" value="0.5" />
  <param name="laser_z_min_value" value="-2.5" />
  <param name="laser_z_max_value" value="7.5" />

  <!-- Map update parameters -->
  <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.06" />

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



<arg name="trajectory_source_frame_name" default="/base_link"/>
<arg name="trajectory_update_rate" default="4"/>
<arg name="trajectory_publish_rate" default="0.25"/>

<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="double" value="$(arg trajectory_publish_rate)" />

<node pkg="hector_geotiff" type="geotiff_node" name="hector_geotiff_node" output="screen" launch-prefix="nice -n 15">
<remap from="map" to="/dynamic_map" />
<param name="map_file_path" type="string" value="$(find hector_geotiff)/maps" />
<param name="map_file_base_name" type="string" value="uprobotics" />
<param name="geotiff_save_period" type="double" value="0" />
<param name="draw_background_checkerboard" type="bool" value="true" />
<param name="draw_free_space_grid" type="bool" value="true" />

edit flag offensive delete link more

Question Tools

1 follower


Asked: 2015-08-04 19:12:20 -0500

Seen: 3,476 times

Last updated: Aug 04 '15