Monado中集成了UltraLeap手势识别除了算法库和service部分的代码,今天就来解析一下。
一.UltraLeap代码目录和文件
从ultraleap代码目录下的Readme.md可以看到:
(1).编译Ultraleap代码需要有如下三个条件:
1.XRT_BUILD_DRIVER_ULV2 宏打开
2.Leap.h LeapMath.h头文件
3.libLeap.so算法库
(2).Ultraleap设备要想成功初始化,就需要ultraleap controller被成功编译和集成
ultraleap controller不仅包括当前目录下的ulv2_driver.cpp和ulv2_interface.h
还包括上一段build中提到的.h和so,这是需要ultraleap提供的
一.CMakeLists看看Ultraleap代码在Monado中被如何使用
1. Ultraleap的代码在Monado中被宏 XRT_BUILD_DRIVER_ULV2 控制:
2. /monado/CMakeLists.txt:
3. /monado/src/xrt/drivers/CMakeLists.txt:
注:ultraleap的代码会被编译成名为drv_ulv2.a静态库
(1).target_lists.a会根据各设备的宏决定是否link各设备的.a库
(2).target_lists.a会在不同的地方被编译link到:
monado-service可执行文件
driver_monado模块库
openxr-monado模块库
不再一一跟踪了
二.target_lists.c入口
三. ulv2_interface.h
(1).xrt_device.h和xrt_prober.h是每一个外接runtime设备都需要包含的头文件:
1.xrt_device.h包含了需要被外接device的基础结构体
2.xrt_prober.h包含了需要被外接device的controller探针
(2).Leap Montion Controller driver:
1.Ultraleap Motion
2.Ultraleap Controller
(3).前文所述的每个设备Controller的found( )函数参数与之前found函数注解一一对应