You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
changing lane to be added in the code.
at line 277 to 282
if (too_close) {
//try and change lanes
bool canMergeLeft = lane > 0;
bool canMergeRight = lane < 2;
//try merging left
int ref_lane = lane - 1;
if (canMergeLeft && d < (2+4*ref_lane+2) && d > (2+4*ref_lane-2)) {
if (abs(check_car_s - car_s) < 20) {
canMergeLeft = false;
}
}
//try merging right
ref_lane = lane + 1;
if (canMergeRight && d < (2+4*ref_lane+2) && d > (2+4*ref_lane-2)) {
if (abs(check_car_s - car_s) < 20) {
canMergeRight = false;
}
}
}
if (canMergeLeft) {
lane--;
} else if (canMergeRight) {
lane++;
}
The text was updated successfully, but these errors were encountered:
changing lane to be added in the code.
at line 277 to 282
The text was updated successfully, but these errors were encountered: