Skip to content

Commit

Permalink
Fix typos, add functions to init, fix order of operations
Browse files Browse the repository at this point in the history
  • Loading branch information
shalinmehtalgsvl committed Sep 25, 2020
1 parent 0d4619b commit 0791c2c
Show file tree
Hide file tree
Showing 2 changed files with 3 additions and 3 deletions.
2 changes: 1 addition & 1 deletion lgsvl/evaluator/__init__.py
Original file line number Diff line number Diff line change
Expand Up @@ -4,4 +4,4 @@
# This software contains code licensed as described in LICENSE.
#

from .utils import TestException, right_lane_check, separation
from .utils import TestException, right_lane_check, separation, almost_equal, in_parking_zone
4 changes: 2 additions & 2 deletions lgsvl/evaluator/utils.py
Original file line number Diff line number Diff line change
Expand Up @@ -25,9 +25,9 @@ def right_lane_check(simulator, ego_transform):
def in_parking_zone(beginning, end, ego_transform):
forward = lgsvl.utils.transform_to_forward(ego_transform)
b2e = ego_transform.position - beginning # Vector from beginning of parking zone to EGO's position
b2e = b2e * 1 / b2e.magnitude # Make is a Unit vector to simplify dot product result
b2e = b2e * (1 / b2e.magnitude()) # Make it a Unit vector to simplify dot product result
e2e = end - ego_transform.position # Vector from EGO's position to end of parking zone
e2e = e2e * 1 / e2e.magnitue
e2e = e2e * (1 / e2e.magnitude())
return (
numpy.dot([forward.x, forward.y, forward.z], [b2e.x, b2e.y, b2e.z]) > 0.9
and numpy.dot([forward.x, forward.y, forward.z], [e2e.x, e2e.y, e2e.z]) > 0.9
Expand Down

0 comments on commit 0791c2c

Please sign in to comment.