re-publishing data from multiple topics
I've written a node which takes data from node A via a topic, which uses custom messages, does some manipulation with it, then publishes it to another topic. However the node also listens to a topic from node B, which is not always active. I'm not sure how I go about getting the node to use data from node B when it is active, but using node A otherwise?
I've tried a few different ways and come across different issues. Firstly I was thinking of somehow being able to switch to listen to the higher priority topic B, when the node is initiated.
I also tried to play with some if statements in the callback, but realised the callback can only deal with 1 set of custom messages at once.
Note: this is using python