code-iai / iai_kinect2

Tools for using the Kinect One (Kinect v2) in ROS
Apache License 2.0
879 stars 520 forks source link

Failed to use kinect2_bridge. #383

Open jim1949 opened 7 years ago

jim1949 commented 7 years ago

Hi, I have a problem to use kinect2 in my ROS and look for lots of ways to configure that but still cannot. Firstly, I follow the instructions from:

https://github.com/OpenKinect/libfreenect2

This link is the kinect driver in linux. It seems that everything works fine except

*sudo dpkg -i debs/{libva,i965}deb; sudo apt-get install -f**

it tells me that it doesn't contain libva and i965 directory, and fails.

I used another way to install them:

sudo apt-get install libva-dev libjpeg-dev

I skipped this step, and followed the instruction to the end:

./Protonect

And this gives me four images which includes depth image and RGB image. However, I noticed that, when I executed this command, the output in the screen shows:

jimmy@eaibot:~/libfreenect2/bin$ ./Protonect Version: 0.2.0

Environment variables: LOGFILE=

Usage: ./Protonect [-gpu=] [gl | cl | clkde | cuda | cudakde | cpu] []

    [-noviewer] [-norgb | -no

depth] [-help] [-version]

    [-frames <number of frames to process>]

To pause and unpause: pkill -USR1 Protonect

[Info] [Freenect2Impl] enumerating devices...

[Info] [Freenect2Impl] 13 usb devices connected

[Info] [Freenect2Impl] found valid Kinect v2 @4:9 with serial 002305464947

[Info] [Freenec

t2Impl] found 1 devices

libva info: VA-API version 0.35.0

libva info: va_getDriverName() returns 1

libva error: va_getDriverName() failed with operation failed,driver_name=i965

[Error] [VaapiRgbPacketProcessorImpl] vaInitialize(display, &major_ver, &minor_ver): operation failed

[Info] [Freenec

t2DeviceImpl] opening...

[Info] [Freenect2DeviceImpl] transfer pool sizes rgb: 2016384 ir: 608*33792

[Info] [Freenect2DeviceImpl] opened

[Info] [Freenect2DeviceImpl] starting...

[Debug] [Freenect2DeviceImpl] status 0x090000: 9729

[Debug] [Freenect2DeviceImpl] status 0x090000: 9731

[Info] [Freenect2DeviceImpl] submitting rgb transfers...

[Info] [Freenect2DeviceImpl] submitting depth transfers...

[Info] [Freenect2DeviceImpl] started

device serial: 002305464947

device fi

rmware: 4.0.3911.0

[Debug] [DepthPacketStreamParser] not all subsequences received 0

[Debug] [DepthPacketStreamParser] not all subsequences received 1008

[Debug] [DepthPacketStreamParser] skipping depth packet

[Debug] [DepthPacketStreamParser] skipping depth packet

[Info] [DepthPa

cketStreamParser] 2 packets were lost

[Debug] [DepthPacketStreamParser] skipping depth packet

[Info] [DepthPacketStreamParser] 1 packets were lost

[Debug] [DepthPacketStreamParser] skipping depth packet

[Debug] [DepthPacketStreamParser] skipping depth packet

[Debug] [DepthPacketStreamParser] skipping depth packet

[Debug] [DepthPacketStreamParser] skipping depth packet

^C[Info] [Freenect2DeviceImpl] stopping...

[Info] [Freenect2DeviceImpl] canceling rgb transfers...

[Info] [Freenect2DeviceImpl] canceling depth transfers...

[Info] [Freenect2DeviceImpl] stopped

[Info] [Freenect2DeviceImpl] closing...

[Info] [Freene

ct2DeviceImpl] releasing usb interfaces...

[Info] [Freenect2DeviceImpl] deallocating usb transfer pools...

[Info] [Freenect2DeviceImpl] closing usb device...

[Info] [Freenect2DeviceImpl] closed

[Info] [Freenect2DeviceImpl] closing...

[Info] [Freenect2DeviceImpl] already closed, doing nothing

From here, it shows there's some problem with the libva, however, I don't understand what the reminders mean. I used to be happy with the image and continue to work on the ROS. and the ROS results turn to be fairly disappointing!

I found a kinect ROS driver which is called iai-kinect2:

https://github.com/code-iai/iai_kinect2

And it fails when I run

roslaunch kinect2_bridge kinect2_bridge.launch

This is the main problem.(I want to show you the overall message from the screen, but sorry, I don't know how.) And it shows me no message and always shows some problems:

[Info] [OpenCLDepthPacketProcessorImpl] building OpenCL program...

[Error] [OpenCLDepthPacketProcessorImpl] program = cl::Program(context, source, &err): -34

[ WARN] [1489113544.030635869]: [Kinect2Bridge::initCalibration] using sensor defaults for color intrinsic parameters.

[ WARN] [1489113544.030691456]: [Kinect2Bridge::initCalibration] using sensor defaults for ir intrinsic parameters.

[ WARN] [1489113544.030714924]: [Kinect2Bridge::initCalibration] using defaults for rotation and translation.

[ WARN] [1489113544.030751568]: [Kinect2Bridge::initCalibration] using defaults for depth shift.

[ INFO] [1489113544.122475564]: [DepthRegistration::New] Using OpenCL registration method!

[ INFO] [1489113544.122519103]: [DepthRegistration::New] Using OpenCL registration method!

[ERROR] [1489113544.134612055]: [DepthRegistrationOpenCL::init] depth_registration_opencl.cpp cl::Platform::get(&platforms) failed: -1001

Any suggestions?

BHAASKARR commented 7 years ago

@jim1949 once try by running the below commands in 3 different command prompts roscore rosrun kinect2_bridge kinect2_bridge _depth_method:=opengl _reg_method:=cpu rosrun kinect2_viewer kinect2_viewer