Robotics StackExchange | Archived questions

How to use_indices with Kinect/Asus?

Hi all,

Trying to cut down on the point cloud bandwidth with the Asus Xtion Pro sensor using the useindices feature. Working with Electric/Ubuntu Lucid. Pulled opennicamera via apt-get. My launch for the sensor looks like this:

<launch>
    <param name="/asus/driver/use_indices" type="bool" value="true" />
    <param name="/asus/driver/depth_registration" type="bool" value="false" />
    <param name="/asus/driver/depth_mode" value="4" />

    <include file="$(find openni_launch)/launch/openni.launch" >
    <arg name="camera" value="asus" />
    </include>
</launch>

The code to set up the indices vector:

// set up indices to window the Asus point cloud1
ros::Publisher PointIndicesPub;
pcl::PointIndices IN;
PointIndicesPub = nh_.advertise<pcl::PointIndices>("/asus/driver/depth/indices", 1, true);  // latched
int x1=80, y1=60, x2=240, y2=180;   // change to params
IN.indices.resize((x2-x1+1)*(y2-y1+1));
int a,b,c=0;
for (b=y1; b<=y2; b++) {
  for (a=x1; a<=x2; a++) {
    IN.indices.at(c++) = (b*320)+a;
  }
}
PointIndicesPub.publish(IN);

I've tried a number of variations (like publishing on depth/indices), but the result is always the same, the point cloud comes across as the full 320x240. I do not get any runtime errors, my indices topic is being published just fine. I've also looked at the rxconsole input, but I do not see the openni nodelet put out any info regarding the state of the use_indices parameter. What am I missing?

Thanks, in advance for any help!


Ok, I been going through this problem, and I finally figured out that the launch sequence does not actually load the openninodelet.cpp code (which does the useindices processing), it loads the driver.cpp code (which does not). Why is that? Is the nodelet not actually working?


Changed the device.launch file to load the openni_nodelet.cpp nodelet instead of driver.cpp. Unfortunately it dies every times with exit code -11. Traced it to OpenNINodelet::setupDevice routine, and found it crashes at the following line:

->  int image_mode = mapXnMode2ConfigMode (device_->getDefaultImageMode ());
    param_nh.param ("image_mode", image_mode, image_mode );

Any idea why?


Got to the bottom of the rat hole. It fails because the Asus XtionPro does not support image modes, only depth. The code, as is, croaks because there are no image mode enumerated, leaving availableimagemodes_ empty.

So, bottom line is driver.cpp supports the Asus device, but not useindices; openninodelet.cpp supports useindices, but not the Asus device. Any chance of seeing useindices supported in driver.cpp?

Asked by prp on 2011-09-30 01:59:54 UTC

Comments

Answers