Skip to content

[Bug] Costmap observation layers fail silently when using relative topic names #5745

@cortesvitor

Description

@cortesvitor

Bug report

Required Info:

  • Operating System:
    • Ubuntu 24.04.3 LTS
  • Computer:
    • AMD Ryzen 5 3500U
  • ROS2 Version:
    • Jazzy binaries
  • Version or commit hash:
    • ros-jazzy-navigation2 1.3.10-1noble.20251108.013534
  • DDS implementation:
    • Tested with FastDDS and CycloneDDS

Steps to reproduce issue

Configure both the local_costmap and global_costmap with a scan topic name that does not start with a leading slash (/) in a params file:

local_costmap:
  local_costmap:
    ros__parameters:
      voxel_layer:
        observation_sources: scan
        scan:
          topic: prefix/scan  # <--- Topic name without leading slash

global_costmap:
  global_costmap:
    ros__parameters:
      obstacle_layer:
        observation_sources: scan
        scan:
          topic: prefix/scan  # <--- Topic name without leading slash

Expected behavior

Both local_costmap and global_costmap should successfully subscribe to the configured scan source, as the topic name is a valid relative topic name in ROS 2.

Actual behavior

The local_costmap and global_costmap observation layers start without any subscription to the configured scan source and without emitting any warning or error regarding the failure.

  • The global_costmap generates a costmap based only on the static map (from amcl).
  • The local_costmap generates an empty costmap.

Reproduction instructions

For now, the issue is resolved by adding a leading slash (/) in front of the scan topic name in the params file (e.g., changing prefix/scan to /prefix/scan).

Additional information

This suggests an inconsistent approach in the scan topic name parsing and resolution within the Nav2 stack:

  • The local_costmap and global_costmap observation layers fail silently when the scan topic lacks a leading slash.
  • Conversely, other core Nav2 components, such as amcl and the collision_monitor, appear to handle the same topic naming convention (relative names without a leading slash) correctly, highlighting a functional divergence in how scan topic names are resolved across the Nav2 package.

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions