Skip to content
Snippets Groups Projects
Commit 84c6d4b6 authored by Sergi Hernandez's avatar Sergi Hernandez
Browse files

Added a junction to add a single road segment from multiple junction segments.

Improved the update and clean references functions.
When possible, use always the spline geometry.
parent 64c852f4
No related branches found
No related tags found
1 merge request!2Solved a bug when creating a new geometry object: the sale factor is...
...@@ -29,7 +29,7 @@ class COpendriveRoad ...@@ -29,7 +29,7 @@ class COpendriveRoad
void free(void); void free(void);
void link_segments(OpenDRIVE &open_drive); void link_segments(OpenDRIVE &open_drive);
void link_neighbors(OpenDRIVE &open_drive); void link_neighbors(OpenDRIVE &open_drive);
void add_neighbors(const COpendriveRoadSegment *segment,segment_up_ref_t &new_segment_ref,node_up_ref_t &new_node_ref,lane_up_ref_t &new_lane_ref,link_up_ref_t &new_link_ref,TOpendriveWorldPose *start,TOpendriveWorldPose *end); void add_segment(const COpendriveRoadSegment *segment,segment_up_ref_t &new_segment_ref,node_up_ref_t &new_node_ref,lane_up_ref_t &new_lane_ref,link_up_ref_t &new_link_ref);
unsigned int add_node(COpendriveRoadNode *node); unsigned int add_node(COpendriveRoadNode *node);
bool remove_node(COpendriveRoadNode *node); bool remove_node(COpendriveRoadNode *node);
COpendriveRoadNode* get_node_at(TOpendriveWorldPose &pose); COpendriveRoadNode* get_node_at(TOpendriveWorldPose &pose);
...@@ -41,9 +41,9 @@ class COpendriveRoad ...@@ -41,9 +41,9 @@ class COpendriveRoad
bool has_segment(COpendriveRoadSegment *segment); bool has_segment(COpendriveRoadSegment *segment);
std::vector<unsigned int> update_path(node_up_ref_t &node_refs,std::vector<unsigned int> &path); std::vector<unsigned int> update_path(node_up_ref_t &node_refs,std::vector<unsigned int> &path);
void update_references(segment_up_ref_t &segment_refs,lane_up_ref_t &lane_refs,node_up_ref_t &node_refs); void update_references(segment_up_ref_t &segment_refs,lane_up_ref_t &lane_refs,node_up_ref_t &node_refs);
void clean_references(segment_up_ref_t &segment_refs,lane_up_ref_t &lane_refs,node_up_ref_t &node_refs); void clean_references(segment_up_ref_t &segment_refs,lane_up_ref_t &lane_refs,node_up_ref_t &node_refs,link_up_ref_t &new_link_ref);
void reindex(void); void reindex(void);
void prune(std::vector<unsigned int> &path_nodes,bool keep_first_left_lane=false); void prune(std::vector<unsigned int> &path_nodes);
unsigned int create_junction(const std::string &name,unsigned int start_segment,int start_lane_id,unsigned int end_segment,int end_lane_id); unsigned int create_junction(const std::string &name,unsigned int start_segment,int start_lane_id,unsigned int end_segment,int end_lane_id);
public: public:
/** /**
...@@ -402,7 +402,7 @@ class COpendriveRoad ...@@ -402,7 +402,7 @@ class COpendriveRoad
* *
* \return the sequence of road nodes describing the path in the new sub-road. * \return the sequence of road nodes describing the path in the new sub-road.
*/ */
std::vector<unsigned int> get_sub_road(std::vector<unsigned int> &path_nodes,TOpendriveWorldPose &end_pose,COpendriveRoad &new_road,bool keep_first_left_lane=false); std::vector<unsigned int> get_sub_road(std::vector<unsigned int> &path_nodes,TOpendriveWorldPose &end_pose,COpendriveRoad &new_road);
/** /**
* \brief creates a sub-road with only the road elements within a distance to a given pose * \brief creates a sub-road with only the road elements within a distance to a given pose
* *
......
This diff is collapsed.
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment