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

How to create a simple publisher to publish current time ?

asked 2014-05-22 19:06:49 -0500

keshav_sarraf gravatar image

Hello guys! I am a ros and cpp beginner and I have read the simple ros publisher tutorial given in the wiki. I want to create a simple publisher that can publish time every second. how can I modify the code given in the tutorial to do the same.

edit retag flag offensive close merge delete

1 Answer

Sort by ยป oldest newest most voted

answered 2014-05-24 19:39:25 -0500

Hamid Didari gravatar image

you can use Timers in ros to count seconds in one variable , and in your callback event for Timer you can publish Time over ros .

for this you can use std_msg::int64

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: 2014-05-22 19:06:49 -0500

Seen: 435 times

Last updated: May 24 '14