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

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.
parent 78f61fa8
No related branches found
No related tags found
No related merge requests found
......@@ -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);
......
......@@ -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;
......
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