Skip to content

Supporting multiple CAN signals from the same CAN frame #40

@psch0rr

Description

@psch0rr

I've already asked a related question in a different issue #16, but our use case is slightly different than I explained beforehand therefore this new issue.

In our case, we aim to combine two signals from the same CAN frame. The objective is to obtain a signed value, for example, longitudinal acceleration. We have one signal representing the acceleration magnitude and another signal representing its sign.

Here are the signals as defined in the DBC:

SG_ sigLongAcceleration : 35|12@0+ (0.01,0) [0|40.95] "m/s²"
SG_ sigLongAccelerationSign : 36|1@0+ (1,0) [0|1] ""

The sigLongAccelerationSign will be mapped in the DBC itself to -1 for negative values and 1 for positive values.

Feature Request / Question:

Would it be possible to extend the mapping syntax to allow combining such signals from the same frame?

Proposed syntax:

Vehicle.Acceleration.Longitudinal:
  type: sensor
  datatype: float
  dbc:
    combinedSignals: sigLongAcceleration, sigLongAccelerationSign
    interval_ms: 100
    transform:
      math: (x * y)

This would enable us to perform basic arithmetic using multiple signals (e.g., applying the sign to the magnitude).

Is this something that could be supported in future or considered for future development?

Bests Philipp

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions