Skip to content

Commit

Permalink
Merge release/neon (7.8.0) branch into master (#633)
Browse files Browse the repository at this point in the history
<!-- Thanks for the contribution, this is awesome. -->

# PR Details
This PR is to merge release/neon branch into master branch for WFD
release with new version.
## 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
SaikrishnaBairamoni authored Aug 28, 2024
2 parents 657a30f + dec8c6a commit b8f4392
Show file tree
Hide file tree
Showing 38 changed files with 1,357 additions and 452 deletions.
6 changes: 5 additions & 1 deletion .sonarqube/sonar-scanner.properties
Original file line number Diff line number Diff line change
Expand Up @@ -57,7 +57,8 @@ sonar.modules= PedestrianPlugin, \
ERVCloudForwardingPlugin, \
CDASimAdapter, \
RSUHealthMonitorPlugin, \
TelematicBridgePlugin
TelematicBridgePlugin, \
MUSTSensorDriverPlugin



Expand Down Expand Up @@ -86,6 +87,7 @@ ERVCloudForwardingPlugin.sonar.projectBaseDir =src/v2i-hub/ERVCloudForwa
CDASimAdapter.sonar.projectBaseDir =src/v2i-hub/CDASimAdapter
RSUHealthMonitorPlugin.sonar.projectBaseDir =src/v2i-hub/RSUHealthMonitorPlugin
TelematicBridgePlugin.sonar.projectBaseDir =src/v2i-hub/TelematicBridgePlugin
MUSTSensorDriverPlugin.sonar.projectBaseDir =src/v2i-hub/MUSTSensorDriverPlugin



Expand Down Expand Up @@ -125,6 +127,7 @@ RSUHealthMonitorPlugin.sonar.sources =src
RSUHealthMonitorPlugin.sonar.exclusions =test/**
TelematicBridgePlugin.sonar.sources =src
TelematicBridgePlugin.sonar.exclusions =test/**
MUSTSensorDriverPlugin.sonar.sources =src

# Tests
# Note: For C++ setting this field does not cause test analysis to occur. It only allows the test source code to be evaluated.
Expand Down Expand Up @@ -154,3 +157,4 @@ ERVCloudForwardingPlugin.sonar.tests=test
CDASimAdapter.sonar.tests=test
RSUHealthMonitorPlugin.sonar.tests=test
TelematicBridgePlugin.sonar.tests=test
MUSTSensorDriverPlugin.sonar.tests=test
14 changes: 14 additions & 0 deletions configuration/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -59,3 +59,17 @@ To support execution in a simulated environment, V2X-Hub is in the process of in
* **V2XHUB_IP** – Environment variable for storing IP address of V2X Hub.
* **INFRASTRUCTURE_ID** – Environment variable for storing infrastructure id of V2X Hub.
* **SENSOR_JSON_FILE_PATH** – Environment variable for storing path to sensor configuration file. This is an optional simulation environment variable that allows for setting up simulated sensor for a V2X-Hub instance. Example file can be found in the **CDASimAdapterPlugin** tests [here](../src/v2i-hub/CDASimAdapter/test/sensors.json).

### Access V2X-Hub
To access V2X-Hub UI, either chromium or google-chrome browser can be used by running the following commands:
```
chromium-browser --ignore-certificate-errors <v2xhub_ip>
```
or

```
google-chrome --ignore-certificate-errors <v2xhub_ip>
```

> [!NOTE]
> V2X-Hub Server uses a secure WebSocket connection to communicate with the browser. For this, V2X-Hub Server uses a self-signed certificate instead of one signed by a trusted certificate authority (CA). Most of the browsers do not trust this until explicitly told to do so by navigating to the WebSocket URL (https://<v2xhub_ip>:19760) and accepting the risk. The `--ignore-certificate-errors` option instructs the browser to ignore certificate errors and warnings which removes manual effort of accepting this risk on V2X-Hub deployments. **Using the browser with this option enabled to access the internet or any other application is not advised as it is a security risk**.
2 changes: 1 addition & 1 deletion configuration/docker-compose.yml
Original file line number Diff line number Diff line change
Expand Up @@ -40,7 +40,7 @@ services:
- SIMULATION_MODE=${SIMULATION_MODE:-false}
- SIMULATION_IP=${SIMULATION_IP:-127.0.0.1}
- SIMULATION_REGISTRATION_PORT=6767
- LOCAL_IP=${LOCAL_IP:-127.0.0.1}
- LOCAL_IP=${V2XHUB_IP:-127.0.0.1}
- TIME_SYNC_TOPIC=time_sync
- TIME_SYNC_PORT=7575
- SIM_V2X_PORT=5757
Expand Down
8 changes: 5 additions & 3 deletions configuration/initialization.sh
Original file line number Diff line number Diff line change
Expand Up @@ -23,9 +23,12 @@ latest_version=$(echo "$release_info" | grep -o '"tag_name": *"[^"]*"' | cut -d
# Fetching all tags from Git repository
tags=$(git ls-remote --tags https://github.com/usdot-fhwa-OPS/V2X-Hub.git | awk -F/ '{print $3}' | sort -V)

# Remove curly braces, Properties found, and duplicate entries
updated_tags=$(echo "$tags" | sed 's/\^{}//' | grep -v '^Properties_Found$' | awk '!seen[$0]++')

# Displaying all available versions
echo "Available versions:"
echo "$tags"
echo "$updated_tags"

# select a version or accept the latest version as default
read -r -p "Enter V2X-Hub Version (choose from the above, or press Enter to use latest version $latest_version): " chosen_version
Expand Down Expand Up @@ -148,5 +151,4 @@ fi
cd "$mysqlDir" || return # return in case cd fails
./add_v2xhub_user.bash

chromium-browser "http://127.0.0.1" > /dev/null 2>&1 &
chromium-browser "https://127.0.0.1:19760" > /dev/null 2>&1 &
chromium-browser --ignore-certificate-errors localhost > /dev/null 2>&1 &
11 changes: 11 additions & 0 deletions configuration/mysql/pvl_lab/README.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,11 @@
# PVL Actions
These are Port Drayage actions created for the PVL Lab for testing of C1T functionality.

## Instructions
Replace the port_drayage.sql file in docker-compose.yml with the file in this directory.
```
db:
image: mysql:8.0
volumes:
- ./mysql/pvl_lab/port_drayage.sql:/docker-entrypoint-initdb.d/port_drayage.sql
```
49 changes: 49 additions & 0 deletions configuration/mysql/pvl_lab/port_drayage.sql
Original file line number Diff line number Diff line change
@@ -0,0 +1,49 @@
-- MySQL 8.0 for Linux amd64 (x86_64) and arm64 (aarch64)
--
-- Host: 127.0.0.1 Database: PORT_DRAYAGE
-- ------------------------------------------------------
-- Server version 7.6.0
-- Current Database: `PORT_DRAYAGE`
--

CREATE DATABASE /*!32312 IF NOT EXISTS*/ `PORT_DRAYAGE` /*!40100 DEFAULT CHARACTER SET latin1 */;

USE `PORT_DRAYAGE`;

--
-- Table structure for table `first_action`
--

DROP TABLE IF EXISTS `first_action`;
CREATE TABLE `first_action` (
`cmv_id` varchar(20) NOT NULL,
`cargo_id` varchar(20) DEFAULT NULL,
`destination_lat` decimal(9,7) NOT NULL,
`destination_long` decimal(9,7) NOT NULL,
`operation` varchar(20) NOT NULL,
`action_id` varchar(36) NOT NULL,
`next_action` varchar(36) NOT NULL
) ENGINE=InnoDB DEFAULT CHARSET=latin1;

LOCK TABLES `first_action` WRITE;
INSERT INTO `first_action` VALUES ('C1T-1','CARGO_A',-5.8,3.7,'PICKUP','4bea1c45-e421-11eb-a8cc-000c29ae3c1t','32320c8a-e422-11eb-a8cc-000c29ae3c1t');
UNLOCK TABLES;

--
-- Table structure for table `freight`
--

DROP TABLE IF EXISTS `freight`;
CREATE TABLE `freight` (
`cmv_id` varchar(20) NOT NULL,
`cargo_id` varchar(20) DEFAULT NULL,
`destination_lat` decimal(9,7) NOT NULL,
`destination_long` decimal(9,7) NOT NULL,
`operation` varchar(20) NOT NULL,
`action_id` varchar(36) NOT NULL,
`next_action` varchar(36) NOT NULL
) ENGINE=InnoDB DEFAULT CHARSET=latin1;

LOCK TABLES `freight` WRITE;
INSERT INTO `freight` VALUES ('C1T-1',NULL,0.2,0.0,'EXIT_STAGING_AREA','32320c8a-e422-11eb-a8cc-000c29ae3c1t','4ace39e6-ee36-11eb-9a03-0242ac130c1t');
UNLOCK TABLES;
22 changes: 22 additions & 0 deletions docs/Release_notes.md
Original file line number Diff line number Diff line change
@@ -1,6 +1,28 @@
V2X-Hub Release Notes
---------------------------------

Version 7.8.0, released Aug 26th, 2024
--------------------------------------------------------

**Summary:**
V2X Hub release 7.8.0 includes significant enhancements such as a new telematics module for streaming V2X Hub data into the telematics server and Influx database, and an RSU Health Monitor to stream J2735 data from V2X Hub to the cloud in near real-time. The telematics plugin now subscribes to all TMX messages from V2X Hub, improving data integration. Additionally, this release addresses key issues, such as fixing the telematics bridge memory usage and correcting the handling of null topics, ensuring accurate data management and system reliability.

Enhancement in this release:

- V2X-Hub PR 564: Implemented a RSU Health Monitor Plugin to directly interface with RSUs connected to V2X Hub via SNMP protocol.
- V2X-Hub PR 565: Implemented a telematics plugin to subscribe to all TMX messages from V2X Hub.
- V2X-Hub PR 567: Implemented the telematic bridge to stream J2735 data from V2XHub to the cloud in near real-time. This includes forwarding JSON messages,
registering with WFD cloud services, mapping TMX message types to topics, and streaming requested TMX messages in JSON format.
- Issue 591: Created a telematics module to stream V2X Hub data into the telematics server and Influx database. This includes connecting to V2X Hub,
subscribing/unsubscribing to topics, and streaming data to the telematics tool.
- V2X-Hub PR 599: Fixed memory usage issue in the telematics bridge, which increased indefinitely when forwarding messages to the telematics tool.
- V2X-Hub PR 606: Updated the RSU Health Monitor plugin to support monitoring the health status of multiple RSUs per V2X Hub instance.
- V2X-Hub PR 613: Added configuration parameters for RSU Health Monitor Plugin to identify the source of payload when multiple RSUs are connected.

Fixes in this release:

- N/A

Version 7.7.0, released Aug 15th, 2024
--------------------------------------------------------

Expand Down
54 changes: 54 additions & 0 deletions src/tmx/Messages/include/SensorDetectedObject.h
Original file line number Diff line number Diff line change
@@ -0,0 +1,54 @@
#ifndef INCLUDE_SIMULATED_SensorDetectedObject_H_
#define INCLUDE_SIMULATED_SensorDetectedObject_H_

#include <tmx/messages/message.hpp>
#include <MessageTypes.h>
#include <Vector3d.h>
#include <Point.h>

namespace tmx
{
namespace messages
{

/**
* This SensorDetectedObject is used to communicate the sensor detected object information with various applications.
* This message is the generic representation of a sensor detection.
*/
class SensorDetectedObject : public tmx::message
{
public:
SensorDetectedObject(){};
SensorDetectedObject(const tmx::message_container_type &contents) : tmx::message(contents) {};
~SensorDetectedObject(){};
// Message type for routing this message through TMX core
static constexpr const char *MessageType = MSGTYPE_APPLICATION_STRING;

// // Message sub type for routing this message through TMX core
static constexpr const char *MessageSubType = MSGSUBTYPE_SENSOR_DETECTED_OBJECT_STRING;

// TODO: Convert this member variable to std::attributes and handle nested object and arrays. (see [CloudHeartbeatMessage.h](./CloudHearbeatMessage.h) array_attribute )

// Classification of detected object
std::string type = "";
// Confidence of type classification
double confidence = 0.0;
// Unique indentifier of sensor reporting detection
std::string sensorId = "";
// String describing projection used to convert cartesian data to WGS84 data
std::string projString = "";
// Unique identifier of detected object
int objectId = 0;
// Cartesian positiion of object. Assumed to be ENU coordinate frame.
tmx::utils::Point position = tmx::utils::Point();
// Cartesian velocity vector of object. Assumed to be ENU coordinate frame.
tmx::utils::Vector3d velocity = tmx::utils::Vector3d();
// Epoch time in milliseconds
long timestamp = 0;

};

}

}; // namespace tmx
#endif
35 changes: 0 additions & 35 deletions src/tmx/Messages/include/simulation/SensorDetectedObject.h

This file was deleted.

18 changes: 18 additions & 0 deletions src/tmx/TmxUtils/src/UdpServer.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -198,4 +198,22 @@ namespace tmx::utils {
return -1;
}

std::string UdpServer::stringTimedReceive(int maxWait_ms) {
std::vector<char> msg(4000);
int num_of_bytes = this->TimedReceive(msg.data(),4000, maxWait_ms);
if (num_of_bytes > 0 ) {
msg.resize(num_of_bytes);
std::string ret(msg.data());
FILE_LOG(logDEBUG) << "UDP Server message received : " << ret << " of size " << num_of_bytes << std::endl;
return ret;
}
else if ( num_of_bytes == 0 ) {
throw UdpServerRuntimeError("Received empty message!");
}
else {
throw UdpServerRuntimeError("Listen timed out after 5 ms!");
}
return "";
}

} // namespace tmx::utils
3 changes: 3 additions & 0 deletions src/tmx/TmxUtils/src/UdpServer.h
Original file line number Diff line number Diff line change
Expand Up @@ -13,6 +13,7 @@
#include <netdb.h>
#include <stdexcept>
#include <tmx/TmxException.hpp>
#include <PluginLog.h>

namespace tmx {
namespace utils {
Expand All @@ -36,6 +37,8 @@ class UdpServer
virtual int Receive(char *msg, size_t maxSize);
virtual int TimedReceive(char *msg, size_t maxSize, int maxWait_ms);

virtual std::string stringTimedReceive(int maxWait_ms=5);

private:
int _socket;
int _port;
Expand Down
19 changes: 19 additions & 0 deletions src/tmx/TmxUtils/src/Vector3d.h
Original file line number Diff line number Diff line change
@@ -0,0 +1,19 @@
#pragma once

namespace tmx::utils {


/// Three dimensional Vector
using Vector3d = struct Vector3d
{
Vector3d() : X(0), Y(0), Z(0) {}

Vector3d(double x, double y, double z = 0.0):
X(x), Y(y), Z(z) { }

double X;
double Y;
double Z;
};

} // namespace tmx::utils
4 changes: 2 additions & 2 deletions src/v2i-hub/CARMAStreetsPlugin/src/CARMAStreetsPlugin.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -25,7 +25,7 @@ CARMAStreetsPlugin::CARMAStreetsPlugin(string name) :
AddMessageFilter < tsm2Message > (this, &CARMAStreetsPlugin::HandleMobilityPathMessage);
AddMessageFilter < MapDataMessage > (this, &CARMAStreetsPlugin::HandleMapMessage);
AddMessageFilter < SrmMessage > (this, &CARMAStreetsPlugin::HandleSRMMessage);
AddMessageFilter < simulation::SensorDetectedObject > (this, &CARMAStreetsPlugin::HandleSimulatedSensorDetectedMessage );
AddMessageFilter < SensorDetectedObject > (this, &CARMAStreetsPlugin::HandleSimulatedSensorDetectedMessage );

SubscribeToMessages();
}
Expand Down Expand Up @@ -704,7 +704,7 @@ void CARMAStreetsPlugin::SubscribeSDSMKafkaTopic(){

}

void CARMAStreetsPlugin::HandleSimulatedSensorDetectedMessage(simulation::SensorDetectedObject &msg, routeable_message &routeableMsg)
void CARMAStreetsPlugin::HandleSimulatedSensorDetectedMessage(SensorDetectedObject &msg, routeable_message &routeableMsg)
{
// TODO: This is a temporary fix for tmx message container property tree
// serializing all attributes as strings. This issue needs to be fixed but
Expand Down
4 changes: 2 additions & 2 deletions src/v2i-hub/CARMAStreetsPlugin/src/CARMAStreetsPlugin.h
Original file line number Diff line number Diff line change
Expand Up @@ -20,7 +20,7 @@
#include <kafka/kafka_client.h>
#include <kafka/kafka_consumer_worker.h>
#include "JsonToJ2735SSMConverter.h"
#include <simulation/SensorDetectedObject.h>
#include <SensorDetectedObject.h>
#include "JsonToJ3224SDSMConverter.h"
#include "J3224ToSDSMJsonConverter.h"
#include "PluginClientClockAware.h"
Expand Down Expand Up @@ -56,7 +56,7 @@ class CARMAStreetsPlugin: public PluginClientClockAware {
* @param msg Detected object received from TMX bus.
* @param routeableMsg routeable_message for detected object.
*/
void HandleSimulatedSensorDetectedMessage(simulation::SensorDetectedObject &msg, routeable_message &routeableMsg);
void HandleSimulatedSensorDetectedMessage(SensorDetectedObject &msg, routeable_message &routeableMsg);
/**
* @brief Overide PluginClientClockAware HandleTimeSyncMessage to producer TimeSyncMessage to kafka for CARMA Streets Time Synchronization.
* @param msg TimeSyncMessage received by plugin when in simulation mode. Message provides current simulation time to all processes.
Expand Down
4 changes: 2 additions & 2 deletions src/v2i-hub/CDASimAdapter/src/CDASimAdapter.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -87,9 +87,9 @@ namespace CDASimAdapter{

}

void CDASimAdapter::forward_simulated_detected_message(tmx::messages::simulation::SensorDetectedObject &msg) {
void CDASimAdapter::forward_simulated_detected_message(tmx::messages::SensorDetectedObject &msg) {
PLOG(logDEBUG1) << "Sending Simulated SensorDetectedObject Message " << msg << std::endl;
this->BroadcastMessage<tmx::messages::simulation::SensorDetectedObject>(msg, _name, 0 , IvpMsgFlags_None);
this->BroadcastMessage<tmx::messages::SensorDetectedObject>(msg, _name, 0 , IvpMsgFlags_None);
}

bool CDASimAdapter::connect() {
Expand Down
Loading

0 comments on commit b8f4392

Please sign in to comment.