mirror of
https://github.com/orbbec/OrbbecSDK_ROS2.git
synced 2026-10-08 13:57:46 +08:00
Fix crash and change parameter order in gemini435_le launch file by repositioning time_sync_period argument
This commit is contained in:
@@ -32,7 +32,6 @@
|
||||
#include <iomanip>
|
||||
#include <arpa/inet.h>
|
||||
|
||||
|
||||
namespace orbbec_camera {
|
||||
inline void LogFatal(const char* file, int line, const std::string& message) {
|
||||
std::cerr << "Check failed at " << file << ":" << line << ": " << message << std::endl;
|
||||
@@ -40,15 +39,25 @@ inline void LogFatal(const char* file, int line, const std::string& message) {
|
||||
}
|
||||
} // namespace orbbec_camera
|
||||
|
||||
#define TRY_EXECUTE_BLOCK(block) \
|
||||
try { \
|
||||
block; \
|
||||
} catch (const ob::Error& e) { \
|
||||
RCLCPP_ERROR(logger_, "Error in %s at line %d: %s", __FUNCTION__, __LINE__, e.getMessage()); \
|
||||
} catch (const std::exception& e) { \
|
||||
RCLCPP_ERROR(logger_, "Exception in %s at line %d: %s", __FUNCTION__, __LINE__, e.what()); \
|
||||
} catch (...) { \
|
||||
RCLCPP_ERROR(logger_, "Unknown exception in %s at line %d", __FUNCTION__, __LINE__); \
|
||||
#define TRY_EXECUTE_BLOCK(block) \
|
||||
try { \
|
||||
block; \
|
||||
} catch (const ob::Error& e) { \
|
||||
std::string error_msg = e.getMessage() ? e.getMessage() : "Unknown OB error"; \
|
||||
if (error_msg.find("Device is deactivated") != std::string::npos || \
|
||||
error_msg.find("disconnected") != std::string::npos || \
|
||||
error_msg.find("Send control transfer failed") != std::string::npos) { \
|
||||
RCLCPP_WARN(logger_, \
|
||||
"Device communication error in %s at line %d: %s - Device may be disconnected", \
|
||||
__FUNCTION__, __LINE__, error_msg.c_str()); \
|
||||
} else { \
|
||||
RCLCPP_ERROR(logger_, "Error in %s at line %d: %s", __FUNCTION__, __LINE__, \
|
||||
error_msg.c_str()); \
|
||||
} \
|
||||
} catch (const std::exception& e) { \
|
||||
RCLCPP_ERROR(logger_, "Exception in %s at line %d: %s", __FUNCTION__, __LINE__, e.what()); \
|
||||
} catch (...) { \
|
||||
RCLCPP_ERROR(logger_, "Unknown exception in %s at line %d", __FUNCTION__, __LINE__); \
|
||||
}
|
||||
|
||||
#define TRY_TO_SET_PROPERTY(func, property, value) \
|
||||
@@ -200,5 +209,5 @@ cv::Mat undistortImage(const cv::Mat& image, const OBCameraIntrinsic& intrinsic,
|
||||
|
||||
std::string getDistortionModels(OBCameraDistortion distortion);
|
||||
|
||||
std::string calcMD5(const std::string &data);
|
||||
std::string calcMD5(const std::string& data);
|
||||
} // namespace orbbec_camera
|
||||
|
||||
Reference in New Issue
Block a user