diff --git a/include/opendrive_param_poly3.h b/include/opendrive_param_poly3.h index 8613d06c039095687b0b6b4dff1c07030d6e89f3..cbb494329deb1359c1071f3e637d1e9828e34e93 100644 --- a/include/opendrive_param_poly3.h +++ b/include/opendrive_param_poly3.h @@ -13,20 +13,21 @@ typedef struct class COpendriveParamPoly3 : public COpendriveGeometry { + friend class COpendriveRoadNode; private: TOpendrivePoly3Params u; TOpendrivePoly3Params v; bool normalized; protected: + COpendriveParamPoly3(); + COpendriveParamPoly3(const COpendriveParamPoly3 &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: - COpendriveParamPoly3(); - COpendriveParamPoly3(double min_s, double max_s, double x, double y, double heading,TOpendrivePoly3Params &u,TOpendrivePoly3Params &v,bool normalized); - COpendriveParamPoly3(const COpendriveParamPoly3 &object); virtual COpendriveGeometry *clone(void); + virtual void get_curvature(double &start,double &end); TOpendrivePoly3Params get_u_params(void); TOpendrivePoly3Params get_v_params(void); bool is_normalized(void); diff --git a/src/opendrive_param_poly3.cpp b/src/opendrive_param_poly3.cpp index 12cdddb446b19e668f38199030732342c87aa9d7..d973be20f9f22f8c78cbf4b5c41d8dba5192e516 100644 --- a/src/opendrive_param_poly3.cpp +++ b/src/opendrive_param_poly3.cpp @@ -14,19 +14,6 @@ COpendriveParamPoly3::COpendriveParamPoly3() this->normalized=true; } -COpendriveParamPoly3::COpendriveParamPoly3(double min_s, double max_s, double x, double y, double heading,TOpendrivePoly3Params &u,TOpendrivePoly3Params &v,bool normalized) : COpendriveGeometry(min_s,max_s,x,y,heading) -{ - this->u.a=u.a; - this->u.b=u.b; - this->u.c=u.c; - this->u.d=u.d; - this->v.a=v.a; - this->v.b=v.b; - this->v.c=v.c; - this->v.d=v.d; - this->normalized=normalized; -} - COpendriveParamPoly3::COpendriveParamPoly3(const COpendriveParamPoly3 &object) : COpendriveGeometry(object) { this->u.a=object.u.a; @@ -42,7 +29,7 @@ COpendriveParamPoly3::COpendriveParamPoly3(const COpendriveParamPoly3 &object) : bool COpendriveParamPoly3::transform_local_pose(TOpendriveTrackPoint &track,TOpendriveLocalPoint &local) const { - double p = (this->normalized ? (track.s - this->min_s)/(this->max_s - this->min_s): (track.s - this->min_s)); + double p = (this->normalized ? track.s/((this->max_s - this->min_s)/this->scale_factor):track.s); double p2 = p*p; double p3 = p2*p; double du = this->u.b + 2*this->u.c*p + 3*this->u.d*p2; @@ -93,6 +80,12 @@ COpendriveGeometry *COpendriveParamPoly3::clone(void) return new_poly; } +void COpendriveParamPoly3::get_curvature(double &start,double &end) +{ + start=0.0; + end=0.0; +} + TOpendrivePoly3Params COpendriveParamPoly3::get_u_params(void) { return this->u;