From 1d8fef29ce30a3cc5379206c213387e99d13acb8 Mon Sep 17 00:00:00 2001 From: ariannagavioli Date: Tue, 8 Jan 2019 22:43:52 +0100 Subject: [PATCH] modified: include/task.h modified: include/utils.h modified: src/graphics.c modified: src/sensors.c --- include/task.h | 4 ---- include/utils.h | 1 + src/graphics.c | 4 ++-- src/sensors.c | 9 +++++++-- 4 files changed, 10 insertions(+), 8 deletions(-) diff --git a/include/task.h b/include/task.h index 1b0e977..4745b45 100644 --- a/include/task.h +++ b/include/task.h @@ -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*/ diff --git a/include/utils.h b/include/utils.h index b107c5c..c44fbe3 100644 --- a/include/utils.h +++ b/include/utils.h @@ -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); diff --git a/src/graphics.c b/src/graphics.c index 845d61c..48819dc 100644 --- a/src/graphics.c +++ b/src/graphics.c @@ -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; @@ -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; diff --git a/src/sensors.c b/src/sensors.c index 881d04f..2fd66ca 100644 --- a/src/sensors.c +++ b/src/sensors.c @@ -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) { @@ -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 **/