简体   繁体   中英

XML RSI(KUKA robot format) parsing library in boost c++?

我已经解析了来自Kuka Robot的XML rsi数据,并将其用于将Robot与Controller接口。我想知道在boost c ++库中用于解析的XML Parser是哪一个?

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:

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 (eg 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.

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

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM