#include <intersection_tracker.H>
Classes | |
struct | intersection_status_t |
struct | stop_status_t |
Public Member Functions | |
intersection_tracker_t (const rndf_t *rndf_) | |
void | update (std::vector< blocked_lane_data_t > const &blk_lanes_) |
const intersection_status_t * | get_inter_status (rndf_t::waypoint_id_t wp_id_) |
Returns NULL if wp_id_ does not belong to any intersection, else returns the status of all stop points at the intersection to which wp_id_ belongs to. | |
Private Member Functions | |
void | init () |
void | add_intersection_contents (unsigned it_id_, intersection_status_t *&int_st_) |
bool | at_near_stop (const blocked_lane_data_t &blk_lane_, unsigned &int_id_, unsigned &stop_wp_id_) |
Returns true and sets int_id_, if blk_lane is on a stop waypoint, else return false. | |
void | update_stop_point (const blocked_lane_data_t &blk_lanes_, unsigned int_id_, unsigned stop_wp_id_) |
Updates the intersection_status [int_id_] for the blk detected. If its a new blockage then all parameters are set, if its old blockage then only 'm_last_noticed' time is updated. | |
void | flush_old_blockage (intersection_status_t *it_st_) |
Unsets the blockages if they are not detected for 'm_blk_status_timeout'. | |
void | print_stop (stop_status_t const stop_) |
Private Attributes | |
const rndf_t * | m_rndf |
double | m_blk_status_timeout |
double | m_max_dis_before_stop |
double | m_max_dis_after_stop |
std::vector < intersection_status_t * > | m_inter_status |
cajun::intersection_tracker_t::intersection_tracker_t | ( | const rndf_t * | rndf_ | ) | [inline] |
References init().
void intersection_tracker_t::add_intersection_contents | ( | unsigned | it_id_, | |
intersection_status_t *& | int_st_ | |||
) | [private] |
References cajun::intersection_tracker_t::stop_status_t::m_blk_lane_id, cajun::intersection_tracker_t::stop_status_t::m_blk_since, cajun::intersection_tracker_t::intersection_status_t::m_inter_id, cajun::intersection_tracker_t::stop_status_t::m_is_blocked, cajun::intersection_tracker_t::stop_status_t::m_last_noticed, m_rndf, and cajun::intersection_tracker_t::stop_status_t::m_wp_id.
Referenced by init().
bool intersection_tracker_t::at_near_stop | ( | const blocked_lane_data_t & | blk_lane_, | |
unsigned & | int_id_, | |||
unsigned & | stop_wp_id_ | |||
) | [private] |
Returns true and sets int_id_, if blk_lane is on a stop waypoint, else return false.
References m_max_dis_after_stop, m_max_dis_before_stop, and m_rndf.
void intersection_tracker_t::flush_old_blockage | ( | intersection_status_t * | it_st_ | ) | [private] |
Unsets the blockages if they are not detected for 'm_blk_status_timeout'.
References m_blk_status_timeout, and cajun::intersection_tracker_t::intersection_status_t::m_stop_status.
const intersection_tracker_t::intersection_status_t * intersection_tracker_t::get_inter_status | ( | rndf_t::waypoint_id_t | wp_id_ | ) |
Returns NULL if wp_id_ does not belong to any intersection, else returns the status of all stop points at the intersection to which wp_id_ belongs to.
References m_inter_status, and m_rndf.
Referenced by cajun::world_state_t::get_intersection_status().
void intersection_tracker_t::init | ( | ) | [private] |
References add_intersection_contents(), m_blk_status_timeout, m_inter_status, m_max_dis_after_stop, m_max_dis_before_stop, and m_rndf.
Referenced by intersection_tracker_t().
void intersection_tracker_t::print_stop | ( | stop_status_t const | stop_ | ) | [private] |
References cajun::intersection_tracker_t::stop_status_t::m_blk_lane_id, cajun::intersection_tracker_t::stop_status_t::m_blk_since, cajun::intersection_tracker_t::stop_status_t::m_is_blocked, cajun::intersection_tracker_t::stop_status_t::m_last_noticed, and cajun::intersection_tracker_t::stop_status_t::m_wp_id.
void cajun::intersection_tracker_t::update | ( | std::vector< blocked_lane_data_t > const & | blk_lanes_ | ) |
Referenced by cajun::world_state_t::update_intersection().
void intersection_tracker_t::update_stop_point | ( | const blocked_lane_data_t & | blk_lanes_, | |
unsigned | int_id_, | |||
unsigned | stop_wp_id_ | |||
) | [private] |
Updates the intersection_status [int_id_] for the blk detected. If its a new blockage then all parameters are set, if its old blockage then only 'm_last_noticed' time is updated.
References m_blk_status_timeout, m_inter_status, and cajun::intersection_tracker_t::intersection_status_t::m_stop_status.
double cajun::intersection_tracker_t::m_blk_status_timeout [private] |
Referenced by flush_old_blockage(), init(), and update_stop_point().
std::vector<intersection_status_t *> cajun::intersection_tracker_t::m_inter_status [private] |
Referenced by get_inter_status(), init(), and update_stop_point().
double cajun::intersection_tracker_t::m_max_dis_after_stop [private] |
Referenced by at_near_stop(), and init().
double cajun::intersection_tracker_t::m_max_dis_before_stop [private] |
Referenced by at_near_stop(), and init().
const rndf_t* cajun::intersection_tracker_t::m_rndf [private] |
Referenced by add_intersection_contents(), at_near_stop(), get_inter_status(), and init().