Skip to content

Instantly share code, notes, and snippets.

@cipher982
Created February 16, 2018 00:29
Show Gist options
  • Save cipher982/0881f4127d70489c1a5b5ab51c4c337d to your computer and use it in GitHub Desktop.
Save cipher982/0881f4127d70489c1a5b5ab51c4c337d to your computer and use it in GitHub Desktop.
if (d > 0 && d < 4) // d represents location in meters from left-most edge
{
car_lane = 0; // 0-4 meters = lane 0, (left-lane)
}
else if (d > 4 && d < 8)
{
car_lane = 1; // middle-lane
}
else if (d > 8 && d < 12)
{
car_lane = 2; // right-lane
}
if (car_lane < 0)
{
continue;
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment