Socket
Book a DemoInstallSign in
Socket

velocitas-model-generator

Package Overview
Dependencies
Maintainers
3
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

velocitas-model-generator

Generates a language-specific data model out of VSS vspec files

0.8.0
pipPyPI
Maintainers
3

Velocitas Vehicle Model Generator

License: Apache

About

This generator creates a vehicle model from the given vspec specification for the target programming language.

Supported languages

  • Python 3
  • C++

HINT: C++ model generated by model generator versions >= 0.8.0 require C++ SDK versions >= 0.5.5 !

Supported VSS versions

  • 3.x
  • 4.x

Usage

Invoke the src/velocitas/model_generator/cli.py script with the path to the vspec or json file you wish to generate code for, additionally passing include pathes to directories which contain referenced vspec files. You need a units.yaml in the same directory. If you want to use the default one see here. For stability use release branch with tags. For example branch release/4.0.

python3 src/velocitas/model_generator/cli.py -I <path_to_dir_with_included_vspec_files> <path_to_your_vspec_file>

or

python3 src/velocitas/model_generator/cli.py <path_to_your_json_file>

Example

git clone -b v3.1 https://github.com/COVESA/vehicle_signal_specification.git
python3 src/velocitas/model_generator/cli.py -I ./vehicle_signal_specification/spec ./vehicle_signal_specification/spec/VehicleSignalSpecification.vspec

Or use VSCode Launch: Press F5, select Python or cpp and pass in the include directory and input file path.

Arguments

ArgumentDescription
-h, --helpshow this help message and exit
-I dir, --include-dir dirAdd include directory to search for included vspec files.
-T TARGET_FOLDER, --target-folder TARGET_FOLDERThe folder name (with relative path) where the code will be generated into.
-N PACKAGE_NAME, --package-name PACKAGE_NAMEName of the root module/package (Python) or root namespace (C++).
-s, --strictUse strict checking: Terminate when anything not covered or not recommended by the core VSS specs is found.
-l {python}, --language {python}The target language of the generated code.
-o OVERLAY_FILE, --overlays OVERLAY_FILEAdd overlays that will be layered on top of the VSS file in the order they appear.
-u UNITS, --units UNITSThe file location of units file. If left empty it tries downloading default units file from https://github.com/COVESA/vehicle_signal_specification/blob/v4.0/spec/units.yaml.
-e EXTENDED_ATTRIBUTES,
--extended-attributes EXTENDED_ATTRIBUTES
Whitelisted extended attributes as comma separated list. Note, that extended attributes aren't considered by the generator. This paramter is only for suppressing warnings/errors."

Known issues

VSS v3.0 has a typo in its specification. This clashes with vss tools 4.0 which is needed to support VSS v4.0 because it allows only lower case versions for types of signals. e.g the problem is with 'actuator' instead of 'Actuator' in https://github.com/COVESA/vehicle_signal_specification/blob/525e2bd00ddf061851bdc75e849178e5d3ad5833/spec/Powertrain/Battery.vspec#L229. Json files work just fine. See https://github.com/COVESA/vehicle_signal_specification/releases for getting the json files.

Contribution

FAQs

Did you know?

Socket

Socket for GitHub automatically highlights issues in each pull request and monitors the health of all your open source dependencies. Discover the contents of your packages and block harmful activity before you install or update your dependencies.

Install

Related posts

SocketSocket SOC 2 Logo

Product

About

Packages

Stay in touch

Get open source security insights delivered straight into your inbox.

  • Terms
  • Privacy
  • Security

Made with ⚡️ by Socket Inc

U.S. Patent No. 12,346,443 & 12,314,394. Other pending.