ROS Resources: Documentation | Support | Discussion Forum | Index | Service Status | ros @ Robotics Stack Exchange
Ask Your Question

Revision history [back]

click to hide/show revision 1
initial version

The solution was to rebuild libdc1394 library. Here is what I did,

1) downloaded latest version of the library, libdc1394-2.2.

2) added vendors and products codes to usb_products[] that is defined in libdc1394-2.2/dc1394/usb/control.c For flea 3, I added these two lines { 0x1e10, 0x3000 }, { 0X1e10, 0x3006 }, Finally the structure looks as follows

/* This is the list of USB vendor/products that we know support
 * IIDC-over-USB.  Currently, this is the only mechanism of detecting
 * such cameras. */
static struct _vendor_product_t {
    uint16_t vendor;
    uint16_t product;
} usb_products[] = {
    { 0x1e10, 0x2000 }, // Point Grey Firefly MV Color
    { 0x1e10, 0x2001 }, // Point Grey Firefly MV Mono
    { 0x1e10, 0x2002 }, // Point Grey High Res Firefly MV Color
    { 0x1e10, 0x2003 }, // Point Grey High Res Firefly MV Mono
    { 0x1e10, 0x2004 }, // Point Grey Chameleon Color
    { 0x1e10, 0x2005 }, // Point Grey Chameleon Mono
    { 0x1e10, 0x3000 }, // Point Grey Flea 3
    { 0X1e10, 0x3006 }, // Point Grey Flea 3 Color
    { 0, 0 },
};

3) Rebuild libdc

4) Build and run the following code that allowed me to get GUID, that later I successfully used to run camera1394.

#include <stdio.h>
#include <stdint.h>
#include <dc1394/dc1394.h>
#include <stdlib.h>
#include <inttypes.h>

int main(int argc, char *argv[])
{
    FILE* imagefile;
    dc1394camera_t *camera;
    unsigned int width, height;
    dc1394video_frame_t *frame=NULL;
    //dc1394featureset_t features;
    dc1394_t * d;
    dc1394camera_list_t * list;
    dc1394error_t err;

    d = dc1394_new ();
    if (!d)
        return 1;
    err=dc1394_camera_enumerate (d, &list);
    DC1394_ERR_RTN(err,"Failed to enumerate cameras");

    if (list->num == 0) {
        dc1394_log_error("No cameras found");
        return 1;
    }

    camera = dc1394_camera_new (d, list->ids[0].guid);
    if (!camera) {
        dc1394_log_error("Failed to initialize camera with guid %llx", list->ids[0].guid);
        return 1;
    }
    dc1394_camera_free_list (list);

    printf("Using camera with GUID %" PRIx64"\n", camera->guid);

   dc1394_video_set_transmission(camera, DC1394_OFF);
   dc1394_capture_stop(camera);
   dc1394_camera_free(camera);
   dc1394_free (d);
   return 0;
}

It is useable now, although there are some issues with setting different modes and reducing the delay. I don't have these issues on a Windows virtual machine when I use FlyCapture.

The solution was to rebuild libdc1394 library. Here is what I did,

1) downloaded latest version of the library, libdc1394-2.2.

2) added vendors and products codes to usb_products[] that is defined in libdc1394-2.2/dc1394/usb/control.c For flea 3, I added these two lines { 0x1e10, 0x3000 }, { 0X1e10, 0x3006 }, Finally the structure looks as follows

/* This is the list of USB vendor/products that we know support
 * IIDC-over-USB.  Currently, this is the only mechanism of detecting
 * such cameras. */
static struct _vendor_product_t {
    uint16_t vendor;
    uint16_t product;
} usb_products[] = {
    { 0x1e10, 0x2000 }, // Point Grey Firefly MV Color
    { 0x1e10, 0x2001 }, // Point Grey Firefly MV Mono
    { 0x1e10, 0x2002 }, // Point Grey High Res Firefly MV Color
    { 0x1e10, 0x2003 }, // Point Grey High Res Firefly MV Mono
    { 0x1e10, 0x2004 }, // Point Grey Chameleon Color
    { 0x1e10, 0x2005 }, // Point Grey Chameleon Mono
    { 0x1e10, 0x3000 }, // Point Grey Flea 3
    { 0X1e10, 0x3006 }, // Point Grey Flea 3 Color
    { 0, 0 },
};

3) Rebuild libdc

4) Build and run the following code that allowed me will allow you to get GUID, that later I successfully used GUID. Later this GUID should be put to camera yaml file to run camera1394.

#include <stdio.h>
#include <stdint.h>
#include <dc1394/dc1394.h>
#include <stdlib.h>
#include <inttypes.h>

int main(int argc, char *argv[])
{
    FILE* imagefile;
    dc1394camera_t *camera;
    unsigned int width, height;
    dc1394video_frame_t *frame=NULL;
    //dc1394featureset_t features;
    dc1394_t * d;
    dc1394camera_list_t * list;
    dc1394error_t err;

    d = dc1394_new ();
    if (!d)
        return 1;
    err=dc1394_camera_enumerate (d, &list);
    DC1394_ERR_RTN(err,"Failed to enumerate cameras");

    if (list->num == 0) {
        dc1394_log_error("No cameras found");
        return 1;
    }

    camera = dc1394_camera_new (d, list->ids[0].guid);
    if (!camera) {
        dc1394_log_error("Failed to initialize camera with guid %llx", list->ids[0].guid);
        return 1;
    }
    dc1394_camera_free_list (list);

    printf("Using camera with GUID %" PRIx64"\n", camera->guid);

   dc1394_video_set_transmission(camera, DC1394_OFF);
   dc1394_capture_stop(camera);
   dc1394_camera_free(camera);
   dc1394_free (d);
   return 0;
}

It is useable now, although there are some issues with setting different modes and reducing the delay. I don't have these issues on a Windows virtual machine when I use FlyCapture.