Skip to content

Commit

Permalink
Fixig bug in spinnaker 2.x.x which causes serial number to be read in…
Browse files Browse the repository at this point in the history
… hex (#84)

Co-authored-by: agv <[email protected]>
  • Loading branch information
Vikrant Shah and abhishekbajpayee authored Apr 28, 2020
1 parent cd38cd3 commit 96bc9ed
Show file tree
Hide file tree
Showing 2 changed files with 10 additions and 2 deletions.
2 changes: 1 addition & 1 deletion include/spinnaker_sdk_camera_driver/camera.h
Original file line number Diff line number Diff line change
Expand Up @@ -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; }
Expand Down
10 changes: 9 additions & 1 deletion src/camera.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -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");
Expand Down Expand Up @@ -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 = "<<get_id()<<" , Sensor_Width = "<<(pCam_ ->SensorWidth()) <<" given cameraInfo params:width = "<<calibrationWidth);
if ( (pCam_ ->SensorHeight()) != calibrationHeight )
ROS_WARN_STREAM(" Looks like your calibration is not done at full Sensor Resolution for cam_id = "<<get_id()<<" , Sensor_Height= "<<(pCam_ ->SensorHeight()) <<" given cameraInfo params:height = "<<calibrationHeight);
}
}

0 comments on commit 96bc9ed

Please sign in to comment.