How is turtlebot3 able to transfer 5 different msgs with 115200 baud rate?
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?
Could you do a 'rostopic bw' for the topics?
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".
In theory, the total publishing msgs sizes are way more up than 115000 baud for turtlebot3? Am I wrong?
I see no obvious error on your side. Can you generate a bag file?
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.
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.
For example, OpenCR/vector3 vs Ros/vector3
sed -i 's/OPENCR/rosserial/g'
. wiki/rosserial/Overview/Limitations.