Skip to content

Commit

Permalink
Updated codebase to the latest OpenNI / Sensor version (1.3.2.3 / 5.0…
Browse files Browse the repository at this point in the history
….3.4)
  • Loading branch information
avin2 committed Jul 19, 2011
1 parent 0e5a176 commit c2c8b45
Show file tree
Hide file tree
Showing 9 changed files with 90 additions and 20 deletions.
5 changes: 5 additions & 0 deletions CHANGES
@@ -1,6 +1,11 @@
Detailed Change log:
--------------------

Version 5.0.3.4 (Unstable version - Jul 5th 2011)
-------------------------------------------------
* Windows Redist: Support for 64-bit systems.
* Control mutex is now per sensor and not global to all sensors.

Version 5.0.3.3 (Stable version - Jul 5th 2011)
-----------------------------------------------
* Linux: Allow installation to a different directory (for cross-compilation mainly).
Expand Down
2 changes: 1 addition & 1 deletion Include/XnPsVersion.h
Expand Up @@ -43,7 +43,7 @@
/** Xiron maintenance version. */
#define XN_PS_MAINTENANCE_VERSION 3
/** Xiron build version. */
#define XN_PS_BUILD_VERSION 3
#define XN_PS_BUILD_VERSION 4

/** Xiron version (in brief string format): "Major.Minor.Maintenance (Build)" */
#define XN_PS_BRIEF_VERSION_STRING \
Expand Down
5 changes: 4 additions & 1 deletion Platform/Linux-x86/Build/Common/CommonCSMakefile
Expand Up @@ -22,12 +22,15 @@ COMMON_CS_MAKE_FILE_DIR = $(dir $(lastword $(MAKEFILE_LIST)))
include $(COMMON_CS_MAKE_FILE_DIR)CommonDefs.mak

# create -r option to mcs
USED_NETLIBS_OPTION = $(foreach lib,$(USED_LIBS),-r:$(OUT_DIR)/$(lib).dll)
USED_NETLIBS_OPTION = $(foreach lib,$(USED_LIBS),-r:$(lib).dll)

ifeq "$(NET_WIN_FORMS)" "1"
USED_NETLIBS_OPTION += -r:System.Windows.Forms.dll -r:System.Drawing.dll
endif

# add the output dir as a place to search for assemblies
USED_NETLIBS_OPTION += -lib:$(OUT_DIR)

ifeq "$(CFG)" "Release"
CSFLAGS += -o+
endif
Expand Down
19 changes: 17 additions & 2 deletions Platform/Linux-x86/Build/Common/CommonDefs.mak
@@ -1,6 +1,21 @@
# some defaults
ifndef CFG
CFG = Release
CFG = Release
endif

ifndef PLATFORM
MACHINE = $(shell uname -m)
ifneq (,$(findstring x86,$(MACHINE)))
PLATFORM = x86
else ifneq (,$(findstring i686,$(MACHINE)))
PLATFORM = x86
else ifneq (,$(findstring i386,$(MACHINE)))
PLATFORM = x86
else ifneq (,$(findstring arm,$(MACHINE)))
PLATFORM = Arm
else
$(error Unknown Platform)
endif
endif

# expand file list
Expand All @@ -22,4 +37,4 @@ COMMON_MAK_DIR = $(dir $(lastword $(MAKEFILE_LIST)))
OSTYPE := $(shell uname -s)

# platform specific args
-include $(COMMON_MAK_DIR)Platform.$(PLATFORM)
include $(COMMON_MAK_DIR)Platform.$(PLATFORM)
3 changes: 3 additions & 0 deletions Platform/Linux-x86/Build/Common/Platform.x86
Expand Up @@ -17,6 +17,9 @@ ifeq "$(CFG)" "Release"
else
ifeq ($(SSE_GENERATION), 3)
CFLAGS += -msse3
ifeq ($(SSSE3_ENABLED), 1)
CFLAGS += -mssse3
endif
else
($error "Only SSE2 and SSE3 are supported")
endif
Expand Down
Expand Up @@ -8,7 +8,7 @@
<?define MinorVersion=0?>
<?define MaintenanceVersion=3?>
<!-- BuildVersion is NOT used by WiX in the upgrade procedure -->
<?define BuildVersion=3?>
<?define BuildVersion=4?>

<!-- Full version number to display -->
<?define VersionNumber="$(var.MajorVersion).$(var.MinorVersion).$(var.MaintenanceVersion).$(var.BuildVersion)" ?>
Expand Down
53 changes: 44 additions & 9 deletions Platform/Win32/CreateRedist/Redist.py
Expand Up @@ -29,6 +29,17 @@
import re
import subprocess
from xml.dom.minidom import parse, parseString
import platform

def is_64_bit_platform():
result = False
import platform
(bits,linkage) = platform.architecture()
matchObject = re.search('64',bits)
result = matchObject is not None
return result

is_64_bit_platform = is_64_bit_platform()

#------------Check args---------------------------------------------#

Expand Down Expand Up @@ -115,15 +126,22 @@ def get_reg_values(reg_key, value_list):

try:
VS_NEED_UPGRADE = 0
MSVC_KEY = (win32con.HKEY_LOCAL_MACHINE, r"SOFTWARE\Microsoft\VisualStudio\9.0")
if not is_64_bit_platform:
MSVC_KEY = (win32con.HKEY_LOCAL_MACHINE, r"SOFTWARE\Microsoft\VisualStudio\9.0")
else:
MSVC_KEY = (win32con.HKEY_LOCAL_MACHINE, r"SOFTWARE\Wow6432Node\Microsoft\VisualStudio\9.0")
#MSVC_KEY = (win32con.HKEY_LOCAL_MACHINE, r"SOFTWARE\Wow6432Node\Microsoft\VisualStudio\9.0")
MSVC_VALUES = [("InstallDir", win32con.REG_SZ)]
VS_INST_DIR = get_reg_values(MSVC_KEY, MSVC_VALUES)[0]
except Exception as e:
VC_version = 10

if VC_version == 10:
VS_NEED_UPGRADE = 1
MSVC_KEY = (win32con.HKEY_LOCAL_MACHINE, r"SOFTWARE\Microsoft\VisualStudio\10.0")
if not is_64_bit_platform:
MSVC_KEY = (win32con.HKEY_LOCAL_MACHINE, r"SOFTWARE\Microsoft\VisualStudio\10.0")
else:
MSVC_KEY = (win32con.HKEY_LOCAL_MACHINE, r"SOFTWARE\Wow6432Node\Microsoft\VisualStudio\10.0")
MSVC_VALUES = [("InstallDir", win32con.REG_SZ)]
VS_INST_DIR = get_reg_values(MSVC_KEY, MSVC_VALUES)[0]

Expand All @@ -135,18 +153,27 @@ def get_reg_values(reg_key, value_list):
os.chdir(os.path.join(ROOT_DIR, "..", "Build"))

if VS_NEED_UPGRADE == 1:
#os.system("attrib -r * /s")
res = os.system("\"" + VS_INST_DIR + "devenv\" " + "Engine.sln" + " /upgrade > ..\\CreateRedist\\Output\\build.log")
if res != 0:
raise Exception("build failed!")
res = os.system("\"" + VS_INST_DIR + "devenv\" " + "Engine.sln" + " /build Release > ..\\CreateRedist\\Output\\build.log")
build_cmd = "\"%s\" %s /Rebuild \"release|%s\" /out ..\\CreateRedist\\Output\\build.log"%(os.path.join(VS_INST_DIR,'devenv'),'Engine.sln',
'win32' if vc_build_bits == '32' else 'x64')
#build_cmd = "\"%s\" %s /Rebuild \"Release|x%s\""%(os.path.join(VS_INST_DIR,'devenv.exe'),'Engine.sln',
# '86' if vc_build_bits == '32' else '64')
print 'building .. %s'%build_cmd
#res = os.system("\"" + VS_INST_DIR + "devenv\" " + "Engine.sln" + " /build Release > ..\\CreateRedist\\Output\\build.log")
#res = os.system(build_cmd)
res = subprocess.call(build_cmd)
res = 0
if res != 0:
raise Exception("build failed!")
os.chdir(SCRIPT_DIR)

print("Copying into redist folder...")

# create folder structure
os.mkdir(os.path.join(REDIST_DIR, "Bin"))
os.mkdir(os.path.join(REDIST_DIR, "Bin" if vc_build_bits == "32" else "Bin64"))
os.mkdir(os.path.join(REDIST_DIR, "Data"))
os.mkdir(os.path.join(REDIST_DIR, "Driver"))
os.mkdir(os.path.join(REDIST_DIR, "Driver", "amd64"))
Expand All @@ -159,16 +186,19 @@ def get_reg_values(reg_key, value_list):
shutil.copy(os.path.join(ROOT_DIR, "..", "..", "..", "LGPL.txt"), OUTPUT_DIR)

# copy binaries
RELEASE_DIR = os.path.join(ROOT_DIR, "..", "Bin", "Release")
RELEASE_DIR = os.path.join(ROOT_DIR, "..", "Bin" if vc_build_bits == "32" else "Bin64", "Release")
for file in os.listdir(RELEASE_DIR):
if os.path.splitext(file)[1] in [".dll", ".exe"]:
shutil.copy(os.path.join(RELEASE_DIR, file), os.path.join(REDIST_DIR, "Bin"))
shutil.copy(os.path.join(RELEASE_DIR, file), os.path.join(REDIST_DIR, "Bin" if vc_build_bits == "32" else "Bin64"))

# copy data
DATA_DIR = os.path.join(ROOT_DIR, "..", "..", "..", "Data")
for file in os.listdir(DATA_DIR):
shutil.copy(os.path.join(DATA_DIR, file), os.path.join(REDIST_DIR, "Data"))


#if vc_build_bits == '64':
# print 'Finishing without creating the installer'
# exit(0)
# copy driver
DRIVER_DIR = os.path.join(ROOT_DIR, "..", "Driver")
for file in os.listdir(DRIVER_DIR):
Expand Down Expand Up @@ -206,8 +236,13 @@ def get_reg_values(reg_key, value_list):
if res != 0:
raise Exception("Failed upgrade installer!")

res = subprocess.call("\""+VS_INST_DIR + "devenv\" EE_NI.wixproj /build \"release|x86"\
+"\" /out "+SCRIPT_DIR+"\\Output\\" + logFilename + ".txt",close_fds=True)

wix_build_cmd = '"%s" %s /Build "release|%s" /out %s'%(os.path.join(VS_INST_DIR,'devenv'), 'EE_NI.wixproj' ,'x86' if vc_build_bits == '32' else 'x64',
os.path.join(SCRIPT_DIR,'Output',logFilename + ".txt"))
print "wix_build_cmd=%s"%wix_build_cmd
res = subprocess.call(wix_build_cmd)
#res = subprocess.call("\""+VS_INST_DIR + "devenv\" EE_NI.wixproj /build \"release|x86"\
# +"\" /out "+SCRIPT_DIR+"\\Output\\" + logFilename + ".txt",close_fds=True)
if res != 0:
raise Exception("Failed creating installer!")

Expand Down
12 changes: 8 additions & 4 deletions README
@@ -1,5 +1,5 @@
PrimeSense Sensor Module for OpenNI (Version 5.0.3.3 Stable version - Jul 5th 2011)
-----------------------------------------------------------------------------------
PrimeSense Sensor Module for OpenNI (Version 5.0.3.4 Unstable version - Jul 19th 2011)
--------------------------------------------------------------------------------------

Kinect Mod:
-----------
Expand All @@ -9,12 +9,16 @@ You must use this kinect mod version with the unstable OpenNI release which is a
http://www.openni.org/downloadfiles/opennimodules/openni-binaries/20-latest-unstable

Changes:
v0.7:
1) Updated codebase to the latest OpenNI / Sensor version (1.3.2.3 / 5.0.3.34)
2) Added a 64-bit binary installer for Windows.

v0.6:
1) Updated codebase to the latest OpenNI / Sensor version (1.3.2.1 / 5.0.3.33)

v0.5:
1) Updated codebase to the latest OpenNI / Sensor version (1.1.0.39 / 5.0.1.32)
2) Changed to install directory from Sensor to SensorKinect to co-exist with the orignal PrimeSense Sensor module.
2) Changed to install directory from Sensor to SensorKinect to co-exist with the original PrimeSense Sensor module.

v0.4:
1) Merged code with the new unstable sensor driver from PrimeSense that adds MacOSX and multiple sensor support.
Expand Down Expand Up @@ -53,7 +57,7 @@ Install notes:
1) Run: sudo apt-get install libusb-1.0-0-dev
2) Run: sudo apt-get install freeglut3-dev
MaxOSX:
1) Intall MacPorts from: http://distfiles.macports.org/MacPorts/MacPorts-1.9.2-10.6-SnowLeopard.dmg
1) Install MacPorts from: http://distfiles.macports.org/MacPorts/MacPorts-1.9.2-10.6-SnowLeopard.dmg
2) Run: sudo port install libtool
3) Run: sudo port install libusb-devel +universal
Note: Do not forget the +universal, it's very important!!
Expand Down
9 changes: 7 additions & 2 deletions Source/XnDeviceSensorV2/XnDeviceSensorInit.cpp
Expand Up @@ -37,7 +37,7 @@
#include <XnLog.h>
#include "XnSensor.h"

#define XN_HOST_PROTOCOL_MUTEX_NAME "HostProtocolMutex"
#define XN_HOST_PROTOCOL_MUTEX_NAME_PREFIX "HostProtocolMutex"

//---------------------------------------------------------------------------
// Code
Expand All @@ -49,7 +49,12 @@ XnStatus XnDeviceSensorInit(XnDevicePrivateData* pDevicePrivateData)
nRetVal = XnDeviceSensorAllocateBuffers(pDevicePrivateData);
XN_IS_STATUS_OK(nRetVal);

nRetVal = xnOSCreateNamedMutex(&pDevicePrivateData->hExecuteMutex, XN_HOST_PROTOCOL_MUTEX_NAME);
XnChar strMutexName[XN_FILE_MAX_PATH];
XnUInt32 nCharsWritten = 0;
nRetVal = xnOSStrFormat(strMutexName, XN_FILE_MAX_PATH, &nCharsWritten, "%s%s", XN_HOST_PROTOCOL_MUTEX_NAME_PREFIX, pDevicePrivateData->pSensor->GetUSBPath());
XN_IS_STATUS_OK(nRetVal);

nRetVal = xnOSCreateNamedMutex(&pDevicePrivateData->hExecuteMutex, strMutexName);
XN_IS_STATUS_OK(nRetVal);

nRetVal = XnDeviceSensorConfigureVersion(pDevicePrivateData);
Expand Down

0 comments on commit c2c8b45

Please sign in to comment.