Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[ROS-O] patches to build on modern systems #80

Open
wants to merge 4 commits into
base: ros1
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
6 changes: 3 additions & 3 deletions openni_camera/include/openni_camera/openni_depth_image.h
Original file line number Diff line number Diff line change
Expand Up @@ -59,9 +59,9 @@ class DepthImage
inline virtual ~DepthImage () throw ();

inline const xn::DepthMetaData& getDepthMetaData () const throw ();
void fillDisparityImage (unsigned width, unsigned height, float* disparity_buffer, unsigned line_step = 0) const throw (OpenNIException);
void fillDepthImage (unsigned width, unsigned height, float* depth_buffer, unsigned line_step = 0) const throw (OpenNIException);
void fillDepthImageRaw (unsigned width, unsigned height, unsigned short* depth_buffer, unsigned line_step = 0) const throw (OpenNIException);
void fillDisparityImage (unsigned width, unsigned height, float* disparity_buffer, unsigned line_step = 0) const ;
void fillDepthImage (unsigned width, unsigned height, float* depth_buffer, unsigned line_step = 0) const ;
void fillDepthImageRaw (unsigned width, unsigned height, unsigned short* depth_buffer, unsigned line_step = 0) const ;

inline float getBaseline () const throw ();
inline float getFocalLength () const throw ();
Expand Down
76 changes: 38 additions & 38 deletions openni_camera/include/openni_camera/openni_device.h
Original file line number Diff line number Diff line change
Expand Up @@ -75,35 +75,35 @@ class OpenNIDevice : public boost::noncopyable
virtual ~OpenNIDevice () throw ();
void shutdown ();

virtual bool findCompatibleImageMode (const XnMapOutputMode& output_mode, XnMapOutputMode& mode ) const throw (OpenNIException);
virtual bool findCompatibleDepthMode (const XnMapOutputMode& output_mode, XnMapOutputMode& mode ) const throw (OpenNIException);
virtual bool findCompatibleImageMode (const XnMapOutputMode& output_mode, XnMapOutputMode& mode ) const ;
virtual bool findCompatibleDepthMode (const XnMapOutputMode& output_mode, XnMapOutputMode& mode ) const ;

virtual bool isImageModeSupported (const XnMapOutputMode& output_mode) const throw (OpenNIException);
virtual bool isDepthModeSupported (const XnMapOutputMode& output_mode) const throw (OpenNIException);
virtual bool isImageModeSupported (const XnMapOutputMode& output_mode) const ;
virtual bool isDepthModeSupported (const XnMapOutputMode& output_mode) const ;

virtual const XnMapOutputMode& getDefaultImageMode () const throw ();
virtual const XnMapOutputMode& getDefaultDepthMode () const throw ();
virtual const XnMapOutputMode& getDefaultIRMode () const throw ();

virtual void setImageOutputMode (const XnMapOutputMode& output_mode) throw (OpenNIException);
virtual void setDepthOutputMode (const XnMapOutputMode& output_mode) throw (OpenNIException);
virtual void setIROutputMode (const XnMapOutputMode& output_mode) throw (OpenNIException);
virtual void setImageOutputMode (const XnMapOutputMode& output_mode) ;
virtual void setDepthOutputMode (const XnMapOutputMode& output_mode) ;
virtual void setIROutputMode (const XnMapOutputMode& output_mode) ;

XnMapOutputMode getImageOutputMode () const throw (OpenNIException);
XnMapOutputMode getDepthOutputMode () const throw (OpenNIException);
XnMapOutputMode getIROutputMode () const throw (OpenNIException);
XnMapOutputMode getImageOutputMode () const ;
XnMapOutputMode getDepthOutputMode () const ;
XnMapOutputMode getIROutputMode () const ;

virtual void setDepthRegistration (bool on_off) throw (OpenNIException);
bool isDepthRegistered () const throw (OpenNIException);
virtual bool isDepthRegistrationSupported () const throw (OpenNIException);
virtual void setDepthRegistration (bool on_off) ;
bool isDepthRegistered () const ;
virtual bool isDepthRegistrationSupported () const ;

virtual void setSynchronization (bool on_off) throw (OpenNIException);
virtual bool isSynchronized () const throw (OpenNIException);
virtual void setSynchronization (bool on_off) ;
virtual bool isSynchronized () const ;
virtual bool isSynchronizationSupported () const throw ();

// just supported by primesense -> virtual
virtual bool isDepthCropped () const throw (OpenNIException);
virtual void setDepthCropping (unsigned x, unsigned y, unsigned width, unsigned height) throw (OpenNIException);
virtual bool isDepthCropped () const ;
virtual void setDepthCropping (unsigned x, unsigned y, unsigned width, unsigned height) ;
virtual bool isDepthCroppingSupported () const throw ();

/** \brief returns the focal length for the color camera in pixels. The pixels are assumed to be square.
Expand All @@ -117,22 +117,22 @@ class OpenNIDevice : public boost::noncopyable
inline float getDepthFocalLength (int output_x_resolution = 0) const throw ();
inline float getBaseline () const throw ();

virtual void startImageStream () throw (OpenNIException);
virtual void stopImageStream () throw (OpenNIException);
virtual void startImageStream () ;
virtual void stopImageStream () ;

virtual void startDepthStream () throw (OpenNIException);
virtual void stopDepthStream () throw (OpenNIException);
virtual void startDepthStream () ;
virtual void stopDepthStream () ;

virtual void startIRStream () throw (OpenNIException);
virtual void stopIRStream () throw (OpenNIException);
virtual void startIRStream () ;
virtual void stopIRStream () ;

bool hasImageStream () const throw ();
bool hasDepthStream () const throw ();
bool hasIRStream () const throw ();

virtual bool isImageStreamRunning () const throw (OpenNIException);
virtual bool isDepthStreamRunning () const throw (OpenNIException);
virtual bool isIRStreamRunning () const throw (OpenNIException);
virtual bool isImageStreamRunning () const ;
virtual bool isDepthStreamRunning () const ;
virtual bool isIRStreamRunning () const ;

CallbackHandle registerImageCallback (const ImageCallbackFunction& callback, void* cookie = NULL) throw ();
template<typename T> CallbackHandle registerImageCallback (void (T::*callback)(boost::shared_ptr<Image>, void* cookie), T& instance, void* cookie = NULL) throw ();
Expand Down Expand Up @@ -164,26 +164,26 @@ class OpenNIDevice : public boost::noncopyable
typedef boost::function<void(boost::shared_ptr<DepthImage>) > ActualDepthImageCallbackFunction;
typedef boost::function<void(boost::shared_ptr<IRImage>) > ActualIRImageCallbackFunction;

OpenNIDevice (xn::Context& context, const xn::NodeInfo& device_node, const xn::NodeInfo& image_node, const xn::NodeInfo& depth_node, const xn::NodeInfo& ir_node) throw (OpenNIException);
OpenNIDevice (xn::Context& context, const xn::NodeInfo& device_node, const xn::NodeInfo& depth_node, const xn::NodeInfo& ir_node) throw (OpenNIException);
OpenNIDevice (xn::Context& context) throw (OpenNIException);
OpenNIDevice (xn::Context& context, const xn::NodeInfo& device_node, const xn::NodeInfo& image_node, const xn::NodeInfo& depth_node, const xn::NodeInfo& ir_node) ;
OpenNIDevice (xn::Context& context, const xn::NodeInfo& device_node, const xn::NodeInfo& depth_node, const xn::NodeInfo& ir_node) ;
OpenNIDevice (xn::Context& context) ;
static void __stdcall NewDepthDataAvailable (xn::ProductionNode& node, void* cookie) throw ();
static void __stdcall NewImageDataAvailable (xn::ProductionNode& node, void* cookie) throw ();
static void __stdcall NewIRDataAvailable (xn::ProductionNode& node, void* cookie) throw ();

// This is a workaround, since in the NewDepthDataAvailable function WaitAndUpdateData leads to a dead-lock behaviour
// and retrieving image data without WaitAndUpdateData leads to incomplete images!!!
void ImageDataThreadFunction () throw (OpenNIException);
void DepthDataThreadFunction () throw (OpenNIException);
void IRDataThreadFunction () throw (OpenNIException);
void ImageDataThreadFunction () ;
void DepthDataThreadFunction () ;
void IRDataThreadFunction () ;

virtual bool isImageResizeSupported (unsigned input_width, unsigned input_height, unsigned output_width, unsigned output_height) const throw () = 0;

void setRegistration (bool on_off) throw (OpenNIException);
void setRegistration (bool on_off) ;
virtual boost::shared_ptr<Image> getCurrentImage (boost::shared_ptr<xn::ImageMetaData> image_data) const throw () = 0;

virtual void enumAvailableModes () throw (OpenNIException);
void Init () throw (OpenNIException);
virtual void enumAvailableModes () ;
void Init () ;
// holds the callback functions together with custom data
// since same callback function can be registered multiple times with e.g. different custom data
// we use a map structure with a handle as the key
Expand Down Expand Up @@ -264,19 +264,19 @@ float OpenNIDevice::getBaseline () const throw ()

template<typename T> OpenNIDevice::CallbackHandle OpenNIDevice::registerImageCallback (void (T::*callback)(boost::shared_ptr<Image>, void* cookie), T& instance, void* custom_data) throw ()
{
image_callback_[image_callback_handle_counter_] = boost::bind (callback, boost::ref (instance), _1, custom_data);
image_callback_[image_callback_handle_counter_] = boost::bind (callback, boost::ref (instance), boost::placeholders::_1, custom_data);
return image_callback_handle_counter_++;
}

template<typename T> OpenNIDevice::CallbackHandle OpenNIDevice::registerDepthCallback (void (T::*callback)(boost::shared_ptr<DepthImage>, void* cookie), T& instance, void* custom_data) throw ()
{
depth_callback_[depth_callback_handle_counter_] = boost::bind ( callback, boost::ref (instance), _1, custom_data);
depth_callback_[depth_callback_handle_counter_] = boost::bind ( callback, boost::ref (instance), boost::placeholders::_1, custom_data);
return depth_callback_handle_counter_++;
}

template<typename T> OpenNIDevice::CallbackHandle OpenNIDevice::registerIRCallback (void (T::*callback)(boost::shared_ptr<IRImage>, void* cookie), T& instance, void* custom_data) throw ()
{
ir_callback_[ir_callback_handle_counter_] = boost::bind ( callback, boost::ref (instance), _1, custom_data);
ir_callback_[ir_callback_handle_counter_] = boost::bind ( callback, boost::ref (instance), boost::placeholders::_1, custom_data);
return ir_callback_handle_counter_++;
}

Expand Down
12 changes: 6 additions & 6 deletions openni_camera/include/openni_camera/openni_device_kinect.h
Original file line number Diff line number Diff line change
Expand Up @@ -54,24 +54,24 @@ class DeviceKinect : public OpenNIDevice
{
friend class OpenNIDriver;
public:
DeviceKinect (xn::Context& context, const xn::NodeInfo& device_node, const xn::NodeInfo& image_node, const xn::NodeInfo& depth_node, const xn::NodeInfo& ir_node) throw (OpenNIException);
DeviceKinect (xn::Context& context, const xn::NodeInfo& device_node, const xn::NodeInfo& image_node, const xn::NodeInfo& depth_node, const xn::NodeInfo& ir_node) ;
virtual ~DeviceKinect () throw ();

inline void setDebayeringMethod (const ImageBayerGRBG::DebayeringMethod& debayering_method) throw ();
inline const ImageBayerGRBG::DebayeringMethod& getDebayeringMethod () const throw ();

// these capabilities are not supported for kinect
virtual void setSynchronization (bool on_off) throw (OpenNIException);
virtual bool isSynchronized () const throw (OpenNIException);
virtual void setSynchronization (bool on_off) ;
virtual bool isSynchronized () const ;
virtual bool isSynchronizationSupported () const throw ();

virtual bool isDepthCropped () const throw (OpenNIException);
virtual void setDepthCropping (unsigned x, unsigned y, unsigned width, unsigned height) throw (OpenNIException);
virtual bool isDepthCropped () const ;
virtual void setDepthCropping (unsigned x, unsigned y, unsigned width, unsigned height) ;
virtual bool isDepthCroppingSupported () const throw ();

protected:
virtual boost::shared_ptr<Image> getCurrentImage (boost::shared_ptr<xn::ImageMetaData> image_meta_data) const throw ();
virtual void enumAvailableModes () throw (OpenNIException);
virtual void enumAvailableModes () ;
virtual bool isImageResizeSupported (unsigned input_width, unsigned input_height, unsigned output_width, unsigned output_height) const throw ();
ImageBayerGRBG::DebayeringMethod debayering_method_;
};
Expand Down
26 changes: 13 additions & 13 deletions openni_camera/include/openni_camera/openni_device_oni.h
Original file line number Diff line number Diff line change
Expand Up @@ -54,30 +54,30 @@ class DeviceONI : public OpenNIDevice
{
friend class OpenNIDriver;
public:
DeviceONI (xn::Context& context, const std::string& file_name, bool repeat = false, bool streaming = true) throw (OpenNIException);
DeviceONI (xn::Context& context, const std::string& file_name, bool repeat = false, bool streaming = true) ;
virtual ~DeviceONI () throw ();

virtual void startImageStream () throw (OpenNIException);
virtual void stopImageStream () throw (OpenNIException);
virtual void startImageStream () ;
virtual void stopImageStream () ;

virtual void startDepthStream () throw (OpenNIException);
virtual void stopDepthStream () throw (OpenNIException);
virtual void startDepthStream () ;
virtual void stopDepthStream () ;

virtual void startIRStream () throw (OpenNIException);
virtual void stopIRStream () throw (OpenNIException);
virtual void startIRStream () ;
virtual void stopIRStream () ;

virtual bool isImageStreamRunning () const throw (OpenNIException);
virtual bool isDepthStreamRunning () const throw (OpenNIException);
virtual bool isIRStreamRunning () const throw (OpenNIException);
virtual bool isImageStreamRunning () const ;
virtual bool isDepthStreamRunning () const ;
virtual bool isIRStreamRunning () const ;

virtual bool isImageResizeSupported (unsigned input_width, unsigned input_height, unsigned output_width, unsigned output_height) const throw ();

bool trigger () throw (OpenNIException);
bool isStreaming () const throw (OpenNIException);
bool trigger () ;
bool isStreaming () const ;
protected:
virtual boost::shared_ptr<Image> getCurrentImage (boost::shared_ptr<xn::ImageMetaData> image_meta_data) const throw ();

void PlayerThreadFunction () throw (OpenNIException);
void PlayerThreadFunction () ;
static void __stdcall NewONIDepthDataAvailable (xn::ProductionNode& node, void* cookie) throw ();
static void __stdcall NewONIImageDataAvailable (xn::ProductionNode& node, void* cookie) throw ();
static void __stdcall NewONIIRDataAvailable (xn::ProductionNode& node, void* cookie) throw ();
Expand Down
10 changes: 5 additions & 5 deletions openni_camera/include/openni_camera/openni_device_primesense.h
Original file line number Diff line number Diff line change
Expand Up @@ -52,17 +52,17 @@ class DevicePrimesense : public OpenNIDevice
{
friend class OpenNIDriver;
public:
DevicePrimesense (xn::Context& context, const xn::NodeInfo& device_node, const xn::NodeInfo& image_node, const xn::NodeInfo& depth_node, const xn::NodeInfo& ir_node) throw (OpenNIException);
DevicePrimesense (xn::Context& context, const xn::NodeInfo& device_node, const xn::NodeInfo& image_node, const xn::NodeInfo& depth_node, const xn::NodeInfo& ir_node) ;
virtual ~DevicePrimesense () throw ();
//virtual void setImageOutputMode (const XnMapOutputMode& output_mode) throw (OpenNIException);
//virtual void setImageOutputMode (const XnMapOutputMode& output_mode) ;

protected:
virtual boost::shared_ptr<Image> getCurrentImage (boost::shared_ptr<xn::ImageMetaData> image_meta_data) const throw ();
virtual void enumAvailableModes () throw (OpenNIException);
virtual void enumAvailableModes () ;
virtual bool isImageResizeSupported (unsigned input_width, unsigned input_height, unsigned output_width, unsigned output_height) const throw ();

virtual void startImageStream () throw (OpenNIException);
virtual void startDepthStream () throw (OpenNIException);
virtual void startImageStream () ;
virtual void startDepthStream () ;
};
} // namespace

Expand Down
8 changes: 4 additions & 4 deletions openni_camera/include/openni_camera/openni_device_xtion.h
Original file line number Diff line number Diff line change
Expand Up @@ -53,16 +53,16 @@ class DeviceXtionPro : public OpenNIDevice
{
friend class OpenNIDriver;
public:
DeviceXtionPro (xn::Context& context, const xn::NodeInfo& device_node, const xn::NodeInfo& depth_node, const xn::NodeInfo& ir_node) throw (OpenNIException);
DeviceXtionPro (xn::Context& context, const xn::NodeInfo& device_node, const xn::NodeInfo& depth_node, const xn::NodeInfo& ir_node) ;
virtual ~DeviceXtionPro () throw ();
//virtual void setImageOutputMode (const XnMapOutputMode& output_mode) throw (OpenNIException);
//virtual void setImageOutputMode (const XnMapOutputMode& output_mode) ;

protected:
virtual boost::shared_ptr<Image> getCurrentImage (boost::shared_ptr<xn::ImageMetaData> image_meta_data) const throw ();
virtual void enumAvailableModes () throw (OpenNIException);
virtual void enumAvailableModes () ;
virtual bool isImageResizeSupported (unsigned input_width, unsigned input_height, unsigned output_width, unsigned output_height) const throw ();

virtual void startDepthStream () throw (OpenNIException);
virtual void startDepthStream () ;
};
} // namespace

Expand Down
18 changes: 9 additions & 9 deletions openni_camera/include/openni_camera/openni_driver.h
Original file line number Diff line number Diff line change
Expand Up @@ -60,15 +60,15 @@ class OpenNIDriver
public:
~OpenNIDriver () throw ();

inline static OpenNIDriver& getInstance () throw (OpenNIException);
inline static OpenNIDriver& getInstance () ;
unsigned updateDeviceList () throw ();
inline unsigned getNumberDevices () const throw ();

boost::shared_ptr<OpenNIDevice> createVirtualDevice (const std::string& path, bool repeat, bool stream) const throw (OpenNIException);
boost::shared_ptr<OpenNIDevice> getDeviceByIndex (unsigned index) const throw (OpenNIException);
boost::shared_ptr<OpenNIDevice> createVirtualDevice (const std::string& path, bool repeat, bool stream) const ;
boost::shared_ptr<OpenNIDevice> getDeviceByIndex (unsigned index) const ;
#ifndef _WIN32
boost::shared_ptr<OpenNIDevice> getDeviceBySerialNumber (const std::string& serial_number) const throw (OpenNIException);
boost::shared_ptr<OpenNIDevice> getDeviceByAddress (unsigned char bus, unsigned char address) const throw (OpenNIException);
boost::shared_ptr<OpenNIDevice> getDeviceBySerialNumber (const std::string& serial_number) const ;
boost::shared_ptr<OpenNIDevice> getDeviceByAddress (unsigned char bus, unsigned char address) const ;
#endif

const char* getSerialNumber (unsigned index) const throw ();
Expand All @@ -84,7 +84,7 @@ class OpenNIDriver

void getPrimesenseSerial(xn::NodeInfo info, char* buffer, unsigned buf_size) const throw ();

void stopAll () throw (OpenNIException);
void stopAll () ;

static void getDeviceType (const std::string& connection_string, unsigned short& vendorId, unsigned short& productId);
protected:
Expand All @@ -100,8 +100,8 @@ class OpenNIDriver
boost::weak_ptr<OpenNIDevice> device;
};

OpenNIDriver () throw (OpenNIException);
boost::shared_ptr<OpenNIDevice> getDevice (unsigned index) const throw (OpenNIException);
OpenNIDriver () ;
boost::shared_ptr<OpenNIDevice> getDevice (unsigned index) const ;

#ifndef _WIN32
// workaround to get additional device nformation like serial number, vendor and product name, until Primesense fix this
Expand All @@ -116,7 +116,7 @@ class OpenNIDriver
std::map< std::string, unsigned > connection_string_map_;
};

OpenNIDriver& OpenNIDriver::getInstance () throw (OpenNIException)
OpenNIDriver& OpenNIDriver::getInstance ()
{
static OpenNIDriver driver;
return driver;
Expand Down
6 changes: 3 additions & 3 deletions openni_camera/include/openni_camera/openni_image.h
Original file line number Diff line number Diff line change
Expand Up @@ -69,18 +69,18 @@ class Image
virtual bool isResizingSupported (unsigned input_width, unsigned input_height,
unsigned output_width, unsigned output_height) const = 0;
virtual void fillRGB (unsigned width, unsigned height, unsigned char* rgb_buffer,
unsigned rgb_line_step = 0) const throw (OpenNIException) = 0;
unsigned rgb_line_step = 0) const = 0;

virtual Encoding getEncoding () const = 0;

inline void
fillRaw (unsigned char* rgb_buffer) const throw (OpenNIException)
fillRaw (unsigned char* rgb_buffer) const
{
memcpy (rgb_buffer, image_md_->WritableData(), image_md_->DataSize ());
}

virtual void fillGrayscale (unsigned width, unsigned height, unsigned char* gray_buffer,
unsigned gray_line_step = 0) const throw (OpenNIException) = 0;
unsigned gray_line_step = 0) const = 0;

inline unsigned getWidth () const throw ();
inline unsigned getHeight () const throw ();
Expand Down
Loading