The obstacle is not on my cost map

If I give a goal for the robot, it will bump into the obstacle.

I am using Humble and NAV2.


global_costmap:
global_costmap:
ros__parameters:
update_frequency: 2.0
publish_frequency: 2.0
global_frame: map
robot_base_frame: base_link
use_sim_time: True
robot_radius: 0.1
resolution: 0.05
track_unknown_space: true
plugins: [“static_layer”, “obstacle_layer”, “inflation_layer”]
static_layer:
enabled: True
plugin: “nav2_costmap_2d::StaticLayer”
map_subscribe_transient_local: True
obstacle_layer:
plugin: “nav2_costmap_2d::ObstacleLayer”
enabled: True
observation_sources: scan
scan:
topic: /scan
sensor_frame: “base_scan”
max_obstacle_height: 2.0
clearing: True
marking: True
data_type: “LaserScan”
# observation_persistence: 0.3
expected_update_rate: 1.0
raytrace_max_range: 3.0
raytrace_min_range: 0.0
obstacle_max_range: 2.5
obstacle_min_range: 0.0
inflation_layer:
plugin: “nav2_costmap_2d::InflationLayer”
cost_scaling_factor: 1.0
inflation_radius: 0.55
always_send_full_costmap: True
global_costmap_client:
ros__parameters:
use_sim_time: True
global_costmap_rclcpp_node:
ros__parameters:
use_sim_time: True

local_costmap:
local_costmap:
ros__parameters:
update_frequency: 5.0
publish_frequency: 5.0
global_frame: odom
robot_base_frame: base_link
use_sim_time: True
rolling_window: true
width: 3
height: 3
resolution: 0.05
robot_radius: 0.1
always_send_full_costmap: True
plugins: [“obstacle_layer”, “inflation_layer”]
obstacle_layer:
plugin: “nav2_costmap_2d::ObstacleLayer”
enabled: True
observation_sources: scan
scan:
topic: /scan
max_obstacle_height: 2.0
clearing: True
marking: True
data_type: “LaserScan”
# observation_persistence: 0.3
expected_update_rate: 1.0
inflation_layer:
plugin: “nav2_costmap_2d::InflationLayer”
cost_scaling_factor: 3.0
inflation_radius: 1.0
always_send_full_costmap: True
# voxel_layer:
# plugin: “nav2_costmap_2d::VoxelLayer”
# enabled: True
# publish_voxel_map: True
# origin_z: 0.0
# z_resolution: 0.05
# z_voxels: 16
# max_obstacle_height: 2.0
# mark_threshold: 0
# observation_sources: scan
# scan:
# topic: /scan
# max_obstacle_height: 2.0
# clearing: True
# marking: True
# data_type: “LaserScan”
# raytrace_max_range: 3.0
# raytrace_min_range: 0.0
# obstacle_max_range: 2.5
# obstacle_min_range: 0.0
# static_layer:
# map_subscribe_transient_local: True

local_costmap_client:
ros__parameters:
use_sim_time: True
local_costmap_rclcpp_node:
ros__parameters:
use_sim_time: True


I received an answer on ROS answer.
The answer on ROS answers.
What can I do?
I just want to study behavior trees as described in the official NAV2 manual. If I install Humble on Focal (20.2), will it work?

Hello @bluebird ,

Humble is supported for Focal, but it’s a Tier 3 platform, which means that you might encounter some bugs.

I run the official NAV2 demo of the Turtle bot on Jammy, which shows similar results as my homemade Turtle bot. It confirms that the problem is not my bad. I start to install Humble on Focal.

I used the temporary patch, and it seems to work.

I understand that it can be unreliable to force the ROS to subscribe to the Scan message. There must be a reason that it drops the message. However, for now, I have a workable system to continue my journey.

I have to stay in Jammy with Rolling. I have to use self-build NAV2. If this bug is fixed one day, I will come back to Humble.

Certainly, running into a bug is not a good experience. But, thanks to the community and thanks to you - the professors, I can continue to study these behavior trees.

Obstacles reappear in my homemade Turtle bot with Rolling and patched NAV2. Thank God!

I am still waiting for your new version of the NAV2 lecture. It is annoying to study NAV2 without a lecture.

The NAV2 in Foxy does not have the behavior server and the smoother. These nodes can only be found in Humble. However, the installed nav2_bringup in Foxy already contains these new nodes. And, the official manual is changing slowly to contain these new nodes. That means these new structures are not temporary but will exist for a long time.

The NAV2 in Foxy only contains a few behavior nodes; however, in Humble, there are much more nodes to use.

Furthermore, two behavior trees are needed in Humble. One is for a robot to move to a point, and the other is for a robot to move through many given points.

From the learning point of view, I think we should be ready.

However, the NAV2 in Humble seems not well prepared. Take the dropping scan message for example. A software should, at least, properly run its examples. I hope they can fix the bug quickly.

There are useful packages that are not ready either. For example, the turtle bot 3 package is not ready for Humble. Lucky, the Teleope package can still be used after being built in Humble. However, the navigation2 package in turtle bot three is the old one of Foxy.

1 Like