Rosserial Publish method [closed]
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?
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.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.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.