ROS Resources: Documentation | Support | Discussion Forum | Index | Service Status | ros @ Robotics Stack Exchange |
1 | initial version |
I finally found the problem. As explained in this answer there are various threads to take into account in a controller. In my case, I have two threads to look after: the realtime loop and the one calling callbacks.
As my callback was loading new trajectories in a non concurrent-safe way, it was possible for the realtime loop to read a part of the memory being written by the callback.
I fixed it with a shared pointer, in the same way as the ros controllers do it.