#include <task_plan_handler.H>
Public Member Functions | |
| task_plan_handler_t (tp_plan_t *tp_plan_, world_state_t *ws_, mission_handler_t *mh, rndf_t const *rndf_, mdf_t const *mdf_) | |
| void | pass_lane (blocked_lane_data_t &blk_data, unsigned path_blk_ind_) |
| Handles blocked LF_TP by modifying its goal to before block point, and adding PL_TP to avoid the blockage and a LF_TP to complete the original LF_TP's goal. | |
| void | insert_UT_TP (unsigned tp_index_, unsigned sid_, unsigned lid_1_, unsigned lid_2_) |
| Creates and inserts a 'Lane following TP' to the m_plan at specified index. | |
| void | plan_task_planner (mission_plan_t &mission_plan_) |
| Creates list of task planners to achieve the mission plan, which is a list of waypoints. m_plan is updated with this list of task planners. | |
| void | flush_tps () |
| Removes all task planners. | |
| void | print () |
Private Member Functions | |
| bool | insert_PL_TP (unsigned tp_index_, blocked_lane_data_t &blk_data, unsigned sid, unsigned org_lid, unsigned passing_lid, double blk_x, double blk_y, double orig_end_x, double orig_end_y) |
| Creates and Inserts 'passing lane TP' to the plan_ at specified index. | |
| void | insert_LF_TP (unsigned tp_index_, rndf_point_t *lane_end_wp_id, double l_end_x, double l_end_y) |
| Creates and inserts a 'Lane following TP' to the m_plan at specified index. | |
| void | insert_to_task_plan (task_planner_t *tp_, unsigned pos_) |
| Inserts given TP at specified index in plan_ task planner list. | |
| double | dis_before_LC (rndf_point_t *wp_id_1_, rndf_point_t *wp_id_2_) |
| returns -1 if lane is not long enough to drive for a while before LC. Else if lane length left apart from that being used for changing lane is greater than dis_before_LC, than retuns dis_before_LC. Else if half of the distance left apart from that being used for changing lane | |
| void | add_lane_tp (rndf_point_t *wp_id_2_, tp_plan_t *tp_plan_) |
| creates and adds a LF_TP to tp_plan_ | |
| void | add_intersection_tp (rndf_point_t *wp_id_1_, rndf_point_t *wp_id_2_, tp_plan_t *tp_plan_) |
| creates and adds a IT_TP to tp_plan_ | |
| void | add_initial_lf (rndf_point_t *wp_id_1_, rndf_point_t *wp_id_2_, tp_plan_t *tp_plan_) |
| void | add_change_lane_tp (rndf_point_t *wp_id_1_, rndf_point_t *wp_id_2_, tp_plan_t *tp_plan_) |
| creates and adds a CL_TP to tp_plan_ | |
| void | add_uturn_tp (rndf_point_t *wp_id_1_, rndf_point_t *wp_id_2_, tp_plan_t *tp_plan_) |
| creates and adds a UT_TP to tp_plan_ | |
| void | add_zone_tp (rndf_point_t *wp_id_1_, rndf_point_t *wp_id_2_, tp_plan_t *tp_plan_) |
| void | add_parking_tp (rndf_point_t *wp_id_1_, rndf_point_t *wp_id_2_, tp_plan_t *tp_plan_) |
| void | add_unparking_tp (rndf_point_t *wp_id_1_, rndf_point_t *wp_id_2_, tp_plan_t *tp_plan_) |
Private Attributes | |
| tp_plan_t * | m_tp_plan |
| world_state_t * | m_ws |
| mission_handler_t * | m_mh |
| rndf_t const * | m_rndf |
| mdf_t const * | m_mdf |
| uc_planner_param_t const * | m_uc_param |
| cajun::task_plan_handler_t::task_plan_handler_t | ( | tp_plan_t * | tp_plan_, | |
| world_state_t * | ws_, | |||
| mission_handler_t * | mh, | |||
| rndf_t const * | rndf_, | |||
| mdf_t const * | mdf_ | |||
| ) | [inline] |
References cajun::uc_planner_param_t::get_uc_planner_param(), and m_uc_param.
| void task_plan_handler_t::add_change_lane_tp | ( | rndf_point_t * | wp_id_1_, | |
| rndf_point_t * | wp_id_2_, | |||
| tp_plan_t * | tp_plan_ | |||
| ) | [private] |
creates and adds a CL_TP to tp_plan_
References add_initial_lf(), add_lane_tp(), cajun::task_planner_t::init(), m_mdf, m_rndf, and cajun::change_lane_task_planner_t::set_plan().
Referenced by plan_task_planner().
| void task_plan_handler_t::add_initial_lf | ( | rndf_point_t * | wp_id_1_, | |
| rndf_point_t * | wp_id_2_, | |||
| tp_plan_t * | tp_plan_ | |||
| ) | [private] |
point on present lane to follow to
References dis_before_LC(), cajun::track_annotation_t::get_lane_clipages(), cajun::rndf_point_t::id(), cajun::task_planner_t::init(), cajun::lane_clipage_info_t::lid1, cajun::lane_clipage_info_t::lid2, cajun::uc_planner_param_t::m_lane_clippage_extra_drive_dis, m_mdf, m_mh, m_rndf, m_uc_param, cajun::uc_planner_param_t::m_width_multiplier, m_ws, cajun::mission_handler_t::rndf_point_at_wp(), cajun::lane_task_planner_t::set_plan(), cajun::lane_clipage_info_t::sid, and cajun::lane_clipage_info_t::wid_before.
Referenced by add_change_lane_tp().
| void task_plan_handler_t::add_intersection_tp | ( | rndf_point_t * | wp_id_1_, | |
| rndf_point_t * | wp_id_2_, | |||
| tp_plan_t * | tp_plan_ | |||
| ) | [private] |
creates and adds a IT_TP to tp_plan_
References cajun::rndf_point_t::is_entry(), cajun::rndf_point_t::is_exit(), cajun::rndf_point_t::is_stop(), m_mdf, m_rndf, and m_ws.
Referenced by plan_task_planner().
| void task_plan_handler_t::add_lane_tp | ( | rndf_point_t * | wp_id_2_, | |
| tp_plan_t * | tp_plan_ | |||
| ) | [private] |
creates and adds a LF_TP to tp_plan_
References cajun::task_planner_t::init(), m_mdf, m_rndf, cajun::lane_task_planner_t::set_plan(), cajun::rndf_point_t::x(), and cajun::rndf_point_t::y().
Referenced by add_change_lane_tp(), and plan_task_planner().
| void task_plan_handler_t::add_parking_tp | ( | rndf_point_t * | wp_id_1_, | |
| rndf_point_t * | wp_id_2_, | |||
| tp_plan_t * | tp_plan_ | |||
| ) | [private] |
References cajun::task_planner_t::init(), m_mdf, m_rndf, and cajun::parking_task_planner_t::set_plan().
Referenced by plan_task_planner().
| void task_plan_handler_t::add_unparking_tp | ( | rndf_point_t * | wp_id_1_, | |
| rndf_point_t * | wp_id_2_, | |||
| tp_plan_t * | tp_plan_ | |||
| ) | [private] |
References cajun::task_planner_t::init(), m_mdf, m_rndf, and cajun::unparking_task_planner_t::set_plan().
Referenced by plan_task_planner().
| void task_plan_handler_t::add_uturn_tp | ( | rndf_point_t * | wp_id_1_, | |
| rndf_point_t * | wp_id_2_, | |||
| tp_plan_t * | tp_plan_ | |||
| ) | [private] |
creates and adds a UT_TP to tp_plan_
References cajun::task_planner_t::init(), m_mdf, m_rndf, and cajun::uturn_task_planner_t::set_plan().
Referenced by plan_task_planner().
| void task_plan_handler_t::add_zone_tp | ( | rndf_point_t * | wp_id_1_, | |
| rndf_point_t * | wp_id_2_, | |||
| tp_plan_t * | tp_plan_ | |||
| ) | [private] |
References cajun::task_planner_t::init(), cajun::rndf_point_t::is_spot(), m_mdf, m_rndf, m_ws, and cajun::zone_task_planner_t::set_plan().
Referenced by plan_task_planner().
| double task_plan_handler_t::dis_before_LC | ( | rndf_point_t * | wp_id_1_, | |
| rndf_point_t * | wp_id_2_ | |||
| ) | [private] |
returns -1 if lane is not long enough to drive for a while before LC. Else if lane length left apart from that being used for changing lane is greater than dis_before_LC, than retuns dis_before_LC. Else if half of the distance left apart from that being used for changing lane
References cajun::uc_planner_param_t::dis_before_LC, cajun::uc_planner_param_t::m_look_ahead_ratio, m_rndf, m_uc_param, cajun::rndf_point_t::x(), and cajun::rndf_point_t::y().
Referenced by add_initial_lf().
| void cajun::task_plan_handler_t::flush_tps | ( | ) | [inline] |
Removes all task planners.
References m_tp_plan.
Referenced by cajun::state_machine_t::start_new_mission_from().
| void task_plan_handler_t::insert_LF_TP | ( | unsigned | tp_index_, | |
| rndf_point_t * | lane_end_wp_id, | |||
| double | l_end_x, | |||
| double | l_end_y | |||
| ) | [private] |
Creates and inserts a 'Lane following TP' to the m_plan at specified index.
References cajun::task_planner_t::init(), insert_to_task_plan(), m_mdf, m_rndf, and cajun::lane_task_planner_t::set_plan().
Referenced by pass_lane().
| bool task_plan_handler_t::insert_PL_TP | ( | unsigned | tp_index_, | |
| blocked_lane_data_t & | blk_data, | |||
| unsigned | sid, | |||
| unsigned | org_lid, | |||
| unsigned | passing_lid, | |||
| double | blk_x, | |||
| double | blk_y, | |||
| double | orig_end_x, | |||
| double | orig_end_y | |||
| ) | [private] |
Creates and Inserts 'passing lane TP' to the plan_ at specified index.
References cajun::task_planner_t::generate_path(), cajun::uc_planner_param_t::get_uc_planner_param(), cajun::task_planner_t::init(), insert_to_task_plan(), cajun::uc_planner_param_t::m_allowed_post_lane_dis, cajun::uc_planner_param_t::m_allowed_pre_lane_dis, m_mdf, m_rndf, m_tp_plan, m_uc_param, cajun::uc_planner_param_t::m_width_multiplier, m_ws, and cajun::passing_lane_task_planner_t::set_plan().
Referenced by pass_lane().
| void task_plan_handler_t::insert_to_task_plan | ( | task_planner_t * | tp_, | |
| unsigned | pos_ | |||
| ) | [private] |
Inserts given TP at specified index in plan_ task planner list.
References m_tp_plan.
Referenced by insert_LF_TP(), insert_PL_TP(), and insert_UT_TP().
| void task_plan_handler_t::insert_UT_TP | ( | unsigned | tp_index_, | |
| unsigned | sid_, | |||
| unsigned | lid_1_, | |||
| unsigned | lid_2_ | |||
| ) |
Creates and inserts a 'Lane following TP' to the m_plan at specified index.
References cajun::task_planner_t::init(), insert_to_task_plan(), m_mdf, m_rndf, and cajun::uturn_task_planner_t::set_plan().
| void task_plan_handler_t::pass_lane | ( | blocked_lane_data_t & | blk_data, | |
| unsigned | path_blk_ind_ | |||
| ) |
Handles blocked LF_TP by modifying its goal to before block point, and adding PL_TP to avoid the blockage and a LF_TP to complete the original LF_TP's goal.
References cajun::task_planner_t::get_path(), cajun::lane_task_planner_t::get_plan(), insert_LF_TP(), insert_PL_TP(), cajun::LANE_TP, m_rndf, m_tp_plan, and cajun::passing_lane_id().
Referenced by cajun::state_machine_t::pass_lane().
| void task_plan_handler_t::plan_task_planner | ( | mission_plan_t & | mission_plan_ | ) |
Creates list of task planners to achieve the mission plan, which is a list of waypoints. m_plan is updated with this list of task planners.
References add_change_lane_tp(), add_intersection_tp(), add_lane_tp(), add_parking_tp(), add_unparking_tp(), add_uturn_tp(), add_zone_tp(), cajun::CHANGE_LANE_TP, cajun::INTERSECTION_TP, cajun::LANE_TP, cajun::uc_planner_param_t::m_print_plan, m_rndf, m_tp_plan, m_uc_param, message, msg_logger, cajun::PARKING_TP, cajun::tp_package_t::rp_1, cajun::tp_package_t::rp_2, cajun::task_planner_for_mission(), cajun::tp_package_t::tp_type, cajun::UNPARKING_TP, cajun::UTURN_TP, and cajun::ZONE_TP.
Referenced by cajun::state_machine_t::start_new_mission_from(), and cajun::planner_t::update_plan().
| void task_plan_handler_t::print | ( | ) |
References m_tp_plan.
mdf_t const* cajun::task_plan_handler_t::m_mdf [private] |
Referenced by add_initial_lf().
rndf_t const* cajun::task_plan_handler_t::m_rndf [private] |
tp_plan_t* cajun::task_plan_handler_t::m_tp_plan [private] |
Referenced by flush_tps(), insert_PL_TP(), insert_to_task_plan(), pass_lane(), plan_task_planner(), and print().
uc_planner_param_t const* cajun::task_plan_handler_t::m_uc_param [private] |
Referenced by add_initial_lf(), dis_before_LC(), insert_PL_TP(), plan_task_planner(), and task_plan_handler_t().
world_state_t* cajun::task_plan_handler_t::m_ws [private] |
Referenced by add_initial_lf(), add_intersection_tp(), add_zone_tp(), and insert_PL_TP().
1.6.1