From 3a385b2fc854dde0c5bb72ee949ce02ba8de4f6b Mon Sep 17 00:00:00 2001
From: Sergi Hernandez Juan <shernand@iri.upc.edu>
Date: Thu, 31 Dec 2020 17:41:48 +0100
Subject: [PATCH] Moved the default and copy constructors as protected. Removed
 the parameter constructor. Implemented the function to get the start and end
 curvature. Solved a bug: the min_s parameter is not needed to compute the
 local coordinates.

---
 include/opendrive_line.h |  7 ++++---
 src/opendrive_line.cpp   | 13 +++++++------
 2 files changed, 11 insertions(+), 9 deletions(-)

diff --git a/include/opendrive_line.h b/include/opendrive_line.h
index 02b87ee..02a3cd2 100644
--- a/include/opendrive_line.h
+++ b/include/opendrive_line.h
@@ -5,17 +5,18 @@
 
 class COpendriveLine : public COpendriveGeometry
 {
+  friend class COpendriveRoadNode;
   private:
   protected:
+    COpendriveLine();
+    COpendriveLine(const COpendriveGeometry &object);
     virtual bool transform_local_pose(TOpendriveTrackPoint &track,TOpendriveLocalPoint &local) const;
     virtual void print(std::ostream &out);
     virtual void load_params(const planView::geometry_type &geometry_info);
     virtual std::string get_name(void);
   public:
-    COpendriveLine();
-    COpendriveLine(double min_s, double max_s, double x, double y, double heading);
-    COpendriveLine(const COpendriveGeometry &object);
     virtual COpendriveGeometry *clone(void);
+    virtual void get_curvature(double &start,double &end);
     void operator=(const COpendriveLine &object);
     ~COpendriveLine();
 };
diff --git a/src/opendrive_line.cpp b/src/opendrive_line.cpp
index d0933cc..e25c7b6 100644
--- a/src/opendrive_line.cpp
+++ b/src/opendrive_line.cpp
@@ -5,11 +5,6 @@ COpendriveLine::COpendriveLine()
 
 }
 
-COpendriveLine::COpendriveLine(double min_s, double max_s, double x, double y, double heading) : COpendriveGeometry(min_s,max_s,x,y,heading)
-{
-
-}
-
 COpendriveLine::COpendriveLine(const COpendriveGeometry &object) : COpendriveGeometry(object)
 {
 
@@ -17,7 +12,7 @@ COpendriveLine::COpendriveLine(const COpendriveGeometry &object) : COpendriveGeo
 
 bool COpendriveLine::transform_local_pose(TOpendriveTrackPoint &track,TOpendriveLocalPoint &local) const
 {
-  local.u=track.s-this->min_s/this->scale_factor;
+  local.u=track.s;
   local.v=track.t;
   local.heading=track.heading;
 
@@ -46,6 +41,12 @@ COpendriveGeometry *COpendriveLine::clone(void)
   return new_line;
 }
 
+void COpendriveLine::get_curvature(double &start,double &end)
+{
+  start=0.0;
+  end=0.0;
+}
+
 void COpendriveLine::operator=(const COpendriveLine &object)
 {
   COpendriveGeometry::operator=(object);
-- 
GitLab