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

Key 'collate_landmarks' was used the wrong number of times #4

Open
nkuligaofeng opened this issue Nov 21, 2018 · 2 comments
Open

Key 'collate_landmarks' was used the wrong number of times #4

nkuligaofeng opened this issue Nov 21, 2018 · 2 comments

Comments

@nkuligaofeng
Copy link

nkuligaofeng commented Nov 21, 2018

I'm learning the cartographer these days. I have successfully run the 2D backpack demo and the 3D backpack demo. However, I face a problem when I run the Static Landmarks demo.
Here is the problem.
I have install the "cartographer_mir" successfully. When I try to launch the landmarks demo as guided by https://google-cartographer-ros.readthedocs.io/en/latest/demos.html:
roslaunch cartographer_mir offline_mir_100_rviz.launch bag_filename:=${HOME}/Downloads/landmarks_demo_uncalibrated.bag
, I meet the following error:

[...../offline_mir_100_rviz.launch] requires the 'bag_filenames' arg to be set

So I checked the "offline_mir_100_rviz.launch" file and found that the arg name is 'bag_filenames' instead of ‘bag_filename’. So a 's' is missing in the commend line shown in https://google-cartographer-ros.readthedocs.io/en/latest/demos.html.

However, I meet another error when I fix this problem:

[FATAL] [1542782924.721540472]: F1121 14:48:44.000000 27311 lua_parameter_dictionary.cc:410] Check failed: 1 == reference_counts_.count(key) (1 vs. 0) Key 'collate_landmarks' was used the wrong number of times.

I checked the configurations file: /cartographer_mir/cartographer_mir/configuration_files/mir-100-mapping.lua. I found that the parameter "collate_landmarks" is set to be false. So I modify it to be true as following:
TRAJECTORY_BUILDER.collate_landmarks = true

However, the error is same:

[FATAL] [1542782924.721540472]: F1121 14:48:44.000000 27311 lua_parameter_dictionary.cc:410] Check failed: 1 == reference_counts_.count(key) (1 vs. 0) Key 'collate_landmarks' was used the wrong number of times.

Could someone to help me? I don't know what's the problem.

@nkuligaofeng
Copy link
Author

I'm learning the cartographer these days. I have successfully run the 2D backpack demo and the 3D backpack demo. However, I face a problem when I run the Static Landmarks demo.
Here is the problem.
I have install the "cartographer_mir" successfully. When I try to launch the landmarks demo as guided by https://google-cartographer-ros.readthedocs.io/en/latest/demos.html:
roslaunch cartographer_mir offline_mir_100_rviz.launch bag_filename:=${HOME}/Downloads/landmarks_demo_uncalibrated.bag
, I meet the following error:

[...../offline_mir_100_rviz.launch] requires the 'bag_filenames' arg to be set

So I checked the "offline_mir_100_rviz.launch" file and found that the arg name is 'bag_filenames' instead of ‘bag_filename’. So a 's' is missing in the commend line shown in https://google-cartographer-ros.readthedocs.io/en/latest/demos.html.

However, I meet another error when I fix this problem:

[FATAL] [1542782924.721540472]: F1121 14:48:44.000000 27311 lua_parameter_dictionary.cc:410] Check failed: 1 == reference_counts_.count(key) (1 vs. 0) Key 'collate_landmarks' was used the wrong number of times.

I checked the configurations file: /cartographer_mir/cartographer_mir/configuration_files/mir-100-mapping.lua. I found that the parameter "collate_landmarks" is set to be false. So I modify it to be true as following:
TRAJECTORY_BUILDER.collate_landmarks = true

However, the error is same:

[FATAL] [1542782924.721540472]: F1121 14:48:44.000000 27311 lua_parameter_dictionary.cc:410] Check failed: 1 == reference_counts_.count(key) (1 vs. 0) Key 'collate_landmarks' was used the wrong number of times.

Could someone to help me? I don't know what's the problem.

I have solved this problem.
Actually, the value of the parameter "collate_landmarks" should not be "true" or "false". It should be "on" or "off".
Also, the value for "use_pose_extrapolator" should be "on".

So when I modify the .lua file as following, I run the Static Landmarks demo successfully.

use_pose_extrapolator = on
TRAJECTORY_BUILDER.collate_landmarks = on

@Phymin
Copy link

Phymin commented Dec 5, 2018

I'm learning the cartographer these days. I have successfully run the 2D backpack demo and the 3D backpack demo. However, I face a problem when I run the Static Landmarks demo.
Here is the problem.
I have install the "cartographer_mir" successfully. When I try to launch the landmarks demo as guided by https://google-cartographer-ros.readthedocs.io/en/latest/demos.html:
roslaunch cartographer_mir offline_mir_100_rviz.launch bag_filename:=${HOME}/Downloads/landmarks_demo_uncalibrated.bag
, I meet the following error:

[...../offline_mir_100_rviz.launch] requires the 'bag_filenames' arg to be set

So I checked the "offline_mir_100_rviz.launch" file and found that the arg name is 'bag_filenames' instead of ‘bag_filename’. So a 's' is missing in the commend line shown in https://google-cartographer-ros.readthedocs.io/en/latest/demos.html.
However, I meet another error when I fix this problem:

[FATAL] [1542782924.721540472]: F1121 14:48:44.000000 27311 lua_parameter_dictionary.cc:410] Check failed: 1 == reference_counts_.count(key) (1 vs. 0) Key 'collate_landmarks' was used the wrong number of times.

I checked the configurations file: /cartographer_mir/cartographer_mir/configuration_files/mir-100-mapping.lua. I found that the parameter "collate_landmarks" is set to be false. So I modify it to be true as following:
TRAJECTORY_BUILDER.collate_landmarks = true
However, the error is same:

[FATAL] [1542782924.721540472]: F1121 14:48:44.000000 27311 lua_parameter_dictionary.cc:410] Check failed: 1 == reference_counts_.count(key) (1 vs. 0) Key 'collate_landmarks' was used the wrong number of times.

Could someone to help me? I don't know what's the problem.

I have solved this problem.
Actually, the value of the parameter "collate_landmarks" should not be "true" or "false". It should be "on" or "off".
Also, the value for "use_pose_extrapolator" should be "on".

So when I modify the .lua file as following, I run the Static Landmarks demo successfully.

use_pose_extrapolator = on
TRAJECTORY_BUILDER.collate_landmarks = on

This doesn't work, I still has the same problem:

[FATAL] [1543988472.878488836]: F1205 13:41:12.000000  5108 lua_parameter_dictionary.cc:410] Check failed: 1 == reference_counts_.count(key) (1 vs. 0) Key 'collate_landmarks' was used the wrong number of times.

Here is my configure file:

-- Copyright 2018 The Cartographer Authors
--
-- Licensed under the Apache License, Version 2.0 (the "License");
-- you may not use this file except in compliance with the License.
-- You may obtain a copy of the License at
--
--      http://www.apache.org/licenses/LICENSE-2.0
--
-- Unless required by applicable law or agreed to in writing, software
-- distributed under the License is distributed on an "AS IS" BASIS,
-- WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
-- See the License for the specific language governing permissions and
-- limitations under the License.

include "map_builder.lua"
include "trajectory_builder.lua"

options = {
  map_builder = MAP_BUILDER,
  trajectory_builder = TRAJECTORY_BUILDER,
  map_frame = "map",
  tracking_frame = "imu_frame",
  published_frame = "base_link",
  odom_frame = "odom",
  provide_odom_frame = true,
  publish_frame_projected_to_2d = false,
  use_odometry = true,
  use_pose_extrapolator = on,
  use_nav_sat = false,
  use_landmarks = true,
  num_laser_scans = 2,
  num_multi_echo_laser_scans = 0,
  num_subdivisions_per_laser_scan = 1,
  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.collate_landmarks = on
TRAJECTORY_BUILDER_2D.num_accumulated_range_data = 2
TRAJECTORY_BUILDER_2D.use_imu_data = true
TRAJECTORY_BUILDER_2D.submaps.num_range_data = 45

-- more points
TRAJECTORY_BUILDER_2D.adaptive_voxel_filter.max_length = 0.2
TRAJECTORY_BUILDER_2D.adaptive_voxel_filter.min_num_points = 400
-- slightly slower insertion
TRAJECTORY_BUILDER_2D.submaps.range_data_inserter.probability_grid_range_data_inserter.hit_probability = 0.53
TRAJECTORY_BUILDER_2D.submaps.range_data_inserter.probability_grid_range_data_inserter.miss_probability = 0.493
-- slightly shorter rays
TRAJECTORY_BUILDER_2D.max_range = 15.
-- wheel odometry is fine
TRAJECTORY_BUILDER_2D.ceres_scan_matcher.translation_weight = 20
-- IMU is ok
TRAJECTORY_BUILDER_2D.ceres_scan_matcher.rotation_weight = 20

-- less outliers
POSE_GRAPH.constraint_builder.max_constraint_distance = 5.
POSE_GRAPH.constraint_builder.min_score = 0.5
-- tune down IMU in optimization
POSE_GRAPH.optimization_problem.acceleration_weight = 0.1 * 1e3
POSE_GRAPH.optimization_problem.rotation_weight = 0.1 * 3e5
-- ignore wheels in optimization
POSE_GRAPH.optimization_problem.odometry_translation_weight = 0.
POSE_GRAPH.optimization_problem.odometry_rotation_weight = 0.
POSE_GRAPH.optimization_problem.log_solver_summary = true

return options 

Update

I have solved the problem, after change the configure file, you should rebuild the cartographer_mir, or you can change the configure file in /install_isolated/share/cartographer_mir/configuration_files/mir-100-mapping.lua

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

No branches or pull requests

2 participants