-
Notifications
You must be signed in to change notification settings - Fork 44
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
IEEE 754 support #94
Comments
Hi Aleksander, thanks for reporting this and providing all the details. We will go over this in more details and get back to you. If you happen to have the fix at hand, feel free to open a PR. Thanks once again! |
@nenadilic84 Thanks for the quick response. I don't have a fix at hand, unfortunately. I think that a general solution would require changes to IoT FleetWise data model - namely, the CanSignal data type - to be able to convey that the signal value is something else than a signed or unsigned integer that you scale and translate, like |
@apolak Thanks for the additional context. It's not clear from the DBC spec what value |
@hefroy I think the value 3 is either a reserved value or an error in the specification. The three representations that I had in mind are:
|
Is your feature request related to a problem? Please describe.
CAN databases support IEEE 754 signal values. However, Edge Agent doesn't seem to support this type of signals. In turn, collecting them is not possible. Please see the code below:
aws-iot-fleetwise-edge/src/CANDecoder.cpp
Lines 111 to 146 in 28f4460
In this code, all signals of type float or double are considered to be scaled integers. IEEE 754 numbers are treated as signed 64-bit integers, then converted to double using simple casting.
For example, double value 2.3 is encoded as 0x4002666666666666. The signal is of type double in the signal catalog. However, Edge Agent decodes it as 4612361558371493478 and then casts it to double. As a result, the value stored by AWS IoT FleetWise is 4612361558371493478.0 instead of 2.3.
Describe the solution you'd like
Edge Agent should be able to correctly decode signal values that are 32-bit or 64-bit IEEE 754 numbers. This may require changes to the DecoderManifest in order to be able to identify these types of signals.
Describe alternatives you've considered
Additional context
In DBC files, you can use
SIG_VALTYPE_
keyword to specify that the signal value is a 32-bit or 64-bit IEEE 754 number:Please see the example below:
The text was updated successfully, but these errors were encountered: