ros-drivers / openni2_launch

Launch files to open an OpenNI2 device and load all nodelets to convert raw depth/RGB/IR streams to depth images, disparity images, and (registered) point clouds.
8 stars 33 forks source link

Openni2 does not handle oni files #26

Closed rastaxe closed 6 years ago

rastaxe commented 8 years ago

I am not able to load a oni file (OpenNI record file) with openni2 in Indigo. In Hydro I was able to load it simply with: roslaunch openni2_launch openni2.launch device_id:=/path/to/your/file.oni but in Indigo openni2 still tries to open the real device. Do you have the same problem?

mikeferguson commented 8 years ago

I'm guessing it is due to this commit: https://github.com/ros-drivers/openni2_camera/commit/17c10725a3df469d9663e6f6ffd0bea5dbf2bf6d -- in the past it would have probably fallen through and returned the string name, now it returns the empty string -- you could try adding an extra case before the matching attempt which checks if the file ends with .oni and if so, returns the device_id as-is. If that works, we can gladly accept a PR to fix this regression.

rastaxe commented 8 years ago

It worked! Thanks. I simply added this to line 682:

// check if device_id is a oni file
  else if( device_id.size() - device_id.rfind(".oni") == 4 ) {
    return device_id;
  }
lianera commented 8 years ago

Same issue here, does anyone has a fixed fork?

rastaxe commented 8 years ago

If you add the above two lines to line 682, it fixes the problem. I did a pull request on openni2_camera.

lianera commented 8 years ago

@rastaxe problem solved, thanks a lot :+1:

130s commented 6 years ago

Moved to the ros-drivers/openni2_camera repo (cont'd in the referenced issue).