-
Notifications
You must be signed in to change notification settings - Fork 1
/
psmoveapi.patch
73 lines (65 loc) · 2.77 KB
/
psmoveapi.patch
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
diff --git a/examples/c/distance_calibration.c b/examples/c/distance_calibration.c
index 14f8189..3c209c5 100644
--- a/examples/c/distance_calibration.c
+++ b/examples/c/distance_calibration.c
@@ -34,6 +34,7 @@
#include "opencv2/core/core_c.h"
#include "opencv2/highgui/highgui_c.h"
+#include "opencv2/imgcodecs/imgcodecs_c.h"
#include "psmove.h"
#include "psmove_tracker.h"
diff --git a/src/CMakeLists.txt b/src/CMakeLists.txt
index 6e45cae..081c00a 100644
--- a/src/CMakeLists.txt
+++ b/src/CMakeLists.txt
@@ -74,7 +74,7 @@ IF(${CMAKE_SYSTEM_NAME} MATCHES "Darwin")
set(CMAKE_EXE_LINKER_FLAGS "${CMAKE_EXE_LINKER_FLAGS} -stdlib=libc++")
set(CMAKE_SHARED_LINKER_FLAGS "${CMAKE_SHARED_LINKER_FLAGS} -stdlib=libc++")
set(CMAKE_STATIC_LIBRARY_FLAGS "${CMAKE_STATIC_LIBRARY_FLAGS} -stdlib=libc++")
-
+
ELSEIF(${CMAKE_SYSTEM_NAME} MATCHES "Windows")
list(APPEND PSMOVEAPI_REQUIRED_LIBS setupapi bthprops kernel32 ws2_32 winmm version imm32)
@@ -101,8 +101,12 @@ ELSE()
include_directories(${UDEV_INCLUDE_DIRS})
list(APPEND PSMOVEAPI_REQUIRED_LIBS ${UDEV_LIBRARIES})
+ pkg_check_modules(V4L2 REQUIRED libv4l2)
+ include_directories(${V4L2_INCLUDE_DIRS})
+ list(APPEND PSMOVEAPI_REQUIRED_LIBS ${V4L2_LIBRARIES})
+
pkg_check_modules(BLUEZ REQUIRED bluez)
-
+
# auto-detect BlueZ version >= 5
if(${BLUEZ_VERSION} VERSION_LESS "5.0")
set(INFO_BLUEZ5_SUPPORT "No")
@@ -147,7 +151,7 @@ file(GLOB PSMOVEAPI_HEADERS
file (GLOB PSMOVEAPI_MATH_HEADERS
"${CMAKE_CURRENT_LIST_DIR}/math/*.h"
- "${CMAKE_CURRENT_LIST_DIR}/math/*.hpp"
+ "${CMAKE_CURRENT_LIST_DIR}/math/*.hpp"
)
file (GLOB PSMOVEAPI_MATH_SRC
diff --git a/src/tracker/camera_control_private.h b/src/tracker/camera_control_private.h
index a4842b1..86aa8b7 100644
--- a/src/tracker/camera_control_private.h
+++ b/src/tracker/camera_control_private.h
@@ -33,6 +33,7 @@
#include "opencv2/core/core_c.h"
#include "opencv2/highgui/highgui_c.h"
#include "opencv2/imgproc/imgproc_c.h"
+#include "opencv2/videoio/videoio_c.h"
#if defined(WIN32)
# include <windows.h>
diff --git a/src/tracker/platform/camera_control_linux.c b/src/tracker/platform/camera_control_linux.c
index 2a1e19c..eabf8a8 100644
--- a/src/tracker/platform/camera_control_linux.c
+++ b/src/tracker/platform/camera_control_linux.c
@@ -107,7 +107,7 @@ camera_control_set_parameters(CameraControl* cc, int autoE, int autoG, int autoW
v4l2_set_control(fd, V4L2_CID_EXPOSURE, exposure);
v4l2_set_control(fd, V4L2_CID_GAIN, gain);
- v4l2_set_control(fd, V4L2_CID_EXPOSURE_AUTO, autoE);
+ v4l2_set_control(fd, V4L2_CID_EXPOSURE_AUTO, autoE ? 0 : 65535);
v4l2_set_control(fd, V4L2_CID_AUTOGAIN, autoG);
v4l2_set_control(fd, V4L2_CID_AUTO_WHITE_BALANCE, autoWB);
#if 0