cajun::mission_planner_t Class Reference

#include <mission_planner.H>

List of all members.

Classes

class  blocked_edge_t
class  wp_node_t

Public Member Functions

 mission_planner_t (rndf_t const *rndf_, mdf_t const *mdf_, world_state_t *ws_)
bool update_plan (unsigned next_checkpoint_, mission_plan_t &detail_plan_, mission_plan_t &filter_plan_)
 Finds a path on rndf network starting from the waypoint last in the plan_ deque and touching all checkpoints specified in the mdf file starting from 'next_checkpoint_'.
graph_node_tgraph_node_at_wp (rndf_t::waypoint_id_t const &wp_id_)
 Returns the graph's rndf_ponit_t* corresponding the the waypoint.
graph_node_tgraph_node_at_wp (unsigned sid_, unsigned lid_, unsigned wid_)
graph_node_tactive_graph_node_on_or_before (unsigned sid_, unsigned lid_, unsigned wid_)
 Returns active graph node before the given waypoint id.
graph_node_tactive_graph_node_on_or_after (unsigned sid_, unsigned lid_, unsigned wid_)
graph_node_tactive_graph_node_on_or_before (rndf_point_t *rp_)
graph_node_tactive_graph_node_after (rndf_point_t *rp_)
graph_node_tactive_graph_node_before (double x_, double y_, rndf_t::waypoint_id_t const &before_wp_id)
 returns rndf_point_t following 'before_wp_id' which is just behind of (x_, y_). It could be even intermediate rndf_point
graph_node_tgraph_node_at_rp (rndf_point_t *rp_)
bool comes_later_on_wp_seg (rndf_point_t *rp_, double x_, double y_)
 Check is (x_, y_) comes before or after node_ rp_, with respect to the lane segment on which rp_ lies.
rndf_point_trndf_point_at_wp (rndf_t::waypoint_id_t const &wp_id_)
rndf_point_trndf_point_at_wp (unsigned sid_, unsigned lid_, unsigned wid_)
rndf_point_tactive_rndf_point_on_or_before (unsigned sid_, unsigned lid_, unsigned wid_)
rndf_point_tactive_rndf_point_on_or_after (unsigned sid_, unsigned lid_, unsigned wid_)
rndf_point_tactive_rndf_point_before (rndf_point_t *rp_)
rndf_point_tactive_rndf_point_after (rndf_point_t *rp_)
rndf_point_tactive_rndf_point_on_or_before (rndf_point_t *rp_)
rndf_point_tactive_rndf_point_before (double x_, double y_, rndf_t::waypoint_id_t const &before_wp_id)
void unset_all_blockages ()
 Unsets all blockages.
void set_unblocked_till (rndf_point_t *wp_id_1_, rndf_point_t *wp_id_2_)
 Find the edge in the graph which connect wp_id_1 to wp_id_2 and sets its cost to the value returned by compute_cost.
bool set_blocked (rndf_point_t *wp_id_1_, rndf_point_t *wp_id_2_)
 Find the edge in the graph which connect wp_id_1 to wp_id_2 and sets its cost to FLT_MAX.
bool get_plan (rndf_point_t *start_, rndf_point_t *end_, mission_plan_t &path_)
 Returns true if there exist a path from start_ to end_, and fills the path in 'path_'. Else returns false.
void print_graph ()

Private Member Functions

double distance_between_rps (rndf_point_t const *rp_1_, rndf_point_t const *rp_2_)
 Computes distance between rp_1_ to rp_2__.
double compute_cost (rndf_point_t *id_1_, rndf_point_t *id_2_)
 Returns cost between waypoints id_1, and id_2.
void get_lanes_to_merge_with (rndf_t::segment_t const &seg_, unsigned li_, std::vector< unsigned > &lanes_to_merge_)
bool can_pass_between_lanes (rndf_t::segment_t const &seg_, unsigned li1_, unsigned li2_)
 Returns true if can passing between lanes li1_, and li2_ because of direction or lane marking.
void merge_lanes (unsigned sid_, std::vector< unsigned > const &lane_to_merge, std::deque< wp_node_t > &seg_wps)
bool should_be_graph_node (rndf_point_t const *wp_id_)
 Returns true if given wp_id should be a node in graph.
bool is_mission_checkpoint (rndf_point_t const *rp_)
 Returns true if given wp is one of the checkpoint for present mission.
bool create_graph ()
 creates graph for given rndf object. First adds all waypoints of rndf as nodes of the graph and then for each waypoint, its connecting paths are added as edges
void add_zone_to_graph (rndf_t::zone_t const &zone_)
 Add zones to the graph which include adding nodes and edges.
void create_road_edges (std::deque< wp_node_t > &seg_wps)
 Creates edges between nodes of a road. Assumes that wps are ordered along the ROAD.
void create_edges_from_wp (std::deque< wp_node_t > &seg_wps_, unsigned wp_i)
 Create edges from given wp, to all entry pairs if its a exit wp along with edge to next wp on the ROAD if its not already part of exit-entry pair * else just an edge to next wp on the road.
void create_edge (rndf_t::waypoint_id_t wp_id_, rndf_t::waypoint_id_t neighbor_id_)
void create_edge (rndf_point_t *rp, rndf_point_t *neigh_rp)
 Create edge between rp and neigh_rp. Note: rp, neigh_rp should be pointing to the ENTRIES in the graph.
bool edge_exist (graph_node_t *v1, graph_node_t *v2)
bool not_close (std::deque< wp_node_t > &seg_wps_, unsigned ind1_, unsigned ind2_)
void print_wp_node (std::deque< wp_node_t > &seg_wps_, unsigned wp_i)
bool mission_spot (rndf_t::spot_t const &spot_)
 returns true if the spot is part of mission
bool lanes_in_same_direction (rndf_t::lane_t const &lane_, rndf_t::lane_t const &n_lane_)
 Determines all lanes on segmeng 'seg_id_' that are in 'dir_' direction and returns this list in vector 'similar_lanes_'.
bool is_next_checkpoint (rndf_point_t *rp_, unsigned next_ckpt_)
bool keep_as_individual_rp_in_plan (rndf_point_t *rp_, unsigned next_ckpt_)
 returns true if this waypoint should not be filtered from top level plan. A waypoint is not filtered if its the immediate checkpoint, if its a entry_wp and previous wp in the path is its corresponding exit_wp or if present wp is exit_wp and next waypoint on the path is the corresponding entry_wp
bool is_entry_exit_pair (rndf_point_t *exit_rp_, rndf_point_t *entry_rp_)
 Returns true if exit_rp_ and entry_rp are exit entry pairs.
bool is_entry_exit_pair_to_keep (rndf_point_t *exit_rp_, rndf_point_t *entry_rp_)
 Returns true if this is a exit enty and should be keep this exit entry pair.
void filter_detail_plan (mission_plan_t const &input_plan_, mission_plan_t &ouput_plan_, unsigned next_checkpoint_)
 Filters the top level mission plan to remove intermediate waypoints within a road, and keep entry, exit, checkpoints (that are listed in the mdf MISSION).
bool is_active_node (graph_node_t const *gn)
void get_inter_rp_in_wp_seg (rndf_t::waypoint_id_t const &wp_id_, std::vector< rndf_point_t * > rp_list_)
unsigned block_index (graph_node_t const *src_vertex_, graph_node_t const *des_vertex_)
bool unset_first_blockage ()
 Finds the oldest blocked edge, sets it unblocked and removes it from m_blocked_edges list.
rndf_point_tcreate_rndf_point (rndf_t const *rndf_, rndf_t::waypoint_id_t const &wp_id)
rndf_point_tcreate_rndf_point (rndf_t const *rndf_, unsigned sid_, unsigned lid_, unsigned wid_)
rndf_point_tinsert_graph_node (unsigned sid_, unsigned lid_, unsigned wid_, double x_, double y_)
 Sets a edge between.
rndf_point_tterminate_road_at (unsigned sid_, unsigned lid_, unsigned wid_, double x_, double y_)
rndf_point_tstart_road_at (unsigned sid_, unsigned lid_, unsigned wid_, double x_, double y_)
rndf_point_talready_added_inter_rp_for_blk (unsigned sid_, unsigned lid_, unsigned wid_, double x_, double y_)
 Returns true if the road is already blocked for this blockage.
void move_existing_inter_rp (rndf_point_t *blk_rp, unsigned wid_, double x_, double y_)
bool get_other_end_inter_rp (rndf_point_t *rp_, unsigned other_lid_, rndf_point_t *&neigh_rp_, rndf_point_t *&follow_rp_)
 returns true if able to find the rp on neighboring lane connected from given rp_, and al rp following given rp_ on same lane
void print_mission (mission_plan_t const &plan_)

Private Attributes

const uc_planner_param_tm_uc_param
rndf_t const * m_rndf
mdf_t const * m_mdf
world_state_t * m_ws
graph_t< rp_containter_tm_graph
graph_search_t< rp_containter_t > * m_g_search
std::deque< rndf_point_t * > m_intermediate_rps
std::deque< blocked_edge_tm_blocked_edges

Friends

class mission_handler_t

Constructor & Destructor Documentation

mission_planner_t::mission_planner_t ( rndf_t const *  rndf_,
mdf_t const *  mdf_,
world_state_t *  ws_ 
)

brief Constructor: Creates graph for given rndf, and creates graph search object

References create_graph(), cajun::uc_planner_param_t::get_uc_planner_param(), m_g_search, m_graph, m_uc_param, and msg_logger.


Member Function Documentation

graph_node_t * mission_planner_t::active_graph_node_after ( rndf_point_t rp_  ) 
graph_node_t * mission_planner_t::active_graph_node_before ( double  x_,
double  y_,
rndf_t::waypoint_id_t const &  before_wp_id 
)

returns rndf_point_t following 'before_wp_id' which is just behind of (x_, y_). It could be even intermediate rndf_point

References comes_later_on_wp_seg(), get_inter_rp_in_wp_seg(), graph_node_at_rp(), graph_node_at_wp(), cajun::rndf_point_t::id(), is_active_node(), cajun::rndf_point_t::x(), and cajun::rndf_point_t::y().

Referenced by active_rndf_point_before().

graph_node_t * mission_planner_t::active_graph_node_on_or_after ( unsigned  sid_,
unsigned  lid_,
unsigned  wid_ 
)
graph_node_t * mission_planner_t::active_graph_node_on_or_before ( rndf_point_t rp_  ) 
graph_node_t * mission_planner_t::active_graph_node_on_or_before ( unsigned  sid_,
unsigned  lid_,
unsigned  wid_ 
)
rndf_point_t * mission_planner_t::active_rndf_point_after ( rndf_point_t rp_  ) 
rndf_point_t * mission_planner_t::active_rndf_point_before ( double  x_,
double  y_,
rndf_t::waypoint_id_t const &  before_wp_id 
)
rndf_point_t* cajun::mission_planner_t::active_rndf_point_before ( rndf_point_t rp_  ) 
rndf_point_t * mission_planner_t::active_rndf_point_on_or_after ( unsigned  sid_,
unsigned  lid_,
unsigned  wid_ 
)
rndf_point_t * mission_planner_t::active_rndf_point_on_or_before ( rndf_point_t rp_  ) 
rndf_point_t * mission_planner_t::active_rndf_point_on_or_before ( unsigned  sid_,
unsigned  lid_,
unsigned  wid_ 
)
void mission_planner_t::add_zone_to_graph ( rndf_t::zone_t const &  zone_  )  [private]
rndf_point_t * mission_planner_t::already_added_inter_rp_for_blk ( unsigned  sid_,
unsigned  lid_,
unsigned  wid_,
double  x_,
double  y_ 
) [private]
unsigned mission_planner_t::block_index ( graph_node_t const *  src_vertex_,
graph_node_t const *  des_vertex_ 
) [private]

References m_blocked_edges.

Referenced by set_unblocked_till().

bool mission_planner_t::can_pass_between_lanes ( rndf_t::segment_t const &  seg_,
unsigned  li1_,
unsigned  li2_ 
) [private]

Returns true if can passing between lanes li1_, and li2_ because of direction or lane marking.

References cajun::LEFT, and cajun::RIGHT.

bool mission_planner_t::comes_later_on_wp_seg ( rndf_point_t rp_,
double  x_,
double  y_ 
)

Check is (x_, y_) comes before or after node_ rp_, with respect to the lane segment on which rp_ lies.

References cajun::rndf_point_t::id(), m_rndf, m_uc_param, cajun::uc_planner_param_t::m_width_multiplier, m_ws, cajun::rndf_point_t::x(), and cajun::rndf_point_t::y().

Referenced by active_graph_node_before(), and start_road_at().

double mission_planner_t::compute_cost ( rndf_point_t id_1_,
rndf_point_t id_2_ 
) [private]
void mission_planner_t::create_edge ( rndf_point_t rp,
rndf_point_t neigh_rp 
) [private]

Create edge between rp and neigh_rp. Note: rp, neigh_rp should be pointing to the ENTRIES in the graph.

References compute_cost(), edge_exist(), and graph_node_at_rp().

void mission_planner_t::create_edge ( rndf_t::waypoint_id_t  wp_id_,
rndf_t::waypoint_id_t  neighbor_id_ 
) [private]
void cajun::mission_planner_t::create_edges_from_wp ( std::deque< wp_node_t > &  seg_wps_,
unsigned  wp_i 
) [private]

Create edges from given wp, to all entry pairs if its a exit wp along with edge to next wp on the ROAD if its not already part of exit-entry pair * else just an edge to next wp on the road.

bool mission_planner_t::create_graph (  )  [private]
rndf_point_t * mission_planner_t::create_rndf_point ( rndf_t const *  rndf_,
unsigned  sid_,
unsigned  lid_,
unsigned  wid_ 
) [private]
rndf_point_t * mission_planner_t::create_rndf_point ( rndf_t const *  rndf_,
rndf_t::waypoint_id_t const &  wp_id 
) [private]

Referenced by add_zone_to_graph(), and create_graph().

void cajun::mission_planner_t::create_road_edges ( std::deque< wp_node_t > &  seg_wps  )  [private]

Creates edges between nodes of a road. Assumes that wps are ordered along the ROAD.

Referenced by create_graph().

double mission_planner_t::distance_between_rps ( rndf_point_t const *  rp_1_,
rndf_point_t const *  rp_2_ 
) [private]
bool mission_planner_t::edge_exist ( graph_node_t v1,
graph_node_t v2 
) [private]

Referenced by create_edge().

void mission_planner_t::filter_detail_plan ( mission_plan_t const &  input_plan_,
mission_plan_t ouput_plan_,
unsigned  next_checkpoint_ 
) [private]

Filters the top level mission plan to remove intermediate waypoints within a road, and keep entry, exit, checkpoints (that are listed in the mdf MISSION).

References cajun::consecutive_rndf_points(), is_entry_exit_pair(), is_entry_exit_pair_to_keep(), is_next_checkpoint(), keep_as_individual_rp_in_plan(), m_uc_param, and cajun::uc_planner_param_t::m_verbose_printing.

Referenced by update_plan().

void cajun::mission_planner_t::get_inter_rp_in_wp_seg ( rndf_t::waypoint_id_t const &  wp_id_,
std::vector< rndf_point_t * >  rp_list_ 
) [private]
void cajun::mission_planner_t::get_lanes_to_merge_with ( rndf_t::segment_t const &  seg_,
unsigned  li_,
std::vector< unsigned > &  lanes_to_merge_ 
) [private]

Referenced by create_graph().

bool mission_planner_t::get_other_end_inter_rp ( rndf_point_t rp_,
unsigned  other_lid_,
rndf_point_t *&  neigh_rp_,
rndf_point_t *&  follow_rp_ 
) [private]

returns true if able to find the rp on neighboring lane connected from given rp_, and al rp following given rp_ on same lane

References graph_node_at_rp(), and cajun::rndf_point_t::is_rndf_wp().

Referenced by cajun::mission_handler_t::set_blocked().

bool cajun::mission_planner_t::get_plan ( rndf_point_t start_,
rndf_point_t end_,
mission_plan_t path_ 
)

Returns true if there exist a path from start_ to end_, and fills the path in 'path_'. Else returns false.

Referenced by cajun::mission_handler_t::plan_to_next_checkpoint(), and update_plan().

graph_node_t * mission_planner_t::graph_node_at_rp ( rndf_point_t rp_  ) 
graph_node_t * mission_planner_t::graph_node_at_wp ( unsigned  sid_,
unsigned  lid_,
unsigned  wid_ 
)
graph_node_t * mission_planner_t::graph_node_at_wp ( rndf_t::waypoint_id_t const &  wp_id_  ) 

Returns the graph's rndf_ponit_t* corresponding the the waypoint.

References cajun::graph_t< ID_T >::find_vertex(), m_graph, and m_rndf.

Referenced by active_graph_node_before(), and rndf_point_at_wp().

rndf_point_t * mission_planner_t::insert_graph_node ( unsigned  sid_,
unsigned  lid_,
unsigned  wid_,
double  x_,
double  y_ 
) [private]
bool mission_planner_t::is_active_node ( graph_node_t const *  gn  )  [private]
bool mission_planner_t::is_entry_exit_pair ( rndf_point_t exit_rp_,
rndf_point_t entry_rp_ 
) [private]

Returns true if exit_rp_ and entry_rp are exit entry pairs.

References cajun::rndf_point_t::id(), cajun::rndf_point_t::is_entry(), cajun::rndf_point_t::is_exit(), and m_rndf.

Referenced by filter_detail_plan(), and is_entry_exit_pair_to_keep().

bool mission_planner_t::is_entry_exit_pair_to_keep ( rndf_point_t exit_rp_,
rndf_point_t entry_rp_ 
) [private]

Returns true if this is a exit enty and should be keep this exit entry pair.

References is_entry_exit_pair(), and cajun::rndf_point_t::is_stop().

Referenced by filter_detail_plan().

bool mission_planner_t::is_mission_checkpoint ( rndf_point_t const *  rp_  )  [private]

Returns true if given wp is one of the checkpoint for present mission.

References cajun::rndf_point_t::checkpoint_id(), cajun::rndf_point_t::is_checkpoint(), and m_mdf.

Referenced by should_be_graph_node().

bool mission_planner_t::is_next_checkpoint ( rndf_point_t rp_,
unsigned  next_ckpt_ 
) [private]
bool mission_planner_t::keep_as_individual_rp_in_plan ( rndf_point_t rp_,
unsigned  next_ckpt_ 
) [private]

returns true if this waypoint should not be filtered from top level plan. A waypoint is not filtered if its the immediate checkpoint, if its a entry_wp and previous wp in the path is its corresponding exit_wp or if present wp is exit_wp and next waypoint on the path is the corresponding entry_wp

References cajun::rndf_point_t::in_zone(), and cajun::rndf_point_t::is_rndf_wp().

Referenced by filter_detail_plan().

bool mission_planner_t::lanes_in_same_direction ( rndf_t::lane_t const &  lane_,
rndf_t::lane_t const &  n_lane_ 
) [private]

Determines all lanes on segmeng 'seg_id_' that are in 'dir_' direction and returns this list in vector 'similar_lanes_'.

Returns true if given 2 lanes are in same direction.

Geneates a priority queue with all wps of the segment arranged by their distance from along the segment. The distance starts from 1st wp of 1st lane. Distance of wps on lane 1 is equal to distance along the lane, while distance of a wp on other adjacent lanes is equal to the sum of the distance of the closest wp on lane 1 + atrack distance of present wp to this closest wp on lane 1 along the orientation of the lane 1 at that waypoint

Returns true if given 2 lanes are in same direction. Determines this by comparing the orientations of the initial part of the lane segments and checking the xtrack distance between the lanes

void cajun::mission_planner_t::merge_lanes ( unsigned  sid_,
std::vector< unsigned > const &  lane_to_merge,
std::deque< wp_node_t > &  seg_wps 
) [private]

Referenced by create_graph().

bool mission_planner_t::mission_spot ( rndf_t::spot_t const &  spot_  )  [private]

returns true if the spot is part of mission

References m_mdf, m_uc_param, and cajun::uc_planner_param_t::m_verbose_printing.

Referenced by add_zone_to_graph().

void mission_planner_t::move_existing_inter_rp ( rndf_point_t blk_rp,
unsigned  wid_,
double  x_,
double  y_ 
) [private]
bool cajun::mission_planner_t::not_close ( std::deque< wp_node_t > &  seg_wps_,
unsigned  ind1_,
unsigned  ind2_ 
) [private]
void cajun::mission_planner_t::print_graph (  )  [inline]
void mission_planner_t::print_mission ( mission_plan_t const &  plan_  )  [private]
void cajun::mission_planner_t::print_wp_node ( std::deque< wp_node_t > &  seg_wps_,
unsigned  wp_i 
) [private]
rndf_point_t * mission_planner_t::rndf_point_at_wp ( unsigned  sid_,
unsigned  lid_,
unsigned  wid_ 
)

References graph_node_at_wp().

rndf_point_t * mission_planner_t::rndf_point_at_wp ( rndf_t::waypoint_id_t const &  wp_id_  ) 
bool mission_planner_t::set_blocked ( rndf_point_t wp_id_1_,
rndf_point_t wp_id_2_ 
)

Find the edge in the graph which connect wp_id_1 to wp_id_2 and sets its cost to FLT_MAX.

References graph_node_at_rp(), and m_blocked_edges.

Referenced by insert_graph_node(), cajun::mission_handler_t::set_blocked(), and terminate_road_at().

void mission_planner_t::set_unblocked_till ( rndf_point_t wp_id_1_,
rndf_point_t wp_id_2_ 
)

Find the edge in the graph which connect wp_id_1 to wp_id_2 and sets its cost to the value returned by compute_cost.

References block_index(), graph_node_at_rp(), m_blocked_edges, and unset_first_blockage().

bool mission_planner_t::should_be_graph_node ( rndf_point_t const *  wp_id_  )  [private]

Returns true if given wp_id should be a node in graph.

References cajun::rndf_point_t::is_entry(), cajun::rndf_point_t::is_exit(), is_mission_checkpoint(), and cajun::rndf_point_t::is_rndf_wp().

rndf_point_t * mission_planner_t::start_road_at ( unsigned  sid_,
unsigned  lid_,
unsigned  wid_,
double  x_,
double  y_ 
) [private]
rndf_point_t * mission_planner_t::terminate_road_at ( unsigned  sid_,
unsigned  lid_,
unsigned  wid_,
double  x_,
double  y_ 
) [private]
void mission_planner_t::unset_all_blockages (  ) 

Unsets all blockages.

References m_blocked_edges, and unset_first_blockage().

Referenced by cajun::mission_handler_t::unset_all_blockages().

bool mission_planner_t::unset_first_blockage (  )  [private]

Finds the oldest blocked edge, sets it unblocked and removes it from m_blocked_edges list.

References compute_cost(), and m_blocked_edges.

Referenced by set_unblocked_till(), and unset_all_blockages().

bool mission_planner_t::update_plan ( unsigned  next_checkpoint_,
mission_plan_t detail_plan_,
mission_plan_t filter_plan_ 
)

Finds a path on rndf network starting from the waypoint last in the plan_ deque and touching all checkpoints specified in the mdf file starting from 'next_checkpoint_'.

Finds a path on rndf network starting from the waypoint last in the plan_ deque and touching all checkpoints specified in the mdf file starting from 'next_checkpoint_'. returns false if could not find a plan, else returns true. Size of filtered plan_ is < 2 if mission is done.

References filter_detail_plan(), get_plan(), m_mdf, m_rndf, message, msg_logger, and rndf_point_at_wp().

Referenced by cajun::mission_handler_t::update_plan().


Friends And Related Function Documentation

friend class mission_handler_t [friend]

Member Data Documentation

Referenced by mission_planner_t().

mdf_t const* cajun::mission_planner_t::m_mdf [private]
rndf_t const* cajun::mission_planner_t::m_rndf [private]
world_state_t* cajun::mission_planner_t::m_ws [private]

The documentation for this class was generated from the following files:

Generated on Fri Apr 9 10:45:15 2010 for UCPlanner by  doxygen 1.6.1