usdot-fhwa-stol / cdasim

CDASim is an open-source simulation system supporting the development and testing of Cooperative Driving Automation applications.
38 stars 13 forks source link

Update CARLA Ambassador to use XMLRPC Client #165

Closed paulbourelly999 closed 10 months ago

paulbourelly999 commented 11 months ago

PR Details

Description

Add logic to CARLA Ambassador to use XMLRPC Client to dynamically create sensor and retrieve detections. More specifically: the CARLA Ambassador will now create a CARLA XML RPC Client on startup. Its configuration parameters (constructor arguments) will be loaded from the carla_config.json configuration file for the CARLA Ambassador. This is currently limited to carlaCDASimAdapterUrl which tells the XMLRPC client where the XMLRPC server is hosted. Next the CARLA Ambassador now listens for Detector Registration Interactions which are triggered by the Infrastructure Ambassador in response to infrastructure registration attempts that include sensors. When receiving a Detector Registration Interaction, the CARLA Ambassador will tell the CARLA XML RPC Client to make a create_sensor request for each detector registration interaction to create the sensors in CARLA. On each timestep, which should be at 100 ms intervals, the CARLA Ambassador will now also call get_detections for every successful create_sensor attempt. This means that all the created sensor in CARLA will have their detections polled at the same interval as the CARLA Ambassador runs processTimeAdvanceGrant. The detections retrieved from the CARLA CDA Sim Adapter via the XMLRPC client will be serialized into DetectedObject(s) from json and triggered as interactions for other listening Ambassadors, mainly the infrastructure ambassador.

Related Jira Key

CDAR-209

Related Issue

211

Motivation and Context

Add CARLA Sensor pipeline for creating sensors and getting detections for CARMA-Streets

How Has This Been Tested?

Unit testing

Types of changes

Checklist:

sonarcloud[bot] commented 10 months ago

Kudos, SonarCloud Quality Gate passed!    Quality Gate passed

Bug A 0 Bugs
Vulnerability A 0 Vulnerabilities
Security Hotspot A 0 Security Hotspots
Code Smell A 2 Code Smells

77.5% 77.5% Coverage
0.0% 0.0% Duplication

warning The version of Java (11.0.21) you have used to run this analysis is deprecated and we will stop accepting it soon. Please update to at least Java 17. Read more here