add list depth work mode

This commit is contained in:
Joe Dong
2023-03-20 09:34:49 +08:00
parent 1cf703e481
commit 0d318d7a2a
2 changed files with 50 additions and 0 deletions
+28
View File
@@ -194,6 +194,33 @@ ament_target_dependencies(ob_cleanup_shm_node
${dependencies}
)
add_executable(list_depth_work_mode_node
src/list_depth_work_mode.cpp
)
target_include_directories(list_depth_work_mode_node PUBLIC
$<BUILD_INTERFACE:${CMAKE_CURRENT_BINARY_DIR}/include>
$<BUILD_INTERFACE:${CMAKE_CURRENT_SOURCE_DIR}/include>
$<INSTALL_INTERFACE:include>
${ORBBEC_INCLUDE_DIR}
${OpenCV_INCLUDED_DIRS}
${GLOG_INCLUDED_DIRS}
)
target_link_libraries(list_depth_work_mode_node
${ORBBEC_SDK_LIBRARIES}
${OpenCV_LIBS}
Eigen3::Eigen
${GLOG_LIBRARIES}
-lOrbbecSDK
-L${ORBBEC_LIBS}
${PROJECT_NAME}
)
ament_target_dependencies(list_depth_work_mode_node
${dependencies}
)
install(TARGETS ${PROJECT_NAME}
ARCHIVE DESTINATION lib
LIBRARY DESTINATION lib
@@ -230,6 +257,7 @@ install(DIRECTORY
install(TARGETS list_devices_node
ob_cleanup_shm_node
list_depth_work_mode_node
${PROJECT_NAME}_node
DESTINATION lib/${PROJECT_NAME}/
)
@@ -0,0 +1,22 @@
#include <orbbec_camera/ob_camera_node.h>
int main() {
std::shared_ptr<ob::Pipeline> pipeline = std::make_shared<ob::Pipeline>();
auto device = pipeline->getDevice();
if (!device) {
std::cout << "No device found" << std::endl;
return -1;
}
if (!device->isPropertySupported(OB_STRUCT_CURRENT_DEPTH_ALG_MODE, OB_PERMISSION_READ_WRITE)) {
std::cout << "Current device not support depth work mode!" << std::endl;
return -1;
}
auto depthModeList = device->getDepthWorkModeList();
std::cout << "depth mode list: " << std::endl;
for (uint32_t i = 0; i < depthModeList->count(); i++) {
std::cout << "depthModeList[" << i << "]: " << (*depthModeList)[i].name;
std::cout << std::endl;
}
return 0;
}