Log PCM reply time

This commit is contained in:
emanuel 2022-02-22 16:38:55 +00:00
parent 89943a2789
commit 607b0edc01
1 changed files with 14 additions and 3 deletions

View File

@ -173,7 +173,14 @@ static int pcm_check_handle_reply(facilities_t* facilities, PCM_t* pcm, mc_neigh
CoordinationReply_t* reply = &pcm->pcm.maneuverContainer.choice.vehicle.negotiation->choice.reply;
syslog_info("[facilities] [pc] received PCM.reply with %d accepted trajectories", reply->acceptedTrajectoriesIds.list.count);
pthread_mutex_lock(&facilities->epv.time.lock);
uint64_t now_us = it2s_tender_get_now(TIME_MICROSECONDS);
pthread_mutex_unlock(&facilities->epv.time.lock);
syslog_info("[facilities] [pc] received PCM.reply with %d accepted trajectories | took %ld us", reply->acceptedTrajectoriesIds.list.count, now_us-neighbour->t_iid);
neighbour->intersecting = false;
neighbour->proposed = false;
return rv;
}
@ -193,13 +200,17 @@ static int pcm_check_intersection_detected(facilities_t* facilities, PCM_t* pcm,
uint64_t now = it2s_tender_get_clock(&facilities->epv);
if (now < neighbour->t_iid + MC_RESOLUTION_TIMEOUT) {
if (now < neighbour->t_iid/1000 + MC_RESOLUTION_TIMEOUT) {
rv = 0;
goto cleanup;
}
neighbour->intersecting = true;
neighbour->t_iid = now;
pthread_mutex_lock(&facilities->epv.time.lock);
uint64_t now_us = it2s_tender_get_now(TIME_MICROSECONDS) ;
pthread_mutex_unlock(&facilities->epv.time.lock);
neighbour->t_iid = now_us;
if (now < neighbour->t_proposal + MC_RESOLUTION_TIMEOUT) {
rv = 0;