Ask Your Question
0

[CARTOGRAPHER-ROS] "Submaps: For frame [map]: Frame [map] does not exist"

asked 2020-05-12 10:59:30 -0500

D.Schalk gravatar image

updated 2020-05-12 11:54:33 -0500

Hey, I have tried for a while now to get my Lidar setup to work with Cartographer ROS, with mixed results. I am using 2D lidar exclusively (Hokuyo ust-10lx, no imu).

My current launch files:

<launch>
  <param name="/use_sim_time" value="true" />

  <include file="$(find cartographer_ros)/launch/backpack_2d.launch" />

  <node name="rviz" pkg="rviz" type="rviz" required="true"
      args="-d $(find cartographer_ros)/configuration_files/demo_2d.rviz" />
  <node name="playbag" pkg="rosbag" type="play"
      args="--clock $(arg bag_filename)" />
    <param name="frame_id" value="/base_link"/>
</launch>
<launch>
  <param name="robot_description"
    textfile="$(find cartographer_ros)/urdf/backpack_2d.urdf" />

  <node name="robot_state_publisher" pkg="robot_state_publisher"
    type="robot_state_publisher" />

  <node name="cartographer_node" pkg="cartographer_ros"
      type="cartographer_node" args="
          -configuration_directory $(find cartographer_ros)/configuration_files
          -configuration_basename my_robot.lua"
      output="screen">
    <remap from="echoes" to="horizontal_laser_2d" />
  </node>

  <node name="cartographer_occupancy_grid_node" pkg="cartographer_ros"
      type="cartographer_occupancy_grid_node" args="-resolution 0.05" />
</launch>

and my current lua file:

options = {
      map_builder = MAP_BUILDER,
      trajectory_builder = TRAJECTORY_BUILDER,
      map_frame = "map",
      tracking_frame = "base_link",
      published_frame = "base_link",
      odom_frame = "odom",
      provide_odom_frame = true,
      publish_frame_projected_to_2d = false,
      use_odometry = false,
      use_nav_sat = false,
      use_landmarks = false,
      num_laser_scans = 1,
      num_multi_echo_laser_scans = 0,
      num_subdivisions_per_laser_scan = 1, --10
      num_point_clouds = 0,
      lookup_transform_timeout_sec = 0.2,
      submap_publish_period_sec = 0.3,
      pose_publish_period_sec = 5e-3,
      trajectory_publish_period_sec = 30e-3,
      rangefinder_sampling_ratio = 1.,
      odometry_sampling_ratio = 1.,
      fixed_frame_pose_sampling_ratio = 1.,
      imu_sampling_ratio = 1.,
      landmarks_sampling_ratio = 1.,
    }

    MAP_BUILDER.use_trajectory_builder_2d = true
    TRAJECTORY_BUILDER_2D.num_accumulated_range_data = 1081
    TRAJECTORY_BUILDER_2D.use_imu_data = false;

The rosbag that I am using is (only contains topic laserScan /scan (fixed_frame = base_link): 1: https://1drv.ms/u/s!AlYv1byT4VoNgySe8... This one gives no visual results at all 2: https://1drv.ms/u/s!AlYv1byT4VoNgyUuj... This one gives the result shown below The only difference between the two bags is that the Lidar moves in the first one but remains at the same position in the second one.

When run, cartographer does not give any errors in the terminal, but both submaps and constraints are missing frame map. Pictures of result, rqt_graph and rqt_tf_tree:

If I change the fixed frame name from base_link to map, both the RobotModel and the global status give errors as they require base_link to be present.

My question: What am I missing in my tf connections/cartographer settings?

edit retag flag offensive close merge delete

1 Answer

Sort by ยป oldest newest most voted
1

answered 2020-05-12 18:50:49 -0500

bob-ROS gravatar image

updated 2020-05-30 05:25:52 -0500

Do you have return options at the end of your lua file?

Edit: This seems too high. TRAJECTORY_BUILDER_2D.num_accumulated_range_data = 1081 Set it to e.g. TRAJECTORY_BUILDER_2D.num_accumulated_range_data = 1 and it worked for me in Gazebo. I believe this is the number of messages you want to accumulate for a full "revolution" of the scanner.

edit flag offensive delete link more

Comments

Yes I have

D.Schalk gravatar image D.Schalk  ( 2020-05-13 03:45:21 -0500 )edit

I still have not found an answer

D.Schalk gravatar image D.Schalk  ( 2020-05-29 07:47:17 -0500 )edit

Updating my answer

bob-ROS gravatar image bob-ROS  ( 2020-05-30 05:18:56 -0500 )edit

That was indeed the problem! Both rosbags with scan data from a stationary and moving car create a map. Thank you very much

D.Schalk gravatar image D.Schalk  ( 2020-06-01 06:49:50 -0500 )edit

Your Answer

Please start posting anonymously - your entry will be published after you log in or create a new account.

Add Answer

Question Tools

Stats

Asked: 2020-05-12 10:59:30 -0500

Seen: 1,538 times

Last updated: May 30 '20