Skip to content

Commit

Permalink
modified: include/vehicle.h
Browse files Browse the repository at this point in the history
	modified:   src/graphics.c
	modified:   src/pathplanner.c
  • Loading branch information
ariannagavioli committed Jan 20, 2019
1 parent 6821ee3 commit b1e12a7
Show file tree
Hide file tree
Showing 3 changed files with 8 additions and 5 deletions.
2 changes: 1 addition & 1 deletion include/vehicle.h
Original file line number Diff line number Diff line change
Expand Up @@ -19,7 +19,7 @@
#define V_REF 20.0

// VELOCITY BOUNDARIES
#define MAX_VEL_CAR 25
#define MAX_VEL_CAR 40
#define MIN_VEL_CAR 0

/***** Real-Time Task *****/
Expand Down
2 changes: 1 addition & 1 deletion src/graphics.c
Original file line number Diff line number Diff line change
Expand Up @@ -162,7 +162,7 @@ void initStatDisplay(){
240, INFO_COL, -1);

drawNCars(0);
drawGVel(0);
drawGVel(20);

snprintf(s, sizeof(int), "%d", dmiss);
textout_centre_ex(screen, font, s, (N_BLOCKS_X*BLOCK_W + (N_BLOCKS_X+ 1)*STREET_W) + 60,
Expand Down
9 changes: 6 additions & 3 deletions src/pathplanner.c
Original file line number Diff line number Diff line change
Expand Up @@ -287,9 +287,12 @@ char pathPlanner(vehicle_t *c) {
/******** CROSSROAD RESPONSE ********/
if (!c->isTime2Steer) {
keepCertainDistanceFromBlock(c, DST_FROM_LEFT_SIDEBLOCK); // keep safe distance from blocks
if (imf.stCorner.N == 2) {
check2turnAround(c, &imf);

if (imf.stCorner.N){
if(c->Vr > 20) c->Vr = c->Vr-10;
//printf("%f\n", c->vel);
if(imf.stCorner.N== 2) {
check2turnAround(c, &imf);
}
}
if ((imf.stCorner.x[0] < DST_TO_STEER) && (imf.stCorner.N)) {
chooseSteering(c, &imf); // the vehicle will go left, right or straigh
Expand Down

0 comments on commit b1e12a7

Please sign in to comment.