There seems to be an issue with the Custom PointCloud Format. When I select xfer_format = 1 then for a publish_freq of 50Hz I only get around 27-30Hz and for a publish_freq of 10Hz an actual lidar pointcloud rate on the /livox/lidar topic of 6.5Hz.
The imu publish frequency always seems to match the expected frequency of
What does work:
However when I use the ROS1 driver in a different Docker Container on the same system I have no issue with the frame rate and the CPU usage is only around 9% where for the ROS2 driver with CustomPointCloud format and inadequate frequency the CPU usage is around 30%.
When selecting the PointCloud2 format via xfer_format = 0 the published pointcloud frequency matches the expected lidar publish frequency (e.g. 50Hz) and the CPU usage is also ~5% similar to the ROS1 driver.
Possible problem source(s):
When commenting out the FillPointsToCustomMsg function, the rate for the Custom PointCloud reaches the expected 50Hz or 10Hz respectively. The CPU usage in this scenario also goes down to only ~6%.
I have already tried speeding up the FillPointsToCustomMsg function in various ways without any effect on the publish frequency. My understanding is, that with 50packets per published PointCloud and 96 points per packet the loop inside the FillPointsToCustomMsg function does 12Million steps per second. However the same function in the ROS1 Driver works just fine!
Notes:
Frequencies are observed using ros2 topic hz
The used lidar is a Livox Avia.
The observed IMU publish frequency always is 200Hz
To build under ROS2 humble the changes from this PR were necessary: PR.
@Eragon123, I am facing the same issue with my AVIA. I am also facing an issue with the IMU. My IMU rate is only at 60Hz. May I know what changes you did to get the expected IMU rate?
There seems to be an issue with the Custom PointCloud Format. When I select
xfer_format = 1
then for apublish_freq
of 50Hz I only get around 27-30Hz and for apublish_freq
of 10Hz an actual lidar pointcloud rate on the/livox/lidar
topic of 6.5Hz. The imu publish frequency always seems to match the expected frequency ofWhat does work:
xfer_format = 0
the published pointcloud frequency matches the expected lidar publish frequency (e.g. 50Hz) and the CPU usage is also ~5% similar to the ROS1 driver.Possible problem source(s):
FillPointsToCustomMsg
function, the rate for the Custom PointCloud reaches the expected 50Hz or 10Hz respectively. The CPU usage in this scenario also goes down to only ~6%. I have already tried speeding up theFillPointsToCustomMsg
function in various ways without any effect on the publish frequency. My understanding is, that with 50packets per published PointCloud and 96 points per packet the loop inside theFillPointsToCustomMsg
function does 12Million steps per second. However the same function in the ROS1 Driver works just fine!Notes:
ros2 topic hz
200Hz
Thanks for any help!