Mechanical Simulation Corporation has released the 2019.1 versions of the vehicle dynamics simulation tools CarSim, TruckSim and BikeSim, which are well known for providing high-fidelity math models that reproduce physical test results, yet run fast enough on the computer to support real-time simulation with hardware in the loop.
With the growing need by the automotive industry to improve support for ADAS (advanced driver assistance systems) and autonomous driving, there is a corresponding need to provide custom controls for other moving objects in the simulation, such as traffic vehicles and pedestrians. The simulation modules include a scripting language called VS Commands that has been available for controlling moving objects, defining actions based on detected signals, and other applications.
According to James Beyer, Product Development Engineer, “The VS Command language was created before ADAS applications were of interest and was mainly used to define new output variables and provide limited calculations.” With newer versions supporting up to 200 moving objects and 99 ADAS sensors, there has been an increasing need for more options that advanced users may provide to extend the simulation capability.
Using VS Commands, the user can extend models in substantive ways. This is done within the solver framework and needs no external resources. However, VS Commands have limits, and some common programming tools and techniques (looping, strings, accessing third-party packages, etc.) are problematic using only VS Commands.
To support more complicated model extensions made within the solver, VS Solvers have supported an internal (embedded) Python interpreter since 2018.1. Since then, we have continued to make improvements to this capability. In 2019.1, we have added the capability for Linux Solvers and added some simpler examples and additional documentation to show how the embedded Python capability can be used. Currently Embedded Python is not available for RT systems applications.
In addition to the improvements to Embedded Python, VS Commands have been enhanced to allow for defined VS functions that can be created by the user. Defined functions, along with the new IF command, allow for the conditional execution of groups of commands. This allows for simpler, cleaner code when a condition changes during a simulation which requires the updating of several variables. “The good thing about the defined functions,” Beyer notes, “is that they are an enhancement to the VS Commands themselves, and work on all platforms, Windows, Linux, and all of the RT platforms.”