|
@@ -177,7 +177,7 @@ void car::handle_anti_coll(const point& pt, const int& sid)
|
|
|
|
|
|
bool s = false;
|
|
bool s = false;
|
|
int d = (c.second->m_timeval >= m_timeval ? (c.second->m_timeval - m_timeval) : (m_timeval - c.second->m_timeval)) / 1000.0;
|
|
int d = (c.second->m_timeval >= m_timeval ? (c.second->m_timeval - m_timeval) : (m_timeval - c.second->m_timeval)) / 1000.0;
|
|
- s = ((c.second->m_timeval >= m_timeval ? (c.second->m_timeval - m_timeval) : (m_timeval - c.second->m_timeval)) /1000.0 <= 30);
|
|
|
|
|
|
+ s = (d <= 30);
|
|
//float dist = pt.dist(*c.second);
|
|
//float dist = pt.dist(*c.second);
|
|
float dist = pt.dist(c.second->m_v_point);
|
|
float dist = pt.dist(c.second->m_v_point);
|
|
log_info("[anti_coll] vid=%d, pid=%d, dist=%.2f", m_id, c.second->m_id, dist);
|
|
log_info("[anti_coll] vid=%d, pid=%d, dist=%.2f", m_id, c.second->m_id, dist);
|
|
@@ -229,7 +229,8 @@ void car::handle_anti_coll(const point& pt, const int& sid)
|
|
//}
|
|
//}
|
|
++i;
|
|
++i;
|
|
}
|
|
}
|
|
- desc += "]";
|
|
|
|
|
|
+
|
|
|
|
+ desc = desc.sub_str(0, desc.length()-1) + "]";
|
|
log_info("[anti_coll] the distance's list between person and vehicle : %s", desc.c_str());
|
|
log_info("[anti_coll] the distance's list between person and vehicle : %s", desc.c_str());
|
|
event_tool::instance()->handle_event(OT_CARD, ET_PERSON_VEHICLE_ANTI_COLLISION, id, min_d, cur_v, true, DT_COMMON, desc);
|
|
event_tool::instance()->handle_event(OT_CARD, ET_PERSON_VEHICLE_ANTI_COLLISION, id, min_d, cur_v, true, DT_COMMON, desc);
|
|
}
|
|
}
|