Skip to content

[BUG] Python client as both ApplicationLayer and XilClient may not work in SUMO #84

@yunlishao

Description

@yunlishao

Describe the bug
When a Python script attempts to function as both a second client (ApplicationSetup) AND Application Layer controller, the dual-role architecture may cause conflicts in SUMO with EnableExternalDynamics: true.

To Reproduce

  1. Configure config.yaml with both ApplicationSetup.VehicleSubscription and XilSetup.VehicleSubscription for same vehicle
  2. Run TrafficLayer.exe with SUMO
  3. Start Python script connecting to both ports (e.g., port 2444 for app layer, port 420 for XIL)
  4. Observe potential socket synchronization issues or conflicting vehicle control commands

Expected Behavior
System should either:

  • Handle dual-role clients with clear precedence, OR
  • Detect and reject such configurations, OR
  • Document the correct pattern

Current Architecture Issues

  • Python echo clients (tests/Python/SimpleEchoClient) only act as ApplicationLayer
  • Python controllers (tests/Applications/Eco_Fixed_Timming/eco_driving_mpr_SUMO.py) directly connect
  • No clear example if single Python instance can do both roles
  • With SUMO EnableExternalDynamics: true, control conflicts likely

Environment

  • Python version: 3.8+
  • SUMO version: 1.21

Additional context
Affects scenarios where researchers want to:

  1. Receive broader vehicle data via ApplicationSetup (radius-based)
  2. Send control commands to ego vehicle(s)
  3. Do both from single Python application

Related files:

  • CommonLib/SocketHelper.py
  • TrafficLayer/TrafficLayer/mainTrafficLayer.cpp

Metadata

Metadata

Labels

bugSomething isn't working

Type

No type

Projects

No projects

Relationships

None yet

Development

No branches or pull requests

Issue actions