ROBOTIS-JAPAN-GIT / turtlebot3_slam_3d

Turtlebot3 3D-SLAM demo using RTAB-Map with Jetson TX2 and ZED Mini
170 stars 62 forks source link

ValueError: Input contains NaN, infinity or a value too large for dtype('float64'). #15

Closed aaravrav142 closed 2 years ago

aaravrav142 commented 2 years ago

Hi I am running the script on my own dataset collected on a mobile robot with kinect sensor. The yolo is working fine and the rtabmap is also running ok. However I am getting nan values during the detection and this kills the node and I cant get to collect all the positions. I am not sure what this error is coming from. Can you help me with this. Thanks.

detection_collector.py 

Searching for objects...
Found a chair at [5.076215744018555, 0.1553346812725067, 1.0857899188995361]
Found a chair at [5.0635666847229, 0.27497056126594543, 1.1331884860992432]
Found a chair at [4.256170272827148, 0.3564226031303406, 0.823308527469635]
Found a chair at [nan, nan, nan]
Found a chair at [4.907439708709717, 0.2746533155441284, 0.9894275665283203]
Found a chair at [4.988054275512695, 0.2638717293739319, 1.059159755706787]
Found a chair at [4.907907009124756, 0.3024069666862488, 0.980076789855957]
Found a chair at [nan, nan, nan]
Found a chair at [4.8220624923706055, 0.2997586727142334, 0.9472278356552124]
Found a chair at [4.847901821136475, 0.22644220292568207, 0.9880084991455078]
Found a chair at [4.278569221496582, 0.40826913714408875, 0.7901732325553894]
Found a chair at [4.832341194152832, 0.28574058413505554, 0.9498862028121948]
Found a chair at [5.10916445246115e+18, -3.1987569355256644e+23, 1.5332093507875635e+17]
Found a chair at [4.783604145050049, 0.2373742163181305, 0.904579758644104]
Found a chair at [4.783695220947266, 0.28647559881210327, 0.9150972962379456]
Found a chair at [nan, nan, nan]
Found a chair at [nan, nan, nan]
^CWriting to detections_raw.db...
Writing to detections_dbscan.db...
Exception ValueError: ValueError("Input contains NaN, infinity or a value too large for dtype('float64').",) in <bound method DetectionCollector.__del__ of <__main__.DetectionCollector object at 0x7f71c2a0c190>> ignored
Affonso-Gui commented 2 years ago

I am guessing that there were some troubles with the depth image such that the recognition node was unable to get the 3d position of the yolo detection, but this is worth digging a bit deeper... Try replaying the bag file in the rviz and see if you can spot times where the yolo finds the chair but the bounding box do not follow.

For now a quick fix would be to simply skip entries which include some NaN value. Since in your case you seem to have plenty of data this shouldn't hurt the clustering algorithm much.

aaravrav142 commented 2 years ago

Thanks! I am testing with different datasets now and will report if I found a solution.

aaravrav142 commented 2 years ago

Everything working well now. Thanks. I m closing this.