Hypha-ROS / hypharos_ardrone_navigation

ARDrone autonomous indoor navigation by integrating lsd-slam with imu through least square method
http://www.ros.org/news/2014/12/ardrone-autonomous-indoor-navigation-by-3d-slam.html
Apache License 2.0
51 stars 16 forks source link

Memory coruption when running lsd_slam_core #1

Closed boonflies closed 6 years ago

boonflies commented 6 years ago

I receive the following error, when i run, $ rosrun lsd_slam_core live_slam image:=/ardrone/front/image_rect camera_info:=/ardrone/front/camera_info

_Received ROS Camera Calibration: fx: 463.275726, fy: 535.977356, cx: 328.456696, cy: 134.693726 @ 640x360 RECEIVED ROS camera calibration! image dimensions must be multiples of 16! Please crop your images / video accordingly. Started mapping thread! Started constraint search thread! Started optimization thread Doing Random initialization! started image display thread! Done Random initialization! Error in `/home/dyana/ros/catkin_ws/devel/lib/lsd_slam_core/live_slam': malloc(): memory corruption: 0x0000000000cb04a0 Aborted (core dumped)_

Then I tried to use a calibration file, instead of camera_info, rosrun lsd_slam_core live_slam image:=/ardrone/front/image_rect _calib:=/home/dyana/.ros/camera_info/ardrone1_default.cfg with calibration file as follows 0.672049 0.899033 0.502065 0.513876 0.271972 640 352 none 640 352

then i received a different error, UndistorterPTAM: input image size differs from expected input size! Not undistorting

How to solve this memory corruption error? and undistortingPTAM error?

haochihlin commented 6 years ago

@kungfrank I think you could answer this ~

kungfrank commented 6 years ago

Hello @boonflies, Memory corruption error in lsd_slam cause by input image resolution isn't multiple-of-16. That why we modified ardrone output image resolution to 640x352(see video.h in ardrone_autonomy, you should replace the same file in your ardrone_autonomy package with it ). But at the same time, don't forget to modify parameter of resolution in camera calibration file too(that is similar to ardrone_front.yaml, which is ardrone's default camera calibration file).

boonflies commented 6 years ago

Thanks. When I used the raw image and made the camera configuration file as, 640 360 Crop 640 320 the error got resolved.

Does it make a difference in slam, to set the image size to 640x320 rather than 640x352 which is the drone's output image resolution?

haochihlin commented 6 years ago

Hi @boonflies It is great to know you have solved the issue! About the resolution, well, based on my experience, there is no performance difference. The only thing you need to take care is to do the camera calibration after modifying the image size!

axelfar commented 6 years ago

Hi @boonflies, I have a quesiton about your camera calibration. Do you have a good result with lsd_slam and your calibration file? For me the resulting pointcloud is really bad. I try to calibrate my drone with 'camera_calibration' it's better but i have a flat pointcloud.

boonflies commented 6 years ago

I did not properly calibrate the camera, but I just got some calibration file from net. I am using this calibration file, 0.50355332 0.894045767 0.494061013 0.509863 -0.466013 0.176685 0.032364 -0.010129 0.000000 640 360 crop 400 288

I have not visualized the point cloud in RViz yet. I can only see it in lsd_slam's point cloud viewer.

Is it right, that we get point cloud when we press 'l' followed by 'p' on the lsd_slam's pointcloud viewer and a tmp.ply file is generated. How is the point cloud topic published and visualized in RViz?