TrackingHardware
Software
Mega PlanEtc. |
Main /
HowToUseVisionHow to use the vision librariesThe vision system was recently overhauled to allow for the flockbot to select, and change, the currently processing vision library during its execution. The system initially begins by starting up OpenCV (ver. 2.3 c++) and the camera system. Once everything is ready for processing, the vision thread blocks and awaits instructions on which library to load and run. The step to select the library may be taken from either an on-board behavior (Dynamic C or Lua script), or can be sent from a connected client over the socket on port 2005. Once the vision system begins processing, it will process images until it receives the instruction to shut down and prepare itself for the next library command. This means that your program can switch libraries mid-execution as necessary for your computations. Below are the series of steps needed for both approaches. C/Lua
Example: #include <stdio.h> #include <stdlib.h> #include "barcode.h" void *start_behavior(void *args) { camera_forward(); barcode_run(); while((val = barcode_get_barcodes()) == -1); printf("Received a barcode. Found: %d\n", val); shutdown_run(); return; } Socket
|