ISeeML  1.0
LinCurvPath.hpp
1 //
2 // Definition of iSeeML::rob::LinCurvPath, class of only ISeeML
3 // elementary robotic paths.
4 //
5 
6 // To only include this definition once
7 #ifndef ISEEML_CONT_CURV_PATH_HH
8 #define ISEEML_CONT_CURV_PATH_HH
9 
10 
11 // This class needs the definition of iSeeML::rob::BasicPath.
12 #include <iSeeML/rob/BasicPath.hpp>
13 // This class needs the definition of iSeeML::rob::CurvConfig.
14 #include <iSeeML/rob/CurvConfig.hpp>
15 
16 
28  // === Object's Fields ==========================================
29 
31  double Sharpness;
32 
33  double Length;
34 
36  double Deflection;
37 
40 
43 
44 public:
49  static const string ClassName;
50 
51 
52  // === Constructors and Destructors =============================
53 
60  LinCurvPath() : Sharpness(0), Length(0), Deflection(0),
61  Start(), End() {}
62 
75  const double& sharpness = 0, const double& length = 0) :
76  Sharpness(sharpness), Length(length),
77  Deflection(start.curvature() * length +
78  sharpness * sqr(length) / 2),
79  Start(start), End( operator[]( length ) ) {}
80 
81  // The default copy constructor is OK.
82 
83 
84  // === Description Methods ======================================
85 
91  const iSeeML::rob::CurvConfig& start() const { return Start; }
92 
98  const iSeeML::rob::CurvConfig& end() const { return End; }
99 
100 
106  const double& sharpness() const { return( Sharpness ); }
107 
108  // Description is given in PathISeeML.hh
109  double length() const { return( Length ); }
110 
111  // Description is given in PathISeeML.hh
112  double deflection() const { return( Deflection ); }
113 
114 
124  { return *( (iSeeML::Object*) (new LinCurvPath(*this)) ); }
125 
126 
136  void writeTo(ostream& O) const
137  { O << "[" << start() << "-{" << sharpness() << ", "
138  << length() << "}->" << end() << "]"; }
139 
140 
141 public:
142  // === Operators ================================================
143 
160  iSeeML::rob::CurvConfig operator[](const double& s) const;
161 
162 
163  // === Various Methods ==========================================
164 
165 }; // end of class iSeeML::rob::LinCurvPath
166 
167 #endif // end of definition
168 
This class defines superclass of basic paths, from which compound paths can be built.
Definition: BasicPath.hpp:21
This class is the base class of ISeeML: every class of ISeeML inherits this one.
Definition: Object.hpp:47
iSeeML::rob::CurvConfig operator[](const double &s) const
Description method, giving a configuration at a given arc length along the path.
This class defines linear curvature elementary paths, for which the curvature derivative (with respec...
Definition: LinCurvPath.hpp:27
double deflection() const
Description method, giving the path&#39;s deflection (change of orientation).
Definition: LinCurvPath.hpp:112
const iSeeML::rob::CurvConfig & end() const
Description method, giving the path&#39;s final configuration (as a configuration for mobile robot with c...
Definition: LinCurvPath.hpp:98
const double & sharpness() const
Description method, giving the path&#39;s constant curvature derivative with respect to the arc length...
Definition: LinCurvPath.hpp:106
static const string ClassName
The class name is public, as this class can be instanced.
Definition: LinCurvPath.hpp:49
LinCurvPath()
The default constructor should only be used for array initializations: it generates a path starting f...
Definition: LinCurvPath.hpp:60
static double sqr(const double &x)
Method giving the square of a double.
Definition: Object.hpp:220
const iSeeML::rob::CurvConfig & start() const
Description method, giving the path&#39;s starting configuration.
Definition: LinCurvPath.hpp:91
iSeeML::Object & clone() const
Description method, giving a copy of the current linear curvature path.
Definition: LinCurvPath.hpp:123
void writeTo(ostream &O) const
Description method, writing a description of the path in a given output stream.
Definition: LinCurvPath.hpp:136
double length() const
Description method, giving the path&#39;s length.
Definition: LinCurvPath.hpp:109
This class defines a more precise configuration than classical ones for mobile robots.
Definition: CurvConfig.hpp:30
LinCurvPath(const iSeeML::rob::CurvConfig &start, const double &sharpness=0, const double &length=0)
The main constructor.
Definition: LinCurvPath.hpp:74