00001
00002
00003
00004
00005
00006
00007
00008
00009
00010
00011
00012
00013
00014
00015
00016
00017
00018
00019
00020
00021
00022
00023 #include "fvretriever_plugin.h"
00024 #include "retriever_thread.h"
00025
00026 #include <core/exceptions/software.h>
00027
00028 using namespace fawkes;
00029 using namespace firevision;
00030
00031
00032
00033
00034
00035
00036
00037
00038
00039
00040
00041
00042 FvRetrieverPlugin::FvRetrieverPlugin(Configuration *config)
00043 : Plugin(config)
00044 {
00045
00046 std::string prefix = "/firevision/retriever/camera/";
00047 Configuration::ValueIterator *vi = config->search(prefix.c_str());
00048
00049 while (vi->next()) {
00050 if ( ! vi->is_string() ) {
00051 throw TypeMismatchException("Only values of type string are valid for camera"
00052 " argument strings, but got %s for %s",
00053 vi->type(), vi->path());
00054 }
00055
00056 std::string id = std::string(vi->path()).substr(prefix.length());
00057
00058 thread_list.push_back(new FvRetrieverThread(vi->get_string().c_str(), id.c_str()));
00059 }
00060
00061 if ( thread_list.empty() ) {
00062 throw Exception("No cameras have been set for fvretriever");
00063 }
00064
00065 delete vi;
00066 }
00067
00068 PLUGIN_DESCRIPTION("Reads images from cameras and stores them in shared memory")
00069 EXPORT_PLUGIN(FvRetrieverPlugin)