Closed kkoppolu1 closed 1 year ago
Discussion:
Meeting notes:
Opened PR to address the use of struct, modules, and signal groupings via the use of new keywords in VSS, and by creating a format specifying document for each exporter type in vss-tools. https://github.com/COVESA/vehicle_signal_specification/pull/576 Looking forward to the discussions.
Meeting 08/15
Check whether a concept like https://github.com/COVESA/vehicle_signal_specification/pull/576 will be impkmented in the ner/midterm. If yes, we shold think about struct support on top of that approach, if not let's see if the approach here can be reabsed, made work based on the existing DDS exporter with reasonable effort.
Meeting 08/15
Check whether a concept like COVESA/vehicle_signal_specification#576 will be impkmented in the near/midterm. If yes, we should think about struct support on top of that approach, if not let's see if the approach here can be rebased, made work based on the existing DDS exporter with reasonable effort.
@neil-rti is overlay approach described in the above PR being worked on?
Re-based the changes. Example output is below. Once output format is agreed upon, I'll write the unit tests.
Re-cap of the output rules:
#
A:
type: branch
description: Branch A.
A.UInt8: datatype: uint8 type: sensor unit: km description: A uint8.
A.ParentStructSensor: datatype: VehicleDataTypes.TestBranch1.ParentStruct type: sensor unit: km description: A rich sensor with user-defined data type.
A.NestedStructSensor: datatype: VehicleDataTypes.TestBranch1.NestedStruct type: sensor unit: km description: A rich sensor with user-defined data type.
Types are defined at:
https://github.com/COVESA/vss-tools/blob/master/tests/vspec/test_structs/VehicleDataTypes.vspec
Example output:
module VehicleDataTypes {
module TestBranch1 {
struct NestedStruct {
double x;
double y;
double z;
};
struct ParentStruct {
VehicleDataTypes::TestBranch1::NestedStruct x_property;
VehicleDataTypes::TestBranch1::NestedStruct y_property;
sequence
Meeting notes:
Meeting notes:
Test plan update:
The file vspec2ddsidl
does not have any unit tests. The existing environment of vss-tools
does not include idlc
. Hence, we cannot verify in a unit test whether the idl compilation will succeed or not.
In a separate PR, we should introduce the idlc
dependency and add unit tests to vspec2ddsidl
For this PR, I tested manually that the (python) code generation succeeds for cyclonedds
Test command for processing the IDL file generated (signals_out.idl):
idlc -l py ./signals_out.idl
Generated code:
Dir: VehicleDataTypes/TestBranch1
File: _signals_out.py
"""
Generated by Eclipse Cyclone DDS idlc Python Backend
Cyclone DDS IDL version: v0.11.0
Module: VehicleDataTypes.TestBranch1
IDL file: signals_out.idl
"""
from dataclasses import dataclass
from enum import auto
from typing import TYPE_CHECKING, Optional
import cyclonedds.idl as idl
import cyclonedds.idl.annotations as annotate
import cyclonedds.idl.types as types
# root module import for resolving types
import VehicleDataTypes
@dataclass
@annotate.final
@annotate.autoid("sequential")
class NestedStruct(idl.IdlStruct, typename="VehicleDataTypes.TestBranch1.NestedStruct"):
x: types.float64
y: types.float64
z: types.float64
@dataclass
@annotate.final
@annotate.autoid("sequential")
class ParentStruct(idl.IdlStruct, typename="VehicleDataTypes.TestBranch1.ParentStruct"):
x_property: 'VehicleDataTypes.TestBranch1.NestedStruct'
y_property: 'VehicleDataTypes.TestBranch1.NestedStruct'
x_properties: types.sequence['VehicleDataTypes.TestBranch1.NestedStruct']
y_properties: types.sequence['VehicleDataTypes.TestBranch1.NestedStruct']
z_property: types.float64
Dir: A
File: _signals_out.py
"""
Generated by Eclipse Cyclone DDS idlc Python Backend
Cyclone DDS IDL version: v0.11.0
Module: A
IDL file: signals_out.idl
"""
from dataclasses import dataclass
from enum import auto
from typing import TYPE_CHECKING, Optional
import cyclonedds.idl as idl
import cyclonedds.idl.annotations as annotate
import cyclonedds.idl.types as types
# root module import for resolving types
import A
if TYPE_CHECKING:
import VehicleDataTypes.TestBranch1
@dataclass
@annotate.final
@annotate.autoid("sequential")
class UInt8(idl.IdlStruct, typename="A.UInt8"):
value: types.byte
@dataclass
@annotate.final
@annotate.autoid("sequential")
class ParentStructSensor(idl.IdlStruct, typename="A.ParentStructSensor"):
value: 'VehicleDataTypes.TestBranch1.ParentStruct'
@dataclass
@annotate.final
@annotate.autoid("sequential")
class NestedStructSensor(idl.IdlStruct, typename="A.NestedStructSensor"):
value: 'VehicleDataTypes.TestBranch1.NestedStruct'
Meeting notes:
@kkoppolu1 - if you have time feel free to look on the conflicts. If you do not have time I can assist.
Confirm expected output for DDSIDL before proceeding with the implementation