ROS Resources: Documentation | Support | Discussion Forum | Index | Service Status | ros @ Robotics Stack Exchange
Ask Your Question
0

clean message on topic

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

tony gravatar image

Hi,

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

Comments

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
2

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

Question Tools

1 follower

Stats

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

Seen: 833 times

Last updated: Sep 13 '15