#include <passing_lane_task_planner.H>
Public Member Functions | |
| passing_lane_task_planner_t () | |
| void | set_plan (unsigned sid, unsigned lid_1_, unsigned lid_2_, double x_, double y_, double b_dis_) |
| , (x_, y_) and start point of blockage, b_len= length of blockage, lid_1_ = start lane id, lid_2_ = end lane id | |
| void | set_path_blocked (unsigned p_id_) |
| Returns true if TP's path is in forward direction. | |
| void | set_active () |
| Informs the TP that it is now active. | |
| path_status_t | generate_path (world_state_t *ws_, path_t &path_, double &p_len_left_, const path_t &base_path_) |
| Generate TP's share of path. Returns 'false' if TP following present TP should not be called else returns 'true'. | |
| bool | get_path_lane_lids (unsigned &sid_, std::vector< unsigned > &lids_) |
| Fills in the list of lane of a segment across which TP's path extends on. Returns false if TP has to mention the list in different formate. | |
| bool | get_path_map_to_lane_lids (std::vector< path_lane_map_t > &pl_ids_) |
| bool | get_start_lid (unsigned &sid_, unsigned &lid_) |
| Returns sid and lid of original lane till bot enters the passing then provide passing lane' sid. | |
| bool | is_task_complete (world_state_t *ws_, double x_, double y_, double heading_) |
| Returns true if TP completed its task. | |
| void | print_plan () |
| Displays the planned path, used only for debugging. | |
Protected Member Functions | |
| void | compute_end_passing_points (rndf_lane_data_t &lb_, double &end_pass_x, double &end_pass_y) |
| Computes the end points on passing lane. Computed every time as shape and position of lanes may be changed over iteration. | |
| void | compute_end_passing_points (world_state_t *ws_, rndf_lane_data_t &lb_, double pres_x_, double pres_y_, double &end_pass_x_, double &end_pass_y_) |
| Computes the end points on passing lane. Computed every time as shape and position of lanes may be changed over iteration. | |
| bool | blockage_just_after (world_state_t *ws_, blocked_lane_data_t &blk_, double x_, double y_, unsigned sid_, unsigned lid_, unsigned &wid_, double dis_) |
| Returns true if found a blockage within dis_ from x_, y_. | |
| void | blk_end_points (world_state_t *ws_, blocked_lane_data_t const &blk_, double &x_, double &y_, unsigned &wid_) |
| Returns wid_ and x_, y_ at end of the blockage (blk_). | |
| bool | blockage_just_before (world_state_t *ws_, blocked_lane_data_t &blk_, double x_, double y_, unsigned sid_, unsigned lid_, unsigned &wid_, double dis_) |
| void | get_blk_around (world_state_t *ws_, double x_, double y_, std::vector< blocked_lane_data_t > &blk_list_, double dis_) |
| bool | closest_blk_before_point (world_state_t *ws_, std::vector< blocked_lane_data_t > const &blk_list, blocked_lane_data_t &best_blk_, unsigned sid_1_, unsigned lid_1_, unsigned wid_1_, unsigned sid_2_, unsigned lid_2_, unsigned wid_2_, double x, double y, double &dis_) |
| void | drive_on_passing_lane (world_state_t *ws_, rndf_lane_data_t &passing_lb_, path_t &path_, double &local_p_len_left_) |
| bool | stop_before_passing (world_state_t *ws_) |
| Returns true if need to stop at intersection, false if everything is good to drive through intersection. | |
| bool | closest_blk_after_point (world_state_t *ws_, std::vector< blocked_lane_data_t > const &blk_list, blocked_lane_data_t &best_blk_, unsigned sid_1_, unsigned lid_1_, unsigned wid_1_, unsigned sid_2_, unsigned lid_2_, unsigned wid_2_, double x, double y, double &dis_) |
| double | distance_to_end_of_lane (world_state_t *ws_, unsigned sid1_, unsigned lid1_, unsigned wid1_, unsigned sid2_, unsigned lid2_, unsigned wid2_, double x_, double y_) |
| double | distance_to_beginning_of_lane (world_state_t *ws_, unsigned sid1_, unsigned lid1_, unsigned wid1_, unsigned sid2_, unsigned lid2_, unsigned wid2_, double x_, double y_) |
Protected Attributes | |
| const uc_planner_param_t * | m_uc_param |
| double | m_width_multiplier |
| double | m_look_ahead_ratio |
| double | m_dis_from_blk |
| double | m_dis_after_blk |
| double | m_stop_time |
| bool | m_stopped |
| bool | m_switch_pass_lane |
| bool | m_drive_on_passing_lane |
| bool | m_switch_orig_lane |
| unsigned | m_sid |
| unsigned | m_lid |
| unsigned | m_passing_lid |
| double | m_blk_x |
| double | m_blk_y |
| double | m_blk_dis |
| passing_lane_task_planner_t::passing_lane_task_planner_t | ( | ) |
| void passing_lane_task_planner_t::blk_end_points | ( | world_state_t * | ws_, | |
| blocked_lane_data_t const & | blk_, | |||
| double & | x_, | |||
| double & | y_, | |||
| unsigned & | wid_ | |||
| ) | [protected] |
Returns wid_ and x_, y_ at end of the blockage (blk_).
References cajun::task_planner_t::m_rndf, m_uc_param, and cajun::uc_planner_param_t::m_width_multiplier.
Referenced by compute_end_passing_points().
| bool passing_lane_task_planner_t::blockage_just_after | ( | world_state_t * | ws_, | |
| blocked_lane_data_t & | blk_, | |||
| double | x_, | |||
| double | y_, | |||
| unsigned | sid_, | |||
| unsigned | lid_, | |||
| unsigned & | wid_, | |||
| double | dis_ | |||
| ) | [protected] |
Returns true if found a blockage within dis_ from x_, y_.
References closest_blk_after_point(), distance_to_end_of_lane(), get_blk_around(), and cajun::task_planner_t::m_rndf.
Referenced by compute_end_passing_points().
| bool passing_lane_task_planner_t::blockage_just_before | ( | world_state_t * | ws_, | |
| blocked_lane_data_t & | blk_, | |||
| double | x_, | |||
| double | y_, | |||
| unsigned | sid_, | |||
| unsigned | lid_, | |||
| unsigned & | wid_, | |||
| double | dis_ | |||
| ) | [protected] |
References closest_blk_before_point(), distance_to_beginning_of_lane(), and get_blk_around().
Referenced by compute_end_passing_points().
| bool cajun::passing_lane_task_planner_t::closest_blk_after_point | ( | world_state_t * | ws_, | |
| std::vector< blocked_lane_data_t > const & | blk_list, | |||
| blocked_lane_data_t & | best_blk_, | |||
| unsigned | sid_1_, | |||
| unsigned | lid_1_, | |||
| unsigned | wid_1_, | |||
| unsigned | sid_2_, | |||
| unsigned | lid_2_, | |||
| unsigned | wid_2_, | |||
| double | x, | |||
| double | y, | |||
| double & | dis_ | |||
| ) | [protected] |
Referenced by blockage_just_after().
| bool cajun::passing_lane_task_planner_t::closest_blk_before_point | ( | world_state_t * | ws_, | |
| std::vector< blocked_lane_data_t > const & | blk_list, | |||
| blocked_lane_data_t & | best_blk_, | |||
| unsigned | sid_1_, | |||
| unsigned | lid_1_, | |||
| unsigned | wid_1_, | |||
| unsigned | sid_2_, | |||
| unsigned | lid_2_, | |||
| unsigned | wid_2_, | |||
| double | x, | |||
| double | y, | |||
| double & | dis_ | |||
| ) | [protected] |
Referenced by blockage_just_before().
| void passing_lane_task_planner_t::compute_end_passing_points | ( | world_state_t * | ws_, | |
| rndf_lane_data_t & | lb_, | |||
| double | pres_x_, | |||
| double | pres_y_, | |||
| double & | end_pass_x_, | |||
| double & | end_pass_y_ | |||
| ) | [protected] |
Computes the end points on passing lane. Computed every time as shape and position of lanes may be changed over iteration.
References blk_end_points(), blockage_just_after(), blockage_just_before(), cajun::uc_planner_param_t::m_dis_after_blk, m_lid, cajun::task_planner_t::m_rndf, m_sid, m_uc_param, and cajun::uc_planner_param_t::m_width_multiplier.
| void passing_lane_task_planner_t::compute_end_passing_points | ( | rndf_lane_data_t & | lb_, | |
| double & | end_pass_x, | |||
| double & | end_pass_y | |||
| ) | [protected] |
Computes the end points on passing lane. Computed every time as shape and position of lanes may be changed over iteration.
References m_blk_dis, m_blk_x, m_blk_y, cajun::uc_planner_param_t::m_dis_after_blk, m_uc_param, and cajun::uc_planner_param_t::m_width_multiplier.
Referenced by drive_on_passing_lane().
| double passing_lane_task_planner_t::distance_to_beginning_of_lane | ( | world_state_t * | ws_, | |
| unsigned | sid1_, | |||
| unsigned | lid1_, | |||
| unsigned | wid1_, | |||
| unsigned | sid2_, | |||
| unsigned | lid2_, | |||
| unsigned | wid2_, | |||
| double | x_, | |||
| double | y_ | |||
| ) | [protected] |
References m_uc_param, and cajun::uc_planner_param_t::m_width_multiplier.
Referenced by blockage_just_before().
| double passing_lane_task_planner_t::distance_to_end_of_lane | ( | world_state_t * | ws_, | |
| unsigned | sid1_, | |||
| unsigned | lid1_, | |||
| unsigned | wid1_, | |||
| unsigned | sid2_, | |||
| unsigned | lid2_, | |||
| unsigned | wid2_, | |||
| double | x_, | |||
| double | y_ | |||
| ) | [protected] |
References m_uc_param, and cajun::uc_planner_param_t::m_width_multiplier.
Referenced by blockage_just_after().
| void passing_lane_task_planner_t::drive_on_passing_lane | ( | world_state_t * | ws_, | |
| rndf_lane_data_t & | passing_lb_, | |||
| path_t & | path_, | |||
| double & | local_p_len_left_ | |||
| ) | [protected] |
References cajun::add_rndf_lane_to_path(), compute_end_passing_points(), cajun::uc_planner_param_t::m_allowed_post_lane_dis, cajun::uc_planner_param_t::m_allowed_pre_lane_dis, m_drive_on_passing_lane, cajun::uc_planner_param_t::m_dynamic_passing_lane_mode, cajun::task_planner_t::m_mdf, m_sid, m_switch_pass_lane, m_uc_param, cajun::uc_planner_param_t::m_width_multiplier, and cajun::PATH_OVER.
Referenced by generate_path().
| path_status_t passing_lane_task_planner_t::generate_path | ( | world_state_t * | ws_, | |
| path_t & | path_, | |||
| double & | p_len_left_, | |||
| const path_t & | base_path_ | |||
| ) | [virtual] |
Generate TP's share of path. Returns 'false' if TP following present TP should not be called else returns 'true'.
Implements cajun::task_planner_t.
References cajun::add_path_to_switch_lane(), cajun::append_path(), cajun::path_turn_info_t::distance, drive_on_passing_lane(), cajun::task_planner_t::path_lane_map_t::end_x, cajun::task_planner_t::path_lane_map_t::end_y, cajun::task_planner_t::path_lane_map_t::lane_id, cajun::LEFT, cajun::LEFT_TURN, m_drive_on_passing_lane, m_lid, cajun::uc_planner_param_t::m_look_ahead_ratio, m_passing_lid, cajun::task_planner_t::m_path_lane_map, m_sid, cajun::task_planner_t::m_status, m_switch_orig_lane, m_switch_pass_lane, cajun::task_planner_t::m_turn, m_uc_param, cajun::uc_planner_param_t::m_width_multiplier, cajun::NO_TURN, cajun::PATH_OKAY, cajun::PATH_OVER, cajun::RIGHT_TURN, cajun::task_planner_t::path_lane_map_t::seg_id, cajun::task_planner_t::path_lane_map_t::start_x, cajun::task_planner_t::path_lane_map_t::start_y, stop_before_passing(), cajun::path_turn_info_t::turn, and cajun::task_planner_t::update_local_path().
| void cajun::passing_lane_task_planner_t::get_blk_around | ( | world_state_t * | ws_, | |
| double | x_, | |||
| double | y_, | |||
| std::vector< blocked_lane_data_t > & | blk_list_, | |||
| double | dis_ | |||
| ) | [protected] |
Referenced by blockage_just_after(), and blockage_just_before().
| bool passing_lane_task_planner_t::get_path_lane_lids | ( | unsigned & | sid_, | |
| std::vector< unsigned > & | lids_ | |||
| ) | [virtual] |
Fills in the list of lane of a segment across which TP's path extends on. Returns false if TP has to mention the list in different formate.
Reimplemented from cajun::task_planner_t.
References m_lid, m_passing_lid, and m_sid.
| bool passing_lane_task_planner_t::get_path_map_to_lane_lids | ( | std::vector< path_lane_map_t > & | pl_ids_ | ) | [virtual] |
Reimplemented from cajun::task_planner_t.
References cajun::task_planner_t::m_path_lane_map.
Referenced by cajun::traffic_verifier_t::passing_lane_free_of_traffic().
| bool passing_lane_task_planner_t::get_start_lid | ( | unsigned & | sid_, | |
| unsigned & | lid_ | |||
| ) | [virtual] |
Returns sid and lid of original lane till bot enters the passing then provide passing lane' sid.
Reimplemented from cajun::task_planner_t.
References m_lid, m_passing_lid, m_sid, and m_switch_pass_lane.
| bool passing_lane_task_planner_t::is_task_complete | ( | world_state_t * | ws_, | |
| double | x_, | |||
| double | y_, | |||
| double | heading_ | |||
| ) | [virtual] |
Returns true if TP completed its task.
Implements cajun::task_planner_t.
References cajun::task_planner_t::m_complete, m_passing_lid, m_sid, m_switch_orig_lane, message, and msg_logger.
| void passing_lane_task_planner_t::print_plan | ( | ) | [virtual] |
Displays the planned path, used only for debugging.
Implements cajun::task_planner_t.
References m_lid, m_passing_lid, m_sid, message, and msg_logger.
| void passing_lane_task_planner_t::set_active | ( | ) | [virtual] |
Informs the TP that it is now active.
Implements cajun::task_planner_t.
References cajun::task_planner_t::m_active, cajun::task_planner_t::m_complete, m_lid, m_passing_lid, cajun::task_planner_t::m_reset_base_path, m_sid, message, and msg_logger.
| void passing_lane_task_planner_t::set_path_blocked | ( | unsigned | p_id_ | ) | [virtual] |
Returns true if TP's path is in forward direction.
Informs the TP that its path is blocked at index p_id_
Reimplemented from cajun::task_planner_t.
References cajun::task_planner_t::m_path.
| void passing_lane_task_planner_t::set_plan | ( | unsigned | sid, | |
| unsigned | lid_1_, | |||
| unsigned | lid_2_, | |||
| double | x_, | |||
| double | y_, | |||
| double | b_dis_ | |||
| ) |
, (x_, y_) and start point of blockage, b_len= length of blockage, lid_1_ = start lane id, lid_2_ = end lane id
References cajun::task_planner_t::m_active, m_blk_dis, m_blk_x, m_blk_y, cajun::task_planner_t::m_complete, m_drive_on_passing_lane, m_lid, m_passing_lid, m_sid, m_stop_time, m_stopped, m_switch_orig_lane, and m_switch_pass_lane.
Referenced by cajun::task_plan_handler_t::insert_PL_TP().
| bool passing_lane_task_planner_t::stop_before_passing | ( | world_state_t * | ws_ | ) | [protected] |
Returns true if need to stop at intersection, false if everything is good to drive through intersection.
References cajun::task_planner_t::m_active, cajun::uc_planner_param_t::m_max_stop_speed, cajun::uc_planner_param_t::m_passing_lane_wait_time, m_stop_time, m_stopped, and m_uc_param.
Referenced by generate_path().
double cajun::passing_lane_task_planner_t::m_blk_dis [protected] |
Referenced by compute_end_passing_points(), and set_plan().
double cajun::passing_lane_task_planner_t::m_blk_x [protected] |
Referenced by compute_end_passing_points(), and set_plan().
double cajun::passing_lane_task_planner_t::m_blk_y [protected] |
Referenced by compute_end_passing_points(), and set_plan().
double cajun::passing_lane_task_planner_t::m_dis_after_blk [protected] |
double cajun::passing_lane_task_planner_t::m_dis_from_blk [protected] |
bool cajun::passing_lane_task_planner_t::m_drive_on_passing_lane [protected] |
Referenced by drive_on_passing_lane(), generate_path(), and set_plan().
unsigned cajun::passing_lane_task_planner_t::m_lid [protected] |
Referenced by compute_end_passing_points(), generate_path(), get_path_lane_lids(), get_start_lid(), print_plan(), set_active(), and set_plan().
double cajun::passing_lane_task_planner_t::m_look_ahead_ratio [protected] |
unsigned cajun::passing_lane_task_planner_t::m_passing_lid [protected] |
Referenced by generate_path(), get_path_lane_lids(), get_start_lid(), is_task_complete(), print_plan(), set_active(), and set_plan().
unsigned cajun::passing_lane_task_planner_t::m_sid [protected] |
double cajun::passing_lane_task_planner_t::m_stop_time [protected] |
Referenced by set_plan(), and stop_before_passing().
bool cajun::passing_lane_task_planner_t::m_stopped [protected] |
Referenced by set_plan(), and stop_before_passing().
bool cajun::passing_lane_task_planner_t::m_switch_orig_lane [protected] |
Referenced by generate_path(), is_task_complete(), and set_plan().
bool cajun::passing_lane_task_planner_t::m_switch_pass_lane [protected] |
Referenced by drive_on_passing_lane(), generate_path(), get_start_lid(), and set_plan().
const uc_planner_param_t* cajun::passing_lane_task_planner_t::m_uc_param [protected] |
double cajun::passing_lane_task_planner_t::m_width_multiplier [protected] |
1.6.1