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

Rosserial Publish method [closed]

asked 2021-09-24 05:42:11 -0500

jacklu333333 gravatar image

Hi, I am using rosserial packge for the external sensors. When I dig into the tutorial, I found that there are two types of publishing. 1. publish raw data std_msg (Temperature) 2. publish correct format of rostopic with sensor_msg class (IR Ranger)

The first method will have a higher publish rate naturally since there is no other task perform upon. However, the timestamp will have a little bit of delay since it is generated by the computer side. In my case, it is IMU with 50 hz sampling rate. The second one will have better timestamp accuracy. However, due to the extra process I only get 10 hz in this case.

I wonder what is the standard method to publish embed sensor with rosserial package. The first one or the second one?

edit retag flag offensive reopen merge delete

Closed for the following reason the question is answered, right answer was accepted by jacklu333333
close date 2021-09-30 01:17:48.178497

Comments

1

Are you sure the lower "sampling rate" is due to "the extra process"? sensor_msgs/Imu is a large message (many fields). std_msgs/Int32 (and similar) are tiny compared to it. With a fixed bandwidth link, larger messages may result in lower message frequency.

gvdhoorn gravatar image gvdhoorn  ( 2021-09-24 06:37:41 -0500 )edit

Yeah, you are right, it didn't strike me that is the reason. But in that case, wouldn't the rosserial sensor_msg class kinda useless since the bandwidth is already constraint by the serial communication. In my case, with only imu class, I can only get 10 Hz, which can not be further improve if I want to use imu class.

jacklu333333 gravatar image jacklu333333  ( 2021-09-24 11:45:52 -0500 )edit

Just to clarify: my comment was a question, not a statement. Larger messages requiring more time over the same link seems like it could be an explanation, but I don't know whether that's what's happening here. You may want to investigate it, that's all I meant to say.

gvdhoorn gravatar image gvdhoorn  ( 2021-09-25 00:38:09 -0500 )edit

1 Answer

Sort by ยป oldest newest most voted
1

answered 2021-09-25 07:06:07 -0500

duck-development gravatar image

you may increase the boadrate of your uart to get more data to ros.

edit flag offensive delete link more

Question Tools

1 follower

Stats

Asked: 2021-09-24 05:42:11 -0500

Seen: 105 times

Last updated: Sep 25 '21