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

Relative Paths #462

Open
tobiasduerschmid opened this issue Jul 26, 2021 · 0 comments
Open

Relative Paths #462

tobiasduerschmid opened this issue Jul 26, 2021 · 0 comments

Comments

@tobiasduerschmid
Copy link
Collaborator

When referencing files in launch files using relative paths, ros-wire throws this erro:


Traceback (most recent call last):
  File "/home/tdurschm/.local/share/virtualenvs/rosdiscover-hw20rvqf/bin/rosdiscover", line 33, in <module>
    sys.exit(load_entry_point('rosdiscover', 'console_scripts', 'rosdiscover')())
  File "/home/tdurschm/rosdiscover/src/rosdiscover/cli.py", line 164, in main
    args.func(args)
  File "/home/tdurschm/rosdiscover/src/rosdiscover/cli.py", line 40, in launch
    summary = _launch_config(args)
  File "/home/tdurschm/rosdiscover/src/rosdiscover/cli.py", line 35, in _launch_config
    return _launch(config)
  File "/home/tdurschm/rosdiscover/src/rosdiscover/cli.py", line 29, in _launch
    interpreter.launch(fn_launch)
  File "/home/tdurschm/rosdiscover/src/rosdiscover/interpreter/interpreter.py", line 59, in launch
    config = reader.read(launch_obj.filename, launch_obj.get_argv())
  File "/home/tdurschm/.local/share/virtualenvs/rosdiscover-hw20rvqf/lib/python3.9/site-packages/roswire/ros1/launch/reader.py", line 546, in read
    ctx, cfg = self._load_tags(ctx, cfg, list(launch))
  File "/home/tdurschm/.local/share/virtualenvs/rosdiscover-hw20rvqf/lib/python3.9/site-packages/roswire/ros1/launch/reader.py", line 162, in _load_tags
    ctx, cfg = loader(self, ctx, cfg, tag)
  File "/home/tdurschm/.local/share/virtualenvs/rosdiscover-hw20rvqf/lib/python3.9/site-packages/roswire/ros1/launch/reader.py", line 128, in wrapped
    return loader(self, ctx, cfg, elem)
  File "/home/tdurschm/.local/share/virtualenvs/rosdiscover-hw20rvqf/lib/python3.9/site-packages/roswire/ros1/launch/reader.py", line 427, in _load_include_tag
    ctx_child, cfg = self._load_tags(ctx_child, cfg, list(launch))
  File "/home/tdurschm/.local/share/virtualenvs/rosdiscover-hw20rvqf/lib/python3.9/site-packages/roswire/ros1/launch/reader.py", line 162, in _load_tags
    ctx, cfg = loader(self, ctx, cfg, tag)
  File "/home/tdurschm/.local/share/virtualenvs/rosdiscover-hw20rvqf/lib/python3.9/site-packages/roswire/ros1/launch/reader.py", line 128, in wrapped
    return loader(self, ctx, cfg, elem)
  File "/home/tdurschm/.local/share/virtualenvs/rosdiscover-hw20rvqf/lib/python3.9/site-packages/roswire/ros1/launch/reader.py", line 203, in _load_param_tag
    value = self._files.read(textfile)
  File "/home/tdurschm/.local/share/virtualenvs/rosdiscover-hw20rvqf/lib/python3.9/site-packages/dockerblade/files.py", line 262, in read
    self.copy_to_host(filename, filename_host_temp)
  File "/home/tdurschm/.local/share/virtualenvs/rosdiscover-hw20rvqf/lib/python3.9/site-packages/dockerblade/files.py", line 131, in copy_to_host
    raise exc.ContainerFileNotFound(path=path_container,
dockerblade.exceptions.ContainerFileNotFound: File not found [./src/.config/model/default.urdf] in container [0e00714cbe957ae2cd3365a30bc06d7f02799c0510913a3091fd5ae1eebc2278]
(rosdiscover) tdurschm@nostromo:~/rosdiscover$

The issue is in https://github.com/ChrisTimperley/roswire/blob/master/src/roswire/ros1/launch/reader.py#L396.
It doesn't convert relative paths into absolute paths.
Immediately after line 399, we should check if the path is relative, and if so, use the launch context to figure out the corresponding absolute path:
https://github.com/ChrisTimperley/roswire/blob/master/src/roswire/ros1/launch/reader.py#L399

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