MCPcopy Create free account
hub / github.com/OpenDriveLab/TCP / process_act

Method process_act

leaderboard/team_code/roach_ap_agent.py:510–526  ·  view source on GitHub ↗
(self, action)

Source from the content-addressed store, hash-verified

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 = {

Callers 1

run_stepMethod · 0.95

Calls

no outgoing calls

Tested by

no test coverage detected