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

roscompile scripts have issues with plugin.xml files #77

Open
fmessmer opened this issue Dec 2, 2020 · 3 comments
Open

roscompile scripts have issues with plugin.xml files #77

fmessmer opened this issue Dec 2, 2020 · 3 comments

Comments

@fmessmer
Copy link

fmessmer commented Dec 2, 2020

I have been using both noetic_migration and upgrade_manifest scripts
I did not really look into the code to figure out what the problem is, but I wanted to report this here

whenever there is a plugin.xml file in the repository, I get errors similar to the following:

ERROR: Trouble parsing package @ ./ur_kinematics
Traceback (most recent call last):
  File "/home/fxm/projects/default/care-o-bot/src/roscompile/ros_introspection/src/ros_introspection/util.py", line 15, in get_packages
    packages.append(Package(root))
  File "/home/fxm/projects/default/care-o-bot/src/roscompile/ros_introspection/src/ros_introspection/package.py", line 30, in __init__
    self.plugin_configs.append(PluginXML(rel_fn, file_path))
  File "/home/fxm/projects/default/care-o-bot/src/roscompile/ros_introspection/src/ros_introspection/plugin_xml.py", line 18, in __init__
    self.read()
  File "/home/fxm/projects/default/care-o-bot/src/roscompile/ros_introspection/src/ros_introspection/plugin_xml.py", line 21, in read
    tree = parse(self.file_path)
  File "/usr/lib/python2.7/xml/dom/minidom.py", line 1918, in parse
    return expatbuilder.parse(file)
  File "/usr/lib/python2.7/xml/dom/expatbuilder.py", line 924, in parse
    result = builder.parseFile(fp)
  File "/usr/lib/python2.7/xml/dom/expatbuilder.py", line 207, in parseFile
    parser.Parse(buffer, 0)
ExpatError: junk after document element: line 11, column 0

what I did to work around this is:

  • remove the plugin file temporarily
  • run the roscomplie scripts
  • re-add the plugin file again
@DLu
Copy link
Owner

DLu commented Dec 2, 2020

It looks like its breaking on this plugin xml

On the one hand, roscompile should accept the same XML that pluginlib can parse.

On the other hand, to me that looks like invalid XML since there is not a <class_libraries> tag surrounding all three libraries.

I will look into what pluginlib is doing, and will see if I can add a rule to fix it.

@fmessmer
Copy link
Author

fmessmer commented Dec 2, 2020

here is another plugin.xml that roscompile has issues with:

<class_libraries>
  <library path="lib/liboutlier_scan_filters">
    <class name="outlier_scan_filters/ClusterScanFilter" type="outlier_scan_filters::ClusterScanFilter"
            base_class_type="filters::FilterBase<sensor_msgs::LaserScan>">
      <description>
        Cluster filters outliers based on cluster building.
      </description>
    </class>
    <class name="outlier_scan_filters/NeighbourScanFilter" type="outlier_scan_filters::NeighbourScanFilter"
            base_class_type="filters::FilterBase<sensor_msgs::LaserScan>">
      <description>
        Neighbour filters out outliers based on the distance from a points left and right neighbour.
      </description>
    </class>
  </library>
</class_libraries>

results in the following error:

rosrun roscompile noetic_migration -m
ERROR: Trouble parsing package @ ./outlier_scan_filters
Traceback (most recent call last):
  File "/home/fxm/projects/default/care-o-bot/src/roscompile/ros_introspection/src/ros_introspection/util.py", line 17, in get_packages
    packages.append(Package(root))
  File "/home/fxm/projects/default/care-o-bot/src/roscompile/ros_introspection/src/ros_introspection/package.py", line 31, in __init__
    self.plugin_configs.append(PluginXML(rel_fn, file_path))
  File "/home/fxm/projects/default/care-o-bot/src/roscompile/ros_introspection/src/ros_introspection/plugin_xml.py", line 18, in __init__
    self.read()
  File "/home/fxm/projects/default/care-o-bot/src/roscompile/ros_introspection/src/ros_introspection/plugin_xml.py", line 21, in read
    tree = parse(self.file_path)
  File "/usr/lib/python2.7/xml/dom/minidom.py", line 1918, in parse
    return expatbuilder.parse(file)
  File "/usr/lib/python2.7/xml/dom/expatbuilder.py", line 924, in parse
    result = builder.parseFile(fp)
  File "/usr/lib/python2.7/xml/dom/expatbuilder.py", line 207, in parseFile
    parser.Parse(buffer, 0)
ExpatError: not well-formed (invalid token): line 4, column 4

@DLu
Copy link
Owner

DLu commented Dec 10, 2020

That's another fun one. XMLLint tells me Unescaped '<' not allowed in attributes values, which makes sense, but also works with pluginlib apparently.

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

2 participants