ISeeML  1.0
CurvConfig.hpp
1 //
2 // Definition of iSeeML::rob::CurvConfig, class of ISeeML robotic
3 // configurations with curvature.
4 //
5 
6 // To only include this definition once
7 #ifndef ISEEML_ROB_CURV_CONFIG_HH
8 #define ISEEML_ROB_CURV_CONFIG_HH
9 
10 
11 // This class needs the definition of iSeeML::rob::OrPtConfig.
12 #include <iSeeML/rob/OrPtConfig.hpp>
13 
14 
31  // === Object's Fields ==========================================
32 
33  double Curvature;
34 
35 public:
40  static const string ClassName;
41 
42 
43  // === Constructors and Destructors =============================
44 
51  CurvConfig() : OrPtConfig(), Curvature(0) {}
52 
58  CurvConfig(const iSeeML::rob::OrPtConfig& OrPt, const double& kappa) :
59  OrPtConfig(OrPt), Curvature(kappa) {}
60 
70  CurvConfig(const iSeeML::geom::Point& P, const double& theta,
71  const double& kappa) :
72  OrPtConfig(P, theta), Curvature(kappa) {}
73 
85  CurvConfig(const double& x, const double& y,
86  const double& theta, const double& kappa) :
87  OrPtConfig(x, y, theta), Curvature(kappa) {}
88 
89  // The default copy constructor is OK.
90 
91 
92  // === Description Methods ======================================
93 
94  // cf. OrPtConfig
96  { return *( (iSeeML::Object*) (new CurvConfig(*this)) ); }
97 
98 
99  // Description is given in OrPtConfigISeeML.hh.
100  void writeTo(ostream& O) const { algWriteTo(O); }
101 
102 
110  const double& curvature() const { return Curvature; }
111 
112 
113 protected:
122  int algDimension() const { return 4; }
123 
139  double algCoord(const int i) const {
140  if (i == 4) return curvature();
141 #ifdef ISEEML_CHECK_CURV_CONFIG_PRECOND
142  else if ((i < 1) || (i > 3)) {
143  cerr << ClassName << "::coord: parameter " << i << endl
144  << " outside allowed values (1 to 4),"
145  << " returning zero..." << endl;
146  return 0; }
147 #endif
148  else return OrPtConfig::algCoord(i); }
149 
150 
151  // === Modification Methods =====================================
152 
153  // === Operators ================================================
154 
155  // === Various Methods ==========================================
156 
157 }; // end of class iSeeML::rob::CurvConfig
158 
159 #endif // end of definition
160 
double algCoord(const int i) const
Description method, giving the coordinate of given index of the configuration (both coordinates of th...
Definition: OrPtConfig.hpp:200
int algDimension() const
Description method, giving the dimension of the containing space (4) when this configuration is consi...
Definition: CurvConfig.hpp:122
This class is the base class of ISeeML: every class of ISeeML inherits this one.
Definition: Object.hpp:47
CurvConfig(const iSeeML::geom::Point &P, const double &theta, const double &kappa)
A first detailled constructor allows to give the classical configuration as a point and an orientatio...
Definition: CurvConfig.hpp:70
const double & curvature() const
Description method, giving the intantaneous curvature, in this configuration, of the curve followed b...
Definition: CurvConfig.hpp:110
static const string ClassName
The class name is public, as this class can be instanced.
Definition: CurvConfig.hpp:40
This class defines a standard robotic configuration, containing the position of a reference point and...
Definition: OrPtConfig.hpp:45
virtual void algWriteTo(ostream &O) const
Description method for algebraic vectors, writing this vector in a given output stream: coordinates f...
Definition: Object.hpp:161
CurvConfig(const double &x, const double &y, const double &theta, const double &kappa)
A second detailled constructor allows to give the classical configuration as two Cartesian coordinate...
Definition: CurvConfig.hpp:85
double algCoord(const int i) const
Description method, giving the coordinate of given index of the configuration (both coordinates of th...
Definition: CurvConfig.hpp:139
This class defines 2D geometric points, defined by their Cartesian coordinates.
Definition: Point.hpp:29
CurvConfig(const iSeeML::rob::OrPtConfig &OrPt, const double &kappa)
The main constructor.
Definition: CurvConfig.hpp:58
iSeeML::Object & clone() const
Description method, giving a copy of the current object.
Definition: CurvConfig.hpp:95
CurvConfig()
The default constructor should only be used for array initializations: it correspond to a default ori...
Definition: CurvConfig.hpp:51
void writeTo(ostream &O) const
Description method, writing a description of the object into a given output stream.
Definition: CurvConfig.hpp:100
This class defines a more precise configuration than classical ones for mobile robots.
Definition: CurvConfig.hpp:30