Skip to content

Commit a44ba3b

Browse files
Edit scripts to use new maps, vehicles, and positions
1 parent 5a3a5a5 commit a44ba3b

File tree

6 files changed

+28
-46
lines changed

6 files changed

+28
-46
lines changed

examples/NHTSA-sample-tests/Encroaching-Oncoming-Vehicles/EOV_S_25_20.py

Lines changed: 8 additions & 14 deletions
Original file line numberDiff line numberDiff line change
@@ -15,38 +15,32 @@
1515

1616
MAX_EGO_SPEED = 11.111 # (40 km/h, 25 mph)
1717
MAX_POV_SPEED = 8.889 # (32 km/h, 20 mph)
18-
INITIAL_HEADWAY = 30
18+
INITIAL_HEADWAY = 100 # spec says >30m
1919
SPEED_VARIANCE = 4
2020
TIME_LIMIT = 30
2121
TIME_DELAY = 3
2222

2323
print("EOV_S_25_20 - ", end = '')
2424

2525
sim = lgsvl.Simulator(os.environ.get("SIMULATOR_HOST", "127.0.0.1"), 8181)
26-
if sim.current_scene == "SanFrancisco":
26+
if sim.current_scene == "SingleLaneRoad":
2727
sim.reset()
2828
else:
29-
sim.load("SanFrancisco")
29+
sim.load("SingleLaneRoad")
3030

3131
# spawn EGO in the 2nd to right lane
3232
egoState = lgsvl.AgentState()
3333
# A point close to the desired lane was found in Editor. This method returns the position and orientation of the closest lane to the point.
34-
egoState.transform = sim.map_point_on_lane(lgsvl.Vector(218, 9.9, 4.3))
35-
ego = sim.add_agent("XE_Rigged-apollo_3_5", lgsvl.AgentType.EGO, egoState)
36-
37-
# enable sensors required for Apollo 3.5
38-
sensors = ego.get_sensors()
39-
for s in sensors:
40-
if s.name in ['velodyne', 'Main Camera', 'Telephoto Camera', 'GPS', 'IMU']:
41-
s.enabled = True
34+
egoState.transform = sim.get_spawn()[0]
35+
ego = sim.add_agent("Jaguar2015XE (Apollo 5.0)", lgsvl.AgentType.EGO, egoState)
4236

4337
ego.connect_bridge(os.environ.get("BRIDGE_HOST", "127.0.0.1"), 9090)
4438

45-
finalPOVWaypointPosition = lgsvl.Vector(218, 9.9, 2.207)
39+
finalPOVWaypointPosition = lgsvl.Vector(0, 0, -125)
4640

4741
POVState = lgsvl.AgentState()
48-
POVState.transform.position = lgsvl.Vector(finalPOVWaypointPosition.x - 4.5 - INITIAL_HEADWAY, finalPOVWaypointPosition.y, finalPOVWaypointPosition.z)
49-
POVState.transform.rotation = lgsvl.Vector(0, 90, 0)
42+
POVState.transform.position = lgsvl.Vector(finalPOVWaypointPosition.x, finalPOVWaypointPosition.y, finalPOVWaypointPosition.z + 4.5 + INITIAL_HEADWAY)
43+
POVState.transform.rotation = lgsvl.Vector(0, 180, 0)
5044
POV = sim.add_agent("Sedan", lgsvl.AgentType.NPC, POVState)
5145

5246
POVWaypoints = []

examples/NHTSA-sample-tests/Encroaching-Oncoming-Vehicles/EOV_S_45_40.py

Lines changed: 8 additions & 14 deletions
Original file line numberDiff line numberDiff line change
@@ -15,38 +15,32 @@
1515

1616
MAX_EGO_SPEED = 20 # (72 km/h, 45 mph)
1717
MAX_POV_SPEED = 17.778 # (64 km/h, 40 mph)
18-
INITIAL_HEADWAY = 68
18+
INITIAL_HEADWAY = 150 # spec says >68m
1919
SPEED_VARIANCE = 4
2020
TIME_LIMIT = 30
2121
TIME_DELAY = 4
2222

2323
print("EOV_S_45_40 - ", end = '')
2424

2525
sim = lgsvl.Simulator(os.environ.get("SIMULATOR_HOST", "127.0.0.1"), 8181)
26-
if sim.current_scene == "SanFrancisco":
26+
if sim.current_scene == "SingleLaneRoad":
2727
sim.reset()
2828
else:
29-
sim.load("SanFrancisco")
29+
sim.load("SingleLaneRoad")
3030

3131
# spawn EGO in the 2nd to right lane
3232
egoState = lgsvl.AgentState()
3333
# A point close to the desired lane was found in Editor. This method returns the position and orientation of the closest lane to the point.
34-
egoState.transform = sim.map_point_on_lane(lgsvl.Vector(218, 9.9, 4.3))
35-
ego = sim.add_agent("XE_Rigged-apollo_3_5", lgsvl.AgentType.EGO, egoState)
36-
37-
# enable sensors required for Apollo 3.5
38-
sensors = ego.get_sensors()
39-
for s in sensors:
40-
if s.name in ['velodyne', 'Main Camera', 'Telephoto Camera', 'GPS', 'IMU']:
41-
s.enabled = True
34+
egoState.transform = sim.get_spawn()[0]
35+
ego = sim.add_agent("Jaguar2015XE (Apollo 5.0)", lgsvl.AgentType.EGO, egoState)
4236

4337
ego.connect_bridge(os.environ.get("BRIDGE_HOST", "127.0.0.1"), 9090)
4438

45-
finalPOVWaypointPosition = lgsvl.Vector(218, 9.9, 2.207)
39+
finalPOVWaypointPosition = lgsvl.Vector(0, 0, -125)
4640

4741
POVState = lgsvl.AgentState()
48-
POVState.transform.position = lgsvl.Vector(finalPOVWaypointPosition.x - 4.5 - INITIAL_HEADWAY, finalPOVWaypointPosition.y, finalPOVWaypointPosition.z)
49-
POVState.transform.rotation = lgsvl.Vector(0, 90, 0)
42+
POVState.transform.position = lgsvl.Vector(finalPOVWaypointPosition.x, finalPOVWaypointPosition.y, finalPOVWaypointPosition.z + 4.5 + INITIAL_HEADWAY)
43+
POVState.transform.rotation = lgsvl.Vector(0, 180, 0)
5044
POV = sim.add_agent("Sedan", lgsvl.AgentType.NPC, POVState)
5145

5246
POVWaypoints = []

examples/NHTSA-sample-tests/Encroaching-Oncoming-Vehicles/EOV_S_65_60.py

Lines changed: 8 additions & 14 deletions
Original file line numberDiff line numberDiff line change
@@ -15,38 +15,32 @@
1515

1616
MAX_EGO_SPEED = 29.167 # (105 km/h, 65 mph)
1717
MAX_POV_SPEED = 26.667 # (96 km/h, 60 mph)
18-
INITIAL_HEADWAY = 105
18+
INITIAL_HEADWAY = 200 # spec says >105m
1919
SPEED_VARIANCE = 4
2020
TIME_LIMIT = 30
2121
TIME_DELAY = 5
2222

2323
print("EOV_S_65_60 - ", end = '')
2424

2525
sim = lgsvl.Simulator(os.environ.get("SIMULATOR_HOST", "127.0.0.1"), 8181)
26-
if sim.current_scene == "SanFrancisco":
26+
if sim.current_scene == "SingleLaneRoad":
2727
sim.reset()
2828
else:
29-
sim.load("SanFrancisco")
29+
sim.load("SingleLaneRoad")
3030

3131
# spawn EGO in the 2nd to right lane
3232
egoState = lgsvl.AgentState()
3333
# A point close to the desired lane was found in Editor. This method returns the position and orientation of the closest lane to the point.
34-
egoState.transform = sim.map_point_on_lane(lgsvl.Vector(218, 9.9, 4.3))
35-
ego = sim.add_agent("XE_Rigged-apollo_3_5", lgsvl.AgentType.EGO, egoState)
36-
37-
# enable sensors required for Apollo 3.5
38-
sensors = ego.get_sensors()
39-
for s in sensors:
40-
if s.name in ['velodyne', 'Main Camera', 'Telephoto Camera', 'GPS', 'IMU']:
41-
s.enabled = True
34+
egoState.transform = sim.get_spawn()[0]
35+
ego = sim.add_agent("Jaguar2015XE (Apollo 5.0)", lgsvl.AgentType.EGO, egoState)
4236

4337
ego.connect_bridge(os.environ.get("BRIDGE_HOST", "127.0.0.1"), 9090)
4438

45-
finalPOVWaypointPosition = lgsvl.Vector(218, 9.9, 2.207)
39+
finalPOVWaypointPosition = lgsvl.Vector(0, 0, -125)
4640

4741
POVState = lgsvl.AgentState()
48-
POVState.transform.position = lgsvl.Vector(finalPOVWaypointPosition.x - 4.5 - INITIAL_HEADWAY, finalPOVWaypointPosition.y, finalPOVWaypointPosition.z)
49-
POVState.transform.rotation = lgsvl.Vector(0, 90, 0)
42+
POVState.transform.position = lgsvl.Vector(finalPOVWaypointPosition.x, finalPOVWaypointPosition.y, finalPOVWaypointPosition.z + 4.5 + INITIAL_HEADWAY)
43+
POVState.transform.rotation = lgsvl.Vector(0, 180, 0)
5044
POV = sim.add_agent("Sedan", lgsvl.AgentType.NPC, POVState)
5145

5246
POVWaypoints = []

examples/NHTSA-sample-tests/Vehicle-Following/VF_S_25_Slow.py

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -29,11 +29,11 @@
2929
else:
3030
sim.load("SingleLaneRoad")
3131

32-
# sim.set_time_of_day(12)
32+
sim.set_time_of_day(12)
3333
# spawn EGO in the 2nd to right lane
3434
egoState = lgsvl.AgentState()
3535
egoState.transform = sim.get_spawn()[0]
36-
ego = sim.add_agent("Jaguar2015XE (Apollo 3.5)", lgsvl.AgentType.EGO, egoState)
36+
ego = sim.add_agent("Jaguar2015XE (Apollo 5.0)", lgsvl.AgentType.EGO, egoState)
3737
egoX = ego.state.position.x
3838
egoY = ego.state.position.y
3939
egoZ = ego.state.position.z

examples/NHTSA-sample-tests/Vehicle-Following/VF_S_45_Slow.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -32,7 +32,7 @@
3232
# spawn EGO in the 2nd to right lane
3333
egoState = lgsvl.AgentState()
3434
egoState.transform = sim.get_spawn()[0]
35-
ego = sim.add_agent("Jaguar2015XE (Apollo 3.5)", lgsvl.AgentType.EGO, egoState)
35+
ego = sim.add_agent("Jaguar2015XE (Apollo 5.0)", lgsvl.AgentType.EGO, egoState)
3636
egoX = ego.state.position.x
3737
egoY = ego.state.position.y
3838
egoZ = ego.state.position.z

examples/NHTSA-sample-tests/Vehicle-Following/VF_S_65_Slow.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -32,7 +32,7 @@
3232
# spawn EGO in the 2nd to right lane
3333
egoState = lgsvl.AgentState()
3434
egoState.transform = sim.get_spawn()[0]
35-
ego = sim.add_agent("Jaguar2015XE (Apollo 3.5)", lgsvl.AgentType.EGO, egoState)
35+
ego = sim.add_agent("Jaguar2015XE (Apollo 5.0)", lgsvl.AgentType.EGO, egoState)
3636
egoX = ego.state.position.x
3737
egoY = ego.state.position.y
3838
egoZ = ego.state.position.z

0 commit comments

Comments
 (0)