Skip to content

Commit

Permalink
modified: include/task.h
Browse files Browse the repository at this point in the history
	modified:   include/utils.h
	modified:   src/graphics.c
	modified:   src/sensors.c
  • Loading branch information
ariannagavioli committed Jan 8, 2019
1 parent fca016f commit 1d8fef2
Show file tree
Hide file tree
Showing 4 changed files with 10 additions and 8 deletions.
4 changes: 0 additions & 4 deletions include/task.h
Original file line number Diff line number Diff line change
Expand Up @@ -3,10 +3,6 @@
#ifndef TASK_H
#define TASK_H

/** THREAD ENDERS **/
int ShouldISuicide;


/*Structure that defines the parameters of a real time task*/
typedef struct {
pthread_t tid; /* task id*/
Expand Down
1 change: 1 addition & 0 deletions include/utils.h
Original file line number Diff line number Diff line change
Expand Up @@ -59,6 +59,7 @@
#define INFO_COL makecol(247,196,12)
#define INFO_GREEN makecol(147, 255, 196)
#define INFO_RED makecol(255, 147, 165)
#define INFO_YEL makecol(255, 241, 168)

/* copy int elements from source to destination */
void cpyPnts(int *source, int *destination, const int N);
Expand Down
4 changes: 2 additions & 2 deletions src/graphics.c
Original file line number Diff line number Diff line change
Expand Up @@ -80,7 +80,7 @@ void drawNCars(int x){
if(x <= (MAX_CARS/3))
color = INFO_GREEN;
else if(x <= (2*MAX_CARS/3))
color = WHITE;
color = INFO_YEL;
else
color = INFO_RED;

Expand Down Expand Up @@ -169,7 +169,7 @@ void drawNDmiss(){
if(deadline_misses <= 10)
color = INFO_GREEN;
else if(deadline_misses <= 20)
color = WHITE;
color = INFO_YEL;
else
color = INFO_RED;

Expand Down
9 changes: 7 additions & 2 deletions src/sensors.c
Original file line number Diff line number Diff line change
Expand Up @@ -132,7 +132,10 @@ void getRangefinder(dstsens_t *dst, const int beam) {
char isStreetColor(const int tmp) {
return (tmp == TL_COL) || (tmp == TL_GREEN) ||
(tmp == TL_YELLOW) || (tmp == TL_RED) ||
(tmp == BLOCK_COL) || (tmp == BLACK);
(tmp == BLOCK_COL) || (tmp == BLACK) ||
(tmp == STAT_BG) || (tmp == INFO_COL) ||
(tmp == INFO_GREEN) || (tmp == INFO_RED) ||
(tmp == INFO_YEL);
}

void analyzeCameraFrame(vehicle_t *c, imfeatures_t *imft) {
Expand Down Expand Up @@ -163,10 +166,12 @@ void analyzeCameraFrame(vehicle_t *c, imfeatures_t *imft) {
}
}

display(c->cam.image, W - HRES - 10, H - VRES - 100);
// display(c->cam.image, W - HRES - 10, H - VRES - 100);
RosenfeldPfaltz(bwTL, &imft->TLcenter, 0);
// display(bwTL, W - HRES - 10, H - VRES - 100);
fastHarrisRobertCornerDetection(&bwStreet);
imft->stCorner = bwStreet.ft;
// display(bwStreet.im, W - HRES - 10, H - VRES - 100);

/** TO BE WRAPPED UP **/
/** Read traffic light status **/
Expand Down

0 comments on commit 1d8fef2

Please sign in to comment.