Last active
August 27, 2015 14:55
-
-
Save chatchavan/c073b8b15e2c17ad1dbc to your computer and use it in GitHub Desktop.
PCL manual settings on Raspberry Pi
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
# These settings are obtained from | |
# pkg-config --print-variables pcl_common-1.7 | |
# pkg-config --variable=libdir pcl_common-1.7 | |
PCL_INCLUDE_DIRS=/usr/include/pcl-1.7 | |
PCL_LIBRARY_DIRS=/usr/lib/arm-linux-gnueabihf |
Also
// status = context_.CreateProductionTree (const_cast<xn::NodeInfo&>(ir_node), ir_generator_);
// if (status != XN_STATUS_OK)
// THROW_OPENNI_EXCEPTION ("creating IR generator failed. Reason: %s", xnGetStatusString (status));
// ir_generator_.RegisterToNewDataAvailable (static_cast<xn::StateChangedHandler> (NewIRDataAvailable), this, ir_callback_handle_);
also, make the following methods return 0 always.
openni_wrapper::OpenNIDevice::hasImageStream () const throw ()
openni_wrapper::OpenNIDevice::hasIRStream () const throw ()
Also, make these methods return without doing anything:
openni_wrapper::OpenNIDevice::setIROutputMode (const XnMapOutputMode& output_mode)
openni_wrapper::OpenNIDevice::setImageOutputMode (const XnMapOutputMode& output_mode)
in openni_device_primesense.cpp
, comment out lines (commenting out the image_generator_
stuff and ensure that status
is declared) :
openni_wrapper::DevicePrimesense::DevicePrimesense (
xn::Context& context,
const xn::NodeInfo& device_node,
const xn::NodeInfo& image_node,
const xn::NodeInfo& depth_node,
const xn::NodeInfo& ir_node) : OpenNIDevice (context, device_node, image_node, depth_node, ir_node)
{
// setup stream modes
enumAvailableModes ();
setDepthOutputMode (getDefaultDepthMode ());
setImageOutputMode (getDefaultImageMode ());
setIROutputMode (getDefaultIRMode ());
boost::unique_lock<boost::mutex> image_lock (image_mutex_);
// XnStatus status = image_generator_.SetIntProperty ("InputFormat", 5);
// if (status != XN_STATUS_OK)
// THROW_OPENNI_EXCEPTION ("Error setting the image input format to Uncompressed YUV422. Reason: %s", xnGetStatusString (status));
// status = image_generator_.SetPixelFormat (XN_PIXEL_FORMAT_YUV422);
// if (status != XN_STATUS_OK)
// THROW_OPENNI_EXCEPTION ("Failed to set image pixel format to YUV422. Reason: %s", xnGetStatusString (status));
image_lock.unlock ();
boost::lock_guard<boost::mutex> depth_lock (depth_mutex_);
XnStatus status = depth_generator_.SetIntProperty ("RegistrationType", 1);
if (status != XN_STATUS_OK)
THROW_OPENNI_EXCEPTION ("Error setting the registration type. Reason: %s", xnGetStatusString (status));
}
In your program, changed the binding function to use only XYZ. Basically, replace everything with XYZRGBA
to XYZ
boost::function<void (const PointCloud<PointXYZ>::ConstPtr&)> f =
boost::bind(&grabberCallback, _1);
The example in pcl/io/tools/openni_grabber_depth_example.cpp
may be a better starting point than the one on the website.
Knowledge in this post is captured in this fork of PCL
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Commented out in
openni_device.cpp
: