Ask Your Question

how to keep publishing a same message in roslibjs

asked 2020-05-08 01:43:30 -0500

drtritm gravatar image

Hi everyone, I am trying to control a mobile robot using voice recognition through a website. The problem is my robot only move if a callback funtion of subcribe is call, which means subcriber keep receiving twist message. If I use a keyboard it would be easy because I just keep pushing the button. But I am using voice recognition so it takes a website a little time to recognise my voice and I can't keep talking to make my robot move. I tried to look at roslibjs API and I just find a throttle rate, which is "the rate (in ms in between messages) at which to throttle the topics". But it didn't work. I feel it like a latch option in rostopic pub command in terminal, it just publish 1 time and done, not any more. Thanks for reading and sorry for my english

edit retag flag offensive close merge delete

1 Answer

Sort by ยป oldest newest most voted

answered 2020-05-10 11:36:37 -0500

drtritm gravatar image

Well I find out that using function like setTimeout and setInterval in js will solve this problem

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


Asked: 2020-05-08 01:43:30 -0500

Seen: 77 times

Last updated: May 10 '20