Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Properly handle evaluated conditions #5

Open
mikepurvis opened this issue Oct 11, 2022 · 0 comments
Open

Properly handle evaluated conditions #5

mikepurvis opened this issue Oct 11, 2022 · 0 comments

Comments

@mikepurvis
Copy link
Contributor

mikepurvis commented Oct 11, 2022

Currently we handle the condition for ROS_PYTHON_VERSION via setting a distro-specific python value in the config toml:

os.environ['ROS_PYTHON_VERSION'] = str(self.distro.python_version)

However, what we don't properly handle is ROS_VERSION— this is done in a handful of chimera-type repos, where a single codebase supports both ROS 1 and 2, such as PlotJuggler:

https://github.com/facontidavide/PlotJuggler/blob/8c1ae51dfe966faa4af9c69b5284a7613e6c83f9/package.xml#L14-L22

The consequence of the current state of affairs is that when generating workspaces, Nix definitions, whatever which include a package like this, a bunch of dependencies from other-ROS show up as warnings about unresolved rosdeps.

The three main possibilities for how to better handle this are:

  1. Defer evaluating the conditions. This would require support from elsewhere, in particular Defer evaluated conditions? colcon/colcon-ros#128.
  2. Add an additional field to the repo_states table so that it stores PlotJuggler/8c1ae51dfe966faa4af9c69b5284a7613e6c83f9 in ROS 1 mode as a separate entity from that same version in ROS 2 mode. This could just be called ros_version, but it would be nice to figure out how to generalize it since very little else in colcon-distro is presently ROS-specific. In the extreme, this could be a whole table of potential "contexts" that the repo_states entries could key into.
  3. Switch to caching the whole package.xml file (where available), and generate PackageDescriptor objects at request time— this way any contextual information about the distribution will be known.
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

No branches or pull requests

1 participant