Failed to start USB setting for specified single camera

This commit is contained in:
jj
2024-10-29 16:29:29 +08:00
parent 355c48bbf1
commit df144fd0d8
+4 -5
View File
@@ -285,11 +285,6 @@ void OBCameraNodeDriver::rebootDeviceCallback(
std::shared_ptr<ob::Device> OBCameraNodeDriver::selectDevice(
const std::shared_ptr<ob::DeviceList> &list) {
if (device_num_ == 1) {
RCLCPP_INFO_STREAM(logger_, "Connecting to the default device");
return list->getDevice(0);
}
std::shared_ptr<ob::Device> device = nullptr;
if (!serial_number_.empty()) {
RCLCPP_INFO_STREAM(logger_, "Connecting to device with serial number: " << serial_number_);
@@ -297,6 +292,10 @@ std::shared_ptr<ob::Device> OBCameraNodeDriver::selectDevice(
} else if (!usb_port_.empty()) {
RCLCPP_INFO_STREAM(logger_, "Connecting to device with usb port: " << usb_port_);
device = selectDeviceByUSBPort(list, usb_port_);
}
else if (device_num_ == 1) {
RCLCPP_INFO_STREAM(logger_, "Connecting to the default device");
return list->getDevice(0);
}
if (device == nullptr) {
RCLCPP_WARN_THROTTLE(logger_, *get_clock(), 1000, "Device with serial number %s not found",