This thread has been locked.

If you have a related question, please click the "Ask a related question" button in the top right corner. The newly created question will be automatically linked to this question.

DLP4500: Getting a PG_FLYCAP_C_SET_FORMAT_7_FAILED Error when using Point Grey Camera and DLP4500.

Part Number: DLP4500
Other Parts Discussed in Thread: TIDA-00254

Hello,

I am using the DLP4500 for 3D Pointcloud generation. My setup also includes a BFLY-PGE-13E4C/M-CS Point Grey BlackFly camera (Global Shutter). I have made the connections according to the manual. The connections between the camera and the DLP4500 are as follows:

DLP4500 - J11                   ||           PointGrey  BlackFly Camera (6-pin GPIO connector)

Pin 2                                  -->                          Pin 3 (Red Wire)

Pin 3                                 -->                            Pin 5 (Blue Wire)

The GPIO connecter labelling for the camera mentined above was referenced from here : https://www.ptgrey.com/support/downloads/10202

I have followed all the steps for installing and running the DLP_LightCrafter_4500_3D_Scan_Application. On startup however I get the ERROR: PG_FLYCAP_C_SET_FORMAT_7_FAILED message. The full output on startup is as follows:

 Connecting to projector...
Configuring projector...
Connecting to camera...
Configuring camera...
Camera setup FAILED!
ERRORS: 2 and WARNINGS: 0
ERROR: PG_FLYCAP_C_SET_FORMAT_7_FAILED
ERROR: CAMERA_NOT_SETUP

Step 2: Prepare DLP LightCrafter 4500 (once per projector) also runs perfectly but in the camera calibration step (Step 4) I get the following errors:

Loading camera calibration settings...
Setting up camera calibration
Camera calibration setup FAILED:
ERRORS: 4 and WARNINGS: 0
ERROR: CALIBRATION_PARAMETERS_MODEL_SIZE_MISSING
ERROR: CALIBRATION_PARAMETERS_MODEL_SIZE_MISSING
ERROR: CALIBRATION_PARAMETERS_IMAGE_SIZE_MISSING
ERROR: CALIBRATION_PARAMETERS_IMAGE_SIZE_MISSING

I have checked my camera in the FlyCap software and I'm able to get live video and capture images from it perfectly. I would appreciate any help on this problem. Thank you.

  • Hi Sidharth,
    Welcome to DLP forum and thank you for your interest in DLP technology.
    We will review it and get back to you.

    regards,
    Vivek
  • Hi Sidharth,

    The SDK was written with Point Grey Flea3 camera, please note that for "Point Grey BlackFly camera" the format-7 settings needs to be changed, this is discussed here

    e2e.ti.com/.../719113

    Basically you will have to look at why the camera functions failing, it may either, camera trigger settings or the resolution, which you are feeding may be incorrect.

    In the SDK you will find config_camera.txt file with these settings for PointGrey camera

    These may need to adjusted for your specific model, also look at the resolution, in recommend reading the PointGrey documentation for your model and understand more the Format-7 settings for the mode.


    ####################
    ##PointGrey Camera #
    ####################
    PG_FLYCAP_PARAMETERS_GAIN_DB = 18
    # For below parameter set
    # Rolling shutter color Camera - MONO8
    # Global shutter Monochrome camera - RAW8
    PG_FLYCAP_PARAMETERS_PIXEL_FORMAT = RAW8
    PG_FLYCAP_PARAMETERS_SHUTTER_EXPOSURE_MS = 33
    PG_FLYCAP_PARAMETERS_FRAME_RATE_HZ = 30
    PG_FLYCAP_PARAMETERS_STROBE_SOURCE = 2
    PG_FLYCAP_PARAMETERS_STROBE_ENABLE = 1
    PG_FLYCAP_PARAMETERS_STROBE_POLARITY = 1
    # For below parameter
    # Rolling shutter color camera - 5.0
    # Glocal shutter Monochrome camera - 0.0
    PG_FLYCAP_PARAMETERS_STROBE_DELAY = 0.0
    PG_FLYCAP_PARAMETERS_STROBE_DURATION = 1.0
    PG_FLYCAP_PARAMETERS_AUTOEXPOSURE = 0
    PG_FLYCAP_PARAMETERS_EXPOSURE = 1.0
  • Hi Sanjeev,

    In the link to the other question that you provided, where is the file pg_flycap2_c.cpp located? I have searched through the FlyCap2 install files and also the TI-DLP Application files but there is no such file. Also, my camera_config.txt file is identical to the one you provided in the answer. Could you please help me as to where I could locate the pg_flycap2_c.cpp file ?
  • Ok, I downloaded the SDK from the link in the other answer and found the pg_flycap2_c.cpp file. However, the manual only mentions downloading and using TIDA-00254_3D_Scanner_LCr4500-2.0 software and no mention of the SDK in the link. Could you please explain what the SDK would be used for ? How was the TIDA-00254_3D_Scanner_LCr4500-2.0 application running without the pg_flycap2_c.cpp file and the SDK?
  • Hi Sidharth,

    Okay there are two things -

    TIDA-00254_3D_Scanner_LCr4500-2.0 application is pre-built binary that is built using DLP 3D SDK you use it for out-of-box demo using specific model of PointGrey camera or a general web-cam.

    Since you talked about making it work with another model of camera which is not supported in the DLP 3D SDK first thing you need to add support for it and make it work, and then rebuild the application with updated SDK.

    I hope this helps.

    Regards,
    Sanjeev
  • Sanjeev said:
    Hi Sidharth,

    Okay there are two things -

    TIDA-00254_3D_Scanner_LCr4500-2.0 application is pre-built binary that is built using DLP 3D SDK you use it for out-of-box demo using specific model of PointGrey camera or a general web-cam.

    Since you talked about making it work with another model of camera which is not supported in the DLP 3D SDK first thing you need to add support for it and make it work, and then rebuild the application with updated SDK.

    I hope this helps.

    Regards,
    Sanjeev

    Hi Sanjeev,

    When you mention adding support for the camera, you mean altering the Format 7? Is there any resource I could refer to where another camera support is added to the SDK. Right now I am following the steps from the follwoing manual: http://www.ti.com/lit/ug/dlpu019a/dlpu019a.pdf

    Would modifying the cpp file in the SDK folder affect how the DLP_LightCrafter_4500_3D_Scan_Application behaves? I'm not very clear on how that part. Could you please explain abit more on that? Thank you.
    Also, I have also contacted the PointGrey and they have mentioned that there is no significant difference between the Flea3 and BlackFly which I am using in the case of Format 7.

  • Hi Sidharth,

    >>When you mention adding support for the camera, you mean altering the Format 7?
    Our SDK makes specific Format-7 settings for the Pointe Grey camera, now as you can see from the application output, the Format-7 setting applied is not working. You need to investigate why the Format-7 settings is failing?

    Camera setup FAILED!
    ERRORS: 2 and WARNINGS: 0
    ERROR: PG_FLYCAP_C_SET_FORMAT_7_FAILED
    ERROR: CAMERA_NOT_SETUP


    One this is have a look at the Chapter 4: Troubleshooting guidelines www.ti.com/.../dlpu019a.pdf


    >>Would modifying the cpp file in the SDK folder affect how the DLP_LightCrafter_4500_3D_Scan_Application behaves? I'm not very clear on how that part. Could you please explain abit more on that? Thank you.

    I don't think so, the behavior remains same.



    >> Also, I have also contacted the PointGrey and they have mentioned that there is no significant difference between the Flea3 and BlackFly which I am using in the case of Format 7.
    I would recommend you to setup development environment i.e., start compiling the SDK and the application; this will be much easier for you, while debugging the code you need to investigate why fc2ValidateFormat7Settings() function is failing in pg_flycap2_c.cpp file.
    Also you first use the PointGrey FlyCapture2 Viewer tool then experiment setting Format-7 to the camera verify its working.

    Regards,
    Sanjeev
  • "I would recommend you to setup development environment i.e., start compiling the SDK and the application; this will be much easier for you, while debugging the code you need to investigate why fc2ValidateFormat7Settings() function is failing in pg_flycap2_c.cpp file.
    Also you first use the PointGrey FlyCapture2 Viewer tool then experiment setting Format-7 to the camera verify its working."

    Could you please help me in th esteps to compile the SDK after making changes to the cpp file? I referred to this thread: e2e.ti.com/.../383897

    Is it still the case that DLP_LightCrafter_4500_3D_Scan_Application only supports the Flea camera as mentioned in that thread? Could you point to what changes I would need to make for adding support for the BlackFly camera ?

    I have spoken to the PointGrey support and they informed me that the registers for setting up the Format 7 for the BlackFly and the flea are the same. So could you point out what settings might need changing for getting support for the BlackFly? And could you guide me through the steps for compiling the SDK ? Thank you for your help on this.

    Best regrads,
    Sidharth Makhija
  • Hi Sidharth,

    For BlackFly as i mentioned in my previous post, you must experiment with their FlyCap GUI tool and then configure and experiment setting it in Format 7 mode, this step/exercise is nothing to do with DLP. Only after you are successful in configuring in Format 7 mode on BlackFly you can go back to DLP SDK.

    >>
    Is it still the case that DLP_LightCrafter_4500_3D_Scan_Application only supports the Flea camera as mentioned in that thread? Could you point to what changes I would need to make for adding support for the BlackFly camera ?

    Yes, if you are using specific model as described in the TI design, you should be use the demo application as it is.

    For BlackFly model, i agree that there won't be many changes, you need to find the correct setting for the Format 7 mode. I recommend you read the BlackFly model Format 7 setup instructions in the PointGrey document. Once you confirm its working, i can help you with the what needs to be changes in the DLP SDK.

    Also i suggest that while discussing with PointGrey folks make sure you provide which version of the PointGrey out user document referring.

    Regards,
    Sanjeev
  • Hi Sidharth,

    Let me know you are able to make progress and where you are stuck.

    Were you able to setup Format 7 mode on BlackFly camera model with Pointgrey libraries and GUI software? This part is nothing to do with the TI DLP SDK. If it worked please attache the PointGrey GUI snap-shot settings with this thread.

    Regards,

    Sanjeev

  • Hi Sanjeev,

    I am still stuck at the Format7 error step. I have tried changing the mode settings on the Flycap GUI. Please have a look at the screenshot below. I have options of choosing modes 0,1,2,7.

    I'm not sure which one would be suitable for the DLP4500. 

    I am also not able to compile the SDK using CMake. Could you provide what exactly are the files needed for compiling with CMake? It would help in th edebugging process. 

  • Hi,

    You should experiment option 7 in the drop down list.

    Please attach what is failing in the CMake? Are you able to configure the SDK using CMake? Without this you will not be able to compile the code.

    Regards,

    Sanjeev

  •  Hi Sanjeev,

    I've attached the screenshot for my CMake configurations below and what folders of the SDK I'm pointing to. When I click configure I get the output that is seen in the screenshot and then CMake just crashes without any message. Thank you for yyour help.

    Best regards,

    Sidharth Makhija

  • Hi Sidharth,

    CMake crashing different issue and nothing to do with DLP ALC SDK as such. Many uses have been using the SDK without any issues. I suspect it is something to do with your pc build environment setting; also in the CMake configure window, did you manually point to the directories? what is is your build environment? Have you already installed the PointGrey libraries which SDK requires...

    Let me summarize what we have done so far in the thread -

    1. You have chosen the BlackFly model from Point Grey

    2. You have used standalone exe that was released with the TI design TIDA-00254 

    3. The exe when run, showing FORMAT 7 errors

    4. We requested you to touch base with PointGrey to get correct information regarding the Format 7 setting on the particular model, you haven't get back to us if the PointGrey GUI really worked for the model in Format 7 mode, and you found the correct settings

    5. We are now attempting to compile the DLP ALC SDK 

    I think we are taking too long time to really find what is going here. 

    We can certainly help you in debugging but i would suggest if it will be very helpful if you setup the build environment related issues first. Also please clarify what you found on step (4) above.

    Regards,
    Sanjeev

  • Hi Sanjeev,

    Yes, I did point to the directories manually in CMake. Also, I have installed Flycap software as mentioned in the Texas Instruments manual here and additionally the PointGrey SDK.

    Regarding your points,

    "2. You have used standalone exe that was released with the TI design TIDA-00254"

    > I have downloaded the SDK that was mentioned in th eTexas Instruments manual linked above. It is the same one. 

    "4. We requested you to touch base with PointGrey to get correct information regarding the Format 7 setting on the particular model, you haven't get back to us if the PointGrey GUI really worked for the model in Format 7 mode, and you found the correct settings"

    > I had mentioned earlier that Pointgrey have confirmed that the Format7 registers for the Flea and BlackFly are the same. I have also set the camera to mode 7 as you mentioned in the previous reply. The screenshot of the mode 7 setup and the camera feed is attached below. The PointGrey GUI works an I am able to get the camera feed since th estart. It is the TI SDK that gives the error: 

    ERROR: PG_FLYCAP_C_SET_FORMAT_7_FAILED
    ERROR: CAMERA_NOT_SETUP

    "5. We are now attempting to compile the DLP ALC SDK "

    >This is the way the changes made in the pg_flycapp2_c.cpp file could be tested in the SDK correct? Or is there a better method? Could you help step through on how to compile the SDK with CMake? I am using CMake on a Windows 10 computer and MinGW as the compiler. Is there any more information you need for the building with CMake? Thank you.

    Regards,

    Sidharth Makhija

  • The screenshot for the camera working with the Flycap GUI is here. 

  • Hi Sanjeev,

    Please confirm whether the screenshot provided for the BlackFly Format 7 mode settings is correct. I too agree this is taking alot of time to debug and would like to interface this camera with the DLP4500 by this week. Thank you for your help so far and I look forward to your response.

    Regards,

    Sidharth Makhija

  • Hi Sanjeev,

    Please confirm whether the screenshot provided for the BlackFly Format 7 mode settings is correct. I too agree this is taking alot of time to debug and would like to interface this camera with the DLP4500 by this week. Thank you for your help so far and I look forward to your response.

    Regards,

    Sidharth Makhija
  • Hi Siddharth,

    FlyCap2 GUI snap shot looks okay to me.

    Once you are able to compile the SDK,

    You can modify this function in pg_flycap2_c.cpp see which particular error it is returning camera_error

    ReturnCode PG_FlyCap2_C::Setup(const dlp::Parameters &settings)
    {
    ...
    ...
        // Check that Format7 settings are valid
        BOOL format7_settings_valid = false;
        fc2Format7PacketInfo format7_packet_info;
        camera_error = fc2ValidateFormat7Settings((*camera_context),&format7_settings_new,&format7_settings_valid,&format7_packet_info);
        if(camera_error != FC2_ERROR_OK)
        {
            this->debug_.Msg("fc2ValidateFormat7Settings FAILED, camera NOT setup!");
            ret.AddError(PG_FLYCAP_C_SET_FORMAT_7_FAILED);
            ret.AddError(CAMERA_NOT_SETUP);
            return ret;
        }
    ....
    ...
    }

  • Hi Sidharth,

    I am closing this thread.

    As discussed you have to compile the SDK code, read the exact return error code - @ 

    camera_error = fc2ValidateFormat7Settings((*camera_context),&format7_settings_new,&format7_settings_valid,&format7_packet_info);

    ReturnCode PG_FlyCap2_C::Setup(const dlp::Parameters &settings)
    {
        ReturnCode ret;
        fc2Error        camera_error;
        fc2Context*     camera_context = (fc2Context*)this->camera_context_;
    
        // Check if the camera is connected
        if (!(this->is_connected_))
        {
            this->debug_.Msg("Camera is NOT Connected");
            return ret.AddError(CAMERA_NOT_CONNECTED);
        }
    
        // Set the maximum buffer size
        settings.Get(&this->image_queue_max_frames_);
    
        // Set the camera to format 7 video mode
        fc2Format7Info fc2_format7_info;
        BOOL fc2_format7_supported;
    
        fc2_format7_info.mode = FC2_MODE_0;
    
        camera_error = fc2GetFormat7Info((*camera_context),&fc2_format7_info,&fc2_format7_supported);
        if((camera_error != FC2_ERROR_OK) || (!fc2_format7_supported))
        {
            this->debug_.Msg("Get fc2SetVideoModeAndFrameRate configuration FAILED");
            std::cout << "Camera Error = " << camera_error << std::endl;
            ret.AddError(PG_FLYCAP_C_GET_FORMAT_7_FAILED);
            ret.AddError(CAMERA_NOT_SETUP);
            return ret;
        }
    
        // Store the maximum and default modes
        this->mode_.Set( (unsigned int) FC2_MODE_0 );
        this->height_.Set(   fc2_format7_info.maxHeight);
        this->width_.Set(    fc2_format7_info.maxWidth);
        this->offset_x_.Set( 0 );
        this->offset_y_.Set( 0 );
        this->pixel_format_.Set(PixelFormat::MONO8);
    
        // Check for mode, resolution, offset, and format settings from supplied Parameters
        if(settings.Contains(this->mode_))          settings.Get(&this->mode_);
        if(settings.Contains(this->height_))        settings.Get(&this->height_);
        if(settings.Contains(this->width_))         settings.Get(&this->width_);
        if(settings.Contains(this->offset_x_))      settings.Get(&this->offset_x_);
        if(settings.Contains(this->offset_y_))      settings.Get(&this->offset_y_);
        if(settings.Contains(this->pixel_format_))  settings.Get(&this->pixel_format_);
    
        // Set the Format 7 Configuration with any new settings from parameters object
        fc2Format7ImageSettings format7_settings_new;
        format7_settings_new.mode    = (fc2Mode) this->mode_.Get();
        format7_settings_new.height  = this->height_.Get();
        format7_settings_new.width   = this->width_.Get();
        format7_settings_new.offsetX = this->offset_x_.Get();
        format7_settings_new.offsetY = this->offset_y_.Get();
    
        // Get the camera's pixel format
        switch(this->pixel_format_.Get()){
        case PixelFormat::RAW8:
            format7_settings_new.pixelFormat = FC2_PIXEL_FORMAT_RAW8;
            break;
        case PixelFormat::MONO8:
            format7_settings_new.pixelFormat = FC2_PIXEL_FORMAT_MONO8;
            break;
        case PixelFormat::RGB8:
            format7_settings_new.pixelFormat = FC2_PIXEL_FORMAT_RGB8;
            break;
        default:
            this->debug_.Msg("Invalid pixel format, camera NOT setup!");
            ret.AddError(PG_FLYCAP_C_INVALID_PIXEL_FORMAT);
            ret.AddError(CAMERA_NOT_SETUP);
            return ret;
        }
    
        // Check that Format7 settings are valid
        BOOL format7_settings_valid = false;
        fc2Format7PacketInfo format7_packet_info;
        camera_error = fc2ValidateFormat7Settings((*camera_context),&format7_settings_new,&format7_settings_valid,&format7_packet_info);
        if(camera_error != FC2_ERROR_OK)
        {
            this->debug_.Msg("fc2ValidateFormat7Settings FAILED, camera NOT setup!");
            ret.AddError(PG_FLYCAP_C_SET_FORMAT_7_FAILED);
            ret.AddError(CAMERA_NOT_SETUP);
            return ret;
        }
    
        if(!format7_settings_valid){
            // Try setting format to MONO8 max resolution
    
            this->mode_.Set( (unsigned int) FC2_MODE_0 );
            this->height_.Set(   fc2_format7_info.maxHeight);
            this->width_.Set(    fc2_format7_info.maxWidth);
            this->offset_x_.Set( 0 );
            this->offset_y_.Set( 0 );
            this->pixel_format_.Set(PixelFormat::MONO8);
    
            format7_settings_new.mode    = (fc2Mode) this->mode_.Get();
            format7_settings_new.height  = this->height_.Get();
            format7_settings_new.width   = this->width_.Get();
            format7_settings_new.offsetX = this->offset_x_.Get();
            format7_settings_new.offsetY = this->offset_y_.Get();
    
            camera_error = fc2ValidateFormat7Settings((*camera_context),
                                                      &format7_settings_new,
                                                      &format7_settings_valid,
                                                      &format7_packet_info);
    
            if((camera_error != FC2_ERROR_OK) || (!format7_settings_valid))
            {
                this->debug_.Msg("fc2ValidateFormat7Settings mono8 FAILED, camera NOT setup!");
                ret.AddError(PG_FLYCAP_C_SET_FORMAT_7_FAILED);
                ret.AddError(CAMERA_NOT_SETUP);
                return ret;
            }
    
            this->pixel_format_.Set(PixelFormat::MONO8);
            ret.AddWarning("Supplied settings invalid!");
            ret.AddWarning("Format settings overriden!");
        }
    
    
        // Setup the camera's format 7 settings
        // and set the maximum data packet size to 100%
        this->debug_.Msg("Setting camera resolution, offsets, and pixel format...");
        camera_error = fc2SetFormat7Configuration((*camera_context), &format7_settings_new, 100.0);
        if(camera_error != FC2_ERROR_OK)
        {
            this->debug_.Msg("Format7 configuration FAILED, camera NOT setup!");
            ret.AddError(PG_FLYCAP_C_SET_FORMAT_7_FAILED);
            ret.AddError(CAMERA_NOT_SETUP);
            return ret;
        }
    
        // Check for the frame rate
        fc2Property frame_rate;
        if(settings.Contains(this->frame_rate_)){
    
            // Retrieve the setting
            settings.Get(&this->frame_rate_);
    
            // Set the frame rate
            frame_rate.type           = FC2_FRAME_RATE;
            frame_rate.absControl     = true;
            frame_rate.onePush        = false;
            frame_rate.onOff          = true;
            frame_rate.autoManualMode = false;
            frame_rate.absValue       = this->frame_rate_.Get();
    
            this->debug_.Msg("Setting frame rate...");
            camera_error = fc2SetProperty((*camera_context), &frame_rate);
            if (camera_error != FC2_ERROR_OK)
            {
                this->debug_.Msg("Frame rate configuration FAILED");
                ret.AddError(PG_FLYCAP_C_SETUP_FAILED_FRAME_RATE);
                ret.AddError(CAMERA_NOT_SETUP);
                return ret;
            }
        }
    
        // Retrieve the actual framerate
        if (fc2GetProperty((*camera_context), &frame_rate) != FC2_ERROR_OK)
        {
            this->debug_.Msg("Could NOT read frame rate value!");
            ret.AddError(PG_FLYCAP_C_GET_FRAME_RATE_FAILED);
            return ret;
        }
    
        // Save the frame rate
        this->frame_rate_.Set(frame_rate.absValue);
    
    
        // Check for shutter time which is the time that the sensor captures light
        fc2Property shutter;
        if(settings.Contains(this->shutter_)){
    
            // Retrieve the setting
            settings.Get(&this->shutter_);
    
            // Set the camera shutter time
            shutter.type              = FC2_SHUTTER;
            shutter.absControl        = true;
            shutter.onePush           = false;
            shutter.onOff             = true;
            shutter.autoManualMode    = false;
            shutter.absValue          = this->shutter_.Get();
    
            camera_error = fc2SetProperty((*camera_context), &shutter);
            if (camera_error != FC2_ERROR_OK)
            {
                this->debug_.Msg("Shutter configuration FAILED");
                ret.AddError(PG_FLYCAP_C_SETUP_FAILED_SHUTTER);
                ret.AddError(CAMERA_NOT_SETUP);
                return ret;
            }
        }
    
        // Retrieve the shutter exposure time
        camera_error = fc2GetProperty((*camera_context), &shutter);
        if (camera_error != FC2_ERROR_OK)
        {
            this->debug_.Msg("Could NOT read shutter exposure time!");
            ret.AddError(PG_FLYCAP_C_GET_SHUTTER_EXPOSURE_FAILED);
            return ret;
        }
    
        // Save the shutter time
        this->shutter_.Set(shutter.absValue);
    
    
    
        // If using color camera, set the color related settings
        if(this->pixel_format_.Get() == PixelFormat::RGB8){
    
            // Check for white balance settings
            fc2Property white_balance;
            if( settings.Contains(this->white_balance_enable_) ||
                settings.Contains(this->white_balance_red_)    ||
                settings.Contains(this->white_balance_blue_)){
    
                // Retrieve the settings
                settings.Get(&this->white_balance_enable_);
                settings.Get(&this->white_balance_blue_);
                settings.Get(&this->white_balance_red_);
    
                // Set the camera white balance
                white_balance.type              = FC2_WHITE_BALANCE;
                white_balance.absControl        = false;
                white_balance.onePush           = false;
                white_balance.onOff             = this->white_balance_enable_.Get();
                white_balance.autoManualMode    = false;
                white_balance.valueA            = this->white_balance_red_.Get();
                white_balance.valueB            = this->white_balance_blue_.Get();
    
                this->debug_.Msg("Setting white balance...");
                camera_error = fc2SetProperty((*camera_context), &white_balance);
                if (camera_error != FC2_ERROR_OK)
                {
                    this->debug_.Msg("White Balance configuration FAILED");
                    ret.AddError(PG_FLYCAP_C_SETUP_FAILED_WHITE_BALANCE);
                    ret.AddError(CAMERA_NOT_SETUP);
                    return ret;
                }
            }
    
            // Retrieving white balance setting
            camera_error = fc2GetProperty((*camera_context), &white_balance);
            if (camera_error != FC2_ERROR_OK)
            {
                this->debug_.Msg("Could NOT read white balance values!");
                ret.AddError(PG_FLYCAP_C_GET_WHITE_BALANCE_FAILED);
                ret.AddError(CAMERA_NOT_SETUP);
                return ret;
            }
    
            // Save the white balance
            this->white_balance_enable_.Set(white_balance.onOff);
            this->white_balance_red_.Set(white_balance.valueA);
            this->white_balance_blue_.Set(white_balance.valueB);
    
    
            // Check for hue settings
            fc2Property hue;
            if( settings.Contains(this->hue_)){
    
                // Retrieve the value
                settings.Get(&this->hue_);
    
                // Set the camera hue
                hue.type            = FC2_HUE;
                hue.absControl      = true;
                hue.onePush         = false;
                hue.onOff           = true;
                hue.autoManualMode  = false;
                hue.absValue        = this->hue_.Get();
    
                this->debug_.Msg("Setting hue...");
                camera_error = fc2SetProperty((*camera_context), &hue);
                if (camera_error != FC2_ERROR_OK){
                    this->debug_.Msg("Hue configuration FAILED");
                    ret.AddError(PG_FLYCAP_C_SETUP_FAILED_HUE);
                    ret.AddError(CAMERA_NOT_SETUP);
                    return ret;
                }
            }
    
            // Check the actual value
            camera_error = fc2GetProperty((*camera_context), &hue);
            if (camera_error != FC2_ERROR_OK){
                this->debug_.Msg("Could NOT read hue value!");
                ret.AddError(PG_FLYCAP_C_GET_HUE_FAILED);
                ret.AddError(CAMERA_NOT_SETUP);
                return ret;
            }
    
            // Save the value
            this->hue_.Set(hue.absValue);
    
            // Check for saturation settings
            fc2Property saturation;
            if( settings.Contains(this->saturation_)){
    
                // Retrieve the value
                settings.Get(&this->saturation_);
    
                // Set the camera saturation
                saturation.type            = FC2_SATURATION;
                saturation.absControl      = true;
                saturation.onePush         = false;
                saturation.onOff           = true;
                saturation.autoManualMode  = false;
                saturation.absValue        = this->saturation_.Get();
    
                this->debug_.Msg("Setting saturation...");
                camera_error = fc2SetProperty((*camera_context), &saturation);
                if (camera_error != FC2_ERROR_OK){
                    this->debug_.Msg("Saturation configuration FAILED");
                    ret.AddError(PG_FLYCAP_C_SETUP_FAILED_SATURATION);
                    ret.AddError(CAMERA_NOT_SETUP);
                    return ret;
                }
            }
    
            // Check the actual value
            camera_error = fc2GetProperty((*camera_context), &saturation);
            if (camera_error != FC2_ERROR_OK){
                this->debug_.Msg("Could NOT read saturation value!");
                ret.AddError(PG_FLYCAP_C_GET_SATURATION_FAILED);
                ret.AddError(CAMERA_NOT_SETUP);
                return ret;
            }
    
            // Save the value
            this->saturation_.Set(saturation.absValue);
    
            // Check for gamma settings
            fc2Property gamma;
            if( settings.Contains(this->gamma_)){
    
                // Retrieve the value
                settings.Get(&this->gamma_);
    
                // Set the camera gamma
                gamma.type            = FC2_GAMMA;
                gamma.absControl      = true;
                gamma.onePush         = false;
                gamma.onOff           = true;
                gamma.autoManualMode  = false;
                gamma.absValue        = this->gamma_.Get();
    
                this->debug_.Msg("Setting gamma...");
                camera_error = fc2SetProperty((*camera_context), &gamma);
                if (camera_error != FC2_ERROR_OK){
                    this->debug_.Msg("Gamma configuration FAILED");
                    ret.AddError(PG_FLYCAP_C_SETUP_FAILED_GAMMA);
                    ret.AddError(CAMERA_NOT_SETUP);
                    return ret;
                }
            }
    
            // Check the actual setting
            camera_error = fc2GetProperty((*camera_context), &gamma);
            if (camera_error != FC2_ERROR_OK){
                this->debug_.Msg("Could NOT read gamma value!");
                ret.AddError(PG_FLYCAP_C_GET_GAMMA_FAILED);
                ret.AddError(CAMERA_NOT_SETUP);
                return ret;
            }
    
            // Save the setting
            this->gamma_.Set(gamma.absValue);
        }
    
    
        // Check for brightness settings
        fc2Property brightness;
        brightness.type = FC2_BRIGHTNESS;
        if(settings.Contains(this->brightness_)){
    
            // Retrieve the setting
            settings.Get(&this->brightness_);
    
            // Set the camera brightness
            brightness.absControl       = false;
            brightness.onePush          = false;
            brightness.onOff            = true;
            brightness.autoManualMode   = false;
            brightness.valueA           = this->brightness_.Get();
    
            camera_error = fc2SetProperty((*camera_context), &brightness);
            if(camera_error != FC2_ERROR_OK){
                this->debug_.Msg("Brightness configuration FAILED");
                ret.AddError(PG_FLYCAP_C_SETUP_FAILED_BRIGHTNESS);
                ret.AddError(CAMERA_NOT_SETUP);
                return ret;
            }
        }
    
        // Check the actual setting
        camera_error = fc2GetProperty((*camera_context), &brightness);
        if (camera_error != FC2_ERROR_OK){
            this->debug_.Msg("Could NOT read brightness value!");
            ret.AddError(PG_FLYCAP_C_GET_BRIGHTNESS_FAILED);
            ret.AddError(CAMERA_NOT_SETUP);
            return ret;
        }
    
        // Save the actual value
        this->brightness_.Set(brightness.valueA);
    
        // Check for sharpness setting
        fc2Property sharpness;
        sharpness.type = FC2_SHARPNESS;
        if(settings.Contains(this->sharpness_)){
    
            // Retrieve setting
            settings.Get(&this->sharpness_);
    
            // Set the camera sharpness
            sharpness.absControl        = false;
            sharpness.onePush           = false;
            sharpness.onOff             = true;
            sharpness.autoManualMode    = false;
            sharpness.valueA            = this->sharpness_.Get();
    
            camera_error = fc2SetProperty((*camera_context), &sharpness);
            if (camera_error != FC2_ERROR_OK){
                this->debug_.Msg("Sharpness configuration FAILED");
                ret.AddError(PG_FLYCAP_C_SETUP_FAILED_SHARPNESS);
                ret.AddError(CAMERA_NOT_SETUP);
                return ret;
            }
        }
    
        // Check actual setting
        camera_error = fc2GetProperty((*camera_context), &sharpness);
        if(camera_error != FC2_ERROR_OK)
        {
            this->debug_.Msg("Could NOT read sharpness!");
            ret.AddError(PG_FLYCAP_C_GET_SHARPNESS_FAILED);
            ret.AddError(CAMERA_NOT_SETUP);
            return ret;
        }
    
        // Save actual value
        this->sharpness_.Set(sharpness.valueA);
    
        // Check for gain setting
        fc2Property gain;
        gain.type = FC2_GAIN;
        if(settings.Contains(this->gain_)){
    
            // Retrieve settings
            settings.Get(&this->gain_);
    
            // Set the camera gain
            gain.absControl     = true;
            gain.onePush        = false;
            gain.onOff          = true;
            gain.autoManualMode = false;
            gain.absValue       = this->gain_.Get();
    
            camera_error = fc2SetProperty((*camera_context), &gain);
            if (camera_error != FC2_ERROR_OK)
            {
                this->debug_.Msg("Gain configuration FAILED");
                ret.AddError(PG_FLYCAP_C_SETUP_FAILED_GAIN);
                ret.AddError(CAMERA_NOT_SETUP);
                return ret;
            }
        }
    
        // Check actual setting
        camera_error = fc2GetProperty((*camera_context), &gain);
        if(camera_error != FC2_ERROR_OK)
        {
            this->debug_.Msg("Could NOT read gain!");
            ret.AddError(PG_FLYCAP_C_GET_GAIN_FAILED);
            ret.AddError(CAMERA_NOT_SETUP);
            return ret;
        }
    
        // Save actual value
        this->gain_.Set(gain.absValue);
    
    
    
        // Check for exposure setting
        fc2Property exposure;
        exposure.type = FC2_AUTO_EXPOSURE;
        if(settings.Contains(this->auto_exposure_) || settings.Contains(this->exposure_)){
    
            // Retrieve settings
            settings.Get(&this->auto_exposure_);
            settings.Get(&this->exposure_);
    
            // Set the camera exposure
            exposure.absControl       = true;
            exposure.onePush          = false;
            exposure.onOff            = this->auto_exposure_.Get();
            exposure.autoManualMode   = false;
            exposure.absValue         = this->exposure_.Get();
    
            camera_error = fc2SetProperty((*camera_context), &exposure);
            if (camera_error != FC2_ERROR_OK)
            {
                this->debug_.Msg("Gain configuration FAILED");
                ret.AddError(PG_FLYCAP_C_SETUP_FAILED_EXPOSURE);
                ret.AddError(CAMERA_NOT_SETUP);
                return ret;
            }
        }
    
        // Check actual setting
        camera_error = fc2GetProperty((*camera_context), &exposure);
        if(camera_error != FC2_ERROR_OK)
        {
            this->debug_.Msg("Could NOT read exposure!");
            ret.AddError(PG_FLYCAP_C_GET_EXPOSURE_FAILED);
            ret.AddError(CAMERA_NOT_SETUP);
            return ret;
        }
    
        // Save actual value
        this->exposure_.Set(exposure.absValue);
        this->auto_exposure_.Set(exposure.onOff);
    
    
        // First read the current trigger mode settings in case some
        // settings are missing from the parameters list
        fc2TriggerMode trigger_settings;
        camera_error = fc2GetTriggerMode((*camera_context),&trigger_settings);
        if (camera_error != FC2_ERROR_OK){
            this->debug_.Msg("Could NOT read trigger mode settings!");
            ret.AddError(PG_FLYCAP_C_GET_TRIGGER_MODE_FAILED);
            ret.AddError(CAMERA_NOT_SETUP);
            return ret;
        }
    
        // Save current values
        this->trigger_polarity_.Set(trigger_settings.polarity);
        this->trigger_source_.Set(trigger_settings.source);
        this->trigger_parameter_.Set(trigger_settings.parameter);
        this->trigger_enable_.Set(trigger_settings.onOff);
        this->trigger_mode_.Set(trigger_settings.mode);
    
        // Read any trigger settings from parameter list
        if(settings.Contains(this->trigger_enable_))    settings.Get(&this->trigger_enable_);
        if(settings.Contains(this->trigger_polarity_))  settings.Get(&this->trigger_polarity_);
        if(settings.Contains(this->trigger_source_))    settings.Get(&this->trigger_source_);
        if(settings.Contains(this->trigger_mode_))      settings.Get(&this->trigger_mode_);
        if(settings.Contains(this->trigger_parameter_)) settings.Get(&this->trigger_parameter_);
        if(settings.Contains(this->trigger_delay_))     settings.Get(&this->trigger_delay_);
    
        // Initialize all parameters of Trigger Settings
        trigger_settings.polarity   = this->trigger_polarity_.Get();
        trigger_settings.source     = this->trigger_source_.Get();
        trigger_settings.parameter  = this->trigger_parameter_.Get();
        trigger_settings.onOff      = this->trigger_enable_.Get();
        trigger_settings.mode       = this->trigger_mode_.Get();
    
        // Send the trigger mode settings
        camera_error = fc2SetTriggerMode((*camera_context),&trigger_settings);
        if (camera_error != FC2_ERROR_OK){
            this->debug_.Msg("Trigger mode configuration FAILED");
            ret.AddError(PG_FLYCAP_C_SETUP_FAILED_TRIGGER_MODE);
            ret.AddError(CAMERA_NOT_SETUP);
            return ret;
        }
    
    
        // If the trigger was turned and hardware trigger is selected,
        // poll the camera until it is ready to accept triggers
        if (trigger_settings.onOff && (trigger_settings.source == 0)){
    
            // Poll the camera until the device is ready to accept triggers
            // or the timeoue has occurred
            unsigned int register_value = 0;
    
            this->debug_.Msg("Hardware trigger mode enabled");
            this->debug_.Msg("Waiting for hardware triggers...");
    
            // Setup timeout
            dlp::Time::Chronograph time_out;
            time_out.Reset();
    
            do{
                camera_error = fc2ReadRegister((*camera_context),
                                               PG_FLYCAP_C_REGISTER_ADDRESS_SOFTWARE_TRIGGER,
                                               &register_value);
                if (camera_error != FC2_ERROR_OK){
                    this->debug_.Msg(1, "Trigger ready polling FAILED");
                    ret.AddError(PG_FLYCAP_C_SETUP_FAILED_TRIGGER_READY);
                    ret.AddError(CAMERA_NOT_SETUP);
                    return ret;
                }
    
                // This bit gets cleared as soon as Trigger is enabled and
                // it is finishes processing exisiting frame
            } while (((register_value >> 31) != 0) &&
                     (time_out.GetTotalTime() < 5000) );    // If time exceeds 5 seconds exit function
    
            // Check that a timeout did not occur
            if (time_out.GetTotalTime() >= 5000){
                this->debug_.Msg(1, "Polling for trigger ready TIME OUT");
                ret.AddError(PG_FLYCAP_C_SETUP_FAILED_TRIGGER_TIMEOUT);
                ret.AddError(CAMERA_NOT_SETUP);
                return ret;
            }
        }
    
    
        // Check if settings contained trigger delay
        fc2TriggerDelay trigger_delay;
        trigger_delay.type = FC2_TRIGGER_DELAY;
    
        if(settings.Contains(this->trigger_delay_)){
    
            // Set the trigger delay
            trigger_delay.absControl     = true;
            trigger_delay.onePush        = false;
            trigger_delay.onOff          = true;
            trigger_delay.autoManualMode = false;
            trigger_delay.absValue       = this->trigger_delay_.Get();
    
            camera_error = fc2SetTriggerDelay((*camera_context), &trigger_delay);
            if (camera_error != FC2_ERROR_OK){
                this->debug_.Msg("Trigger delay configuration FAILED");
                ret.AddError(PG_FLYCAP_C_SETUP_FAILED_TRIGGER_DELAY);
                ret.AddError(CAMERA_NOT_SETUP);
                return ret;
            }
        }
    
        // Read the trigger delay settings
        camera_error = fc2GetTriggerDelay((*camera_context), &trigger_delay);
        if (camera_error != FC2_ERROR_OK){
            this->debug_.Msg("Could NOT read trigger delay!");
            ret.AddError(PG_FLYCAP_C_GET_TRIGGER_DELAY_FAILED);
            ret.AddError(CAMERA_NOT_SETUP);
            return ret;
        }
    
        // Check if settings contains a specified strobe source
        if(settings.Contains(this->strobe_source_)){
    
            // Retrieve the strobe source
            settings.Get(&this->strobe_source_);
    
            // Read the strobe source current settings
            fc2StrobeControl strobe_settings;
            strobe_settings.source      = this->strobe_source_.Get();
            camera_error = fc2GetStrobe((*camera_context), &strobe_settings);
            if (camera_error != FC2_ERROR_OK){
                this->debug_.Msg("Coulnd NOT read strobe configuration!");
                ret.AddError(PG_FLYCAP_C_GET_STROBE_FAILED);
                ret.AddError(CAMERA_NOT_SETUP);
                return ret;
            }
    
            // Check for other strobe settings in parameter object
            if(settings.Contains(this->strobe_enable_))     settings.Get(&this->strobe_enable_);
            if(settings.Contains(this->strobe_polarity_))   settings.Get(&this->strobe_polarity_);
            if(settings.Contains(this->strobe_delay_))      settings.Get(&this->strobe_delay_);
            if(settings.Contains(this->strobe_duration_))   settings.Get(&this->strobe_duration_);
    
            // Update the strobe settings
            strobe_settings.onOff       = this->strobe_enable_.Get();
            strobe_settings.polarity    = this->strobe_polarity_.Get();
            strobe_settings.delay       = this->strobe_delay_.Get();
            strobe_settings.duration    = this->strobe_duration_.Get();
    
            // Setup the strobe
            camera_error = fc2SetStrobe((*camera_context), &strobe_settings);
            if (camera_error != FC2_ERROR_OK){
                this->debug_.Msg("Strobe configuration FAILED");
                ret.AddError(PG_FLYCAP_C_SETUP_FAILED_STROBE);
                ret.AddError(CAMERA_NOT_SETUP);
                return ret;
            }
        }
    
        // Mark setup flag as true
        this->is_setup_ = true;
    
        return ret;
    }
    

  • Hi Sanjeev,

    As I mentioned in an earlier post with the screenshot I am not able to compile the SDK in CMake. Please provide the steps needed to compile the SDK in CMake. Thank you.

    Regards,

    Sidharth Makhija
  • Hi Sidharth,

    Go ahead and submit another thread on compiling SDK issue. Before that i suggest to look into the form on compilation topic.

    Regards,

    Sanjeev

  • Hi Sanjeev,

    I have made a new forum post regarding compiling the SDK here. I look forward to your prompt response on that. Thank you.

    Regards,

    Sidharth Makhija

  • Hello,

    I have been able to build the SDK and the application on Windows 7 32 bit. I have modified the code to print out the Format 7 settings where the error is genrated. Both the camera and the SDK have the same Format 7 modes but the error still comes up. I have attached the screenshots below. Could you help in suggesting any more changes to the code since the modes seem to be the same?

    Thank you.