Skip to content

Commit

Permalink
Merge commit 'v0.2.0-15-g6198bcd' (dfsg branch) into debian
Browse files Browse the repository at this point in the history
* commit 'v0.2.0-15-g6198bcd': (36 commits)
  Update CONTRIB for v0.2.0
  Update CMake version for v0.2.0
  Kinect for Windows and Xbox 360 Model 1473 support
  Changed all GL-related INCLUDE_DIRS to INCLUDE_DIR Fixes OpenKinect#320
  as3-bom: Support uncompressed depth
  camera-flags: added depth and video mirror
  camera-flags: initial commit
  Fixed fprintf format warnings
  Removed Formula now in homebrew Library
  Added Kinect for Windows udev rules
  Removed unused stdbool.h Replaced all include guards with '#pragma once' - fixes OpenKinect#296
  Removed libusb patch already merged upstream
  handle error case on USB 3.0: control transfer may return 512 bytes
  FrameMode now implements getFieldOrder() to be compatible with new versions of jna. Signed-off-by: John Scheible johnscheible@gmail.com
  Adding to C++ wrapper a method to access the underlying freenect_device Signed-off-by: Joseph J Dillon <joe.robotics@hotmail.com> josephd
  Added missing dependencies
  examples: GLUT_INCLUDE_DIRS -> GLUT_INCLUDE_DIR
  wavrecord.c: initialize sample count to 0
  audio firmware loader: use the structure of the firmware image format to specify size/addresses
  freenect.pyx: add FREENECT_DEPTH_{MM,REGISTERED} support
  ...
  • Loading branch information
yarikoptic committed Sep 21, 2013
2 parents 5678ee6 + 6198bcd commit acb82f5
Show file tree
Hide file tree
Showing 52 changed files with 711 additions and 412 deletions.
12 changes: 9 additions & 3 deletions CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -41,8 +41,8 @@ cmake_minimum_required(VERSION 2.6)
PROJECT(libfreenect)

set (PROJECT_VER_MAJOR 0)
set (PROJECT_VER_MINOR 1)
set (PROJECT_VER_PATCH 2)
set (PROJECT_VER_MINOR 2)
set (PROJECT_VER_PATCH 0)
set (PROJECT_VER
"${PROJECT_VER_MAJOR}.${PROJECT_VER_MINOR}.${PROJECT_VER_PATCH}")
set (PROJECT_APIVER
Expand Down Expand Up @@ -86,6 +86,12 @@ if(BUILD_AUDIO)
add_definitions(-DBUILD_AUDIO)
endif()

if (WIN32)
set(MATH_LIB "")
else(WIN32)
set(MATH_LIB "m")
endif()

######################################################################################
# CMake
######################################################################################
Expand All @@ -112,7 +118,7 @@ include_directories(${LIBUSB_1_INCLUDE_DIRS})

if(WIN32)
include_directories("${CMAKE_CURRENT_SOURCE_DIR}/platform/windows")
include_directories("${CMAKE_CURRENT_SOURCE_DIR}/platform/windows/libusb10emu")
include_directories("${CMAKE_CURRENT_SOURCE_DIR}/platform/windows/libusb10emu/libusb-1.0")
endif()

# Add library project
Expand Down
7 changes: 7 additions & 0 deletions CONTRIB
Original file line number Diff line number Diff line change
Expand Up @@ -5,6 +5,8 @@ Alex Weiss <algrs@cacography.net>
Andrew <amiller@dappervision.com>
Antonio Ospite <ospite@studenti.unina.it>
arnebe <arne@alamut.de>
Benn Snyder <benn.snyder@gmail.com>
Ben Stolovitz <ben@stolovitz.com>
Brandyn A. White <bwhite@dappervision.com>
Chris J (cryptk) <cryptk@gmail.com>
David García Garzón <david.garcia@barcelonamedia.org>
Expand All @@ -18,7 +20,10 @@ Francois Coulombe <fcoulombe@silentfalls.org>
Gabor Szarka <szarkagabor@coralworks.hu>
Hector Martin <hector@marcansoft.com>
James Harris <jimmy@jamesharris.org>
Joakim Gebart <joakim.gebart@jge.se>
Jochen Kerdels <jochen@kerdels.de>
John Scheible <JohnScheible@gmail.com>
josephd <joe@w00t42.net>
Josh Grunzweig <jgrunzweig@gizmotron.local>
Joshua Blake <joshblake@gmail.com>
Juan Carlos del Valle <jc.ekinox@gmail.com>
Expand All @@ -30,6 +35,7 @@ Kyle Machulis <kyle@nonpolynomial.com>
Marcos Paulo Berteli Slomp <mslomp@gmail.com>
Mark Renouf <mark.renouf@gmail.com>
Melonee Wise <mwise@willowgarage.com>
Nicolas Bourdaud <nicolas.bourdaud@gmail.com>
Peter Kropf <pkropf@gmail.com>
Radu Bogdan Rusu <rusu@cs.tum.edu>
Rich Mattes <jpgr87@gmail.com>
Expand All @@ -42,4 +48,5 @@ Thomas Roefer <Thomas.Roefer@dfki.de>
Tim Niemueller <niemueller@kbsg.rwth-aachen.de>
Tully Foote <tfoote@willowgarage.com>
Vincent Le Ligeour <yoda-jm@users.sourceforge.net>
Yannis Gravezas <wizgrav@gmail.com>
Yaroslav Halchenko <debian@onerussian.com>
35 changes: 6 additions & 29 deletions README.asciidoc
Original file line number Diff line number Diff line change
Expand Up @@ -43,7 +43,7 @@ http://twitter.com/openkinect

For the driver, you'll need

- libusb-1.0 >= 1.0.3 (*nix and OS X)
- libusb-1.0 >= 1.0.9 (*nix and OS X)
- libusb-win32 (Windows)
- Cmake >= 2.6 (All platforms)

Expand Down Expand Up @@ -73,33 +73,9 @@ To use CMake:

==== OS X

NOTE: AS OF 2010-11-16, WE HAVE UPDATED THIS PATCH. IF YOU HAVE
ALREADY PATCHED, PLEASE REPATCH AND REINSTALL LIBUSB TO GET OS X
WORKING AT FULL 30FPS.

You will need to pull the matching version of libusb for this
patch. This is NOT v1.0.8, this is a change based off the repo head as
of 2010-10-16. To get a tar.gz with the snapshot of the repo at this
point, hit the link below.

http://git.libusb.org/?p=libusb.git;a=snapshot;h=7da756e09fd97efad2b35b5cee0e2b2550aac2cb;sf=tgz;js=1

Once you've gotten that tarball and unziped it somewhere, patch using
the files in platform/osx/. Just go to the root directory of the
libusb source and run

patch -p1 < [path_to_OpenKinectRepo]/platform/osx/libusb-osx-kinect.diff

You need to tell configure to include some necessary frameworks:
./configure LDFLAGS='-framework IOKit -framework CoreFoundation'

Recompile libusb and put it wherever CMake will look (/usr/local/lib,
/usr/lib, etc...). If you're using a package manager like fink,
macports, or homebrew, I'm going to expect you know what your doing
and can deal with this. If not, see IRC channel.

OpenGL and GLUT come as prebuilt frameworks with OS X, so that should
do it for requirements.
libusb is available through various package managers
including homebrew and Macports.
OpenGL and GLUT come as prebuilt frameworks.

==== Linux

Expand Down Expand Up @@ -128,9 +104,10 @@ libfreenect has interface to several languages. Look in the wrappers/
directory for them:

- C (using a synchronous API)
- C++
- C#
- python
- actionscript
- C#
- Java (JNA)

=== Licensing
Expand Down
6 changes: 3 additions & 3 deletions cmake_modules/Findlibusb-1.0.cmake
Original file line number Diff line number Diff line change
Expand Up @@ -49,7 +49,7 @@ if (LIBUSB_1_LIBRARIES AND LIBUSB_1_INCLUDE_DIRS)
else (LIBUSB_1_LIBRARIES AND LIBUSB_1_INCLUDE_DIRS)
find_path(LIBUSB_1_INCLUDE_DIR
NAMES
libusb-1.0/libusb.h
libusb.h
PATHS
/usr/include
/usr/local/include
Expand All @@ -61,7 +61,7 @@ else (LIBUSB_1_LIBRARIES AND LIBUSB_1_INCLUDE_DIRS)

find_library(LIBUSB_1_LIBRARY
NAMES
usb-1.0
usb-1.0 usb
PATHS
/usr/lib
/usr/local/lib
Expand Down Expand Up @@ -95,4 +95,4 @@ else (LIBUSB_1_LIBRARIES AND LIBUSB_1_INCLUDE_DIRS)
# show the LIBUSB_1_INCLUDE_DIRS and LIBUSB_1_LIBRARIES variables only in the advanced view
mark_as_advanced(LIBUSB_1_INCLUDE_DIRS LIBUSB_1_LIBRARIES)

endif (LIBUSB_1_LIBRARIES AND LIBUSB_1_INCLUDE_DIRS)
endif (LIBUSB_1_LIBRARIES AND LIBUSB_1_INCLUDE_DIRS)
8 changes: 1 addition & 7 deletions examples/CMakeLists.txt
100755 → 100644
Original file line number Diff line number Diff line change
Expand Up @@ -56,13 +56,7 @@ else()
find_package(OpenGL REQUIRED)
find_package(GLUT REQUIRED)

include_directories(${OPENGL_INCLUDE_DIRS} ${GLUT_INCLUDE_DIRS} ${USB_INCLUDE_DIRS})

if (WIN32)
set(MATH_LIB "")
else(WIN32)
set(MATH_LIB "m")
endif()
include_directories(${OPENGL_INCLUDE_DIR} ${GLUT_INCLUDE_DIR} ${USB_INCLUDE_DIRS})

target_link_libraries(glview freenect ${OPENGL_LIBRARIES} ${GLUT_LIBRARY} ${CMAKE_THREAD_LIBS_INIT} ${MATH_LIB})
target_link_libraries(regview freenect ${OPENGL_LIBRARIES} ${GLUT_LIBRARY} ${CMAKE_THREAD_LIBS_INIT} ${MATH_LIB})
Expand Down
28 changes: 27 additions & 1 deletion examples/glview.c
Original file line number Diff line number Diff line change
Expand Up @@ -179,6 +179,27 @@ void keyPressed(unsigned char key, int x, int y)
freenect_angle = -30;
}
}
if (key == 'e') {
static freenect_flag_value auto_exposure = FREENECT_ON;
freenect_set_flag(f_dev, FREENECT_AUTO_EXPOSURE, auto_exposure);
auto_exposure = !auto_exposure;
}
if (key == 'b') {
static freenect_flag_value white_balance = FREENECT_ON;
freenect_set_flag(f_dev, FREENECT_AUTO_WHITE_BALANCE, white_balance);
white_balance = !white_balance;
}
if (key == 'r') {
static freenect_flag_value raw_color = FREENECT_ON;
freenect_set_flag(f_dev, FREENECT_RAW_COLOR, raw_color);
raw_color = !raw_color;
}
if (key == 'm') {
static freenect_flag_value mirror = FREENECT_ON;
freenect_set_flag(f_dev, FREENECT_MIRROR_DEPTH, mirror);
freenect_set_flag(f_dev, FREENECT_MIRROR_VIDEO, mirror);
mirror = !mirror;
}
if (key == '1') {
freenect_set_led(f_dev,LED_GREEN);
}
Expand Down Expand Up @@ -349,6 +370,7 @@ void *freenect_threadfunc(void *arg)
freenect_start_video(f_dev);

printf("'w'-tilt up, 's'-level, 'x'-tilt down, '0'-'6'-select LED mode, 'f'-video format\n");
printf("'e' - auto exposure, 'b' - white balance, 'r' - raw color, 'm' - mirror\n");

while (!die && freenect_process_events(f_ctx) >= 0) {
//Throttle the text output
Expand Down Expand Up @@ -421,17 +443,21 @@ int main(int argc, char **argv)
if (argc > 1)
user_device_number = atoi(argv[1]);

if (nr_devices < 1)
if (nr_devices < 1) {
freenect_shutdown(f_ctx);
return 1;
}

if (freenect_open_device(f_ctx, &f_dev, user_device_number) < 0) {
printf("Could not open device\n");
freenect_shutdown(f_ctx);
return 1;
}

res = pthread_create(&freenect_thread, NULL, freenect_threadfunc, NULL);
if (res) {
printf("pthread_create failed\n");
freenect_shutdown(f_ctx);
return 1;
}

Expand Down
6 changes: 5 additions & 1 deletion examples/hiview.c
Original file line number Diff line number Diff line change
Expand Up @@ -445,17 +445,21 @@ int main(int argc, char **argv)
if (argc > 1)
user_device_number = atoi(argv[1]);

if (nr_devices < 1)
if (nr_devices < 1) {
freenect_shutdown(f_ctx);
return 1;
}

if (freenect_open_device(f_ctx, &f_dev, user_device_number) < 0) {
printf("Could not open device\n");
freenect_shutdown(f_ctx);
return 1;
}

res = pthread_create(&freenect_thread, NULL, freenect_threadfunc, NULL);
if (res) {
printf("pthread_create failed\n");
freenect_shutdown(f_ctx);
return 1;
}

Expand Down
6 changes: 5 additions & 1 deletion examples/micview.c
Original file line number Diff line number Diff line change
Expand Up @@ -161,12 +161,15 @@ int main(int argc, char** argv) {

int nr_devices = freenect_num_devices (f_ctx);
printf ("Number of devices found: %d\n", nr_devices);
if (nr_devices < 1)
if (nr_devices < 1) {
freenect_shutdown(f_ctx);
return 1;
}

int user_device_number = 0;
if (freenect_open_device(f_ctx, &f_dev, user_device_number) < 0) {
printf("Could not open device\n");
freenect_shutdown(f_ctx);
return 1;
}

Expand All @@ -188,6 +191,7 @@ int main(int argc, char** argv) {
int res = pthread_create(&freenect_thread, NULL, freenect_threadfunc, NULL);
if (res) {
printf("pthread_create failed\n");
freenect_shutdown(f_ctx);
return 1;
}
printf("This is the libfreenect microphone waveform viewer. Press 'q' to quit or spacebar to pause/unpause the view.\n");
Expand Down
4 changes: 2 additions & 2 deletions examples/regtest.c
Original file line number Diff line number Diff line change
Expand Up @@ -43,13 +43,13 @@ FILE *open_dump(const char *filename)

void dump_depth(FILE *fp, void *data, unsigned int width, unsigned int height)
{
fprintf(fp, "P5 %d %d 65535\n", width, height);
fprintf(fp, "P5 %u %u 65535\n", width, height);
fwrite(data, width * height * 2, 1, fp);
}

void dump_rgb(FILE *fp, void *data, unsigned int width, unsigned int height)
{
fprintf(fp, "P6 %d %d 255\n", width, height);
fprintf(fp, "P6 %u %u 255\n", width, height);
fwrite(data, width * height * 3, 1, fp);
}

Expand Down
6 changes: 5 additions & 1 deletion examples/regview.c
Original file line number Diff line number Diff line change
Expand Up @@ -363,17 +363,21 @@ int main(int argc, char **argv)
if (argc > 1)
user_device_number = atoi(argv[1]);

if (nr_devices < 1)
if (nr_devices < 1) {
freenect_shutdown(f_ctx);
return 1;
}

if (freenect_open_device(f_ctx, &f_dev, user_device_number) < 0) {
printf("Could not open device\n");
freenect_shutdown(f_ctx);
return 1;
}

res = pthread_create(&freenect_thread, NULL, freenect_threadfunc, NULL);
if (res) {
printf("pthread_create failed\n");
freenect_shutdown(f_ctx);
return 1;
}

Expand Down
7 changes: 6 additions & 1 deletion examples/wavrecord.c
Original file line number Diff line number Diff line change
Expand Up @@ -80,16 +80,20 @@ int main(int argc, char** argv) {

int nr_devices = freenect_num_devices (f_ctx);
printf ("Number of devices found: %d\n", nr_devices);
if (nr_devices < 1)
if (nr_devices < 1) {
freenect_shutdown(f_ctx);
return 1;
}

int user_device_number = 0;
if (freenect_open_device(f_ctx, &f_dev, user_device_number) < 0) {
printf("Could not open device\n");
freenect_shutdown(f_ctx);
return 1;
}

capture state;
state.samples = 0;
state.logfiles[0] = fopen("channel1.wav", "wb");
state.logfiles[1] = fopen("channel2.wav", "wb");
state.logfiles[2] = fopen("channel3.wav", "wb");
Expand Down Expand Up @@ -135,5 +139,6 @@ int main(int argc, char** argv) {
fclose(state.logfiles[i]);
}

freenect_shutdown(f_ctx);
return 0;
}
3 changes: 2 additions & 1 deletion fakenect/CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -8,12 +8,13 @@ set_target_properties ( fakenect PROPERTIES
VERSION ${PROJECT_VER}
SOVERSION ${PROJECT_APIVER}
OUTPUT_NAME freenect)
target_link_libraries(fakenect ${MATH_LIB})

install (TARGETS fakenect
DESTINATION "${PROJECT_LIBRARY_INSTALL_DIR}/fakenect")

add_executable(record record.c)
target_link_libraries(record freenect m)
target_link_libraries(record freenect)
install (TARGETS record
DESTINATION bin)

Expand Down
Loading

0 comments on commit acb82f5

Please sign in to comment.