-
Notifications
You must be signed in to change notification settings - Fork 172
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
Left/Right Instance Discussion #718
Changes from all commits
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -10,17 +10,39 @@ quite often there is a need to repeat branches and data entries | |
branches and data entries in the specification an instance-concept is supported. | ||
Instances remove the need of repeating definitions, by defining at the node itself how often it occurs in | ||
the resulting tree. They are meant as a short-cut in the specification and | ||
interpreted by the tools. As an example is shown below for doors: | ||
interpreted by the tools. | ||
|
||
The instance names defined in VSS can be seen as labels | ||
to reference particular instances. There is not necessarily a 1:1 relation between | ||
VSS instance identifiers and physical instances. A typical example could be instance identifiers | ||
for doors, windows and seats. For a left-hand drive vehicle, the driver seat may be referenced both | ||
as `DriverSide` and as `Left`. VSS does not provide any syntax to specify that VSS instance `A` | ||
(for this particular vehicle) actually refers to the same physical instances as `C`. | ||
It is up to the VSS implementation and deployment to manage this relationship, for example | ||
by a configuration file. | ||
|
||
|
||
As an example is shown below for doors. In VSS four instances of doors are specified for each row, | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Review phrasing. Not clear what is meant by "As an example is shown below." "In VSS" -> "In VSS," |
||
but there are at most two physical doors on each side. | ||
`DriverSide`and `PassengerSide`can be considered as aliases for `Left`and `Right`, or vice versa. | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more.
as aliases -> aliases
|
||
|
||
<!-- Image source in docs-gen/image_source/instance_tree.puml --> | ||
![Example tree](/vehicle_signal_specification/images/instance_tree.png) | ||
|
||
When expanded this corresponds to: | ||
|
||
If expanded (for instance by [VSS-tools](https://github.com/COVESA/vss-tools)) this corresponds to: | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. ) -> ), |
||
|
||
<!-- Image source in docs-gen/image_source/instance_tree_expand.puml --> | ||
![Example tree](/vehicle_signal_specification/images/instance_tree_expand.png?width=60pc) | ||
![Example tree expanded](/vehicle_signal_specification/images/instance_tree_expand.png?width=70pc) | ||
|
||
## Definition | ||
Note that for example `Vehicle.Cabin.Door.Row1.DriverSide.IsOpen` and `Vehicle.Cabin.Door.Row1.Left.IsOpen` from | ||
a VSS perspective are considered as different signals. It is up to the implementation (for a LHD vehicle) to make | ||
sure that both signal names can be used to control the left door, so that the logical representation corresponds to the image below. | ||
|
||
<!-- Image source in docs-gen/image_source/instance_tree_expand_logical.puml --> | ||
![Example tree expanded logical](/vehicle_signal_specification/images/instance_tree_expand_logical.png?width=70pc) | ||
|
||
## VSS Syntax | ||
|
||
### How can I create instances for my `branch`? | ||
|
||
|
@@ -38,7 +60,7 @@ When expanded this corresponds to: | |
and `Position4`. It is in VSS recommended to use `1` as start index for the first row/axle/position/... | ||
4. If multiple instances occur in one node or on the path to a data entry, | ||
the instances get combined, by the order of occurrence. Following the example above, | ||
four position instances will be created for each of the 'DriverSide' and 'PasengerSide' instances, | ||
four position instances will be created for each of the 'DriverSide' and 'PassengerSide' instances, | ||
resulting into a total number of 8 instances. | ||
|
||
### How can I exclude child-nodes from instantiation? | ||
|
@@ -61,7 +83,7 @@ Door: | |
type: branch | ||
instances: | ||
- Row[1,2] | ||
- ["DriverSide","PassengerSide"] | ||
- ["DriverSide","PassengerSide", "Left", "Right"] | ||
description: All doors, including windows and switches | ||
#include SingleDoor.vspec Door | ||
|
||
|
@@ -91,8 +113,12 @@ Results in the following signals: | |
Vehicle.Cabin.Door.SomeSignal | ||
Vehicle.Cabin.Door.Row1.DriverSide.IsOpen | ||
Vehicle.Cabin.Door.Row1.PassengerSide.IsOpen | ||
Vehicle.Cabin.Door.Row1.Left.IsOpen | ||
Vehicle.Cabin.Door.Row1.Right.IsOpen | ||
Vehicle.Cabin.Door.Row2.DriverSide.IsOpen | ||
Vehicle.Cabin.Door.Row2.PassengerSide.IsOpen | ||
Vehicle.Cabin.Door.Row2.Left.IsOpen | ||
Vehicle.Cabin.Door.Row2.Right.IsOpen | ||
``` | ||
|
||
## Redefinition | ||
|
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,57 @@ | ||
@startuml | ||
|
||
usecase Vehicle as N1 | ||
usecase Cabin as N11 | ||
N1--> N11 | ||
usecase Door as N111 | ||
N11--> N111 | ||
|
||
usecase Row1 as N111a | ||
N111-->N111a | ||
usecase Row2 as N111b | ||
N111-->N111b | ||
|
||
' Instance Level | ||
|
||
usecase "DriverSide/Left" as N111aa | ||
usecase "PassengerSide/Right" as N111ab | ||
N111a-->N111aa | ||
N111a-->N111ab | ||
|
||
usecase "DriverSide/Left" as N111ba | ||
usecase "PassengerSide/Right" as N111bb | ||
N111b-->N111ba | ||
N111b-->N111bb | ||
|
||
' Leaf Level | ||
|
||
usecase IsOpen as N111aa2 | ||
usecase Window as N111aa1 | ||
usecase IsOpen as N111aa11 | ||
N111aa-->N111aa1 | ||
N111aa1-->N111aa11 | ||
N111aa-->N111aa2 | ||
|
||
usecase IsOpen as N111ab2 | ||
usecase Window as N111ab1 | ||
usecase IsOpen as N111ab11 | ||
N111ab-->N111ab1 | ||
N111ab1-->N111ab11 | ||
N111ab-->N111ab2 | ||
|
||
|
||
usecase IsOpen as N111ba2 | ||
usecase Window as N111ba1 | ||
usecase IsOpen as N111ba11 | ||
N111ba-->N111ba1 | ||
N111ba1-->N111ba11 | ||
N111ba-->N111ba2 | ||
|
||
usecase IsOpen as N111bb2 | ||
usecase Window as N111bb1 | ||
usecase IsOpen as N111bb11 | ||
N111bb-->N111bb1 | ||
N111bb1-->N111bb11 | ||
N111bb-->N111bb2 | ||
|
||
@enduml |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I think this makes sense, but I would like to spend some more time thinking this through as to how this would be implemented in practice.
I immediately see two approaches:
For 1., there are portability issues (an app written to look for DriverSide would not find it on vehicles that use a ["Left", "Right"] definition, and thus would need to be adapted). There is also the argument that if we expect an overlay to be used here, then going with one or the other of ["Left", "Right"] or ["DriverSide", "PassengerSide"] makes some minimal portability guarantee (at least for vehicles that use the definition as it is).
For 2., any code that reports the value for this signal would need to know that it needs to report (or store) this value twice and not just once as it normally does for other signals. Another issue is that
As well, this approach embeds the notion of left-hand vs. right-hand driver side in a bit of an awkward way. Thinking out loud, would it be better for this notion of driver side not to be embedded in this signal, but carried independently, leaving this signal to only have ["Left", "Right"] as instances, with the application relaying on the independent driver position information to cheese between the two instances?
Lastly, where does this leave us with vehicles that do not have a driver side? That is, where the driver is in the middle?