VCM: ignore VCMs if in maneuver
This commit is contained in:
parent
22a54a1d06
commit
d8dff27d83
|
|
@ -308,6 +308,7 @@ static int vcm_check_handle_reply(VCM_t* vcm, mc_neighbour_s* neighbour) {
|
|||
if (all_rep) {
|
||||
ASN_STRUCT_FREE(asn_DEF_VCM, coordination->session.req);
|
||||
coordination->session.req = NULL;
|
||||
coordination->session.ts = itss_time_get();
|
||||
memset(coordination->session.affs, 0, sizeof(coordination->session.affs));
|
||||
memset(coordination->session.n_affs_neighs, 0, sizeof(coordination->session.n_affs_neighs));
|
||||
coordination->session.n_affs_trjs = 0;
|
||||
|
|
@ -491,6 +492,7 @@ static int intersection_detected(VCM_t* vcm, mc_neighbour_s* neighbour) {
|
|||
ssize_t vcm_req_len = (enc.encoded + 7) / 8;
|
||||
|
||||
coordination->session.req = vcm_req;
|
||||
coordination->session.ts = now;
|
||||
coordination->session.n_affs_trjs = 1;
|
||||
coordination->session.n_affs_neighs[0] = n_intneigh;
|
||||
memcpy(coordination->session.affs[0], intneigh, sizeof(intneigh));
|
||||
|
|
@ -679,15 +681,16 @@ int vcm_check(VCM_t* vcm) {
|
|||
}
|
||||
} else {
|
||||
if (
|
||||
now < neighbour->t_iid/1000 + MC_RESOLUTION_TIMEOUT ||
|
||||
now < neighbour->t_proposal + MC_RESOLUTION_TIMEOUT
|
||||
(coordination->session.req && now < coordination->session.ts + MC_RESOLUTION_TIMEOUT) || /* issued request */
|
||||
now < neighbour->t_proposal + MC_RESOLUTION_TIMEOUT /* issued reply */
|
||||
) { /* in maneuver */
|
||||
log_warn("[coordination] received basic VCM of vehicle while maneuvering with it");
|
||||
log_debug("[coordination] ignoring VCM - currently in maneuver");
|
||||
|
||||
} else { /* not in maneuver OR timeout reached */
|
||||
if (coordination->session.req) { /* clear previous request if exists */
|
||||
ASN_STRUCT_FREE(asn_DEF_VCM, coordination->session.req);
|
||||
coordination->session.req = NULL;
|
||||
coordination->session.ts = now;
|
||||
memset(coordination->session.affs, 0, sizeof(coordination->session.affs));
|
||||
memset(coordination->session.n_affs_neighs, 0, sizeof(coordination->session.n_affs_neighs));
|
||||
coordination->session.n_affs_trjs = 0;
|
||||
|
|
|
|||
Loading…
Reference in New Issue