Publishing rate of ros topic using new ros interface

Typically: "How do I... ", "How can I... " questions
Post Reply
hypnosfeel
Posts: 22
Joined: 03 Mar 2014, 16:05

Publishing rate of ros topic using new ros interface

Post by hypnosfeel »

Hello,

I wonder if there is any way to control the publishing rate of the ros topic via the new ros interface?

Cheers

coppelia
Site Admin
Posts: 10366
Joined: 14 Dec 2012, 00:25

Re: Publishing rate of ros topic using new ros interface

Post by coppelia »

Hello,

with the new RosInterface you are fully in control of publishing a specific topic. Each time you call simExtRosInterface_publish, a new message will be sent to ROS.

Cheers

akhil27
Posts: 7
Joined: 10 Jul 2017, 12:50

Re: Publishing rate of ros topic using new ros interface

Post by akhil27 »

Hi,

I wanted to know how to increase the publishing rate. I see with 'rostopic hz' that the /image published by rosInterfaceTopicPublisherAndSubscriber.ttt is at a rate around 170 and the /sensorTrigger.... of controlTypeExamples.ttt publishes at around 55.
The reason I ask is because I want to publish the joint states of the baxter model as a sensor_msgs/JointState message and I am only getting a rate of around 16.

Thanks

coppelia
Site Admin
Posts: 10366
Joined: 14 Dec 2012, 00:25

Re: Publishing rate of ros topic using new ros interface

Post by coppelia »

Hello,

you are in full control of how many messages you are publishing with simExtRosInterface_publish (also make sure to increase the queue size when advertising the topic with simExtRosInterface_advertise). But it does not make sense to publish a messages more than once per simulation step, if the message content hasn't changed (which is the case almost all the time).

Cheers

Post Reply