-
Notifications
You must be signed in to change notification settings - Fork 12
Expand file tree
/
Copy pathagent.py
More file actions
40 lines (35 loc) · 1.45 KB
/
Copy pathagent.py
File metadata and controls
40 lines (35 loc) · 1.45 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
import carla
import time
class Agent():
def __init__(self, vehicle=None):
self.vehicle = vehicle
def run_step(self, filtered_obstacles, waypoints, vel, transform, boundary):
"""
Execute one step of navigation.
Args:
filtered_obstacles
- Type: List[carla.Actor(), ...]
- Description: All actors except for EGO within sensoring distance
waypoints
- Type: List[[x,y,z], ...]
- Description: List All future waypoints to reach in (x,y,z) format
vel
- Type: carla.Vector3D
- Description: Ego's current velocity in (x, y, z) in m/s
transform
- Type: carla.Transform
- Description: Ego's current transform
boundary
- Type: List[List[left_boundry], List[right_boundry]]
- Description: left/right boundary each consists of 20 waypoints,
they defines the track boundary of the next 20 meters.
Return: carla.VehicleControl()
"""
# Actions to take during each simulation step
# Feel Free to use carla API; however, since we already provide info to you, using API will only add to your delay time
# Currently the timeout is set to 10s
#
print("Reach Customized Agent")
control = carla.VehicleControl()
control.throttle = 0.5
return control