From b04b23a0b7adbbd45298be43a9b85334650380eb Mon Sep 17 00:00:00 2001 From: Jakob Erdmann Date: Wed, 12 Feb 2025 11:38:31 +0100 Subject: [PATCH] added test refs #21, #15282 --- .../traci/vehicle/moveToXY/testsuite.complex | 9 ++-- .../moveToXY/ticket15282/errors.complex | 0 .../moveToXY/ticket15282/input_routes.rou.xml | 3 ++ .../moveToXY/ticket15282/options.complex | 1 + .../moveToXY/ticket15282/output.complex | 2 + .../vehicle/moveToXY/ticket15282/runner.py | 42 +++++++++++++++++++ 6 files changed, 54 insertions(+), 3 deletions(-) create mode 100644 tests/complex/traci/vehicle/moveToXY/ticket15282/errors.complex create mode 100644 tests/complex/traci/vehicle/moveToXY/ticket15282/input_routes.rou.xml create mode 100644 tests/complex/traci/vehicle/moveToXY/ticket15282/options.complex create mode 100644 tests/complex/traci/vehicle/moveToXY/ticket15282/output.complex create mode 100755 tests/complex/traci/vehicle/moveToXY/ticket15282/runner.py diff --git a/tests/complex/traci/vehicle/moveToXY/testsuite.complex b/tests/complex/traci/vehicle/moveToXY/testsuite.complex index 2d83ffab1758..4efaf51d440d 100644 --- a/tests/complex/traci/vehicle/moveToXY/testsuite.complex +++ b/tests/complex/traci/vehicle/moveToXY/testsuite.complex @@ -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 diff --git a/tests/complex/traci/vehicle/moveToXY/ticket15282/errors.complex b/tests/complex/traci/vehicle/moveToXY/ticket15282/errors.complex new file mode 100644 index 000000000000..e69de29bb2d1 diff --git a/tests/complex/traci/vehicle/moveToXY/ticket15282/input_routes.rou.xml b/tests/complex/traci/vehicle/moveToXY/ticket15282/input_routes.rou.xml new file mode 100644 index 000000000000..17057871eaaf --- /dev/null +++ b/tests/complex/traci/vehicle/moveToXY/ticket15282/input_routes.rou.xml @@ -0,0 +1,3 @@ + + + diff --git a/tests/complex/traci/vehicle/moveToXY/ticket15282/options.complex b/tests/complex/traci/vehicle/moveToXY/ticket15282/options.complex new file mode 100644 index 000000000000..0315a5379de5 --- /dev/null +++ b/tests/complex/traci/vehicle/moveToXY/ticket15282/options.complex @@ -0,0 +1 @@ +tests/complex/traci/vehicle/moveToXY/ticket15282/runner.py \ No newline at end of file diff --git a/tests/complex/traci/vehicle/moveToXY/ticket15282/output.complex b/tests/complex/traci/vehicle/moveToXY/ticket15282/output.complex new file mode 100644 index 000000000000..8dab71e3106f --- /dev/null +++ b/tests/complex/traci/vehicle/moveToXY/ticket15282/output.complex @@ -0,0 +1,2 @@ + Retrying in 1 seconds +:C_6_0 diff --git a/tests/complex/traci/vehicle/moveToXY/ticket15282/runner.py b/tests/complex/traci/vehicle/moveToXY/ticket15282/runner.py new file mode 100755 index 000000000000..b2f330307196 --- /dev/null +++ b/tests/complex/traci/vehicle/moveToXY/ticket15282/runner.py @@ -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()