forked from COVESA/vss-tools
-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
This commit is a proof of concept update of vss-tools to support higher order/complex types via a variation of the approach outlined in https://github.com/COVESA/vehicle_signal_specification/wiki/Proposal-%22struct%22:-Just-model-as-branches,-the-rest-is-deployment Ref: COVESA/vehicle_signal_specification#326 **Description ** The main idea is that we are trying to model a sensor of Complex type - `ObstacleList` as a branch. The current limitation with branches is that you cannot have arrays of branches. With the understanding that branches are to be treated as a data type (like primitive and their array equivalent), what we need is a way to convey the fact that the branch represents a collection/array. In the case of primitives, we use the operator `[]` for this purpose. For example, an array type `uint8` is denoted by adding the suffix `[]`. On a similar path, we can utilize the already available `arraysize` property of a VSS node to specify the array size of a branch typed node. In this commit, the VSS tools are updated to proceess the `arraysize` key for branch typed nodes. For reference, the type is defined as follows: ``` ObstacleClass { uint64 class } Obstacle { uint64 id ObstacleClass class float64 probability } ObstacleList { Obstacle[] data } ``` All the relevant files are included in the commit. vspec -> json: `python vspec2json.py ObstacleArray.vspec --json-pretty out.json` The resulting JSON output contains the attribute "arraysize" for the branch typed nodes if defined.
- Loading branch information
Krishna Koppolu
committed
Aug 2, 2022
1 parent
19531d2
commit a544eff
Showing
7 changed files
with
110 additions
and
0 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,11 @@ | ||
Id: | ||
type: attribute | ||
datatype: int64 | ||
|
||
Probability: | ||
type: attribute | ||
datatype: float | ||
|
||
ObstacleClass: | ||
type: branch | ||
#include ObstacleClass.vspec ObstacleClass |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,17 @@ | ||
Vehicle: | ||
type: branch | ||
|
||
Vehicle.ADAS: | ||
type: branch | ||
|
||
Vehicle.ADAS.Lidar: | ||
type: branch | ||
|
||
Vehicle.ADAS.Lidar.Front: | ||
type: branch | ||
|
||
Vehicle.ADAS.Lidar.Front.Obstacles: | ||
type: branch | ||
arraysize: 10 | ||
|
||
#include ObstacleData.vspec Vehicle.ADAS.Lidar.Front.Obstacles |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,3 @@ | ||
Class: | ||
type: attribute | ||
datatype: uint64 |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,4 @@ | ||
Data: | ||
type: branch | ||
|
||
#include Obstacle.vspec Data |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,70 @@ | ||
{ | ||
"Vehicle": { | ||
"children": { | ||
"ADAS": { | ||
"children": { | ||
"Lidar": { | ||
"children": { | ||
"Front": { | ||
"children": { | ||
"Obstacles": { | ||
"arraysize": 10, | ||
This comment has been minimized.
Sorry, something went wrong. |
||
"children": { | ||
"Data": { | ||
"children": { | ||
"Id": { | ||
"datatype": "int64", | ||
"description": null, | ||
"type": "attribute", | ||
"uuid": "31f7ac1946da58a194c1c6a8dad9cf1d" | ||
}, | ||
"ObstacleClass": { | ||
"children": { | ||
"Class": { | ||
"datatype": "uint64", | ||
"description": null, | ||
"type": "attribute", | ||
"uuid": "c30ce72db64057fd99ac502190bf5fcb" | ||
} | ||
}, | ||
"description": null, | ||
"type": "branch", | ||
"uuid": "9ea15f3abd1656e096bcdc5ee6dcbba3" | ||
}, | ||
"Probability": { | ||
"datatype": "float", | ||
"description": null, | ||
"type": "attribute", | ||
"uuid": "32e416f193d250d3a5f96f0f4789bee3" | ||
} | ||
}, | ||
"description": null, | ||
"type": "branch", | ||
"uuid": "9646d03cc6845c42834aa74fc91a1cfa" | ||
} | ||
}, | ||
"description": null, | ||
"type": "branch", | ||
"uuid": "6ae7d48f9cd25ff694dc5ebd02f90522" | ||
} | ||
}, | ||
"description": null, | ||
"type": "branch", | ||
"uuid": "f96d319c62615760861d8abe645081af" | ||
} | ||
}, | ||
"description": null, | ||
"type": "branch", | ||
"uuid": "aac706a4d4ca599c824ebc479c47540c" | ||
} | ||
}, | ||
"description": null, | ||
"type": "branch", | ||
"uuid": "14c2b2e1297b513197d320a5ce58f42e" | ||
} | ||
}, | ||
"description": null, | ||
"type": "branch", | ||
"uuid": "ccc825f94139544dbb5f4bfd033bece6" | ||
} | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
The idea is to use a property to signify that the branch is an array.
For dynamic arrays, a new property is needed or a "marker" value can be used for arraysize such as "None"