Skip to main content

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

Project description

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

Argument Description
-h, --help show this help message and exit
-I dir, --include-dir dir Add include directory to search for included vspec files.
-T TARGET_FOLDER, --target-folder TARGET_FOLDER The folder name (with relative path) where the code will be generated into.
-N PACKAGE_NAME, --package-name PACKAGE_NAME Name of the root module/package (Python) or root namespace (C++).
-s, --strict Use 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_FILE Add overlays that will be layered on top of the VSS file in the order they appear.
-u UNITS, --units UNITS The 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

Project details


Download files

Download the file for your platform. If you're not sure which to choose, learn more about installing packages.

Source Distribution

velocitas_model_generator-0.8.0.tar.gz (43.7 kB view details)

Uploaded Source

Built Distribution

If you're not sure about the file name format, learn more about wheel file names.

velocitas_model_generator-0.8.0-py3-none-any.whl (34.1 kB view details)

Uploaded Python 3

File details

Details for the file velocitas_model_generator-0.8.0.tar.gz.

File metadata

File hashes

Hashes for velocitas_model_generator-0.8.0.tar.gz
Algorithm Hash digest
SHA256 be4cc74cd7407d35ecd63be24a54b8c54067fca37bede718f03e7e3b4581ba3f
MD5 53cb71f85bffcafe7797b11bd6a1ec37
BLAKE2b-256 4d14b9fcbd9820c95d40a4f7e65b8729b60a70875dcb1099f713a87083da5cd9

See more details on using hashes here.

Provenance

The following attestation bundles were made for velocitas_model_generator-0.8.0.tar.gz:

Publisher: release.yml on eclipse-velocitas/vehicle-model-generator

Attestations: Values shown here reflect the state when the release was signed and may no longer be current.

File details

Details for the file velocitas_model_generator-0.8.0-py3-none-any.whl.

File metadata

File hashes

Hashes for velocitas_model_generator-0.8.0-py3-none-any.whl
Algorithm Hash digest
SHA256 e2941a3665214bc0127cc644fe76d518bf0be730cecbcbf90847bb9e0f404079
MD5 591f6543d5a6f3d2157706a134e5804a
BLAKE2b-256 d8a86902505a490b8a205ff5601f3712264bb8f7e7003f2c45e00e7b454a757f

See more details on using hashes here.

Provenance

The following attestation bundles were made for velocitas_model_generator-0.8.0-py3-none-any.whl:

Publisher: release.yml on eclipse-velocitas/vehicle-model-generator

Attestations: Values shown here reflect the state when the release was signed and may no longer be current.

Supported by

AWS Cloud computing and Security Sponsor Datadog Monitoring Depot Continuous Integration Fastly CDN Google Download Analytics Pingdom Monitoring Sentry Error logging StatusPage Status page