1

I have parse to XML rsi data from Kuka Robot and use it for interfacing Robot with Controller.I Need to know which is the XML Parser to be used for this parsing in boost c++ library?

3 Answers3

0

The answer is, no, there's no XML parser, let alone the specific KUKA RSI format.

You could use RapidXML (which underlies Boost Property Tree's XML backend). My personal favorite for small tasks is PugiXML. You should watch the decision advice here:

sehe
  • 374,641
  • 47
  • 450
  • 633
0

For future reference if someone asks this question:

Boost

Boost is supposed to stay a general library and therefore parsing XML is not its most important feature. There is however, as suggested PropertyTree with a tutorial here in Boost which is for general tree structure data format (e.g. json or XML).

XML

This being said, I do not recommend using boost for parsing XML structures in General. You can use as again suggested several small libraries specifically developed to parse XML strings efficiently and fast, again as suggested What XML parser should I use in C++?.

Robot Sensor Interface of KUKA (RSI)

Do not try to re-invente the wheel. There are even libraries for parsing XML structure of RSI. ROS Industrial already has a very good RSI interface called kuka_experimental package available here and on ROS website. This not only satisfies your need for XML parsing but also for controlling the robot through UDP communication, kinematics model, etc. If you are not happy with it, you can develop your own after reading the code and learning how it works.

This package uses TinyXML, a lightweight XML library which in my opinion is quite fast and easy to use. The files about how parsing is done are available under kuka_rsi_hw_interface, here. If you are not satisfied with this, you can still use another XML library or even upgrade this package to work with TinyXML2 which is supposed to be even more efficient with memory usage and faster. If you use CMake build system, you can easily add TinyXML as a submodule to your package.

Keivan
  • 673
  • 7
  • 15
-1

I don't know the KUKA RSI Format, but you can read and write data in the XML Format with the PropertyLibrary in boost.

Look here: http://www.boost.org/doc/libs/1_65_1/doc/html/property_tree.html

Ludger H.
  • 76
  • 6
  • Thank you for the answer...I just want to know is it feasible to use Property library for all XML formats – Chandan Lal Oct 04 '17 at 11:30
  • Please, don't advertise Boost Property Tree as an XML or JSON library. Too many puppies have died over this. – sehe Oct 04 '17 at 11:33