Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Fixing bug in spinnaker 2.x.x which causes serial number to be read in… #84

Merged
merged 1 commit into from
Apr 28, 2020
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
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);
}
}