diff --git a/orbbec_camera/tools/list_devices_node.cpp b/orbbec_camera/tools/list_devices_node.cpp index e4b9c26a..fe4c2f52 100644 --- a/orbbec_camera/tools/list_devices_node.cpp +++ b/orbbec_camera/tools/list_devices_node.cpp @@ -1,18 +1,18 @@ /******************************************************************************* -* Copyright (c) 2023 Orbbec 3D Technology, Inc -* -* Licensed under the Apache License, Version 2.0 (the "License"); -* you may not use this file except in compliance with the License. -* You may obtain a copy of the License at -* -* http://www.apache.org/licenses/LICENSE-2.0 -* -* Unless required by applicable law or agreed to in writing, software -* distributed under the License is distributed on an "AS IS" BASIS, -* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -* See the License for the specific language governing permissions and -* limitations under the License. -*******************************************************************************/ + * Copyright (c) 2023 Orbbec 3D Technology, Inc + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + *******************************************************************************/ #include #include @@ -21,7 +21,7 @@ int main() { try { auto context = std::make_unique(); - context->setLoggerSeverity(OBLogSeverity::OB_LOG_SEVERITY_NONE); + context->setLoggerSeverity(OBLogSeverity::OB_LOG_SEVERITY_OFF); auto list = context->queryDeviceList(); for (size_t i = 0; i < list->deviceCount(); i++) { auto device = list->getDevice(i); @@ -29,13 +29,18 @@ int main() { std::string serial = device_info->serialNumber(); std::string uid = device_info->uid(); auto usb_port = orbbec_camera::parseUsbPort(uid); + RCLCPP_INFO_STREAM(rclcpp::get_logger("list_device_node"), + "- Name: " << device_info->getName() << ", PID: 0x" + << device_info->getPid() << ", SN/ID: " << serial + << ", Connection: " << device_info->getConnectionType()); RCLCPP_INFO_STREAM(rclcpp::get_logger("list_device_node"), "serial: " << serial); RCLCPP_INFO_STREAM(rclcpp::get_logger("list_device_node"), "usb port: " << usb_port); - RCLCPP_INFO_STREAM(rclcpp::get_logger("list_device_node"), "usb connect type: " << device_info->getConnectionType()); + RCLCPP_INFO_STREAM(rclcpp::get_logger("list_device_node"), + "usb connect type: " << device_info->getConnectionType()); } - } catch (ob::Error &e) { + } catch (ob::Error &e) { RCLCPP_ERROR_STREAM(rclcpp::get_logger("list_device_node"), e.getMessage()); - }catch (const std::exception &e) { + } catch (const std::exception &e) { RCLCPP_ERROR_STREAM(rclcpp::get_logger("list_device_node"), e.what()); } catch (...) { RCLCPP_ERROR_STREAM(rclcpp::get_logger("list_device_node"), "unknown error");