Vissim Connector is a prototype to collaborate with PTV Vissim from MATLAB and Simulink.
Vissim Connector performs following iteration for every simulation ticks:
- Vissim Connector System Object reads ego and other vehicle information stored in Simulink Bus or struct.
- Then Visssim Connector sends information to Vissim to interact with Vissim's traffic simulation.
- After Vissim returns all vehicle information, Vissim Connector identifies which vehicles are ego and other traffics, then return information.
Vissim Connector utilizes Vissim C API. We create:
- A C++ Wrapper Class DLL connecting Vissim C API and C++ Library integration function in MATLAB
- A System Object (Vissim Connector) allowing user to interact with Vissim through MATLAB or Simulink.
- Install Vissim Blockset. Refer to guidance below
- Open
./test/mainWithToolbox.slx
(You don't have to open project file./VissimConnector.prj.
) - Run the Simulink simulation.
- Open
./VissimConnectorDLL/VissimConnectorDLL.sln
with Visual Studio 2019. - Build solution and you will find C++ wrapper class DLL
VissimConnectorDLL.dll
(dynamic link library) andVissimConnectorDLL.lib
(DLL import library, not static library) in./VissimConnectorDLL/x64/Release.
- Open MATLAB project file
./VissimConnector.prj
. - Run
./VissimInterfaceBuild/generateCPPInterface.m
step by step to build and finally you will find auto-generated interface DLLVissimInterfaceInterface.dll
in./VissimInterface.
- (Manual Operation) Create Simulink Library
VissimConnectorLib.slx
from VissimConnector.slx, by copy and paste PTV Vissim Connector block fromVissimConnector.slx
toVissimConnectorLib.slx.
- Run
buildtools/setSLLibSettings.m
to mark the library searchable from Library Browser. - Run
buildtools/copyFilesToBuildDir.m
to gather necessary files into build folderbuild.
- Open
buildtools/Vissim Blockset.prj
. - Click PACKAGE tab > PACKAGE section > Package to make package.
buildtools/Vissim Blockset.mltbx
is generated.
- Launch MATLAB and Open
./distrib/Vissim Blockset N.N.mltbx
from MATLAB to install, where N.N represents version of the Blockset. Toolbox will be automatically installed toC:\Users\Username\AppData\Roaming\MathWorks\MATLAB Add-Ons\Toolboxes.
Tested with following environment:
- Windows 10 21H1
- MATLAB R2021a update 4
- MATLAB
- Simulink
- Automated Driving Toolbox
- PTV Vissim 2021
- Note: API change is expected for every major update of Vissim.
- Visual Studio 2019 (if you want build C++ wrapper class DLL)
.git
: git dirbuild
: working dir to build Simulink Librarybuildtools
: utility scripts to build Simulink Library. See How to build for detail.data
: sample OpenDrive data (xodr,) Driving Scenario Designer session file (.mat) and Vissim scenario file (.inpx.)distrib
: distributable toolbox package (.mltbx)doc
: documents (.ppt) and images for this README.md (.png.)resources
: MATLAB project filestest
: test script (.m) and Simulink model (.slx) working with sample data. See How to use for detail.VissimConnector
: MATLAB system object class (.m,) Simulink model (.slx) and companion scripts (*.m.)VissimConnectorDLL
: a C++ Wrapper class DLL connecting MATLAB auto-generated interface DLL and and Vissim C API (Driving Simulator API.)VissimInterface
: auto-generated interface DLL generated by scripts in VissimInterfaceBuild, connecting MATLAB C++ API and C++ Wrapper class DLL.VissimInterfaceBuild
: script for building auto-generating bridge DLL.README.md
: this file.VisssimConnector.prj
: MATLAB project file.