Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Addition of FTC I2C Protocol #35

Open
wants to merge 5 commits into
base: master
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
7 changes: 7 additions & 0 deletions src/common/inc/blobs.h
Original file line number Diff line number Diff line change
Expand Up @@ -20,6 +20,7 @@
#include "pixytypes.h"
#include "colorlut.h"
#include "qqueue.h"
#include <stdlib.h> //added to get sort by area functionality

#define MAX_BLOBS 100
#define MAX_BLOBS_PER_MODEL 20
Expand All @@ -28,6 +29,7 @@
#define MIN_COLOR_CODE_AREA 10
#define MAX_CODED_DIST 8
#define MAX_COLOR_CODE_MODELS 5
#define MAX_FTCBLOBS 5

#define BL_BEGIN_MARKER 0xaa55
#define BL_BEGIN_MARKER_CC 0xaa56
Expand All @@ -49,6 +51,7 @@ class Blobs
uint16_t getBlock(uint8_t *buf, uint32_t buflen);
uint16_t getCCBlock(uint8_t *buf, uint32_t buflen);
BlobA *getMaxBlob(uint16_t signature=0, uint16_t *numBlobs=NULL);
void getMaxBlobs(uint16_t signature, uint16_t maxNumBlobs, BlobA **maxBlobs, uint16_t *numBlobs);
void getBlobs(BlobA **blobs, uint32_t *len, BlobB **ccBlobs, uint32_t *ccLen);
int setParams(uint16_t maxBlobs, uint16_t maxBlobsPerModel, uint32_t minArea, ColorCodeMode ccMode);
int runlengthAnalysis();
Expand All @@ -69,6 +72,7 @@ class Blobs
bool closeby(BlobA *blob0, BlobA *blob1);
int16_t distance(BlobA *blob0, BlobA *blob1);
void sort(BlobA *blobs[], uint16_t len, BlobA *firstBlob, bool horiz);
//static int compareBlobAreas(const void *a, const void *b);
int16_t angle(BlobA *blob0, BlobA *blob1);
int16_t distance(BlobA *blob0, BlobA *blob1, bool horiz);
void processCC();
Expand All @@ -84,6 +88,9 @@ class Blobs
uint16_t *m_blobs;
uint16_t m_numBlobs;


uint16_t *m_ftcblobs;

BlobB *m_ccBlobs;
uint16_t m_numCCBlobs;

Expand Down
Loading