Skip to content

grid_map_rviz_plugin appears to use grid_map_core directly without declaring it #538

Description

@Plumezz

Summary

grid_map_rviz_plugin appears to use grid_map_core directly in production/runtime code, but grid_map_core is not declared directly in grid_map_rviz_plugin/package.xml in humble branch.

The package currently remains buildable because the dependency is reachable through the recursive dependency closure. This issue is about making the direct dependency contract match the source usage, not claiming that the current default build necessarily fails.

Direct source usage

grid_map_rviz_plugin directly includes grid_map_core in the following source locations:

  • include/grid_map_rviz_plugin/GridMapVisual.hpp:19: #include <grid_map_core/GridMap.hpp>
  • src/GridMapVisual.cpp:19: #include <grid_map_core/GridMapMath.hpp>

The dependency is also used through concrete types or APIs, rather than being included/imported without use:

  • include/grid_map_rviz_plugin/GridMapVisual.hpp:71: grid_map::GridMap map_;
  • src/GridMapVisual.cpp:57: grid_map::GridMapRosConverter::fromMessage(*msg, map_);
  • src/GridMapVisual.cpp:103: const grid_map::Matrix & heightData = map_[flatTerrain ? layerNames[0] : heightLayer];
  • src/GridMapVisual.cpp:104: const grid_map::Matrix & colorData = map_[flatColor ? layerNames[0] : colorLayer];
  • src/GridMapVisual.cpp:152: grid_map::Position position;
  • src/GridMapVisual.cpp:153: grid_map::Index index(i + k, j + l);
  • src/GridMapVisual.cpp:164: grid_map::colorValueToVector(color, colorVectorRGB);

Package metadata

The collected package metadata and raw package.xml context contain no direct declaration of grid_map_core. The appropriate declaration is likely <depend>grid_map_core</depend>, subject to the package maintainer's preferred dependency scope.

Build/test trace observation

Build/test file-access tracing observed some events associated with grid_map_core during build;test. Observed artifact kinds were ament_resource;other.

Representative accessed paths include:

  • grid_map_core/share/ament_index/resource_index/package_run_dependencies/grid_map_core
  • grid_map_core/share/grid_map_core/package.sh
  • grid_map_core/share/grid_map_core/hook/cmake_prefix_path.sh
  • grid_map_core/share/grid_map_core/local_setup.sh

Transitive path

grid_map_rviz_plugin -> grid_map_ros -> grid_map_core
grid_map_rviz_plugin -> grid_map_ros -> grid_map_cv -> grid_map_core

Suggested fix

Would it make sense to declare grid_map_core directly in grid_map_rviz_plugin/package.xml and, where needed by the package's build style, add the corresponding CMake dependency to the target that uses it?

Notes

This issue does not claim that the package currently fails to build. The concern is that the package directly uses grid_map_core while relying on a transitive dependency path to make it available. The evidence combines package metadata, concrete source-level use, recursive dependency closure analysis, and build/test file-access tracing.

Could you please confirm whether this dependency is intentionally left implicit, or whether an explicit declaration would be appropriate?

I would be happy to open a small PR adding the dependency if that matches the intended package metadata.

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