Skip to content

Add Navigation Support for FindPackageShare and get_package_share_directory #52

Description

@SakshayMahna

Goal

When LaunchMap parses a ROS 2 launch file, it may encounter calls to:

  • FindPackageShare("package_name")
  • get_package_share_directory("package_name")

These are used to resolve the filesystem path to a package share directory.
Currently, the parser outputs the expression but doesn’t resolve it to the actual path on the system.

The goal of this issue is to update the parser so that whenever it encounters these functions, it resolves the real directory path and includes it in the output.

Acceptance Criteria

  • Detect both FindPackageShare and get_package_share_directory calls during parsing.
  • Use ROS 2 ament_index_python.packages.get_package_share_directory to resolve the actual path (or any other approach).
  • Update parser output so that:
    • resolved_path is included alongside the original expression.
    • If the package is not found, gracefully handle with a warning in output.
    • Add unit tests with minimal launch files to verify both functions.

Sub-Tasks

  • Implement resolver that imports and calls ament_index_python methods.
  • Integrate resolver for FindPackageShare("example_pkg").
  • Integrate resolver for get_package_share_directory("example_pkg").
  • Handle missing packages gracefully.

Notes

This is the base feature for resolving more complex path constructs in the future (PathJoinSubstitution, ParameterFile, etc.).

Activity

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions