lucascoelhof / ball_follower

This package uses cmvision and openni to track the position of a ball and follow it

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

pcl::IsNotDenseException error

sglvladi opened this issue · comments

Hi,

I am trying to use the package and it seems to work fine, as long as the tracked object is not in the image when the "follower" node is started. If it is in the FOV of the Kinect at the initialization of the node, then the following error pops up:

terminate called after throwing an instance of 'pcl::IsNotDenseException'
what(): : Can't use 2D indexing with a unorganized point cloud

Any ideas on why this is happening?

Thanks in advance

Hi sglvladi,

I'm glad this package is being useful for someone! Well, I don't remember
if I had this problem before. On my video in youtube, we can see that the
ball starts out of the fov of kinect, but I don't really remember if this
problem was always happening.

There are some possibilities, though:

  • The package assumes you have cmvision calibrated and running. Have you
    calibrated cmvision correctly?
  • The follower node subscribes to the kinect depth camera topic. Maybe
    when we subscribe on it, the readings are still incorrect? I think we could
    just ignore the first readings from the sensor and see what happens later.
    So, on the kinect depth callback, try to do something like this:

void kinectDepthCallback(const sensor_msgs::PointCloud2::ConstPtr msg)
{

static int ignoredMessages = 0;

if(ignoredMessages >=100)

{

  depth = *msg;

  //std::cout<<msg->height<<" ";

  pcl::PCLPointCloud2 pcl_pc2;

  //pcl_conversions::toPCL((sensor_msgs::PointCloud2&)msg, pcl_pc2);

  pcl_conversions::toPCL(*msg, pcl_pc2);

   //Actually convert the PointCloud2 message into a type we can

reason about

  pcl::fromPCLPointCloud2(pcl_pc2, pcl_cloud);

  imageCenter.linear.x = depth.width/2;

  imageCenter.linear.y = depth.height/2;

}

else

{

ignoredMessages++;

}

}

Let me know if you stil have any problems! It will be a pleasure to help

2015-03-12 11:09 GMT-03:00 sglvladi notifications@github.com:

Hi,

I am trying to use the package and it seems to work fine, as long as the
tracked object is not in the image when the "follower" node is started. If
it is in the FOV of the Kinect at the initialization of the node, then the
following error pops up:

terminate called after throwing an instance of 'pcl::IsNotDenseException'
what(): : Can't use 2D indexing with a unorganized point cloud

Any ideas on why this is happening?

Thanks in advance


Reply to this email directly or view it on GitHub
#1.