Log PCM reply time
This commit is contained in:
parent
89943a2789
commit
607b0edc01
17
src/pcm.c
17
src/pcm.c
|
|
@ -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;
|
||||
|
|
|
|||
Loading…
Reference in New Issue