From eca43c391aa54355948ca2d4c0da7f6b3f353f1f Mon Sep 17 00:00:00 2001 From: Kevron Rees Date: Mon, 4 Mar 2013 11:13:52 -0800 Subject: [PATCH] added README --- plugins/dbus/vehicleinfo.h | 8 ++-- plugins/opencvlux/README | 69 +++++++++++++++++++++++++++++++++++ plugins/opencvlux/opencvluxplugin.cpp | 2 + 3 files changed, 75 insertions(+), 4 deletions(-) create mode 100644 plugins/opencvlux/README diff --git a/plugins/dbus/vehicleinfo.h b/plugins/dbus/vehicleinfo.h index a596d6a..f597da4 100644 --- a/plugins/dbus/vehicleinfo.h +++ b/plugins/dbus/vehicleinfo.h @@ -69,7 +69,7 @@ public: * @type unsigned short * @access readonly **/ - wantProperty(VehicleProperty::FuelType, "Type", "i", AbstractProperty::Read); + wantProperty(VehicleProperty::FuelType, "Type", "y", AbstractProperty::Read); /** @attributeName RefuelPosition * @type unsigned short @@ -109,7 +109,7 @@ public: * @type sequence * @access readonly **/ - wantPropertyVariant(VehicleProperty::DoorsPerRow, "DoorsPerRow", "ai", AbstractProperty::Read); + wantPropertyVariant(VehicleProperty::DoorsPerRow, "DoorsPerRow", "ay", AbstractProperty::Read); supportedChanged(re->supported()); } @@ -144,13 +144,13 @@ public: * @type unsigned short * @access readonly **/ - wantProperty(VehicleProperty::FrontWheelRadius, "FrontWheelRadius", "u", AbstractProperty::Read); + wantProperty(VehicleProperty::FrontWheelRadius, "FrontWheelRadius", "q", AbstractProperty::Read); /** @attributeName RearWheelRadius * @type unsigned short * @access readonly **/ - wantProperty(VehicleProperty::RearWheelRadius, "RearWheelRadius", "u", AbstractProperty::Read); + wantProperty(VehicleProperty::RearWheelRadius, "RearWheelRadius", "q", AbstractProperty::Read); /** @attributeName WheelTrack * @type unsigned long diff --git a/plugins/opencvlux/README b/plugins/opencvlux/README new file mode 100644 index 0000000..0fe1d68 --- /dev/null +++ b/plugins/opencvlux/README @@ -0,0 +1,69 @@ +OpenCV "lux" plugin + +This plugin simulates the ExteriorBrigtness property using a traditional webcamera. It works +by taking the mean pixel intensity of the web camera image and estimating lux. The particular +can be calibrated using the "pixelUpperBound" and "pixelLowerBound" variables. + +To use the OpenCV plugin, add the following to the "sources" array in /etc/ambd/config: + +{ + "name" : "OpenCV LUX", + "path" : "/usr/lib/automotive-message-broker/opencvluxplugin.so", + "threaded" : "true", + "pixelLowerBound" : "0", + "pixelUpperBound" : "255", + "fps" : "30", + "kinect" : "false", + "opencl" : "false", + "device" : "0" +} + +Configuration Key Definitions: + +"name" +name of plugin. This key is not used by the plugin at this moment. + +"path" +path to plugin on the filesystem. + +"device" +Camera to use. The string "0" corrisponds to /dev/video0, "1" to /dev/video1, etc. + +Default: "0" + +"threaded" +Compute pixel intensity in another thread. Set to "true" or "false" + +Default: "false" + +"fps" +How many times per second to poll image data from the camera. + +Default: "30" + +"kinect" +Set to "true" if you are using a kinect camera. + +Default: "false" + +"pixelLowerBound" +Lowest calibration value for a camera. This is the average pixel intensity value the camera reports when +it is completely covered. + +Default: "0" + +"pixelUpperBound" +The highest calibration value for camera. This is the average pixel intensity value when a very bright +light (like the sun) is being projected at the camera. + +Default: "255" + +"opencl" (experimental) +Use a specialized CPU/GPU device to calculate the mean pixel intensity. This will only work if OpenCV +was compiled with OpenCL support. This plugin looks for the OpenCV ocl headers and adds support at +compile time. + +NOTE: This option has not been tested because at implementation, OpenCL 1.2 was not available from devices +on-hand. + +Default: "false" diff --git a/plugins/opencvlux/opencvluxplugin.cpp b/plugins/opencvlux/opencvluxplugin.cpp index 4cf47d1..0012db8 100644 --- a/plugins/opencvlux/opencvluxplugin.cpp +++ b/plugins/opencvlux/opencvluxplugin.cpp @@ -74,7 +74,9 @@ OpenCvLuxPlugin::OpenCvLuxPlugin(AbstractRoutingEngine* re, map pixelLowerBound = boost::lexical_cast(config["pixelLowerBound"]); if(pixelLowerBound < 0) + { pixelLowerBound = 0; + } } -- 2.7.4