5454#define PROGRESS_COMPLETE 100 // /< Value denoting 100% and a completion of progress of various functions
5555#define THROTTLE_PERIOD 5 // /< Default throttle period for all throttled rosconsole messages (seconds)
5656
57- #define UNDEFINED_ROTATION Quaterniond (0 ,0 ,0 ,0 )
58- #define UNDEFINED_POSITION Vector3d (double (INT_MAX), double(INT_MAX), double(INT_MAX))
57+ #define UNDEFINED_ROTATION Eigen:: Quaterniond (0 ,0 ,0 ,0 )
58+ #define UNDEFINED_POSITION Eigen:: Vector3d (double (INT_MAX), double(INT_MAX), double(INT_MAX))
5959
6060#define GRAVITY_ACCELERATION -9.81 // /< Approximate gravitational acceleration (m/s/s)
6161
6262using namespace std ;
6363using namespace ros ;
6464using namespace tf2_ros ;
65- using namespace Eigen ;
6665
6766// / Converts Degrees to Radians.
6867// / @param[in] degrees Value in degrees to be converted to radians
@@ -132,7 +131,7 @@ inline T clamped(const T& value, const double& magnitude)
132131template <class T >
133132inline T clamped (const T& value, const T& limit)
134133{
135- VectorXd result (value.size ());
134+ Eigen:: VectorXd result (value.size ());
136135 for (int i = 0 ; i < value.size (); ++i)
137136 {
138137 result[i] = clamped (value[i], -limit[i], limit[1 ]);
@@ -153,9 +152,9 @@ inline double setPrecision(const double& value, const int& precision)
153152// / @param[in] vector The input vector
154153// / @param[in] precision The required precision
155154// / @return The input vector with a precision defined by the precision input
156- inline Vector3d setPrecision (const Vector3d& vector, const int & precision)
155+ inline Eigen:: Vector3d setPrecision (const Eigen:: Vector3d& vector, const int & precision)
157156{
158- return Vector3d (roundToInt (vector[0 ] * pow (10 , precision)) / pow (10 , precision),
157+ return Eigen:: Vector3d (roundToInt (vector[0 ] * pow (10 , precision)) / pow (10 , precision),
159158 roundToInt (vector[1 ] * pow (10 , precision)) / pow (10 , precision),
160159 roundToInt (vector[2 ] * pow (10 , precision)) / pow (10 , precision));
161160}
@@ -174,11 +173,11 @@ inline double smoothStep(const double& control_input)
174173// / @param[in] a The input vector
175174// / @param[in] b The reference vector
176175// / @return The resultant projection vector
177- inline Vector3d getProjection (const Vector3d& a, const Vector3d& b)
176+ inline Eigen:: Vector3d getProjection (const Eigen:: Vector3d& a, const Eigen:: Vector3d& b)
178177{
179178 if (a.norm () == 0.0 || b.norm () == 0.0 )
180179 {
181- return Vector3d::Zero ();
180+ return Eigen:: Vector3d::Zero ();
182181 }
183182 else
184183 {
@@ -191,7 +190,7 @@ inline Vector3d getProjection(const Vector3d& a, const Vector3d& b)
191190// / @param[in] a The input vector
192191// / @param[in] b The reference vector
193192// / @return The resultant rejection vector
194- inline Vector3d getRejection (const Vector3d& a, const Vector3d& b)
193+ inline Eigen:: Vector3d getRejection (const Eigen:: Vector3d& a, const Eigen:: Vector3d& b)
195194{
196195 return a - getProjection (a, b);
197196}
@@ -212,11 +211,11 @@ inline T interpolate(const T& origin, const T& target, const double& control_inp
212211// / @param[in] test The test rotation to check for shorter rotation path
213212// / @param[in] reference The reference rotation for the target rotation
214213// / @return Rotation with shorter path between identical rotations on quaternion
215- inline Quaterniond correctRotation (const Quaterniond& test, const Quaterniond& reference)
214+ inline Eigen:: Quaterniond correctRotation (const Eigen:: Quaterniond& test, const Eigen:: Quaterniond& reference)
216215{
217216 if (test.dot (reference) < 0.0 )
218217 {
219- return Quaterniond (-test.w (), -test.x (), -test.y (), -test.z ());
218+ return Eigen:: Quaterniond (-test.w (), -test.x (), -test.y (), -test.z ());
220219 }
221220 else
222221 {
@@ -228,19 +227,19 @@ inline Quaterniond correctRotation(const Quaterniond& test, const Quaterniond& r
228227// / @param[in] euler Eigen Vector3d of Euler angles (roll, pitch, yaw) to be converted
229228// / @param[in] intrinsic Defines whether conversion occurs intrinsically or extrinsically
230229// / @return Eigen Quaternion generated using given Euler Angles
231- inline Quaterniond eulerAnglesToQuaternion (const Vector3d& euler, const bool & intrinsic = false )
230+ inline Eigen:: Quaterniond eulerAnglesToQuaternion (const Eigen:: Vector3d& euler, const bool & intrinsic = false )
232231{
233232 if (intrinsic)
234233 {
235- return Quaterniond (AngleAxisd (euler[0 ], Vector3d::UnitX ()) *
236- AngleAxisd (euler[1 ], Vector3d::UnitY ()) *
237- AngleAxisd (euler[2 ], Vector3d::UnitZ ()));
234+ return Eigen:: Quaterniond (Eigen:: AngleAxisd (euler[0 ], Eigen:: Vector3d::UnitX ()) *
235+ Eigen:: AngleAxisd (euler[1 ], Eigen:: Vector3d::UnitY ()) *
236+ Eigen:: AngleAxisd (euler[2 ], Eigen:: Vector3d::UnitZ ()));
238237 }
239238 else
240239 {
241- return Quaterniond (AngleAxisd (euler[2 ], Vector3d::UnitZ ()) *
242- AngleAxisd (euler[1 ], Vector3d::UnitY ()) *
243- AngleAxisd (euler[0 ], Vector3d::UnitX ()));
240+ return Eigen:: Quaterniond (Eigen:: AngleAxisd (euler[2 ], Eigen:: Vector3d::UnitZ ()) *
241+ Eigen:: AngleAxisd (euler[1 ], Eigen:: Vector3d::UnitY ()) *
242+ Eigen:: AngleAxisd (euler[0 ], Eigen:: Vector3d::UnitX ()));
244243 }
245244}
246245
@@ -249,9 +248,9 @@ inline Quaterniond eulerAnglesToQuaternion(const Vector3d& euler, const bool& in
249248// / @param[in] rotation Eigen Quaterniond of rotation to be converted
250249// / @param[in] intrinsic Defines whether conversion occurs intrinsically or extrinsically
251250// / @return Euler Angles generated using given Eigen Quaternoid
252- inline Vector3d quaternionToEulerAngles (const Quaterniond& rotation, const bool & intrinsic = false )
251+ inline Eigen:: Vector3d quaternionToEulerAngles (const Eigen:: Quaterniond& rotation, const bool & intrinsic = false )
253252{
254- Vector3d result (0 ,0 ,0 );
253+ Eigen:: Vector3d result (0 ,0 ,0 );
255254
256255 // Intrinsic rotation (roll, pitch, yaw order)
257256 if (intrinsic)
@@ -292,7 +291,7 @@ inline Vector3d quaternionToEulerAngles(const Quaterniond& rotation, const bool&
292291 }
293292 }
294293
295- return intrinsic ? result : Vector3d (result[2 ], result[1 ], result[0 ]);
294+ return intrinsic ? result : Eigen:: Vector3d (result[2 ], result[1 ], result[0 ]);
296295}
297296
298297// / Returns a string representation of the input value.
@@ -377,9 +376,9 @@ inline T quarticBezierDot(const T* points, const double& t)
377376// / @param[in] r The DH parameter representing length of the common normal
378377// / @param[in] alpha The DH parameter representing angle about common normal, form old z-axis to new z-axis
379378// / @return Classical Denavit-Hartenberg (DH) matrix generated using the given DH parameters as input
380- inline Matrix4d createDHMatrix (const double & d, const double & theta, const double & r, const double & alpha)
379+ inline Eigen:: Matrix4d createDHMatrix (const double & d, const double & theta, const double & r, const double & alpha)
381380{
382- Matrix4d m;
381+ Eigen:: Matrix4d m;
383382 m << cos (theta), -sin (theta)*cos (alpha), sin (theta)*sin (alpha), r* cos (theta),
384383 sin (theta), cos (theta)*cos (alpha), -cos (theta)*sin (alpha), r* sin (theta),
385384 0 , sin (alpha), cos (alpha), d,
0 commit comments