feat: add StreamConfigurationError exception handling for stream setup

This commit is contained in:
ob-yalian
2026-09-21 15:43:33 +08:00
parent 80f9a24778
commit d28886c9a1
4 changed files with 62 additions and 39 deletions
@@ -26,6 +26,7 @@
#include <queue>
#include <rclcpp/rclcpp.hpp>
#include <string>
#include <stdexcept>
#include <unordered_map>
#include <unordered_set>
#include <utility>
@@ -136,6 +137,11 @@
#define DEVICE_PATH "/dev/camsync"
namespace orbbec_camera {
class StreamConfigurationError : public std::runtime_error {
public:
explicit StreamConfigurationError(const std::string& message) : std::runtime_error(message) {}
};
using GetDeviceConfig = orbbec_camera_msgs::srv::GetDeviceConfig;
using GetActionConfig = orbbec_camera_msgs::srv::GetActionConfig;
using GetDeviceInfo = orbbec_camera_msgs::srv::GetDeviceInfo;
@@ -114,6 +114,7 @@ class OBCameraNodeDriver : public rclcpp::Node {
std::atomic_bool is_alive_{false};
std::atomic_bool device_connected_{false};
std::atomic_bool device_connecting_{false};
std::atomic_bool stream_configuration_error_{false};
std::string serial_number_;
std::string device_unique_id_;
std::string usb_port_;