first commit

This commit is contained in:
andre neto
2024-01-15 12:27:47 +00:00
commit 13a330c472
364 changed files with 39952 additions and 0 deletions
@@ -0,0 +1,55 @@
/*
* Copyright (c) 2013, Willow Garage, Inc.
* Copyright (c) 2016, Orbbec Ltd.
* All rights reserved.
*
* Redistribution and use in source and binary forms, with or without
* modification, are permitted provided that the following conditions are met:
*
* * Redistributions of source code must retain the above copyright
* notice, this list of conditions and the following disclaimer.
* * Redistributions in binary form must reproduce the above copyright
* notice, this list of conditions and the following disclaimer in the
* documentation and/or other materials provided with the distribution.
* * Neither the name of the Willow Garage, Inc. nor the names of its
* contributors may be used to endorse or promote products derived from
* this software without specific prior written permission.
*
* THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS"
* AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
* IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
* ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT OWNER OR CONTRIBUTORS BE
* LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
* CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
* SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
* INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN
* CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
* ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
* POSSIBILITY OF SUCH DAMAGE.
*
* Author: Tim Liu (liuhua@orbbec.com)
*/
#ifndef ASTRA_CONVERT_H_
#define ASTRA_CONVERT_H_
#include "astra_camera/astra_device_info.h"
#include "astra_camera/astra_video_mode.h"
#include "openni2/OpenNI.h"
#include <vector>
namespace astra_wrapper
{
const AstraDeviceInfo astra_convert(const openni::DeviceInfo* pInfo);
const AstraVideoMode astra_convert(const openni::VideoMode& input);
const openni::VideoMode astra_convert(const AstraVideoMode& input);
const std::vector<AstraVideoMode> astra_convert(const openni::Array<openni::VideoMode>& input);
}
#endif
@@ -0,0 +1,196 @@
/*
* Copyright (c) 2013, Willow Garage, Inc.
* Copyright (c) 2016, Orbbec Ltd.
* All rights reserved.
*
* Redistribution and use in source and binary forms, with or without
* modification, are permitted provided that the following conditions are met:
*
* * Redistributions of source code must retain the above copyright
* notice, this list of conditions and the following disclaimer.
* * Redistributions in binary form must reproduce the above copyright
* notice, this list of conditions and the following disclaimer in the
* documentation and/or other materials provided with the distribution.
* * Neither the name of the Willow Garage, Inc. nor the names of its
* contributors may be used to endorse or promote products derived from
* this software without specific prior written permission.
*
* THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS"
* AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
* IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
* ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT OWNER OR CONTRIBUTORS BE
* LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
* CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
* SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
* INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN
* CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
* ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
* POSSIBILITY OF SUCH DAMAGE.
*
* Author: Tim Liu (liuhua@orbbec.com)
*/
#ifndef ASTRA_DEVICE_H
#define ASTRA_DEVICE_H
#include "astra_camera/astra_video_mode.h"
#include "astra_camera/astra_exception.h"
#include "astra_camera/astra_device_type.h"
#include <openni2/OpenNI.h>
#include <boost/shared_ptr.hpp>
#include <boost/cstdint.hpp>
#include <boost/bind.hpp>
#include <boost/function.hpp>
#include <sensor_msgs/Image.h>
#include <string>
#include <vector>
namespace openni
{
class Device;
class DeviceInfo;
class VideoStream;
class SensorInfo;
}
namespace astra_wrapper
{
typedef boost::function<void(sensor_msgs::ImagePtr image)> FrameCallbackFunction;
class AstraFrameListener;
class AstraDevice
{
public:
AstraDevice(const std::string& device_URI);
virtual ~AstraDevice();
const std::string getUri() const;
const std::string getVendor() const;
const std::string getName() const;
uint16_t getUsbVendorId() const;
uint16_t getUsbProductId() const;
const std::string getStringID() const;
bool isValid() const;
bool hasIRSensor() const;
bool hasColorSensor() const;
bool hasDepthSensor() const;
void startIRStream();
void startColorStream();
void startDepthStream();
void stopAllStreams();
void stopIRStream();
void stopColorStream();
void stopDepthStream();
bool isIRStreamStarted();
bool isColorStreamStarted();
bool isDepthStreamStarted();
bool isImageRegistrationModeSupported() const;
void setImageRegistrationMode(bool enabled);
void setDepthColorSync(bool enabled);
const AstraVideoMode getIRVideoMode();
const AstraVideoMode getColorVideoMode();
const AstraVideoMode getDepthVideoMode();
const std::vector<AstraVideoMode>& getSupportedIRVideoModes() const;
const std::vector<AstraVideoMode>& getSupportedColorVideoModes() const;
const std::vector<AstraVideoMode>& getSupportedDepthVideoModes() const;
bool isIRVideoModeSupported(const AstraVideoMode& video_mode) const;
bool isColorVideoModeSupported(const AstraVideoMode& video_mode) const;
bool isDepthVideoModeSupported(const AstraVideoMode& video_mode) const;
void setIRVideoMode(const AstraVideoMode& video_mode);
void setColorVideoMode(const AstraVideoMode& video_mode);
void setDepthVideoMode(const AstraVideoMode& video_mode);
void setIRFrameCallback(FrameCallbackFunction callback);
void setColorFrameCallback(FrameCallbackFunction callback);
void setDepthFrameCallback(FrameCallbackFunction callback);
float getIRFocalLength (int output_y_resolution) const;
float getColorFocalLength (int output_y_resolution) const;
float getDepthFocalLength (int output_y_resolution) const;
float getBaseline () const;
OBCameraParams getCameraParams() const;
bool isCameraParamsValid();
char* getSerialNumber();
char* getDeviceType();
OB_DEVICE_NO getDeviceTypeNo();
int getIRGain() const;
int getIRExposure() const;
void setCameraParams(OBCameraParams param);
void setIRGain(int gain);
void setIRExposure(int exposure);
void setLaser(bool enable);
void setIRFlood(bool enable);
void setLDP(bool enable);
void switchIRCamera(int cam);
void setAutoExposure(bool enable);
void setAutoWhiteBalance(bool enable);
bool getAutoExposure() const;
bool getAutoWhiteBalance() const;
void setUseDeviceTimer(bool enable);
protected:
void shutdown();
boost::shared_ptr<openni::VideoStream> getIRVideoStream() const;
boost::shared_ptr<openni::VideoStream> getColorVideoStream() const;
boost::shared_ptr<openni::VideoStream> getDepthVideoStream() const;
boost::shared_ptr<openni::Device> openni_device_;
boost::shared_ptr<openni::DeviceInfo> device_info_;
boost::shared_ptr<AstraFrameListener> ir_frame_listener;
boost::shared_ptr<AstraFrameListener> color_frame_listener;
boost::shared_ptr<AstraFrameListener> depth_frame_listener;
mutable boost::shared_ptr<openni::VideoStream> ir_video_stream_;
mutable boost::shared_ptr<openni::VideoStream> color_video_stream_;
mutable boost::shared_ptr<openni::VideoStream> depth_video_stream_;
mutable std::vector<AstraVideoMode> ir_video_modes_;
mutable std::vector<AstraVideoMode> color_video_modes_;
mutable std::vector<AstraVideoMode> depth_video_modes_;
bool ir_video_started_;
bool color_video_started_;
bool depth_video_started_;
bool image_registration_activated_;
bool use_device_time_;
OBCameraParams m_CamParams;
bool m_ParamsValid;
char serial_number[12];
char device_type[32];
OB_DEVICE_NO device_type_no;
};
std::ostream& operator << (std::ostream& stream, const AstraDevice& device);
}
#endif /* OPENNI_DEVICE_H */
@@ -0,0 +1,56 @@
/*
* Copyright (c) 2013, Willow Garage, Inc.
* Copyright (c) 2016, Orbbec Ltd.
* All rights reserved.
*
* Redistribution and use in source and binary forms, with or without
* modification, are permitted provided that the following conditions are met:
*
* * Redistributions of source code must retain the above copyright
* notice, this list of conditions and the following disclaimer.
* * Redistributions in binary form must reproduce the above copyright
* notice, this list of conditions and the following disclaimer in the
* documentation and/or other materials provided with the distribution.
* * Neither the name of the Willow Garage, Inc. nor the names of its
* contributors may be used to endorse or promote products derived from
* this software without specific prior written permission.
*
* THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS"
* AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
* IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
* ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT OWNER OR CONTRIBUTORS BE
* LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
* CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
* SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
* INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN
* CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
* ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
* POSSIBILITY OF SUCH DAMAGE.
*
* Author: Tim Liu (liuhua@orbbec.com)
*/
#ifndef ASTRA_DEVICE_INFO_H_
#define ASTRA_DEVICE_INFO_H_
#include <ostream>
#include <boost/cstdint.hpp>
namespace astra_wrapper
{
struct AstraDeviceInfo
{
std::string uri_;
std::string vendor_;
std::string name_;
uint16_t vendor_id_;
uint16_t product_id_;
};
std::ostream& operator << (std::ostream& stream, const AstraDeviceInfo& device_info);
}
#endif /* DRIVER_H_ */
@@ -0,0 +1,78 @@
/*
* Copyright (c) 2013, Willow Garage, Inc.
* Copyright (c) 2016, Orbbec Ltd.
* All rights reserved.
*
* Redistribution and use in source and binary forms, with or without
* modification, are permitted provided that the following conditions are met:
*
* * Redistributions of source code must retain the above copyright
* notice, this list of conditions and the following disclaimer.
* * Redistributions in binary form must reproduce the above copyright
* notice, this list of conditions and the following disclaimer in the
* documentation and/or other materials provided with the distribution.
* * Neither the name of the Willow Garage, Inc. nor the names of its
* contributors may be used to endorse or promote products derived from
* this software without specific prior written permission.
*
* THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS"
* AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
* IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
* ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT OWNER OR CONTRIBUTORS BE
* LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
* CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
* SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
* INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN
* CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
* ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
* POSSIBILITY OF SUCH DAMAGE.
*
* Author: Tim Liu (liuhua@orbbec.com)
*/
#ifndef ASTRA_DEVICE_MANAGER_H_
#define ASTRA_DEVICE_MANAGER_H_
#include "astra_camera/astra_device_info.h"
#include <boost/thread/mutex.hpp>
#include <vector>
#include <string>
#include <ostream>
namespace astra_wrapper
{
class AstraDeviceListener;
class AstraDevice;
class AstraDeviceManager
{
public:
AstraDeviceManager();
virtual ~AstraDeviceManager();
static boost::shared_ptr<AstraDeviceManager> getSingelton();
boost::shared_ptr<std::vector<AstraDeviceInfo> > getConnectedDeviceInfos() const;
boost::shared_ptr<std::vector<std::string> > getConnectedDeviceURIs() const;
std::size_t getNumOfConnectedDevices() const;
boost::shared_ptr<AstraDevice> getAnyDevice();
boost::shared_ptr<AstraDevice> getDevice(const std::string& device_URI);
std::string getSerial(const std::string& device_URI) const;
protected:
boost::shared_ptr<AstraDeviceListener> device_listener_;
static boost::shared_ptr<AstraDeviceManager> singelton_;
};
std::ostream& operator <<(std::ostream& stream, const AstraDeviceManager& device_manager);
}
#endif
@@ -0,0 +1,20 @@
#ifndef ASTRA_DEVICE_TYPE_H
#define ASTRA_DEVICE_TYPE_H
#define OB_STEREO_S "Orbbec Canglong"
#define OB_EMBEDDED_S "Astra SL1000S_U3"
#define OB_STEREO_S_U3 "Astra SV1301S_U3"
#define OB_ASTRA_PRO "Orbbec Astra Pro"
typedef enum
{
OB_ASTRA_NO,
OB_STEREO_S_NO,
OB_EMBEDDED_S_NO,
OB_STEREO_S_U3_NO,
OB_ASTRA_PRO_NO
} OB_DEVICE_NO;
bool astraWithUVC(OB_DEVICE_NO id);
#endif
@@ -0,0 +1,224 @@
/*
* Copyright (c) 2013, Willow Garage, Inc.
* Copyright (c) 2016, Orbbec Ltd.
* All rights reserved.
*
* Redistribution and use in source and binary forms, with or without
* modification, are permitted provided that the following conditions are met:
*
* * Redistributions of source code must retain the above copyright
* notice, this list of conditions and the following disclaimer.
* * Redistributions in binary form must reproduce the above copyright
* notice, this list of conditions and the following disclaimer in the
* documentation and/or other materials provided with the distribution.
* * Neither the name of the Willow Garage, Inc. nor the names of its
* contributors may be used to endorse or promote products derived from
* this software without specific prior written permission.
*
* THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS"
* AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
* IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
* ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT OWNER OR CONTRIBUTORS BE
* LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
* CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
* SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
* INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN
* CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
* ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
* POSSIBILITY OF SUCH DAMAGE.
*
* Author: Tim Liu (liuhua@orbbec.com)
*/
#ifndef ASTRA_DRIVER_H
#define ASTRA_DRIVER_H
#include <boost/shared_ptr.hpp>
#include <boost/cstdint.hpp>
#include <boost/bind.hpp>
#include <boost/function.hpp>
#include <sensor_msgs/Image.h>
#include <dynamic_reconfigure/server.h>
#include <astra_camera/AstraConfig.h>
#include <image_transport/image_transport.h>
#include <camera_info_manager/camera_info_manager.h>
#include <string>
#include <vector>
#include "astra_camera/astra_device_manager.h"
#include "astra_camera/astra_device.h"
#include "astra_camera/astra_video_mode.h"
#include "astra_camera/GetSerial.h"
#include "astra_camera/GetDeviceType.h"
#include "astra_camera/GetIRGain.h"
#include "astra_camera/SetIRGain.h"
#include "astra_camera/GetIRExposure.h"
#include "astra_camera/SetIRExposure.h"
#include "astra_camera/SetLaser.h"
#include "astra_camera/SetLDP.h"
#include "astra_camera/ResetIRGain.h"
#include "astra_camera/ResetIRExposure.h"
#include "astra_camera/GetCameraInfo.h"
#include "astra_camera/SetIRFlood.h"
#include "astra_camera/SwitchIRCamera.h"
#include <astra_camera/astra_device_type.h>
#include <ros/ros.h>
namespace astra_wrapper
{
class AstraDriver
{
public:
AstraDriver(ros::NodeHandle& n, ros::NodeHandle& pnh) ;
~AstraDriver();
private:
typedef astra_camera::AstraConfig Config;
typedef dynamic_reconfigure::Server<Config> ReconfigureServer;
void newIRFrameCallback(sensor_msgs::ImagePtr image);
void newColorFrameCallback(sensor_msgs::ImagePtr image);
void newDepthFrameCallback(sensor_msgs::ImagePtr image);
// Methods to get calibration parameters for the various cameras
sensor_msgs::CameraInfoPtr getDefaultCameraInfo(int width, int height, double f) const;
sensor_msgs::CameraInfoPtr getColorCameraInfo(int width, int height, ros::Time time) const;
sensor_msgs::CameraInfoPtr getIRCameraInfo(int width, int height, ros::Time time) const;
sensor_msgs::CameraInfoPtr getDepthCameraInfo(int width, int height, ros::Time time) const;
sensor_msgs::CameraInfoPtr getProjectorCameraInfo(int width, int height, ros::Time time) const;
sensor_msgs::CameraInfo convertAstraCameraInfo(OBCameraParams p, ros::Time time) const;
void readConfigFromParameterServer();
// resolves non-URI device IDs to URIs, e.g. '#1' is resolved to the URI of the first device
std::string resolveDeviceURI(const std::string& device_id);
void initDevice();
void advertiseROSTopics();
void imageConnectCb();
void depthConnectCb();
bool getSerialCb(astra_camera::GetSerialRequest& req, astra_camera::GetSerialResponse& res);
bool getDeviceTypeCb(astra_camera::GetDeviceTypeRequest& req, astra_camera::GetDeviceTypeResponse& res);
bool getIRGainCb(astra_camera::GetIRGainRequest& req, astra_camera::GetIRGainResponse& res);
bool setIRGainCb(astra_camera::SetIRGainRequest& req, astra_camera::SetIRGainResponse& res);
bool getIRExposureCb(astra_camera::GetIRExposureRequest& req, astra_camera::GetIRExposureResponse& res);
bool setIRExposureCb(astra_camera::SetIRExposureRequest& req, astra_camera::SetIRExposureResponse& res);
bool setLaserCb(astra_camera::SetLaserRequest& req, astra_camera::SetLaserResponse& res);
bool resetIRGainCb(astra_camera::ResetIRGainRequest& req, astra_camera::ResetIRGainResponse& res);
bool resetIRExposureCb(astra_camera::ResetIRExposureRequest& req, astra_camera::ResetIRExposureResponse& res);
bool getCameraInfoCb(astra_camera::GetCameraInfoRequest& req, astra_camera::GetCameraInfoResponse& res);
bool setIRFloodCb(astra_camera::SetIRFloodRequest& req, astra_camera::SetIRFloodResponse& res);
bool switchIRCameraCb(astra_camera::SwitchIRCameraRequest& req, astra_camera::SwitchIRCameraResponse& res);
bool setLDPCb(astra_camera::SetLDPRequest& req, astra_camera::SetLDPResponse& res);
void configCb(Config &config, uint32_t level);
void applyConfigToOpenNIDevice();
void genVideoModeTableMap();
int lookupVideoModeFromDynConfig(int mode_nr, AstraVideoMode& video_mode);
sensor_msgs::ImageConstPtr rawToFloatingPointConversion(sensor_msgs::ImageConstPtr raw_image);
void setIRVideoMode(const AstraVideoMode& ir_video_mode);
void setColorVideoMode(const AstraVideoMode& color_video_mode);
void setDepthVideoMode(const AstraVideoMode& depth_video_mode);
ros::NodeHandle& nh_;
ros::NodeHandle& pnh_;
boost::shared_ptr<AstraDeviceManager> device_manager_;
boost::shared_ptr<AstraDevice> device_;
std::string device_id_;
/** \brief get_serial server*/
ros::ServiceServer get_camera_info;
ros::ServiceServer get_serial_server;
ros::ServiceServer get_device_type_server;
ros::ServiceServer get_ir_gain_server;
ros::ServiceServer set_ir_gain_server;
ros::ServiceServer get_ir_exposure_server;
ros::ServiceServer set_ir_exposure_server;
ros::ServiceServer set_ir_flood_server;
ros::ServiceServer set_laser_server;
ros::ServiceServer set_ldp_server;
ros::ServiceServer reset_ir_gain_server;
ros::ServiceServer reset_ir_exposure_server;
ros::ServiceServer switch_ir_camera;
/** \brief reconfigure server*/
boost::shared_ptr<ReconfigureServer> reconfigure_server_;
bool config_init_;
std::set<std::string> alreadyOpen;
boost::mutex connect_mutex_;
// published topics
image_transport::CameraPublisher pub_color_;
image_transport::CameraPublisher pub_depth_;
image_transport::CameraPublisher pub_depth_raw_;
image_transport::CameraPublisher pub_ir_;
ros::Publisher pub_projector_info_;
/** \brief Camera info manager objects. */
boost::shared_ptr<camera_info_manager::CameraInfoManager> color_info_manager_, ir_info_manager_;
AstraVideoMode ir_video_mode_;
AstraVideoMode color_video_mode_;
AstraVideoMode depth_video_mode_;
std::string ir_frame_id_;
std::string color_frame_id_;
std::string depth_frame_id_ ;
std::string color_info_url_, ir_info_url_;
bool color_depth_synchronization_;
bool depth_registration_;
std::map<int, AstraVideoMode> video_modes_lookup_;
// dynamic reconfigure config
double depth_ir_offset_x_;
double depth_ir_offset_y_;
int z_offset_mm_;
double z_scaling_;
ros::Duration ir_time_offset_;
ros::Duration color_time_offset_;
ros::Duration depth_time_offset_;
int data_skip_;
int data_skip_ir_counter_;
int data_skip_color_counter_;
int data_skip_depth_counter_;
bool rgb_preferred_;
bool auto_exposure_;
bool auto_white_balance_;
bool ir_subscribers_;
bool color_subscribers_;
bool depth_subscribers_;
bool depth_raw_subscribers_;
bool projector_info_subscribers_;
bool use_device_time_;
Config old_config_;
int uvc_flip_;
};
}
#endif
@@ -0,0 +1,91 @@
/*
* Software License Agreement (BSD License)
*
* Copyright (c) 2011, Willow Garage, Inc.
* Copyright (c) 2016, Orbbec Ltd.
* Tim Liu <liuhua@orbbec.com>
*
* All rights reserved.
*
* Redistribution and use in source and binary forms, with or without
* modification, are permitted provided that the following conditions
* are met:
*
* * Redistributions of source code must retain the above copyright
* notice, this list of conditions and the following disclaimer.
* * Redistributions in binary form must reproduce the above
* copyright notice, this list of conditions and the following
* disclaimer in the documentation and/or other materials provided
* with the distribution.
* * Neither the name of Willow Garage, Inc. nor the names of its
* contributors may be used to endorse or promote products derived
* from this software without specific prior written permission.
*
* THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
* "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT
* LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS
* FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE
* COPYRIGHT OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT,
* INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING,
* BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES;
* LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER
* CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT
* LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN
* ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
* POSSIBILITY OF SUCH DAMAGE.
*
*/
#ifndef __ASTRA_EXCEPTION__
#define __ASTRA_EXCEPTION__
#include <cstdarg>
#include <cstdio>
#include <exception>
#include <string>
#if defined _WIN32 && defined _MSC_VER
# define __PRETTY_FUNCTION__ __FUNCTION__
#endif
#define THROW_OPENNI_EXCEPTION(format,...) throwOpenNIException( __PRETTY_FUNCTION__, __FILE__, __LINE__, format , ##__VA_ARGS__ )
namespace astra_wrapper
{
/**
* @brief General exception class
* @author Suat Gedikli
* @date 02.january 2011
*/
class AstraException : public std::exception
{
public:
AstraException(const std::string& function_name,
const std::string& file_name,
unsigned line_number,
const std::string& message);
virtual ~AstraException() throw();
AstraException & operator=(const AstraException& exception);
virtual const char* what() const throw();
const std::string& getFunctionName() const;
const std::string& getFileName() const;
unsigned getLineNumber() const;
protected:
std::string function_name_;
std::string file_name_;
unsigned line_number_;
std::string message_;
std::string message_long_;
};
inline void throwOpenNIException(const char* function, const char* file, unsigned line, const char* format, ...)
{
static char msg[1024];
va_list args;
va_start(args, format);
vsprintf(msg, format, args);
throw AstraException(function, file, line, msg);
}
} // namespace astra_camera
#endif
@@ -0,0 +1,79 @@
/*
* Copyright (c) 2013, Willow Garage, Inc.
* Copyright (c) 2016, Orbbec Ltd.
* All rights reserved.
*
* Redistribution and use in source and binary forms, with or without
* modification, are permitted provided that the following conditions are met:
*
* * Redistributions of source code must retain the above copyright
* notice, this list of conditions and the following disclaimer.
* * Redistributions in binary form must reproduce the above copyright
* notice, this list of conditions and the following disclaimer in the
* documentation and/or other materials provided with the distribution.
* * Neither the name of the Willow Garage, Inc. nor the names of its
* contributors may be used to endorse or promote products derived from
* this software without specific prior written permission.
*
* THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS"
* AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
* IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
* ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT OWNER OR CONTRIBUTORS BE
* LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
* CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
* SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
* INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN
* CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
* ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
* POSSIBILITY OF SUCH DAMAGE.
*
* Author: Tim Liu (liuhua@orbbec.com)
*/
#ifndef ASTRA_FRAME_LISTENER_H_
#define ASTRA_FRAME_LISTENER_H_
#include "astra_camera/astra_device.h"
#include <sensor_msgs/Image.h>
#include <vector>
#include "openni2/OpenNI.h"
namespace astra_wrapper
{
class AstraTimerFilter;
class AstraFrameListener : public openni::VideoStream::NewFrameListener
{
public:
AstraFrameListener();
virtual ~AstraFrameListener()
{ };
void onNewFrame(openni::VideoStream& stream);
void setCallback(FrameCallbackFunction& callback)
{
callback_ = callback;
}
void setUseDeviceTimer(bool enable);
private:
openni::VideoFrameRef m_frame;
FrameCallbackFunction callback_;
bool user_device_timer_;
boost::shared_ptr<AstraTimerFilter> timer_filter_;
double prev_time_stamp_;
};
}
#endif
@@ -0,0 +1,64 @@
/*
* Copyright (c) 2013, Willow Garage, Inc.
* Copyright (c) 2016, Orbbec Ltd.
* All rights reserved.
*
* Redistribution and use in source and binary forms, with or without
* modification, are permitted provided that the following conditions are met:
*
* * Redistributions of source code must retain the above copyright
* notice, this list of conditions and the following disclaimer.
* * Redistributions in binary form must reproduce the above copyright
* notice, this list of conditions and the following disclaimer in the
* documentation and/or other materials provided with the distribution.
* * Neither the name of the Willow Garage, Inc. nor the names of its
* contributors may be used to endorse or promote products derived from
* this software without specific prior written permission.
*
* THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS"
* AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
* IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
* ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT OWNER OR CONTRIBUTORS BE
* LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
* CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
* SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
* INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN
* CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
* ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
* POSSIBILITY OF SUCH DAMAGE.
*
* Author: Tim Liu (liuhua@orbbec.com)
*/
#ifndef ASTRA_TIME_FILTER_H_
#define ASTRA_TIME_FILTER_H_
#include <deque>
#include "openni2/OpenNI.h"
namespace astra_wrapper
{
class AstraTimerFilter
{
public:
AstraTimerFilter(std::size_t filter_len);
virtual ~AstraTimerFilter();
void addSample(double sample);
double getMedian();
double getMovingAvg();
void clear();
private:
std::size_t filter_len_;
std::deque<double> buffer_;
};
}
#endif
@@ -0,0 +1,74 @@
/*
* Copyright (c) 2013, Willow Garage, Inc.
* Copyright (c) 2016, Orbbec Ltd.
* All rights reserved.
*
* Redistribution and use in source and binary forms, with or without
* modification, are permitted provided that the following conditions are met:
*
* * Redistributions of source code must retain the above copyright
* notice, this list of conditions and the following disclaimer.
* * Redistributions in binary form must reproduce the above copyright
* notice, this list of conditions and the following disclaimer in the
* documentation and/or other materials provided with the distribution.
* * Neither the name of the Willow Garage, Inc. nor the names of its
* contributors may be used to endorse or promote products derived from
* this software without specific prior written permission.
*
* THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS"
* AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
* IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
* ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT OWNER OR CONTRIBUTORS BE
* LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
* CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
* SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
* INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN
* CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
* ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
* POSSIBILITY OF SUCH DAMAGE.
*
* Author: Tim Liu (liuhua@orbbec.com)
*/
#ifndef ASTRA_VIDEO_MODE_H_
#define ASTRA_VIDEO_MODE_H_
#include <cstddef>
#include <ostream>
namespace astra_wrapper
{
// copied from OniEnums.h
typedef enum
{
// Depth
PIXEL_FORMAT_DEPTH_1_MM = 100,
PIXEL_FORMAT_DEPTH_100_UM = 101,
PIXEL_FORMAT_SHIFT_9_2 = 102,
PIXEL_FORMAT_SHIFT_9_3 = 103,
// Color
PIXEL_FORMAT_RGB888 = 200,
PIXEL_FORMAT_YUV422 = 201,
PIXEL_FORMAT_GRAY8 = 202,
PIXEL_FORMAT_GRAY16 = 203,
PIXEL_FORMAT_JPEG = 204,
} PixelFormat;
struct AstraVideoMode
{
std::size_t x_resolution_;
std::size_t y_resolution_;
double frame_rate_;
PixelFormat pixel_format_;
};
std::ostream& operator << (std::ostream& stream, const AstraVideoMode& video_mode);
bool operator==(const AstraVideoMode& video_mode_a, const AstraVideoMode& video_mode_b);
bool operator!=(const AstraVideoMode& video_mode_a, const AstraVideoMode& video_mode_b);
}
#endif
@@ -0,0 +1,113 @@
#pragma once
#include <libuvc/libuvc.h>
#include <ros/ros.h>
#include <image_transport/image_transport.h>
#include <image_transport/camera_publisher.h>
#include <dynamic_reconfigure/server.h>
#include <camera_info_manager/camera_info_manager.h>
#include <boost/thread/mutex.hpp>
#include <sensor_msgs/CameraInfo.h>
#include <astra_camera/GetUVCExposure.h>
#include <astra_camera/SetUVCExposure.h>
#include <astra_camera/GetUVCGain.h>
#include <astra_camera/SetUVCGain.h>
#include <astra_camera/GetUVCWhiteBalance.h>
#include <astra_camera/SetUVCWhiteBalance.h>
#include <astra_camera/astra_device_type.h>
#include <astra_camera/UVCCameraConfig.h>
#include <string>
namespace libuvc_camera {
class CameraDriver {
public:
CameraDriver(ros::NodeHandle nh, ros::NodeHandle priv_nh);
~CameraDriver();
bool Start();
void Stop();
private:
enum State {
kInitial = 0,
kStopped = 1,
kRunning = 2,
};
// Flags controlling whether the sensor needs to be stopped (or reopened) when changing settings
static const int kReconfigureClose = 3; // Need to close and reopen sensor to change this setting
static const int kReconfigureStop = 1; // Need to stop the stream before changing this setting
static const int kReconfigureRunning = 0; // We can change this setting without stopping the stream
void OpenCamera(UVCCameraConfig &new_config);
void CloseCamera();
// Accept a reconfigure request from a client
void ReconfigureCallback(UVCCameraConfig &config, uint32_t level);
enum uvc_frame_format GetVideoMode(std::string vmode);
// Accept changes in values of automatically updated controls
void AutoControlsCallback(enum uvc_status_class status_class,
int event,
int selector,
enum uvc_status_attribute status_attribute,
void *data, size_t data_len);
static void AutoControlsCallbackAdapter(enum uvc_status_class status_class,
int event,
int selector,
enum uvc_status_attribute status_attribute,
void *data, size_t data_len,
void *ptr);
// Accept a new image frame from the camera
void ImageCallback(uvc_frame_t *frame);
static void ImageCallbackAdapter(uvc_frame_t *frame, void *ptr);
bool getUVCExposureCb(astra_camera::GetUVCExposureRequest& req, astra_camera::GetUVCExposureResponse& res);
bool setUVCExposureCb(astra_camera::SetUVCExposureRequest& req, astra_camera::SetUVCExposureResponse& res);
bool getUVCGainCb(astra_camera::GetUVCGainRequest& req, astra_camera::GetUVCGainResponse& res);
bool setUVCGainCb(astra_camera::SetUVCGainRequest& req, astra_camera::SetUVCGainResponse& res);
bool getUVCWhiteBalanceCb(astra_camera::GetUVCWhiteBalanceRequest& req, astra_camera::GetUVCWhiteBalanceResponse& res);
bool setUVCWhiteBalanceCb(astra_camera::SetUVCWhiteBalanceRequest& req, astra_camera::SetUVCWhiteBalanceResponse& res);
ros::NodeHandle nh_, priv_nh_;
State state_;
boost::recursive_mutex mutex_;
uvc_context_t *ctx_;
uvc_device_t *dev_;
uvc_device_handle_t *devh_;
uvc_frame_t *rgb_frame_;
image_transport::ImageTransport it_;
image_transport::CameraPublisher cam_pub_;
dynamic_reconfigure::Server<UVCCameraConfig> config_server_;
UVCCameraConfig config_;
bool config_changed_;
camera_info_manager::CameraInfoManager cinfo_manager_;
std::string ns;
std::string ns_no_slash;
ros::ServiceServer get_uvc_exposure_server;
ros::ServiceServer set_uvc_exposure_server;
ros::ServiceServer get_uvc_gain_server;
ros::ServiceServer set_uvc_gain_server;
ros::ServiceServer get_uvc_white_balance_server;
ros::ServiceServer set_uvc_white_balance_server;
ros::ServiceClient device_type_client;
ros::ServiceClient camera_info_client;
bool device_type_init_;
bool camera_info_init_;
std::string device_type_;
sensor_msgs::CameraInfo camera_info_;
int uvc_flip_;
OB_DEVICE_NO device_type_no_;
bool camera_info_valid_;
};
};
@@ -0,0 +1,43 @@
/*****************************************************************************
* *
* OpenNI 2.x Alpha *
* Copyright (C) 2012 PrimeSense Ltd. *
* *
* This file is part of OpenNI. *
* *
* Licensed under the Apache License, Version 2.0 (the "License"); *
* you may not use this file except in compliance with the License. *
* You may obtain a copy of the License at *
* *
* http://www.apache.org/licenses/LICENSE-2.0 *
* *
* Unless required by applicable law or agreed to in writing, software *
* distributed under the License is distributed on an "AS IS" BASIS, *
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. *
* See the License for the specific language governing permissions and *
* limitations under the License. *
* *
*****************************************************************************/
#ifndef ONIPLATFORMANDROID_ARM_H
#define ONIPLATFORMANDROID_ARM_H
// Start with Linux-x86, and override what's different
#include "../Linux-x86/OniPlatformLinux-x86.h"
//---------------------------------------------------------------------------
// Platform Basic Definition
//---------------------------------------------------------------------------
#undef ONI_PLATFORM
#undef ONI_PLATFORM_STRING
#define ONI_PLATFORM ONI_PLATFORM_ANDROID_ARM
#define ONI_PLATFORM_STRING "Android-Arm"
#ifdef HAVE_ANDROID_OS
#define ONI_PLATFORM_ANDROID_OS
#undef ONI_PLATFORM_STRING
#define ONI_PLATFORM_STRING "AndroidOS-Arm"
#endif
#endif // ONIPLATFORMANDROID_ARM_H
@@ -0,0 +1,393 @@
/*****************************************************************************
* *
* OpenNI 2.x Alpha *
* Copyright (C) 2012 PrimeSense Ltd. *
* *
* This file is part of OpenNI. *
* *
* Licensed under the Apache License, Version 2.0 (the "License"); *
* you may not use this file except in compliance with the License. *
* You may obtain a copy of the License at *
* *
* http://www.apache.org/licenses/LICENSE-2.0 *
* *
* Unless required by applicable law or agreed to in writing, software *
* distributed under the License is distributed on an "AS IS" BASIS, *
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. *
* See the License for the specific language governing permissions and *
* limitations under the License. *
* *
*****************************************************************************/
#ifndef ONIDRIVERAPI_H
#define ONIDRIVERAPI_H
#include "OniPlatform.h"
#include "OniCTypes.h"
#include "OniCProperties.h"
#include "OniDriverTypes.h"
#include <stdarg.h>
namespace oni { namespace driver {
class DeviceBase;
class StreamBase;
typedef void (ONI_CALLBACK_TYPE* DeviceConnectedCallback)(const OniDeviceInfo*, void* pCookie);
typedef void (ONI_CALLBACK_TYPE* DeviceDisconnectedCallback)(const OniDeviceInfo*, void* pCookie);
typedef void (ONI_CALLBACK_TYPE* DeviceStateChangedCallback)(const OniDeviceInfo* deviceId, int errorState, void* pCookie);
typedef void (ONI_CALLBACK_TYPE* NewFrameCallback)(StreamBase* streamId, OniFrame*, void* pCookie);
typedef void (ONI_CALLBACK_TYPE* PropertyChangedCallback)(void* sender, int propertyId, const void* data, int dataSize, void* pCookie);
class StreamServices : public OniStreamServices
{
public:
int getDefaultRequiredFrameSize()
{
return OniStreamServices::getDefaultRequiredFrameSize(streamServices);
}
OniFrame* acquireFrame()
{
return OniStreamServices::acquireFrame(streamServices);
}
void addFrameRef(OniFrame* pFrame)
{
OniStreamServices::addFrameRef(streamServices, pFrame);
}
void releaseFrame(OniFrame* pFrame)
{
OniStreamServices::releaseFrame(streamServices, pFrame);
}
};
class StreamBase
{
public:
StreamBase() : m_newFrameCallback(NULL), m_propertyChangedCallback(NULL) {}
virtual ~StreamBase() {}
virtual void setServices(StreamServices* pStreamServices) { m_pServices = pStreamServices; }
virtual OniStatus setProperty(int /*propertyId*/, const void* /*data*/, int /*dataSize*/) {return ONI_STATUS_NOT_IMPLEMENTED;}
virtual OniStatus getProperty(int /*propertyId*/, void* /*data*/, int* /*pDataSize*/) {return ONI_STATUS_NOT_IMPLEMENTED;}
virtual OniBool isPropertySupported(int /*propertyId*/) {return FALSE;}
virtual OniStatus invoke(int /*commandId*/, void* /*data*/, int /*dataSize*/) {return ONI_STATUS_NOT_IMPLEMENTED;}
virtual OniBool isCommandSupported(int /*commandId*/) {return FALSE;}
virtual int getRequiredFrameSize() { return getServices().getDefaultRequiredFrameSize(); }
virtual OniStatus start() = 0;
virtual void stop() = 0;
virtual void setNewFrameCallback(NewFrameCallback handler, void* pCookie) { m_newFrameCallback = handler; m_newFrameCallbackCookie = pCookie; }
virtual void setPropertyChangedCallback(PropertyChangedCallback handler, void* pCookie) { m_propertyChangedCallback = handler; m_propertyChangedCookie = pCookie; }
virtual void notifyAllProperties() { return; }
virtual OniStatus convertDepthToColorCoordinates(StreamBase* /*colorStream*/, int /*depthX*/, int /*depthY*/, OniDepthPixel /*depthZ*/, int* /*pColorX*/, int* /*pColorY*/) { return ONI_STATUS_NOT_SUPPORTED; }
virtual OniStatus convertC2DCoordinates(int /*depthX*/, int /*depthY*/, OniDepthPixel /*depthZ*/, int* /*pColorX*/, int* /*pColorY*/) { return ONI_STATUS_NOT_SUPPORTED; }
virtual OniStatus convertD2CCoordinates(int /*depthX*/, int /*depthY*/, OniDepthPixel /*depthZ*/, int* /*pColorX*/, int* /*pColorY*/) { return ONI_STATUS_NOT_SUPPORTED; }
protected:
void raiseNewFrame(OniFrame* pFrame) { (*m_newFrameCallback)(this, pFrame, m_newFrameCallbackCookie); }
void raisePropertyChanged(int propertyId, const void* data, int dataSize) { (*m_propertyChangedCallback)(this, propertyId, data, dataSize, m_propertyChangedCookie); }
StreamServices& getServices() { return *m_pServices; }
private:
StreamServices* m_pServices;
NewFrameCallback m_newFrameCallback;
void* m_newFrameCallbackCookie;
PropertyChangedCallback m_propertyChangedCallback;
void* m_propertyChangedCookie;
};
class DeviceBase
{
public:
DeviceBase() {}
virtual ~DeviceBase() {}
virtual OniStatus getSensorInfoList(OniSensorInfo** pSensorInfos, int* numSensors) = 0;
virtual StreamBase* createStream(OniSensorType) = 0;
virtual void destroyStream(StreamBase* pStream) = 0;
virtual OniStatus setProperty(int /*propertyId*/, const void* /*data*/, int /*dataSize*/) {return ONI_STATUS_NOT_IMPLEMENTED;}
virtual OniStatus getProperty(int /*propertyId*/, void* /*data*/, int* /*pDataSize*/) {return ONI_STATUS_NOT_IMPLEMENTED;}
virtual OniBool isPropertySupported(int /*propertyId*/) {return FALSE;}
virtual OniStatus invoke(int /*commandId*/, void* /*data*/, int /*dataSize*/) {return ONI_STATUS_NOT_IMPLEMENTED;}
virtual OniBool isCommandSupported(int /*commandId*/) {return FALSE;}
virtual OniStatus tryManualTrigger() {return ONI_STATUS_OK;}
virtual void setPropertyChangedCallback(PropertyChangedCallback handler, void* pCookie) { m_propertyChangedCallback = handler; m_propertyChangedCookie = pCookie; }
virtual void notifyAllProperties() { return; }
virtual OniBool isImageRegistrationModeSupported(OniImageRegistrationMode mode) { return (mode == ONI_IMAGE_REGISTRATION_OFF); }
protected:
void raisePropertyChanged(int propertyId, const void* data, int dataSize) { (*m_propertyChangedCallback)(this, propertyId, data, dataSize, m_propertyChangedCookie); }
private:
PropertyChangedCallback m_propertyChangedCallback;
void* m_propertyChangedCookie;
};
class DriverServices
{
public:
DriverServices(OniDriverServices* pDriverServices) : m_pDriverServices(pDriverServices) {}
void errorLoggerAppend(const char* format, ...)
{
va_list args;
va_start(args, format);
m_pDriverServices->errorLoggerAppend(m_pDriverServices->driverServices, format, args);
va_end(args);
}
void errorLoggerClear()
{
m_pDriverServices->errorLoggerClear(m_pDriverServices->driverServices);
}
void log(int severity, const char* file, int line, const char* mask, const char* message)
{
m_pDriverServices->log(m_pDriverServices->driverServices, severity, file, line, mask, message);
}
private:
OniDriverServices* m_pDriverServices;
};
class DriverBase
{
public:
DriverBase(OniDriverServices* pDriverServices) : m_services(pDriverServices)
{}
virtual ~DriverBase() {}
virtual OniStatus initialize(DeviceConnectedCallback connectedCallback, DeviceDisconnectedCallback disconnectedCallback, DeviceStateChangedCallback deviceStateChangedCallback, void* pCookie)
{
m_deviceConnectedEvent = connectedCallback;
m_deviceDisconnectedEvent = disconnectedCallback;
m_deviceStateChangedEvent = deviceStateChangedCallback;
m_pCookie = pCookie;
return ONI_STATUS_OK;
}
virtual DeviceBase* deviceOpen(const char* uri, const char* mode) = 0;
virtual void deviceClose(DeviceBase* pDevice) = 0;
virtual void shutdown() = 0;
virtual OniStatus tryDevice(const char* /*uri*/) { return ONI_STATUS_ERROR;}
virtual void* enableFrameSync(StreamBase** /*pStreams*/, int /*streamCount*/) { return NULL; }
virtual void disableFrameSync(void* /*frameSyncGroup*/) {}
protected:
void deviceConnected(const OniDeviceInfo* pInfo) { (m_deviceConnectedEvent)(pInfo, m_pCookie); }
void deviceDisconnected(const OniDeviceInfo* pInfo) { (m_deviceDisconnectedEvent)(pInfo, m_pCookie); }
void deviceStateChanged(const OniDeviceInfo* pInfo, int errorState) { (m_deviceStateChangedEvent)(pInfo, errorState, m_pCookie); }
DriverServices& getServices() { return m_services; }
private:
DeviceConnectedCallback m_deviceConnectedEvent;
DeviceDisconnectedCallback m_deviceDisconnectedEvent;
DeviceStateChangedCallback m_deviceStateChangedEvent;
void* m_pCookie;
DriverServices m_services;
};
}} // oni::driver
#define ONI_EXPORT_DRIVER(DriverClass) \
\
oni::driver::DriverBase* g_pDriver = NULL; \
\
/* As Driver */ \
ONI_C_API_EXPORT void oniDriverCreate(OniDriverServices* driverServices) { \
g_pDriver = XN_NEW(DriverClass, driverServices); \
} \
ONI_C_API_EXPORT void oniDriverDestroy() \
{ \
g_pDriver->shutdown(); \
XN_DELETE(g_pDriver); g_pDriver = NULL; \
} \
ONI_C_API_EXPORT OniStatus oniDriverInitialize(oni::driver::DeviceConnectedCallback deviceConnectedCallback, \
oni::driver::DeviceDisconnectedCallback deviceDisconnectedCallback, \
oni::driver::DeviceStateChangedCallback deviceStateChangedCallback, \
void* pCookie) \
{ \
return g_pDriver->initialize(deviceConnectedCallback, deviceDisconnectedCallback, deviceStateChangedCallback, pCookie); \
} \
\
ONI_C_API_EXPORT OniStatus oniDriverTryDevice(const char* uri) \
{ \
return g_pDriver->tryDevice(uri); \
} \
\
/* As Device */ \
ONI_C_API_EXPORT oni::driver::DeviceBase* oniDriverDeviceOpen(const char* uri, const char* mode) \
{ \
return g_pDriver->deviceOpen(uri, mode); \
} \
ONI_C_API_EXPORT void oniDriverDeviceClose(oni::driver::DeviceBase* pDevice) \
{ \
g_pDriver->deviceClose(pDevice); \
} \
\
ONI_C_API_EXPORT OniStatus oniDriverDeviceGetSensorInfoList(oni::driver::DeviceBase* pDevice, OniSensorInfo** pSensorInfos, \
int* numSensors) \
{ \
return pDevice->getSensorInfoList(pSensorInfos, numSensors); \
} \
\
ONI_C_API_EXPORT oni::driver::StreamBase* oniDriverDeviceCreateStream(oni::driver::DeviceBase* pDevice, \
OniSensorType sensorType) \
{ \
return pDevice->createStream(sensorType); \
} \
\
ONI_C_API_EXPORT void oniDriverDeviceDestroyStream(oni::driver::DeviceBase* pDevice, oni::driver::StreamBase* pStream) \
{ \
return pDevice->destroyStream(pStream); \
} \
\
ONI_C_API_EXPORT OniStatus oniDriverDeviceSetProperty(oni::driver::DeviceBase* pDevice, int propertyId, \
const void* data, int dataSize) \
{ \
return pDevice->setProperty(propertyId, data, dataSize); \
} \
ONI_C_API_EXPORT OniStatus oniDriverDeviceGetProperty(oni::driver::DeviceBase* pDevice, int propertyId, \
void* data, int* pDataSize) \
{ \
return pDevice->getProperty(propertyId, data, pDataSize); \
} \
ONI_C_API_EXPORT OniBool oniDriverDeviceIsPropertySupported(oni::driver::DeviceBase* pDevice, int propertyId) \
{ \
return pDevice->isPropertySupported(propertyId); \
} \
ONI_C_API_EXPORT void oniDriverDeviceSetPropertyChangedCallback(oni::driver::DeviceBase* pDevice, \
oni::driver::PropertyChangedCallback handler, void* pCookie) \
{ \
pDevice->setPropertyChangedCallback(handler, pCookie); \
} \
ONI_C_API_EXPORT void oniDriverDeviceNotifyAllProperties(oni::driver::DeviceBase* pDevice) \
{ \
pDevice->notifyAllProperties(); \
} \
ONI_C_API_EXPORT OniStatus oniDriverDeviceInvoke(oni::driver::DeviceBase* pDevice, int commandId, \
void* data, int dataSize) \
{ \
return pDevice->invoke(commandId, data, dataSize); \
} \
ONI_C_API_EXPORT OniBool oniDriverDeviceIsCommandSupported(oni::driver::DeviceBase* pDevice, int commandId) \
{ \
return pDevice->isCommandSupported(commandId); \
} \
ONI_C_API_EXPORT OniStatus oniDriverDeviceTryManualTrigger(oni::driver::DeviceBase* pDevice) \
{ \
return pDevice->tryManualTrigger(); \
} \
ONI_C_API_EXPORT OniBool oniDriverDeviceIsImageRegistrationModeSupported(oni::driver::DeviceBase* pDevice, \
OniImageRegistrationMode mode) \
{ \
return pDevice->isImageRegistrationModeSupported(mode); \
} \
\
/* As Stream */ \
ONI_C_API_EXPORT void oniDriverStreamSetServices(oni::driver::StreamBase* pStream, OniStreamServices* pServices) \
{ \
pStream->setServices((oni::driver::StreamServices*)pServices); \
} \
\
ONI_C_API_EXPORT OniStatus oniDriverStreamSetProperty(oni::driver::StreamBase* pStream, int propertyId, \
const void* data, int dataSize) \
{ \
return pStream->setProperty(propertyId, data, dataSize); \
} \
ONI_C_API_EXPORT OniStatus oniDriverStreamGetProperty(oni::driver::StreamBase* pStream, int propertyId, void* data, \
int* pDataSize) \
{ \
return pStream->getProperty(propertyId, data, pDataSize); \
} \
ONI_C_API_EXPORT OniBool oniDriverStreamIsPropertySupported(oni::driver::StreamBase* pStream, int propertyId) \
{ \
return pStream->isPropertySupported(propertyId); \
} \
ONI_C_API_EXPORT void oniDriverStreamSetPropertyChangedCallback(oni::driver::StreamBase* pStream, \
oni::driver::PropertyChangedCallback handler, void* pCookie) \
{ \
pStream->setPropertyChangedCallback(handler, pCookie); \
} \
ONI_C_API_EXPORT void oniDriverStreamNotifyAllProperties(oni::driver::StreamBase* pStream) \
{ \
pStream->notifyAllProperties(); \
} \
ONI_C_API_EXPORT OniStatus oniDriverStreamInvoke(oni::driver::StreamBase* pStream, int commandId, \
void* data, int dataSize) \
{ \
return pStream->invoke(commandId, data, dataSize); \
} \
ONI_C_API_EXPORT OniBool oniDriverStreamIsCommandSupported(oni::driver::StreamBase* pStream, int commandId) \
{ \
return pStream->isCommandSupported(commandId); \
} \
\
ONI_C_API_EXPORT OniStatus oniDriverStreamStart(oni::driver::StreamBase* pStream) \
{ \
return pStream->start(); \
} \
ONI_C_API_EXPORT void oniDriverStreamStop(oni::driver::StreamBase* pStream) \
{ \
pStream->stop(); \
} \
\
ONI_C_API_EXPORT int oniDriverStreamGetRequiredFrameSize(oni::driver::StreamBase* pStream) \
{ \
return pStream->getRequiredFrameSize(); \
} \
\
ONI_C_API_EXPORT void oniDriverStreamSetNewFrameCallback(oni::driver::StreamBase* pStream, \
oni::driver::NewFrameCallback handler, void* pCookie) \
{ \
pStream->setNewFrameCallback(handler, pCookie); \
} \
\
ONI_C_API_EXPORT OniStatus oniDriverStreamConvertDepthToColorCoordinates(oni::driver::StreamBase* pDepthStream, \
oni::driver::StreamBase* pColorStream, int depthX, int depthY, OniDepthPixel depthZ, int* pColorX, int* pColorY) \
{ \
return pDepthStream->convertDepthToColorCoordinates(pColorStream, depthX, depthY, depthZ, pColorX, pColorY); \
} \
\
ONI_C_API_EXPORT OniStatus oniDriverStreamConvertC2DCoordinates(oni::driver::StreamBase* pDepthStream, \
int colorX, int colorY, OniDepthPixel depthZ, int* pDepthX, int* pDepthY) \
{ \
return pDepthStream->convertC2DCoordinates(colorX, colorY, depthZ, pDepthX, pDepthY); \
} \
\
ONI_C_API_EXPORT OniStatus oniDriverStreamConvertD2CCoordinates(oni::driver::StreamBase* pDepthStream, \
int colorX, int colorY, OniDepthPixel depthZ, int* pDepthX, int* pDepthY) \
{ \
return pDepthStream->convertD2CCoordinates(colorX, colorY, depthZ, pDepthX, pDepthY); \
} \
\
ONI_C_API_EXPORT void* oniDriverEnableFrameSync(oni::driver::StreamBase** pStreams, int streamCount) \
{ \
return g_pDriver->enableFrameSync(pStreams, streamCount); \
} \
\
ONI_C_API_EXPORT void oniDriverDisableFrameSync(void* frameSyncGroup) \
{ \
return g_pDriver->disableFrameSync(frameSyncGroup); \
} \
#endif // ONIDRIVERAPI_H
@@ -0,0 +1,54 @@
/*****************************************************************************
* *
* OpenNI 2.x Alpha *
* Copyright (C) 2012 PrimeSense Ltd. *
* *
* This file is part of OpenNI. *
* *
* Licensed under the Apache License, Version 2.0 (the "License"); *
* you may not use this file except in compliance with the License. *
* You may obtain a copy of the License at *
* *
* http://www.apache.org/licenses/LICENSE-2.0 *
* *
* Unless required by applicable law or agreed to in writing, software *
* distributed under the License is distributed on an "AS IS" BASIS, *
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. *
* See the License for the specific language governing permissions and *
* limitations under the License. *
* *
*****************************************************************************/
#ifndef ONIDRIVERTYPES_H
#define ONIDRIVERTYPES_H
#include <OniCTypes.h>
#include <stdarg.h>
#define ONI_STREAM_PROPERTY_PRIVATE_BASE XN_MAX_UINT16
typedef struct
{
int dataSize;
void* data;
} OniGeneralBuffer;
/////// DriverServices
struct OniDriverServices
{
void* driverServices;
void (ONI_CALLBACK_TYPE* errorLoggerAppend)(void* driverServices, const char* format, va_list args);
void (ONI_CALLBACK_TYPE* errorLoggerClear)(void* driverServices);
void (ONI_CALLBACK_TYPE* log)(void* driverServices, int severity, const char* file, int line, const char* mask, const char* message);
};
struct OniStreamServices
{
void* streamServices;
int (ONI_CALLBACK_TYPE* getDefaultRequiredFrameSize)(void* streamServices);
OniFrame* (ONI_CALLBACK_TYPE* acquireFrame)(void* streamServices); // returns a frame with size corresponding to getRequiredFrameSize()
void (ONI_CALLBACK_TYPE* addFrameRef)(void* streamServices, OniFrame* pframe);
void (ONI_CALLBACK_TYPE* releaseFrame)(void* streamServices, OniFrame* pframe);
};
#endif // ONIDRIVERTYPES_H
@@ -0,0 +1,104 @@
/*****************************************************************************
* *
* OpenNI 2.x Alpha *
* Copyright (C) 2012 PrimeSense Ltd. *
* *
* This file is part of OpenNI. *
* *
* Licensed under the Apache License, Version 2.0 (the "License"); *
* you may not use this file except in compliance with the License. *
* You may obtain a copy of the License at *
* *
* http://www.apache.org/licenses/LICENSE-2.0 *
* *
* Unless required by applicable law or agreed to in writing, software *
* distributed under the License is distributed on an "AS IS" BASIS, *
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. *
* See the License for the specific language governing permissions and *
* limitations under the License. *
* *
*****************************************************************************/
#ifndef KINECTPROPERTIES_H
#define KINECTPROPERTIES_H
#include <OniCTypes.h>
/*
* private properties of Microsoft Kinect devices.
*
* @remarks
* properties structure is 0x045eXXYY (045e = Microsoft's USB vendor ID)
* where XX is range and YY is code.
* range values:
* 00 - common stream properties
* 10 - depth stream properties
* 20 - color stream properties
* E0 - device commands
* F0 - device properties
*/
enum
{
KINECT_PROPERTY_BASE = 0x045e0000,
/*******************************************************************/
/* Common stream properties (00-) */
/*******************************************************************/
/*******************************************************************/
/* Depth stream properties (10-) */
/*******************************************************************/
/** OniBool, set and get.
* Maps to Near Mode in Kinect SDK.
* Also maps to XN_STREAM_PROPERTY_CLOSE_RANGE in PS1080.h.
*/
KINECT_DEPTH_PROPERTY_CLOSE_RANGE = KINECT_PROPERTY_BASE + 0x1001,
/*******************************************************************/
/* Color stream properties (20-) */
/*******************************************************************/
/*******************************************************************/
/* Device commands (E0-) */
/*******************************************************************/
/*******************************************************************/
/* Device properties (F0-) */
/*******************************************************************/
/* 3D sensing properties (F0-) */
/** OniBool, set and get.
* Maps to !NuiGetForceInfraredEmitterOff in Kinect SDK.
* Also maps to XN_MODULE_PROPERTY_EMITTER_STATE.
*/
KINECT_DEVICE_PROPERTY_EMITTER_STATE = KINECT_PROPERTY_BASE + 0xF001,
/* Non- 3D sensing bonus properties (F8) */
/** long, set and get.
* Maps to NuiCameraElevationGetAngle and NuiCameraElevationSetAngle in Kinect SDK.
*/
KINECT_DEVICE_PROPERTY_CAMERA_ELEVATION = KINECT_PROPERTY_BASE + 0xF801,
/** KinectVector3f, get only.
* Maps to NuiAccelerometerGetCurrentReading.
*/
KINECT_DEVICE_PROPERTY_ACCELEROMETER = KINECT_PROPERTY_BASE + 0xF802,
/** String, get only.
* Maps to NuiAudioArrayId.
* Useful to find the mic array on the sensor when developing audio-enabled applications.
*/
KINECT_DEVICE_PROPERTY_AUDIO_ARRAY_ID = KINECT_PROPERTY_BASE + 0xF803,
};
typedef struct
{
float x;
float y;
float z;
} KinectVector3f;
#endif // KINECTPROPERTIES_H
@@ -0,0 +1,36 @@
/*****************************************************************************
* *
* OpenNI 2.x Alpha *
* Copyright (C) 2012 PrimeSense Ltd. *
* *
* This file is part of OpenNI. *
* *
* Licensed under the Apache License, Version 2.0 (the "License"); *
* you may not use this file except in compliance with the License. *
* You may obtain a copy of the License at *
* *
* http://www.apache.org/licenses/LICENSE-2.0 *
* *
* Unless required by applicable law or agreed to in writing, software *
* distributed under the License is distributed on an "AS IS" BASIS, *
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. *
* See the License for the specific language governing permissions and *
* limitations under the License. *
* *
*****************************************************************************/
#ifndef ONIPLATFORMLINUX_ARM_H
#define ONIPLATFORMLINUX_ARM_H
// Start with Linux-x86, and override what's different
#include "../Linux-x86/OniPlatformLinux-x86.h"
//---------------------------------------------------------------------------
// Platform Basic Definition
//---------------------------------------------------------------------------
#undef ONI_PLATFORM
#undef ONI_PLATFORM_STRING
#define ONI_PLATFORM ONI_PLATFORM_LINUX_ARM
#define ONI_PLATFORM_STRING "Linux-Arm"
#endif // ONIPLATFORMLINUX_ARM_H
@@ -0,0 +1,102 @@
/*****************************************************************************
* *
* OpenNI 2.x Alpha *
* Copyright (C) 2012 PrimeSense Ltd. *
* *
* This file is part of OpenNI. *
* *
* Licensed under the Apache License, Version 2.0 (the "License"); *
* you may not use this file except in compliance with the License. *
* You may obtain a copy of the License at *
* *
* http://www.apache.org/licenses/LICENSE-2.0 *
* *
* Unless required by applicable law or agreed to in writing, software *
* distributed under the License is distributed on an "AS IS" BASIS, *
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. *
* See the License for the specific language governing permissions and *
* limitations under the License. *
* *
*****************************************************************************/
#ifndef ONIPLATFORMLINUX_X86_H
#define ONIPLATFORMLINUX_X86_H
//---------------------------------------------------------------------------
// Prerequisites
//---------------------------------------------------------------------------
//---------------------------------------------------------------------------
// Includes
//---------------------------------------------------------------------------
#include <unistd.h>
#include <stdlib.h>
#include <stdio.h>
#include <string.h>
#include <assert.h>
#include <limits.h>
#include <stdint.h>
//---------------------------------------------------------------------------
// Platform Basic Definition
//---------------------------------------------------------------------------
#define ONI_PLATFORM ONI_PLATFORM_LINUX_X86
#define ONI_PLATFORM_STRING "Linux-x86"
//---------------------------------------------------------------------------
// Platform Capabilities
//---------------------------------------------------------------------------
#define ONI_PLATFORM_ENDIAN_TYPE ONI_PLATFORM_IS_LITTLE_ENDIAN
#define ONI_PLATFORM_SUPPORTS_DYNAMIC_LIBS 1
//---------------------------------------------------------------------------
// Memory
//---------------------------------------------------------------------------
/** The default memory alignment. */
#define ONI_DEFAULT_MEM_ALIGN 16
/** The thread static declarator (using TLS). */
#define ONI_THREAD_STATIC __thread
//---------------------------------------------------------------------------
// Files
//---------------------------------------------------------------------------
/** The maximum allowed file path size (in bytes). */
#define ONI_FILE_MAX_PATH 256
//---------------------------------------------------------------------------
// Call back
//---------------------------------------------------------------------------
/** The std call type. */
#define ONI_STDCALL __stdcall
/** The call back calling convention. */
#define ONI_CALLBACK_TYPE
/** The C and C++ calling convension. */
#define ONI_C_DECL
//---------------------------------------------------------------------------
// Macros
//---------------------------------------------------------------------------
/** Returns the date and time at compile time. */
#define ONI_TIMESTAMP __DATE__ " " __TIME__
/** Converts n into a pre-processor string. */
#define ONI_STRINGIFY(n) ONI_STRINGIFY_HELPER(n)
#define ONI_STRINGIFY_HELPER(n) #n
//---------------------------------------------------------------------------
// API Export/Import Macros
//---------------------------------------------------------------------------
/** Indicates an exported shared library function. */
#define ONI_API_EXPORT __attribute__ ((visibility("default")))
/** Indicates an imported shared library function. */
#define ONI_API_IMPORT
/** Indicates a deprecated function */
#define ONI_API_DEPRECATED(msg) __attribute__((warning("This function is deprecated: " msg)))
#endif // ONIPLATFORMLINUX_X86_H
@@ -0,0 +1,57 @@
/*****************************************************************************
* *
* OpenNI 2.x Alpha *
* Copyright (C) 2012 PrimeSense Ltd. *
* *
* This file is part of OpenNI. *
* *
* Licensed under the Apache License, Version 2.0 (the "License"); *
* you may not use this file except in compliance with the License. *
* You may obtain a copy of the License at *
* *
* http://www.apache.org/licenses/LICENSE-2.0 *
* *
* Unless required by applicable law or agreed to in writing, software *
* distributed under the License is distributed on an "AS IS" BASIS, *
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. *
* See the License for the specific language governing permissions and *
* limitations under the License. *
* *
*****************************************************************************/
#ifndef ONIPLATFORMMACOSX_H
#define ONIPLATFORMMACOSX_H
// Start with Linux-x86, and override what's different
#include "../Linux-x86/OniPlatformLinux-x86.h"
#include <sys/time.h>
#undef ONI_PLATFORM
#undef ONI_PLATFORM_STRING
#define ONI_PLATFORM ONI_PLATFORM_MACOSX
#define ONI_PLATFORM_STRING "MacOSX"
#include "TargetConditionals.h"
#if (TARGET_IPHONE_SIMULATOR == 1) || (TARGET_OS_IPHONE == 1)
#define ONI_PLATFORM_IOS
#undef ONI_PLATFORM_STRING
#define ONI_PLATFORM_STRING "iOS"
#elif TARGET_OS_MAC
#ifdef XN_XCODE_BUILD
#define ONI_PLATFORM_MACOSX_XCODE
#undef ONI_PLATFORM_STRING
#define ONI_PLATFORM_STRING "MacOSX-Xcode"
#endif
#endif
#define ONI_PLATFORM_HAS_NO_TIMED_OPS
#define ONI_PLATFORM_HAS_NO_CLOCK_GETTIME
#define ONI_PLATFORM_HAS_NO_SCHED_PARAM
#define ONI_PLATFORM_HAS_BUILTIN_SEMUN
#undef ONI_THREAD_STATIC
#define ONI_THREAD_STATIC
#endif // ONIPLATFORMMACOSX_H
@@ -0,0 +1,264 @@
/*****************************************************************************
* *
* OpenNI 2.x Alpha *
* Copyright (C) 2012 PrimeSense Ltd. *
* *
* This file is part of OpenNI. *
* *
* Licensed under the Apache License, Version 2.0 (the "License"); *
* you may not use this file except in compliance with the License. *
* You may obtain a copy of the License at *
* *
* http://www.apache.org/licenses/LICENSE-2.0 *
* *
* Unless required by applicable law or agreed to in writing, software *
* distributed under the License is distributed on an "AS IS" BASIS, *
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. *
* See the License for the specific language governing permissions and *
* limitations under the License. *
* *
*****************************************************************************/
#ifndef ONICAPI_H
#define ONICAPI_H
#include "OniPlatform.h"
#include "OniCTypes.h"
#include "OniCProperties.h"
#include "OniVersion.h"
/******************************************** General APIs */
/** Initialize OpenNI2. Use ONI_API_VERSION as the version. */
ONI_C_API OniStatus oniInitialize(int apiVersion);
/** Shutdown OpenNI2 */
ONI_C_API void oniShutdown();
/**
* Get the list of currently connected device.
* Each device is represented by its OniDeviceInfo.
* pDevices will be allocated inside.
*/
ONI_C_API OniStatus oniGetDeviceList(OniDeviceInfo** pDevices, int* pNumDevices);
/** Release previously allocated device list */
ONI_C_API OniStatus oniReleaseDeviceList(OniDeviceInfo* pDevices);
ONI_C_API OniStatus oniRegisterDeviceCallbacks(OniDeviceCallbacks* pCallbacks, void* pCookie, OniCallbackHandle* pHandle);
ONI_C_API void oniUnregisterDeviceCallbacks(OniCallbackHandle handle);
/** Wait for any of the streams to have a new frame */
ONI_C_API OniStatus oniWaitForAnyStream(OniStreamHandle* pStreams, int numStreams, int* pStreamIndex, int timeout);
/** Get the current version of OpenNI2 */
ONI_C_API OniVersion oniGetVersion();
/** Translate from format to number of bytes per pixel. Will return 0 for formats in which the number of bytes per pixel isn't fixed. */
ONI_C_API int oniFormatBytesPerPixel(OniPixelFormat format);
/** Get internal error */
ONI_C_API const char* oniGetExtendedError();
/******************************************** Device APIs */
/** Open a device. Uri can be taken from the matching OniDeviceInfo. */
ONI_C_API OniStatus oniDeviceOpen(const char* uri, OniDeviceHandle* pDevice);
/** Close a device */
ONI_C_API OniStatus oniDeviceClose(OniDeviceHandle device);
/** Get the possible configurations available for a specific source, or NULL if the source does not exist. */
ONI_C_API const OniSensorInfo* oniDeviceGetSensorInfo(OniDeviceHandle device, OniSensorType sensorType);
/** Get the OniDeviceInfo of a certain device. */
ONI_C_API OniStatus oniDeviceGetInfo(OniDeviceHandle device, OniDeviceInfo* pInfo);
/** Create a new stream in the device. The stream will originate from the source. */
ONI_C_API OniStatus oniDeviceCreateStream(OniDeviceHandle device, OniSensorType sensorType, OniStreamHandle* pStream);
ONI_C_API OniStatus oniDeviceEnableDepthColorSync(OniDeviceHandle device);
ONI_C_API void oniDeviceDisableDepthColorSync(OniDeviceHandle device);
ONI_C_API OniBool oniDeviceGetDepthColorSyncEnabled(OniDeviceHandle device);
/** Set property in the device. Use the properties listed in OniTypes.h: ONI_DEVICE_PROPERTY_..., or specific ones supplied by the device. */
ONI_C_API OniStatus oniDeviceSetProperty(OniDeviceHandle device, int propertyId, const void* data, int dataSize);
/** Get property in the device. Use the properties listed in OniTypes.h: ONI_DEVICE_PROPERTY_..., or specific ones supplied by the device. */
ONI_C_API OniStatus oniDeviceGetProperty(OniDeviceHandle device, int propertyId, void* data, int* pDataSize);
/** Check if the property is supported by the device. Use the properties listed in OniTypes.h: ONI_DEVICE_PROPERTY_..., or specific ones supplied by the device. */
ONI_C_API OniBool oniDeviceIsPropertySupported(OniDeviceHandle device, int propertyId);
/** Invoke an internal functionality of the device. */
ONI_C_API OniStatus oniDeviceInvoke(OniDeviceHandle device, int commandId, void* data, int dataSize);
/** Check if a command is supported, for invoke */
ONI_C_API OniBool oniDeviceIsCommandSupported(OniDeviceHandle device, int commandId);
ONI_C_API OniBool oniDeviceIsImageRegistrationModeSupported(OniDeviceHandle device, OniImageRegistrationMode mode);
/** @internal */
ONI_C_API OniStatus oniDeviceOpenEx(const char* uri, const char* mode, OniDeviceHandle* pDevice);
/******************************************** Stream APIs */
/** Destroy an existing stream */
ONI_C_API void oniStreamDestroy(OniStreamHandle stream);
/** Get the OniSensorInfo of the certain stream. */
ONI_C_API const OniSensorInfo* oniStreamGetSensorInfo(OniStreamHandle stream);
/** Start generating data from the stream. */
ONI_C_API OniStatus oniStreamStart(OniStreamHandle stream);
/** Stop generating data from the stream. */
ONI_C_API void oniStreamStop(OniStreamHandle stream);
/** Get the next frame from the stream. This function is blocking until there is a new frame from the stream. For timeout, use oniWaitForStreams() first */
ONI_C_API OniStatus oniStreamReadFrame(OniStreamHandle stream, OniFrame** pFrame);
/** Register a callback to when the stream has a new frame. */
ONI_C_API OniStatus oniStreamRegisterNewFrameCallback(OniStreamHandle stream, OniNewFrameCallback handler, void* pCookie, OniCallbackHandle* pHandle);
/** Unregister a previously registered callback to when the stream has a new frame. */
ONI_C_API void oniStreamUnregisterNewFrameCallback(OniStreamHandle stream, OniCallbackHandle handle);
/** Set property in the stream. Use the properties listed in OniTypes.h: ONI_STREAM_PROPERTY_..., or specific ones supplied by the device for its streams. */
ONI_C_API OniStatus oniStreamSetProperty(OniStreamHandle stream, int propertyId, const void* data, int dataSize);
/** Get property in the stream. Use the properties listed in OniTypes.h: ONI_STREAM_PROPERTY_..., or specific ones supplied by the device for its streams. */
ONI_C_API OniStatus oniStreamGetProperty(OniStreamHandle stream, int propertyId, void* data, int* pDataSize);
/** Check if the property is supported the stream. Use the properties listed in OniTypes.h: ONI_STREAM_PROPERTY_..., or specific ones supplied by the device for its streams. */
ONI_C_API OniBool oniStreamIsPropertySupported(OniStreamHandle stream, int propertyId);
/** Invoke an internal functionality of the stream. */
ONI_C_API OniStatus oniStreamInvoke(OniStreamHandle stream, int commandId, void* data, int dataSize);
/** Check if a command is supported, for invoke */
ONI_C_API OniBool oniStreamIsCommandSupported(OniStreamHandle stream, int commandId);
/** Sets the stream buffer allocation functions. Note that this function may only be called while stream is not started. */
ONI_C_API OniStatus oniStreamSetFrameBuffersAllocator(OniStreamHandle stream, OniFrameAllocBufferCallback alloc, OniFrameFreeBufferCallback free, void* pCookie);
////
/** Mark another user of the frame. */
ONI_C_API void oniFrameAddRef(OniFrame* pFrame);
/** Mark that the frame is no longer needed. */
ONI_C_API void oniFrameRelease(OniFrame* pFrame);
/*add by xlj*/
ONI_C_API void oniStreamfilter(OniStreamHandle stream, void* buf, int newVal, int maxSpeckleSize, int maxDiff);
// ONI_C_API OniStatus oniConvertRealWorldToProjective(OniStreamHandle stream, OniFloatPoint3D* pRealWorldPoint, OniFloatPoint3D* pProjectivePoint);
// ONI_C_API OniStatus oniConvertProjectiveToRealWorld(OniStreamHandle stream, OniFloatPoint3D* pProjectivePoint, OniFloatPoint3D* pRealWorldPoint);
/**
* Creates a recorder that records to a file.
* @param [in] fileName The name of the file that will contain the recording.
* @param [out] pRecorder Points to the handle to the newly created recorder.
* @retval ONI_STATUS_OK Upon successful completion.
* @retval ONI_STATUS_ERROR Upon any kind of failure.
*/
ONI_C_API OniStatus oniCreateRecorder(const char* fileName, OniRecorderHandle* pRecorder);
/**
* Attaches a stream to a recorder. The amount of attached streams is virtually
* infinite. You cannot attach a stream after you have started a recording, if
* you do: an error will be returned by oniRecorderAttachStream.
* @param [in] recorder The handle to the recorder.
* @param [in] stream The handle to the stream.
* @param [in] allowLossyCompression Allows/denies lossy compression
* @retval ONI_STATUS_OK Upon successful completion.
* @retval ONI_STATUS_ERROR Upon any kind of failure.
*/
ONI_C_API OniStatus oniRecorderAttachStream(
OniRecorderHandle recorder,
OniStreamHandle stream,
OniBool allowLossyCompression);
/**
* Starts recording. There must be at least one stream attached to the recorder,
* if not: oniRecorderStart will return an error.
* @param[in] recorder The handle to the recorder.
* @retval ONI_STATUS_OK Upon successful completion.
* @retval ONI_STATUS_ERROR Upon any kind of failure.
*/
ONI_C_API OniStatus oniRecorderStart(OniRecorderHandle recorder);
/**
* Stops recording. You can resume recording via oniRecorderStart.
* @param[in] recorder The handle to the recorder.
* @retval ONI_STATUS_OK Upon successful completion.
* @retval ONI_STATUS_ERROR Upon any kind of failure.
*/
ONI_C_API void oniRecorderStop(OniRecorderHandle recorder);
/**
* Stops recording if needed, and destroys a recorder.
* @param [in,out] recorder The handle to the recorder, the handle will be
* invalidated (nullified) when the function returns.
* @retval ONI_STATUS_OK Upon successful completion.
* @retval ONI_STATUS_ERROR Upon any kind of failure.
*/
ONI_C_API OniStatus oniRecorderDestroy(OniRecorderHandle* pRecorder);
ONI_C_API OniStatus oniCoordinateConverterDepthToWorld(OniStreamHandle depthStream, float depthX, float depthY, float depthZ, float* pWorldX, float* pWorldY, float* pWorldZ);
ONI_C_API OniStatus oniCoordinateConverterWorldToDepth(OniStreamHandle depthStream, float worldX, float worldY, float worldZ, float* pDepthX, float* pDepthY, float* pDepthZ);
ONI_C_API OniStatus oniCoordinateConverterDepthToColor(OniStreamHandle depthStream, OniStreamHandle colorStream, int depthX, int depthY, OniDepthPixel depthZ, int* pColorX, int* pColorY);
ONI_C_API OniStatus oniCoordinateConverterC2D(OniStreamHandle depthStream, int colorX, int colorY, OniDepthPixel depthZ, int* pDepthX, int* pDepthY);
ONI_C_API OniStatus oniCoordinateConverterD2C(OniStreamHandle depthStream, int colorX, int colorY, OniDepthPixel depthZ, int* pDepthX, int* pDepthY);
/******************************************** Log APIs */
/**
* Change the log output folder
* @param const char * strOutputFolder [in] path to the desirebale folder
*
* @retval ONI_STATUS_OK Upon successful completion.
* @retval ONI_STATUS_ERROR Upon any kind of failure.
*/
ONI_C_API OniStatus oniSetLogOutputFolder(const char* strOutputFolder);
/**
* Get the current log file name
* @param char * strFileName [out] hold the returned file name
* @param int nBufferSize [in] size of strFileName
*
* @retval ONI_STATUS_OK Upon successful completion.
* @retval ONI_STATUS_ERROR Upon any kind of failure.
*/
ONI_C_API OniStatus oniGetLogFileName(char* strFileName, int nBufferSize);
/**
* Set the Minimum severity for log produce
* @param const char * strMask [in] Name of the logger
*
* @retval ONI_STATUS_OK Upon successful completion.
* @retval ONI_STATUS_ERROR Upon any kind of failure.
*/
ONI_C_API OniStatus oniSetLogMinSeverity(int nMinSeverity);
/**
* Configures if log entries will be printed to console.
* @param OniBool bConsoleOutput [in] TRUE to print log entries to console, FALSE otherwise.
*
* @retval ONI_STATUS_OK Upon successful completion.
* @retval ONI_STATUS_ERROR Upon any kind of failure.
*/
ONI_C_API OniStatus oniSetLogConsoleOutput(OniBool bConsoleOutput);
/**
* Configures if log entries will be printed to a log file.
* @param OniBool bFileOutput [in] TRUE to print log entries to the file, FALSE otherwise.
*
* @retval ONI_STATUS_OK Upon successful completion.
* @retval ONI_STATUS_ERROR Upon any kind of failure.
*/
ONI_C_API OniStatus oniSetLogFileOutput(OniBool bFileOutput);
#if ONI_PLATFORM == ONI_PLATFORM_ANDROID_ARM
/**
* Configures if log entries will be printed to the Android log.
* @param OniBool bAndroidOutput [in] TRUE to print log entries to the Android log, FALSE otherwise.
*
* @retval ONI_STATUS_OK Upon successful completion.
* @retval ONI_STATUS_ERROR Upon any kind of failure.
*/
ONI_C_API OniStatus oniSetLogAndroidOutput(OniBool bAndroidOutput);
#endif
#endif // ONICAPI_H
@@ -0,0 +1,84 @@
/*****************************************************************************
* *
* OpenNI 2.x Alpha *
* Copyright (C) 2012 PrimeSense Ltd. *
* *
* This file is part of OpenNI. *
* *
* Licensed under the Apache License, Version 2.0 (the "License"); *
* you may not use this file except in compliance with the License. *
* You may obtain a copy of the License at *
* *
* http://www.apache.org/licenses/LICENSE-2.0 *
* *
* Unless required by applicable law or agreed to in writing, software *
* distributed under the License is distributed on an "AS IS" BASIS, *
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. *
* See the License for the specific language governing permissions and *
* limitations under the License. *
* *
*****************************************************************************/
#ifndef ONICENUMS_H
#define ONICENUMS_H
/** Possible failure values */
typedef enum
{
ONI_STATUS_OK = 0,
ONI_STATUS_ERROR = 1,
ONI_STATUS_NOT_IMPLEMENTED = 2,
ONI_STATUS_NOT_SUPPORTED = 3,
ONI_STATUS_BAD_PARAMETER = 4,
ONI_STATUS_OUT_OF_FLOW = 5,
ONI_STATUS_NO_DEVICE = 6,
ONI_STATUS_TIME_OUT = 102,
} OniStatus;
/** The source of the stream */
typedef enum
{
ONI_SENSOR_IR = 1,
ONI_SENSOR_COLOR = 2,
ONI_SENSOR_DEPTH = 3,
} OniSensorType;
/** All available formats of the output of a stream */
typedef enum
{
// Depth
ONI_PIXEL_FORMAT_DEPTH_1_MM = 100,
ONI_PIXEL_FORMAT_DEPTH_100_UM = 101,
ONI_PIXEL_FORMAT_SHIFT_9_2 = 102,
ONI_PIXEL_FORMAT_SHIFT_9_3 = 103,
// Color
ONI_PIXEL_FORMAT_RGB888 = 200,
ONI_PIXEL_FORMAT_YUV422 = 201,
ONI_PIXEL_FORMAT_GRAY8 = 202,
ONI_PIXEL_FORMAT_GRAY16 = 203,
ONI_PIXEL_FORMAT_JPEG = 204,
ONI_PIXEL_FORMAT_YUYV = 205,
} OniPixelFormat;
typedef enum
{
ONI_DEVICE_STATE_OK = 0,
ONI_DEVICE_STATE_ERROR = 1,
ONI_DEVICE_STATE_NOT_READY = 2,
ONI_DEVICE_STATE_EOF = 3
} OniDeviceState;
typedef enum
{
ONI_IMAGE_REGISTRATION_OFF = 0,
ONI_IMAGE_REGISTRATION_DEPTH_TO_COLOR = 1,
} OniImageRegistrationMode;
enum
{
ONI_TIMEOUT_NONE = 0,
ONI_TIMEOUT_FOREVER = -1,
};
#endif // ONICENUMS_H
@@ -0,0 +1,80 @@
/*****************************************************************************
* *
* OpenNI 2.x Alpha *
* Copyright (C) 2012 PrimeSense Ltd. *
* *
* This file is part of OpenNI. *
* *
* Licensed under the Apache License, Version 2.0 (the "License"); *
* you may not use this file except in compliance with the License. *
* You may obtain a copy of the License at *
* *
* http://www.apache.org/licenses/LICENSE-2.0 *
* *
* Unless required by applicable law or agreed to in writing, software *
* distributed under the License is distributed on an "AS IS" BASIS, *
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. *
* See the License for the specific language governing permissions and *
* limitations under the License. *
* *
*****************************************************************************/
#ifndef ONICPROPERTIES_H
#define ONICPROPERTIES_H
// Device properties
enum
{
ONI_DEVICE_PROPERTY_FIRMWARE_VERSION = 0, // By implementation
ONI_DEVICE_PROPERTY_DRIVER_VERSION = 1, // OniVersion
ONI_DEVICE_PROPERTY_HARDWARE_VERSION = 2, // int
ONI_DEVICE_PROPERTY_SERIAL_NUMBER = 3, // string
ONI_DEVICE_PROPERTY_ERROR_STATE = 4, // ??
ONI_DEVICE_PROPERTY_IMAGE_REGISTRATION = 5, // OniImageRegistrationMode
//orbbec
OBEXTENSION_ID_IR_GAIN = 11,
OBEXTENSION_ID_IR_EXP,
OBEXTENSION_ID_LDP_EN,
OBEXTENSION_ID_CAM_PARAMS,
OBEXTENSION_ID_LASER_EN,
OBEXTENSION_ID_SERIALNUMBER,
OBEXTENSION_ID_DEVICETYPE,
OBEXTENSION_ID_UPDATE_FIRMWARE,
// Files
ONI_DEVICE_PROPERTY_PLAYBACK_SPEED = 100, // float
ONI_DEVICE_PROPERTY_PLAYBACK_REPEAT_ENABLED = 101, // OniBool
};
// Stream properties
enum
{
ONI_STREAM_PROPERTY_CROPPING = 0, // OniCropping*
ONI_STREAM_PROPERTY_HORIZONTAL_FOV = 1, // float: radians
ONI_STREAM_PROPERTY_VERTICAL_FOV = 2, // float: radians
ONI_STREAM_PROPERTY_VIDEO_MODE = 3, // OniVideoMode*
ONI_STREAM_PROPERTY_MAX_VALUE = 4, // int
ONI_STREAM_PROPERTY_MIN_VALUE = 5, // int
ONI_STREAM_PROPERTY_STRIDE = 6, // int
ONI_STREAM_PROPERTY_MIRRORING = 7, // OniBool
ONI_STREAM_PROPERTY_NUMBER_OF_FRAMES = 8, // int
// Camera
ONI_STREAM_PROPERTY_AUTO_WHITE_BALANCE = 100, // OniBool
ONI_STREAM_PROPERTY_AUTO_EXPOSURE = 101, // OniBool
ONI_STREAM_PROPERTY_EXPOSURE = 102, // int
ONI_STREAM_PROPERTY_GAIN = 103, // int
};
// Device commands (for Invoke)
enum
{
ONI_DEVICE_COMMAND_SEEK = 1, // OniSeek
};
#endif // ONICPROPERTIES_H
@@ -0,0 +1,222 @@
/*****************************************************************************
* *
* OpenNI 2.x Alpha *
* Copyright (C) 2012 PrimeSense Ltd. *
* *
* This file is part of OpenNI. *
* *
* Licensed under the Apache License, Version 2.0 (the "License"); *
* you may not use this file except in compliance with the License. *
* You may obtain a copy of the License at *
* *
* http://www.apache.org/licenses/LICENSE-2.0 *
* *
* Unless required by applicable law or agreed to in writing, software *
* distributed under the License is distributed on an "AS IS" BASIS, *
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. *
* See the License for the specific language governing permissions and *
* limitations under the License. *
* *
*****************************************************************************/
#ifndef ONICTYPES_H
#define ONICTYPES_H
#include "OniPlatform.h"
#include "OniCEnums.h"
/** Basic types **/
typedef int OniBool;
#ifndef TRUE
#define TRUE 1
#endif //TRUE
#ifndef FALSE
#define FALSE 0
#endif //FALSE
#define ONI_MAX_STR 256
#define ONI_MAX_SENSORS 10
struct OniCallbackHandleImpl;
typedef struct OniCallbackHandleImpl* OniCallbackHandle;
/** Holds an OpenNI version number, which consists of four separate numbers in the format: @c major.minor.maintenance.build. For example: 2.0.0.20. */
typedef struct
{
/** Major version number, incremented for major API restructuring. */
int major;
/** Minor version number, incremented when significant new features added. */
int minor;
/** Maintenance build number, incremented for new releases that primarily provide minor bug fixes. */
int maintenance;
/** Build number. Incremented for each new API build. Generally not shown on the installer and download site. */
int build;
} OniVersion;
typedef int OniHardwareVersion;
/** Description of the output: format and resolution */
typedef struct
{
OniPixelFormat pixelFormat;
int resolutionX;
int resolutionY;
int fps;
} OniVideoMode;
/** List of supported video modes by a specific source */
typedef struct
{
OniSensorType sensorType;
int numSupportedVideoModes;
OniVideoMode *pSupportedVideoModes;
} OniSensorInfo;
/** Basic description of a device */
typedef struct
{
char uri[ONI_MAX_STR];
char vendor[ONI_MAX_STR];
char name[ONI_MAX_STR];
uint16_t usbVendorId;
uint16_t usbProductId;
} OniDeviceInfo;
typedef struct OBCameraParams
{
float l_intr_p[4];//[fx,fy,cx,cy]
float r_intr_p[4];//[fx,fy,cx,cy]
float r2l_r[9];//[r00,r01,r02;r10,r11,r12;r20,r21,r22]
float r2l_t[3];//[t1,t2,t3]
float l_k[5];//[k1,k2,p1,p2,k3]
float r_k[5];
//int is_mirror;
}OBCameraParams;
struct _OniDevice;
typedef struct _OniDevice* OniDeviceHandle;
struct _OniStream;
typedef struct _OniStream* OniStreamHandle;
struct _OniRecorder;
typedef struct _OniRecorder* OniRecorderHandle;
/** All information of the current frame */
typedef struct
{
int dataSize;
void* data;
OniSensorType sensorType;
uint64_t timestamp;
int frameIndex;
int width;
int height;
OniVideoMode videoMode;
OniBool croppingEnabled;
int cropOriginX;
int cropOriginY;
int stride;
} OniFrame;
typedef void (ONI_CALLBACK_TYPE* OniNewFrameCallback)(OniStreamHandle stream, void* pCookie);
typedef void (ONI_CALLBACK_TYPE* OniGeneralCallback)(void* pCookie);
typedef void (ONI_CALLBACK_TYPE* OniDeviceInfoCallback)(const OniDeviceInfo* pInfo, void* pCookie);
typedef void (ONI_CALLBACK_TYPE* OniDeviceStateCallback)(const OniDeviceInfo* pInfo, OniDeviceState deviceState, void* pCookie);
typedef void* (ONI_CALLBACK_TYPE* OniFrameAllocBufferCallback)(int size, void* pCookie);
typedef void (ONI_CALLBACK_TYPE* OniFrameFreeBufferCallback)(void* data, void* pCookie);
typedef struct
{
OniDeviceInfoCallback deviceConnected;
OniDeviceInfoCallback deviceDisconnected;
OniDeviceStateCallback deviceStateChanged;
} OniDeviceCallbacks;
typedef struct
{
int enabled;
int originX;
int originY;
int width;
int height;
} OniCropping;
// Pixel types
/**
Pixel type used to store depth images.
*/
typedef uint16_t OniDepthPixel;
typedef uint16_t OniIRPixel;
/**
Pixel type used to store 16-bit grayscale images
*/
typedef uint16_t OniGrayscale16Pixel;
/**
Pixel type used to store 8-bit grayscale/bayer images
*/
typedef uint8_t OniGrayscale8Pixel;
#pragma pack (push, 1)
/** Holds the value of a single color image pixel in 24-bit RGB format. */
typedef struct
{
/* Red value of this pixel. */
uint8_t r;
/* Green value of this pixel. */
uint8_t g;
/* Blue value of this pixel. */
uint8_t b;
} OniRGB888Pixel;
/**
Holds the value of two pixels in YUV422 format (Luminance/Chrominance,16-bits/pixel).
The first pixel has the values y1, u, v.
The second pixel has the values y2, u, v.
*/
typedef struct
{
/** First chrominance value for two pixels, stored as blue luminance difference signal. */
uint8_t u;
/** Overall luminance value of first pixel. */
uint8_t y1;
/** Second chrominance value for two pixels, stored as red luminance difference signal. */
uint8_t v;
/** Overall luminance value of second pixel. */
uint8_t y2;
} OniYUV422DoublePixel;
/**
Holds the value of two pixels in YUV422 format (Luminance/Chrominance,16-bits/pixel).
The first pixel has the values y1, u, v.
The second pixel has the values y2, u, v.
*/
typedef struct
{
/** Overall luminance value of first pixel. */
uint8_t y1;
/** First chrominance value for two pixels, stored as blue luminance difference signal. */
uint8_t u;
/** Overall luminance value of second pixel. */
uint8_t y2;
/** Second chrominance value for two pixels, stored as red luminance difference signal. */
uint8_t v;
} OniYUYVDoublePixel;
#pragma pack (pop)
typedef struct
{
int frameIndex;
OniStreamHandle stream;
} OniSeek;
#endif // ONICTYPES_H
@@ -0,0 +1,93 @@
/*****************************************************************************
* *
* OpenNI 2.x Alpha *
* Copyright (C) 2012 PrimeSense Ltd. *
* *
* This file is part of OpenNI. *
* *
* Licensed under the Apache License, Version 2.0 (the "License"); *
* you may not use this file except in compliance with the License. *
* You may obtain a copy of the License at *
* *
* http://www.apache.org/licenses/LICENSE-2.0 *
* *
* Unless required by applicable law or agreed to in writing, software *
* distributed under the License is distributed on an "AS IS" BASIS, *
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. *
* See the License for the specific language governing permissions and *
* limitations under the License. *
* *
*****************************************************************************/
#ifndef ONIENUMS_H
#define ONIENUMS_H
namespace openni
{
/** Possible failure values */
typedef enum
{
STATUS_OK = 0,
STATUS_ERROR = 1,
STATUS_NOT_IMPLEMENTED = 2,
STATUS_NOT_SUPPORTED = 3,
STATUS_BAD_PARAMETER = 4,
STATUS_OUT_OF_FLOW = 5,
STATUS_NO_DEVICE = 6,
STATUS_TIME_OUT = 102,
} Status;
/** The source of the stream */
typedef enum
{
SENSOR_IR = 1,
SENSOR_COLOR = 2,
SENSOR_DEPTH = 3,
} SensorType;
/** All available formats of the output of a stream */
typedef enum
{
// Depth
PIXEL_FORMAT_DEPTH_1_MM = 100,
PIXEL_FORMAT_DEPTH_100_UM = 101,
PIXEL_FORMAT_SHIFT_9_2 = 102,
PIXEL_FORMAT_SHIFT_9_3 = 103,
// Color
PIXEL_FORMAT_RGB888 = 200,
PIXEL_FORMAT_YUV422 = 201,
PIXEL_FORMAT_GRAY8 = 202,
PIXEL_FORMAT_GRAY16 = 203,
PIXEL_FORMAT_JPEG = 204,
PIXEL_FORMAT_YUYV = 205,
} PixelFormat;
typedef enum
{
DEVICE_STATE_OK = 0,
DEVICE_STATE_ERROR = 1,
DEVICE_STATE_NOT_READY = 2,
DEVICE_STATE_EOF = 3
} DeviceState;
typedef enum
{
IMAGE_REGISTRATION_OFF = 0,
IMAGE_REGISTRATION_DEPTH_TO_COLOR = 1,
} ImageRegistrationMode;
typedef enum
{
PARAMS_REGISTRATION_OFF = 0,
PARAMS_REGISTRATION_DEPTH_TO_COLOR = 1,
PARAMS_REGISTRATION_USE_DISTORTION = 2,
} ParamsRegistrationMode;
static const int TIMEOUT_NONE = 0;
static const int TIMEOUT_FOREVER = -1;
} // namespace openni
#endif // ONIENUMS_H
@@ -0,0 +1,72 @@
/*****************************************************************************
* *
* OpenNI 2.x Alpha *
* Copyright (C) 2012 PrimeSense Ltd. *
* *
* This file is part of OpenNI. *
* *
* Licensed under the Apache License, Version 2.0 (the "License"); *
* you may not use this file except in compliance with the License. *
* You may obtain a copy of the License at *
* *
* http://www.apache.org/licenses/LICENSE-2.0 *
* *
* Unless required by applicable law or agreed to in writing, software *
* distributed under the License is distributed on an "AS IS" BASIS, *
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. *
* See the License for the specific language governing permissions and *
* limitations under the License. *
* *
*****************************************************************************/
#ifndef ONIPLATFORM_H
#define ONIPLATFORM_H
// Supported platforms
#define ONI_PLATFORM_WIN32 1
#define ONI_PLATFORM_LINUX_X86 2
#define ONI_PLATFORM_LINUX_ARM 3
#define ONI_PLATFORM_MACOSX 4
#define ONI_PLATFORM_ANDROID_ARM 5
#if (defined _WIN32)
# ifndef RC_INVOKED
# if _MSC_VER < 1300
# error OpenNI Platform Abstraction Layer - Win32 - Microsoft Visual Studio version below 2003 (7.0) are not supported!
# endif
# endif
# include "Win32/OniPlatformWin32.h"
#elif defined (ANDROID) && (__arm__|| __aarch64__)
# include "Android-Arm/OniPlatformAndroid-Arm.h"
#elif (__linux__ && (__i386__ || __x86_64__))
# include "Linux-x86/OniPlatformLinux-x86.h"
#elif (__linux__ && (__arm__ || __aarch64__))
# include "Linux-Arm/OniPlatformLinux-Arm.h"
#elif _ARC
# include "ARC/OniPlaformARC.h"
#elif (__APPLE__)
# include "MacOSX/OniPlatformMacOSX.h"
#else
# error Xiron Platform Abstraction Layer - Unsupported Platform!
#endif
#ifdef __cplusplus
# define ONI_C extern "C"
# define ONI_C_API_EXPORT ONI_C ONI_API_EXPORT
# define ONI_C_API_IMPORT ONI_C ONI_API_IMPORT
# define ONI_CPP_API_EXPORT ONI_API_EXPORT
# define ONI_CPP_API_IMPORT ONI_API_IMPORT
#else // __cplusplus
# define ONI_C_API_EXPORT ONI_API_EXPORT
# define ONI_C_API_IMPORT ONI_API_IMPORT
#endif // __cplusplus
#ifdef OPENNI2_EXPORT
# define ONI_C_API ONI_C_API_EXPORT
# define ONI_CPP_API ONI_CPP_API_EXPORT
#else // OPENNI2_EXPORT
# define ONI_C_API ONI_C_API_IMPORT
# define ONI_CPP_API ONI_CPP_API_IMPORT
#endif // OPENNI2_EXPORT
#endif // ONIPLATFORM_H
@@ -0,0 +1,83 @@
/*****************************************************************************
* *
* OpenNI 2.x Alpha *
* Copyright (C) 2012 PrimeSense Ltd. *
* *
* This file is part of OpenNI. *
* *
* Licensed under the Apache License, Version 2.0 (the "License"); *
* you may not use this file except in compliance with the License. *
* You may obtain a copy of the License at *
* *
* http://www.apache.org/licenses/LICENSE-2.0 *
* *
* Unless required by applicable law or agreed to in writing, software *
* distributed under the License is distributed on an "AS IS" BASIS, *
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. *
* See the License for the specific language governing permissions and *
* limitations under the License. *
* *
*****************************************************************************/
#ifndef ONIPROPERTIES_H
#define ONIPROPERTIES_H
namespace openni
{
// Device properties
enum
{
DEVICE_PROPERTY_FIRMWARE_VERSION = 0, // string
DEVICE_PROPERTY_DRIVER_VERSION = 1, // OniVersion
DEVICE_PROPERTY_HARDWARE_VERSION = 2, // int
DEVICE_PROPERTY_SERIAL_NUMBER = 3, // string
DEVICE_PROPERTY_ERROR_STATE = 4, // ??
DEVICE_PROPERTY_IMAGE_REGISTRATION = 5, // OniImageRegistrationMode
//orbbec
OBEXTENSION_ID_IR_GAIN = 11,
OBEXTENSION_ID_IR_EXP,
OBEXTENSION_ID_LDP_EN,
OBEXTENSION_ID_CAM_PARAMS,
OBEXTENSION_ID_LASER_EN,
OBEXTENSION_ID_SERIALNUMBER,
OBEXTENSION_ID_DEVICETYPE,
OBEXTENSION_ID_UPDATE_FIRMWARE,
// Files
DEVICE_PROPERTY_PLAYBACK_SPEED = 100, // float
DEVICE_PROPERTY_PLAYBACK_REPEAT_ENABLED = 101, // OniBool
};
// Stream properties
enum
{
STREAM_PROPERTY_CROPPING = 0, // OniCropping*
STREAM_PROPERTY_HORIZONTAL_FOV = 1, // float: radians
STREAM_PROPERTY_VERTICAL_FOV = 2, // float: radians
STREAM_PROPERTY_VIDEO_MODE = 3, // OniVideoMode*
STREAM_PROPERTY_MAX_VALUE = 4, // int
STREAM_PROPERTY_MIN_VALUE = 5, // int
STREAM_PROPERTY_STRIDE = 6, // int
STREAM_PROPERTY_MIRRORING = 7, // OniBool
STREAM_PROPERTY_NUMBER_OF_FRAMES = 8, // int
// Camera
STREAM_PROPERTY_AUTO_WHITE_BALANCE = 100, // OniBool
STREAM_PROPERTY_AUTO_EXPOSURE = 101, // OniBool
STREAM_PROPERTY_EXPOSURE = 102, // int
STREAM_PROPERTY_GAIN = 103, // int
STREAM_PROPERTY_SOFTWARE_REGISTRATION = 0x2080FF42, // int
};
// Device commands (for Invoke)
enum
{
DEVICE_COMMAND_SEEK = 1, // OniSeek
};
} // namespace openni
#endif // ONIPROPERTIES_H
@@ -0,0 +1,40 @@
/*****************************************************************************
* *
* OpenNI 2.x Alpha *
* Copyright (C) 2012 PrimeSense Ltd. *
* *
* This file is part of OpenNI. *
* *
* Licensed under the Apache License, Version 2.0 (the "License"); *
* you may not use this file except in compliance with the License. *
* You may obtain a copy of the License at *
* *
* http://www.apache.org/licenses/LICENSE-2.0 *
* *
* Unless required by applicable law or agreed to in writing, software *
* distributed under the License is distributed on an "AS IS" BASIS, *
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. *
* See the License for the specific language governing permissions and *
* limitations under the License. *
* *
*****************************************************************************/
#ifndef ONITEST_H
#define ONITEST_H
#define TEST_DEVICE_NAME "Test" // use with device.open() to create a test device
/**
* Additional commands for Test device streams
*/
enum
{
TEST_COMMAND_ISSUE_FRAME = 0xFFFF0001, // TestCommandIssueFrame
};
typedef struct TestCommandIssueFrame
{
uint64_t timestamp;
void* data;
} TestCommandIssueFrame;
#endif // ONITEST_H
@@ -0,0 +1,48 @@
/*****************************************************************************
* *
* OpenNI 2.x Alpha *
* Copyright (C) 2012 PrimeSense Ltd. *
* *
* This file is part of OpenNI. *
* *
* Licensed under the Apache License, Version 2.0 (the "License"); *
* you may not use this file except in compliance with the License. *
* You may obtain a copy of the License at *
* *
* http://www.apache.org/licenses/LICENSE-2.0 *
* *
* Unless required by applicable law or agreed to in writing, software *
* distributed under the License is distributed on an "AS IS" BASIS, *
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. *
* See the License for the specific language governing permissions and *
* limitations under the License. *
* *
*****************************************************************************/
#ifndef ONIVERSION_H
#define ONIVERSION_H
#include "OniPlatform.h"
#define ONI_VERSION_MAJOR 2
#define ONI_VERSION_MINOR 3
#define ONI_VERSION_MAINTENANCE 0
#define ONI_VERSION_BUILD 50
/** OpenNI version (in brief string format): "Major.Minor.Maintenance (Build)" */
#define ONI_BRIEF_VERSION_STRING \
ONI_STRINGIFY(ONI_VERSION_MAJOR) "." \
ONI_STRINGIFY(ONI_VERSION_MINOR) "." \
ONI_STRINGIFY(ONI_VERSION_MAINTENANCE) \
" (Build " ONI_STRINGIFY(ONI_VERSION_BUILD) ")"
/** OpenNI version (in numeric format): (OpenNI major version * 100000000 + OpenNI minor version * 1000000 + OpenNI maintenance version * 10000 + OpenNI build version). */
#define ONI_VERSION (ONI_VERSION_MAJOR*100000000 + ONI_VERSION_MINOR*1000000 + ONI_VERSION_MAINTENANCE*10000 + ONI_VERSION_BUILD)
#define ONI_CREATE_API_VERSION(major, minor) ((major)*1000 + (minor))
#define ONI_API_VERSION ONI_CREATE_API_VERSION(ONI_VERSION_MAJOR, ONI_VERSION_MINOR)
/** OpenNI version (in string format): "Major.Minor.Maintenance.Build-Platform (MMM DD YYYY HH:MM:SS)". */
#define ONI_VERSION_STRING \
ONI_BRIEF_VERSION_STRING "-" \
ONI_PLATFORM_STRING " (" ONI_TIMESTAMP ")"
#endif // ONIVERSION_H
File diff suppressed because it is too large Load Diff
@@ -0,0 +1,752 @@
/*****************************************************************************
* *
* OpenNI 2.x Alpha *
* Copyright (C) 2012 PrimeSense Ltd. *
* *
* This file is part of OpenNI. *
* *
* Licensed under the Apache License, Version 2.0 (the "License"); *
* you may not use this file except in compliance with the License. *
* You may obtain a copy of the License at *
* *
* http://www.apache.org/licenses/LICENSE-2.0 *
* *
* Unless required by applicable law or agreed to in writing, software *
* distributed under the License is distributed on an "AS IS" BASIS, *
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. *
* See the License for the specific language governing permissions and *
* limitations under the License. *
* *
*****************************************************************************/
#ifndef PS1080_H
#define PS1080_H
#include <OniCTypes.h>
/** The maximum permitted Xiron device name string length. */
#define XN_DEVICE_MAX_STRING_LENGTH 200
/*
* private properties of PS1080 devices.
*
* @remarks
* properties structure is 0x1080XXYY where XX is range and YY is code.
* range values:
* F0 - device properties
* E0 - device commands
* 00 - common stream properties
* 10 - depth stream properties
* 20 - color stream properties
*/
enum
{
/*******************************************************************/
/* Device properties */
/*******************************************************************/
/** unsigned long long (XnSensorUsbInterface) */
XN_MODULE_PROPERTY_USB_INTERFACE = 0x1080F001, // "UsbInterface"
/** Boolean */
XN_MODULE_PROPERTY_MIRROR = 0x1080F002, // "Mirror"
/** unsigned long long, get only */
XN_MODULE_PROPERTY_RESET_SENSOR_ON_STARTUP = 0x1080F004, // "ResetSensorOnStartup"
/** unsigned long long, get only */
XN_MODULE_PROPERTY_LEAN_INIT = 0x1080F005, // "LeanInit"
/** char[XN_DEVICE_MAX_STRING_LENGTH], get only */
XN_MODULE_PROPERTY_SERIAL_NUMBER = 0x1080F006, // "ID"
/** XnVersions, get only */
XN_MODULE_PROPERTY_VERSION = 0x1080F007, // "Version"
/** Boolean */
XN_MODULE_PROPERTY_FIRMWARE_FRAME_SYNC = 0x1080F008,
/** Boolean */
XN_MODULE_PROPERTY_HOST_TIMESTAMPS = 0x1080FF77, // "HostTimestamps"
/** Boolean */
XN_MODULE_PROPERTY_CLOSE_STREAMS_ON_SHUTDOWN = 0x1080FF78, // "CloseStreamsOnShutdown"
/** Integer */
XN_MODULE_PROPERTY_FIRMWARE_LOG_INTERVAL = 0x1080FF7F, // "FirmwareLogInterval"
/** Boolean */
XN_MODULE_PROPERTY_PRINT_FIRMWARE_LOG = 0x1080FF80, // "FirmwareLogPrint"
/** Integer */
XN_MODULE_PROPERTY_FIRMWARE_LOG_FILTER = 0x1080FF81, // "FirmwareLogFilter"
/** String, get only */
XN_MODULE_PROPERTY_FIRMWARE_LOG = 0x1080FF82, // "FirmwareLog"
/** Integer */
XN_MODULE_PROPERTY_FIRMWARE_CPU_INTERVAL = 0x1080FF83, // "FirmwareCPUInterval"
/** String, get only */
XN_MODULE_PROPERTY_PHYSICAL_DEVICE_NAME = 0x1080FF7A, // "PhysicalDeviceName"
/** String, get only */
XN_MODULE_PROPERTY_VENDOR_SPECIFIC_DATA = 0x1080FF7B, // "VendorSpecificData"
/** String, get only */
XN_MODULE_PROPERTY_SENSOR_PLATFORM_STRING = 0x1080FF7C, // "SensorPlatformString"
/*******************************************************************/
/* Device commands (activated via SetProperty/GetProperty) */
/*******************************************************************/
/** XnInnerParam */
XN_MODULE_PROPERTY_FIRMWARE_PARAM = 0x1080E001, // "FirmwareParam"
/** unsigned long long, set only */
XN_MODULE_PROPERTY_RESET = 0x1080E002, // "Reset"
/** XnControlProcessingData */
XN_MODULE_PROPERTY_IMAGE_CONTROL = 0x1080E003, // "ImageControl"
/** XnControlProcessingData */
XN_MODULE_PROPERTY_DEPTH_CONTROL = 0x1080E004, // "DepthControl"
/** XnAHBData */
XN_MODULE_PROPERTY_AHB = 0x1080E005, // "AHB"
/** XnLedState */
XN_MODULE_PROPERTY_LED_STATE = 0x1080E006, // "LedState"
/** Boolean */
XN_MODULE_PROPERTY_EMITTER_STATE = 0x1080E007, // "EmitterState"
/** XnCmosBlankingUnits */
XN_MODULE_PROPERTY_CMOS_BLANKING_UNITS = 0x1080FF74, // "CmosBlankingUnits"
/** XnCmosBlankingTime */
XN_MODULE_PROPERTY_CMOS_BLANKING_TIME = 0x1080FF75, // "CmosBlankingTime"
/** XnFlashFileList, get only */
XN_MODULE_PROPERTY_FILE_LIST = 0x1080FF84, // "FileList"
/** XnParamFlashData, get only */
XN_MODULE_PROPERTY_FLASH_CHUNK = 0x1080FF85, // "FlashChunk"
XN_MODULE_PROPERTY_FILE = 0x1080FF86, // "FlashFile"
/** Integer */
XN_MODULE_PROPERTY_DELETE_FILE = 0x1080FF87, // "DeleteFile"
XN_MODULE_PROPERTY_FILE_ATTRIBUTES = 0x1080FF88, // "FileAttributes"
XN_MODULE_PROPERTY_TEC_SET_POINT = 0x1080FF89, // "TecSetPoint"
/** get only */
XN_MODULE_PROPERTY_TEC_STATUS = 0x1080FF8A, // "TecStatus"
/** get only */
XN_MODULE_PROPERTY_TEC_FAST_CONVERGENCE_STATUS = 0x1080FF8B, // "TecFastConvergenceStatus"
XN_MODULE_PROPERTY_EMITTER_SET_POINT = 0x1080FF8C, // "EmitterSetPoint"
/** get only */
XN_MODULE_PROPERTY_EMITTER_STATUS = 0x1080FF8D, // "EmitterStatus"
XN_MODULE_PROPERTY_I2C = 0x1080FF8E, // "I2C"
/** Integer, set only */
XN_MODULE_PROPERTY_BIST = 0x1080FF8F, // "BIST"
/** XnProjectorFaultData, set only */
XN_MODULE_PROPERTY_PROJECTOR_FAULT = 0x1080FF90, // "ProjectorFault"
/** Boolean, set only */
XN_MODULE_PROPERTY_APC_ENABLED = 0x1080FF91, // "APCEnabled"
/** Boolean */
XN_MODULE_PROPERTY_FIRMWARE_TEC_DEBUG_PRINT = 0x1080FF92, // "TecDebugPrint"
/** Boolean, set only */
XN_MODULE_PROPERTY_READ_ALL_ENDPOINTS = 0x1080FF93,
/*IRFLOOD*/
XN_MODULE_PROPERTY_IRFLOOD_STATE = 0x1080FF94, // "Ir floodState"
//irgain
XN_MODULE_PROPERTY_IRGAIN = 0x1080FF95, //Ir gain
XN_MODULE_PROPERTY_IREXP = 0x1080FF96, //Ir exp
XN_MODULE_PROPERTY_SENSOR_CHANGE = 0x1080FF97, //ado change sensor
XN_MODULE_PROPERTY_PUBLIC_KEY = 0x1080FF98, //public key and batch version
XN_MODULE_PROPERTY_RANDOM_STRING = 0x1080FF99, //get random init string
XN_MODULE_PROPERTY_RS_KEY = 0x1080FF9A, //rs key
//laser secure
XN_MODULE_PROPERTY_IS_SUPPORT_LASER_SECURE = 0x1080FF9B, //is support laser secure
XN_MODULE_PROPERTY_LASER_SECURE_STATUS = 0x1080FF9C, //laser secure (open or close)
XN_MODULE_PROPERTY_LASER_SECURE_KEEPALIVE = 0x1080FF9D, //keepalive heart packet
//laser current
XN_MODULE_PROPERTY_LASER_CURRENT = 0x1080FF9E,
//soft reset
XN_MODULE_PROPERTY_SOFT_RESET = 0x1080FF9F,
//dual camera switch left and right ir
XN_MODULE_PROPERTY_SWITCH_IR = 0x1080FFB0,
//rgb Ae mode
XN_MODULE_PROPERTY_RGB_AE_MODE = 0x1080FFB1,
//IR Temperature mode
XN_MODULE_PROPERTY_CAL_IR_TEMP = 0x1080FFB2,
//LDMP Temperature mode
XN_MODULE_PROPERTY_CAL_LDMP_TEMP = 0x1080FFB3,
//IR real time Temperature mode
XN_MODULE_PROPERTY_RT_IR_TEMP = 0x1080FFB4,
//LDMP real time Temperature mode
XN_MODULE_PROPERTY_RT_LDMP_TEMP = 0x1080FFB5,
//IR temperature compensation coefficient mode
XN_MODULE_PROPERTY_IR_TEMP_COMP_CO = 0x1080FFB6,
//Ldmp temperature compensation coefficient mode
XN_MODULE_PROPERTY_LDMP_TEMP_COMP_CO = 0x1080FFB7,
//Temperature comp
XN_MODULE_PROPERTY_TEMP_COMP = 0x1080FFB8,
//Depth optimization enabled state
XN_MODULE_PROPERTY_DEPTH_OPTIM_STATE = 0x1080FFB9,
//Depth optimization param
XN_MODULE_PROPERTY_DEPTH_OPTIM_PARAM = 0x1080FFBA,
XN_MODULE_PROPERTY_UPDATE_FIRMWARE_FLASH_CHUNK = 0x1080FFBD,
XN_MODULE_PROPERTY_LDP_ENABLE = 0x1080FFBE,
XN_MODULE_PROPERTY_EMITTER_STATE_V1 = 0x1080FFBF, // "get Emitter enable"
XN_MODULE_PROPERTY_LDP_SCALE = 0x1080FFC0, //ldp scale
XN_MODULE_PROPERTY_LDP_STATUS = 0x1080FFC1, //ldp status
/*******************************************************************/
/* Common stream properties */
/*******************************************************************/
/** unsigned long long */
XN_STREAM_PROPERTY_INPUT_FORMAT = 0x10800001, // "InputFormat"
/** unsigned long long (XnCroppingMode) */
XN_STREAM_PROPERTY_CROPPING_MODE = 0x10800002, // "CroppingMode"
/*******************************************************************/
/* Depth stream properties */
/*******************************************************************/
/** unsigned long long */
XN_STREAM_PROPERTY_CLOSE_RANGE = 0x1080F003, // "CloseRange"
/** unsigned long long */
XN_STREAM_PROPERTY_FAST_ZOOM_CROP = 0x1080F009, // "FastZoomCrop"
/** XnPixelRegistration - get only */
XN_STREAM_PROPERTY_PIXEL_REGISTRATION = 0x10801001, // "PixelRegistration"
/** XnPixelRegistration - get only */
XN_STREAM_PROPERTY_PIXEL_C2D_REGISTRATION = 0x20801001, // "PixelRegistration"
/** XnPixelRegistration - get only */
XN_STREAM_PROPERTY_PIXEL_D2C_REGISTRATION = 0x20801002, // "PixelRegistration"
/** unsigned long long */
XN_STREAM_PROPERTY_WHITE_BALANCE_ENABLED = 0x10801002, // "WhiteBalancedEnabled"
/** unsigned long long */
XN_STREAM_PROPERTY_GAIN = 0x10801003, // "Gain"
/** unsigned long long */
XN_STREAM_PROPERTY_HOLE_FILTER = 0x10801004, // "HoleFilter"
/** unsigned long long (XnProcessingType) */
XN_STREAM_PROPERTY_REGISTRATION_TYPE = 0x10801005, // "RegistrationType"
/** XnDepthAGCBin* */
XN_STREAM_PROPERTY_AGC_BIN = 0x10801006, // "AGCBin"
/** unsigned long long, get only */
XN_STREAM_PROPERTY_CONST_SHIFT = 0x10801007, // "ConstShift"
/** unsigned long long, get only */
XN_STREAM_PROPERTY_PIXEL_SIZE_FACTOR = 0x10801008, // "PixelSizeFactor"
/** unsigned long long, get only */
XN_STREAM_PROPERTY_MAX_SHIFT = 0x10801009, // "MaxShift"
/** unsigned long long, get only */
XN_STREAM_PROPERTY_PARAM_COEFF = 0x1080100A, // "ParamCoeff"
/** unsigned long long, get only */
XN_STREAM_PROPERTY_SHIFT_SCALE = 0x1080100B, // "ShiftScale"
/** unsigned long long, get only */
XN_STREAM_PROPERTY_ZERO_PLANE_DISTANCE = 0x1080100C, // "ZPD"
/** double, get only */
XN_STREAM_PROPERTY_ZERO_PLANE_PIXEL_SIZE = 0x1080100D, // "ZPPS"
/** double, get only */
XN_STREAM_PROPERTY_EMITTER_DCMOS_DISTANCE = 0x1080100E, // "LDDIS"
/** double, get only */
XN_STREAM_PROPERTY_DCMOS_RCMOS_DISTANCE = 0x1080100F, // "DCRCDIS"
/*dual sensor */
XN_STREAM_PROPERTY_DUAL_FOCALL_LENGTH = 0x06010011, // "DCRCDIS"
/*dual sensor */
XN_STREAM_PROPERTY_DUAL_COEFF_DISPARITY = 0x06010012, // "DCRCDIS"
/** OniDepthPixel[], get only */
XN_STREAM_PROPERTY_S2D_TABLE = 0x10801112, // "S2D"
/** unsigned short[], get only */
XN_STREAM_PROPERTY_D2S_TABLE = 0x10801113, // "D2S"
/** get only */
XN_STREAM_PROPERTY_DEPTH_SENSOR_CALIBRATION_INFO = 0x10801012,
/** Boolean */
XN_STREAM_PROPERTY_GMC_MODE = 0x1080FF44, // "GmcMode"
XN_STREAM_PROPERTY_MIN_DEPTH = 0x1080FF40, // "MinDepthValue"
XN_STREAM_PROPERTY_MAX_DEPTH = 0x1080FF41, // "MaxDepthValue"
/** Boolean */
XN_STREAM_PROPERTY_GMC_DEBUG = 0x1080FF45, // "GmcDebug"
/** Boolean */
XN_STREAM_PROPERTY_WAVELENGTH_CORRECTION = 0x1080FF46, // "WavelengthCorrection"
/** Boolean */
XN_STREAM_PROPERTY_WAVELENGTH_CORRECTION_DEBUG = 0x1080FF47, // "WavelengthCorrectionDebug"
/** Boolean */
XN_STREAM_PROPERTY_SOFTWARE_REGISTRATION = 0x2080FF42, // "Software Registration"
XN_STREAM_PROPERTY_SOFTWARE_FILTER = 0x2080FF43, //soft filter enable
/*******************************************************************/
/* Color stream properties */
/*******************************************************************/
/** Integer */
XN_STREAM_PROPERTY_FLICKER = 0x10802001, // "Flicker"
};
typedef enum
{
XN_SENSOR_FW_VER_UNKNOWN = 0,
XN_SENSOR_FW_VER_0_17 = 1,
XN_SENSOR_FW_VER_1_1 = 2,
XN_SENSOR_FW_VER_1_2 = 3,
XN_SENSOR_FW_VER_3_0 = 4,
XN_SENSOR_FW_VER_4_0 = 5,
XN_SENSOR_FW_VER_5_0 = 6,
XN_SENSOR_FW_VER_5_1 = 7,
XN_SENSOR_FW_VER_5_2 = 8,
XN_SENSOR_FW_VER_5_3 = 9,
XN_SENSOR_FW_VER_5_4 = 10,
XN_SENSOR_FW_VER_5_5 = 11,
XN_SENSOR_FW_VER_5_6 = 12,
XN_SENSOR_FW_VER_5_7 = 13,
XN_SENSOR_FW_VER_5_8 = 14,
XN_SENSOR_FW_VER_5_9 = 15,
} XnFWVer;
typedef enum {
XN_SENSOR_VER_UNKNOWN = 0,
XN_SENSOR_VER_2_0 = 1,
XN_SENSOR_VER_3_0 = 2,
XN_SENSOR_VER_4_0 = 3,
XN_SENSOR_VER_5_0 = 4
} XnSensorVer;
typedef enum {
XN_SENSOR_HW_VER_UNKNOWN = 0,
XN_SENSOR_HW_VER_FPDB_10 = 1,
XN_SENSOR_HW_VER_CDB_10 = 2,
XN_SENSOR_HW_VER_RD_3 = 3,
XN_SENSOR_HW_VER_RD_5 = 4,
XN_SENSOR_HW_VER_RD1081 = 5,
XN_SENSOR_HW_VER_RD1082 = 6,
XN_SENSOR_HW_VER_RD109 = 7
} XnHWVer;
typedef enum {
XN_SENSOR_CHIP_VER_UNKNOWN = 0,
XN_SENSOR_CHIP_VER_PS1000 = 1,
XN_SENSOR_CHIP_VER_PS1080 = 2,
XN_SENSOR_CHIP_VER_PS1080A6 = 3,
XN_SENSOR_CHIP_VER_MX6000 = 6,
XN_SENSOR_CHIP_VER_DUAL_MX6000 = 7
} XnChipVer;
typedef enum
{
XN_CMOS_TYPE_IMAGE = 0,
XN_CMOS_TYPE_DEPTH = 1,
XN_CMOS_TYPE_IR = 2,
XN_CMOS_COUNT
} XnCMOSType;
typedef enum
{
XN_IO_IMAGE_FORMAT_BAYER = 0,
XN_IO_IMAGE_FORMAT_YUV422 = 1,
XN_IO_IMAGE_FORMAT_JPEG = 2,
XN_IO_IMAGE_FORMAT_JPEG_420 = 3,
XN_IO_IMAGE_FORMAT_JPEG_MONO = 4,
XN_IO_IMAGE_FORMAT_UNCOMPRESSED_YUV422 = 5,
XN_IO_IMAGE_FORMAT_UNCOMPRESSED_BAYER = 6,
XN_IO_IMAGE_FORMAT_UNCOMPRESSED_YUYV = 7,
} XnIOImageFormats;
typedef enum
{
XN_IO_DEPTH_FORMAT_UNCOMPRESSED_16_BIT = 0,
XN_IO_DEPTH_FORMAT_COMPRESSED_PS = 1,
XN_IO_DEPTH_FORMAT_UNCOMPRESSED_10_BIT = 2,
XN_IO_DEPTH_FORMAT_UNCOMPRESSED_11_BIT = 3,
XN_IO_DEPTH_FORMAT_UNCOMPRESSED_12_BIT = 4,
} XnIODepthFormats;
typedef enum
{
XN_RESET_TYPE_POWER = 0,
XN_RESET_TYPE_SOFT = 1,
XN_RESET_TYPE_SOFT_FIRST = 2,
} XnParamResetType;
typedef enum XnSensorUsbInterface
{
XN_SENSOR_USB_INTERFACE_DEFAULT = 0,
XN_SENSOR_USB_INTERFACE_ISO_ENDPOINTS = 1,
XN_SENSOR_USB_INTERFACE_BULK_ENDPOINTS = 2,
XN_SENSOR_USB_INTERFACE_ISO_ENDPOINTS_LOW_DEPTH = 3,
} XnSensorUsbInterface;
typedef enum XnProcessingType
{
XN_PROCESSING_DONT_CARE = 0,
XN_PROCESSING_HARDWARE = 1,
XN_PROCESSING_SOFTWARE = 2,
} XnProcessingType;
typedef enum XnCroppingMode
{
XN_CROPPING_MODE_NORMAL = 1,
XN_CROPPING_MODE_INCREASED_FPS = 2,
XN_CROPPING_MODE_SOFTWARE_ONLY = 3,
} XnCroppingMode;
enum
{
XN_ERROR_STATE_OK = 0,
XN_ERROR_STATE_DEVICE_PROJECTOR_FAULT = 1,
XN_ERROR_STATE_DEVICE_OVERHEAT = 2,
};
typedef enum XnFirmwareCroppingMode
{
XN_FIRMWARE_CROPPING_MODE_DISABLED = 0,
XN_FIRMWARE_CROPPING_MODE_NORMAL = 1,
XN_FIRMWARE_CROPPING_MODE_INCREASED_FPS = 2,
} XnFirmwareCroppingMode;
typedef enum
{
XnLogFilterDebug = 0x0001,
XnLogFilterInfo = 0x0002,
XnLogFilterError = 0x0004,
XnLogFilterProtocol = 0x0008,
XnLogFilterAssert = 0x0010,
XnLogFilterConfig = 0x0020,
XnLogFilterFrameSync = 0x0040,
XnLogFilterAGC = 0x0080,
XnLogFilterTelems = 0x0100,
XnLogFilterAll = 0xFFFF
} XnLogFilter;
typedef enum
{
XnFileAttributeReadOnly = 0x8000
} XnFilePossibleAttributes;
typedef enum
{
XnFlashFileTypeFileTable = 0x00,
XnFlashFileTypeScratchFile = 0x01,
XnFlashFileTypeBootSector = 0x02,
XnFlashFileTypeBootManager = 0x03,
XnFlashFileTypeCodeDownloader = 0x04,
XnFlashFileTypeMonitor = 0x05,
XnFlashFileTypeApplication = 0x06,
XnFlashFileTypeFixedParams = 0x07,
XnFlashFileTypeDescriptors = 0x08,
XnFlashFileTypeDefaultParams = 0x09,
XnFlashFileTypeImageCmos = 0x0A,
XnFlashFileTypeDepthCmos = 0x0B,
XnFlashFileTypeAlgorithmParams = 0x0C,
XnFlashFileTypeReferenceQVGA = 0x0D,
XnFlashFileTypeReferenceVGA = 0x0E,
XnFlashFileTypeMaintenance = 0x0F,
XnFlashFileTypeDebugParams = 0x10,
XnFlashFileTypePrimeProcessor = 0x11,
XnFlashFileTypeGainControl = 0x12,
XnFlashFileTypeRegistartionParams = 0x13,
XnFlashFileTypeIDParams = 0x14,
XnFlashFileTypeSensorTECParams = 0x15,
XnFlashFileTypeSensorAPCParams = 0x16,
XnFlashFileTypeSensorProjectorFaultParams = 0x17,
XnFlashFileTypeProductionFile = 0x18,
XnFlashFileTypeUpgradeInProgress = 0x19,
XnFlashFileTypeWavelengthCorrection = 0x1A,
XnFlashFileTypeGMCReferenceOffset = 0x1B,
XnFlashFileTypeSensorNESAParams = 0x1C,
XnFlashFileTypeSensorFault = 0x1D,
XnFlashFileTypeVendorData = 0x1E,
} XnFlashFileType;
typedef enum XnBistType
{
//Auto tests
XN_BIST_IMAGE_CMOS = 1 << 0,
XN_BIST_IR_CMOS = 1 << 1,
XN_BIST_POTENTIOMETER = 1 << 2,
XN_BIST_FLASH = 1 << 3,
XN_BIST_FULL_FLASH = 1 << 4,
XN_BIST_PROJECTOR_TEST_MASK = 1 << 5,
XN_BIST_TEC_TEST_MASK = 1 << 6,
// Manual tests
XN_BIST_NESA_TEST_MASK = 1 << 7,
XN_BIST_NESA_UNLIMITED_TEST_MASK = 1 << 8,
// Mask of all the auto tests
XN_BIST_ALL = (0xFFFFFFFF & ~XN_BIST_NESA_TEST_MASK & ~XN_BIST_NESA_UNLIMITED_TEST_MASK),
} XnBistType;
typedef enum XnBistError
{
XN_BIST_RAM_TEST_FAILURE = 1 << 0,
XN_BIST_IR_CMOS_CONTROL_BUS_FAILURE = 1 << 1,
XN_BIST_IR_CMOS_DATA_BUS_FAILURE = 1 << 2,
XN_BIST_IR_CMOS_BAD_VERSION = 1 << 3,
XN_BIST_IR_CMOS_RESET_FAILUE = 1 << 4,
XN_BIST_IR_CMOS_TRIGGER_FAILURE = 1 << 5,
XN_BIST_IR_CMOS_STROBE_FAILURE = 1 << 6,
XN_BIST_COLOR_CMOS_CONTROL_BUS_FAILURE = 1 << 7,
XN_BIST_COLOR_CMOS_DATA_BUS_FAILURE = 1 << 8,
XN_BIST_COLOR_CMOS_BAD_VERSION = 1 << 9,
XN_BIST_COLOR_CMOS_RESET_FAILUE = 1 << 10,
XN_BIST_FLASH_WRITE_LINE_FAILURE = 1 << 11,
XN_BIST_FLASH_TEST_FAILURE = 1 << 12,
XN_BIST_POTENTIOMETER_CONTROL_BUS_FAILURE = 1 << 13,
XN_BIST_POTENTIOMETER_FAILURE = 1 << 14,
XN_BIST_AUDIO_TEST_FAILURE = 1 << 15,
XN_BIST_PROJECTOR_TEST_LD_FAIL = 1 << 16,
XN_BIST_PROJECTOR_TEST_LD_FAILSAFE_TRIG_FAIL = 1 << 17,
XN_BIST_PROJECTOR_TEST_FAILSAFE_HIGH_FAIL = 1 << 18,
XN_BIST_PROJECTOR_TEST_FAILSAFE_LOW_FAIL = 1 << 19,
XN_TEC_TEST_HEATER_CROSSED = 1 << 20,
XN_TEC_TEST_HEATER_DISCONNETED = 1 << 21,
XN_TEC_TEST_TEC_CROSSED = 1 << 22,
XN_TEC_TEST_TEC_FAULT = 1 << 23,
} XnBistError;
typedef enum XnDepthCMOSType
{
XN_DEPTH_CMOS_NONE = 0,
XN_DEPTH_CMOS_MT9M001 = 1,
XN_DEPTH_CMOS_AR130 = 2,
XN_DEPTH_CMOS_OV9151 = 3,
XN_DEPTH_CMOS_OV9282 = 7,
XN_DEPTH_CMOS_AR0144 = 8,
} XnDepthCMOSType;
typedef enum XnImageCMOSType
{
XN_IMAGE_CMOS_NONE = 0,
XN_IMAGE_CMOS_MT9M112 = 1,
XN_IMAGE_CMOS_MT9D131 = 2,
XN_IMAGE_CMOS_MT9M114 = 3,
} XnImageCMOSType;
#define XN_IO_MAX_I2C_BUFFER_SIZE 10
#define XN_MAX_LOG_SIZE (6*1024)
#pragma pack (push, 1)
typedef struct XnSDKVersion
{
unsigned char nMajor;
unsigned char nMinor;
unsigned char nMaintenance;
unsigned short nBuild;
} XnSDKVersion;
typedef struct {
unsigned char nMajor;
unsigned char nMinor;
unsigned short nBuild;
unsigned int nChip;
unsigned short nFPGA;
unsigned short nSystemVersion;
XnSDKVersion SDK;
XnHWVer HWVer;
XnFWVer FWVer;
XnSensorVer SensorVer;
XnChipVer ChipVer;
} XnVersions;
typedef struct
{
unsigned short nParam;
unsigned short nValue;
} XnInnerParamData;
typedef struct XnDepthAGCBin
{
unsigned short nBin;
unsigned short nMin;
unsigned short nMax;
} XnDepthAGCBin;
typedef struct XnControlProcessingData
{
unsigned short nRegister;
unsigned short nValue;
} XnControlProcessingData;
typedef struct XnAHBData
{
unsigned int nRegister;
unsigned int nValue;
unsigned int nMask;
} XnAHBData;
typedef struct XnPixelRegistration
{
unsigned int nDepthX;
unsigned int nDepthY;
uint16_t nDepthValue;
unsigned int nImageXRes;
unsigned int nImageYRes;
unsigned int nImageX; // out
unsigned int nImageY; // out
} XnPixelRegistration;
typedef struct XnLedState
{
uint16_t nLedID;
uint16_t nState;
} XnLedState;
typedef struct XnCmosBlankingTime
{
XnCMOSType nCmosID;
float nTimeInMilliseconds;
uint16_t nNumberOfFrames;
} XnCmosBlankingTime;
typedef struct XnCmosBlankingUnits
{
XnCMOSType nCmosID;
uint16_t nUnits;
uint16_t nNumberOfFrames;
} XnCmosBlankingUnits;
typedef struct XnI2CWriteData
{
uint16_t nBus;
uint16_t nSlaveAddress;
uint16_t cpWriteBuffer[XN_IO_MAX_I2C_BUFFER_SIZE];
uint16_t nWriteSize;
} XnI2CWriteData;
typedef struct XnI2CReadData
{
uint16_t nBus;
uint16_t nSlaveAddress;
uint16_t cpReadBuffer[XN_IO_MAX_I2C_BUFFER_SIZE];
uint16_t cpWriteBuffer[XN_IO_MAX_I2C_BUFFER_SIZE];
uint16_t nReadSize;
uint16_t nWriteSize;
} XnI2CReadData;
typedef struct XnTecData
{
uint16_t m_SetPointVoltage;
uint16_t m_CompensationVoltage;
uint16_t m_TecDutyCycle; //duty cycle on heater/cooler
uint16_t m_HeatMode; //TRUE - heat, FALSE - cool
int32_t m_ProportionalError;
int32_t m_IntegralError;
int32_t m_DerivativeError;
uint16_t m_ScanMode; //0 - crude, 1 - precise
} XnTecData;
typedef struct XnTecFastConvergenceData
{
int16_t m_SetPointTemperature; // set point temperature in celsius,
// scaled by factor of 100 (extra precision)
int16_t m_MeasuredTemperature; // measured temperature in celsius,
// scaled by factor of 100 (extra precision)
int32_t m_ProportionalError; // proportional error in system clocks
int32_t m_IntegralError; // integral error in system clocks
int32_t m_DerivativeError; // derivative error in system clocks
uint16_t m_ScanMode; // 0 - initial, 1 - crude, 2 - precise
uint16_t m_HeatMode; // 0 - idle, 1 - heat, 2 - cool
uint16_t m_TecDutyCycle; // duty cycle on heater/cooler in percents
uint16_t m_TemperatureRange; // 0 - cool, 1 - room, 2 - warm
} XnTecFastConvergenceData;
typedef struct XnEmitterData
{
uint16_t m_State; //idle, calibrating
uint16_t m_SetPointVoltage; //this is what should be written to the XML
uint16_t m_SetPointClocks; //target cross duty cycle
uint16_t m_PD_Reading; //current cross duty cycle in system clocks(high time)
uint16_t m_EmitterSet; //duty cycle on emitter set in system clocks (high time).
uint16_t m_EmitterSettingLogic; //TRUE = positive logic, FALSE = negative logic
uint16_t m_LightMeasureLogic; //TRUE - positive logic, FALSE - negative logic
uint16_t m_IsAPCEnabled;
uint16_t m_EmitterSetStepSize; // in MilliVolts
uint16_t m_ApcTolerance; // in system clocks (only valid up till v5.2)
uint16_t m_SubClocking; //in system clocks (only valid from v5.3)
uint16_t m_Precision; // (only valid from v5.3)
} XnEmitterData;
typedef struct
{
uint16_t nId;
uint16_t nAttribs;
} XnFileAttributes;
typedef struct
{
uint32_t nOffset;
const char* strFileName;
uint16_t nAttributes;
} XnParamFileData;
typedef struct
{
uint32_t nOffset;
uint32_t nSize;
unsigned char* pData;
} XnParamFlashData;
typedef struct {
uint16_t nId;
uint16_t nType;
uint32_t nVersion;
uint32_t nOffset;
uint32_t nSize;
uint16_t nCrc;
uint16_t nAttributes;
uint16_t nReserve;
} XnFlashFile;
typedef struct
{
XnFlashFile* pFiles;
uint16_t nFiles;
} XnFlashFileList;
typedef struct XnProjectorFaultData
{
uint16_t nMinThreshold;
uint16_t nMaxThreshold;
int32_t bProjectorFaultEvent;
} XnProjectorFaultData;
typedef struct XnBist
{
uint32_t nTestsMask;
uint32_t nFailures;
} XnBist;
//public key and batch version
typedef struct OBEccVerify
{
char Pub_x[48]; //public key x 48 bytes
char Pub_y[48]; //public key y 48 bytes
char Batch_Ver[12]; //batch version 12 bytes
}OBEccVerify;
//get init random string
typedef struct OBEccInit
{
char RandomStr[48];
char Batch_Ver[12];
}OBEccInit;
//r s key
typedef struct OBEccRSKey
{
char R_key[48];
char S_key[48];
}OBEccRSKey;
//rgb ae mode
typedef struct XnRgbAeMode
{
uint16_t nAeMode;
uint16_t nAeTarget;
} XnRgbAeMode;
typedef struct XnDepthOptimizationParam
{
double nParam1;
double nParam2;
double nParam3;
}XnDepthOptimizationParam;
#pragma pack (pop)
#endif // PS1080_H
@@ -0,0 +1,239 @@
/*****************************************************************************
* *
* OpenNI 2.x Alpha *
* Copyright (C) 2012 PrimeSense Ltd. *
* *
* This file is part of OpenNI. *
* *
* Licensed under the Apache License, Version 2.0 (the "License"); *
* you may not use this file except in compliance with the License. *
* You may obtain a copy of the License at *
* *
* http://www.apache.org/licenses/LICENSE-2.0 *
* *
* Unless required by applicable law or agreed to in writing, software *
* distributed under the License is distributed on an "AS IS" BASIS, *
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. *
* See the License for the specific language governing permissions and *
* limitations under the License. *
* *
*****************************************************************************/
#ifndef PSLINK_H
#define PSLINK_H
#include <PrimeSense.h>
enum
{
/**** Device properties ****/
/* XnDetailedVersion, get only */
LINK_PROP_FW_VERSION = 0x12000001, // "FWVersion"
/* Int, get only */
LINK_PROP_VERSIONS_INFO_COUNT = 0x12000002, // "VersionsInfoCount"
/* General - array - XnComponentVersion * count elements, get only */
LINK_PROP_VERSIONS_INFO = 0x12000003, // "VersionsInfo"
/* Int - 0 means off, 1 means on. */
LINK_PROP_PROJECTOR_ACTIVE = 0x12000008, // "ProjectorActive"
/* String. Set only */
LINK_PROP_PRESET_FILE = 0x1200000a, // "PresetFile"
/* Get only */
LINK_PROP_BOOT_STATUS = 0x1200000b,
/* Int - system specific units */
LINK_PROP_PROJECTOR_POWER = 0x1200000c,
/* SetAccActive*/
LINK_PROP_ACC_ENABLED = 0x1200000d,
/* SetAccActive*/
LINK_PROP_VDD_ENABLED = 0x1200000e,
/* SetAccActive*/
LINK_PROP_PERIODIC_BIST_ENABLED = 0x1200000f,
/**** Device commands ****/
/* XnCommandGetFwStreams */
LINK_COMMAND_GET_FW_STREAM_LIST = 0x1200F001,
/* XnCommandCreateStream */
LINK_COMMAND_CREATE_FW_STREAM = 0x1200F002,
/* XnCommandDestroyStream */
LINK_COMMAND_DESTROY_FW_STREAM = 0x1200F003,
/* XnCommandStartStream */
LINK_COMMAND_START_FW_STREAM = 0x1200F004,
/* XnCommandStopStream */
LINK_COMMAND_STOP_FW_STREAM = 0x1200F005,
/* XnCommandGetFwStreamVideoModeList */
LINK_COMMAND_GET_FW_STREAM_VIDEO_MODE_LIST = 0x1200F006,
/* XnCommandSetFwStreamVideoMode */
LINK_COMMAND_SET_FW_STREAM_VIDEO_MODE = 0x1200F007,
/* XnCommandGetFwStreamVideoMode */
LINK_COMMAND_GET_FW_STREAM_VIDEO_MODE = 0x1200F008,
/* XnCommandSetProjectorPulse */
LINK_COMMAND_SET_PROJECTOR_PULSE = 0x1200F009,
/* No args */
LINK_COMMAND_DISABLE_PROJECTOR_PULSE = 0x1200F00a,
/**** Stream properties ****/
/* Int. 1 - Shifts 9.3, 2 - Grayscale16, 3 - YUV422, 4 - Bayer8 */
LINK_PROP_PIXEL_FORMAT = 0x12001001, // "PixelFormat"
/* Int. 0 - None, 1 - 8z, 2 - 16z, 3 - 24z, 4 - 6-bit, 5 - 10-bit, 6 - 11-bit, 7 - 12-bit */
LINK_PROP_COMPRESSION = 0x12001002, // "Compression"
/**** Depth Stream properties ****/
/* Real, get only */
LINK_PROP_DEPTH_SCALE = 0x1200000b, // "DepthScale"
/* Int, get only */
LINK_PROP_MAX_SHIFT = 0x12002001, // "MaxShift"
/* Int, get only */
LINK_PROP_ZERO_PLANE_DISTANCE = 0x12002002, // "ZPD"
/* Int, get only */
LINK_PROP_CONST_SHIFT = 0x12002003, // "ConstShift"
/* Int, get only */
LINK_PROP_PARAM_COEFF = 0x12002004, // "ParamCoeff"
/* Int, get only */
LINK_PROP_SHIFT_SCALE = 0x12002005, // "ShiftScale"
/* Real, get only */
LINK_PROP_ZERO_PLANE_PIXEL_SIZE = 0x12002006, // "ZPPS"
/* Real, get only */
LINK_PROP_ZERO_PLANE_OUTPUT_PIXEL_SIZE = 0x12002007, // "ZPOPS"
/* Real, get only */
LINK_PROP_EMITTER_DEPTH_CMOS_DISTANCE = 0x12002008, // "LDDIS"
/* General - array - MaxShift * XnDepthPixel elements, get only */
LINK_PROP_SHIFT_TO_DEPTH_TABLE = 0x12002009, // "S2D"
/* General - array - MaxDepth * uint16_t elements, get only */
LINK_PROP_DEPTH_TO_SHIFT_TABLE = 0x1200200a, // "D2S"
};
typedef enum XnFileZone
{
XN_ZONE_FACTORY = 0x0000,
XN_ZONE_UPDATE = 0x0001,
} XnFileZone;
typedef enum XnBootErrorCode
{
XN_BOOT_OK = 0x0000,
XN_BOOT_BAD_CRC = 0x0001,
XN_BOOT_UPLOAD_IN_PROGRESS = 0x0002,
XN_BOOT_FW_LOAD_FAILED = 0x0003,
} XnBootErrorCode;
typedef enum XnFwStreamType
{
XN_FW_STREAM_TYPE_COLOR = 0x0001,
XN_FW_STREAM_TYPE_IR = 0x0002,
XN_FW_STREAM_TYPE_SHIFTS = 0x0003,
XN_FW_STREAM_TYPE_AUDIO = 0x0004,
XN_FW_STREAM_TYPE_DY = 0x0005,
XN_FW_STREAM_TYPE_LOG = 0x0008,
} XnFwStreamType;
typedef enum XnFwPixelFormat
{
XN_FW_PIXEL_FORMAT_NONE = 0x0000,
XN_FW_PIXEL_FORMAT_SHIFTS_9_3 = 0x0001,
XN_FW_PIXEL_FORMAT_GRAYSCALE16 = 0x0002,
XN_FW_PIXEL_FORMAT_YUV422 = 0x0003,
XN_FW_PIXEL_FORMAT_BAYER8 = 0x0004,
} XnFwPixelFormat;
typedef enum XnFwCompressionType
{
XN_FW_COMPRESSION_NONE = 0x0000,
XN_FW_COMPRESSION_8Z = 0x0001,
XN_FW_COMPRESSION_16Z = 0x0002,
XN_FW_COMPRESSION_24Z = 0x0003,
XN_FW_COMPRESSION_6_BIT_PACKED = 0x0004,
XN_FW_COMPRESSION_10_BIT_PACKED = 0x0005,
XN_FW_COMPRESSION_11_BIT_PACKED = 0x0006,
XN_FW_COMPRESSION_12_BIT_PACKED = 0x0007,
} XnFwCompressionType;
#pragma pack (push, 1)
#define XN_MAX_VERSION_MODIFIER_LENGTH 16
typedef struct XnDetailedVersion
{
uint8_t m_nMajor;
uint8_t m_nMinor;
uint16_t m_nMaintenance;
uint32_t m_nBuild;
char m_strModifier[XN_MAX_VERSION_MODIFIER_LENGTH];
} XnDetailedVersion;
typedef struct XnBootStatus
{
XnFileZone zone;
XnBootErrorCode errorCode;
} XnBootStatus;
typedef struct XnFwStreamInfo
{
XnFwStreamType type;
char creationInfo[80];
} XnFwStreamInfo;
typedef struct XnFwStreamVideoMode
{
uint32_t m_nXRes;
uint32_t m_nYRes;
uint32_t m_nFPS;
XnFwPixelFormat m_nPixelFormat;
XnFwCompressionType m_nCompression;
} XnFwStreamVideoMode;
typedef struct XnCommandGetFwStreamList
{
uint32_t count; // in: number of allocated elements in streams array. out: number of written elements in the array
XnFwStreamInfo* streams;
} XnCommandGetFwStreamList;
typedef struct XnCommandCreateStream
{
XnFwStreamType type;
const char* creationInfo;
uint32_t id; // out
} XnCommandCreateStream;
typedef struct XnCommandDestroyStream
{
uint32_t id;
} XnCommandDestroyStream;
typedef struct XnCommandStartStream
{
uint32_t id;
} XnCommandStartStream;
typedef struct XnCommandStopStream
{
uint32_t id;
} XnCommandStopStream;
typedef struct XnCommandGetFwStreamVideoModeList
{
int streamId;
uint32_t count; // in: number of allocated elements in videoModes array. out: number of written elements in the array
XnFwStreamVideoMode* videoModes;
} XnCommandGetFwStreamVideoModeList;
typedef struct XnCommandSetFwStreamVideoMode
{
int streamId;
XnFwStreamVideoMode videoMode;
} XnCommandSetFwStreamVideoMode;
typedef struct XnCommandGetFwStreamVideoMode
{
int streamId;
XnFwStreamVideoMode videoMode; // out
} XnCommandGetFwStreamVideoMode;
typedef struct XnCommandSetProjectorPulse
{
float delay; //start delay - delay time before start pulse
float width; //DC - duty cycle - the percentage of the pulse out of total cycle
float cycle;
} XnCommandSetProjectorPulse;
#pragma pack (pop)
#endif // PSLINK_H
@@ -0,0 +1,260 @@
/*****************************************************************************
* *
* OpenNI 2.x Alpha *
* Copyright (C) 2012 PrimeSense Ltd. *
* *
* This file is part of OpenNI. *
* *
* Licensed under the Apache License, Version 2.0 (the "License"); *
* you may not use this file except in compliance with the License. *
* You may obtain a copy of the License at *
* *
* http://www.apache.org/licenses/LICENSE-2.0 *
* *
* Unless required by applicable law or agreed to in writing, software *
* distributed under the License is distributed on an "AS IS" BASIS, *
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. *
* See the License for the specific language governing permissions and *
* limitations under the License. *
* *
*****************************************************************************/
#ifndef PRIMESENSE_H
#define PRIMESENSE_H
#include <OniCTypes.h>
/**
* Additional properties for PrimeSense devices
*
* @remarks
* properties structure is 0x1D27XXYY where XX is range and YY is code.
* range values:
* 00 - common stream properties
* 10 - depth stream properties
* E0 - device commands
* F0 - device properties
*/
enum
{
// Stream Properties
PS_PROPERTY_DUMP_DATA = 0x1d270001, // boolean
PS_PROPERTY_GAIN = 0x1d270002, // int - system specific
// Device Properties
PS_PROPERTY_USB_INTERFACE = 0x1d27F001, // values from XnUsbInterfaceType
};
/**
* Additional commands for PrimeSense devices
*
* @remarks
* Commands structure is 0x1D27XXYY where XX is range and YY is code.
* range values:
* E0 - device commands
*/
enum
{
// Device Commands - use via invoke()
PS_COMMAND_AHB_READ = 0x1d27E001, // XnCommandAHB
PS_COMMAND_AHB_WRITE = 0x1d27E002, // XnCommandAHB
PS_COMMAND_I2C_READ = 0x1d27E003, // XnCommandI2C
PS_COMMAND_I2C_WRITE = 0x1d27E004, // XnCommandI2C
PS_COMMAND_SOFT_RESET = 0x1d27E005, // no arguments
PS_COMMAND_POWER_RESET = 0x1d27E006, // no arguments
PS_COMMAND_BEGIN_FIRMWARE_UPDATE = 0x1d27E007, // no arguments
PS_COMMAND_END_FIRMWARE_UPDATE = 0x1d27E008, // no arguments
PS_COMMAND_UPLOAD_FILE = 0x1d27E009, // XnCommandUploadFile
PS_COMMAND_DOWNLOAD_FILE = 0x1d27E00A, // XnCommandDownloadFile
PS_COMMAND_GET_FILE_LIST = 0x1d27E00B, // an array of XnFileEntry
PS_COMMAND_FORMAT_ZONE = 0x1d27E00C, // XnCommandFormatZone
PS_COMMAND_DUMP_ENDPOINT = 0x1d27E00D, // XnCommandDumpEndpoint
PS_COMMAND_GET_I2C_DEVICE_LIST = 0x1d27E00E, // XnCommandGetI2CDevices
PS_COMMAND_GET_BIST_LIST = 0x1d27E00F, // XnCommandGetBistList
PS_COMMAND_EXECUTE_BIST = 0x1d27E010, // XnCommandExecuteBist
PS_COMMAND_USB_TEST = 0x1d27E011, // XnCommandUsbTest
PS_COMMAND_GET_LOG_MASK_LIST = 0x1d27E012, // XnCommandGetLogMaskList
PS_COMMAND_SET_LOG_MASK_STATE = 0x1d27E013, // XnCommandSetLogMaskState
PS_COMMAND_START_LOG = 0x1d27E014, // no arguments
PS_COMMAND_STOP_LOG = 0x1d27E015, // no arguments
PS_COMMAND_READ_TEMPERATURE = 0x1d27E016, // no arguments
PS_COMMAND_GET_TEMP_LIST = 0x1d27E017,// PrintTempList
PS_COMMAND_READ_DEBUG_DATA = 0x1d27E018, //ReadDebugDaata
};
typedef enum XnUsbInterfaceType
{
PS_USB_INTERFACE_DONT_CARE = 0,
PS_USB_INTERFACE_ISO_ENDPOINTS = 1,
PS_USB_INTERFACE_BULK_ENDPOINTS = 2,
} XnUsbInterfaceType;
#pragma pack (push, 1)
// Data Types
typedef struct XnFwFileVersion
{
uint8_t major;
uint8_t minor;
uint8_t maintenance;
uint8_t build;
} XnFwFileVersion;
typedef enum XnFwFileFlags
{
XN_FILE_FLAG_BAD_CRC = 0x0001,
} XnFwFileFlags;
typedef struct XnFwFileEntry
{
char name[32];
XnFwFileVersion version;
uint32_t address;
uint32_t size;
uint16_t crc;
uint16_t zone;
XnFwFileFlags flags; // bitmap
} XnFwFileEntry;
typedef struct XnI2CDeviceInfo
{
uint8_t masterId;
uint8_t slaveId;
uint32_t id;
char name[32];
} XnI2CDeviceInfo;
typedef struct XnBistInfo
{
uint32_t id;
char name[32];
} XnBistInfo;
typedef struct XnTempInfo
{
uint32_t id;
char name[16];
} XnTempInfo;
typedef struct XnFwLogMask
{
uint32_t id;
char name[32];
} XnFwLogMask;
typedef struct XnUsbTestEndpointResult
{
double averageBytesPerSecond;
uint32_t lostPackets;
} XnUsbTestEndpointResult;
// Commands
typedef struct XnCommandAHB
{
uint32_t address; // Address of this register
uint32_t offsetInBits; // Offset of the field in bits within address
uint32_t widthInBits; // Width of the field in bits
uint32_t value; // For read requests, this is where the actual value will be filled. For write requests, the value to write.
} XnCommandAHB;
typedef struct XnCommandI2C
{
uint32_t deviceID; // Device to communicate with
uint32_t addressSize; // Size of the address, in bytes (1-4)
uint32_t address; // Address
uint32_t valueSize; // Size of the value, in bytes (1-4)
uint32_t mask; // For write request - a mask to be applied to the value. For read requests - ignored.
uint32_t value; // For write request - the value to be written. For read requests - the place where the actual value is written to
} XnCommandI2C;
typedef struct XnCommandUploadFile
{
const char* filePath;
uint32_t uploadToFactory;
} XnCommandUploadFile;
typedef struct XnCommandDownloadFile
{
uint16_t zone;
const char* firmwareFileName;
const char* targetPath;
} XnCommandDownloadFile;
typedef struct XnCommandGetFileList
{
uint32_t count; // in: number of allocated elements in files array. out: number of written elements in the array
XnFwFileEntry* files;
} XnCommandGetFileList;
typedef struct XnCommandFormatZone
{
uint8_t zone;
} XnCommandFormatZone;
typedef struct XnCommandDumpEndpoint
{
uint8_t endpoint;
bool enabled;
} XnCommandDumpEndpoint;
typedef struct XnCommandGetI2CDeviceList
{
uint32_t count; // in: number of allocated elements in devices array. out: number of written elements in the array
XnI2CDeviceInfo* devices;
} XnCommandGetI2CDeviceList;
typedef struct XnCommandGetBistList
{
uint32_t count; // in: number of allocated elements in tests array. out: number of written elements in the array
XnBistInfo* tests;
} XnCommandGetBistList;
typedef struct XnCommandGetTempList
{
uint32_t count; // in: number of allocated elements in tests array. out: number of written elements in the array
XnTempInfo* pTempInfos;
} XnCommandGetTempList;
typedef struct XnCommandExecuteBist
{
uint32_t id;
uint32_t errorCode;
uint32_t extraDataSize; // in: number of allocated bytes in extraData. out: number of written bytes in extraData
uint8_t* extraData;
} XnCommandExecuteBist;
typedef struct XnCommandTemperatureResponse
{
uint32_t id;
float temperature;
} XnCommandTemperatureResponse;
typedef struct XnCommandUsbTest
{
uint32_t seconds;
uint32_t endpointCount; // in: number of allocated bytes in endpoints array. out: number of written bytes in array
XnUsbTestEndpointResult* endpoints;
} XnCommandUsbTest;
typedef struct XnCommandGetLogMaskList
{
uint32_t count; // in: number of allocated elements in masks array. out: number of written elements in the array
XnFwLogMask* masks;
} XnCommandGetLogMaskList;
typedef struct XnCommandSetLogMaskState
{
uint32_t mask;
bool enabled;
} XnCommandSetLogMaskState;
typedef struct XnCommandDebugData
{
uint16_t dataID; // Values come from XnLinkInternalPropID
uint16_t dataSize; // in: size of allocated buffer in data, out: actual bytes written to data
uint8_t* data;
} XnCommandDebugData;
#pragma pack (pop)
#endif // PRIMESENSE_H
@@ -0,0 +1,139 @@
/*****************************************************************************
* *
* OpenNI 2.x Alpha *
* Copyright (C) 2012 PrimeSense Ltd. *
* *
* This file is part of OpenNI. *
* *
* Licensed under the Apache License, Version 2.0 (the "License"); *
* you may not use this file except in compliance with the License. *
* You may obtain a copy of the License at *
* *
* http://www.apache.org/licenses/LICENSE-2.0 *
* *
* Unless required by applicable law or agreed to in writing, software *
* distributed under the License is distributed on an "AS IS" BASIS, *
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. *
* See the License for the specific language governing permissions and *
* limitations under the License. *
* *
*****************************************************************************/
#ifndef ONIPLATFORMWIN32_H
#define ONIPLATFORMWIN32_H
//---------------------------------------------------------------------------
// Prerequisites
//---------------------------------------------------------------------------
#ifndef WINVER // Allow use of features specific to Windows XP or later
#define WINVER 0x0501
#endif
#ifndef _WIN32_WINNT // Allow use of features specific to Windows XP or later
#define _WIN32_WINNT 0x0501
#endif
#ifndef _WIN32_WINDOWS // Allow use of features specific to Windows 98 or later
#define _WIN32_WINDOWS 0x0410
#endif
#ifndef _WIN32_IE // Allow use of features specific to IE 6.0 or later
#define _WIN32_IE 0x0600
#endif
#define WIN32_LEAN_AND_MEAN // Exclude rarely-used stuff from Windows headers
// Undeprecate CRT functions
#ifndef _CRT_SECURE_NO_DEPRECATE
#define _CRT_SECURE_NO_DEPRECATE 1
#endif
//---------------------------------------------------------------------------
// Includes
//---------------------------------------------------------------------------
#include <windows.h>
#include <stdlib.h>
#include <stdio.h>
#include <malloc.h>
#include <io.h>
#include <time.h>
#include <assert.h>
#include <float.h>
#include <crtdbg.h>
#if _MSC_VER < 1600 // Visual Studio 2008 and older doesn't have stdint.h...
typedef signed char int8_t;
typedef short int16_t;
typedef int int32_t;
typedef __int64 int64_t;
typedef unsigned char uint8_t;
typedef unsigned short uint16_t;
typedef unsigned int uint32_t;
typedef unsigned __int64 uint64_t;
#else
#include <stdint.h>
#endif
//---------------------------------------------------------------------------
// Platform Basic Definition
//---------------------------------------------------------------------------
#define ONI_PLATFORM ONI_PLATFORM_WIN32
#define ONI_PLATFORM_STRING "Win32"
//---------------------------------------------------------------------------
// Platform Capabilities
//---------------------------------------------------------------------------
#define ONI_PLATFORM_ENDIAN_TYPE ONI_PLATFORM_IS_LITTLE_ENDIAN
#define ONI_PLATFORM_SUPPORTS_DYNAMIC_LIBS 1
//---------------------------------------------------------------------------
// Memory
//---------------------------------------------------------------------------
/** The default memory alignment. */
#define ONI_DEFAULT_MEM_ALIGN 16
/** The thread static declarator (using TLS). */
#define ONI_THREAD_STATIC __declspec(thread)
//---------------------------------------------------------------------------
// Files
//---------------------------------------------------------------------------
/** The maximum allowed file path size (in bytes). */
#define ONI_FILE_MAX_PATH MAX_PATH
//---------------------------------------------------------------------------
// Call backs
//---------------------------------------------------------------------------
/** The std call type. */
#define ONI_STDCALL __stdcall
/** The call back calling convention. */
#define ONI_CALLBACK_TYPE ONI_STDCALL
/** The C and C++ calling convension. */
#define ONI_C_DECL __cdecl
//---------------------------------------------------------------------------
// Macros
//---------------------------------------------------------------------------
/** Returns the date and time at compile time. */
#define ONI_TIMESTAMP __DATE__ " " __TIME__
/** Converts n into a pre-processor string. */
#define ONI_STRINGIFY(n) ONI_STRINGIFY_HELPER(n)
#define ONI_STRINGIFY_HELPER(n) #n
//---------------------------------------------------------------------------
// API Export/Import Macros
//---------------------------------------------------------------------------
/** Indicates an exported shared library function. */
#define ONI_API_EXPORT __declspec(dllexport)
/** Indicates an imported shared library function. */
#define ONI_API_IMPORT __declspec(dllimport)
/** Indicates a deprecated function */
#if _MSC_VER < 1400 // Before VS2005 there was no support for declspec deprecated...
#define ONI_API_DEPRECATED(msg)
#else
#define ONI_API_DEPRECATED(msg) __declspec(deprecated(msg))
#endif
#endif // ONIPLATFORMWIN32_H
@@ -0,0 +1,17 @@
[Log]
; 0 - Verbose; 1 - Info; 2 - Warning; 3 - Error. Default - None
Verbosity=0
LogToConsole=1
;LogToFile=1
;LogToAndroidLog=1
[Device]
;Override=
;RecordTo=
[Drivers]
; Location of the drivers, relative to OpenNI shared library location. When not provided, "OpenNI2/Drivers" will be used.
;Repository=OpenNI2/Drivers
; List of drivers to load, separated by commas. When not provided, OpenNI will try to load each shared library in Repository.
;List=
@@ -0,0 +1,7 @@
;---------------- Player Configuration -------------------
[Player]
; Speed. 1.0 - 1.0 * fps (default), Values can be R while R is real and grater the 0
;Speed=1.0
; Repeat. 1 - on (default), 0 - off
;Repeat=1
@@ -0,0 +1,48 @@
;---------------- PSLink Driver Default Configuration -------------------
[Device]
; USB interface to be used. 0 - FW Default, 1 - ISO endpoints (default on Windows), 2 - BULK endpoints (default on Linux/Mac/Android machines)
;UsbInterface=2
; Enable firmware logs. 0 - Off (default), 1 - On
;FirmwareLog=1
[Depth]
; Allows dumping all frames to files. 0 - Off (default), 1 - On
;DumpData=1
; Allow flipping the frame horizontally. 0 - Off, 1 - On (default)
;Mirror=0
; Compression of the data passed from device to host. 0 - None, 2 - 16z, 6 - 11-bit packed, 7 - 12-bit packed. Default is set by the firmware
;Compression=2
[Depth.VideoMode]
; Pixel Format. 100 - Depth 1 mm, 101 - Depth 100 um, 102 - Shifts 9.2, 103 - Shifts 9.3
;PixelFormat=100
; Requested X resolution
;XResolution=320
; Requested Y resolution
;YResolution=240
; Requested FPS
;FPS=30
[IR]
; Allows dumping all frames to files. 0 - Off (default), 1 - On
;DumpData=1
; Allow flipping the frame horizontally. 0 - Off, 1 - On (default)
;Mirror=0
; Compression of the data passed from device to host. 0 - None, 5 - 10-bit packed. Default is set by the firmware
;Compression=5
[IR.VideoMode]
; Pixel Format. 200 - RGB888, 202 - Grayscale 8-bit, 203 - Grayscale 16-bit
;PixelFormat=200
; Requested X resolution
;XResolution=320
; Requested Y resolution
;YResolution=240
; Requested FPS
;FPS=30
@@ -0,0 +1,183 @@
;---------------- Sensor Default Configuration -------------------
[Device]
; Mirroring. 0 - Off (default), 1 - On
;Mirror=1
; FrameSync. 0 - Off (default), 1 - On
;FrameSync=1
; Stream Data Timestamps. 0 - milliseconds, 1 - microseconds (default)
;HighResTimestamps=1
; Stream Data Timestamps Source. 0 - Firmware (default), 1 - Host
;HostTimestamps=0
; A filter for the firmware log. Default is determined by firmware.
;FirmwareLogFilter=0
; Automatic firmare log retrieval. 0 - Off (default), or the number of milliseconds between log retrievals operations.
;FirmwareLogInterval=1000
; Print firmware log to console when automatic firmware log retrieval is on. 0 - Off (default), 1 - On
;FirmwareLogPrint=1
; Is APC enabled. 0 - Off, 1 - On (default)
;APCEnabled=1
; USB interface to be used. 0 - FW Default, 1 - ISO endpoints (default on Windows), 2 - BULK endpoints (default on Linux/Mac/Android machines), 3 - ISO endpoints for low-bandwidth depth
UsbInterface=2
[Depth]
; Output format. 100 - 1mm depth values (default), 102 - u9.2 Shift values.
;OutputFormat=100
; Is stream mirrored. 0 - Off, 1 - On
;Mirror=1
; 0 - QVGA, 1 - VGA, 4 - QQVGA. Default: Arm - 4, other platforms - 0, -14 1280x720, 15 1280x960,-16 1280x800, -17 640x400 -20 320x200,-21 480x640, -25 960x1280, -26 800x1280,-27 400x640
Resolution=1
; Frames per second (default is 30)
;FPS=30
; Min depth cutoff. 0-10000 mm (default is 0)
;MinDepthValue=0
; Max depth cutoff. 0-10000 mm (default is 10000)
;MaxDepthValue=10000
; Input format. 0 - Uncompressed 16-bit, 1 - PS Compression,2 - Packed 10-bit, 3 - Packed 11-bit, 4 - Packed 12-bit. Default: Arm - 4, other platforms - 3
InputFormat=3
; Registration. 0 - Off (default), 1 - On
;Registration=1
; Registration Type. 0 - Don't care (default), 1 - use hardware accelaration, 2 - perform in software
;RegistrationType=0
; software filter 0-off ,1--on (default)
;SoftFilter=0
; Depth Rotate 0-off(default) ,1--on (only atlas device support)
;DepthRotate=0
;Read Params (for test only)
;ReadParams=0
; dual sensor: 5.96 mm
;focallength=5.96
;dual sensor: 0.0052mm
;dPlanePixelSize=0.113967
;dPlaneDistance=130
;dual sensor: 75mm
;dEmitterDcmosDistance=7.500000
;dhorizontalFov=0.022600
;dverticalFov=0.796616
; Hole Filler. 0 - Off, 1 - On (default)
;HoleFilter=0
; White Balance. 0 - Off, 1 - On (default)
;WhiteBalancedEnabled=0
; Gain. 0-50 (0 - Auto, 1 - Min., 50 - Max.). Default value is set by firmware.
;Gain=0
; Close Range Mode. 0 - Off (default), 1 - On
;CloseRange=1
; GMC Mode. 0 - Off, 1 - On (default)
;GMCMode=0
; GMC Debug. 0 - Off (default), 1 - On
;GMCDebug=1
; Depth Auto Gain Region-of-Interest. Default values are set by firmware.
;DepthAGCBin0MinDepth=500
;DepthAGCBin0MaxDepth=800
;DepthAGCBin1MinDepth=1500
;DepthAGCBin1MaxDepth=1800
;DepthAGCBin2MinDepth=2500
;DepthAGCBin2MaxDepth=2800
;DepthAGCBin3MinDepth=3500
;DepthAGCBin3MaxDepth=3800
; Wavelength Correction Mechanism. 0 - Off (default), 1 - On
;WavelengthCorrection=1
; Wavelength Correction debug info. 0 - Off (default), 1 - On
;WavelengthCorrectionDebug=1
; Cropping mode. 1 - Normal (default), 2 - Increased FPS, 3 - Software only
;CroppingMode=2
; Cropping area
[Depth.Cropping]
OffsetX=0
OffsetY=0
SizeX=320
SizeY=240
;Enabled=1
[Image]
; Output format. 200 - RGB888 (default), 201 - YUV422, 202 - Gray8 (2.0 MP only), 205 - YUYV
;OutputFormat=201
; Is stream mirrored. 0 - Off, 1 - On
;Mirror=1
; 0 - QVGA (default), 1 - VGA, 2 - SXGA (1.3MP), 3 - UXGA (2.0MP), 14 - 720p, 15 - 1280x960
Resolution=1
; Frames per second (default is 30)
;FPS=30
; Input format. 0 - Compressed 8-bit BAYER (1.3MP or 2.0MP only), 1 - Compressed YUV422 (default in BULK), 2 - Jpeg, 5 - Uncompressed YUV422 (default in ISO), 6 - Uncompressed 8-bit BAYER (1.3MP or 2.0MP only), 7 - Uncompressed YUYV
InputFormat=5
; Anti Flicker. 0 - Off (default), 50 - 50Hz, 60 - 60 Hz.
;Flicker=50
; Image quality when using Jpeg. 1-10 (1 - Lowest, 10 - Highest (default))
;Quality=10
; Cropping mode. 1 - Normal (default), 2 - Increased FPS, 3 - Software only
;CroppingMode=1
; Cropping area
[Image.Cropping]
;OffsetX=0
;OffsetY=0
;SizeX=320
;SizeY=240
;Enabled=1
[IR]
; Output format. 200 - RGB888, 203 - Grayscale 16-bit (default)
;OutputFormat=203
; Is stream mirrored. 0 - Off, 1 - On
;Mirror=1
; 0 - QVGA (default), 1 - VGA, 2 - SXGA(1.3MP), 4 - QQVGA. -14 1280x720, 15 1280x960,-16 1280x800, -17 640x400 -20 320x200,-21 480x640, -25 960x1280, -26 800x1280,-27 400x640
Resolution=1
; Frames per second (default is 30)
;FPS=30
; Cropping mode. 1 - Normal (default), 2 - Increased FPS, 3 - Software only
;CroppingMode=1
; Cropping area
[IR.Cropping]
;OffsetX=0
;OffsetY=0
;SizeX=320
;SizeY=240
;Enabled=1
@@ -0,0 +1,17 @@
[Log]
; 0 - Verbose; 1 - Info; 2 - Warning; 3 - Error. Default - None
Verbosity=0
LogToConsole=1
;LogToFile=1
;LogToAndroidLog=1
[Device]
;Override=
;RecordTo=
[Drivers]
; Location of the drivers, relative to OpenNI shared library location. When not provided, "OpenNI2/Drivers" will be used.
;Repository=OpenNI2/Drivers
; List of drivers to load, separated by commas. When not provided, OpenNI will try to load each shared library in Repository.
;List=
@@ -0,0 +1,7 @@
;---------------- Player Configuration -------------------
[Player]
; Speed. 1.0 - 1.0 * fps (default), Values can be R while R is real and grater the 0
;Speed=1.0
; Repeat. 1 - on (default), 0 - off
;Repeat=1
@@ -0,0 +1,48 @@
;---------------- PSLink Driver Default Configuration -------------------
[Device]
; USB interface to be used. 0 - FW Default, 1 - ISO endpoints (default on Windows), 2 - BULK endpoints (default on Linux/Mac/Android machines)
;UsbInterface=2
; Enable firmware logs. 0 - Off (default), 1 - On
;FirmwareLog=1
[Depth]
; Allows dumping all frames to files. 0 - Off (default), 1 - On
;DumpData=1
; Allow flipping the frame horizontally. 0 - Off, 1 - On (default)
;Mirror=0
; Compression of the data passed from device to host. 0 - None, 2 - 16z, 6 - 11-bit packed, 7 - 12-bit packed. Default is set by the firmware
;Compression=2
[Depth.VideoMode]
; Pixel Format. 100 - Depth 1 mm, 101 - Depth 100 um, 102 - Shifts 9.2, 103 - Shifts 9.3
;PixelFormat=100
; Requested X resolution
;XResolution=320
; Requested Y resolution
;YResolution=240
; Requested FPS
;FPS=30
[IR]
; Allows dumping all frames to files. 0 - Off (default), 1 - On
;DumpData=1
; Allow flipping the frame horizontally. 0 - Off, 1 - On (default)
;Mirror=0
; Compression of the data passed from device to host. 0 - None, 5 - 10-bit packed. Default is set by the firmware
;Compression=5
[IR.VideoMode]
; Pixel Format. 200 - RGB888, 202 - Grayscale 8-bit, 203 - Grayscale 16-bit
;PixelFormat=200
; Requested X resolution
;XResolution=320
; Requested Y resolution
;YResolution=240
; Requested FPS
;FPS=30
@@ -0,0 +1,183 @@
;---------------- Sensor Default Configuration -------------------
[Device]
; Mirroring. 0 - Off (default), 1 - On
;Mirror=1
; FrameSync. 0 - Off (default), 1 - On
;FrameSync=1
; Stream Data Timestamps. 0 - milliseconds, 1 - microseconds (default)
;HighResTimestamps=1
; Stream Data Timestamps Source. 0 - Firmware (default), 1 - Host
;HostTimestamps=0
; A filter for the firmware log. Default is determined by firmware.
;FirmwareLogFilter=0
; Automatic firmare log retrieval. 0 - Off (default), or the number of milliseconds between log retrievals operations.
;FirmwareLogInterval=1000
; Print firmware log to console when automatic firmware log retrieval is on. 0 - Off (default), 1 - On
;FirmwareLogPrint=1
; Is APC enabled. 0 - Off, 1 - On (default)
;APCEnabled=1
; USB interface to be used. 0 - FW Default, 1 - ISO endpoints (default on Windows), 2 - BULK endpoints (default on Linux/Mac/Android machines), 3 - ISO endpoints for low-bandwidth depth
UsbInterface=2
[Depth]
; Output format. 100 - 1mm depth values (default), 102 - u9.2 Shift values.
;OutputFormat=100
; Is stream mirrored. 0 - Off, 1 - On
;Mirror=1
; 0 - QVGA, 1 - VGA, 4 - QQVGA. Default: Arm - 4, other platforms - 0, -14 1280x720, 15 1280x960,-16 1280x800, -17 640x400 -20 320x200,-21 480x640, -25 960x1280, -26 800x1280,-27 400x640
Resolution=1
; Frames per second (default is 30)
;FPS=30
; Min depth cutoff. 0-10000 mm (default is 0)
;MinDepthValue=0
; Max depth cutoff. 0-10000 mm (default is 10000)
;MaxDepthValue=10000
; Input format. 0 - Uncompressed 16-bit, 1 - PS Compression,2 - Packed 10-bit, 3 - Packed 11-bit, 4 - Packed 12-bit. Default: Arm - 4, other platforms - 3
InputFormat=3
; Registration. 0 - Off (default), 1 - On
;Registration=1
; Registration Type. 0 - Don't care (default), 1 - use hardware accelaration, 2 - perform in software
;RegistrationType=0
; software filter 0-off ,1--on (default)
;SoftFilter=0
; Depth Rotate 0-off(default) ,1--on (only atlas device support)
;DepthRotate=0
;Read Params (for test only)
;ReadParams=0
; dual sensor: 5.96 mm
;focallength=5.96
;dual sensor: 0.0052mm
;dPlanePixelSize=0.113967
;dPlaneDistance=130
;dual sensor: 75mm
;dEmitterDcmosDistance=7.500000
;dhorizontalFov=0.022600
;dverticalFov=0.796616
; Hole Filler. 0 - Off, 1 - On (default)
;HoleFilter=0
; White Balance. 0 - Off, 1 - On (default)
;WhiteBalancedEnabled=0
; Gain. 0-50 (0 - Auto, 1 - Min., 50 - Max.). Default value is set by firmware.
;Gain=0
; Close Range Mode. 0 - Off (default), 1 - On
;CloseRange=1
; GMC Mode. 0 - Off, 1 - On (default)
;GMCMode=0
; GMC Debug. 0 - Off (default), 1 - On
;GMCDebug=1
; Depth Auto Gain Region-of-Interest. Default values are set by firmware.
;DepthAGCBin0MinDepth=500
;DepthAGCBin0MaxDepth=800
;DepthAGCBin1MinDepth=1500
;DepthAGCBin1MaxDepth=1800
;DepthAGCBin2MinDepth=2500
;DepthAGCBin2MaxDepth=2800
;DepthAGCBin3MinDepth=3500
;DepthAGCBin3MaxDepth=3800
; Wavelength Correction Mechanism. 0 - Off (default), 1 - On
;WavelengthCorrection=1
; Wavelength Correction debug info. 0 - Off (default), 1 - On
;WavelengthCorrectionDebug=1
; Cropping mode. 1 - Normal (default), 2 - Increased FPS, 3 - Software only
;CroppingMode=2
; Cropping area
[Depth.Cropping]
OffsetX=0
OffsetY=0
SizeX=320
SizeY=240
;Enabled=1
[Image]
; Output format. 200 - RGB888 (default), 201 - YUV422, 202 - Gray8 (2.0 MP only), 205 - YUYV
;OutputFormat=201
; Is stream mirrored. 0 - Off, 1 - On
;Mirror=1
; 0 - QVGA (default), 1 - VGA, 2 - SXGA (1.3MP), 3 - UXGA (2.0MP), 14 - 720p, 15 - 1280x960
Resolution=1
; Frames per second (default is 30)
;FPS=30
; Input format. 0 - Compressed 8-bit BAYER (1.3MP or 2.0MP only), 1 - Compressed YUV422 (default in BULK), 2 - Jpeg, 5 - Uncompressed YUV422 (default in ISO), 6 - Uncompressed 8-bit BAYER (1.3MP or 2.0MP only), 7 - Uncompressed YUYV
InputFormat=5
; Anti Flicker. 0 - Off (default), 50 - 50Hz, 60 - 60 Hz.
;Flicker=50
; Image quality when using Jpeg. 1-10 (1 - Lowest, 10 - Highest (default))
;Quality=10
; Cropping mode. 1 - Normal (default), 2 - Increased FPS, 3 - Software only
;CroppingMode=1
; Cropping area
[Image.Cropping]
;OffsetX=0
;OffsetY=0
;SizeX=320
;SizeY=240
;Enabled=1
[IR]
; Output format. 200 - RGB888, 203 - Grayscale 16-bit (default)
;OutputFormat=203
; Is stream mirrored. 0 - Off, 1 - On
;Mirror=1
; 0 - QVGA (default), 1 - VGA, 2 - SXGA(1.3MP), 4 - QQVGA. -14 1280x720, 15 1280x960,-16 1280x800, -17 640x400 -20 320x200,-21 480x640, -25 960x1280, -26 800x1280,-27 400x640
Resolution=1
; Frames per second (default is 30)
;FPS=30
; Cropping mode. 1 - Normal (default), 2 - Increased FPS, 3 - Software only
;CroppingMode=1
; Cropping area
[IR.Cropping]
;OffsetX=0
;OffsetY=0
;SizeX=320
;SizeY=240
;Enabled=1
@@ -0,0 +1,17 @@
[Log]
; 0 - Verbose; 1 - Info; 2 - Warning; 3 - Error. Default - None
Verbosity=0
LogToConsole=1
;LogToFile=1
;LogToAndroidLog=1
[Device]
;Override=
;RecordTo=
[Drivers]
; Location of the drivers, relative to OpenNI shared library location. When not provided, "OpenNI2/Drivers" will be used.
;Repository=OpenNI2/Drivers
; List of drivers to load, separated by commas. When not provided, OpenNI will try to load each shared library in Repository.
;List=
@@ -0,0 +1,7 @@
;---------------- Player Configuration -------------------
[Player]
; Speed. 1.0 - 1.0 * fps (default), Values can be R while R is real and grater the 0
;Speed=1.0
; Repeat. 1 - on (default), 0 - off
;Repeat=1
@@ -0,0 +1,48 @@
;---------------- PSLink Driver Default Configuration -------------------
[Device]
; USB interface to be used. 0 - FW Default, 1 - ISO endpoints (default on Windows), 2 - BULK endpoints (default on Linux/Mac/Android machines)
;UsbInterface=2
; Enable firmware logs. 0 - Off (default), 1 - On
;FirmwareLog=1
[Depth]
; Allows dumping all frames to files. 0 - Off (default), 1 - On
;DumpData=1
; Allow flipping the frame horizontally. 0 - Off, 1 - On (default)
;Mirror=0
; Compression of the data passed from device to host. 0 - None, 2 - 16z, 6 - 11-bit packed, 7 - 12-bit packed. Default is set by the firmware
;Compression=2
[Depth.VideoMode]
; Pixel Format. 100 - Depth 1 mm, 101 - Depth 100 um, 102 - Shifts 9.2, 103 - Shifts 9.3
;PixelFormat=100
; Requested X resolution
;XResolution=320
; Requested Y resolution
;YResolution=240
; Requested FPS
;FPS=30
[IR]
; Allows dumping all frames to files. 0 - Off (default), 1 - On
;DumpData=1
; Allow flipping the frame horizontally. 0 - Off, 1 - On (default)
;Mirror=0
; Compression of the data passed from device to host. 0 - None, 5 - 10-bit packed. Default is set by the firmware
;Compression=5
[IR.VideoMode]
; Pixel Format. 200 - RGB888, 202 - Grayscale 8-bit, 203 - Grayscale 16-bit
;PixelFormat=200
; Requested X resolution
;XResolution=320
; Requested Y resolution
;YResolution=240
; Requested FPS
;FPS=30
@@ -0,0 +1,183 @@
;---------------- Sensor Default Configuration -------------------
[Device]
; Mirroring. 0 - Off (default), 1 - On
;Mirror=1
; FrameSync. 0 - Off (default), 1 - On
;FrameSync=1
; Stream Data Timestamps. 0 - milliseconds, 1 - microseconds (default)
;HighResTimestamps=1
; Stream Data Timestamps Source. 0 - Firmware (default), 1 - Host
;HostTimestamps=0
; A filter for the firmware log. Default is determined by firmware.
;FirmwareLogFilter=0
; Automatic firmare log retrieval. 0 - Off (default), or the number of milliseconds between log retrievals operations.
;FirmwareLogInterval=1000
; Print firmware log to console when automatic firmware log retrieval is on. 0 - Off (default), 1 - On
;FirmwareLogPrint=1
; Is APC enabled. 0 - Off, 1 - On (default)
;APCEnabled=1
; USB interface to be used. 0 - FW Default, 1 - ISO endpoints (default on Windows), 2 - BULK endpoints (default on Linux/Mac/Android machines), 3 - ISO endpoints for low-bandwidth depth
UsbInterface=2
[Depth]
; Output format. 100 - 1mm depth values (default), 102 - u9.2 Shift values.
;OutputFormat=100
; Is stream mirrored. 0 - Off, 1 - On
;Mirror=1
; 0 - QVGA, 1 - VGA, 4 - QQVGA. Default: Arm - 4, other platforms - 0, -14 1280x720, 15 1280x960,-16 1280x800, -17 640x400 -20 320x200,-21 480x640, -25 960x1280, -26 800x1280,-27 400x640
Resolution=17
; Frames per second (default is 30)
;FPS=30
; Min depth cutoff. 0-10000 mm (default is 0)
;MinDepthValue=0
; Max depth cutoff. 0-10000 mm (default is 10000)
;MaxDepthValue=10000
; Input format. 0 - Uncompressed 16-bit, 1 - PS Compression,2 - Packed 10-bit, 3 - Packed 11-bit, 4 - Packed 12-bit. Default: Arm - 4, other platforms - 3
InputFormat=3
; Registration. 0 - Off (default), 1 - On
;Registration=1
; Registration Type. 0 - Don't care (default), 1 - use hardware accelaration, 2 - perform in software
;RegistrationType=0
; software filter 0-off ,1--on (default)
;SoftFilter=0
; Depth Rotate 0-off(default) ,1--on (only atlas device support)
;DepthRotate=0
;Read Params (for test only)
;ReadParams=0
; dual sensor: 5.96 mm
;focallength=5.96
;dual sensor: 0.0052mm
;dPlanePixelSize=0.113967
;dPlaneDistance=130
;dual sensor: 75mm
;dEmitterDcmosDistance=7.500000
;dhorizontalFov=0.022600
;dverticalFov=0.796616
; Hole Filler. 0 - Off, 1 - On (default)
;HoleFilter=0
; White Balance. 0 - Off, 1 - On (default)
;WhiteBalancedEnabled=0
; Gain. 0-50 (0 - Auto, 1 - Min., 50 - Max.). Default value is set by firmware.
;Gain=0
; Close Range Mode. 0 - Off (default), 1 - On
;CloseRange=1
; GMC Mode. 0 - Off, 1 - On (default)
;GMCMode=0
; GMC Debug. 0 - Off (default), 1 - On
;GMCDebug=1
; Depth Auto Gain Region-of-Interest. Default values are set by firmware.
;DepthAGCBin0MinDepth=500
;DepthAGCBin0MaxDepth=800
;DepthAGCBin1MinDepth=1500
;DepthAGCBin1MaxDepth=1800
;DepthAGCBin2MinDepth=2500
;DepthAGCBin2MaxDepth=2800
;DepthAGCBin3MinDepth=3500
;DepthAGCBin3MaxDepth=3800
; Wavelength Correction Mechanism. 0 - Off (default), 1 - On
;WavelengthCorrection=1
; Wavelength Correction debug info. 0 - Off (default), 1 - On
;WavelengthCorrectionDebug=1
; Cropping mode. 1 - Normal (default), 2 - Increased FPS, 3 - Software only
;CroppingMode=2
; Cropping area
[Depth.Cropping]
OffsetX=0
OffsetY=0
SizeX=320
SizeY=240
;Enabled=1
[Image]
; Output format. 200 - RGB888 (default), 201 - YUV422, 202 - Gray8 (2.0 MP only), 205 - YUYV
;OutputFormat=201
; Is stream mirrored. 0 - Off, 1 - On
;Mirror=1
; 0 - QVGA (default), 1 - VGA, 2 - SXGA (1.3MP), 3 - UXGA (2.0MP), 14 - 720p, 15 - 1280x960
Resolution=1
; Frames per second (default is 30)
;FPS=30
; Input format. 0 - Compressed 8-bit BAYER (1.3MP or 2.0MP only), 1 - Compressed YUV422 (default in BULK), 2 - Jpeg, 5 - Uncompressed YUV422 (default in ISO), 6 - Uncompressed 8-bit BAYER (1.3MP or 2.0MP only), 7 - Uncompressed YUYV
InputFormat=5
; Anti Flicker. 0 - Off (default), 50 - 50Hz, 60 - 60 Hz.
;Flicker=50
; Image quality when using Jpeg. 1-10 (1 - Lowest, 10 - Highest (default))
;Quality=10
; Cropping mode. 1 - Normal (default), 2 - Increased FPS, 3 - Software only
;CroppingMode=1
; Cropping area
[Image.Cropping]
;OffsetX=0
;OffsetY=0
;SizeX=320
;SizeY=240
;Enabled=1
[IR]
; Output format. 200 - RGB888, 203 - Grayscale 16-bit (default)
;OutputFormat=203
; Is stream mirrored. 0 - Off, 1 - On
;Mirror=1
; 0 - QVGA (default), 1 - VGA, 2 - SXGA(1.3MP), 4 - QQVGA. -14 1280x720, 15 1280x960,-16 1280x800, -17 640x400 -20 320x200,-21 480x640, -25 960x1280, -26 800x1280,-27 400x640
Resolution=17
; Frames per second (default is 30)
;FPS=30
; Cropping mode. 1 - Normal (default), 2 - Increased FPS, 3 - Software only
;CroppingMode=1
; Cropping area
[IR.Cropping]
;OffsetX=0
;OffsetY=0
;SizeX=320
;SizeY=240
;Enabled=1
@@ -0,0 +1,17 @@
[Log]
; 0 - Verbose; 1 - Info; 2 - Warning; 3 - Error. Default - None
Verbosity=0
LogToConsole=1
;LogToFile=1
;LogToAndroidLog=1
[Device]
;Override=
;RecordTo=
[Drivers]
; Location of the drivers, relative to OpenNI shared library location. When not provided, "OpenNI2/Drivers" will be used.
;Repository=OpenNI2/Drivers
; List of drivers to load, separated by commas. When not provided, OpenNI will try to load each shared library in Repository.
;List=
@@ -0,0 +1,7 @@
;---------------- Player Configuration -------------------
[Player]
; Speed. 1.0 - 1.0 * fps (default), Values can be R while R is real and grater the 0
;Speed=1.0
; Repeat. 1 - on (default), 0 - off
;Repeat=1
@@ -0,0 +1,48 @@
;---------------- PSLink Driver Default Configuration -------------------
[Device]
; USB interface to be used. 0 - FW Default, 1 - ISO endpoints (default on Windows), 2 - BULK endpoints (default on Linux/Mac/Android machines)
;UsbInterface=2
; Enable firmware logs. 0 - Off (default), 1 - On
;FirmwareLog=1
[Depth]
; Allows dumping all frames to files. 0 - Off (default), 1 - On
;DumpData=1
; Allow flipping the frame horizontally. 0 - Off, 1 - On (default)
;Mirror=0
; Compression of the data passed from device to host. 0 - None, 2 - 16z, 6 - 11-bit packed, 7 - 12-bit packed. Default is set by the firmware
;Compression=2
[Depth.VideoMode]
; Pixel Format. 100 - Depth 1 mm, 101 - Depth 100 um, 102 - Shifts 9.2, 103 - Shifts 9.3
;PixelFormat=100
; Requested X resolution
;XResolution=320
; Requested Y resolution
;YResolution=240
; Requested FPS
;FPS=30
[IR]
; Allows dumping all frames to files. 0 - Off (default), 1 - On
;DumpData=1
; Allow flipping the frame horizontally. 0 - Off, 1 - On (default)
;Mirror=0
; Compression of the data passed from device to host. 0 - None, 5 - 10-bit packed. Default is set by the firmware
;Compression=5
[IR.VideoMode]
; Pixel Format. 200 - RGB888, 202 - Grayscale 8-bit, 203 - Grayscale 16-bit
;PixelFormat=200
; Requested X resolution
;XResolution=320
; Requested Y resolution
;YResolution=240
; Requested FPS
;FPS=30
@@ -0,0 +1,183 @@
;---------------- Sensor Default Configuration -------------------
[Device]
; Mirroring. 0 - Off (default), 1 - On
;Mirror=1
; FrameSync. 0 - Off (default), 1 - On
;FrameSync=1
; Stream Data Timestamps. 0 - milliseconds, 1 - microseconds (default)
;HighResTimestamps=1
; Stream Data Timestamps Source. 0 - Firmware (default), 1 - Host
;HostTimestamps=0
; A filter for the firmware log. Default is determined by firmware.
;FirmwareLogFilter=0
; Automatic firmare log retrieval. 0 - Off (default), or the number of milliseconds between log retrievals operations.
;FirmwareLogInterval=1000
; Print firmware log to console when automatic firmware log retrieval is on. 0 - Off (default), 1 - On
;FirmwareLogPrint=1
; Is APC enabled. 0 - Off, 1 - On (default)
;APCEnabled=1
; USB interface to be used. 0 - FW Default, 1 - ISO endpoints (default on Windows), 2 - BULK endpoints (default on Linux/Mac/Android machines), 3 - ISO endpoints for low-bandwidth depth
UsbInterface=2
[Depth]
; Output format. 100 - 1mm depth values (default), 102 - u9.2 Shift values.
;OutputFormat=100
; Is stream mirrored. 0 - Off, 1 - On
;Mirror=1
; 0 - QVGA, 1 - VGA, 4 - QQVGA. Default: Arm - 4, other platforms - 0, -14 1280x720, 15 1280x960,-16 1280x800, -17 640x400 -20 320x200,-21 480x640, -25 960x1280, -26 800x1280,-27 400x640
Resolution=1
; Frames per second (default is 30)
;FPS=30
; Min depth cutoff. 0-10000 mm (default is 0)
;MinDepthValue=0
; Max depth cutoff. 0-10000 mm (default is 10000)
;MaxDepthValue=10000
; Input format. 0 - Uncompressed 16-bit, 1 - PS Compression,2 - Packed 10-bit, 3 - Packed 11-bit, 4 - Packed 12-bit. Default: Arm - 4, other platforms - 3
InputFormat=3
; Registration. 0 - Off (default), 1 - On
;Registration=1
; Registration Type. 0 - Don't care (default), 1 - use hardware accelaration, 2 - perform in software
;RegistrationType=0
; software filter 0-off ,1--on (default)
;SoftFilter=0
; Depth Rotate 0-off(default) ,1--on (only atlas device support)
;DepthRotate=0
;Read Params (for test only)
;ReadParams=0
; dual sensor: 5.96 mm
;focallength=5.96
;dual sensor: 0.0052mm
;dPlanePixelSize=0.113967
;dPlaneDistance=130
;dual sensor: 75mm
;dEmitterDcmosDistance=7.500000
;dhorizontalFov=0.022600
;dverticalFov=0.796616
; Hole Filler. 0 - Off, 1 - On (default)
;HoleFilter=0
; White Balance. 0 - Off, 1 - On (default)
;WhiteBalancedEnabled=0
; Gain. 0-50 (0 - Auto, 1 - Min., 50 - Max.). Default value is set by firmware.
;Gain=0
; Close Range Mode. 0 - Off (default), 1 - On
;CloseRange=1
; GMC Mode. 0 - Off, 1 - On (default)
;GMCMode=0
; GMC Debug. 0 - Off (default), 1 - On
;GMCDebug=1
; Depth Auto Gain Region-of-Interest. Default values are set by firmware.
;DepthAGCBin0MinDepth=500
;DepthAGCBin0MaxDepth=800
;DepthAGCBin1MinDepth=1500
;DepthAGCBin1MaxDepth=1800
;DepthAGCBin2MinDepth=2500
;DepthAGCBin2MaxDepth=2800
;DepthAGCBin3MinDepth=3500
;DepthAGCBin3MaxDepth=3800
; Wavelength Correction Mechanism. 0 - Off (default), 1 - On
;WavelengthCorrection=1
; Wavelength Correction debug info. 0 - Off (default), 1 - On
;WavelengthCorrectionDebug=1
; Cropping mode. 1 - Normal (default), 2 - Increased FPS, 3 - Software only
;CroppingMode=2
; Cropping area
[Depth.Cropping]
OffsetX=0
OffsetY=0
SizeX=320
SizeY=240
;Enabled=1
[Image]
; Output format. 200 - RGB888 (default), 201 - YUV422, 202 - Gray8 (2.0 MP only), 205 - YUYV
;OutputFormat=201
; Is stream mirrored. 0 - Off, 1 - On
;Mirror=1
; 0 - QVGA (default), 1 - VGA, 2 - SXGA (1.3MP), 3 - UXGA (2.0MP), 14 - 720p, 15 - 1280x960
Resolution=1
; Frames per second (default is 30)
;FPS=30
; Input format. 0 - Compressed 8-bit BAYER (1.3MP or 2.0MP only), 1 - Compressed YUV422 (default in BULK), 2 - Jpeg, 5 - Uncompressed YUV422 (default in ISO), 6 - Uncompressed 8-bit BAYER (1.3MP or 2.0MP only), 7 - Uncompressed YUYV
InputFormat=5
; Anti Flicker. 0 - Off (default), 50 - 50Hz, 60 - 60 Hz.
;Flicker=50
; Image quality when using Jpeg. 1-10 (1 - Lowest, 10 - Highest (default))
;Quality=10
; Cropping mode. 1 - Normal (default), 2 - Increased FPS, 3 - Software only
;CroppingMode=1
; Cropping area
[Image.Cropping]
;OffsetX=0
;OffsetY=0
;SizeX=320
;SizeY=240
;Enabled=1
[IR]
; Output format. 200 - RGB888, 203 - Grayscale 16-bit (default)
;OutputFormat=203
; Is stream mirrored. 0 - Off, 1 - On
;Mirror=1
; 0 - QVGA (default), 1 - VGA, 2 - SXGA(1.3MP), 4 - QQVGA. -14 1280x720, 15 1280x960,-16 1280x800, -17 640x400 -20 320x200,-21 480x640, -25 960x1280, -26 800x1280,-27 400x640
Resolution=1
; Frames per second (default is 30)
;FPS=30
; Cropping mode. 1 - Normal (default), 2 - Increased FPS, 3 - Software only
;CroppingMode=1
; Cropping area
[IR.Cropping]
;OffsetX=0
;OffsetY=0
;SizeX=320
;SizeY=240
;Enabled=1