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

J2735 2020 upgrade #568

Merged
merged 20 commits into from
Feb 20, 2024
Merged

J2735 2020 upgrade #568

merged 20 commits into from
Feb 20, 2024

Conversation

jwillmartin
Copy link
Contributor

@jwillmartin jwillmartin commented Dec 1, 2023

PR Details

Description

Upgrades include new ASN1 folders containing 2020 version of J2735. Changes were made to many files to allow for use of older and this new standard. These changes are indicated by "#if SAEJ2735_SPEC < 2020".
This line specifies which standard is to be used by V2X Hub: https://github.com/usdot-fhwa-OPS/V2X-Hub/blob/j2735-2020-upgrade/src/tmx/Asn_J2735/CMakeLists.txt#L44

Related Issue

Motivation and Context

New versions of the standard are being published. These changes are required to keep up with industry needs.

How Has This Been Tested?

Tested all message encoding/decoding with these unit tests:
https://github.com/usdot-fhwa-OPS/V2X-Hub/blob/j2735-2020-upgrade/src/tmx/TmxUtils/test/J2735MessageTest.cpp
Additional testing was completed on a local instance to ensure messages were generated properly and adhered to the updated standard. Encoded messages were cross-checked with an existing decoder: https://www.marben-products.com/decoder-asn1-automotive/

Types of changes

  • Defect fix (non-breaking change that fixes an issue)
  • New feature (non-breaking change that adds functionality)
  • Breaking change (fix or feature that cause existing functionality to change)

Checklist:

  • I have added any new packages to the sonar-scanner.properties file
  • My change requires a change to the documentation.
  • I have updated the documentation accordingly.
  • I have read the CONTRIBUTING document.
    V2XHUB Contributing Guide
  • I have added tests to cover my changes.
  • All new and existing tests passed.

	new folder: src/tmx/Asn_J2735/src/2020
	modified:   src/tmx/TmxApi/tmx/j2735_messages/SensorDataSharingMessage.hpp
	new folder: src/tmx/Asn_J2735/src/r2020
	modified:   src/tmx/TmxUtils/test/J2735MessageTest.cpp
	modified:   src/v2i-hub/CARMAStreetsPlugin/src/J3224ToSDSMJsonConverter.cpp
	modified:   src/v2i-hub/CARMAStreetsPlugin/src/J3224ToSDSMJsonConverter.h
	modified:   src/v2i-hub/CARMAStreetsPlugin/src/JsonToJ3224SDSMConverter.cpp
	modified:   src/v2i-hub/CARMAStreetsPlugin/src/JsonToJ3224SDSMConverter.h
	modified:   src/v2i-hub/CARMAStreetsPlugin/test/test_J2735ToSRMJsonConverter.cpp
	modified:   src/v2i-hub/CARMAStreetsPlugin/test/test_J3224ToSDSMJsonConverter.cpp
	modified:   src/v2i-hub/CswPlugin/src/XmlCurveParser.cpp
	modified:   src/v2i-hub/MapPlugin/src/inputs/isd/ISDDataAdaptor.hpp
	modified:   src/v2i-hub/MessageReceiverPlugin/src/MessageReceiverPlugin.cpp
	modified:   src/v2i-hub/SpatPlugin/src/NTCIP1202.cpp
	modified:   src/v2i-hub/TimPlugin/src/DsrcBuilder.cpp
	modified:   src/v2i-hub/TimPlugin/src/TimPlugin.cpp
	modified:   src/v2i-hub/TimPlugin/src/XmlCurveParser.cpp
	modified:   src/tmx/TmxUtils/test/J2735MessageTest.cpp
	re-introduced: src/tmx/Asn_J2735/src/r41/
	modified:   src/tmx/Messages/include/rtcm/RTCM2.h
	modified:   src/tmx/Messages/include/rtcm/RTCM3.h
	modified:   src/tmx/TmxApi/tmx/j2735_messages/BasicSafetyMessage.hpp
	modified:   src/tmx/TmxApi/tmx/j2735_messages/CommonSafetyRequestMessage.hpp
	modified:   src/tmx/TmxApi/tmx/j2735_messages/EmergencyVehicleAlertMessage.hpp
	modified:   src/tmx/TmxApi/tmx/j2735_messages/IntersectionCollisionMessage.hpp
	modified:   src/tmx/TmxApi/tmx/j2735_messages/J2735MessageFactory.hpp
	modified:   src/tmx/TmxApi/tmx/j2735_messages/J2735MessageTemplate.hpp
	modified:   src/tmx/TmxApi/tmx/j2735_messages/MessageFrame.hpp
	modified:   src/tmx/TmxApi/tmx/j2735_messages/NmeaMessage.hpp
	modified:   src/tmx/TmxApi/tmx/j2735_messages/ProbeDataManagementMessage.hpp
	modified:   src/tmx/TmxApi/tmx/j2735_messages/ProbeVehicleDataMessage.hpp
	modified:   src/tmx/TmxApi/tmx/j2735_messages/RtcmMessage.hpp
	modified:   src/tmx/TmxApi/tmx/j2735_messages/SignalRequestMessage.hpp
	modified:   src/tmx/TmxApi/tmx/j2735_messages/testMessage00.hpp
	modified:   src/tmx/TmxApi/tmx/j2735_messages/testMessage01.hpp
	modified:   src/tmx/TmxApi/tmx/j2735_messages/testMessage02.hpp
	modified:   src/tmx/TmxApi/tmx/j2735_messages/testMessage03.hpp
	modified:   src/tmx/TmxApi/tmx/j2735_messages/testMessage04.hpp
	modified:   src/tmx/TmxApi/tmx/j2735_messages/testMessage05.hpp
	modified:   src/tmx/TmxApi/tmx/messages/IvpJ2735.c
	modified:   src/tmx/TmxApi/tmx/messages/IvpJ2735.h
	modified:   src/tmx/TmxApi/tmx/messages/TmxJ2735Codec.hpp
	modified:   src/tmx/TmxUtils/src/BsmConverter.cpp
	modified:   src/tmx/TmxUtils/test/J2735MessageTest.cpp
	modified:   src/v2i-hub/CARMAStreetsPlugin/src/JsonToJ2735SpatConverter.cpp
	modified:   src/v2i-hub/CARMAStreetsPlugin/src/JsonToJ3224SDSMConverter.cpp
	modified:   src/v2i-hub/CARMAStreetsPlugin/test/test_J2735MapToJsonConverter.cpp
	modified:   src/v2i-hub/CARMAStreetsPlugin/test/test_J2735ToSRMJsonConverter.cpp
	modified:   src/v2i-hub/CARMAStreetsPlugin/test/test_J3224ToSDSMJsonConverter.cpp
	modified:   src/v2i-hub/CswPlugin/src/DsrcBuilder.cpp
	modified:   src/v2i-hub/CswPlugin/src/DsrcBuilder.h
	modified:   src/v2i-hub/CswPlugin/src/XmlCurveParser.cpp
	modified:   src/v2i-hub/MapPlugin/src/ConvertToJ2735r41.cpp
	modified:   src/v2i-hub/MapPlugin/src/MapPlugin.cpp
	modified:   src/v2i-hub/MapPlugin/src/inputs/isd/ISDDataAdaptor.hpp
	modified:   src/v2i-hub/MapPlugin/src/inputs/isd/ISDToJ2735r41.cpp
	modified:   src/v2i-hub/MessageReceiverPlugin/src/MessageReceiverPlugin.cpp
	modified:   src/v2i-hub/SpatPlugin/src/NTCIP1202.cpp
	modified:   src/v2i-hub/TimPlugin/src/DsrcBuilder.cpp
	modified:   src/v2i-hub/TimPlugin/src/DsrcBuilder.h
	modified:   src/v2i-hub/TimPlugin/src/TimPlugin.cpp
	modified:   src/v2i-hub/TimPlugin/src/XmlCurveParser.cpp
	modified:   src/tmx/CMakeLists.txt
	modified:   src/tmx/Asn_J2735/src/r2020/RegionalExtension.c
	modified:   src/tmx/TmxUtils/test/J2735MessageTest.cpp
	modified:   src/v2i-hub/SpatPlugin/src/NTCIP1202.cpp
	modified:   src/v2i-hub/SpatPlugin/src/NTCIP1202.cpp
…ge-addGrpCarma.h

	new file:   src/tmx/Asn_J2735/include/asn_j2735_r2020/DestinationType.h
	new file:   src/tmx/Asn_J2735/include/asn_j2735_r2020/ENUMERATED.h
	new file:   src/tmx/Asn_J2735/include/asn_j2735_r2020/EstimatedTimeType.h
	new file:   src/tmx/Asn_J2735/include/asn_j2735_r2020/GeneralString.h
	new file:   src/tmx/Asn_J2735/include/asn_j2735_r2020/GeneralizedTime.h
	new file:   src/tmx/Asn_J2735/include/asn_j2735_r2020/MobilityNeeds.h
	new file:   src/tmx/Asn_J2735/include/asn_j2735_r2020/MobilityNeedsList.h
	new file:   src/tmx/Asn_J2735/include/asn_j2735_r2020/MobilityNeedsType.h
	new file:   src/tmx/Asn_J2735/include/asn_j2735_r2020/ModeOfTransportType.h
	new file:   src/tmx/Asn_J2735/include/asn_j2735_r2020/NativeReal.h
	new file:   src/tmx/Asn_J2735/include/asn_j2735_r2020/NumericString.h
	new file:   src/tmx/Asn_J2735/include/asn_j2735_r2020/PersonalMobilityMessage.h
	new file:   src/tmx/Asn_J2735/include/asn_j2735_r2020/PersonalMobilityMessageStatusType.h
	modified:   src/tmx/Asn_J2735/include/asn_j2735_r2020/Position3D-addGrpCarma.h
	new file:   src/tmx/Asn_J2735/include/asn_j2735_r2020/PrintableString.h
	new file:   src/tmx/Asn_J2735/include/asn_j2735_r2020/REAL.h
	new file:   src/tmx/Asn_J2735/include/asn_j2735_r2020/RELATIVE-OID.h
	new file:   src/tmx/Asn_J2735/include/asn_j2735_r2020/SeatCount.h
	new file:   src/tmx/Asn_J2735/include/asn_j2735_r2020/T61String.h
	new file:   src/tmx/Asn_J2735/include/asn_j2735_r2020/TeletexString.h
	new file:   src/tmx/Asn_J2735/include/asn_j2735_r2020/UUIDType.h
	new file:   src/tmx/Asn_J2735/include/asn_j2735_r2020/VehicleDescriptionType.h
	new file:   src/tmx/Asn_J2735/include/asn_j2735_r2020/VideotexString.h
	modified:   src/tmx/Asn_J2735/include/asn_j2735_r2020/constr_SEQUENCE.h
	new file:   src/tmx/Asn_J2735/src/r2020/.vscode/c_cpp_properties.json
	new file:   src/tmx/Asn_J2735/src/r2020/.vscode/launch.json
	new file:   src/tmx/Asn_J2735/src/r2020/.vscode/settings.json
	modified:   src/tmx/Asn_J2735/src/r2020/RegionalExtension.c
	modified:   src/tmx/TmxUtils/test/J2735MessageTest.cpp
	modified:   src/tmx/Asn_J2735/include/asn_j2735_r2020/TrafficControlSchedule.h
	new file:   src/tmx/Asn_J2735/src/r2020/DSRC_DayOfWeek.c
	modified:   src/tmx/Asn_J2735/src/r2020/TrafficControlSchedule.c
	modified:   src/tmx/TmxUtils/test/J2735MessageTest.cpp
@@ -600,8 +603,6 @@ TEST_F(J2735MessageTest, EncodePersonalSafetyMessage){
container.load<XML>(ss);
psmmessage.set_contents(container.get_storage().get_tree());
psmENC.encode_j2735_message(psmmessage);
std::cout << psmENC.get_payload_str()<<std::endl;
ASSERT_EQ(32, psmENC.get_msgId());
Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Not sure when this was removed. Will add back in.

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Added back.

Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

No need to comit vscode stuff

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

My bad, did a git add *
Removed.

@paulbourelly999
Copy link
Contributor

We may want to consider holding off on merging this until we cut a release candidate for VRU. This is a very large change set that spans many pieces of commonly used functionality. I think merging this before VRU integration testing poses substantial risk to the testing

Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Can we remove this .vscode folder?

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Removed.

@@ -0,0 +1,116 @@
/*
* Copyright (c) 2017 Lev Walkin <vlm@lionet.info>.
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

All the copyright comments should be updated to year 2023

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

All 2020 files containing this comment were updated to 2023. Thanks!

@@ -94,7 +94,11 @@ namespace CARMAStreetsPlugin
auto ref_pos_ptr = CARMAStreetsPlugin::create_store_shared<Position3D_t>(shared_ptrs);
ref_pos_ptr->lat = sdsm_json["ref_pos"]["lat"].asInt64();
ref_pos_ptr->Long = sdsm_json["ref_pos"]["long"].asInt64();
#if SAEJ2735_SPEC < 2020
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Do we need to support both versions or upgrade to one version?

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I'm not really sure. The previous version had this logic to support both, but you could only use one at a time. Do you think we should just make separate tags for different versions or something else?

Copy link
Collaborator

@dan-du-car dan-du-car Dec 4, 2023

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I prefer to stick with one version. However, if we plan to support both versions in all the plugins, this makes sense. It is a bit inconvenient that we need to consider both from now on if we make any change.

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I agree. I think we should at least phase out anything pre-2020. Nobody will be using anything older anyway, so it doesn't make sense to maintain support.

Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I am good with how it is now. Maybe later we can come back with a solution

	deleted:    src/tmx/Asn_J2735/src/r2020/.vscode/c_cpp_properties.json
	deleted:    src/tmx/Asn_J2735/src/r2020/.vscode/launch.json
	deleted:    src/tmx/Asn_J2735/src/r2020/.vscode/settings.json
	modified:   src/tmx/Asn_J2735/src/r2020/
	modified:   src/tmx/TmxUtils/test/J2735MessageTest.cpp
Copy link

@kjrush kjrush left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Man, github does not like PRs of this size. Seems overall good to me.

frame->duratonTime = 32000;

#else
frame->durationTime = 32000;
Copy link

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Was this a typo in the standard previously "duratonTime"?

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Ha, yeah it was

@paulbourelly999
Copy link
Contributor

@jwillmartin @dan-du-car This can be merged into develop now if it is approved. We have release candidates for VRU so it won't impact our testing. Please resolve merge conflicts before merging.

 Conflicts:
	src/tmx/TmxApi/tmx/TmxApiMessages.h
	src/v2i-hub/CARMAStreetsPlugin/src/JsonToJ3224SDSMConverter.cpp
	src/v2i-hub/ImmediateForwardPlugin/manifest.json

 Changes to be committed:
	modified:   .github/workflows/sonar-scanner.yml
	modified:   src/v2i-hub/CARMAStreetsPlugin/src/CARMAStreetsPlugin.cpp
	modified:   src/v2i-hub/CARMAStreetsPlugin/src/JsonToJ3224SDSMConverter.cpp
	modified:   src/v2i-hub/CARMAStreetsPlugin/src/JsonToJ3224SDSMConverter.h
	modified:   src/v2i-hub/CARMAStreetsPlugin/test/test_JsonToJ3224SDSMConverter.cpp
	modified:   src/v2i-hub/CDASimAdapter/src/CDASimAdapter.cpp
	modified:   src/v2i-hub/ImmediateForwardPlugin/manifest.json
	modified:   src/v2i-hub/TelematicBridgePlugin/src/TelematicUnit.cpp
	modified:   src/v2i-hub/TelematicBridgePlugin/test/test_TelematicUnit.cpp
@jwillmartin jwillmartin merged commit d886fae into develop Feb 20, 2024
7 of 9 checks passed
@jwillmartin jwillmartin deleted the j2735-2020-upgrade branch February 20, 2024 19:25
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

Successfully merging this pull request may close these issues.

4 participants