Skip to content

Commit

Permalink
Merge master branch into develop (#530)
Browse files Browse the repository at this point in the history
<!-- Thanks for the contribution, this is awesome. -->
This PR is to update develop branch with master release changes for k900
release
# PR Details
## Description

<!--- Describe your changes in detail -->

## Related Issue

<!--- This project only accepts pull requests related to open issues -->
<!--- If suggesting a new feature or change, please discuss it in an
issue first -->
<!--- If fixing a bug, there should be an issue describing it with steps
to reproduce -->
<!--- Please link to the issue here: -->

## Motivation and Context

<!--- Why is this change required? What problem does it solve? -->

## How Has This Been Tested?

<!--- Please describe in detail how you tested your changes. -->
<!--- Include details of your testing environment, and the tests you ran
to -->
<!--- see how your change affects other areas of the code, etc. -->

## Types of changes

<!--- What types of changes does your code introduce? Put an `x` in all
the boxes that apply: -->

- [ ] 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:

<!--- Go over all the following points, and put an `x` in all the boxes
that apply. -->
<!--- If you're unsure about any of these, don't hesitate to ask. We're
here to help! -->

- [ ] 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](https://github.com/usdot-fhwa-OPS/V2X-Hub/blob/develop/Contributing.md)
- [ ] I have added tests to cover my changes.
- [ ] All new and existing tests passed.
  • Loading branch information
codygarver authored May 12, 2023
2 parents 1e65ccf + f7d694f commit cad66ed
Show file tree
Hide file tree
Showing 26 changed files with 67 additions and 44 deletions.
4 changes: 2 additions & 2 deletions configuration/amd64/docker-compose.yml
Original file line number Diff line number Diff line change
Expand Up @@ -20,7 +20,7 @@ services:
- mysql-datavolume:/var/lib/mysql

php:
image: usdotfhwaops/php:7.4.0
image: usdotfhwaops/php:latest
container_name: php
network_mode: host
depends_on:
Expand All @@ -44,7 +44,7 @@ services:
- ./logs:/var/log/tmx
- ./MAP:/var/www/plugins/MAP
port_drayage_webservice:
image: usdotfhwaops/port-drayage-webservice:7.4.0
image: usdotfhwaops/port-drayage-webservice:latest
container_name: port_drayage_webservice
network_mode: host
secrets:
Expand Down
4 changes: 2 additions & 2 deletions configuration/arm64/docker-compose.yml
Original file line number Diff line number Diff line change
Expand Up @@ -20,7 +20,7 @@ services:
- mysql-datavolume:/var/lib/mysql

php:
image: usdotfhwaops/php_arm:7.4.0
image: usdotfhwaops/php_arm:latest
container_name: php
network_mode: host
depends_on:
Expand All @@ -44,7 +44,7 @@ services:
- ./logs:/var/log/tmx
- ./MAP:/var/www/plugins/MAP
port_drayage_webservice:
image: usdotfhwaops/port-drayage-webservice_arm:7.4.0
image: usdotfhwaops/port-drayage-webservice_arm:latest
container_name: port_drayage_webservice
network_mode: host
secrets:
Expand Down
26 changes: 26 additions & 0 deletions docs/Release_notes.md
Original file line number Diff line number Diff line change
@@ -1,5 +1,31 @@
V2X-Hub Release Notes
---------------------------------

Version 7.5.0, released May 5th, 2023
--------------------------------------------------------

**Summary:**
V2X Hub release 7.5.0 is comprised of the following new features: a new ERVCloudForwardingPlugin to enable BSMs from active Emergency Response Vehicles (ERVs) to be forwarded to CARMA Cloud in support of message forwarding to V2X Hub instances along an ERV’s future route when deployed along with other CARMA tools to demonstrate move-over law when an ERV is approaching a CDA vehicle from behind; new features to support CARMA Simulation integration such as simulation clock functionality; and a newly developed CARMA Simulation adaptor shell and handshake functionality to allow multiple V2X Hub instances to connect with a single CARMA Simulation platform. Along with the above enhancements, several enhancements and bug fixes are included in this release.

**<ins>Freight Emergency Response Functionalities</ins>**

Enhancements in this release related to Freight Emergency Response:

- PR 460: The creation of a new ERVCloudForwardingPlugin that enables V2X Hub to register a connected RSU, along with its location information, with CARMA Cloud. Additionally, this plugin is responsible for sending received BSMs from active Emergency Response Vehicles (ERVs) to CARMA Cloud in support of message forwarding to V2X Hub instances located along the ERV’s future route.

**<ins>Other</ins>**

Enhancements in this release:

- Issue 262: Updated CARMA Streets plugin to receive and decode Mobility Path messages into JSON through Kafka.
- PR 486: Updated the V2X Hub docker images to Ubuntu 22 (Jammy) which has LTS support through April 2027. This will also support new libraries created using the Carma-builds project.
- PR 487: Added some changes to allow for Docker to be installed on different Linux distros for arm64.

Fixes in this release:

- Issue 484: Fixed PedestrianPlugin does not update when any configuration changes are made with in Plugin, either when plugin is off or on.
- PR 494: Sets some error message in the Command Plugin for file upload operations to ERROR instead of DEBUG so they can be seen on the command line by default.

Version 7.4.0, released Feb 10th, 2023
--------------------------------------------------------

Expand Down
2 changes: 1 addition & 1 deletion src/v2i-hub/CARMACloudPlugin/CMakeLists.txt
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
PROJECT ( CARMACloudPlugin VERSION 7.4.0 LANGUAGES CXX )
PROJECT ( CARMACloudPlugin VERSION 7.5.0 LANGUAGES CXX )

SET (TMX_PLUGIN_NAME "CARMACloud")
add_compile_options(-fPIC)
Expand Down
2 changes: 1 addition & 1 deletion src/v2i-hub/CARMAStreetsPlugin/CMakeLists.txt
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
PROJECT ( CARMAStreetsPlugin VERSION 7.4.0 LANGUAGES CXX )
PROJECT ( CARMAStreetsPlugin VERSION 7.5.0 LANGUAGES CXX )

BuildTmxPlugin ( )

Expand Down
2 changes: 1 addition & 1 deletion src/v2i-hub/CDASimAdapter/CMakeLists.txt
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
PROJECT ( CDASimAdapter VERSION 7.4.0 LANGUAGES CXX )
PROJECT ( CDASimAdapter VERSION 7.5.0 LANGUAGES CXX )
set(CMAKE_CXX_STANDARD 17)

FIND_PACKAGE( carma-clock )
Expand Down
2 changes: 1 addition & 1 deletion src/v2i-hub/CommandPlugin/CMakeLists.txt
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
PROJECT ( CommandPlugin VERSION 7.4.0 LANGUAGES CXX )
PROJECT ( CommandPlugin VERSION 7.5.0 LANGUAGES CXX )

FIND_PACKAGE (OpenSSL REQUIRED)

Expand Down
2 changes: 1 addition & 1 deletion src/v2i-hub/CswPlugin/CMakeLists.txt
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
PROJECT ( CswPlugin VERSION 7.4.0 LANGUAGES CXX )
PROJECT ( CswPlugin VERSION 7.5.0 LANGUAGES CXX )

SET (TMX_PLUGIN_NAME "CSW")

Expand Down
2 changes: 1 addition & 1 deletion src/v2i-hub/DmsPlugin/CMakeLists.txt
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
PROJECT ( DmsPlugin VERSION 7.4.0 LANGUAGES CXX )
PROJECT ( DmsPlugin VERSION 7.5.0 LANGUAGES CXX )

SET (TMX_PLUGIN_NAME "Dynamic Message Sign")

Expand Down
2 changes: 1 addition & 1 deletion src/v2i-hub/ERVCloudForwardingPlugin/CMakeLists.txt
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
PROJECT(ERVCloudForwardingPlugin VERSION 7.4.0 LANGUAGES CXX)
PROJECT(ERVCloudForwardingPlugin VERSION 7.5.0 LANGUAGES CXX)

SET(TMX_PLUGIN_NAME "ERVCloudForwarding")
add_compile_options(-fPIC)
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -19,12 +19,13 @@ namespace ERVCloudForwardingPlugin

void ERVCloudForwardingPlugin::handleBSM(BsmMessage &msg, routeable_message &routableMsg)
{
PLOG(logDEBUG) << "Receive BSM: " << msg << endl;
uint64_t delayStart = std::chrono::duration_cast<std::chrono::milliseconds>(std::chrono::system_clock::now().time_since_epoch()).count();
// Check if the BSM is broadcast by an ERV (Emergency Response Vehicle)
if (ERVCloudForwardingWorker::IsBSMFromERV(msg))
{
// Construct the ERV BSM and forward it to the cloud.
auto xml_str = ERVCloudForwardingWorker::constructERVBSMRequest(msg);
auto xml_str = ERVCloudForwardingWorker::constructERVBSMRequest(msg, _webPort);
PLOG(logINFO) << "Forward ERV BSM to cloud: " << xml_str << endl;
CloudSendAsync(xml_str, _CLOUDURL, _CLOUDBSMREQ, _POSTMETHOD);
uint64_t delayEnd = std::chrono::duration_cast<std::chrono::milliseconds>(std::chrono::system_clock::now().time_since_epoch()).count();
Expand All @@ -33,7 +34,7 @@ namespace ERVCloudForwardingPlugin
else
{
// If BSM is not from ERV, print debug log
PLOG(logDEBUG) << "Incoming BSM is not from Emergency Response Vehicle (ERV)." << endl;
PLOG(logDEBUG) << "Incoming BSM is not from Emergency Response Vehicle (ERV): " << msg << endl;
}
}

Expand Down Expand Up @@ -193,13 +194,16 @@ namespace ERVCloudForwardingPlugin
if (strcmp(local_method.c_str(), "POST") == 0)
{
curl_easy_setopt(req, CURLOPT_POSTFIELDS, local_msg.c_str());
curl_easy_setopt(req, CURLOPT_TIMEOUT_MS, 1000L);
curl_easy_setopt(req, CURLOPT_TIMEOUT_MS, 5000L); //Http request timeout in 5 seconds
curl_easy_setopt(req, CURLOPT_SSLVERSION, CURL_SSLVERSION_TLSv1_2);
PLOG(logDEBUG) << "Forwarding message to cloud via curl: " << local_msg << endl;
res = curl_easy_perform(req);
if (res != CURLE_OK)
{
fprintf(stderr, "curl send failed: %s\n", curl_easy_strerror(res));
return EXIT_FAILURE;
}else{
PLOG(logDEBUG) << "Successfully forwarded message to cloud via curl: " << local_msg << endl;
}
}
curl_easy_cleanup(req);
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@

namespace ERVCloudForwardingPlugin
{
std::string ERVCloudForwardingWorker::constructERVBSMRequest(BsmMessage &msg)
std::string ERVCloudForwardingWorker::constructERVBSMRequest(BsmMessage &msg, uint16_t v2xhubPort)
{
char xml_str[20000];
std::string bsmHex = encodeBSMHex(msg);
Expand All @@ -20,9 +20,9 @@ namespace ERVCloudForwardingPlugin
return xml_str;
}
std::stringstream route_ss;
//Add vehicle current position to the BSMRequest route point
// Add vehicle current position to the BSMRequest route point
route_ss << "<point><latitude>" << bsmPtr->coreData.lat << "</latitude>"
<< "<longitude>" << bsmPtr->coreData.Long << "</longitude></point>";
<< "<longitude>" << bsmPtr->coreData.Long << "</longitude></point>";
// If there is carma related regional extension value that contains the ERV route points, construct the BSM request with the points.
auto bsmCarmaRegion = bsmPtr->regional->list.array[0]->regExtValue.choice.BasicSafetyMessage_addGrpCarma;
for (int i = 0; i < bsmCarmaRegion.routeDestinationPoints->list.count; i++)
Expand All @@ -32,7 +32,7 @@ namespace ERVCloudForwardingPlugin
route_ss << "<point><latitude>" << latitude << "</latitude>"
<< "<longitude>" << longitude << "</longitude></point>";
}
snprintf(xml_str, sizeof(xml_str), "<?xml version=\"1.0\" encoding=\"UTF-8\"?><BSMRequest><id>%s</id><route>%s</route></BSMRequest>", bsmHex.c_str(), route_ss.str().c_str());
snprintf(xml_str, sizeof(xml_str), "<?xml version=\"1.0\" encoding=\"UTF-8\"?><BSMRequest><id>%s</id><v2xhubPort>%d</v2xhubPort><route>%s</route></BSMRequest>", bsmHex.c_str(), v2xhubPort, route_ss.str().c_str());
return xml_str;
}

Expand All @@ -56,20 +56,12 @@ namespace ERVCloudForwardingPlugin
else
{
// The ERV broadcast BSM that has the PartII content, and the specical vehicle extension within the PartII has the emergency response type.
if (bsm_ptr->partII->list.count > 0 && bsm_ptr->partII->list.array[0]->partII_Value.present == BSMpartIIExtension__partII_Value_PR_SpecialVehicleExtensions )
if (bsm_ptr->partII->list.count > 0 && bsm_ptr->partII->list.array[0]->partII_Value.present == BSMpartIIExtension__partII_Value_PR_SpecialVehicleExtensions)
{
if(bsm_ptr->partII->list.array[0]->partII_Value.choice.SpecialVehicleExtensions.vehicleAlerts->responseType && *bsm_ptr->partII->list.array[0]->partII_Value.choice.SpecialVehicleExtensions.vehicleAlerts->responseType == ResponseType_emergency)
if (bsm_ptr->partII->list.array[0]->partII_Value.choice.SpecialVehicleExtensions.vehicleAlerts->responseType && *bsm_ptr->partII->list.array[0]->partII_Value.choice.SpecialVehicleExtensions.vehicleAlerts->responseType == ResponseType_emergency && bsm_ptr->partII->list.array[0]->partII_Value.choice.SpecialVehicleExtensions.vehicleAlerts->lightsUse == LightbarInUse_inUse && bsm_ptr->partII->list.array[0]->partII_Value.choice.SpecialVehicleExtensions.vehicleAlerts->sirenUse == SirenInUse_inUse)
{
return true;
}
if(bsm_ptr->partII->list.array[0]->partII_Value.choice.SpecialVehicleExtensions.vehicleAlerts->lightsUse == LightbarInUse_inUse)
{
return true;
}
if(bsm_ptr->partII->list.array[0]->partII_Value.choice.SpecialVehicleExtensions.vehicleAlerts->sirenUse == SirenInUse_inUse)
{
return true;
}
}
return false;
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -36,7 +36,7 @@ namespace ERVCloudForwardingPlugin
* @param msg The BSM object
* @return The BSM request in XML format
*/
static std::string constructERVBSMRequest(BsmMessage &msg);
static std::string constructERVBSMRequest(BsmMessage &msg, uint16_t v2xhubPort);
/**
* @brief Check whether the BSM is sent from an ERV
* @param msg The BSM object
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -191,14 +191,15 @@ namespace unit_test

TEST_F(ERVCloudForwardingWorkerTest, constructERVBSMRequest)
{
uint16_t v2xhubPort = 11111;
// BSM without partII
string bsmReq = ERVCloudForwardingPlugin::ERVCloudForwardingWorker::constructERVBSMRequest(*_bsmMessage);
string bsmReq = ERVCloudForwardingPlugin::ERVCloudForwardingWorker::constructERVBSMRequest(*_bsmMessage, v2xhubPort);
ASSERT_EQ("", bsmReq);

// ERV BSM with partII
bsmReq = ERVCloudForwardingPlugin::ERVCloudForwardingWorker::constructERVBSMRequest(*_bsmMessagePartII);
bsmReq = ERVCloudForwardingPlugin::ERVCloudForwardingWorker::constructERVBSMRequest(*_bsmMessagePartII, v2xhubPort);
string expectedBSMHex = "00146e604043030280ffdbfba868b3584ec40824646400320032000c888fc834e37fff0aaa960fa0040d082408804278d693a431ad275c7c6b49d9e8d693b60e35a4f0dc6b49deef1ad27a6235a4f16b8d693e2b1ad279afc6b49f928d693d54e35a5007c6b49ee8f1ad2823235a4f93b8";
string expectedBSMReq = "<?xml version=\"1.0\" encoding=\"UTF-8\"?><BSMRequest><id>" + expectedBSMHex + "</id><route><point><latitude>38954961</latitude><longitude>-77149303</longitude></point><point><latitude>12</latitude><longitude>1312</longitude></point><point><latitude>1012</latitude><longitude>2312</longitude></point><point><latitude>2012</latitude><longitude>3312</longitude></point><point><latitude>3012</latitude><longitude>4312</longitude></point><point><latitude>4012</latitude><longitude>5312</longitude></point><point><latitude>5012</latitude><longitude>6312</longitude></point><point><latitude>6012</latitude><longitude>7312</longitude></point><point><latitude>7012</latitude><longitude>8312</longitude></point></route></BSMRequest>";
string expectedBSMReq = "<?xml version=\"1.0\" encoding=\"UTF-8\"?><BSMRequest><id>" + expectedBSMHex + "</id><v2xhubPort>"+ std::to_string(v2xhubPort)+"</v2xhubPort><route><point><latitude>38954961</latitude><longitude>-77149303</longitude></point><point><latitude>12</latitude><longitude>1312</longitude></point><point><latitude>1012</latitude><longitude>2312</longitude></point><point><latitude>2012</latitude><longitude>3312</longitude></point><point><latitude>3012</latitude><longitude>4312</longitude></point><point><latitude>4012</latitude><longitude>5312</longitude></point><point><latitude>5012</latitude><longitude>6312</longitude></point><point><latitude>6012</latitude><longitude>7312</longitude></point><point><latitude>7012</latitude><longitude>8312</longitude></point></route></BSMRequest>";
ASSERT_EQ(expectedBSMReq, bsmReq);
}

Expand Down
2 changes: 1 addition & 1 deletion src/v2i-hub/ImmediateForwardPlugin/CMakeLists.txt
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
PROJECT ( ImmediateForwardPlugin VERSION 7.4.0 LANGUAGES CXX )
PROJECT ( ImmediateForwardPlugin VERSION 7.5.0 LANGUAGES CXX )

SET (TMX_PLUGIN_NAME "Immediate Forward")

Expand Down
2 changes: 1 addition & 1 deletion src/v2i-hub/LocationPlugin/CMakeLists.txt
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
project( LocationPlugin VERSION 7.4.0 LANGUAGES CXX )
project( LocationPlugin VERSION 7.5.0 LANGUAGES CXX )

SET (TMX_PLUGIN_NAME Location)

Expand Down
2 changes: 1 addition & 1 deletion src/v2i-hub/MapPlugin/CMakeLists.txt
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
PROJECT ( MapPlugin VERSION 7.4.0 LANGUAGES CXX )
PROJECT ( MapPlugin VERSION 7.5.0 LANGUAGES CXX )

SET (TMX_PLUGIN_NAME "MAP")

Expand Down
2 changes: 1 addition & 1 deletion src/v2i-hub/MessageLoggerPlugin/CMakeLists.txt
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
PROJECT ( MessageLoggerPlugin VERSION 7.4.0 LANGUAGES CXX )
PROJECT ( MessageLoggerPlugin VERSION 7.5.0 LANGUAGES CXX )

SET (TMX_PLUGIN_NAME "MessageLoggerPlugin")

Expand Down
2 changes: 1 addition & 1 deletion src/v2i-hub/MessageReceiverPlugin/CMakeLists.txt
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
PROJECT ( MessageReceiverPlugin VERSION 7.4.0 LANGUAGES CXX )
PROJECT ( MessageReceiverPlugin VERSION 7.5.0 LANGUAGES CXX )

set(CMAKE_CXX_STANDARD 11)
set(CMAKE_CXX_STANDARD_REQUIRED ON)
Expand Down
2 changes: 1 addition & 1 deletion src/v2i-hub/ODEForwardPlugin/CMakeLists.txt
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
PROJECT ( ODEForwardPlugin VERSION 7.4.0 LANGUAGES CXX )
PROJECT ( ODEForwardPlugin VERSION 7.5.0 LANGUAGES CXX )

SET (TMX_PLUGIN_NAME "ODEForwardPlugin")

Expand Down
2 changes: 1 addition & 1 deletion src/v2i-hub/PedestrianPlugin/CMakeLists.txt
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
PROJECT ( PedestrianPlugin VERSION 7.4.0 LANGUAGES CXX )
PROJECT ( PedestrianPlugin VERSION 7.5.0 LANGUAGES CXX )

SET (TMX_PLUGIN_NAME "Pedestrian")
add_compile_options(-fPIC)
Expand Down
2 changes: 1 addition & 1 deletion src/v2i-hub/PortDrayagePlugin/CMakeLists.txt
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
PROJECT ( PortDrayagePlugin VERSION 7.4.0 LANGUAGES CXX )
PROJECT ( PortDrayagePlugin VERSION 7.5.0 LANGUAGES CXX )

SET (TMX_PLUGIN_NAME "PortDrayage")
set(CMAKE_AUTOMOC ON)
Expand Down
2 changes: 1 addition & 1 deletion src/v2i-hub/PreemptionPlugin/CMakeLists.txt
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
PROJECT ( PreemptionPlugin VERSION 7.4.0 LANGUAGES CXX )
PROJECT ( PreemptionPlugin VERSION 7.5.0 LANGUAGES CXX )

SET (TMX_PLUGIN_NAME "Preemption")

Expand Down
2 changes: 1 addition & 1 deletion src/v2i-hub/RtcmPlugin/CMakeLists.txt
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
PROJECT ( RtcmPlugin VERSION 7.4.0 LANGUAGES CXX )
PROJECT ( RtcmPlugin VERSION 7.5.0 LANGUAGES CXX )

SET (TMX_PLUGIN_NAME "RTCM")

Expand Down
2 changes: 1 addition & 1 deletion src/v2i-hub/SpatPlugin/CMakeLists.txt
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
PROJECT ( SpatPlugin VERSION 7.4.0 LANGUAGES CXX )
PROJECT ( SpatPlugin VERSION 7.5.0 LANGUAGES CXX )

SET (TMX_PLUGIN_NAME "SPAT")

Expand Down
2 changes: 1 addition & 1 deletion src/v2i-hub/TimPlugin/CMakeLists.txt
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
PROJECT ( TimPlugin VERSION 7.4.0 LANGUAGES CXX )
PROJECT ( TimPlugin VERSION 7.5.0 LANGUAGES CXX )

SET (TMX_PLUGIN_NAME "TIM")
add_compile_options(-fPIC)
Expand Down

0 comments on commit cad66ed

Please sign in to comment.