Skip to content
Closed
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
49 commits
Select commit Hold shift + click to select a range
baef89f
Add depth to RGB registration via FREENECT_DEPTH_REGISTERED and raw-t…
zarvox Sep 26, 2011
e886638
libfreenect: stricter check for send_cmd() in freenect_fetch_zero_pla…
Oct 13, 2011
b7a8f97
libfreenect: Use the actual dev_reg_info field names in unprinted deb…
Oct 13, 2011
af8e6ee
c_sync: Add support for registered depth to c_sync wrapper
Oct 13, 2011
eae0cb4
c_sync: Add an example program for registered depth based on c_sync
Oct 13, 2011
17948a1
HACKING: fix indentation; add a missing '=' to one of the titles
Oct 13, 2011
80894bc
HACKING: document how to make debug builds
zarvox Oct 15, 2011
3db7f23
not necessary to init reg tables for 11-bit unpacked depth
floe Oct 13, 2011
4feb5e7
no need to wipe the buffer as every pixel will be written exactly once
floe Oct 13, 2011
e02a2ec
add helper function to convert camera coords -> metric world coords
floe Oct 13, 2011
540f924
wrappers/python: Use explicit include path
marcan Oct 16, 2011
dc9fe08
wrappers/python: Release the GIL in the async interface
marcan Oct 16, 2011
9141c8e
wrappers/python: Support init outside the runloop
marcan Oct 16, 2011
8f53bf8
wrappers/python: Use structures and enums from headers
marcan Oct 16, 2011
72ed6e6
Updated to use rspec 2
algrs Jul 23, 2011
6f9b50a
Updated FFI interface to match new interface. All tests run, some tests
algrs Jul 23, 2011
01c1f33
Updated Freenect singleton to query the new FrameMode system.
algrs Jul 23, 2011
4ff6cd7
Minor code cleanup, removing commented out code.
algrs Jul 23, 2011
e79d08c
Updated tests
algrs Jul 23, 2011
b674a8a
wappers/ruby: Updated to use new frame mode code.
algrs Jul 25, 2011
4d3c590
wrappers/ruby: Update examples
algrs Jul 25, 2011
87f61ea
Fixed up ConsoleTest project for new API changes. Also made small twe…
lostinspacebar Jun 3, 2011
cbf9ef9
libusbemu: fix missing int types when compiling under mingw
Oct 22, 2011
a1e42c8
libusbemu: fix "expected unqualified-id before numeric constant" error
Oct 22, 2011
f421ac4
libusbemu: make libusb functions callable with a NULL context
Oct 22, 2011
5a5a47a
libusbemu: add a stub implementation for libusb_set_debug()
Oct 22, 2011
4e68bcc
libusbemu: add a stub implementation for libusb_set_configuration()
Oct 22, 2011
e04b4c7
libusbemu: implement libusb_open_device_with_vid_pid()
Oct 24, 2011
cddf18c
libusbemu: implement libusb_bulk_transfer()
Oct 22, 2011
aed0262
Adjust freenect_camera_to_world for 1280x1024 -> 640x480 conversion.
zarvox Oct 29, 2011
73a22af
Actually, the camera_to_world scale factor should just be 2.
zarvox Oct 29, 2011
ad0ec0b
libusbemu: implement libusb_set_debug and libusb_set_configuration
zarvox Oct 31, 2011
856095c
Add string descriptor retrieval to libusbemu.
zarvox Nov 3, 2011
c5c76fa
Drop the consts from function return types; they don't do anything in…
zarvox Nov 3, 2011
3d7a011
Attempt to rework audio/firmware upload.
zarvox Nov 6, 2011
b270518
src/loader.c: Be quiet, compiler.
zarvox Nov 6, 2011
0010cad
Add support for examining camera serial numbers and opening devices b…
zarvox Nov 6, 2011
619a1e5
wrappers/python: Support asynchronous usage without the full runloop
marcan Nov 9, 2011
371ee04
Add a non-blocking freenect_process_events_timeout().
zarvox Nov 10, 2011
4e1be4e
wrappers/python: fix numpy include path for cmake build too
marcan Nov 10, 2011
e04ba7f
wrappers/python: fix sync wrappers
marcan Nov 10, 2011
e7eed98
Add function to query what subdevices the library supports.
zarvox Nov 13, 2011
8755990
opencv wrapper: Use the CMake OpenCV finder instead of naming librari…
zarvox Nov 14, 2011
3f4aba8
fakenect: add fakenect helper script
shelhamer Aug 18, 2011
ed5081f
Fix the audios.bin install path.
zarvox Nov 14, 2011
53e8aa2
Fix the java wrapper
edaubert Nov 6, 2011
5855740
Fix the java wrapper
edaubert Nov 6, 2011
cfddec5
Fix the java wrapper
edaubert Nov 6, 2011
1a0ea42
Switch entirely to using FrameModes internally
nneonneo Nov 15, 2011
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
1 change: 1 addition & 0 deletions .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -29,3 +29,4 @@ obj/
_ReSharper*/
[Tt]est[Rr]esult*
build
/results/
5 changes: 5 additions & 0 deletions CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -98,6 +98,10 @@ SET(DOC_OUTPUT_PATH ${CMAKE_BINARY_DIR}/doc)
if(CMAKE_C_FLAGS STREQUAL "")
set(CMAKE_C_FLAGS "-O2")
endif()
SET(CMAKE_C_FLAGS_DEBUG "-g -DDEBUG=1")
SET(CMAKE_C_FLAGS_RELEASE "-O2")
SET(CMAKE_C_FLAGS_RELWITHDEBINFO "-O2 -g")

add_definitions(-Wall)

# Pretty much everyone is going to need the main includes
Expand Down Expand Up @@ -182,6 +186,7 @@ IF ( BUILD_CPACK )
INSTALL(FILES "include/libfreenect-audio.h" DESTINATION ${PROJECT_INCLUDE_INSTALL_DIR})
endif()
INSTALL(FILES "include/libfreenect.h" DESTINATION ${PROJECT_INCLUDE_INSTALL_DIR})
INSTALL(FILES "include/libfreenect-registration.h" DESTINATION ${PROJECT_INCLUDE_INSTALL_DIR})
INSTALL(FILES "APACHE20" DESTINATION "share/doc/${CPACK_PACKAGE_NAME}")
INSTALL(FILES "GPL2" DESTINATION "share/doc/${CPACK_PACKAGE_NAME}")
INSTALL(FILES "README.asciidoc" DESTINATION "share/doc/${CPACK_PACKAGE_NAME}")
Expand Down
36 changes: 27 additions & 9 deletions HACKING
Original file line number Diff line number Diff line change
Expand Up @@ -57,18 +57,18 @@ the body.

Functions should have the opening brace on the next line, like this:

void foo(int a_thing, int something_else)
{
...
}
void foo(int a_thing, int something_else)
{
...
}

No-args functions should be (void), and function arguments should be separated
with a space after the comma, like this:

void baz(void)
{
foo(bluh, blah);
}
void baz(void)
{
foo(bluh, blah);
}

Try to avoid having excessively long function names (abbreviating is fine) and
don't make multiple functions that do essentially the same thing (and certainly
Expand All @@ -78,7 +78,25 @@ In general, for data obtained with the Kinect, we'll provide a raw and a
"cooked" variant, where it makes sense, but we don't need to support every
"cooked" value convention under the sun.

== WHITESPACE ===
=== WHITESPACE ===

Avoid trailing whitespace. No lines should end in a tab or a space. Keep a
newline (blank line) at the end of each file.

=== DEBUG BUILD ===

In order to build the binaries with debug symbols the following commands
can be used:

$ mkdir build
$ cd build
$ cmake ../ -DCMAKE_BUILD_TYPE=debug
$ make

If you want to build in release mode (with optimizations) but still have debug
symbols, try RelWithDebInfo:

$ mkdir build
$ cd build
$ cmake ../ -DCMAKE_BUILD_TYPE=RelWithDebInfo
$ make
1 change: 1 addition & 0 deletions README.asciidoc
Original file line number Diff line number Diff line change
Expand Up @@ -131,6 +131,7 @@ directory for them:
- python
- actionscript
- C#
- Java (JNA)

=== Licensing

Expand Down
9 changes: 8 additions & 1 deletion examples/CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -6,6 +6,7 @@ set(CMAKE_C_FLAGS "-Wall")

if (WIN32)
set_source_files_properties(glview.c PROPERTIES LANGUAGE CXX)
set_source_files_properties(regview.c PROPERTIES LANGUAGE CXX)
set_source_files_properties(glpclview.c PROPERTIES LANGUAGE CXX)
set_source_files_properties(hiview.c PROPERTIES LANGUAGE CXX)
set_source_files_properties(tiltdemo.c PROPERTIES LANGUAGE CXX)
Expand All @@ -17,6 +18,7 @@ if (WIN32)
endif()

add_executable(glview glview.c)
add_executable(regview regview.c)
add_executable(hiview hiview.c)
if(BUILD_AUDIO)
add_executable(wavrecord wavrecord.c)
Expand All @@ -26,6 +28,7 @@ endif()
if (BUILD_C_SYNC)
add_executable(glpclview glpclview.c)
add_executable(tiltdemo tiltdemo.c)
add_executable(regtest regtest.c)
endif()

# We need to include libfreenect_sync.h for glpclview
Expand All @@ -35,6 +38,7 @@ include_directories (../wrappers/c_sync/)
if(APPLE)
set(CMAKE_EXE_LINKER_FLAGS "-framework OpenGL -framework GLUT")
target_link_libraries(glview freenect)
target_link_libraries(regview freenect)
target_link_libraries(hiview freenect)
if (BUILD_AUDIO)
target_link_libraries(wavrecord freenect)
Expand All @@ -43,6 +47,7 @@ if(APPLE)
if (BUILD_C_SYNC)
target_link_libraries(glpclview freenect_sync)
target_link_libraries(tiltdemo freenect_sync)
target_link_libraries(regtest freenect_sync)
endif()
# Linux, not so much
else()
Expand All @@ -60,6 +65,7 @@ else()
endif()

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})
target_link_libraries(hiview freenect ${OPENGL_LIBRARIES} ${GLUT_LIBRARY} ${CMAKE_THREAD_LIBS_INIT} ${MATH_LIB})
if (BUILD_AUDIO)
target_link_libraries(wavrecord freenect ${OPENGL_LIBRARIES} ${GLUT_LIBRARY} ${CMAKE_THREAD_LIBS_INIT} ${MATH_LIB})
Expand All @@ -69,11 +75,12 @@ else()
target_link_libraries(glpclview freenect_sync ${OPENGL_LIBRARIES} ${GLUT_LIBRARY}
${CMAKE_THREAD_LIBS_INIT} ${MATH_LIB})
target_link_libraries(tiltdemo freenect_sync ${CMAKE_THREAD_LIBS_INIT} ${MATH_LIB})
target_link_libraries(regtest freenect_sync ${CMAKE_THREAD_LIBS_INIT})
endif()
endif()


install (TARGETS glview hiview
install (TARGETS glview regview hiview
DESTINATION bin)

if (BUILD_C_SYNC)
Expand Down
103 changes: 103 additions & 0 deletions examples/regtest.c
Original file line number Diff line number Diff line change
@@ -0,0 +1,103 @@
/*
* This file is part of the OpenKinect Project. http://www.openkinect.org
*
* Copyright (c) 2011 individual OpenKinect contributors. See the CONTRIB file
* for details.
*
* This code is licensed to you under the terms of the Apache License, version
* 2.0, or, at your option, the terms of the GNU General Public License,
* version 2.0. See the APACHE20 and GPL2 files for the text of the licenses,
* or the following URLs:
* http://www.apache.org/licenses/LICENSE-2.0
* http://www.gnu.org/licenses/gpl-2.0.txt
*
* If you redistribute this file in source form, modified or unmodified, you
* may:
* 1) Leave this header intact and distribute it under the same terms,
* accompanying it with the APACHE20 and GPL20 files, or
* 2) Delete the Apache 2.0 clause and accompany it with the GPL2 file, or
* 3) Delete the GPL v2 clause and accompany it with the APACHE20 file
* In all cases you must keep the copyright notice intact and include a copy
* of the CONTRIB file.
*
* Binary distributions must follow the binary distribution requirements of
* either License.
*/

#include <stdio.h>
#include <stdlib.h>

#include "libfreenect.h"
#include "libfreenect_sync.h"

FILE *open_dump(const char *filename)
{
FILE* fp = fopen(filename, "w");
if (fp == NULL) {
fprintf(stderr, "Error: Cannot open file [%s]\n", filename);
exit(1);
}
printf("%s\n", filename);
return fp;
}

void dump_depth(FILE *fp, void *data, unsigned int width, unsigned int height)
{
fprintf(fp, "P5 %d %d 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);
fwrite(data, width * height * 3, 1, fp);
}

void no_kinect_quit(void)
{
fprintf(stderr, "Error: Kinect not connected?\n");
exit(1);
}

int main(void)
{
short *depth = 0;
char *rgb = 0;
uint32_t ts;
FILE *fp;
int ret;

ret = freenect_sync_get_video((void**)&rgb, &ts, 0, FREENECT_VIDEO_RGB);
if (ret < 0)
no_kinect_quit();

fp = open_dump("registration_test_rgb.ppm");
dump_rgb(fp, rgb, 640, 480);
fclose(fp);

ret = freenect_sync_get_depth((void**)&depth, &ts, 0, FREENECT_DEPTH_11BIT);
if (ret < 0)
no_kinect_quit();

fp = open_dump("registration_test_depth_raw.pgm");
dump_depth(fp, depth, 640, 480);
fclose(fp);

ret = freenect_sync_get_depth((void**)&depth, &ts, 0, FREENECT_DEPTH_REGISTERED);
if (ret < 0)
no_kinect_quit();

fp = open_dump("registration_test_depth_registered.pgm");
dump_depth(fp, depth, 640, 480);
fclose(fp);

ret = freenect_sync_get_depth((void**)&depth, &ts, 0, FREENECT_DEPTH_MM);
if (ret < 0)
no_kinect_quit();

fp = open_dump("registration_test_depth_mm.pgm");
dump_depth(fp, depth, 640, 480);
fclose(fp);

return 0;
}
Loading