@@ -69,7 +69,7 @@ def test_NPC_follow_lane(self): #Check if NPC can follow lane
6969 agentState = agent .state
7070 self .assertGreater (agentState .speed , 0 )
7171 # self.assertAlmostEqual(agent.state.speed, 5.6, delta=1)
72- self .assertLess (agent .state .position .x - sim .get_spawn ()[0 ].position .x , 5.6 )
72+ self .assertLess (agent .state .position .x - sim .get_spawn ()[0 ].position .x , 5.6 * 2 )
7373
7474 def test_rotate_NPC (self ): # Check if NPC can be rotated
7575 with SimConnection () as sim :
@@ -78,11 +78,11 @@ def test_rotate_NPC(self): # Check if NPC can be rotated
7878 state .transform .position = state .position - 5 * right
7979 sim .add_agent ("Jaguar2015XE (Apollo 3.0)" , lgsvl .AgentType .EGO , state )
8080 agent = self .create_NPC (sim , "SUV" )
81- self .assertAlmostEqual (agent .state .transform .rotation .y , 194 .823394 , places = 3 )
81+ self .assertAlmostEqual (agent .state .transform .rotation .y , 104 .823394 , places = 3 )
8282 x = agent .state
83- x .transform .rotation .y = 100
83+ x .transform .rotation .y = 10
8484 agent .state = x
85- self .assertAlmostEqual (agent .state .transform .rotation .y , 100 , delta = 0.1 )
85+ self .assertAlmostEqual (agent .state .transform .rotation .y , 10 , delta = 0.1 )
8686
8787 def test_blank_agent (self ): # Check that an exception is raised if a blank name is given
8888 with SimConnection () as sim :
@@ -299,10 +299,10 @@ def test_spawn_speed(self): # Checks that a spawned agent keeps the correct spee
299299 def test_lane_change_right (self ):
300300 with SimConnection (40 ) as sim :
301301 state = lgsvl .AgentState ()
302- state .transform = sim .map_point_on_lane (lgsvl .Vector (40.85 , - 1.57 , - 4.49 ))
302+ state .transform = sim .map_point_on_lane (lgsvl .Vector (4.49 , - 1.57 , 40.85 ))
303303 npc = sim .add_agent ("SUV" , lgsvl .AgentType .NPC , state )
304304
305- state .transform = sim .map_point_on_lane (lgsvl .Vector (42.73 , - 1.57 , - 0.63 ))
305+ state .transform = sim .map_point_on_lane (lgsvl .Vector (0.63 , - 1.57 , 42.73 ))
306306 sim .add_agent ("Jaguar2015XE (Apollo 3.0)" , lgsvl .AgentType .EGO , state )
307307 forward = lgsvl .utils .transform_to_forward (state .transform )
308308 target = state .position + 31 * forward
@@ -324,12 +324,12 @@ def on_lane_change(agent):
324324 def test_lane_change_right_missing_lane (self ):
325325 with SimConnection (40 ) as sim :
326326 state = lgsvl .AgentState ()
327- state .transform = sim .map_point_on_lane (lgsvl .Vector (42.73 , - 1.57 , - 0.63 ))
327+ state .transform = sim .map_point_on_lane (lgsvl .Vector (0.63 , - 1.57 , 42.73 ))
328328 npc = sim .add_agent ("Hatchback" , lgsvl .AgentType .NPC , state )
329329 forward = lgsvl .utils .transform_to_forward (state .transform )
330330 target = state .position + 42.75 * forward
331331
332- state .transform = sim .map_point_on_lane (lgsvl .Vector (40.85 , - 1.57 , - 4.49 ))
332+ state .transform = sim .map_point_on_lane (lgsvl .Vector (4.49 , - 1.57 , 40.85 ))
333333 sim .add_agent ("Jaguar2015XE (Apollo 3.0)" , lgsvl .AgentType .EGO , state )
334334
335335 npc .follow_closest_lane (True , 10 )
@@ -349,10 +349,10 @@ def on_lane_change(agent):
349349 def test_lane_change_left (self ):
350350 with SimConnection (40 ) as sim :
351351 state = lgsvl .AgentState ()
352- state .transform = sim .map_point_on_lane (lgsvl .Vector (40.85 , - 1.57 , - 4.49 ))
352+ state .transform = sim .map_point_on_lane (lgsvl .Vector (4.49 , - 1.57 , 40.85 ))
353353 npc = sim .add_agent ("SUV" , lgsvl .AgentType .NPC , state )
354354
355- state .transform = sim .map_point_on_lane (lgsvl .Vector (42.02 , - 1.79 , - 9.82 ))
355+ state .transform = sim .map_point_on_lane (lgsvl .Vector (9.82 , - 1.79 , 42.02 ))
356356 sim .add_agent ("Jaguar2015XE (Apollo 3.0)" , lgsvl .AgentType .EGO , state )
357357 forward = lgsvl .utils .transform_to_forward (state .transform )
358358 target = state .position + 31 * forward
@@ -374,7 +374,7 @@ def on_lane_change(agent):
374374 def test_lane_change_left_opposing_traffic (self ):
375375 with SimConnection (40 ) as sim :
376376 state = lgsvl .AgentState ()
377- state .transform = sim .map_point_on_lane (lgsvl .Vector (- 40.292 , - 3.363 , - 78.962 ))
377+ state .transform = sim .map_point_on_lane (lgsvl .Vector (78.962 , - 3.363 , - 40.292 ))
378378 npc = sim .add_agent ("SUV" , lgsvl .AgentType .NPC , state )
379379 forward = lgsvl .utils .transform_to_forward (state .transform )
380380 target = state .position + 42.75 * forward
@@ -400,13 +400,13 @@ def on_lane_change(agent):
400400 def test_multiple_lane_changes (self ):
401401 with SimConnection (120 ) as sim :
402402 state = lgsvl .AgentState ()
403- state .transform .position = lgsvl .Vector (239 ,10 ,180 )
404- state .transform .rotation = lgsvl .Vector (0 ,180 ,0 )
403+ state .transform .position = lgsvl .Vector (- 180 ,10 ,239 )
404+ state .transform .rotation = lgsvl .Vector (0 ,90 ,0 )
405405 sim .add_agent ("XE_Rigged-apollo" , lgsvl .AgentType .EGO , state )
406406
407407 state = lgsvl .AgentState ()
408- state .transform .position = lgsvl .Vector (234.5 , 10 , 175 )
409- state .transform .rotation = lgsvl .Vector (0.016 , 180 , 0 )
408+ state .transform .position = lgsvl .Vector (- 175 , 10 , 234.5 )
409+ state .transform .rotation = lgsvl .Vector (0 , 90 , 0.016 )
410410 npc = sim .add_agent ("Sedan" , lgsvl .AgentType .NPC , state )
411411
412412 npc .follow_closest_lane (True , 10 )
@@ -455,9 +455,9 @@ def test_npc_control_exceptions(self):
455455 npc .apply_control (control )
456456
457457 def test_e_stop (self ):
458- with SimConnection () as sim :
458+ with SimConnection (60 ) as sim :
459459 state = lgsvl .AgentState ()
460- state .transform = sim .map_point_on_lane (lgsvl .Vector (- 40.292 , - 3.363 , - 78.962 ))
460+ state .transform = sim .map_point_on_lane (lgsvl .Vector (78.962 , - 3.363 , - 40.292 ))
461461 sim .add_agent ("Jaguar2015XE (Apollo 3.0)" , lgsvl .AgentType .EGO , state )
462462 forward = lgsvl .utils .transform_to_forward (state .transform )
463463 state .transform .position = state .position + 10 * forward
@@ -478,7 +478,7 @@ def test_e_stop(self):
478478 def test_waypoint_speed (self ):
479479 with SimConnection (60 ) as sim :
480480 state = lgsvl .AgentState ()
481- state .transform = sim .map_point_on_lane (lgsvl .Vector (- 40.292 , - 3.363 , - 78.962 ))
481+ state .transform = sim .map_point_on_lane (lgsvl .Vector (78.962 , - 3.363 , - 40.292 ))
482482 sim .add_agent ("Jaguar2015XE (Apollo 3.0)" , lgsvl .AgentType .EGO , state )
483483 forward = lgsvl .utils .transform_to_forward (state .transform )
484484 up = lgsvl .utils .transform_to_up (state .transform )
0 commit comments