diff --git a/include/spinnaker_sdk_camera_driver/camera.h b/include/spinnaker_sdk_camera_driver/camera.h index 1f12fbc..c3bba14 100755 --- a/include/spinnaker_sdk_camera_driver/camera.h +++ b/include/spinnaker_sdk_camera_driver/camera.h @@ -59,7 +59,7 @@ namespace acquisition { // void setTrigMode(); // void setTriggerOverlapOff(); - string get_id() { return string(pCam_->GetUniqueID()); } + string get_id(); void make_master() { MASTER_ = true; ROS_DEBUG_STREAM( "camera " << get_id() << " set as master"); } bool is_master() { return MASTER_; } void set_color(bool flag) { COLOR_ = flag; } diff --git a/src/camera.cpp b/src/camera.cpp index ed04971..a97fd4f 100755 --- a/src/camera.cpp +++ b/src/camera.cpp @@ -292,6 +292,14 @@ void acquisition::Camera::trigger() { } +string acquisition::Camera::get_id() { + INodeMap& nodeMap = pCam_->GetTLDeviceNodeMap(); + CStringPtr ptrDeviceSerialNumber = nodeMap.GetNode("DeviceSerialNumber"); + if (IsReadable(ptrDeviceSerialNumber)){ + return string(ptrDeviceSerialNumber->GetValue()); + } + return ""; +} void acquisition::Camera::targetGreyValueTest() { CFloatPtr ptrExpTest =pCam_->GetNodeMap().GetNode("AutoExposureTargetGreyValue"); @@ -327,4 +335,4 @@ void acquisition::Camera::calibrationParamsTest(int calibrationWidth, int calibr ROS_WARN_STREAM(" Looks like your calibration is not done at full Sensor Resolution for cam_id = "<