Asynchronous nested realtime controller [closed]
Hi,
I would like to have a nested realtime controller where the inner loop runs at the standard 1 kHz and the outer loop at a slower frequency (e.g. 100 Hz). The reason being that updating the outer loop involves solving an optimization problem repeatedly which cannot be done within 1 ms. However, both loops utilize state feedback and thus should have access to the current joint state.
Currently I have the outer loop implemented in a separate package and use messages to communicate with the inner controller (which is implemented in the pr2_controller framework) but the introduced delay is unacceptable. I'm aware that the pr2_controller manager allows chaining via providing pointers to controllers but this does not solve my problem with the different update rates. I guess the two loops should run in separate threads but I'm not sure how to do this in the pr2_controller_manager framework. Maybe somebody already tried something like this and could share his experience?
Thanks, -Robert-