Skip to content
Snippets Groups Projects
Commit 78f61fa8 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 (removed the get_start_curvature() and get_end_curvature() functions).
Solved a bug: the min_s parameter is not needed to compute the local coordinates.
parent c05e7658
No related branches found
No related tags found
No related merge requests found
...@@ -5,21 +5,20 @@ ...@@ -5,21 +5,20 @@
class COpendriveSpiral : public COpendriveGeometry class COpendriveSpiral : public COpendriveGeometry
{ {
friend class COpendriveRoadNode;
private: private:
double start_curvature; double start_curvature;
double end_curvature; double end_curvature;
protected: protected:
COpendriveSpiral();
COpendriveSpiral(const COpendriveSpiral &object);
virtual bool transform_local_pose(TOpendriveTrackPoint &track,TOpendriveLocalPoint &local) const; virtual bool transform_local_pose(TOpendriveTrackPoint &track,TOpendriveLocalPoint &local) const;
virtual void print(std::ostream &out); virtual void print(std::ostream &out);
virtual void load_params(const planView::geometry_type &geometry_info); virtual void load_params(const planView::geometry_type &geometry_info);
virtual std::string get_name(void); virtual std::string get_name(void);
public: public:
COpendriveSpiral();
COpendriveSpiral(double min_s, double max_s, double x, double y, double heading,double start_curv,double end_curv);
COpendriveSpiral(const COpendriveSpiral &object);
virtual COpendriveGeometry *clone(void); virtual COpendriveGeometry *clone(void);
double get_start_curvature(void); virtual void get_curvature(double &start,double &end);
double get_end_curvature(void);
void operator=(const COpendriveSpiral &object); void operator=(const COpendriveSpiral &object);
~COpendriveSpiral(); ~COpendriveSpiral();
}; };
......
...@@ -6,12 +6,6 @@ COpendriveSpiral::COpendriveSpiral() ...@@ -6,12 +6,6 @@ COpendriveSpiral::COpendriveSpiral()
this->end_curvature=0.0; this->end_curvature=0.0;
} }
COpendriveSpiral::COpendriveSpiral(double min_s, double max_s, double x, double y, double heading,double start_curv,double end_curv) : COpendriveGeometry(min_s,max_s,x,y,heading)
{
this->start_curvature=start_curv;
this->end_curvature=end_curv;
}
COpendriveSpiral::COpendriveSpiral(const COpendriveSpiral &object) : COpendriveGeometry(object) COpendriveSpiral::COpendriveSpiral(const COpendriveSpiral &object) : COpendriveGeometry(object)
{ {
this->start_curvature=object.start_curvature; this->start_curvature=object.start_curvature;
...@@ -25,8 +19,11 @@ bool COpendriveSpiral::transform_local_pose(TOpendriveTrackPoint &track,TOpendri ...@@ -25,8 +19,11 @@ bool COpendriveSpiral::transform_local_pose(TOpendriveTrackPoint &track,TOpendri
void COpendriveSpiral::print(std::ostream &out) void COpendriveSpiral::print(std::ostream &out)
{ {
double start_curvature,end_curvature;
COpendriveGeometry::print(out); COpendriveGeometry::print(out);
out << " start_curvature = " << this->get_start_curvature() << ", end_curvature = " << this->get_end_curvature() << std::endl; this->get_curvature(start_curvature,end_curvature);
out << " start_curvature = " << start_curvature << ", end_curvature = " << end_curvature << std::endl;
} }
void COpendriveSpiral::load_params(const planView::geometry_type &geometry_info) void COpendriveSpiral::load_params(const planView::geometry_type &geometry_info)
...@@ -47,14 +44,10 @@ COpendriveGeometry *COpendriveSpiral::clone(void) ...@@ -47,14 +44,10 @@ COpendriveGeometry *COpendriveSpiral::clone(void)
return new_spiral; return new_spiral;
} }
double COpendriveSpiral::get_start_curvature(void) void COpendriveSpiral::get_curvature(double &start,double &end)
{
return this->start_curvature*this->scale_factor;
}
double COpendriveSpiral::get_end_curvature(void)
{ {
return this->end_curvature*this->scale_factor; start=this->start_curvature*this->scale_factor;
end=this->end_curvature*this->scale_factor;
} }
void COpendriveSpiral::operator=(const COpendriveSpiral &object) void COpendriveSpiral::operator=(const COpendriveSpiral &object)
......
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