ROS Resources: Documentation | Support | Discussion Forum | Index | Service Status | Q&A
Ask Your Question

clean message on topic

asked 2015-09-13 20:04:18 -0500

tony gravatar image


I have a publisher to publish message to one topic at different time. Each time before I publish the new message, how can I clean the messages on the topic published at other time? Thanks.

edit retag flag offensive close merge delete


Why would you need that? After a subscriber receives a message, this message then vanishes. Probably what you actually need in your situation is to use services as they allow to publish messages only on requests.

VitaliyProoks gravatar image VitaliyProoks  ( 2015-09-14 00:27:42 -0500 )edit

@VitaliyProoks Because I noticed that the robot didnot stop after publishing (0,0) to topic cmd_vel. I suspect that there is velocity command on topic cmd_vel published at other time.

tony gravatar image tony  ( 2015-09-14 05:30:17 -0500 )edit

1 Answer

Sort by ยป oldest newest most voted

answered 2015-09-14 07:02:14 -0500

VitaliyProoks gravatar image

Then it looks like it is issue in your robot's code, messaging in ROS works fine :) ROS provides tools for listening to/publishing from topics either from console or by means of rqt_gui try to debug by sending test messages and see what happens.

edit flag offensive delete link more

Your Answer

Please start posting anonymously - your entry will be published after you log in or create a new account.

Add Answer

Question Tools

1 follower


Asked: 2015-09-13 20:04:18 -0500

Seen: 804 times

Last updated: Sep 13 '15