This package provides a topic priority management library.
This library allows a module to receive multiple command messages with different origins and order them by priority and lifetime. A topic is kept while its lifetime does not expire. Of the still surviving topics the one with the highest priority is returned.
First add to the module manifest as:
Then include the necessary header:
The next step is to declare the class with the appropriate command message type (in this example we are using the atlascar_base::ThrottleCommand message type).
It is recommended to put a fall back safety message in the queue, this message will be used if no other is available.
In normal use, the user will push to the queue any command message received
And will obtain the current command to use with:
If the queue is empty the class will return a null boost::shared_ptr.