Skip to content

Comments

feat: Add Navigation Support for FindPackageShare and get_package_share_directory#63

Open
tibisabau wants to merge 1 commit intoKodo-Robotics:mainfrom
tibisabau:feat/add-navigation-support
Open

feat: Add Navigation Support for FindPackageShare and get_package_share_directory#63
tibisabau wants to merge 1 commit intoKodo-Robotics:mainfrom
tibisabau:feat/add-navigation-support

Conversation

@tibisabau
Copy link

Description

This PR implements navigation support for FindPackageShare and get_package_share_directory functions in the LaunchMap parser. The parser now resolves these calls to actual filesystem paths using ROS 2's ament_index_python.packages.get_package_share_directory, while maintaining backward compatibility with the existing symbolic expression format.

Implementation Details

  • Created package_path_resolver.py utility module to handle package path resolution with graceful error handling
  • Enhanced FindPackageShare handler to include resolved_path field in output when package is available
  • Modified get_package_share_directory resolver to return structured dict with both symbolic expression and resolved path
  • Updated postprocessing logic to properly distinguish between launch constructs (no quotes in PathJoinSubstitution) and Python function calls (with quotes)
  • Added comprehensive unit tests to verify both resolution functionality and error handling

The implementation gracefully handles cases where:

  • ament_index_python is not available (warns but continues)
  • Package cannot be found (warns but continues)
  • Package is found (includes resolved_path in output)

Closes #52.

Checklist if Applicable

  • The tests passed – npm run test:parser (94 passed, 1 skipped)
  • Linting passed – npm run lint:py (All checks passed!)
  • Documentation has been added
  • CHANGELOG.md has been updated

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

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Add Navigation Support for FindPackageShare and get_package_share_directory

1 participant