diff options
author | 2022-06-12 12:58:47 -0400 | |
---|---|---|
committer | 2022-07-06 14:00:05 -0400 | |
commit | c035ef27d35fd10a850c49610d46ffb54f90016d (patch) | |
tree | 2893e766ceceaebb7be3f86fecfbd2c2f363e803 /recipes-connectivity/kuksa-val/kuksa-dbc-feeder/0003-dbc2val-add-duplicate-filtering-option.patch | |
parent | 94a34e1359860b99ad5958bd11ef9abae3f3dbb0 (diff) |
Update demo KUKSA.val configuration
In practice mapping multiple CAN signals from the LIN polling to a
smaller number of VIS signals does not work well with the behavior
of the CAN feeder from KUKSA.val when testing on the actual demo
hardware. To improve the behavior:
- update the VSS schema overlay and DBC feeder mapping configuration
to use new AGL custom steering wheel switch signals instead of the
previous signals and mappings.
- add a patch to the DBC feeder to add a per-target duplicate signal
filtering option, and enable it for all the steering wheel signals
in the mapping configuration.
The DBC feeder performance issues stemming from synchronous VIS server
updates will be discussed with upstream, but these changes should
yield behavior similar to the previous combination of the low-can and
signal-composer bindings. With respect to the switch signals, this
should be revisited if implementing a custom LIN signal feeder becomes
an option, as overall it would be better to leverage the standard VSS
schema signals if possible.
Bug-AGL: SPEC-4405
Signed-off-by: Scott Murray <scott.murray@konsulko.com>
Change-Id: Ifd62161f18303717ee279e23f46000324ab77dbc
Diffstat (limited to 'recipes-connectivity/kuksa-val/kuksa-dbc-feeder/0003-dbc2val-add-duplicate-filtering-option.patch')
-rw-r--r-- | recipes-connectivity/kuksa-val/kuksa-dbc-feeder/0003-dbc2val-add-duplicate-filtering-option.patch | 61 |
1 files changed, 61 insertions, 0 deletions
diff --git a/recipes-connectivity/kuksa-val/kuksa-dbc-feeder/0003-dbc2val-add-duplicate-filtering-option.patch b/recipes-connectivity/kuksa-val/kuksa-dbc-feeder/0003-dbc2val-add-duplicate-filtering-option.patch new file mode 100644 index 000000000..1709ac1e4 --- /dev/null +++ b/recipes-connectivity/kuksa-val/kuksa-dbc-feeder/0003-dbc2val-add-duplicate-filtering-option.patch @@ -0,0 +1,61 @@ +From a22d972bc497ab46d99c1d118bd40b9471fef3a7 Mon Sep 17 00:00:00 2001 +From: Scott Murray <scott.murray@konsulko.com> +Date: Mon, 13 Jun 2022 12:54:54 -0400 +Subject: [PATCH] dbc2val: add duplicate filtering option + +To avoid generating a lot of duplicated signal events from the +CAN messages generated by LIN polling, add a per-target +"filter-duplicates" option that can be used for signals where +only changes should be pushed toi the VIS server. This is +required with the current performance of the DBC feeder to avoid +ending up with an increasing backlog of signal commands to the +server. This will be investigated with upstream. + +Upstream-Status: pending +Signed-off-by: Scott Murray <scott.murray@konsulko.com> +--- + kuksa_feeders/dbc2val/dbc2vssmapper.py | 27 +++++++++++++++++++------- + 1 file changed, 20 insertions(+), 7 deletions(-) + +diff --git a/kuksa_feeders/dbc2val/dbc2vssmapper.py b/kuksa_feeders/dbc2val/dbc2vssmapper.py +index 1718154..2feb572 100644 +--- a/kuksa_feeders/dbc2val/dbc2vssmapper.py ++++ b/kuksa_feeders/dbc2val/dbc2vssmapper.py +@@ -48,14 +48,27 @@ class mapper: + # Check whether there are transforms defined to map DBC signal "signal" to + # VSS path "target". Returns the (potentially) transformed values + def transform(self,signal, target, value): +- if "transform" not in self.mapping[signal]["targets"][target].keys(): #no transform defined, return as is +- return value +- for transform in self.mapping[signal]["targets"][target]["transform"]: +- if transform in self.transforms.keys(): #found a known transform and apply +- value=self.transforms[transform].transform(self.mapping[signal]["targets"][target]["transform"][transform],value) ++ result = value ++ if "transform" in self.mapping[signal]["targets"][target].keys(): ++ for transform in self.mapping[signal]["targets"][target]["transform"]: ++ if transform in self.transforms.keys(): #found a known transform and apply ++ result = self.transforms[transform].transform(self.mapping[signal]["targets"][target]["transform"][transform],value) ++ else: ++ print(f"Warning: Unknown transform {transform} for {signal}->{target}") ++ # else no transform defined, return as is ++ ++ if (("filter-duplicates" in self.mapping[signal]["targets"][target]) and ++ self.mapping[signal]["targets"][target]["filter-duplicates"] == "true"): ++ if "last" in self.mapping[signal]["targets"][target]: ++ if self.mapping[signal]["targets"][target]["last"] == result: ++ # ignore duplicate value ++ result = None ++ else: ++ self.mapping[signal]["targets"][target]["last"] = result + else: +- print(f"Warning: Unknown transform {transform} for {signal}->{target}") +- return value ++ self.mapping[signal]["targets"][target]["last"] = result ++ ++ return result + + def __contains__(self,key): + return key in self.mapping.keys() +-- +2.35.1 + |