14.11.2012 Views

Submitted version of the thesis - Airlab, the Artificial Intelligence ...

Submitted version of the thesis - Airlab, the Artificial Intelligence ...

Submitted version of the thesis - Airlab, the Artificial Intelligence ...

SHOW MORE
SHOW LESS

Create successful ePaper yourself

Turn your PDF publications into a flip-book with our unique Google optimized e-Paper software.

B.1. Microprocessor Code 107<br />

/* Standard include ----------------------------------------------------------*/<br />

#include "91x_map.h"<br />

#include "utils.h"<br />

#include "definitions.h"<br />

#include "definitionsLib.h"<br />

#include "CamInt_x24.h"<br />

#include "usb_lib.h"<br />

#include "usb_conf.h"<br />

#include "usb_prop.h"<br />

#include "usb_pwr.h"<br />

#include "usb_config.h"<br />

#include "RGBCube.h"<br />

#include "blobsearch.h"<br />

#include "math.h"<br />

#include "Misc.h"<br />

#include "Vision.h"<br />

#include "Camera_Init.h"<br />

#include "Motion.h"<br />

/* Include <strong>of</strong> o<strong>the</strong>r module interface headers ---------------------------------*/<br />

/* Local includes ------------------------------------------------------------*/<br />

/* Private typedef -----------------------------------------------------------*/<br />

/* Private define ------------------------------------------------------------*/<br />

//#define PRINT_ON<br />

/* Private macro -------------------------------------------------------------*/<br />

/* Private variables ---------------------------------------------------------*/<br />

u8 *pImgBufferData;<br />

u32 BufferSize;<br />

double BlobSample[10][2];<br />

u8 index = 0;<br />

extern Tx24_ImgJob Job[2];<br />

extern CurrentJob;<br />

extern u8 control_hit;<br />

/* Private function prototypes -----------------------------------------------*/<br />

//see header<br />

/* Private functions ---------------------------------------------------------*/<br />

void Blob_Search(void) {<br />

if (Job[CurrentJob].State == x24_StateAcquisitionEnd) { // Image is acquired<br />

MY_ON();<br />

CompletedJob = &Job[CurrentJob];<br />

BlobSearch((u16*) CompletedJob->pFirstBlock->pData);<br />

MY_OFF();<br />

CurrentJob ^= 1;<br />

}<br />

}<br />

void CalculatePositionTop(TPoint point, s16 result[3]) {<br />

//Homography for servo_top

Hooray! Your file is uploaded and ready to be published.

Saved successfully!

Ooh no, something went wrong!