RMonica / ros_kinfu

30 stars 18 forks source link

Kinfu crashing when trying with kinect2 #5

Open srinimd2005 opened 7 years ago

srinimd2005 commented 7 years ago

Hi Monica,

I am stuck up with this error message.

SUMMARY

PARAMETERS

NODES / kinect_kinfu1 (kinfu/kinfu)

core service [/rosout] found process[kinect_kinfu1-1]: started with pid [13425] [pcl::gpu::printShortCudaDeviceInfo] : Device 0: "Quadro K2100M" 978Mb, sm_30, 576 cores, Driver/Runtime ver.8.0/8.0 [ INFO] [1488390744.644554839]: Running KinFu without texture extraction [ INFO] [1488390744.813068519]: kinfu_output: main thread started. [ INFO] [1488390744.818232142]: --- CURRENT SETTINGS ---

[ INFO] [1488390744.818277247]: Volume size is set to 1.00 meters

[ INFO] [1488390744.818301202]: Volume will shift when the camera target point is farther than 1.50 meters from the volume center

[ INFO] [1488390744.818316003]: The target point is located at [0, 0, 0.60] in camera coordinates

in reset function! Error: invalid argument /home/pcl/gpu/kinfu_large_scale/src/cuda/bilateral_pyrdown.cu:172 [kinect_kinfu1-1] process has finished cleanly log file: /home/.ros/log/f7212d82-fea5-11e6-afd2-fc3fdbb37715/kinect_kinfu1-1*.log all processes on machine have died, roslaunch will exit shutting down processing monitor... ... shutting down processing monitor complete done

I am using Kinect v2 and while launching kinfu2.launch the process always terminates here or stays in "in reset function!". could you please provide some help. I cannot see anything in Rviz when i subscribe to /kinfu_current_view

RMonica commented 7 years ago

Hi srinimd2005.

The crash was detected in bilateral_pyrdown.cu:172 https://github.com/RMonica/ros_kinfu/blob/master/kinfu/pcl_kinfu_large_scale/kinfu_large_scale/src/cuda/bilateral_pyrdown.cu#L172 Usually, this would point to an error in the kernel above: truncateDepthKernel. However, the kernel contains just a few lines of code, so it is unlikely that a bug is there. Try adding

  cudaSafeCall (cudaGetLastError());
  cudaSafeCall (cudaDeviceSynchronize());

before and after the kernel call, in order to check if the error was already there before the call.

Aside, you changed the TSDF volume size to 1.0m, but you left the shifting distance to 1.50m. Usually, you would want the shifting distance to be smaller than the TSDF volume size. This may not be related to your issue, though. However, what other parts of the code did you change?

srinimd2005 commented 7 years ago

Hi RMonica,

Thank you for your help. I have changed the parts of the code where VOLUME_X, VOLUME_Y, VOLUME_Z = 512, I have set them to 128. Because I thought that CUDA couldn't handle this size. Also I have added an extra gpuArchCoresPerSM[ ] (0x32, 192) in intialization.cpp.

srinimd2005 commented 7 years ago

Hi RMonica,

After these modification I am currently getting error like this when I am trying to extract the mesh by passing the command

rostopic pub /kinfu_request_topic kinfu_msgs/KinfuTsdfRequest "tsdf_header: {request_type: 2, request_id: 1, request_source_name: '/response'}"

while

rostopic pub /kinfu_request_topic kinfu_msgs/KinfuTsdfRequest "tsdf_header: {request_type: 1, request_id: 1, request_source_name: '/response'}"

TSDF volume is extracted without any errors.

SUMMARY

PARAMETERS

NODES / kinect_kinfu1 (kinfu/kinfu)

ROS_MASTER_URI=http://localhost:11311

core service [/rosout] found process[kinect_kinfu1-1]: started with pid [9191] [pcl::gpu::printShortCudaDeviceInfo] : Device 0: "Quadro K2100M" 978Mb, sm_30, 576 cores, Driver/Runtime ver.8.0/8.0 [ INFO] [1488809405.162743321]: Running KinFu without texture extraction [ INFO] [1488809405.326589401]: kinfu_output: main thread started. [ INFO] [1488809405.331978829]: --- CURRENT SETTINGS ---

[ INFO] [1488809405.332009567]: Volume size is set to 1.50 meters

[ INFO] [1488809405.332034346]: Volume will shift when the camera target point is farther than 0.75 meters from the volume center

[ INFO] [1488809405.332060581]: The target point is located at [0, 0, 0.90] in camera coordinates

in reset function! [ INFO] [1488809408.274965365]: Avg frame time = 76.12 ms (13.14 fps) [ INFO] [1488809410.967208451]: Avg frame time = 80.94 ms (12.35 fps) [ INFO] [1488809413.944492267]: Avg frame time = 89.55 ms (11.17 fps) [ INFO] [1488809416.549883683]: Avg frame time = 78.30 ms (12.77 fps) [ INFO] [1488809419.164817411]: Avg frame time = 78.58 ms (12.73 fps) [ INFO] [1488809421.756196304]: Avg frame time = 77.91 ms (12.84 fps) [ INFO] [1488809424.299491754]: Avg frame time = 76.36 ms (13.10 fps) [ INFO] [1488809426.840929630]: Avg frame time = 76.39 ms (13.09 fps) The old cube's metric origin was (0.000000, 0.000000, 0.000000). The new cube's metric origin is now (0.678054, 0.046931, -0.319424). SIZE IS 20456 world contains 0 points after update world contains 0 points after cleaning SHIFTING [ INFO] [1488809429.446953066]: Avg frame time = 78.15 ms (12.80 fps) [ INFO] [1488809432.144549007]: Avg frame time = 81.15 ms (12.32 fps) [ INFO] [1488809434.819036029]: Avg frame time = 80.33 ms (12.45 fps) [ INFO] [1488809437.494371575]: Avg frame time = 80.45 ms (12.43 fps) [ INFO] [1488809440.156073022]: Avg frame time = 79.97 ms (12.50 fps) [ INFO] [1488809442.851940149]: Avg frame time = 81.09 ms (12.33 fps) [ INFO] [1488809445.485126213]: Avg frame time = 79.12 ms (12.64 fps) [ INFO] [1488809448.037186205]: Avg frame time = 76.70 ms (13.04 fps) The old cube's metric origin was (0.678054, 0.046931, -0.319424). The new cube's metric origin is now (-0.022460, -0.001908, 0.003531). SIZE IS 25491 world contains 20456 points after update world contains 20456 points after cleaning SHIFTING [ INFO] [1488809450.661094062]: Avg frame time = 78.85 ms (12.68 fps) [ INFO] [1488809453.220574709]: Avg frame time = 76.91 ms (13.00 fps) The old cube's metric origin was (-0.022460, -0.001908, 0.003531). The new cube's metric origin is now (0.669701, 0.032031, -0.308231). SIZE IS 22933 world contains 45947 points after update world contains 26576 points after cleaning SHIFTING [ INFO] [1488809455.941115061]: Avg frame time = 81.82 ms (12.22 fps) [ INFO] [1488809458.565547754]: Avg frame time = 78.85 ms (12.68 fps) [ INFO] [1488809461.189302876]: Avg frame time = 78.82 ms (12.69 fps) [ INFO] [1488809463.841492319]: Avg frame time = 79.76 ms (12.54 fps) [ INFO] [1488809465.261487296]: kinfu: Extract Mesh Worker started. [ INFO] [1488809465.261524679]: kinfu: Locking kinfu... [ INFO] [1488809465.383517123]: kinfu: Locked. Extracting current volume...The old cube's metric origin was (0.669701, 0.032031, -0.308231). The new cube's metric origin is now (0.448939, 0.025191, -0.127823). SIZE IS 96055 world contains 49509 points after update world contains 42921 points after cleaning Done [ INFO] [1488809465.473506885]: kinfu: Marching cubes... Getting world as cubes. World contains 138976 points. World contains 138976 points after nan removal. cube size is set to 128 Bounding box for the world: [-2.000000 - 184.000000] [2.000000 - 131.000000] [-19.000000 - 127.000000] Extracting cube at: [-2.000000, 2.000000, -19.000000]. Extracting cube at: [-2.000000, 2.000000, 105.800003]. Extracting cube at: [-2.000000, 126.800003, -19.000000]. Extracted cube was empty, skiping this one. Extracting cube at: [-2.000000, 126.800003, 105.800003]. Extracted cube was empty, skiping this one. Extracting cube at: [122.800003, 2.000000, -19.000000]. Extracting cube at: [122.800003, 2.000000, 105.800003]. Extracting cube at: [122.800003, 126.800003, -19.000000]. Extracting cube at: [122.800003, 126.800003, 105.800003]. Extracted cube was empty, skiping this one. returning 5 cubes Processing world with volume size set to 3meters There are 5 cubes to be processed Processing cube number 0 VOLUME SIZE IS 3 Error: out of memory /home/msr7rng/kinfu_ws/src/ros_kinfu/kinfu/pcl_kinfu_large_scale/containers/src/device_memory.cpp:151 Error: driver shutting down /home/msr7rng/kinfu_ws/src/ros_kinfu/kinfu/pcl_kinfu_large_scale/kinfu_large_scale/src/cuda/estimate_combined.cu:324 kinfu: /usr/include/boost/thread/pthread/recursive_mutex.hpp:101: boost::recursive_mutex::~recursive_mutex(): Assertion `!pthread_mutex_destroy(&m)' failed. [kinect_kinfu1-1] process has died [pid 9191, exit code -6, cmd /home/msr7rng/kinfu_ws/devel/lib/kinfu/kinfu __name:=kinect_kinfu1 __log:=/home/msr7rng/.ros/log/194d4eae-0261-11e7-a683-fc3fdbb37715/kinect_kinfu1-1.log]. log file: /home/msr7rng/.ros/log/194d4eae-0261-11e7-a683-fc3fdbb37715/kinect_kinfu1-1*.log all processes on machine have died, roslaunch will exit shutting down processing monitor... ... shutting down processing monitor complete

RMonica commented 7 years ago

Hi srinimd2005.

With your current configuration, kinfu should use less than 100 MB of GPU RAM. Run the command

  nvidia-smi

while running kinfu, while not running kinfu, and during marching cubes execution. During marching cubes, GPU RAM usage by kinfu should almost double. See if kinfu is using more GPU RAM than expected or maybe something else in your system is using it.

srinimd2005 commented 7 years ago

Hi Monica Thank you for the reply. It really helped me. my X-org was consuming 600MB of my gpu because of dual screen. Now it is perfect.

By the way how can I save the mesh after recording. Will this command saves the mesh as well

rostopic pub /kinfu_request_topic kinfu_msgs/KinfuTsdfRequest "tsdf_header: {request_type: 2, request_id: 1, request_source_name: '/response'}"

RMonica commented 7 years ago

Hi srinimd2005.

No, that will not save the mesh. It just publishes a pcl_msgs/PolygonMesh to the topic /response. You need a ROS node to receive it.

srinimd2005 commented 7 years ago

Hi Monica,

Thank you so much for the reply and help. I have recently found that when ever I call cloud or mesh publish, it always gives me no points. The console log is shown below

SUMMARY

PARAMETERS

NODES / kinect_kinfu1 (kinfu/kinfu)

ROS_MASTER_URI=http://localhost:11311

core service [/rosout] found process[kinect_kinfu1-1]: started with pid [5319] [pcl::gpu::printShortCudaDeviceInfo] : Device 0: "Quadro K2100M" 978Mb, sm_30, 576 cores, Driver/Runtime ver.8.0/8.0 [ INFO] [1489395380.050044505]: Running KinFu without texture extraction [ INFO] [1489395380.208269534]: kinfu_output: main thread started. [ INFO] [1489395380.213643520]: --- CURRENT SETTINGS ---

[ INFO] [1489395380.213676536]: Volume size is set to 1.50 meters

[ INFO] [1489395380.213706156]: Volume will shift when the camera target point is farther than 0.75 meters from the volume center

[ INFO] [1489395380.213729766]: The target point is located at [0, 0, 0.90] in camera coordinates

in reset function! [ INFO] [1489395384.852178078]: kinfu: Extract Tsdf Worker started. [ INFO] [1489395384.852243520]: kinfu: Locking kinfu... 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.000404, -0.000160, -0.001200). SIZE IS 167404 world contains 0 points after update world contains 0 points after cleaning Done [ INFO] [1489395385.195652579]: kinfu: Sending message...

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

[ INFO] [1489395385.199692220]: kinfu: Extract Tsdf Worker complete. [ INFO] [1489395386.457654411]: Avg frame time = 158.33 ms (6.32 fps) [ INFO] [1489395391.727330849]: Avg frame time = 159.00 ms (6.29 fps) [ INFO] [1489395396.933548249]: Avg frame time = 156.94 ms (6.37 fps) [ INFO] [1489395402.122999037]: Avg frame time = 156.45 ms (6.39 fps) [ INFO] [1489395407.349310177]: Avg frame time = 157.61 ms (6.34 fps) [ INFO] [1489395412.599434084]: Avg frame time = 158.27 ms (6.32 fps) [ INFO] [1489395417.809559638]: Avg frame time = 157.03 ms (6.37 fps) [ INFO] [1489395423.005126059]: Avg frame time = 156.73 ms (6.38 fps) [ INFO] [1489395428.215156277]: Avg frame time = 157.15 ms (6.36 fps) [ INFO] [1489395433.393517355]: Avg frame time = 156.15 ms (6.40 fps) [ INFO] [1489395438.576816401]: Avg frame time = 156.36 ms (6.40 fps) [ INFO] [1489395443.756016068]: Avg frame time = 156.15 ms (6.40 fps) [ INFO] [1489395448.943497945]: Avg frame time = 156.39 ms (6.39 fps) [ INFO] [1489395454.124979673]: Avg frame time = 156.24 ms (6.40 fps) [ INFO] [1489395459.359020861]: Avg frame time = 157.76 ms (6.34 fps) [ INFO] [1489395464.548445335]: Avg frame time = 156.45 ms (6.39 fps) [ INFO] [1489395469.737588879]: Avg frame time = 156.52 ms (6.39 fps) [ INFO] [1489395474.927922430]: Avg frame time = 156.45 ms (6.39 fps) [ INFO] [1489395480.168599082]: Avg frame time = 158.03 ms (6.33 fps) [ INFO] [1489395485.406406269]: Avg frame time = 157.91 ms (6.33 fps) [ INFO] [1489395490.690901432]: Avg frame time = 159.36 ms (6.27 fps) [ INFO] [1489395492.683827865]: kinfu: Extract Cloud Worker started. [ INFO] [1489395492.683862408]: kinfu: Locking kinfu... [ INFO] [1489395492.913767712]: kinfu: Locked. Extracting current volume...The old cube's metric origin was (0.000404, -0.000160, -0.001200). The new cube's metric origin is now (-0.016768, -0.018867, 0.014392). SIZE IS 298313 world contains 167404 points after update world contains 166334 points after cleaning Done [ INFO] [1489395493.162145075]: kinfu: Marching cubes... Getting world as cubes. World contains 464647 points. World contains 464647 points after nan removal. cube size is set to 256 Bounding box for the world: [0.000000 - 255.000000] [49.000000 - 209.000000] [27.000000 - 255.000000] Extracting cube at: [0.000000, 49.000000, 27.000000]. Extracting cube at: [249.600006, 49.000000, 27.000000]. returning 2 cubes Processing world with volume size set to 3meters There are 2 cubes to be processed Processing cube number 0 VOLUME SIZE IS 3 Saving mesh...1 [pcl::io::savePLYFile] Input point cloud has no data! Processing cube number 1 VOLUME SIZE IS 3 Saving mesh...2 [pcl::io::savePLYFile] Input point cloud has no data! Done! [ INFO] [1489395494.563829439]: kinfu: Extracting only points from mesh... [ INFO] [1489395494.563894433]: kinfu: Merging points... [ INFO] [1489395494.563911084]: kinfu: Applying transformation... [ INFO] [1489395494.563936112]: kinfu: Publishing...

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

[ INFO] [1489395494.564795841]: kinfu: Extract Cloud Worker complete. [ INFO] [1489395496.297900952]: Avg frame time = 161.52 ms (6.19 fps) ^C[kinect_kinfu1-1] killing on exit shutting down processing monitor... ... shutting down processing monitor complete done

Need your help.

RMonica commented 7 years ago

Hi srinimd2005.

Please see issue https://github.com/RMonica/ros_kinfu/issues/6

srinimd2005 commented 7 years ago

Thank you Monica !!! It really worked for me after cmake with release.

Can you share some information regarding the Bounding box. Is it in meters ? How do we pass Bounding Box information (in terms of size and units). It would be great to know more.