Skip to content

Commit

Permalink
CDAR-756: Update UDPSockets to listen at higher frequency
Browse files Browse the repository at this point in the history
  • Loading branch information
paulbourelly999 committed Feb 5, 2024
1 parent 136439a commit e6a2279
Showing 1 changed file with 6 additions and 6 deletions.
12 changes: 6 additions & 6 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

0 comments on commit e6a2279

Please sign in to comment.