kroshu / kuka_drivers

Repository containing ROS2 drivers for multiple KUKA robots
Apache License 2.0
71 stars 21 forks source link

Make the KSS-RSI driver real-time safe #61

Open altex111 opened 1 year ago

Svastits commented 1 year ago

Heap allocations in control loop should also be removed! RSICommand heap-allocates in consctructor, and it is instantiated in every cycle (write)

altex111 commented 1 year ago

Tasks:

Low prio tasks (possibly in different branch):

altex111 commented 1 year ago

Evaluating PUGI XML

After creating my own xml parser i implemented the pugi xml parser too. The parser is capable of working on C style character strings which is compatible with the udp library i use. The user is also able to redefine the allocation functions. I redefined them with the memory resources library so the memory is allocated at the start of the algorithm.

Results

As the following diagrams shows there is a significant difference between the two xml parser both in encodeing and decodeing.

Decode

image

Encode

image

Conclusion and Tasks

The driver for encodeing and decoding messages to and from the RSI should use the PUGI XML parser. However further tests should be created to prove the real-time nature. The PUGI can be configured multiple ways. It should be checked whether the parser can be more stable. While decodeing there are a few spikes where the decode takes longer It should be investigated further whether thees comes from useing the memory resource or the algorithm need more time. Further task is to integrate the pugi xml into the driver. Also there is an open pull request which updates the pugi with its own pmr style memory resource.