Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Generating big maps, and using multiLidars #1477

Open
lsprior opened this issue May 27, 2020 · 0 comments
Open

Generating big maps, and using multiLidars #1477

lsprior opened this issue May 27, 2020 · 0 comments

Comments

@lsprior
Copy link

lsprior commented May 27, 2020

I have some doubts about effective ways to use cartographer, especially related to mapping. These questions if addressed could be added to the documentation, as they are fundamental questions.

Related to generating big maps:
1- How to use multiple rosbags to get a map? When using the following launch file, cartographer stops at the first bag (bag1 and does not continue to process bag2). Is this even possible, or should i use some image editing program to add the two maps? Except that bag1 and bag2 should have an overlap, is there anything else to consider?

<launch>
   <node name="cartographer_offline_node" pkg="cartographer_ros"
        type="cartographer_offline_node" args="
            -configuration_directory $(find bagsTesting)/config
            -configuration_basenames cartographer_offline_mapping_modified.lua
            -bag_filenames bag1, bag2" -------> here
        output="screen">
        <remap from="scan_1" to="/laser_front/scan" />
        <remap from="scan_2" to="/laser_rear/scan" />
        <remap from="odom" to="/odom" />
    </node>
  </launch>

2- Generating a map of 400*200 meters, with a resolution of 2cm, gives some errors in cartographer_assets_writer node that prevent the node from finishing. The following code is the respective launch and lua files, and errors. The problem here is that my computer has 16 GB and the memory used was about 10GB during processing. Maybe there was a spike on memory that I did not see. What to do to create big maps, with high resolution?

<launch>
  <arg name="config_file" default="grid_map_beacons.lua"/>
  <node name="cartographer_assets_writer" pkg="cartographer_ros" required="true"
      type="cartographer_assets_writer" args="
          -configuration_directory $(find bagsTesting)/config
          -configuration_basename $(arg config_file)
          -urdf_filename $(find bagsTesting)/config/agv_2d.urdf
          -bag_filenames $(find bagsTesting)/bags/$(arg bag_filenames)
          -pose_graph_filename $(find bagsTesting)/bags/$(arg bag_filenames).pbstream"
      output="screen">
  </node>
</launch>

--VOXEL_SIZE = 1e-2 -- 1cm
VOXEL_SIZE = 2e-2

XY_TRANSFORM =  {
  translation = { 0., 0., 0. },
  rotation = { 0., -math.pi / 2., 0., },
}

XZ_TRANSFORM =  {
  translation = { 0., 0., 0. },
  rotation = { 0. , 0., -math.pi / 2, },
}

YZ_TRANSFORM =  {
  translation = { 0., 0., 0. },
  rotation = { 0. , 0., math.pi, },
}

options = {
  tracking_frame = "base_link",
  pipeline = {
    {
      action = "min_max_range_filter",
      min_range = 1.0, -- 1.0
      max_range = 20.0, --60
    },

     {
       action = "write_probability_grid",
       draw_trajectories = false,
       resolution = 0.02,
       range_data_inserter = {
         insert_free_space = true,
         hit_probability = 0.55, --0.65
         miss_probability = 0.49, --0.196
       },
       filename = "grid_map",
     },
     
    {
      action = "write_xray_image",
      voxel_size = VOXEL_SIZE,
      filename = "beacons_map",
      transform = XY_TRANSFORM,
      draw_trajectories = false,
      separate_floors = false,
    },
  }
}

return options

And the errors:
Screenshot from 2020-05-27 09-55-25
This error could be solved by passing the voxel size as 7cm.

Then another error:

Optimizing: xx.x%...terminate called after throwing an instance of 'std::bad_alloc'
  what():  std::bad_alloc

This could be solved by using a different resolution in:

action = "write_probability_grid",
       draw_trajectories = false,
       resolution = 0.02,  --------to 4 cm

MultiLidars
3- Using to Lidars to create a map: I have a robot with 2 Lidars on the front, each on each corner, and even after much effort to calibrate them, they still are not perfectly aligned so they do not detect obstacles at exactly the same distance, as seen in the image below. Is this a problem, what can be done to be sure that the generated map will be usable for navigation? Should I use only 1? Any other advices?
Screenshot from 2020-05-26 17-39-47
Screenshot from 2020-05-26 17-40-15

4- What are the plans for https://google-cartographer-ros.readthedocs.io/en/latest/going_further.html#cloud-integration-with-grpc , is this already ready?

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

2 participants