mirror of
https://github.com/orbbec/OrbbecSDK_ROS2.git
synced 2026-10-07 05:27:45 +08:00
fix: enhance error logging by formatting error messages with status
This commit is contained in:
@@ -2791,7 +2791,8 @@ void OBCameraNode::setupProfiles() {
|
||||
|
||||
} catch (const ob::Error &ex) {
|
||||
RCLCPP_ERROR_STREAM(
|
||||
logger_, "Failed to get " << stream_name_[elem] << " profile: " << ex.getMessage());
|
||||
logger_, "Failed to get " << stream_name_[elem]
|
||||
<< " profile: " << orbbec_camera::formatObErrorWithStatus(ex));
|
||||
RCLCPP_ERROR_STREAM(
|
||||
logger_, "Stream: " << magic_enum::enum_name(elem.first)
|
||||
<< ", Stream Index: " << elem.second << ", Width: " << width_[elem]
|
||||
|
||||
@@ -1086,8 +1086,8 @@ void OBCameraNodeDriver::initializeDevice(const std::shared_ptr<ob::Device> &dev
|
||||
}
|
||||
} catch (ob::Error &e) {
|
||||
// Some devices don't support ISP firmware version query
|
||||
RCLCPP_DEBUG_STREAM(
|
||||
logger_, "Current device not support ISP firmware version query: " << e.getMessage());
|
||||
RCLCPP_DEBUG_STREAM(logger_, "Current device not support ISP firmware version query: "
|
||||
<< orbbec_camera::formatObErrorWithStatus(e));
|
||||
}
|
||||
RCLCPP_INFO_STREAM(logger_, "usb connect type: " << device_info_->getConnectionType());
|
||||
});
|
||||
|
||||
@@ -297,7 +297,8 @@ void OBLidarNode::setupProfiles() {
|
||||
|
||||
} catch (const ob::Error &ex) {
|
||||
RCLCPP_ERROR_STREAM(
|
||||
logger_, "Failed to get " << stream_name_[elem] << " profile: " << ex.getMessage());
|
||||
logger_, "Failed to get " << stream_name_[elem]
|
||||
<< " profile: " << orbbec_camera::formatObErrorWithStatus(ex));
|
||||
RCLCPP_ERROR_STREAM(logger_, "Stream: " << magic_enum::enum_name(elem.first)
|
||||
<< ", Stream Index: " << elem.second
|
||||
<< ", Scan Rate: " << rate_[elem]
|
||||
@@ -1262,8 +1263,9 @@ void OBLidarNode::calcAndPublishStaticTransform() {
|
||||
RCLCPP_INFO_STREAM(logger_, "Using GYRO extrinsic for IMU");
|
||||
} catch (const ob::Error &e2) {
|
||||
RCLCPP_ERROR_STREAM(
|
||||
logger_, "Failed to get "
|
||||
<< frame_id << " extrinsic from both ACCEL and GYRO: " << e2.getMessage());
|
||||
logger_, "Failed to get " << frame_id
|
||||
<< " extrinsic from both ACCEL and GYRO: "
|
||||
<< orbbec_camera::formatObErrorWithStatus(e2));
|
||||
ex = OBExtrinsic({{1, 0, 0, 0, 1, 0, 0, 0, 1}, {0, 0, 0}});
|
||||
}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user