Skip to content

Commit

Permalink
comment traffic-light states for later updates
Browse files Browse the repository at this point in the history
  • Loading branch information
AlirezaMorsali committed Sep 27, 2022
1 parent 7d4a0b4 commit 7d7a825
Show file tree
Hide file tree
Showing 2 changed files with 5 additions and 7 deletions.
4 changes: 1 addition & 3 deletions examples/Demo_Drive.py
Original file line number Diff line number Diff line change
Expand Up @@ -29,7 +29,6 @@
min_speed=10,
max_speed=20,
)
breakpoint()
agent_attributes = response["attributes"]
frames = []
for i in tqdm(range(50)):
Expand All @@ -41,10 +40,9 @@
location=args.location,
obs_length=1,
steps=1,
traffic_timer=response["traffic_timer"],
# traffic_timer=response["traffic_timer"],
)

breakpoint()
birdview = np.array(response["bird_view"], dtype=np.uint8)
image = cv2.imdecode(birdview, cv2.IMREAD_COLOR)
frames.append(image)
Expand Down
8 changes: 4 additions & 4 deletions invertedai/drive.py
Original file line number Diff line number Diff line change
Expand Up @@ -51,8 +51,8 @@ def initialize(
"states": initial_states["initial_condition"]["agent_states"],
"recurrent_states": None,
"attributes": initial_states["initial_condition"]["agent_sizes"],
"traffic_light_state": initial_states["traffic_light_state"],
"traffic_timer": initial_states["traffic_timer"],
# "traffic_light_state": initial_states["traffic_light_state"],
# "traffic_timer": initial_states["traffic_timer"],
}
return response
except TryAgain as e:
Expand All @@ -73,7 +73,7 @@ def drive(
batch_size: int = 1,
fix_carla_coord: bool = False,
get_infractions: bool = False,
traffic_timer: int = 1,
# traffic_timer: int = 1,
) -> dict:
def _validate(input_dict: dict, input_name: str):
input_data = input_dict[input_name]
Expand Down Expand Up @@ -140,7 +140,7 @@ def _validate_and_tolist(input_data: dict, input_name: str):
get_birdviews=get_birdviews,
fix_carla_coord=fix_carla_coord,
get_infractions=get_infractions,
traffic_timer=traffic_timer,
# traffic_timer=traffic_timer,
)

start = time.time()
Expand Down

0 comments on commit 7d7a825

Please sign in to comment.