Skip to content

Commit d071095

Browse files
committed
c_sync: Add freenect_sync_camera_to_world() (thanks @martyvona) - fixes OpenKinect#294
Signed-off-by: Benn Snyder <[email protected]>
1 parent 513a177 commit d071095

File tree

2 files changed

+13
-0
lines changed

2 files changed

+13
-0
lines changed

wrappers/c_sync/libfreenect_sync.c

Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -28,6 +28,7 @@
2828
#include <string.h>
2929
#include <stdlib.h>
3030
#include <assert.h>
31+
#include "libfreenect_registration.h"
3132
#include "libfreenect_sync.h"
3233

3334
typedef struct buffer_ring {
@@ -402,6 +403,13 @@ int freenect_sync_set_led(freenect_led_options led, int index) {
402403
return 0;
403404
}
404405

406+
int freenect_sync_camera_to_world(int cx, int cy, int wz, double* wx, double* wy, int index) {
407+
if (runloop_enter(index)) return -1;
408+
freenect_camera_to_world(kinects[index]->dev, cx, cy, wz, wx, wy);
409+
runloop_exit();
410+
return 0;
411+
}
412+
405413
void freenect_sync_stop(void)
406414
{
407415
if (thread_running) {

wrappers/c_sync/libfreenect_sync.h

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -113,6 +113,11 @@ FREENECTAPI_SYNC int freenect_sync_set_led(freenect_led_options led, int index);
113113
Nonzero on error.
114114
*/
115115

116+
FREENECTAPI_SYNC int freenect_sync_camera_to_world(int cx, int cy, int wz, double* wx, double* wy, int index);
117+
/* Camera to world mapping, starts the runloop if it isn't running
118+
119+
Wraps libfreenect_registration.h function of same name.
120+
*/
116121

117122
FREENECTAPI_SYNC void freenect_sync_stop(void);
118123
#ifdef __cplusplus

0 commit comments

Comments
 (0)