bluespace-ai / bluespace_ai_xsens_ros_mti_driver

xsens ros2 driver
BSD 3-Clause "New" or "Revised" License
47 stars 63 forks source link

High Frequency Reading is buffered #25

Closed ahmadSum1 closed 2 months ago

ahmadSum1 commented 2 months ago

The high-frequency topics are being buffered at 100hz. here is an example with an unmodified driver with the provided launch file:

bash dump:

ros2 launch bluespace_ai_xsens_mti_driver xsens_mti_node.launch.py                                                                                                           02:52:30 PM
[INFO] [launch]: All log files can be found below /home/cniuser/.ros/log/2024-08-15-14-54-00-777861-cnidesktop1-290578
[INFO] [launch]: Default logging verbosity is set to INFO
[INFO] [xsens_mti_node-1]: process started with pid [290579]
[xsens_mti_node-1] RCUTILS_CONSOLE_STDOUT_LINE_BUFFERED is now ignored. Please set RCUTILS_LOGGING_USE_STDOUT and RCUTILS_LOGGING_BUFFERED_STREAM to control the stream and the buffering of log messages.
[xsens_mti_node-1] [INFO] [1723726440.850105276] [xsens_mti_node]: Creating XsControl object...
[xsens_mti_node-1] [INFO] [1723726440.856980246] [xsens_mti_node]: Scanning for devices...
[xsens_mti_node-1] [INFO] [1723726441.255392271] [xsens_mti_node]: Found a device with ID: 03887B6D @ port: /dev/ttyUSB0, baudrate: 921600
[xsens_mti_node-1] [INFO] [1723726441.255443157] [xsens_mti_node]: Opening port /dev/ttyUSB0 ...
[xsens_mti_node-1] [INFO] [1723726441.502214918] [xsens_mti_node]: Device: MTi-3-8A7G6, with ID: 03887B6D opened.
[xsens_mti_node-1] [INFO] [1723726441.554242353] [xsens_mti_node]: Measuring ...
ahmadSum1 commented 2 months ago

The same happens when enabling /imu/acceleration_high_rate at 500hz Screenshot from 2024-08-15 13-14-47

ahmadSum1 commented 2 months ago
          > setserial /dev/ttyUSB0 low_latency

this essentially solves the issue upto 500hz without fiddling around with source code. 500hz_setusb_lowlatency_Screenshot from 2024-08-20 12-15-44

But at 1000hz, things are again buffered at around 500hz 1Khz_setserial_lowlatency_Screenshot from 2024-08-20 12-49-04

_Originally posted by @ahmadSum1 in https://github.com/xsenssupport/Xsens_MTi_ROS_Driver_and_Ntrip_Client/issues/3#issuecomment-2298563427_