00001
00002
00003
00004
00005
00006
00007
00008
00009
00010
00011
00012
00013
00014
00015
00016
00017
00018
00019
00020
00021
00022
00023 #include <cams/bumblebee2.h>
00024 #include <fvutils/system/camargp.h>
00025 #include <cerrno>
00026 #include <cstdlib>
00027
00028 using namespace std;
00029 using namespace firevision;
00030
00031 int
00032 main(int argc, char **argv)
00033 {
00034
00035 if ( argc < 2 ) {
00036 printf("Usage: %s <context_file>\n", argv[0]);
00037 exit(-1);
00038 }
00039
00040 const char *context_file = argv[1];
00041 if ( access(context_file, F_OK) == 0) {
00042 fprintf(stderr, "File with name %s exists, delete manually and retry. Aborting.\n", context_file);
00043 return -1;
00044 }
00045 if ( access(context_file, W_OK) != 0) {
00046
00047 if ( errno != ENOENT ) {
00048 fprintf(stderr, "Cannot write to file %s, permission problem?\n", context_file);
00049 return -2;
00050 }
00051 }
00052
00053 CameraArgumentParser *cap = new CameraArgumentParser("bumblebee2:Bumblebee2 BB2-03S2C");
00054
00055 Bumblebee2Camera *bb2 = new Bumblebee2Camera(cap);
00056 bb2->open();
00057
00058 bb2->write_triclops_config_from_camera_to_file(context_file);
00059 bb2->close();
00060 delete bb2;
00061 delete cap;
00062
00063 return 0;
00064 }