cartographer_ros icon indicating copy to clipboard operation
cartographer_ros copied to clipboard

I want to change the default topic

Open kooofresemi opened this issue 1 year ago • 1 comments

I want to change the topic of /scan. This is what the current trajectory_builder_2d.lua looks like with the changes.

submaps = {
    num_range_data = 90,
    grid_options_2d = {
      grid_type = "PROBABILITY_GRID",
      resolution = 0.05,
    },
    range_data_inserter = {
      range_data_inserter_type = "PROBABILITY_GRID_INSERTER_2D",
      probability_grid_range_data_inserter = {
        insert_free_space = true,
        hit_probability = 0.55,
        miss_probability = 0.49,
        topic = "/scan",
      },      
    },
  },

However, I got this error.

[cartographer_node-1] F0928 16:47:29.577988 22229 lua_parameter_dictionary.cc:410] Check failed: 1 == reference_counts_.count(key) (1 vs. 0) Key 'topic' was used the wrong number of times.
[cartographer_node-1] [FATAL] [1695887249.578198312] [cartographer_ros]: F0928 16:47:29.000000 22229 lua_parameter_dictionary.cc:410] Check failed: 1 == reference_counts_.count(key) (1 vs. 0) Key 'topic' was used the wrong number of times.

I think it would solve the problem if the default topic could be changed from /scan. Please let me know the candidate location to change the subscribed topic.

kooofresemi avatar Sep 28 '23 08:09 kooofresemi

Hello, here you can find an example on how to change the topic names cartographer expects.

lucamozza avatar Sep 29 '23 11:09 lucamozza