Skip to content

Commit 9bd5d05

Browse files
committed
Merge tag 'v0.5.1' into dfsg
libfreenect v0.5.1 Tabula * tag 'v0.5.1': Fix CPack libusb dependency - fixes OpenKinect#420 win32: Fix scattered sources causing link errors OSX: Link freenect-cpp_pcview to libfreenect Install libfreenect.pc on OSX - fixes OpenKinect#410 Fix broken link in README.md Add cpp_pcview example Update python wrapper. python: Add .gitattributes which treats the Python freenect.c as binary Ignore .pyc files from Python Python wrapper: handle non-standard modes properly Python wrapper: prevent *Ptr classes from being created from Python Java wrapper: Don't set video or depth formats at startup. Implement all FREENECTAPI functions in fakenect to avoid issues with Java wrapper bump java wrapper version, bundle with all dependencies Use native byte ordering on byte buffers Add convenient Makefile python: add Python library to link command
2 parents 9716fbf + 846b6bf commit 9bd5d05

14 files changed

Lines changed: 5485 additions & 4115 deletions

File tree

.gitattributes

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1 @@
1+
wrappers/python/freenect.c binary

CMakeLists.txt

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -188,7 +188,7 @@ IF ( BUILD_CPACK_TGZ OR BUILD_CPACK_DEB OR BUILD_CPACK_RPM )
188188
set(CPACK_PACKAGE_DESCRIPTION "libfreenect for kinect")
189189
set(CPACK_PACKAGE_DESCRIPTION_SUMMARY "libfreenect library for using kinect")
190190
set(CPACK_PACKAGE_NAME "libfreenect-dev")
191-
set(CPACK_DEBIAN_PACKAGE_DEPENDS "libusb-1.0.0-dev")
191+
set(CPACK_DEBIAN_PACKAGE_DEPENDS "libusb-1.0-0-dev")
192192

193193
set(CPACK_PACKAGE_CONTACT "OpenKinect <openkinect@googlegroups.com>")
194194
#set(CPACK_PACKAGE_VENDOR "")

README.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -134,7 +134,7 @@ Wrappers are not guaranteed to be API stable or up to date.
134134
# cython freenect.pyx
135135
python2 setup.py build_ext --inplace
136136

137-
For example, start with [demo_cv_async.py](https://gihub.com/OpenKinect/libfreenect/tree/master/wrappers/python/devmo_cv_async.py).
137+
For example, start with [demo_cv_async.py](https://github.com/OpenKinect/libfreenect/tree/master/wrappers/python/demo_cv_async.py).
138138

139139

140140
# Code Contributions

fakenect/fakenect.c

Lines changed: 46 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -219,6 +219,11 @@ freenect_raw_tilt_state* freenect_get_tilt_state(freenect_device *dev)
219219
return &state;
220220
}
221221

222+
freenect_tilt_status_code freenect_get_tilt_status(freenect_raw_tilt_state *state)
223+
{
224+
return state->tilt_status;
225+
}
226+
222227
void freenect_get_mks_accel(freenect_raw_tilt_state *state, double* x, double* y, double* z)
223228
{
224229
//the documentation for the accelerometer (http://www.kionix.com/Product%20Sheets/KXSD9%20Product%20Brief.pdf)
@@ -261,6 +266,21 @@ freenect_frame_mode freenect_find_video_mode(freenect_resolution res, freenect_v
261266
return out;
262267
}
263268

269+
int freenect_get_video_mode_count()
270+
{
271+
return 1;
272+
}
273+
274+
freenect_frame_mode freenect_get_video_mode(int mode_num)
275+
{
276+
return freenect_find_video_mode(FREENECT_RESOLUTION_MEDIUM, FREENECT_VIDEO_RGB);
277+
}
278+
279+
freenect_frame_mode freenect_get_current_video_mode(freenect_device *dev)
280+
{
281+
return freenect_get_video_mode(0);
282+
}
283+
264284
freenect_frame_mode freenect_find_depth_mode(freenect_resolution res, freenect_depth_format fmt) {
265285
assert(FREENECT_RESOLUTION_MEDIUM == res);
266286
assert(FREENECT_DEPTH_11BIT == fmt);
@@ -270,6 +290,21 @@ freenect_frame_mode freenect_find_depth_mode(freenect_resolution res, freenect_d
270290
return out;
271291
}
272292

293+
int freenect_get_depth_mode_count()
294+
{
295+
return 1;
296+
}
297+
298+
freenect_frame_mode freenect_get_depth_mode(int mode_num)
299+
{
300+
return freenect_find_depth_mode(FREENECT_RESOLUTION_MEDIUM, FREENECT_DEPTH_11BIT);
301+
}
302+
303+
freenect_frame_mode freenect_get_current_depth_mode(freenect_device *dev)
304+
{
305+
return freenect_get_depth_mode(0);
306+
}
307+
273308
int freenect_num_devices(freenect_context *ctx)
274309
{
275310
// Always 1 device
@@ -283,12 +318,23 @@ int freenect_open_device(freenect_context *ctx, freenect_device **dev, int index
283318
return 0;
284319
}
285320

321+
int freenect_open_device_by_camera_serial(freenect_context *ctx, freenect_device **dev, const char* camera_serial)
322+
{
323+
*dev = fake_dev;
324+
return 0;
325+
}
326+
286327
int freenect_init(freenect_context **ctx, freenect_usb_context *usb_ctx)
287328
{
288329
*ctx = fake_ctx;
289330
return 0;
290331
}
291332

333+
int freenect_supported_subdevices(void)
334+
{
335+
return FREENECT_DEVICE_MOTOR | FREENECT_DEVICE_CAMERA;
336+
}
337+
292338
void freenect_select_subdevices(freenect_context *ctx, freenect_device_flags subdevs) {
293339
// Ideally, we'd actually check for MOTOR and CAMERA and AUDIO, but for now
294340
// we just ignore them and provide all captured data.

src/CMakeLists.txt

Lines changed: 3 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -5,14 +5,13 @@
55
include_directories (${CMAKE_CURRENT_SOURCE_DIR})
66

77
include_directories(${LIBUSB_1_INCLUDE_DIRS})
8-
LIST(APPEND SRC core.c tilt.c cameras.c flags.c usb_libusb10.c registration.c)
8+
LIST(APPEND SRC core.c tilt.c cameras.c flags.c usb_libusb10.c registration.c audio.c loader.c)
99
IF(WIN32)
1010
set_source_files_properties(${SRC} PROPERTIES LANGUAGE CXX)
1111
ENDIF(WIN32)
1212

13-
# Audio
13+
# Audio Firmware
1414
include(FindPythonInterp)
15-
LIST(APPEND SRC audio.c loader.c)
1615
IF(BUILD_REDIST_PACKAGE)
1716
# If this build is intended for a redistributable package, we can't include audios.bin, so we should include fwfetcher.py
1817
# and the package should run "python fwfetcher.py $INSTALL_PREFIX/share" as a postinst hook
@@ -47,7 +46,7 @@ target_link_libraries (freenectstatic ${LIBUSB_1_LIBRARIES})
4746
install (FILES "../include/libfreenect.h" "../include/libfreenect_registration.h" "../include/libfreenect_audio.h"
4847
DESTINATION ${PROJECT_INCLUDE_INSTALL_DIR})
4948

50-
IF(UNIX AND NOT APPLE)
49+
IF(UNIX)
5150
# Produce a pkg-config file for linking against the shared lib
5251
configure_file ("libfreenect.pc.in" "libfreenect.pc" @ONLY)
5352
install (FILES "${CMAKE_CURRENT_BINARY_DIR}/libfreenect.pc"

wrappers/cpp/CMakeLists.txt

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -13,11 +13,13 @@ endif()
1313
include_directories(.)
1414

1515
add_executable(freenect-cppview cppview.cpp)
16+
add_executable(freenect-cpp_pcview cpp_pc_view.cpp)
1617

1718
# Mac just has everything already
1819
if(APPLE)
1920
set(CMAKE_EXE_LINKER_FLAGS "-framework OpenGL -framework GLUT")
2021
target_link_libraries(freenect-cppview freenect)
22+
target_link_libraries(freenect-cpp_pcview freenect)
2123
else()
2224
find_package(Threads REQUIRED)
2325
find_package(OpenGL REQUIRED)
@@ -26,9 +28,13 @@ else()
2628
include_directories(${OPENGL_INCLUDE_DIR} ${GLUT_INCLUDE_DIR} ${USB_INCLUDE_DIRS})
2729

2830
target_link_libraries(freenect-cppview freenect ${OPENGL_LIBRARIES} ${GLUT_LIBRARY} ${CMAKE_THREAD_LIBS_INIT} ${MATH_LIB})
31+
target_link_libraries(freenect-cpp_pcview freenect ${OPENGL_LIBRARIES} ${GLUT_LIBRARY} ${CMAKE_THREAD_LIBS_INIT})
2932
endif()
3033

3134
install (TARGETS freenect-cppview
3235
DESTINATION bin)
3336

37+
install (TARGETS freenect-cpp_pcview
38+
DESTINATION bin)
39+
3440
ENDIF()

0 commit comments

Comments
 (0)