cmu-rss-lab / roswire

A library for static and dynamic analysis of ROS applications via Docker 🔌
http://christimperley.co.uk/roswire
Apache License 2.0
8 stars 0 forks source link

Add handling of integer-based boolean values in launch file "if" attributes #468

Closed ChrisTimperley closed 3 years ago

ChrisTimperley commented 3 years ago
2021-08-19 16:02:54.609 | DEBUG    | roswire.app.instance:close:159 - destroyed app instance directory: /home/chris/.roswire/containers/tmpmnuuslpn
Traceback (most recent call last):
  File "/home/chris/.local/share/virtualenvs/rosdiscover-39I1LD61/bin/rosdiscover", line 33, in <module>
    sys.exit(load_entry_point('rosdiscover', 'console_scripts', 'rosdiscover')())
  File "/home/chris/tools/rosdiscover/src/rosdiscover/cli.py", line 191, in main
    args.func(args)
  File "/home/chris/tools/rosdiscover/src/rosdiscover/cli.py", line 49, in launch
    summary = _launch_config(args)
  File "/home/chris/tools/rosdiscover/src/rosdiscover/cli.py", line 44, in _launch_config
    return _launch(config)
  File "/home/chris/tools/rosdiscover/src/rosdiscover/cli.py", line 38, in _launch
    interpreter.launch(fn_launch)
  File "/home/chris/tools/rosdiscover/src/rosdiscover/interpreter/interpreter.py", line 85, in launch
    config = reader.read(launch_description.filename, launch_description.get_argv())
  File "/home/chris/.local/share/virtualenvs/rosdiscover-39I1LD61/src/roswire/src/roswire/ros1/launch/reader.py", line 546, in read
    ctx, cfg = self._load_tags(ctx, cfg, list(launch))
  File "/home/chris/.local/share/virtualenvs/rosdiscover-39I1LD61/src/roswire/src/roswire/ros1/launch/reader.py", line 162, in _load_tags
    ctx, cfg = loader(self, ctx, cfg, tag)
  File "/home/chris/.local/share/virtualenvs/rosdiscover-39I1LD61/src/roswire/src/roswire/ros1/launch/reader.py", line 128, in wrapped
    return loader(self, ctx, cfg, elem)
  File "/home/chris/.local/share/virtualenvs/rosdiscover-39I1LD61/src/roswire/src/roswire/ros1/launch/reader.py", line 427, in _load_include_tag
    ctx_child, cfg = self._load_tags(ctx_child, cfg, list(launch))
  File "/home/chris/.local/share/virtualenvs/rosdiscover-39I1LD61/src/roswire/src/roswire/ros1/launch/reader.py", line 162, in _load_tags
    ctx, cfg = loader(self, ctx, cfg, tag)
  File "/home/chris/.local/share/virtualenvs/rosdiscover-39I1LD61/src/roswire/src/roswire/ros1/launch/reader.py", line 128, in wrapped
    return loader(self, ctx, cfg, elem)
  File "/home/chris/.local/share/virtualenvs/rosdiscover-39I1LD61/src/roswire/src/roswire/ros1/launch/reader.py", line 427, in _load_include_tag
    ctx_child, cfg = self._load_tags(ctx_child, cfg, list(launch))
  File "/home/chris/.local/share/virtualenvs/rosdiscover-39I1LD61/src/roswire/src/roswire/ros1/launch/reader.py", line 162, in _load_tags
    ctx, cfg = loader(self, ctx, cfg, tag)
  File "/home/chris/.local/share/virtualenvs/rosdiscover-39I1LD61/src/roswire/src/roswire/ros1/launch/reader.py", line 126, in wrapped
    if not self._ifunless_check(elem, ctx):
  File "/home/chris/.local/share/virtualenvs/rosdiscover-39I1LD61/src/roswire/src/roswire/ros1/launch/reader.py", line 511, in _ifunless_check
    return _parse_bool("if", if_val)
  File "/home/chris/.local/share/virtualenvs/rosdiscover-39I1LD61/src/roswire/src/roswire/ros1/launch/reader.py", line 65, in _parse_bool
    raise FailedToParseLaunchFile(m)
roswire.exceptions.FailedToParseLaunchFile: illegal boolean attribute [if]: 0

Reference handling: https://github.com/ros/ros_comm/blob/f5fa3a168760d62e9693f10dcb9adfffc6132d22/tools/roslaunch/src/roslaunch/loader.py#L58-L108