• Small knowledge, big challenge! This article is participating in the creation activity of “Essential Tips for Programmers”.

The document indicates the size parameters of the robot chassis and the expansion parameters of the obstacle. For the specific robot, the corresponding parameters should be modified to be consistent with the robot body. # The maximum effective height of the sensor reading, in meters;

It is usually set to slightly higher than the actual height of the robot, which refers to the maximum height including the straightening of the robot arm.

Max_obstacle_height: 0.60 # assume something like an arm is mounted on top of the robot

 

Robot_radius For a round robot, this is the radius of the robot in meters; For a non-circular robot,

You can use the footprint parameter next. The values used here are Turtle’s raw data.

Robot_radius: 0.15 # Distance a circular robot should be clear of the obstacle (Kobuki: 0.18)

 

footprint: [[x0, y0], [x1, y1], … [xn, yn]]  # if the robot is not circular

Each coordinate in the list represents a point on the robot’s side, and the robot’s center is set to [0,0]. It’s measured in meters.

The points on the perimeter of the robot are arranged either clockwise or counterclockwise.

When the robot is not round, first find the rotation center of the robot, that is, the center point of the two wheels is set as (0,0), and then determine the orientation of the robot. X and y are each vertex of each edge of each robot geometry. I’m going to list all the vertices in there. This completes robot’s footprint

Footprint: [[0.55, 0.375], [0.55, 0.375], [0.55, 0.375], [0.55, 0.375]]

 

Graph type, here voxel(voxel map). Another type of map is a costmap.

The difference between the two is that the former is a 3D representation of the world, while the latter is a 2D representation of the world.

map_type: voxel

 

Barrier layer parameter

obstacle_layer:

Enabled: true # Enable

Maximum effective height of sensor reading (unit: m). It is usually set to slightly higher than the robot. Setting this parameter to a value greater than the global max_OBSTACLE_height parameter will invalidate.

Setting a value less than the global max_OBSTACLE_height will filter out points on the sensor that are greater than that height.

Max_obstacle_height: 0.6

Min_obstacle_height: 0.0

Combination_method: Handles the behavior of incoming data from layers other than obstACle_LAYe,

Enum type (enum). The possible values are: Overwrite the existing value “Overwrite” (0), take the Maximum value “Maximum” (1), and do Nothing (99). “Overwriting” simply “overwrites” other layers of data, such as making them ineffective. “Max out” is what you need most of the time. It extracts the maximum value of data provided in obstACLE_Layer or input data. “Nothing” doesn’t change the incoming data at all.

# Note that this dramatically affects how Costmap behaves, depending on how you set track_UNkown_space.

combination_method:   1

Track_unknown_space If false, each pixel has one of two states:

Lethal or Free. If true, each pixel has one of three states:

Lethal, free or unknown.

track_unknown_space:  true    #true needed for disabling global path planning through unknown space

These two parameters are used to set the threshold for the barrier information in the cost map.

“Obstacle_range” updates the obstacle information within the radius centered on the robot.

Insert the maximum range of obstacles into the cost map, in meters.

Obstacle_range: 2.0

Raytrace_range updates the free space within the radius of the robot as the center.

Scan out the maximum range of obstacles from the map, in meters.

Raytrace_range: 5.0

# Not currently used

Origin_z z origin, in meters, only for voxel maps

# origin_z: 0.0

#z_resolution = meters/cell;

# z_resolution: 0.2

#z_voxels Number of voxels per vertical column. The default value for the ROS Nav feature pack is 10.

#z_voxels: 2

# unknown_threshold: 15 The maximum number of unknown units in a column when the voxel is known

Mark_threshold: 0 Specifies the maximum number of marked cells in the voxel column when the voxel column is “free”.

 

 

Publish_voxel_map: Whether to publish the underlying voxel raster map, which is mainly used for visualization.

publish_voxel_map: false

The “observation_sources” parameter defines a series of sensors that pass spatial information to the cost map. Each sensor is defined on the next line.

 

Looking at the sources, we have laser data (SCAN) and bump data (bump). The observation source list is separated by Spaces that define each of the <source_name> namespaces in the following arguments.

observation_sources:  scan

scan:

data_type: LaserScan

topic: “/scan”

The “marking” and “clearing” parameters determine whether the sensor is used to add obstacle information to the cost map,

Clear the obstacle message from the cost map, or both.

marking: true

clearing: true

expected_update_rate: 0

Note: About Marking and Clearing:

Marking and clearing parameters are used to indicate whether real-time sensor information is needed to add or remove obstacle information from the cost map.)

Cost maps automatically subscribe to sensor topics and automatically update.

Each sensor is used for tag operations (inserting obstacle information into the cost map), clear operations (removing obstacle information from the cost map), or both.

If the voxel layer is used, the obstacle information on each column needs to be projected into two dimensions before it can be placed in the cost map.

 

#cost_scaling_factor and inflation_radius were now moved to the inflation_layer ns

# Expansion layer parameters

inflation_layer:

Enabled: true # Enable expansion map

# cost_SCALing_factor The scale factor applied to the surrogate value during inflation. Default value: 10. For cells outside the inner radius and cells within the inner radius, the calculation formula of the cost function is as follows:

Exp (-1.0 * cost_scaling_factor * (distance_from_obstacle – inscribed_radius)) * (costmap_2d::INSCRIBED_INFLATED_OBSTACLE 1)

Cost_scaling_factor: 10.0 # Exponential rate at which the obstacle cost drops off (default: 10)

Here we set the footprint of the robot. When filling in the footprint specified by “Footprint” according to the robot coordinate setting, the center of the robot is considered to be at (0.0,0.0), which is supported by both clockwise and counterclockwise specifications.

Robot_radius: Yes The occupied area of the robot is round. You can set the radius directly

Inflation_radius: Sets the inflating radius of the cost map. It can be understood that with the robot as the center, no obstacle can appear within this value of expansion radius.

The radius of the obstacle on the map is in meters. If your robot can’t fit through a narrow door or other narrow place very well,

I’m going to decrease this a little bit. Conversely, if the robot keeps bumping into things, try to increase this value.

Inflation_radius: 0.1 # Max. Distance from an obstacle at which costs are incurred for planning paths.

 

static_layer:

enabled:              true

map_topic:            “/map”

 

 

# appendix:

Bump: Look at source 2: bump data. It defines: observing the data type of the source, publishing topics, marking and adding obstacles functions, and defining the effective range of sensor source values

Data_type: PointCloud2 Indicates that the data type is point cloud

Topic: Mobile_base /sensors/bumper_pointcloud topic is mobile_base/sensors/bumper_pointcloud

Marking: true Enables the function of marking obstacles

Clearing: false Disables clearing of obstacles

Min_obstacle_height: 0.0 Lowest effective sensor reading in meters.

Max_obstacle_height: 0.15 Maximum effective height of a sensor reading in meters.