OpenNI Depth timestamps

classic Classic list List threaded Threaded
4 messages Options
Reply | Threaded
Open this post in threaded view
|

OpenNI Depth timestamps

james
Administrator
Hi,

Is it possible to access sensor timestamps for OpenNI XYZ point clouds when using the OpenNI grabber to directly produce clouds?
e.g.:
typedef pcl::PointXYZ PointType;
...
boost::function<void (const CloudConstPtr&)> f = boost::bind (&ThreeDSensor::cloud_cb_, this, _1);
grabber->registerCallback (f);
grabber->start ();
...
void cloud_cb_ (const CloudConstPtr &cloud)

Or do I have to subscribe to a depth image stream and do something like this:
time_stamp = depth_image_ptr->getTimeStamp ();
If so, how can I create a XYZ point cloud from the depth image, any resources someone can point me to? I have always relied on the grabber's simplicity so far :)

Thanks,
James
Reply | Threaded
Open this post in threaded view
|

Re: OpenNI Depth timestamps

kwaegel
Administrator
james wrote
Is it possible to access sensor timestamps for OpenNI XYZ point clouds when using the OpenNI grabber to directly produce clouds?
e.g.:
typedef pcl::PointXYZ PointType;
...
boost::function<void (const CloudConstPtr&)> f = boost::bind (&ThreeDSensor::cloud_cb_, this, _1);
grabber->registerCallback (f);
grabber->start ();
...
void cloud_cb_ (const CloudConstPtr &cloud)

Or do I have to subscribe to a depth image stream and do something like this:
time_stamp = depth_image_ptr->getTimeStamp ();
If so, how can I create a XYZ point cloud from the depth image, any resources someone can point me to? I have always relied on the grabber's simplicity so far :)
I'm not sure of a great way to do this. The grabber has a protected function to convert a depth image into a point cloud ( convertToXYZPointCloud(depth_image_ptr) ), but it's not accessible by default. Modifying the PCL grabber to make that function public might be the easiest thing to do.
Reply | Threaded
Open this post in threaded view
|

Re: OpenNI Depth timestamps

james
Administrator
Sorry for the delayed response, and thanks for your swift response, it was a nice and easy solution.
Reply | Threaded
Open this post in threaded view
|

Re: OpenNI Depth timestamps

erickulcyk
In reply to this post by kwaegel
Is there any particular reason this function is protected in the first place?  I just subclassed the grabber and made it public, but it seems like it should have been a public method to begin with, along with a public static method which takes the sensors parameters and a depth map and constructs a point cloud.  I see it as just an abstraction so you don't have to worry about the details of creating the point cloud yourself.

Eric

From: [hidden email]
Sent: ‎Monday‎, ‎January‎ ‎27‎, ‎2014 ‎1‎:‎15‎ ‎AM
To: [hidden email]

james wrote

> Is it possible to access sensor timestamps for OpenNI XYZ point clouds
> when using the OpenNI grabber to directly produce clouds?
> e.g.:
> typedef pcl::PointXYZ PointType;
> ...
> boost::function
> <void (const CloudConstPtr&)>
>  f = boost::bind (&ThreeDSensor::cloud_cb_, this, _1);
> grabber->registerCallback (f);
> grabber->start ();
> ...
> void cloud_cb_ (const CloudConstPtr &cloud)
>
> Or do I have to subscribe to a depth image stream and do something like
> this:
> time_stamp = depth_image_ptr->getTimeStamp ();
> If so, how can I create a XYZ point cloud from the depth image, any
> resources someone can point me to? I have always relied on the grabber's
> simplicity so far :)

I'm not sure of a great way to do this. The grabber has a protected function
to convert a depth image into a point cloud (
*convertToXYZPointCloud(depth_image_ptr)* ), but it's not accessible by
default. Modifying the PCL grabber to make that function public might be the
easiest thing to do.



--
View this message in context: http://www.pcl-users.org/OpenNI-Depth-timestamps-tp4031926p4031927.html
Sent from the Point Cloud Library (PCL) Users mailing list mailing list archive at Nabble.com.
_______________________________________________
[hidden email] / http://pointclouds.org
http://pointclouds.org/mailman/listinfo/pcl-users

_______________________________________________
[hidden email] / http://pointclouds.org
http://pointclouds.org/mailman/listinfo/pcl-users