Skip to content

Commit

Permalink
Cast the action to float64 explicitly in CarRacing
Browse files Browse the repository at this point in the history
  • Loading branch information
RedTachyon committed Jun 27, 2024
1 parent 3b7f398 commit 74157f2
Showing 1 changed file with 1 addition and 0 deletions.
1 change: 1 addition & 0 deletions gymnasium/envs/box2d/car_racing.py
Original file line number Diff line number Diff line change
Expand Up @@ -540,6 +540,7 @@ def reset(
def step(self, action: Union[np.ndarray, int]):
assert self.car is not None
if action is not None:
action = action.astype(np.float64)
if self.continuous:
self.car.steer(-action[0])
self.car.gas(action[1])
Expand Down

0 comments on commit 74157f2

Please sign in to comment.