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

How VSS2DBC signal gets data of other signals of same frame #23

Open
Athvaith2828 opened this issue May 16, 2024 · 3 comments
Open

How VSS2DBC signal gets data of other signals of same frame #23

Athvaith2828 opened this issue May 16, 2024 · 3 comments

Comments

@Athvaith2828
Copy link

Athvaith2828 commented May 16, 2024

I have exploring kuksa can providers, amazing work.
I have a doubt on hwo VSS2DBC gets the value of other(affected) signals of the same frame,
I understood that a single VSS signal will have DBC2VSS(current) and VSS2DBC(target),
if i set target value of a VSS signal,
Does it takes other signal value in the following order ?
1.) check current_value of the signal
2.)check target_value of the signal
3.) check for default values in the json

I have a doubt whether it takes target value or current value

and does a single VSS signal will have both current and target ? or will it be different VSS signals ?

and if it is a same signal while it be actuator? / I tried to set target value for sensor type VSS signal and it throws error

please correct me, if i am wrong

@erikbosch
Copy link
Contributor

You are right on the general mapping as described in https://github.com/eclipse-kuksa/kuksa-can-provider/blob/main/mapping/README.md

  • dbc2vss: The signal from CAN is injected into Databroker as actual value
  • vss2dbc: The target value from Databroker is added to the CAN signal

This is (currently) based on an assumption that actual values only flow in the direction from CAN to Databroker, and target values in direction from Databroker to CAN. We do not have as of today any mechanism to specify that sensor values should be used on CAN or that CAN will provide target/actuator values to Databroker.

This is how values in vss2dbc is handled:

At startup the CAN provider subscribes to target values of all VSS signals listed in vss2dbc part of the mapping config

async def subscribe(self, vss_names: List[str], callback):

When CAN provider receives a target value update callback from Databroker it:

  • Checks which CAN frames that are involved and should be sent
  • Populates the CAN frame

def get_value_dict(self, can_id):

Population use two methods:

So what will be included in the CAN frame is either default values from JSON or actuator/target values from other vss2dbc mapping configurations.

@Athvaith2828
Copy link
Author

Athvaith2828 commented May 16, 2024

Thanks for the quick reply and answer @erikbosch,

Is there an option, that it will look for current value of the VSS and sends that ?

While testing I have noticed 2 that VSS signals of sensor, Can't able to set the target value but in https://github.com/eclipse-kuksa/kuksa-can-provider/blob/973fe305f470db216ceddb619c11df7a77adb7a2/mapping/vss_4.1/dbc_overlay.vspec#L300C3-L300C7 for type of sensor vss2dbc is defined

@erikbosch
Copy link
Contributor

It would technically not be a problem to extend the syntax of the mapping with something like valuetype: current or valuetype: target and adapt the implementation accordingly so it subscribes to or publish the "right" value.

For Vehicle.Powertrain.ElectricMotor.Temperature I would say that it definitively is an error in the .vspec/.json, as we cannot subscribe to or at least not will get any target value updates for actuators.

erikbosch added a commit to boschglobal/kuksa-can-provider that referenced this issue May 16, 2024
Related to eclipse-kuksa#23

Current CAN provider implementation always subscribe to target value for "vss2dbc".
That does not really make sense for sensors, as they do not have target values
erikbosch added a commit to boschglobal/kuksa-can-provider that referenced this issue May 20, 2024
Related to eclipse-kuksa#23

Current CAN provider implementation always subscribe to target value for "vss2dbc".
That does not really make sense for sensors, as they do not have target values
erikbosch added a commit to boschglobal/kuksa-can-provider that referenced this issue May 20, 2024
Related to eclipse-kuksa#23

Current CAN provider implementation always subscribe to target value for "vss2dbc".
That does not really make sense for sensors, as they do not have target values
SebastianSchildt pushed a commit that referenced this issue May 20, 2024
Related to #23

Current CAN provider implementation always subscribe to target value for "vss2dbc".
That does not really make sense for sensors, as they do not have target values
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants