| 508 | |
| 509 | |
| 510 | def process_act(self, action): |
| 511 | |
| 512 | # acc, steer = action.astype(np.float64) |
| 513 | acc = action[0][0] |
| 514 | steer = action[0][1] |
| 515 | if acc >= 0.0: |
| 516 | throttle = acc |
| 517 | brake = 0.0 |
| 518 | else: |
| 519 | throttle = 0.0 |
| 520 | brake = np.abs(acc) |
| 521 | |
| 522 | throttle = np.clip(throttle, 0, 1) |
| 523 | steer = np.clip(steer, -1, 1) |
| 524 | brake = np.clip(brake, 0, 1) |
| 525 | control = carla.VehicleControl(throttle=throttle, steer=steer, brake=brake) |
| 526 | return control |
| 527 | |
| 528 | def _weather_to_dict(self, carla_weather): |
| 529 | weather = { |