I wrote my problem with details below. But it may be a bit complicated. That is why, firstly, I am going to indicate it clearly. This is my question as I wrote on the title:
I want to publish some data to a certain topic. And I do not want this topic to accept any other data from other nodes which tries to publish to it. Or I want this topic to erase all the data coming from nodes except the node that I permit to publish to that node. How can I write this commend into my heartbeat node. How should the strategy be? (I am using Python). Any help would be appreciated
And my problem with details is this:
I am trying to write a heartbeat node for my robot. My robot has its own computer on it. I am going to publish heartbeat data from main computer to topic "A" which my heartbeat node subscribes to and which runs on the robot. Similarly I am going to control this robot from main computer by publishing to topic "B" and "C" that my engine node and brake motor node subscribes to. All these nodes (heartbeat, brake motor, engine) are going to run on the robot.
If heartbeat node realise that there is no data published to topic "A" (that is; connection between main computer and robot has failed), it is going to publish data to topic "B" and "C" in order to stop the engine and brake.
There is no problem about things above.
The problem is this:
When heartbeat node realises that connection is lost, I want it to clear all data flowing on the topic "B" and "C" to engine and brake motor nodes and than publish "stop" and "brake" data to them. I am trying to do this in case there is data on topic "B" and when my heartbeat tries to stop engine there should not be any data which tries to work the engine.
Originally posted by ebakor on ROS Answers with karma: 3 on 2014-08-27
Post score: 0