#include <planner.H>
Public Member Functions | |
| planner_t (mdf_t const *mdf_, rndf_t const *rndf_, world_state_t *ws_) | |
| ~planner_t () | |
| void | init () |
| void | get_steering_path (path_data_t &d_, path_data_t &base_path_) |
| Compute path by calling task planners from m_plan. | |
| path_turn_info_t | get_path_turn_info () |
| Returns the status of up-coming or present turn. | |
| bool | is_finished () |
| void | get_mission_status (mission_status_data_t &ms_) |
| Returns present mission status, which includes next checkpoint id, num checkpoints left and num task planners left. | |
| void | get_pres_lid (unsigned &sid_, unsigned &lid_) |
| Returns lane id on which bot is on. | |
Protected Member Functions | |
| void | get_path (std::deque< task_planner_t * > &task_plan_, path_t &path, const path_t &b_path) |
| bool | get_path_direction (std::deque< task_planner_t * > &task_plan_) |
| void | update_path_flags (path_data_t &path_data_, path_data_t &b_path_data_) |
| Updates the path's flag like, direction (forward, reverse), tight_path (true, false). | |
| bool | update_waypoints_reached (double x_, double y_) |
| bool | ready_to_handle_blocked_lane (const path_t &b_path, unsigned blk_tp_ind_) |
| Returns true if given blockage is on a active task planner's path and bot crossed the point on the path with zero speed. | |
| void | update_task_planner_status (double x_, double y_, double heading_) |
| Check if a task planner is done and if so removes the task planner from m_plan list. | |
| void | update_planner_state () |
| Check if the mission if complete, else if mission is not done but m_plan with task planners is done then call update_plan to compute new plan. Returns false if mission is completed, else returns true. | |
| void | set_final_speed_limit (path_t &path_) |
| Set the speed of final point in the path to zero. | |
| void | get_base_path (path_t &path_) |
| void | reset_path_speed (path_t &path_) |
| Reset the speed of the path, this function is not being use. This functions walks from end of the path to the beginning of the path check for first non zero speed and set the speed of the path following from that poitn to this speed. Was called to unset the zero speed path segment. | |
| void | adjust_path_speeds (path_t &path, const path_t &b_path) |
| Goes through the path to find a point with zero speed limits, if found, sets speed of following points to zero. | |
| void | limit_path_speed (std::deque< task_planner_t * > &task_plan_, unsigned tp_ind_, unsigned path_ind_, double speed_) |
| bool | analyze_path (path_t &b_path_) |
| Goes through the path and check if its blocked by static obstacles and then by dynamic obstacles. Also handles the situation if blocked. Returns true = path is okay, false = path is not okay and re-generate the path. | |
| void | convoy_dynamic_object (blocked_lane_data_t &blk_data, unsigned blk_tp_ind, unsigned path_blk_index, double blk_speed) |
| Handles if the path is blocked by a dynamic object. Presently it sets the speed so as maintain safe distance from front vehicle. | |
| double | dis_along_path (double x1_, double y1_, unsigned tp_ind_, unsigned path_ind_) |
| Computes the distance along the global path, from (x1_, y1_) to bot's bumper. | |
| void | print_plan (std::deque< rndf_t::waypoint_id_t > const &detail_plan_, std::deque< rndf_t::waypoint_id_t > const &filtered_plan_) |
| Prints the detail and filter plans. | |
| void | update_plan (bool could_be_at_start_shoot_=false) |
| Update the mission plan and task planners. | |
| double | distance_from_static_blk (std::deque< task_planner_t * > const &plan_, blocked_lane_data_t const &blk_, unsigned tp_ind_, unsigned path_ind_) |
| Returns true if its confirmed sitting before blocked lane with low speed for some fixed amount of time. This is added to compensate lack of determining static and dynamic objects. | |
| double | compute_convoy_dis (double speed_) |
| bool | convoy_for_dyn_blk (unsigned blk_tp_ind, blocked_lane_data_t const &blk) |
Protected Attributes | |
| const uc_planner_param_t * | m_uc_param |
| double | m_passing_lane_confirm_tstamp |
| mdf_t const * | m_mdf |
| rndf_t const * | m_rndf |
| path_generator_t * | m_path_generator |
| path_verifier_t * | m_path_verifier |
| traffic_verifier_t * | m_traffic_verifier |
| base_path_provider_t * | m_base_path_provider |
| task_plan_handler_t * | m_tp_handler |
| mission_handler_t * | m_mission_handler |
| std::deque< task_planner_t * > | m_plan |
| mission_plan_t | m_mission_plan |
| world_state_t * | m_world_state |
| state_machine_t * | m_sm |
| bool | m_first_iteration |
| planner_t::planner_t | ( | mdf_t const * | mdf_, | |
| rndf_t const * | rndf_, | |||
| world_state_t * | ws_ | |||
| ) |
References cajun::uc_planner_param_t::get_uc_planner_param(), m_base_path_provider, m_first_iteration, m_mdf, m_mission_handler, m_mission_plan, m_passing_lane_confirm_tstamp, m_path_generator, m_path_verifier, m_plan, m_rndf, m_sm, m_tp_handler, m_traffic_verifier, m_uc_param, m_world_state, and msg_logger.
| planner_t::~planner_t | ( | ) |
Goes through the path to find a point with zero speed limits, if found, sets speed of following points to zero.
| bool planner_t::analyze_path | ( | path_t & | b_path_ | ) | [protected] |
Goes through the path and check if its blocked by static obstacles and then by dynamic obstacles. Also handles the situation if blocked. Returns true = path is okay, false = path is not okay and re-generate the path.
m_uc_param->m_treat_dynamic_as_static &&
References convoy_dynamic_object(), convoy_for_dyn_blk(), distance_from_static_blk(), cajun::DYNAMIC, cajun::path_verifier_t::is_task_path_good(), m_path_verifier, m_plan, m_sm, m_traffic_verifier, cajun::uc_planner_param_t::m_treat_dynamic_as_static, m_uc_param, cajun::state_machine_t::nudge_path(), cajun::traffic_verifier_t::path_free_of_traffic(), cajun::STATIC, cajun::state_machine_t::tp_blocked(), cajun::trace_back_global_path(), and cajun::state_machine_t::update_state().
Referenced by get_steering_path().
| double planner_t::compute_convoy_dis | ( | double | speed_ | ) | [protected] |
References cajun::uc_planner_param_t::m_convoy_extra_dis, m_uc_param, and cajun::uc_planner_param_t::m_vehicle_length.
Referenced by convoy_dynamic_object().
| void planner_t::convoy_dynamic_object | ( | blocked_lane_data_t & | blk_data, | |
| unsigned | blk_tp_ind, | |||
| unsigned | path_blk_index, | |||
| double | blk_speed | |||
| ) | [protected] |
Handles if the path is blocked by a dynamic object. Presently it sets the speed so as maintain safe distance from front vehicle.
References compute_convoy_dis(), dis_along_path(), limit_path_speed(), m_plan, cajun::uc_planner_param_t::m_suggested_acceleration, m_uc_param, m_world_state, and cajun::trace_back_global_path().
Referenced by analyze_path().
| bool planner_t::convoy_for_dyn_blk | ( | unsigned | blk_tp_ind, | |
| blocked_lane_data_t const & | blk | |||
| ) | [protected] |
References cajun::CHANGE_LANE_TP, cajun::LANE_TP, and m_plan.
Referenced by analyze_path().
| double planner_t::dis_along_path | ( | double | x1_, | |
| double | y1_, | |||
| unsigned | tp_ind_, | |||
| unsigned | path_ind_ | |||
| ) | [protected] |
Computes the distance along the global path, from (x1_, y1_) to bot's bumper.
References m_plan, and m_world_state.
Referenced by convoy_dynamic_object().
| double planner_t::distance_from_static_blk | ( | std::deque< task_planner_t * > const & | plan_, | |
| blocked_lane_data_t const & | blk_, | |||
| unsigned | tp_ind_, | |||
| unsigned | path_ind_ | |||
| ) | [protected] |
Returns true if its confirmed sitting before blocked lane with low speed for some fixed amount of time. This is added to compensate lack of determining static and dynamic objects.
References cajun::before_intersection_within_dis(), cajun::INTERSECTION_TP, cajun::LANE_TP, cajun::uc_planner_param_t::m_before_stop_intersection_safety_dis, cajun::uc_planner_param_t::m_intersection_queuing_distance, cajun::uc_planner_param_t::m_LF_safety_blk_distance, cajun::uc_planner_param_t::m_min_dis_from_blk, cajun::uc_planner_param_t::m_min_dis_from_uturn_blk, m_rndf, cajun::uc_planner_param_t::m_small_dis_from_blk_at_intersection, m_uc_param, m_world_state, and cajun::UTURN_TP.
Referenced by analyze_path().
| void cajun::planner_t::get_base_path | ( | path_t & | path_ | ) | [protected] |
| void planner_t::get_mission_status | ( | mission_status_data_t & | ms_ | ) |
Returns present mission status, which includes next checkpoint id, num checkpoints left and num task planners left.
References cajun::mission_handler_t::get_next_checkpoint_id(), cajun::mission_handler_t::get_num_checkpoints_left(), m_mission_handler, and m_plan.
Referenced by publish_mission_status().
| void cajun::planner_t::get_path | ( | std::deque< task_planner_t * > & | task_plan_, | |
| path_t & | path, | |||
| const path_t & | b_path | |||
| ) | [protected] |
Referenced by get_steering_path(), and ready_to_handle_blocked_lane().
| bool cajun::planner_t::get_path_direction | ( | std::deque< task_planner_t * > & | task_plan_ | ) | [protected] |
Referenced by update_path_flags().
| path_turn_info_t planner_t::get_path_turn_info | ( | ) |
Returns the status of up-coming or present turn.
References cajun::path_turn_info_t::distance, m_plan, cajun::uc_planner_param_t::m_signal_lookahead_dis, m_uc_param, cajun::NO_TURN, and cajun::path_turn_info_t::turn.
| void planner_t::get_pres_lid | ( | unsigned & | sid_, | |
| unsigned & | lid_ | |||
| ) |
| void planner_t::get_steering_path | ( | path_data_t & | d_, | |
| path_data_t & | base_path_ | |||
| ) |
Compute path by calling task planners from m_plan.
References analyze_path(), cajun::copy_path(), cajun::filter_path(), cajun::path_generator_t::generate_path(), cajun::base_path_provider_t::get_base_path(), get_path(), m_base_path_provider, m_path_generator, m_plan, m_sm, cajun::path_nudger_t::nudge_path(), cajun::state_machine_t::nudge_path(), path_nudger, cajun::path_generator_t::reset_base_path(), set_final_speed_limit(), update_path_flags(), update_planner_state(), and cajun::base_path_provider_t::update_prev_path().
Referenced by main().
| void planner_t::init | ( | ) |
References update_plan().
Referenced by main().
| bool cajun::planner_t::is_finished | ( | ) | [inline] |
References cajun::mission_handler_t::is_finished(), and m_mission_handler.
Referenced by main().
| void cajun::planner_t::limit_path_speed | ( | std::deque< task_planner_t * > & | task_plan_, | |
| unsigned | tp_ind_, | |||
| unsigned | path_ind_, | |||
| double | speed_ | |||
| ) | [protected] |
Referenced by convoy_dynamic_object().
| void planner_t::print_plan | ( | std::deque< rndf_t::waypoint_id_t > const & | detail_plan_, | |
| std::deque< rndf_t::waypoint_id_t > const & | filtered_plan_ | |||
| ) | [protected] |
Prints the detail and filter plans.
References cajun::uc_planner_param_t::m_print_plan, m_uc_param, message, and msg_logger.
| bool planner_t::ready_to_handle_blocked_lane | ( | const path_t & | b_path, | |
| unsigned | blk_tp_ind_ | |||
| ) | [protected] |
Returns true if given blockage is on a active task planner's path and bot crossed the point on the path with zero speed.
References get_path(), m_plan, m_world_state, and cajun::point_on_path().
| void planner_t::reset_path_speed | ( | path_t & | path_ | ) | [protected] |
Reset the speed of the path, this function is not being use. This functions walks from end of the path to the beginning of the path check for first non zero speed and set the speed of the path following from that poitn to this speed. Was called to unset the zero speed path segment.
| void planner_t::set_final_speed_limit | ( | path_t & | path_ | ) | [protected] |
Set the speed of final point in the path to zero.
Referenced by get_steering_path().
| void planner_t::update_path_flags | ( | path_data_t & | path_data_, | |
| path_data_t & | b_path_data_ | |||
| ) | [protected] |
Updates the path's flag like, direction (forward, reverse), tight_path (true, false).
References get_path_direction(), and m_plan.
Referenced by get_steering_path().
| void planner_t::update_plan | ( | bool | could_be_at_start_shoot_ = false |
) | [protected] |
Update the mission plan and task planners.
References m_mission_handler, m_mission_plan, m_plan, m_tp_handler, m_world_state, cajun::task_plan_handler_t::plan_task_planner(), cajun::mission_handler_t::print_plan(), and cajun::mission_handler_t::update_plan().
Referenced by init(), and update_task_planner_status().
| void planner_t::update_planner_state | ( | ) | [protected] |
Check if the mission if complete, else if mission is not done but m_plan with task planners is done then call update_plan to compute new plan. Returns false if mission is completed, else returns true.
References cajun::mission_handler_t::is_finished(), m_mission_handler, m_world_state, msg_logger, update_task_planner_status(), and cajun::mission_handler_t::update_waypoints_reached().
Referenced by get_steering_path().
| void planner_t::update_task_planner_status | ( | double | x_, | |
| double | y_, | |||
| double | heading_ | |||
| ) | [protected] |
Check if a task planner is done and if so removes the task planner from m_plan list.
References cajun::mission_handler_t::flush_blockages(), m_mission_handler, m_plan, m_world_state, message, msg_logger, and update_plan().
Referenced by update_planner_state().
| bool cajun::planner_t::update_waypoints_reached | ( | double | x_, | |
| double | y_ | |||
| ) | [protected] |
Referenced by get_steering_path(), and planner_t().
bool cajun::planner_t::m_first_iteration [protected] |
Referenced by planner_t().
mdf_t const* cajun::planner_t::m_mdf [protected] |
Referenced by planner_t().
mission_handler_t* cajun::planner_t::m_mission_handler [protected] |
Referenced by get_mission_status(), is_finished(), planner_t(), update_plan(), update_planner_state(), and update_task_planner_status().
mission_plan_t cajun::planner_t::m_mission_plan [protected] |
Referenced by planner_t(), and update_plan().
double cajun::planner_t::m_passing_lane_confirm_tstamp [protected] |
Referenced by planner_t().
path_generator_t* cajun::planner_t::m_path_generator [protected] |
Referenced by get_steering_path(), and planner_t().
path_verifier_t* cajun::planner_t::m_path_verifier [protected] |
Referenced by analyze_path(), and planner_t().
std::deque<task_planner_t *> cajun::planner_t::m_plan [protected] |
rndf_t const* cajun::planner_t::m_rndf [protected] |
Referenced by distance_from_static_blk(), and planner_t().
state_machine_t* cajun::planner_t::m_sm [protected] |
Referenced by analyze_path(), get_steering_path(), and planner_t().
task_plan_handler_t* cajun::planner_t::m_tp_handler [protected] |
Referenced by planner_t(), and update_plan().
traffic_verifier_t* cajun::planner_t::m_traffic_verifier [protected] |
Referenced by analyze_path(), and planner_t().
const uc_planner_param_t* cajun::planner_t::m_uc_param [protected] |
world_state_t* cajun::planner_t::m_world_state [protected] |
1.6.1