RMonica / ros_kinfu

30 stars 18 forks source link

No cloud output #13

Closed NikolasE closed 5 years ago

NikolasE commented 5 years ago

I tried to capture a scene and use the kinfu_request_topic to extract a pointcloud. If I send a REQUEST_TYPE_GET_CLOUD, this happens:

[/kinfuLS INFO 1549454729.387893067]: kinfu: Locked. Extracting current volume...The old cube's metric origin was (0.000000, 0.000000, 0.000000). The new cube's metric origin is now (0.043290, -0.124904, -0.044980). SIZE IS 266257 world contains 0 points after update world contains 0 points after cleaning Done [/kinfuLS INFO 1549454729.655228358]: kinfu: Marching cubes... Getting world as cubes. World contains 266257 points. World contains 266257 points after nan removal. cube size is set to 512.000000. Bounding box for the world: [105.000000 - 395.000000] [155.000000 - 327.000000] [3.000000 - 385.000000] Estimated cube voxelgrid: 1x1x1 Creating cube at: [105.000000, 155.000000, 3.000000]. compressing cubes. returning 1 cubes. Processing world with volume size set to 3meters There are 1 cubes to be processed Processing cube number 0 VOLUME SIZE IS 3 Done! [/kinfuLS INFO 1549454731.022439855]: kinfu: Extracting only points from mesh... [/kinfuLS INFO 1549454731.022474385]: kinfu: Merging points... [/kinfuLS INFO 1549454731.022484375]: kinfu: Applying transformation... [/kinfuLS INFO 1549454731.022507038]: kinfu: Publishing...

Received response with 0 cloud points 0 mesh cloud points 0 triangles 0 pixels 0 uint64 values 0 float32 values

nvidia-smi: (GeForce GTX 1070) | NVIDIA-SMI 410.79 Driver Version: 410.79 CUDA Version: 10.0

Compilation worked out of the box and there were no warnings or error during execution, the result is just empty.

RMonica commented 5 years ago

How are you sending the request?

Are you able to get the mesh using the example in kinfu_examples? rosrun kinfu_examples save_mesh

NikolasE commented 5 years ago

Hey! Thanks for the fast response!

I send a trigger on the topic-interface:

rospy.init_node("kinfu_request_publisher") pub = rospy.Publisher("/kinfu_request_topic", KinfuTsdfRequest, queue_size=1) msg = KinfuTsdfRequest() msg.tsdf_header.request_type = msg.tsdf_header.REQUEST_TYPE_GET_CLOUD msg.tsdf_header.request_id = 123 msg.tsdf_header.request_source_name = '/cloud' pub.publish(msg)

I now also tried the save_mesg node and got this:

[/kinfuLS INFO 1549531311.739131048]: kinfu: Marching cubes... Getting world as cubes. World contains 186034 points. World contains 186034 points after nan removal. cube size is set to 512.000000. Bounding box for the world: [104.000000 - 387.000000] [176.000000 - 330.000000] [9.000000 - 338.000000] Estimated cube voxelgrid: 1x1x1 Creating cube at: [104.000000, 176.000000, 9.000000]. compressing cubes. returning 1 cubes. Processing world with volume size set to 3meters There are 1 cubes to be processed Processing cube number 0 VOLUME SIZE IS 3 Done! [/kinfuLS INFO 1549531312.997700369]: kinfu: Divide triangles and points... [/kinfuLS INFO 1549531312.997736276]: kinfu: Merging points... [/kinfuLS INFO 1549531312.997747817]: kinfu: Applying transformation... [/kinfuLS INFO 1549531312.997756952]: kinfu: Removing duplicate points...

Thread 16 "kinfu" received signal SIGSEGV, Segmentation fault. [Switching to Thread 0x7fffc27fc700 (LWP 14848)] 0x0000000000842f3e in void WorldDownloadManager::removeDuplicatePoints(pcl::PointCloud::ConstPtr, boost::shared_ptr<std::vector<WorldDownloadManager::Triangle, std::allocator > const>, pcl::PointCloud::Ptr, boost::shared_ptr<std::vector<WorldDownloadManager::Triangle, std::allocator > >) ()

If I remove the request_remove_duplicates-flag, the crash does not happen, but I still only get an empty response:

[/save_mesh INFO 1549531489.649935784]: Saving mesh to 'mesh.ply'... [pcl::io::savePLYFile] Input point cloud has no data! [/save_mesh ERROR 1549531489.649966521]: Mesh could not be saved.

RMonica commented 5 years ago

Well, a fast response is not a fast solution.

I should have fixed the crash in removeDuplicatePoints when the 3D reconstruction is empty (https://github.com/RMonica/ros_kinfu/commit/882d6770b61fe1922dd66b30a3af1146851493a7) but it doesn't explain why it is empty in the first place.

From the logs, it looks like there is data in the TSDF volume and in the world cloud, but the marching cubes returns empty output. I can't reproduce this bug (tested on a GTX 1070, CUDA 10, Ubuntu 16.04, ROS kinetic), therefore I have no clue.

Do you see the synthetic image in /kinfu_current_view? Are you compiling in release mode, as suggested in the known issues?

NikolasE commented 5 years ago

I'm really sorry, I missed the relase-mode flag. I now can extract the cloud and mesh without problem. Thank you for your help!