Skip to content

Commit

Permalink
added test refs #21, #15282
Browse files Browse the repository at this point in the history
  • Loading branch information
namdre committed Feb 12, 2025
1 parent 4ef260c commit b04b23a
Show file tree
Hide file tree
Showing 6 changed files with 54 additions and 3 deletions.
9 changes: 6 additions & 3 deletions tests/complex/traci/vehicle/moveToXY/testsuite.complex
Original file line number Diff line number Diff line change
Expand Up @@ -59,11 +59,14 @@ guess_next_edge_keepRoute2
# move vehicle against eddge direction
guess_next_edge_keepRoute2_reverse

# moveToXY and opposite direction driving
ticket5029

# test collision directly after moveToXY (#10952)
collision

# use vClass when looking up candidate internal edges along the route (#10952)
parallel_internal_edges

# moveToXY and opposite direction driving
ticket5029

# distance from lane center should be less relevant than angle if the vehicle is fully on the lane
ticket15282
Empty file.
Original file line number Diff line number Diff line change
@@ -0,0 +1,3 @@
<routes>
<route id="r0" edges="SC CN"/>
</routes>
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
tests/complex/traci/vehicle/moveToXY/ticket15282/runner.py
Original file line number Diff line number Diff line change
@@ -0,0 +1,2 @@
Retrying in 1 seconds
:C_6_0
42 changes: 42 additions & 0 deletions tests/complex/traci/vehicle/moveToXY/ticket15282/runner.py
Original file line number Diff line number Diff line change
@@ -0,0 +1,42 @@
#!/usr/bin/env python
# -*- coding: utf-8 -*-
# Eclipse SUMO, Simulation of Urban MObility; see https://eclipse.dev/sumo
# Copyright (C) 2008-2025 German Aerospace Center (DLR) and others.
# This program and the accompanying materials are made available under the
# terms of the Eclipse Public License 2.0 which is available at
# https://www.eclipse.org/legal/epl-2.0/
# This Source Code may also be made available under the following Secondary
# Licenses when the conditions for such availability set forth in the Eclipse
# Public License 2.0 are satisfied: GNU General Public License, version 2
# or later which is available at
# https://www.gnu.org/licenses/old-licenses/gpl-2.0-standalone.html
# SPDX-License-Identifier: EPL-2.0 OR GPL-2.0-or-later

# @file runner.py
# @author Jakob Erdmann
# @date 2018-09-27

import os
import sys

if "SUMO_HOME" in os.environ:
sys.path.append(os.path.join(os.environ["SUMO_HOME"], "tools"))

import traci # noqa
import sumolib # noqa

sumoBinary = sumolib.checkBinary('sumo')
traci.start([sumoBinary,
"-n", "input_net2.net.xml",
"-r", "input_routes.rou.xml",
"--step-length", "0.1",
"--no-step-log",
])
vehID = "v0"
traci.vehicle.add(vehID, "r0")
traci.simulationStep()

traci.vehicle.moveToXY(vehID, ":C_11", 0, 103.51, 104.93, traci.vehicle.getAngle(vehID), keepRoute=2)
traci.simulationStep()
print(traci.vehicle.getLaneID(vehID))
traci.close()

0 comments on commit b04b23a

Please sign in to comment.