Closed matlabbe closed 6 months ago
The issue is related to default OpenMP waiting policy, with libpointmatcher built with OpenMP support. If we do:
OMP_WAIT_POLICY=passive ros2 run rtabmap_odom icp_odometry
Everything is fine:
[1717349566.822038882]: Odom: ratio=0.686275, std dev=0.000100m|0.000173rad, update time=0.003475s
[1717349566.841366103]: Odom: ratio=0.686275, std dev=0.000100m|0.000173rad, update time=0.003860s
[1717349566.855502721]: Odom: ratio=0.686275, std dev=0.000100m|0.000173rad, update time=0.003687s
[1717349566.878782602]: Odom: ratio=0.686275, std dev=0.000100m|0.000173rad, update time=0.003916s
[1717349566.889291191]: Odom: ratio=0.686275, std dev=0.000100m|0.000173rad, update time=0.003879s
[1717349566.909944525]: Odom: ratio=0.686275, std dev=0.000100m|0.000173rad, update time=0.004162s
[1717349566.919669341]: Odom: ratio=0.686275, std dev=0.000100m|0.000173rad, update time=0.004131s
[1717349566.944726090]: Odom: ratio=0.686275, std dev=0.000100m|0.000173rad, update time=0.004026s
Cpu before launching icp_odometry:
Cpu usage after launching icp_odometry (there is no significant difference):
I also saw that when using introlab3it/rtabmap_ros:humble
or introlab3it/rtabmap_ros:humble-latest
docker containers. We should add "-e OMP_WAIT_POLICY=passive
" when launching the container.
On some computers (tested on fresh Ubuntu 22.04/Humble), just launching:
results in 100% CPU usage:
This is for a small scan topic (~300 points):
It seems happening if rtabmap is built with libpointmatcher. As if we launch with PCL's ICP instead: