本文共 3295 字,大约阅读时间需要 10 分钟。
1. remove libfreenect kinnectsensor driver
seamanj@seamanj-Blade:~/Software/SensorKinect/Platform/Linux/Redist/Sensor-Bin-Linux-x64-v5.1.2.1$ sudo ./install.sh -u[sudo] password for seamanj: Uninstalling PrimeSense Sensor******************************unregistering module 'libXnDeviceSensorV2KM.so' from OpenNI...OKunregistering module 'libXnDeviceFile.so' from OpenNI...OKremoving shared libraries...OKremoving executables...OKremoving config dir...OKremoving usb rules...OKremoving modprobe blacklist...OK*** DONE ***
再次运行NiViewer确定驱动已卸载
seamanj@seamanj-Blade:~/Software/OpenNI/Platform/Linux/Bin/x64-Release$ ./NiViewer Open failed: Bad Parameter sent to the device!Press any key to continue . . .^C
download check image from:
http://wiki.ros.org/camera_calibration/Tutorials/MonocularCalibration?action=AttachFile&do=view&target=check-108.pdf
2
sudo apt-get install ros-kinetic-openni-camerasudo apt-get install ros-kinetic-openni-launch
2.
roslaunch openni_launch openni.launch
to open server
3. open another terminal
rosrun camera_calibration cameracalibrator.py image:=/camera/rgb/image_raw camera:=/camera/rgb --size 8x6 --square 0.108
click calibrate when it is enabled.
after a while
click save and commit.
('D = ', [0.25635013336442597, -0.2984876596963141, 0.0009734146169052192, -0.03244694037216558, 0.0])('K = ', [553.5744369056831, 0.0, 302.6957080579083, 0.0, 550.0423080886541, 265.22392609849635, 0.0, 0.0, 1.0])('R = ', [1.0, 0.0, 0.0, 0.0, 1.0, 0.0, 0.0, 0.0, 1.0])('P = ', [580.197998046875, 0.0, 284.542819663453, 0.0, 0.0, 597.4571533203125, 265.5130111590879, 0.0, 0.0, 0.0, 1.0, 0.0])None# oST version 5.0 parameters[image]width640height480[narrow_stereo]camera matrix553.574437 0.000000 302.6957080.000000 550.042308 265.2239260.000000 0.000000 1.000000distortion0.256350 -0.298488 0.000973 -0.032447 0.000000rectification1.000000 0.000000 0.0000000.000000 1.000000 0.0000000.000000 0.000000 1.000000projection580.197998 0.000000 284.542820 0.0000000.000000 597.457153 265.513011 0.0000000.000000 0.000000 1.000000 0.000000('Wrote calibration data to', '/tmp/calibrationdata.tar.gz')
same process for depth
rosrun camera_calibration cameracalibrator.py image:=/camera/ir/image_raw camera:=/camera/ir --size 8x6 --square 0.108
('D = ', [0.07461283337631101, -0.05140216584982599, -0.01283327736638255, -0.022223551078988033, 0.0])('K = ', [616.9181589642653, 0.0, 282.06293869836986, 0.0, 618.6876986838676, 231.94223956859452, 0.0, 0.0, 1.0])('R = ', [1.0, 0.0, 0.0, 0.0, 1.0, 0.0, 0.0, 0.0, 1.0])('P = ', [629.367919921875, 0.0, 270.8282119673022, 0.0, 0.0, 641.358642578125, 227.3242873304116, 0.0, 0.0, 0.0, 1.0, 0.0])None# oST version 5.0 parameters[image]width640height480[narrow_stereo]camera matrix616.918159 0.000000 282.0629390.000000 618.687699 231.9422400.000000 0.000000 1.000000distortion0.074613 -0.051402 -0.012833 -0.022224 0.000000rectification1.000000 0.000000 0.0000000.000000 1.000000 0.0000000.000000 0.000000 1.000000projection629.367920 0.000000 270.828212 0.0000000.000000 641.358643 227.324287 0.0000000.000000 0.000000 1.000000 0.000000('Wrote calibration data to', '/tmp/calibrationdata.tar.gz')
reference:
http://wiki.ros.org/camera_calibration/Tutorials/MonocularCalibration
http://wiki.ros.org/openni_launch/Tutorials/IntrinsicCalibration