-
Notifications
You must be signed in to change notification settings - Fork 5
#55 #56/migrate to libtraci libsumo #69
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Merged
Merged
Conversation
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
- Replace TraCIAPI client with libtraci static API - Update all traci method calls to use libtraci namespace - Use libtraci::Simulation::init() for connection instead of traci.connect() - Update Vehicle, Lane, Edge, TrafficLight, POI, and other domain APIs - Remove commented-out TraCIAPI includes
- Remove traci/socket.cpp, traci/storage.cpp, traci/TraCIAPI.cpp - Remove traci header files (socket.h, storage.h, TraCIAPI.h, TraCIConstants.h, TraCIDefs.h) - Update include directories from traci to libsumo - Update library directories from traci to libsumo
- Delete CommonLib/traci folder with old TraCIAPI implementation - Remove traci include directory from VirCarlaEnv.vcxproj - All projects now use libtraci/libsumo instead of plain TraCI
- Add dependencies.yaml to track external simulator versions - Create update_libsumo.ps1 script to sync libsumo files, DLLs, and import libraries from SUMO releases - Update all libsumo source files from SUMO v1.22.0 - Update TrafficLayer.vcxproj to use libtracicpp.lib import library - Add fallback logic in post-build events to use release DLLs when debug DLLs are unavailable
Add section documenting dependencies.yaml and update_libsumo.ps1 script for managing external dependency versions
Add try-catch block around libtraci::Simulation::init() to provide clearer diagnostics when connection fails. This helps identify connection issues with the SUMO server (wrong IP, port, or server not running).
…tion - Move getConfig() before connectionSetup() to populate VehicleMessageField_set early - Only retrieve speed limits if speedLimit or speedLimitNext is defined in VehicleMessageField - Add comments explaining the optimization logic - Preserves vehClassList retrieval as it's needed regardless of speed limit configuration
- Rename build_sumo_debug_dlls.ps1 to build_libsumo.ps1 - Update script to build both Release and Debug configurations - Add header file copying from SUMO source (libsumo.h,1 libtraci.h) - Remove 60+ unnecessary libsumo source files (.cpp, .h) - Keep only essential files: DLLs, .lib files, and 2 required headers - Update TrafficLayer.vcxproj include paths This reduces CommonLib/libsumo from 69MB to 68MB and keeps only what's needed for compilation.
…e update script - Keep SUMO and SUMOLibraries clones in tmp/ for faster future builds - Only clean up CMake build artifacts, not source repositories - Remove update_libsumo.ps1 (functionality now in build_libsumo.ps1) - Update user messages to reflect new caching behavior
- Debug builds (Win32/x64): Link against libsumocppD.lib and libtracicppD.lib - Release builds (Win32/x64): Link against libsumocpp.lib and libtracicpp.lib - Add new libsumo header files to repository
Added new SumoSetup configuration fields: - EnableAutoLaunch: Toggle automatic SUMO startup - SumoConfigFile: Path to .sumocfg file - NumClients: Support for multiple TraCI clients Implementation includes two launch options: - Option A (commented): Direct libsumo integration (headless) - Option B (active): External sumo-gui process with cross-platform support Updated batch script to automatically detect EnableAutoLaunch setting and skip manual SUMO launch when enabled. Platform support: Windows (start /B) and Linux (background &)
Changed log file operations from binary mode to text mode with explicit UTF-8 encoding to prevent garbled output on Windows systems where default encoding may vary.
- Remove debug print statements from TrafficHelper and mainTrafficLayer - Add EnableExternalDynamics flag to config - Add configurable verbose logging to SimpleEchoClient - Reduce console output by printing basic info every 100 steps
Changes: - build_libsumo.ps1: Copy xerces-c, zlib, proj DLLs to CommonLib/libsumo - TrafficLayer.vcxproj: Post-build events copy runtime DLLs from CommonLib/libsumo - TrafficHelper: Fix compile-time macro checks (#if -> #ifdef) - TrafficHelper: Replace std::this_thread with platform-specific Sleep This ensures all SUMO runtime dependencies are available when running TrafficLayer, resolving "xerces-c_3_3D.dll was not found" errors without requiring PATH setup.
…tory - build_libsumo.ps1: Clean up old CommonLib/libsumo before copying - build_libsumo.ps1: Copy only .lib files to root, all DLLs to bin/ - Eliminates duplicate DLLs (libsumocpp, libtracicpp) - Structure: bin/ contains all runtime DLLs, root contains .lib and .h files
- Update linker paths in vcxproj to point to CommonLib/libsumo/bin - Remove post-build DLL copy events (no longer needed) - Add runtime library path discovery in mainTrafficLayer - Support RuntimeLibraryPath configuration override - Update documentation with new path conventions - Switch to libtraci by default (disable ENABLE_LIBSUMO)
- Configure delay-load for libtraci and libsumo DLLs in both Debug and Release - Add build configuration display (DEBUG/RELEASE) to version banner - Update test script to use Release build
- Add filesystem path resolution in ConfigHelper - Convert relative SumoConfigFile paths to absolute paths based on config file location - Add error message pause in TrafficHelper for debugging - Improve exception handling output in mainTrafficLayer
This was referenced Oct 17, 2025
- Replace outdated update_libsumo.ps1 documentation with build_libsumo.ps1 - Add detailed usage examples and requirements for build script - Document SumoSetup configuration section with auto-launch options - Add example configuration for SUMO auto-launch
cjffly
approved these changes
Oct 17, 2025
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
Summary
Migrated TrafficLayer from the deprecated plain TraCI API to modern libtraci/libsumo libraries. Added automated build scripts for SUMO library management and improved runtime DLL discovery.
Related Issues / Tasks
Closes #55
Closes #56
Type of Change
Affected Modules / Components
CommonLib/TrafficHelper.cpp- Updated to use libsumo/libtraci namespacesCommonLib/ConfigHelper.cpp- Added SUMO config path resolutionTrafficLayer/mainTrafficLayer.cpp- Added DLL discovery and error handlingCommonLib/libsumo/- Updated to SUMO 1.22.0Key Changes
Library Migration
Build Infrastructure
build_libsumo.ps1for automated SUMO library compilationConfiguration Improvements
SumoSetupsection in YAML config for auto-launch settingsEnableAutoLaunchoption for automated SUMO startupDeveloper Experience
CommonLib/libsumo/bin/Test Cases
tests/Python/SimpleEchoClient/configurationEnvironment
Checklist
Additional Notes
Known Limitations:
Breaking Changes:
SumoSetupsection for auto-launchMigration Path:
Existing users can continue using manual SUMO startup by setting
EnableAutoLaunch: falsein the configuration file.