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

Improved the way to apply the node restrictions.

Added the feature to create the junction links.
Added support to generate the geometries of the links.
parent e0767964
No related branches found
No related tags found
1 merge request!2Solved a bug when creating a new geometry object: the sale factor is...
...@@ -5,20 +5,32 @@ ...@@ -5,20 +5,32 @@
#include "osm/osm_node.h" #include "osm/osm_node.h"
#include "osm/osm_road_segment.h" #include "osm/osm_road_segment.h"
#include "g2_spline.h"
#include <Eigen/Dense> #include <Eigen/Dense>
#include <vector> #include <vector>
typedef struct{
const COSMWay *in_way;
int in_lane_id;
const COSMWay *out_way;
int out_lane_id;
CG2Spline *geometry;
}TOSMLink;
class COSMJunction class COSMJunction
{ {
friend class COSMMap; friend class COSMMap;
friend class COSMNode; friend class COSMNode;
friend class COSMWay; friend class COSMWay;
friend class COSMRoadSegment;
private: private:
std::vector<COSMRoadSegment *> in_roads; std::vector<COSMRoadSegment *> in_roads;
std::vector<COSMRoadSegment *> out_roads; std::vector<COSMRoadSegment *> out_roads;
COSMNode *parent_node; COSMNode *parent_node;
std::vector<std::vector<Eigen::MatrixXi>> connections; std::vector<std::vector<Eigen::MatrixXi>> connections;
std::vector<TOSMLink> links;
protected: protected:
void create_FF_connectivity_matrix(const COSMWay &in_way,const COSMWay &out_way,unsigned int in_lane_index,unsigned int out_lane_index,unsigned int num_in_lanes,unsigned int num_out_lanes,Eigen::MatrixXi &matrix); void create_FF_connectivity_matrix(const COSMWay &in_way,const COSMWay &out_way,unsigned int in_lane_index,unsigned int out_lane_index,unsigned int num_in_lanes,unsigned int num_out_lanes,Eigen::MatrixXi &matrix);
void create_FB_connectivity_matrix(const COSMWay &in_way,const COSMWay &out_way,unsigned int in_lane_index,unsigned int out_lane_index,unsigned int num_in_lanes,unsigned int num_out_lanes,unsigned int total_out_lanes,Eigen::MatrixXi &matrix); void create_FB_connectivity_matrix(const COSMWay &in_way,const COSMWay &out_way,unsigned int in_lane_index,unsigned int out_lane_index,unsigned int num_in_lanes,unsigned int num_out_lanes,unsigned int total_out_lanes,Eigen::MatrixXi &matrix);
...@@ -27,10 +39,13 @@ class COSMJunction ...@@ -27,10 +39,13 @@ class COSMJunction
void create_initial_connectivity(void); void create_initial_connectivity(void);
void apply_node_restrictions(void); void apply_node_restrictions(void);
void apply_way_restrictions(void); void apply_way_restrictions(void);
void compute_distances(void); void create_links(void);
bool add_link(TOSMLink &new_link);
void generate_geometry(void);
public: public:
COSMJunction(COSMNode *node); COSMJunction(COSMNode *node);
const COSMNode &get_parent_node(void) const; const COSMNode &get_parent_node(void) const;
void get_trajectory(std::vector<double> &x, std::vector<double> &y, std::vector<double> &heading, std::vector<double> &curvature);
friend std::ostream& operator<<(std::ostream& out, COSMJunction &junction); friend std::ostream& operator<<(std::ostream& out, COSMJunction &junction);
~COSMJunction(); ~COSMJunction();
}; };
......
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