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

CDAR-756: Update UDPSockets to listen at higher frequency #579

Merged
merged 6 commits into from
Feb 6, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion .github/workflows/sonar-scanner.yml
Original file line number Diff line number Diff line change
Expand Up @@ -21,7 +21,7 @@ jobs:
fetch-depth: 0
submodules: recursive
- name: Install sonar-scanner and build-wrapper
uses: sonarsource/sonarcloud-github-c-cpp@v1
uses: sonarsource/sonarcloud-github-c-cpp@v2
- name: Run install_dependencies.sh script
run: |
scripts/install_dependencies.sh
Expand Down
16 changes: 8 additions & 8 deletions src/v2i-hub/CDASimAdapter/src/CDASimAdapter.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -126,27 +126,27 @@ namespace CDASimAdapter{

void CDASimAdapter::start_immediate_forward_thread() {
if ( !immediate_forward_timer ) {
immediate_forward_timer = std::make_unique<tmx::utils::ThreadTimer>();
immediate_forward_timer = std::make_unique<tmx::utils::ThreadTimer>(std::chrono::milliseconds(5));
}
immediate_forward_tick_id = immediate_forward_timer->AddPeriodicTick([this]() {
this->attempt_message_from_v2xhub();

} // end of lambda expression
, std::chrono::milliseconds(100) );
, std::chrono::milliseconds(5) );

immediate_forward_timer->Start();

}

void CDASimAdapter::start_message_receiver_thread() {
if ( !message_receiver_timer ) {
message_receiver_timer = std::make_unique<tmx::utils::ThreadTimer>();
message_receiver_timer = std::make_unique<tmx::utils::ThreadTimer>(std::chrono::milliseconds(5));
}

message_receiver_tick_id = message_receiver_timer->AddPeriodicTick([this]() {
this->attempt_message_from_simulation();
} // end of lambda expression
, std::chrono::milliseconds(100) );
, std::chrono::milliseconds(5) );
message_receiver_timer->Start();

}
Expand Down Expand Up @@ -174,7 +174,7 @@ namespace CDASimAdapter{
{
if(!external_object_detection_thread_timer)
{
external_object_detection_thread_timer = std::make_unique<tmx::utils::ThreadTimer>();
external_object_detection_thread_timer = std::make_unique<tmx::utils::ThreadTimer>(std::chrono::milliseconds(5));
}
external_object_detection_thread_timer->AddPeriodicTick([this](){
PLOG(logDEBUG1) << "Listening for Sensor Detected Message from CDASim." << std::endl;
Expand All @@ -187,7 +187,7 @@ namespace CDASimAdapter{
PLOG(logDEBUG1) << "CDASim connection has not yet received an simulated sensor detected message!" << std::endl;
}
}//End lambda
, std::chrono::milliseconds(100));
, std::chrono::milliseconds(5));
external_object_detection_thread_timer->Start();
}
catch ( const UdpServerRuntimeError &e )
Expand Down Expand Up @@ -216,13 +216,13 @@ namespace CDASimAdapter{
void CDASimAdapter::start_time_sync_thread_timer() {
PLOG(logDEBUG) << "Creating Thread Timer for time sync" << std::endl;
if ( !time_sync_timer ) {
time_sync_timer = std::make_unique<tmx::utils::ThreadTimer>();
time_sync_timer = std::make_unique<tmx::utils::ThreadTimer>(std::chrono::milliseconds(5));
}
time_sync_tick_id = time_sync_timer->AddPeriodicTick([this]() {
PLOG(logDEBUG1) << "Listening for time sync messages from CDASim." << std::endl;
this->attempt_time_sync();
} // end of lambda expression
, std::chrono::milliseconds(100));
, std::chrono::milliseconds(5));
time_sync_timer->Start();
}

Expand Down
Loading