Is there any way to print the parameters of costmap_2d and the comments of the parameters to the terminal?

asked 2020-04-23 02:53:34 -0500

willzoe gravatar image

When I configured costmap, I found that the parameters displayed on the wiki are not comprehensive (for example, some parameters in the reference documents I used are not in the Wiki interface).

Therefore, I went to check the source code of the navigation stack. In the folder navigation / costmap_2d / cfg /, I saw some parameters. For example, in the file navigation / costmap_2d / cfg / Costmap2D.cfg, the code is as follows:

#!/usr/bin/env python

from dynamic_reconfigure.parameter_generator_catkin import ParameterGenerator, double_t, int_t, str_t

gen = ParameterGenerator()

gen.add("transform_tolerance", double_t, 0, "Specifies the delay in transform (tf) data that is tolerable in seconds.", 0.3, 0, 10)
gen.add("update_frequency", double_t, 0, "The frequency in Hz for the map to be updated.", 5, 0, 100)
gen.add("publish_frequency", double_t, 0, "The frequency in Hz for the map to publish display information.", 0, 0, 100)

#map params
gen.add("width", int_t, 0, "The width of the map in meters.", 10, 0)
gen.add("height", int_t, 0, "The height of the map in meters.", 10, 0)
gen.add("resolution", double_t, 0, "The resolution of the map in meters/cell.", 0.05, 0, 50)
gen.add("origin_x", double_t, 0, "The x origin of the map in the global frame in meters.", 0)
gen.add("origin_y", double_t, 0, "The y origin of the map in the global frame in meters.", 0)

# robot footprint shape
gen.add("footprint", str_t, 0, "The footprint of the robot specified in the robot_base_frame coordinate frame as a list in the format: [ [x1, y1], [x2, y2], ...., [xn, yn] ].", "[]")
gen.add("robot_radius", double_t, 0, 'The radius of the robot in meters, this parameter should only be set for circular robots, all others should use the footprint parameter described above.', 0.46, 0, 10)
gen.add("footprint_padding", double_t, 0, "How much to pad (increase the size of) the footprint, in meters.", 0.01)

exit(gen.generate("costmap_2d", "costmap_2d", "Costmap2D"))

This shows the parameter name, comment and default value. But these comments and default values seem to be in formatted form. For example, in the following line, I know there is a parameter named robot_radius, which means The radius of the robot in meters, this parameter should only be set for circular robots, all others should use the footprint parameter described above.. But there are three behind Values (0.46, 0, 10), I don’t know which one is the default.

gen.add("robot_radius", double_t, 0, 'The radius of the robot in meters, this parameter should only be set for circular robots, all others should use the footprint parameter described above.', 0.46, 0, 10)

Is there any way to format the parameters in these files and output them in the terminal so that the default values and comments of the parameters can be clearly viewed?

edit retag flag offensive close merge delete

Comments

1

Quick comment: these files are the configuration files for dynamic_reconfigure. It's not directly an answer, but you may want to start rqt_reconfigure to take a look at them.

gvdhoorn gravatar image gvdhoorn  ( 2020-04-23 03:55:45 -0500 )edit