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

Can't Encode/Decode BasicVehicleContainerHighFrequency #6

Open
Rom-1T opened this issue Feb 2, 2024 · 5 comments
Open

Can't Encode/Decode BasicVehicleContainerHighFrequency #6

Rom-1T opened this issue Feb 2, 2024 · 5 comments

Comments

@Rom-1T
Copy link

Rom-1T commented Feb 2, 2024

Hello,

I truly appreciate your efforts in developing a UPER ASN1 encoder for Java applications. However, I am encountering challenges with encoding/decoding a specific CAM data container, the BasicVehicleContainerHighFrequency. Strangely, I can encode every sub-data correctly (Heading, Speed, etc.), but there seems to be an issue with the BasicVehicleContainerHighFrequency data container.

To provide context for my project, I aim to establish a V2X communication protocol between an Android application (utilizing Java) and a vehicle (using a C++ stack, which is already operational). I am currently testing the encoding/decoding functionality through a Python application for flexibility. It's important to note that I am not utilizing BTP or Geonet, as my network layer is MQTT-based so I am only encoding ITS Container. The DENM works perfectly.

I suspect there may be difficulties in declaring the BasicVehicleContainerHighFrequency correctly. Could you assist me in resolving this issue?

Thank you,

@alexvoronov
Copy link
Owner

Hi!

It's been long time since I've looked at those containers. Since you got DENM to work, there is hope that BasicVehicleContainerHighFrequency will also work :)

What errors do you get? What is the difference in UPER messages between what you get with gcdc-asn1 and Python-encoded UPER message? How does messages look when compared with asn1-playground outputs?

Android used to have a problem with field ordering: it was not preserving field order when iterating through fields using reflection, so results were inconsistent. The hope was that Android will eventually return fields in the declaration order, just like Java.

@Rom-1T
Copy link
Author

Rom-1T commented Feb 5, 2024

I believe the issue stems from the definition of BasicVehicleContainerHighFrequency itself, as it appears to be the smallest container causing problems with encoding/decoding. While I can successfully encode and decode using your encoder and decoder, there seems to be a lack of interoperability. The challenge lies in identifying any substantial differences in the ASN1-like declaration. I've attached a screenshot of my test results for reference. In the test, I encoded a BasicVehicleContainerHighFrequency using a trusted source and your encoder, then compared them.
Capture d’écran du 2024-02-05 09-18-56
As you can observe, the beginning works fine, but issues arise towards the end.

I am exploring potential workarounds and considering not encoding/decoding V2X messages on Android. Regardless, I appreciate your project. Thank you.

@alexvoronov
Copy link
Owner

alexvoronov commented Feb 5, 2024 via email

@Rom-1T
Copy link
Author

Rom-1T commented Feb 5, 2024

Great news! I implemented your suggested method, and it revealed two problematic data fields: CurvatureCalculationMode and YawRate. However, those data container should work fine by themselves. In fact they are, the problems lies in the BasicVehicleContainerHighFrequency because when I make CurvatureCalculationMode and LongitudinalAcceleration OPTIONNAL and the YawRate MANDATORY it also works. Maybe the BasicVehicleContainerHighFrequency can not handle more than 7 data container encoding ?
Capture d’écran du 2024-02-05 12-10-32

To address this, I modified my trusted encoder ASN1 files, designating both yawRate and curvatureCalculationMode as OPTIONAL. I made the same adjustments to your CoopIts class definition. With these changes, I can now successfully send and receive CAM. In the end I can't modify the ASN1 files of my receiving system which mean I have to find another way of fixing this encoding/decoding problem

@alexvoronov
Copy link
Owner

alexvoronov commented Feb 6, 2024 via email

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