Skip to content

Commit

Permalink
Merge pull request #408 from usdot-fhwa-OPS/release_7.3.1
Browse files Browse the repository at this point in the history
Release 7.3.1
  • Loading branch information
snallamothu authored Aug 1, 2022
2 parents 225f553 + f3018d7 commit e27028a
Show file tree
Hide file tree
Showing 19 changed files with 580 additions and 123 deletions.
5 changes: 0 additions & 5 deletions .circleci/config.yml
Original file line number Diff line number Diff line change
Expand Up @@ -273,13 +273,8 @@ workflows:
requires:
- docker_build_push_develop
- automated_release:
requires:
- docker_build_push
- arm_build_push
filters:
tags:
only: /^[\.0-9]*$/
branches:
ignore: /.*/


2 changes: 1 addition & 1 deletion README.md
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@
[![CircleCI](https://circleci.com/gh/usdot-fhwa-OPS/V2X-Hub.svg?style=svg)](https://circleci.com/gh/usdot-fhwa-OPS/V2X-Hub) | [![Quality Gate Status](https://sonarcloud.io/api/project_badges/measure?project=usdot-fhwa-ops_V2X-Hub&metric=alert_status)](https://sonarcloud.io/dashboard?id=usdot-fhwa-ops_V2X-Hub) |

## Release Notes
As of Feb 3rd, 2022, the V2X Hub software platform is on version 7.1. See more about release 7.1 here: [V2X Hub Release Notes](<docs/Release_notes.md>)
As of July 29th, 2022, the V2X Hub software platform is on version 7.3.1 See more about release 7.3.1 here: [V2X Hub Release Notes](<docs/Release_notes.md>)

# Overview
In order to bring infrastructure components into the Connected Vehicle architecture, you need software that will facilitate the exchange of data in a format that can be understood by both vehicles and infrastructure devices The V2X Hub, takes in data from vehicles via Basic Safety Messages (BSM) in a Society of Automotive Engineers (SAE) standard format and translates the data to a National Transportation Communications for ITS Protocol (NTCIP) that infrastructure components can understand. And vice versa. It translates Signal Phase and Timing (SPaT) data from NTCIP to SAE and sends it to the Roadside Unit (RSU) for broadcast to mobile devices, including vehicles.
Expand Down
6 changes: 3 additions & 3 deletions configuration/amd64/docker-compose.yml
Original file line number Diff line number Diff line change
Expand Up @@ -19,7 +19,7 @@ services:
- ./mysql/port_drayage.sql:/docker-entrypoint-initdb.d/port_drayage.sql

php:
image: usdotfhwaops/php:7.3.0
image: usdotfhwaops/php:7.3.1
container_name: php
network_mode: host
depends_on:
Expand All @@ -29,7 +29,7 @@ services:
tty: true

v2xhub:
image: usdotfhwaops/v2xhubamd:7.3.0
image: usdotfhwaops/v2xhubamd:7.3.1
container_name: v2xhub
network_mode: host
restart: always
Expand All @@ -43,7 +43,7 @@ services:
- ./logs:/var/log/tmx
- ./MAP:/var/www/plugins/MAP
port_drayage_webservice:
image: usdotfhwaops/port-drayage-webservice:7.3.0
image: usdotfhwaops/port-drayage-webservice:7.3.1
container_name: port_drayage_webservice
network_mode: host
secrets:
Expand Down
6 changes: 3 additions & 3 deletions configuration/arm64/docker-compose.yml
Original file line number Diff line number Diff line change
Expand Up @@ -19,7 +19,7 @@ services:
- ./mysql/port_drayage.sql:/docker-entrypoint-initdb.d/port_drayage.sql

php:
image: usdotfhwaops/php_arm:7.3.0
image: usdotfhwaops/php_arm:7.3.1
container_name: php
network_mode: host
depends_on:
Expand All @@ -29,7 +29,7 @@ services:
tty: true

v2xhub:
image: usdotfhwaops/v2xhubarm:7.3.0
image: usdotfhwaops/v2xhubarm:7.3.1
container_name: v2xhub
network_mode: host
restart: always
Expand All @@ -43,7 +43,7 @@ services:
- ./logs:/var/log/tmx
- ./MAP:/var/www/plugins/MAP
port_drayage_webservice:
image: usdotfhwaops/port-drayage-webservice_arm:7.3.0
image: usdotfhwaops/port-drayage-webservice_arm:7.3.1
container_name: port_drayage_webservice
network_mode: host
secrets:
Expand Down
13 changes: 13 additions & 0 deletions docs/Release_notes.md
Original file line number Diff line number Diff line change
@@ -1,5 +1,18 @@
V2X-Hub Release Notes
---------------------------------
Version 7.3.1, released July 29th, 2022
--------------------------------------------------------
**Summary:**
V2X Hub release version 7.3.1 is a hotfix release for 7.3.0. The fixes primarily occurred during the Implementation of IHP2 Speed Harmonization algorithm in Carma-cloud application.

Enhancements in this release:
- Issue 262: Updated CARMA Streets plugin to receive and decode Mobility Path messages into JSON through Kafka.
Bug fixes in this release:
- Issue 392: Fixed Large latencies experienced between V2XHub receiving a Traffic Control Request (TCR) and broadcasting corresponding Traffic Control Messages (TCMs).
- Issue 394: Fixed V2X Hub TCMs are broadcasted more than the configured maximum quantity, and are broadcasted after an acknowledgement is received.
- Issue 404: Fixed V2xhub cannot encode the TCM if the package detail has minplatoonhdwy tag.


Version 7.3.0, released June 14th, 2022
--------------------------------------------------------
**Summary:**
Expand Down
14 changes: 10 additions & 4 deletions src/tmx/Asn_J2735/src/r63/TrafficControlDetail.c
Original file line number Diff line number Diff line change
Expand Up @@ -504,11 +504,17 @@ static asn_per_constraints_t asn_PER_memb_minvehocc_constr_42 CC_NOTUSED = {
{ APC_UNCONSTRAINED, -1, -1, 0, 0 },
0, 0 /* No PER value map */
};
static asn_oer_constraints_t asn_OER_memb_maxplatoonsize_constr_43 CC_NOTUSED = {
{ 1, 1 } /* (1..63) */,
-1};
static asn_per_constraints_t asn_PER_memb_maxplatoonsize_constr_43 CC_NOTUSED = {
{ APC_CONSTRAINED, 6, 6, 1, 63 } /* (1..63) */,
{ APC_UNCONSTRAINED, -1, -1, 0, 0 },
0, 0 /* No PER value map */
};
static asn_oer_constraints_t asn_OER_memb_minplatoonhdwy_constr_44 CC_NOTUSED = {
{ 2, 1 } /* (0..2047) */,
-1};
static asn_per_constraints_t asn_PER_memb_minplatoonhdwy_constr_44 CC_NOTUSED = {
{ APC_CONSTRAINED, 11, 11, 0, 2047 } /* (0..2047) */,
{ APC_UNCONSTRAINED, -1, -1, 0, 0 },
Expand Down Expand Up @@ -982,18 +988,18 @@ asn_TYPE_member_t asn_MBR_TrafficControlDetail_1[] = {
(ASN_TAG_CLASS_CONTEXT | (20 << 2)),
-1, /* IMPLICIT tag at current level */
&asn_DEF_NativeInteger,
memb_maxplatoonsize_constraint_1,
&asn_PER_memb_maxplatoonsize_constr_43,
0,
{ &asn_OER_memb_maxplatoonsize_constr_43, &asn_PER_memb_maxplatoonsize_constr_43, memb_maxplatoonsize_constraint_1 },
0, 0, /* No default value */
"maxplatoonsize"
},
{ ATF_NOFLAGS, 0, offsetof(struct TrafficControlDetail, choice.minplatoonhdwy),
(ASN_TAG_CLASS_CONTEXT | (21 << 2)),
-1, /* IMPLICIT tag at current level */
&asn_DEF_NativeInteger,
memb_minplatoonhdwy_constraint_1,
&asn_PER_memb_minplatoonhdwy_constr_44,
0,
{ &asn_OER_memb_minplatoonhdwy_constr_44, &asn_PER_memb_minplatoonhdwy_constr_44, memb_minplatoonhdwy_constraint_1 },
0, 0, /* No default value */
"minplatoonhdwy"
},
};
Expand Down
32 changes: 32 additions & 0 deletions src/tmx/TmxUtils/test/J2735MessageTest.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -555,4 +555,36 @@ TEST_F(J2735MessageTest, EncodePersonalSafetyMessage){
std::cout << psmENC.get_payload_str()<<std::endl;
ASSERT_EQ(32, psmENC.get_msgId());
}

TEST_F(J2735MessageTest, EncodeTrafficControlRequest){
string tsm4str="<TestMessage04><body><tcrV01><reqid>C7C9A13FE6AC464E</reqid><reqseq>0</reqseq><scale>0</scale><bounds><TrafficControlBounds><oldest>27493419</oldest><reflon>-818349472</reflon><reflat>281118677</reflat><offsets><OffsetPoint><deltax>376</deltax><deltay>0</deltay></OffsetPoint><OffsetPoint><deltax>376</deltax><deltay>1320</deltay></OffsetPoint><OffsetPoint><deltax>0</deltax><deltay>1320</deltay></OffsetPoint></offsets></TrafficControlBounds></bounds></tcrV01> </body></TestMessage04>";
std::stringstream ss;
tsm4Message tsm4msg;
tsm4EncodedMessage tsm4Enc;
tmx::message_container_type container;
ss<<tsm4str;
container.load<XML>(ss);
tsm4msg.set_contents(container.get_storage().get_tree());
tsm4Enc.encode_j2735_message(tsm4msg);
std::cout << tsm4Enc.get_payload_str()<<std::endl;
ASSERT_EQ(244, tsm4Enc.get_msgId());
}


TEST_F(J2735MessageTest, EncodeTrafficControlMessage){
string tsm5str="<TestMessage05><body> <tcmV01> <reqid>30642B129B984162</reqid> <reqseq>0</reqseq> <msgtot>9</msgtot> <msgnum>9</msgnum> <id>0034b8d88d084ffdaf23837926031658</id> <updated>0</updated> <package> <label>workzone - lane closed</label> <tcids> <Id128b>0034b8d88d084ffdaf23837926031658</Id128b> </tcids> </package> <params> <vclasses> <micromobile/> <motorcycle/> <passenger-car/> <light-truck-van/> <bus/> <two-axle-six-tire-single-unit-truck/> <three-axle-single-unit-truck/> <four-or-more-axle-single-unit-truck/> <four-or-fewer-axle-single-trailer-truck/> <five-axle-single-trailer-truck/> <six-or-more-axle-single-trailer-truck/> <five-or-fewer-axle-multi-trailer-truck/> <six-axle-multi-trailer-truck/> <seven-or-more-axle-multi-trailer-truck/> </vclasses> <schedule> <start>27506547</start> <end>153722867280912</end> <dow>1111111</dow> </schedule> <regulatory><true/></regulatory> <detail> <closed><notopen/></closed> </detail> </params> <geometry> <proj>epsg:3785</proj> <datum>WGS84</datum> <reftime>27506547</reftime> <reflon>-818331529</reflon> <reflat>281182119</reflat> <refelv>0</refelv> <refwidth>424</refwidth> <heading>3403</heading> <nodes> <PathNode><x>0</x><y>0</y><width>0</width></PathNode> <PathNode><x>-203</x><y>722</y><width>0</width></PathNode> <PathNode><x>-203</x><y>722</y><width>0</width></PathNode> <PathNode><x>-203</x><y>722</y><width>0</width></PathNode> <PathNode><x>-203</x><y>721</y><width>0</width></PathNode> <PathNode><x>-203</x><y>722</y><width>0</width></PathNode> <PathNode><x>-203</x><y>722</y><width>0</width></PathNode> <PathNode><x>-204</x><y>722</y><width>2</width></PathNode> <PathNode><x>-203</x><y>722</y><width>0</width></PathNode> <PathNode><x>-203</x><y>722</y><width>-2</width></PathNode> <PathNode><x>-203</x><y>721</y><width>0</width></PathNode> <PathNode><x>-203</x><y>722</y><width>0</width></PathNode> <PathNode><x>-203</x><y>722</y><width>0</width></PathNode> <PathNode><x>-203</x><y>722</y><width>0</width></PathNode> <PathNode><x>-203</x><y>722</y><width>0</width></PathNode> <PathNode><x>-13</x><y>46</y><width>0</width></PathNode> </nodes> </geometry> </tcmV01> </body></TestMessage05>";
std::stringstream ss;
tsm5Message tsm5msg;
tsm5EncodedMessage tsm5Enc;
tmx::message_container_type container;
ss<<tsm5str;
container.load<XML>(ss);
tsm5msg.set_contents(container.get_storage().get_tree());
tsm5Enc.encode_j2735_message(tsm5msg);
std::cout << tsm5Enc.get_payload_str()<<std::endl;
ASSERT_EQ(245, tsm5Enc.get_msgId());


}

}
58 changes: 28 additions & 30 deletions src/v2i-hub/CARMACloudPlugin/src/CARMACloudPlugin.cpp
Original file line number Diff line number Diff line change
@@ -1,6 +1,7 @@
#include "CARMACloudPlugin.h"
#include <WGS84Point.h>
#include <math.h>
#include <thread>
using namespace std;
using namespace tmx::messages;
using namespace tmx::utils;
Expand Down Expand Up @@ -95,15 +96,6 @@ void CARMACloudPlugin::HandleCARMARequest(tsm4Message &msg, routeable_message &r

PLOG(logINFO) << "Sent TCR to cloud: "<< xml_str<<endl;
CloudSend(xml_str,url, base_req, method);

//If TCR reqids match with the any existing TCMs, erase the TCMs from the list after sending new TCR request to carma-cloud.
std::lock_guard<mutex> lock(_not_ACK_TCMs_mutex);
if(_not_ACK_TCMs->erase(reqid) <= 0)
{
PLOG(logDEBUG) << "TCR request id =" << reqid << " Not Found in TCM map." << std::endl;
}else{
PLOG(logDEBUG) << "TCR request id =" << reqid << " Found in TCM map. Remove the existing TCMs with the same TCR request id." << std::endl;
}
}

void CARMACloudPlugin::HandleMobilityOperationMessage(tsm3Message &msg, routeable_message &routeableMsg){
Expand Down Expand Up @@ -187,7 +179,7 @@ void CARMACloudPlugin::HandleMobilityOperationMessage(tsm3Message &msg, routeabl
<< "</acknowledgement><description>" << even_log_description
<< "</description></TrafficControlAcknowledgement>";
PLOG(logINFO) << "Sent Negative ACK: "<< sss.str() <<endl;
CloudSend(sss.str(),url, base_ack, method);
CloudSendAsync(sss.str(),url, base_ack, method);
}
}
}
Expand Down Expand Up @@ -327,7 +319,7 @@ void CARMACloudPlugin::TCMAckCheckAndRebroadcastTCM()
<< "</acknowledgement><description>" << _TCMNOAcknowledgementDescription
<< "</description></TrafficControlAcknowledgement>";
PLOG(logINFO) << "Sent No ACK as Time Out: "<< sss.str() <<endl;
CloudSend(sss.str(),url, base_ack, method);
CloudSendAsync(sss.str(),url, base_ack, method);

_not_ACK_TCMs->erase(tcmv01_req_id_hex);
//If time out, stop tracking the starting time of the TCMs being broadcast so far
Expand Down Expand Up @@ -472,31 +464,37 @@ void CARMACloudPlugin::OnStateChange(IvpPluginState state) {
}
}


int CARMACloudPlugin::CloudSend(string msg,string url, string base, string method)
void CARMACloudPlugin::CloudSendAsync(const string& local_msg,const string& local_url, const string& local_base, const string& local_method)
{
CURL *req;
CURLcode res;
string urlfull = url+base;

std::thread t([this, &local_msg, &local_url, &local_base, &local_method](){
CloudSend(local_msg, local_url, local_base, local_method);
});
t.detach();
}

req = curl_easy_init();
if(req) {
curl_easy_setopt(req, CURLOPT_URL, urlfull.c_str());
int CARMACloudPlugin::CloudSend(const string &local_msg, const string& local_url, const string& local_base, const string& local_method)
{
CURL *req;
CURLcode res;
string urlfull = local_url+local_base;
req = curl_easy_init();
if(req) {
curl_easy_setopt(req, CURLOPT_URL, urlfull.c_str());

if(strcmp(method.c_str(),"POST")==0)
if(strcmp(local_method.c_str(),"POST")==0)
{
curl_easy_setopt(req, CURLOPT_POSTFIELDS, msg.c_str());
curl_easy_setopt(req, CURLOPT_TIMEOUT, 2L); // Sets a 2 second timeout
curl_easy_setopt(req, CURLOPT_POSTFIELDS, local_msg.c_str());
curl_easy_setopt(req, CURLOPT_TIMEOUT_MS, 1000L); // Request operation complete within max millisecond timeout
res = curl_easy_perform(req);
if(res != CURLE_OK)
{
fprintf(stderr, "curl send failed: %s\n",curl_easy_strerror(res));
return 1;
}
if(res != CURLE_OK)
{
fprintf(stderr, "curl send failed: %s\n",curl_easy_strerror(res));
return 1;
}
}
curl_easy_cleanup(req);
}
curl_easy_cleanup(req);
}

return 0;
}

Expand Down
4 changes: 3 additions & 1 deletion src/v2i-hub/CARMACloudPlugin/src/CARMACloudPlugin.h
Original file line number Diff line number Diff line change
Expand Up @@ -109,7 +109,9 @@ class CARMACloudPlugin: public PluginClient {

int StartWebService();
void CARMAResponseHandler(QHttpEngine::Socket *socket);
int CloudSend(string msg,string url, string base, string method);
int CloudSend(const string& msg,const string& url, const string& base, const string& method);
//Send HTTP request async
void CloudSendAsync(const string& msg,const string& url, const string& base, const string& method);
string updateTags(string s,string t, string t1);

void HandleCARMARequest(tsm4Message &msg, routeable_message &routeableMsg);
Expand Down
21 changes: 20 additions & 1 deletion src/v2i-hub/CARMAStreetsPlugin/CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -2,4 +2,23 @@ PROJECT ( CARMAStreetsPlugin VERSION 5.0 LANGUAGES CXX )

BuildTmxPlugin ( )

TARGET_LINK_LIBRARIES (${PROJECT_NAME} tmxutils rdkafka++ jsoncpp)
TARGET_LINK_LIBRARIES (${PROJECT_NAME} tmxutils rdkafka++ jsoncpp)

#############
## Testing ##
#############
enable_testing()
include_directories(${PROJECT_SOURCE_DIR}/src)
add_library(${PROJECT_NAME}_lib src/J2735MapToJsonConverter.cpp)
target_link_libraries(${PROJECT_NAME}_lib PUBLIC ${TMXAPI_LIBRARIES}
${ASN_J2735_LIBRARIES}
${MYSQL_LIBRARIES}
${MYSQLCPPCONN_LIBRARIES}
tmxutils
${UUID_LIBRARY})
set(BINARY ${PROJECT_NAME}_test)
file(GLOB_RECURSE TEST_SOURCES LIST_DIRECTORIES false test/*.h test/*.cpp)
set(SOURCES ${TEST_SOURCES} WORKING_DIRECTORY ${PROJECT_SOURCE_DIR}/test)
add_executable(${BINARY} ${TEST_SOURCES})
add_test(NAME ${BINARY} COMMAND ${BINARY})
target_link_libraries(${BINARY} PUBLIC ${PROJECT_NAME}_lib gtest jsoncpp)
5 changes: 5 additions & 0 deletions src/v2i-hub/CARMAStreetsPlugin/manifest.json
Original file line number Diff line number Diff line change
Expand Up @@ -31,6 +31,11 @@
"default": "v2xhub_bsm_in",
"description": "Apache Kafka topic plugin will transmit message to."
},
{
"key": "transmitMapTopic",
"default": "v2xhub_map_msg_in",
"description": "Apache Kafka topic plugin will transmit message to."
},
{
"key": "runKafkaConsumer",
"default": "1",
Expand Down
Loading

0 comments on commit e27028a

Please sign in to comment.