cra-ros-pkg / robot_localization

robot_localization is a package of nonlinear state estimation nodes. The package was developed by Charles River Analytics, Inc. Please ask questions on answers.ros.org.
http://www.cra.com
Other
1.38k stars 887 forks source link

Problem listing declared nodelets #519

Open pauljurczak opened 4 years ago

pauljurczak commented 4 years ago

When running rosrun nodelet declared_nodelets Ubuntu 18.04.3 with Ros melodic, I'm getting:

/opt/ros/melodic/share/robot_localization/nodelet_plugins.xml: junk after document element: line 10, column 0
ayrton04 commented 4 years ago

Hmm...looking at this and other packages that give me the same error, the issue seems to be that declared_nodelets doesn't like having more than one library tag in the XML doc. It's this line that's failing:

https://github.com/ros/nodelet_core/blob/c833c6e64f7f228de2c2bd56a7c60d279b6910f4/nodelet/scripts/declared_nodelets#L74

From https://stackoverflow.com/questions/7693204/expaterror-junk-after-document-element:

XML is required to have exactly one top-level element. By the time you parse it, it has a number of top-level tags. The XML parser is parsing the first one as a root element, and then is surprised to find another top-level element.

So we have two options:

  1. Make a new XML plugin doc for every library in the current one, making sure to install them in the CMakeLists.txt, and reference them in the package.xml.
  2. Build all the nodelets into single library, and have multiple class tags inside one library tag.

I won't get the cycles, but will accept a PR.