Commit 79289ca8 authored by spiglerg's avatar spiglerg
Browse files

fixed bug for treeobs in curved rails: now the tree branch will look as 'forward' even on a curve

parent d8cfdb9e
Pipeline #1024 passed with stage
in 9 minutes and 48 seconds
......@@ -234,8 +234,9 @@ class TreeObsForRailEnv(ObservationBuilder):
# If only one transition is possible, the tree is oriented with this transition as the forward branch.
# TODO: Test if this works as desired!
orientation = agent.direction
if num_transitions == 1:
orientation == np.argmax(possible_transitions)
orientation = np.argmax(possible_transitions)
for branch_direction in [(orientation + i) % 4 for i in range(-1, 3)]:
if possible_transitions[branch_direction]:
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment