Skip to content
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

Profile section in VSS doc #14

Draft
wants to merge 1 commit into
base: master
Choose a base branch
from
Draft
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
19 changes: 19 additions & 0 deletions docs-gen/content/ecosystem/profiles/_index.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,19 @@
---
title: "VSS Profiles"
date: 2023-05-18T15:12:25+02:00
chapter: true
weight: 40
---

# VSS Profiles

VSS is designed to be extensible.
A profile describes how VSS could be used for a specific purpose and defines extended attributes and/or extended nodes
used by that profile.

*Note: VSS-tools does not yet support addition of custom nodes!*

This section lists VSS profiles published either by COVESA VSS-project or by other project or organization.
They are not in anyway "approved" by COVESA, as of today there exist no "official" COVESA extensions.
If they become widely used they may however be promoted to official profiles in the future,
or even integrated into the official VSS syntax.
62 changes: 62 additions & 0 deletions docs-gen/content/ecosystem/profiles/data_properties.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,62 @@
---
title: "Data Properties"
date: 2023-05-18T13:31:46+0000
weight: 20
---

To support a VSS data model Ford has defined a profile with extended attributes as well as a totally new node type.

## Definition

The following extended attributes are added.

For branches:

```yaml
<VSS Branch name>:
type: branch
description: ...
identifier: <identifier>
elementType: [FeatureOfInterest|Node]
definition: ...
```

For sensor/attribute/actuators:

```yaml
<VSS Signal name>:
type: <VSS type>
description: ...
identifier: <identifier>
elementType: SignalType
definition: ...
property: ...
```

In addition to this a new node type `dataProperty` is added.

```yaml
<VSS Data Property Name>:
type: dataProperty
description: ...
identifier: <identifier>
elementType: [DataProperty | ObjectProperty]
definition: ...
```

It is for now assumed that `dataProperty` nodes must exist in the types tree, similar to how structs are managed.

## Tool Support

The extended attributes for branches and signals are supported for vss-tools JSON/Yaml.

The new node type `dataProperty` is currently not supported.
VSS-tools could possibly add support for new node types, but performing semantic checks would be more difficult.


## Usage

TBD


## References
70 changes: 70 additions & 0 deletions docs-gen/content/ecosystem/profiles/dbc_mapping.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,70 @@
---
title: "DBC Mapping"
date: 2023-05-18T13:31:46+0000
weight: 10
---

For mapping between VSS signals and CAN signals defined in DBC files the Eclipse KUKSA project has defined two extended attributes,
`vss2dbc` and `dbc2vss`


## Definition

The profile defines two extended attributes, one for each direction of mapping

* `vss2dbc` for mapping from VSS signal to CAN signal
* `dbc2vss` for mapping from CAN signal to VSS signal

For both of them it is possible to specify how values shall be converted, by a mapping table or by a mathematical formula.
For mapping from CAN to VSS it is possibly to specify how often the VSS signal shall be updated.

```yaml
<VSS Signal name>:
type: <VSS type>
datatype: <VSS datatype>
vss2dbc:
signal: <DBC signal name>
[transform: ...]
dbc2vss:
signal: <DBC signal name>
[interval_ms: <interval in milliseconds>]
[on_change: {true|false}]
[transform: ...]
```

Example:


```yaml
Vehicle.Body.Mirrors.DriverSide.Tilt:
datatype: int8
type: actuator
dbc2vss:
signal: VCLEFT_mirrorTiltYPosition
interval_ms: 100
transform:
math: "floor((x*40)-100)"
vss2dbc:
signal: VCLEFT_mirrorTiltYPosition
transform:
math: "(x+100)/40"
```

For more information on syntax see [KUKSA Documentation](https://github.com/eclipse/kuksa.val.feeders/edit/main/dbc2val/mapping/mapping.md)

## Tool Support

If you use `-e vss2dbc,dbc2vss` in vss-tools then JSON and Yaml output will contain the mapping.
The overlay mechanism can be used to add the profile.


## Usage

Below is an example using an overlay to specify vss2dbc/dbc2vss extensions

```
vss-tools/vspec2json.py -e vss2dbc,dbc2vss -o dbc_overlay.vspec -u spec/units.yaml --json-pretty ./spec/VehicleSignalSpecification.vspec vss_dbc.json
```


## References