How is turtlebot3 able to transfer 5 different msgs with 115200 baud rate?

asked 2017-08-05 06:16:38 -0600

pmundt gravatar image

Hey,

I am going through the code of turtlebot3_core on ROBOTIS-GIT/OpenCR git page.

The turtlebot3 is publishing 5 different msgs which are; TransformStamped, SensorState, Imu, Odometry and JointState.

The message sizes are;

  • turtlebot3_msgs::SensorState sensor_state_msg - 28 bytes
  • sensor_msgs::Imu imu_msg - 344 bytes
  • geometry_msgs::Twist cmd_vel_rc100_msg - 72 bytes
  • nav_msgs::Odometry odom - 112 bytes
  • sensor_msgs::JointState joint_states - 88 bytes

The total size of the publishing msgs are around 644bytes (if I am not wrong about the sizes). In turtlebot3_core_config.h, I saw that the publish are 30Hz and for IMU it is 200Hz. The total baud rate needed is way up more than 115200. How does turtlebot3 achive this? What am I missing here?

edit retag flag offensive close merge delete

Comments

Could you do a 'rostopic bw' for the topics?

NEngelhard gravatar image NEngelhard  ( 2017-08-05 08:05:14 -0600 )edit

I do not have a turtlebot3 with me right now, so I am running the same code on a STM32F446re. /tf mean is 0.10KB (1.0KB/s), /joint_states mean is 147.00B (13.0B/s), /odom mean is 700B (45.5 B/s). And serial_node.py is giving a warning "wrong checksum for topic id and msg".

pmundt gravatar image pmundt  ( 2017-08-05 09:01:28 -0600 )edit

In theory, the total publishing msgs sizes are way more up than 115000 baud for turtlebot3? Am I wrong?

pmundt gravatar image pmundt  ( 2017-08-05 09:02:58 -0600 )edit

I see no obvious error on your side. Can you generate a bag file?

NEngelhard gravatar image NEngelhard  ( 2017-08-05 10:37:29 -0600 )edit

AFAIK, if the transfer is via USB serial, the data rate is always fullspeed USB 12MB/S. The advertised baud rate is for information and legacy compatibility only. But I have no citation to support that.

slomobile gravatar image slomobile  ( 2017-08-05 14:38:55 -0600 )edit

I think I just found how turtlebot3 achives that msgs transfer rate. OPENCR msgs are using float32, while ROS msgs are using float64. So as I understood, OPENCR msgs are nearly half the size. For example, OpenCR/vector3 using float32 and ros/vector3 is using float64.

pmundt gravatar image pmundt  ( 2017-08-05 17:07:11 -0600 )edit

For example, OpenCR/vector3 vs Ros/vector3

pmundt gravatar image pmundt  ( 2017-08-05 17:07:57 -0600 )edit

OPENCR msgs are using float32, while ROS msgs are using float64.

sed -i 's/OPENCR/rosserial/g'. wiki/rosserial/Overview/Limitations.

gvdhoorn gravatar image gvdhoorn  ( 2017-08-06 03:47:09 -0600 )edit