Blender V5.0
frames.hpp
Go to the documentation of this file.
1/***************************************************************************
2 frames.hpp `- description
3 -------------------------
4 begin : June 2006
5 copyright : (C) 2006 Erwin Aertbelien
6 email : firstname.lastname@mech.kuleuven.be
7
8 History (only major changes)( AUTHOR-Description ) :
9
10 ***************************************************************************
11 * This library is free software; you can redistribute it and/or *
12 * modify it under the terms of the GNU Lesser General Public *
13 * License as published by the Free Software Foundation; either *
14 * version 2.1 of the License, or (at your option) any later version. *
15 * *
16 * This library is distributed in the hope that it will be useful, *
17 * but WITHOUT ANY WARRANTY; without even the implied warranty of *
18 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU *
19 * Lesser General Public License for more details. *
20 * *
21 * You should have received a copy of the GNU Lesser General Public *
22 * License along with this library; if not, write to the Free Software *
23 * Foundation, Inc., 51 Franklin Street, *
24 * Fifth Floor, Boston, MA 02110-1301, USA. *
25 * *
26 ***************************************************************************/
27
30 * \warning
31 * Efficienty can be improved by writing p2 = A*(B*(C*p1))) instead of
32 * p2=A*B*C*p1
33 *
34 * \par PROPOSED NAMING CONVENTION FOR FRAME-like OBJECTS
35 *
36 * \verbatim
37 * A naming convention of objects of the type defined in this file :
38 * (1) Frame : F...
39 * Rotation : R ...
40 * (2) Twist : T ...
41 * Wrench : W ...
42 * Vector : V ...
43 * This prefix is followed by :
44 * for category (1) :
45 * F_A_B : w.r.t. frame A, frame B expressed
46 * ( each column of F_A_B corresponds to an axis of B,
47 * expressed w.r.t. frame A )
48 * in mathematical convention :
49 * A
50 * F_A_B == F
51 * B
52 *
53 * for category (2) :
54 * V_B : a vector expressed w.r.t. frame B
55 *
56 * This can also be prepended by a name :
57 * e.g. : temporaryV_B
58 *
59 * With this convention one can write :
60 *
61 * F_A_B = F_B_A.Inverse();
62 * F_A_C = F_A_B * F_B_C;
63 * V_B = F_B_C * V_C; // both translation and rotation
64 * V_B = R_B_C * V_C; // only rotation
65 * \endverbatim
66 *
67 * \par CONVENTIONS FOR WHEN USED WITH ROBOTS :
68 *
69 * \verbatim
70 * world : represents the frame ([1 0 0,0 1 0,0 0 1],[0 0 0]')
71 * mp : represents mounting plate of a robot
72 * (i.e. everything before MP is constructed by robot manufacturer
73 * everything after MP is tool )
74 * tf : represents task frame of a robot
75 * (i.e. frame in which motion and force control is expressed)
76 * sf : represents sensor frame of a robot
77 * (i.e. frame at which the forces measured by the force sensor
78 * are expressed )
79 *
80 * Frame F_world_mp=...;
81 * Frame F_mp_sf(..)
82 * Frame F_mp_tf(,.)
83 *
84 * Wrench are measured in sensor frame SF, so one could write :
85 * Wrench_tf = F_mp_tf.Inverse()* ( F_mp_sf * Wrench_sf );
86 * \endverbatim
87 *
88 * \par CONVENTIONS REGARDING UNITS :
89 * Any consistent series of units can be used, e.g. N,mm,Nmm,..mm/sec
90 *
91 * \par Twist and Wrench transformations
92 * 3 different types of transformations do exist for the twists
93 * and wrenches.
94 *
95 * \verbatim
96 * 1) Frame * Twist or Frame * Wrench :
97 * this transforms both the velocity/force reference point
98 * and the basis to which the twist/wrench are expressed.
99 * 2) Rotation * Twist or Rotation * Wrench :
100 * this transforms the basis to which the twist/wrench are
101 * expressed, but leaves the reference point intact.
102 * 3) Twist.RefPoint(v_base_AB) or Wrench.RefPoint(v_base_AB)
103 * this transforms only the reference point. v is expressed
104 * in the same base as the twist/wrench and points from the
105 * old reference point to the new reference point.
106 * \endverbatim
107 *
108 * \par Complexity
109 * Sometimes the amount of work is given in the documentation
110 * e.g. 6M+3A means 6 multiplications and 3 additions.
111 *
112 * Erwin Aertbelien, Div. PMA, Dep. of Mech. Eng., K.U.Leuven
113 *
114 ****************************************************************************/
115#ifndef KDL_FRAMES_H
116#define KDL_FRAMES_H
117
118
120#include "utilities/utility.h"
121
123
124namespace KDL {
125
126
127
128class Vector;
130class Frame;
131class Wrench;
132class Twist;
133class Vector2;
134class Rotation2;
135class Frame2;
136
137
143{
144public:
145 double data[3];
147 inline Vector() {data[0]=data[1]=data[2] = 0.0;}
148
150 inline Vector(double x,double y, double z);
151
153 inline Vector(double* xyz);
154
155 //! Constructs a vector out of an array of three values x, y and z
156 inline Vector(float* xyz);
157
159 inline Vector(const Vector& arg);
162 inline void GetValue(double* xyz) const;
163
164
165 inline Vector& operator = ( const Vector& arg);
166
168 inline double operator()(int index) const;
169
170
171 inline double& operator() (int index);
172
174 double operator[] ( int index ) const
175 {
176 return this->operator() ( index );
178
180 double& operator[] ( int index )
181 {
182 return this->operator() ( index );
183 }
184
185 inline double x() const;
186 inline double y() const;
187 inline double z() const;
188 inline void x(double);
189 inline void y(double);
190 inline void z(double);
191
193 inline void ReverseSign();
194
195
196 //! subtracts a vector from the Vector object itself
197 inline Vector& operator-=(const Vector& arg);
198
199
200
201 inline Vector& operator +=(const Vector& arg);
202
204 inline Vector& operator *=(double arg);
205
206 //! Scalar multiplication is defined
207 inline friend Vector operator*(const Vector& lhs,double rhs);
209 inline friend Vector operator*(double lhs,const Vector& rhs);
210
211
212 inline friend Vector operator/(const Vector& lhs,double rhs);
213 inline friend Vector operator+(const Vector& lhs,const Vector& rhs);
214 inline friend Vector operator-(const Vector& lhs,const Vector& rhs);
215 inline friend Vector operator*(const Vector& lhs,const Vector& rhs);
216 inline friend Vector operator-(const Vector& arg);
217 inline friend double dot(const Vector& lhs,const Vector& rhs);
221 inline friend void SetToZero(Vector& v);
222
224 inline static Vector Zero();
225
228
230 */
231 double Normalize(double eps=epsilon);
232
234 double Norm() const;
235
236
239 inline void Set2DXY(const Vector2& v);
241 inline void Set2DYZ(const Vector2& v);
243 inline void Set2DZX(const Vector2& v);
244 //! a 3D vector where the 2D vector v_XY is put in the XY plane of the frame F_someframe_XY.
245 inline void Set2DPlane(const Frame& F_someframe_XY,const Vector2& v_XY);
246
247
250 inline friend bool Equal(const Vector& a,const Vector& b,double eps);
251
252
253 inline friend Vector Normalize(const Vector& a, double eps);
254
256 inline friend bool operator==(const Vector& a,const Vector& b);
258 inline friend bool operator!=(const Vector& a,const Vector& b);
259
260 friend class Rotation;
261 friend class Frame;
262};
263 inline Vector Normalize(const Vector&, double eps=epsilon);
264
267
268 This class represents a rotation matrix with the following
269 conventions :
270 \verbatim
271 Suppose V2 = R*V, (1)
272 V is expressed in frame B
273 V2 is expressed in frame A
274 This matrix R consists of 3 collumns [ X,Y,Z ],
275 X,Y, and Z contain the axes of frame B, expressed in frame A
276 Because of linearity expr(1) is valid.
277 \endverbatim
278 This class only represents rotational_interpolation, not translation
279 Two interpretations are possible for rotation angles.
280 * if you rotate with angle around X frame A to have frame B,
281 then the result of SetRotX is equal to frame B expressed wrt A.
282 In code:
283 \verbatim
284 Rotation R;
285 F_A_B = R.SetRotX(angle);
286 \endverbatim
287 * Secondly, if you take the following code :
288 \verbatim
289 Vector p,p2; Rotation R;
290 R.SetRotX(angle);
291 p2 = R*p;
292 \endverbatim
293 then the frame p2 is rotated around X axis with (-angle).
294 Analogue reasonings can be applyd to SetRotY,SetRotZ,SetRot
295 \par type
296 Concrete implementation
297*/
299{
300public:
301 double data[9];
302
303 inline Rotation() {
304 *this = Identity();
305 }
306 inline Rotation(double Xx,double Yx,double Zx,
307 double Xy,double Yy,double Zy,
308 double Xz,double Yz,double Zz);
309 inline Rotation(const Vector& x,const Vector& y,const Vector& z);
310 // default copy constructor is sufficient
312 inline void setValue(float* oglmat);
313 inline void getValue(float* oglmat) const;
314
315 inline Rotation& operator=(const Rotation& arg);
316
317 //! Defines a multiplication R*V between a Rotation R and a Vector V.
318 //! Complexity : 9M+6A
319 inline Vector operator*(const Vector& v) const;
320
322 inline double& operator()(int i,int j);
325 inline double operator() (int i,int j) const;
326
327 friend Rotation operator *(const Rotation& lhs,const Rotation& rhs);
328
330 inline void SetInverse();
331
332
333 inline Rotation Inverse() const;
334
336 inline Vector Inverse(const Vector& v) const;
337
339 inline Wrench Inverse(const Wrench& arg) const;
342 inline Twist Inverse(const Twist& arg) const;
343
345 inline static Rotation Identity();
346
348// = Rotations
350 inline static Rotation RotX(double angle);
352 inline static Rotation RotY(double angle);
354 inline static Rotation RotZ(double angle);
355
356 //! DoRot... functions are only defined when they can be executed more efficiently
357 inline void DoRotX(double angle);
360 inline void DoRotY(double angle);
363 inline void DoRotZ(double angle);
364
366 //! returns identity rotation matrix in the case that the norm of rotaxis
367 //! is too small to be used.
368 // @see Rot2 if you want to handle this error in another way.
369 static Rotation Rot(const Vector& rotaxis,double angle);
370
371 //! Along an arbitrary axes. rotvec should be normalized.
372 static Rotation Rot2(const Vector& rotvec,double angle);
373
374 // make sure the matrix is a pure rotation (no scaling)
375 void Ortho();
379 Vector GetRot() const;
380
382 //! Y axis onto the Matrix Y axis and its norm is angle
383 Vector2 GetXZRot() const;
384
386
387 * @param eps : in the case of angle == 0 : rot axis is undefined and choosen
388 * to be +/- Z-axis
389 * in the case of angle == PI : 2 solutions, positive Z-component
390 * of the axis is choosen.
391 * @result returns the rotation angle (between [0..PI] )
392 */
393 double GetRotAngle(Vector& axis,double eps=epsilon) const;
394
395
397
398 //! then around the new Y with beta, then around
399 //! new Z with gamma.
400 static Rotation EulerZYZ(double Alfa,double Beta,double Gamma);
401
403
404 //! then around the new Y with beta, then around
405 //! new Z with gamma.
406 //!
407 //! Variables are bound by
408 //! (-PI <= alfa <= PI),
409 //! (0 <= beta <= PI),
410 //! (-PI <= alfa <= PI)
411 void GetEulerZYZ(double& alfa,double& beta,double& gamma) const;
412
413
415
416 //! old Y with pitch, then around old Z with alfa
417 static Rotation RPY(double roll,double pitch,double yaw);
418
421
422 //! -PI/2 <= PITCH <= PI/2
423 //!
424 //! convention : first rotate around X with roll, then around the
425 //! old Y with pitch, then around old Z with alfa
426 void GetRPY(double& roll,double& pitch,double& yaw) const;
428
431
432 //! new X with gamma.
433 //!
434 //! closely related to RPY-convention
435 inline static Rotation EulerZYX(double Alfa,double Beta,double Gamma) {
436 return RPY(Gamma,Beta,Alfa);
437 }
444
445 //! -PI <= alfa <= PI
446 //! -PI <= gamma <= PI
447 //! -PI/2 <= beta <= PI/2
448 //!
449 //! Closely related to RPY-convention.
450 inline void GetEulerZYX(double& Alfa,double& Beta,double& Gamma) const {
451 GetRPY(Gamma,Beta,Alfa);
452 }
453
458 inline Twist operator * (const Twist& arg) const;
464 inline Wrench operator * (const Wrench& arg) const;
465
467 inline Vector UnitX() const {
468 return Vector(data[0],data[3],data[6]);
469 }
470
472 inline void UnitX(const Vector& X) {
473 data[0] = X(0);
474 data[3] = X(1);
475 data[6] = X(2);
477
479 inline Vector UnitY() const {
480 return Vector(data[1],data[4],data[7]);
481 }
482
484 inline void UnitY(const Vector& X) {
485 data[1] = X(0);
486 data[4] = X(1);
487 data[7] = X(2);
488 }
489
491 inline Vector UnitZ() const {
492 return Vector(data[2],data[5],data[8]);
493 }
494
496 inline void UnitZ(const Vector& X) {
497 data[2] = X(0);
498 data[5] = X(1);
499 data[8] = X(2);
500 }
501
502
503 //! different. It compares whether the 2 arguments are equal in an eps-interval
504
505
507 friend bool operator==(const Rotation& a,const Rotation& b);
508 //! The literal inequality operator!=()
509 friend bool operator!=(const Rotation& a,const Rotation& b);
510
511 friend class Frame;
512};
513 bool operator==(const Rotation& a,const Rotation& b);
514
515
516
518 \brief represents a frame transformation in 3D space (rotation + translation)
519
520 if V2 = Frame*V1 (V2 expressed in frame A, V1 expressed in frame B)
521 then V2 = Frame.M*V1+Frame.p
522
523 Frame.M contains columns that represent the axes of frame B wrt frame A
524 Frame.p contains the origin of frame B expressed in frame A.
526class Frame {
527public:
530
531public:
532
533 inline Frame(const Rotation& R,const Vector& V);
534
536 explicit inline Frame(const Vector& V);
538 explicit inline Frame(const Rotation& R);
539
540 inline void setValue(float* oglmat);
541 inline void getValue(float* oglmat) const;
542
543 inline Frame() {}
545 inline Frame(const Frame& arg);
546
548 //\TODO should be formulated as a constructor
549 void Make4x4(double* d);
550
553 inline double operator()(int i,int j);
554
556
557 inline double operator() (int i,int j) const;
558
559 // = Inverse
560
561 inline Frame Inverse() const;
562
564 inline Vector Inverse(const Vector& arg) const;
565
567 inline Wrench Inverse(const Wrench& arg) const;
568
570 inline Twist Inverse(const Twist& arg) const;
571
573 inline Frame& operator = (const Frame& arg);
574
576
577 inline Vector operator * (const Vector& arg) const;
578
585 inline Wrench operator * (const Wrench& arg) const;
586
592
593 inline Twist operator * (const Twist& arg) const;
594
596 inline friend Frame operator *(const Frame& lhs,const Frame& rhs);
597
599 inline static Frame Identity();
600
604 inline void Integrate(const Twist& t_this,double frequency);
605
606 /*
607 // DH_Craig1989 : constructs a transformationmatrix
608 // T_link(i-1)_link(i) with the Denavit-Hartenberg convention as
609 // described in the Craigs book: Craig, J. J.,Introduction to
610 // Robotics: Mechanics and Control, Addison-Wesley,
611 // isbn:0-201-10326-5, 1986.
612 //
613 // Note that the frame is a redundant way to express the information
614 // in the DH-convention.
615 // \verbatim
616 // Parameters in full : a(i-1),alpha(i-1),d(i),theta(i)
617 //
618 // axis i-1 is connected by link i-1 to axis i numbering axis 1
619 // to axis n link 0 (immobile base) to link n
620 //
621 // link length a(i-1) length of the mutual perpendicular line
622 // (normal) between the 2 axes. This normal runs from (i-1) to
623 // (i) axis.
624 //
625 // link twist alpha(i-1): construct plane perpendicular to the
626 // normal project axis(i-1) and axis(i) into plane angle from
627 // (i-1) to (i) measured in the direction of the normal
628 //
629 // link offset d(i) signed distance between normal (i-1) to (i)
630 // and normal (i) to (i+1) along axis i joint angle theta(i)
631 // signed angle between normal (i-1) to (i) and normal (i) to
632 // (i+1) along axis i
633 //
634 // First and last joints : a(0)= a(n) = 0
635 // alpha(0) = alpha(n) = 0
636 //
637 // PRISMATIC : theta(1) = 0 d(1) arbitrarily
638 //
639 // REVOLUTE : theta(1) arbitrarily d(1) = 0
640 //
641 // Not unique : if intersecting joint axis 2 choices for normal
642 // Frame assignment of the DH convention : Z(i-1) follows axis
643 // (i-1) X(i-1) is the normal between axis(i-1) and axis(i)
644 // Y(i-1) follows out of Z(i-1) and X(i-1)
645 //
646 // a(i-1) = distance from Z(i-1) to Z(i) along X(i-1)
647 // alpha(i-1) = angle between Z(i-1) to Z(i) along X(i-1)
648 // d(i) = distance from X(i-1) to X(i) along Z(i)
649 // theta(i) = angle between X(i-1) to X(i) along X(i)
650 // \endverbatim
651 */
652 static Frame DH_Craig1989(double a,double alpha,double d,double theta);
653
654 // DH : constructs a transformationmatrix T_link(i-1)_link(i) with
655 // the Denavit-Hartenberg convention as described in the original
656 // publictation: Denavit, J. and Hartenberg, R. S., A kinematic
657 // notation for lower-pair mechanisms based on matrices, ASME
658 // Journal of Applied Mechanics, 23:215-221, 1955.
659
660 static Frame DH(double a,double alpha,double d,double theta);
661
662
664
665 inline friend bool Equal(const Frame& a,const Frame& b,double eps);
666
668 inline friend bool operator==(const Frame& a,const Frame& b);
670 inline friend bool operator!=(const Frame& a,const Frame& b);
671};
672
673/**
674 * \brief represents both translational and rotational velocities.
675 *
676 * This class represents a twist. A twist is the combination of translational
677 * velocity and rotational velocity applied at one point.
678*/
679class Twist {
680public:
683public:
684
686 Twist():vel(),rot() {};
688 Twist(const Vector& _vel,const Vector& _rot):vel(_vel),rot(_rot) {};
689
690 inline Twist& operator-=(const Twist& arg);
691 inline Twist& operator+=(const Twist& arg);
693 inline double& operator()(int i);
694
697 inline double operator()(int i) const;
698
699 double operator[] ( int index ) const
700 {
701 return this->operator() ( index );
702 }
704 double& operator[] ( int index )
705 {
706 return this->operator() ( index );
707 }
708
709 inline friend Twist operator*(const Twist& lhs,double rhs);
710 inline friend Twist operator*(double lhs,const Twist& rhs);
711 inline friend Twist operator/(const Twist& lhs,double rhs);
712 inline friend Twist operator+(const Twist& lhs,const Twist& rhs);
713 inline friend Twist operator-(const Twist& lhs,const Twist& rhs);
714 inline friend Twist operator-(const Twist& arg);
715 inline friend double dot(const Twist& lhs,const Wrench& rhs);
716 inline friend double dot(const Wrench& rhs,const Twist& lhs);
717 inline friend void SetToZero(Twist& v);
718
719
720 //! @return a zero Twist : Twist(Vector::Zero(),Vector::Zero())
721 static inline Twist Zero();
722
723
724 inline void ReverseSign();
732 inline Twist RefPoint(const Vector& v_base_AB) const;
734
737 inline friend bool Equal(const Twist& a,const Twist& b,double eps);
738
740 inline friend bool operator==(const Twist& a,const Twist& b);
741 //! The literal inequality operator!=().
742 inline friend bool operator!=(const Twist& a,const Twist& b);
743
744// = Friends
745 friend class Rotation;
746 friend class Frame;
747
748};
749
757/*
758class AccelerationTwist {
759public:
760 Vector trans; //!< The translational acceleration of that point
761 Vector rot; //!< The rotational acceleration of that point.
762public:
763
764
765 AccelerationTwist():trans(),rot() {};
766
767 AccelerationTwist(const Vector& _trans,const Vector& _rot):trans(_trans),rot(_rot) {};
768
769 inline AccelerationTwist& operator-=(const AccelerationTwist& arg);
770 inline AccelerationTwist& operator+=(const AccelerationTwist& arg);
772 inline double& operator()(int i);
773
774
775 //! For use with a const AccelerationTwist
776 inline double operator()(int i) const;
777
778 double operator[] ( int index ) const
779 {
780 return this->operator() ( index );
781 }
782
783 double& operator[] ( int index )
784 {
785 return this->operator() ( index );
786 }
788 inline friend AccelerationTwist operator*(const AccelerationTwist& lhs,double rhs);
789 inline friend AccelerationTwist operator*(double lhs,const AccelerationTwist& rhs);
790 inline friend AccelerationTwist operator/(const AccelerationTwist& lhs,double rhs);
791 inline friend AccelerationTwist operator+(const AccelerationTwist& lhs,const AccelerationTwist& rhs);
792 inline friend AccelerationTwist operator-(const AccelerationTwist& lhs,const AccelerationTwist& rhs);
793 inline friend AccelerationTwist operator-(const AccelerationTwist& arg);
794 //inline friend double dot(const AccelerationTwist& lhs,const Wrench& rhs);
795 //inline friend double dot(const Wrench& rhs,const AccelerationTwist& lhs);
796 inline friend void SetToZero(AccelerationTwist& v);
798
800 static inline AccelerationTwist Zero();
801
802 //! Reverses the sign of the AccelerationTwist
803 inline void ReverseSign();
804
806
807 //! The vector v_base_AB is a vector from the old point to
808 //! the new point.
809 //!
810 //! Complexity : 6M+6A
811 inline AccelerationTwist RefPoint(const Vector& v_base_AB) const;
813
816 inline friend bool Equal(const AccelerationTwist& a,const AccelerationTwist& b,double eps=epsilon);
819 inline friend bool operator==(const AccelerationTwist& a,const AccelerationTwist& b);
821 inline friend bool operator!=(const AccelerationTwist& a,const AccelerationTwist& b);
822
823// = Friends
824 friend class Rotation;
825 friend class Frame;
826
827};
828*/
830
832 * This class represents a Wrench. A Wrench is the force and torque applied at a point
833 */
839public:
843 Wrench(const Vector& _force,const Vector& _torque):force(_force),torque(_torque) {};
844
845// = Operators
846 inline Wrench& operator-=(const Wrench& arg);
847 inline Wrench& operator+=(const Wrench& arg);
848
850 inline double& operator()(int i);
851
852 //! index-based access to components, first force(0..2), then torque(3..5)
853 //! for use with a const Wrench
854 inline double operator()(int i) const;
855
856 double operator[] ( int index ) const
857 {
858 return this->operator() ( index );
859 }
860
861 double& operator[] ( int index )
862 {
863 return this->operator() ( index );
865
867 inline friend Wrench operator*(const Wrench& lhs,double rhs);
869 inline friend Wrench operator*(double lhs,const Wrench& rhs);
870 //! Scalar division
871 inline friend Wrench operator/(const Wrench& lhs,double rhs);
872
873 inline friend Wrench operator+(const Wrench& lhs,const Wrench& rhs);
874 inline friend Wrench operator-(const Wrench& lhs,const Wrench& rhs);
875
876
877 inline friend Wrench operator-(const Wrench& arg);
878
881 inline friend void SetToZero(Wrench& v);
882
884 static inline Wrench Zero();
885
887 inline void ReverseSign();
892
893 //!
894 //! Complexity : 6M+6A
895 inline Wrench RefPoint(const Vector& v_base_AB) const;
896
900 inline friend bool Equal(const Wrench& a,const Wrench& b,double eps);
901
903 inline friend bool operator==(const Wrench& a,const Wrench& b);
905 inline friend bool operator!=(const Wrench& a,const Wrench& b);
906
907 friend class Rotation;
908 friend class Frame;
909
910
912
913
914
916{
917 double data[2];
918public:
919 //! Does not initialise to Zero().
920 Vector2() {data[0]=data[1] = 0.0;}
921 inline Vector2(double x,double y);
922 inline Vector2(const Vector2& arg);
923 inline Vector2(double* xyz);
924 inline Vector2(float* xyz);
925
926 inline Vector2& operator = ( const Vector2& arg);
929 inline double operator()(int index) const;
930
932 inline double& operator() (int index);
935 inline void GetValue(double* xy) const;
936
937 inline void ReverseSign();
938 inline Vector2& operator-=(const Vector2& arg);
939 inline Vector2& operator +=(const Vector2& arg);
940
942 inline friend Vector2 operator*(const Vector2& lhs,double rhs);
943 inline friend Vector2 operator*(double lhs,const Vector2& rhs);
944 inline friend Vector2 operator/(const Vector2& lhs,double rhs);
945 inline friend Vector2 operator+(const Vector2& lhs,const Vector2& rhs);
946 inline friend Vector2 operator-(const Vector2& lhs,const Vector2& rhs);
947 inline friend Vector2 operator*(const Vector2& lhs,const Vector2& rhs);
948 inline friend Vector2 operator-(const Vector2& arg);
949 inline friend void SetToZero(Vector2& v);
950
952 inline static Vector2 Zero();
953
954
955 * makes v a unitvector and returns the norm of v.
956 * if v is smaller than eps, Vector(1,0,0) is returned with norm 0.
957 * if this is not good, check the return value of this method.
958 */
959 double Normalize(double eps=epsilon);
960
961 //! @return the norm of the vector
962 inline double Norm() const;
963
965 inline void Set3DXY(const Vector& v);
966
967 //! projects v in its YZ plane, and sets *this to these values
968 inline void Set3DYZ(const Vector& v);
969
971 inline void Set3DZX(const Vector& v);
976 inline void Set3DPlane(const Frame& F_someframe_XY,const Vector& v_someframe);
978
981 inline friend bool Equal(const Vector2& a,const Vector2& b,double eps);
983 friend class Rotation2;
984};
985
986
987
988//! of the methods see Rotation class.
990{
991 double s,c;
994public:
996 Rotation2() {c=1.0;s=0.0;}
997
998 explicit Rotation2(double angle_rad):s(sin(angle_rad)),c(cos(angle_rad)) {}
999
1000 Rotation2(double ca,double sa):s(sa),c(ca){}
1001
1002 inline Rotation2& operator=(const Rotation2& arg);
1003 inline Vector2 operator*(const Vector2& v) const;
1005 inline double operator() (int i,int j) const;
1006
1007 inline friend Rotation2 operator *(const Rotation2& lhs,const Rotation2& rhs);
1008
1009 inline void SetInverse();
1010 inline Rotation2 Inverse() const;
1011 inline Vector2 Inverse(const Vector2& v) const;
1012
1013 inline void SetIdentity();
1014 inline static Rotation2 Identity();
1016
1018 inline void SetRot(double angle);
1019
1021 inline static Rotation2 Rot(double angle);
1022
1024 inline double GetRot() const;
1025
1028 inline friend bool Equal(const Rotation2& a,const Rotation2& b,double eps);
1029};
1030
1031//! A 2D frame class, for further documentation see the Frames class
1032//! for methods with unchanged semantics.
1034 {
1035public:
1038
1039public:
1040
1041 inline Frame2(const Rotation2& R,const Vector2& V);
1042 explicit inline Frame2(const Vector2& V);
1043 explicit inline Frame2(const Rotation2& R);
1044 inline Frame2(void);
1045 inline Frame2(const Frame2& arg);
1046 inline void Make4x4(double* d);
1047
1049 //! Access to elements 0..2,0..2, bounds are checked when NDEBUG is not set
1050 inline double operator()(int i,int j);
1051
1052
1053 //! Access to elements 0..3,0..3, bounds are checked when NDEBUG is not set
1054 inline double operator() (int i,int j) const;
1055
1056 inline void SetInverse();
1057 inline Frame2 Inverse() const;
1058 inline Vector2 Inverse(const Vector2& arg) const;
1059 inline Frame2& operator = (const Frame2& arg);
1060 inline Vector2 operator * (const Vector2& arg);
1061 inline friend Frame2 operator *(const Frame2& lhs,const Frame2& rhs);
1062 inline void SetIdentity();
1063 inline void Integrate(const Twist& t_this,double frequency);
1064 inline static Frame2 Identity() {
1065 Frame2 tmp;
1066 tmp.SetIdentity();
1067 return tmp;
1068 }
1069 inline friend bool Equal(const Frame2& a,const Frame2& b,double eps);
1070};
1071
1072inline bool Equal(const Vector&, const Vector&, double = epsilon);
1073 bool Equal(const Rotation&, const Rotation&, double = epsilon);
1074inline bool Equal(const Frame&, const Frame&, double = epsilon);
1075inline bool Equal(const Twist&, const Twist&, double = epsilon);
1076inline bool Equal(const Wrench&, const Wrench&, double = epsilon);
1077inline bool Equal(const Vector2&, const Vector2&, double = epsilon);
1078inline bool Equal(const Rotation2&, const Rotation2&, double = epsilon);
1079inline bool Equal(const Frame2&, const Frame2&, double = epsilon);
1080
1081IMETHOD Vector diff(const Vector& a,const Vector& b,double dt=1);
1082IMETHOD Vector diff(const Rotation& R_a_b1,const Rotation& R_a_b2,double dt=1);
1083IMETHOD Twist diff(const Frame& F_a_b1,const Frame& F_a_b2,double dt=1);
1084IMETHOD Twist diff(const Twist& a,const Twist& b,double dt=1);
1085IMETHOD Wrench diff(const Wrench& W_a_p1,const Wrench& W_a_p2,double dt=1);
1086IMETHOD Vector addDelta(const Vector& a,const Vector&da,double dt=1);
1087IMETHOD Rotation addDelta(const Rotation& a,const Vector&da,double dt=1);
1088IMETHOD Frame addDelta(const Frame& a,const Twist& da,double dt=1);
1089IMETHOD Twist addDelta(const Twist& a,const Twist&da,double dt=1);
1090IMETHOD Wrench addDelta(const Wrench& a,const Wrench&da,double dt=1);
1091#ifdef KDL_INLINE
1092// #include "vector.inl"
1093// #include "wrench.inl"
1094 //#include "rotation.inl"
1095 //#include "frame.inl"
1096 //#include "twist.inl"
1097 //#include "vector2.inl"
1098 //#include "rotation2.inl"
1099 //#include "frame2.inl"
1100#include "frames.inl"
1101#endif
1102
1103
1104
1106
1107
1108#endif
#define X
static double angle(const Eigen::Vector3d &v1, const Eigen::Vector3d &v2)
Definition IK_Math.h:117
ATTR_WARN_UNUSED_RESULT const BMVert * v
SIMD_FORCE_INLINE const btScalar & z() const
Return the z value.
Definition btQuadWord.h:117
A 2D frame class, for further documentation see the Frames class for methods with unchanged semantics...
Definition frames.hpp:1034
void SetIdentity()
Definition frames.hpp:982
double operator()(int i, int j)
Treats a frame as a 3x3 matrix and returns element i,j Access to elements 0..2,0.....
Definition frames.hpp:1015
friend bool Equal(const Frame2 &a, const Frame2 &b, double eps)
Definition frames.hpp:1100
Frame2(const Rotation2 &R, const Vector2 &V)
Definition frames.hpp:961
Vector2 operator*(const Vector2 &arg)
Definition frames.hpp:972
static Frame2 Identity()
Definition frames.hpp:1064
Frame2 & operator=(const Frame2 &arg)
Definition frames.hpp:1003
void Integrate(const Twist &t_this, double frequency)
Frame2(void)
Definition frames.hpp:946
Rotation2 M
Orientation of the Frame.
Definition frames.hpp:1037
Vector2 p
origine of the Frame
Definition frames.hpp:1036
void SetInverse()
Definition frames.hpp:988
void Make4x4(double *d)
Frame2 Inverse() const
Definition frames.hpp:996
represents a frame transformation in 3D space (rotation + translation)
Definition frames.hpp:526
static Frame Identity()
Definition frames.hpp:720
Rotation M
Orientation of the Frame.
Definition frames.hpp:529
void setValue(float *oglmat)
Definition frames.hpp:725
void Make4x4(double *d)
Reads data from an double array.
Definition frames.cpp:39
void Integrate(const Twist &t_this, double frequency)
The twist <t_this> is expressed wrt the current frame. This frame is integrated into an updated frame...
Definition frames.hpp:629
Frame & operator=(const Frame &arg)
Normal copy-by-value semantics.
Definition frames.hpp:438
friend bool Equal(const Frame &a, const Frame &b, double eps)
do not use operator == because the definition of Equal(.,.) is slightly different....
Definition frames.hpp:1076
void getValue(float *oglmat) const
Definition frames.hpp:733
friend bool operator==(const Frame &a, const Frame &b)
The literal equality operator==(), also identical.
Definition frames.hpp:1344
static Frame DH_Craig1989(double a, double alpha, double d, double theta)
Definition frames.cpp:53
Vector operator*(const Vector &arg) const
Transformation of the base to which the vector is expressed.
Definition frames.hpp:422
Vector p
origine of the Frame
Definition frames.hpp:528
Frame Inverse() const
Gives back inverse transformation of a Frame.
Definition frames.hpp:432
double operator()(int i, int j)
Treats a frame as a 4x4 matrix and returns element i,j Access to elements 0..3,0.....
Definition frames.hpp:687
friend bool operator!=(const Frame &a, const Frame &b)
The literal inequality operator!=().
Definition frames.hpp:1353
static Frame DH(double a, double alpha, double d, double theta)
Definition frames.cpp:70
A 2D Rotation class, for conventions see Rotation. For further documentation of the methods see Rotat...
Definition frames.hpp:990
double GetRot() const
Gets the angle (in radians).
Definition frames.hpp:941
Vector2 operator*(const Vector2 &v) const
Definition frames.hpp:893
double operator()(int i, int j) const
Access to elements 0..1,0..1, bounds are checked when NDEBUG is not set.
Definition frames.hpp:897
Rotation2(double ca, double sa)
Definition frames.hpp:1000
static Rotation2 Rot(double angle)
The Rot... static functions give the value of the appropriate rotation matrix bac.
Definition frames.hpp:937
void SetInverse()
Definition frames.hpp:911
Rotation2()
c,s represent cos(angle), sin(angle), this also represents first col. of rot matrix from outside,...
Definition frames.hpp:996
static Rotation2 Identity()
Definition frames.hpp:923
friend bool Equal(const Rotation2 &a, const Rotation2 &b, double eps)
do not use operator == because the definition of Equal(.,.) is slightly different....
Definition frames.hpp:1096
void SetIdentity()
Definition frames.hpp:927
Rotation2(double angle_rad)
Definition frames.hpp:998
Rotation2 Inverse() const
Definition frames.hpp:915
void SetRot(double angle)
The SetRot.. functions set the value of *this to the appropriate rotation matrix.
Definition frames.hpp:933
Rotation2 & operator=(const Rotation2 &arg)
Definition frames.hpp:888
represents rotations in 3 dimensional space.
Definition frames.hpp:299
Vector GetRot() const
Returns a vector with the direction of the equiv. axis and its norm is angle.
Definition frames.cpp:297
void GetRPY(double &roll, double &pitch, double &yaw) const
Gives back a vector in RPY coordinates, variables are bound by -PI <= roll <= PI -PI <= Yaw <= PI -PI...
Definition frames.cpp:207
void DoRotZ(double angle)
The DoRot... functions apply a rotation R to *this,such that *this = *this * Rot.....
Definition frames.hpp:593
Rotation Inverse() const
Gives back the inverse rotation matrix of *this.
Definition frames.hpp:642
Rotation & operator=(const Rotation &arg)
Definition frames.hpp:525
Vector operator*(const Vector &v) const
Defines a multiplication R*V between a Rotation R and a Vector V. Complexity : 9M+6A.
Definition frames.hpp:531
Vector UnitY() const
Access to the underlying unitvectors of the rotation matrix.
Definition frames.hpp:479
void UnitZ(const Vector &X)
Access to the underlying unitvectors of the rotation matrix.
Definition frames.hpp:496
Vector UnitZ() const
Access to the underlying unitvectors of the rotation matrix.
Definition frames.hpp:491
Vector UnitX() const
Access to the underlying unitvectors of the rotation matrix.
Definition frames.hpp:467
double GetRotAngle(Vector &axis, double eps=epsilon) const
Definition frames.cpp:354
static Rotation EulerZYX(double Alfa, double Beta, double Gamma)
Gives back a rotation matrix specified with EulerZYX convention : First rotate around Z with alfa,...
Definition frames.hpp:435
static Rotation Rot2(const Vector &rotvec, double angle)
Along an arbitrary axes. rotvec should be normalized.
Definition frames.cpp:273
static Rotation Identity()
Gives back an identity rotaton matrix.
Definition frames.hpp:557
void GetEulerZYZ(double &alfa, double &beta, double &gamma) const
Gives back the EulerZYZ convention description of the rotation matrix : First rotate around Z with al...
Definition frames.cpp:233
static Rotation RotX(double angle)
The Rot... static functions give the value of the appropriate rotation matrix back.
Definition frames.hpp:610
Vector2 GetXZRot() const
Returns a 2D vector representing the equivalent rotation in the XZ plane that brings the Y axis onto ...
Definition frames.cpp:330
void setValue(float *oglmat)
Definition frames.hpp:657
friend bool operator==(const Rotation &a, const Rotation &b)
do not use operator == because the definition of Equal(.,.) is slightly different....
Definition frames.cpp:377
friend bool operator!=(const Rotation &a, const Rotation &b)
The literal inequality operator!=().
Definition frames.hpp:1396
void UnitX(const Vector &X)
Access to the underlying unitvectors of the rotation matrix.
Definition frames.hpp:472
static Rotation Rot(const Vector &rotaxis, double angle)
Along an arbitrary axes. It is not necessary to normalize rotaxis. returns identity rotation matrix i...
Definition frames.cpp:250
void DoRotX(double angle)
The DoRot... functions apply a rotation R to *this,such that *this = *this * Rot.....
Definition frames.hpp:561
double data[9]
Definition frames.hpp:301
static Rotation RotY(double angle)
The Rot... static functions give the value of the appropriate rotation matrix back.
Definition frames.hpp:615
void getValue(float *oglmat) const
Definition frames.hpp:665
void SetInverse()
Sets the value of *this to its inverse.
Definition frames.hpp:673
void Ortho()
Definition frames.cpp:169
static Rotation EulerZYZ(double Alfa, double Beta, double Gamma)
Gives back a rotation matrix specified with EulerZYZ convention : First rotate around Z with alfa,...
Definition frames.cpp:220
void GetEulerZYX(double &Alfa, double &Beta, double &Gamma) const
GetEulerZYX gets the euler ZYX parameters of a rotation : First rotate around Z with alfa,...
Definition frames.hpp:450
void UnitY(const Vector &X)
Access to the underlying unitvectors of the rotation matrix.
Definition frames.hpp:484
static Rotation RotZ(double angle)
The Rot... static functions give the value of the appropriate rotation matrix back.
Definition frames.hpp:620
friend class Frame
Definition frames.hpp:511
double & operator()(int i, int j)
Access to elements 0..2,0..2, bounds are checked when NDEBUG is not set.
Definition frames.hpp:498
void DoRotY(double angle)
The DoRot... functions apply a rotation R to *this,such that *this = *this * Rot.....
Definition frames.hpp:577
static Rotation RPY(double roll, double pitch, double yaw)
Sets the value of this object to a rotation specified with RPY convention: first rotate around X with...
Definition frames.cpp:195
represents both translational and rotational velocities.
Definition frames.hpp:679
friend Twist operator*(const Twist &lhs, double rhs)
Definition frames.hpp:366
Twist(const Vector &_vel, const Vector &_rot)
Definition frames.hpp:688
Twist & operator+=(const Twist &arg)
Definition frames.hpp:340
double & operator()(int i)
index-based access to components, first vel(0..2), then rot(3..5)
Definition frames.hpp:347
friend double dot(const Twist &lhs, const Wrench &rhs)
Definition frames.hpp:1053
friend bool operator==(const Twist &a, const Twist &b)
The literal equality operator==(), also identical.
Definition frames.hpp:1371
Vector rot
The rotational velocity of that point.
Definition frames.hpp:682
friend Twist operator-(const Twist &lhs, const Twist &rhs)
Definition frames.hpp:387
Twist()
The default constructor initialises to Zero via the constructor of Vector.
Definition frames.hpp:686
friend void SetToZero(Twist &v)
Definition frames.hpp:1108
friend Twist operator/(const Twist &lhs, double rhs)
Definition frames.hpp:376
friend class Rotation
Definition frames.hpp:745
void ReverseSign()
Reverses the sign of the twist.
Definition frames.hpp:317
friend bool Equal(const Twist &a, const Twist &b, double eps)
do not use operator == because the definition of Equal(.,.) is slightly different....
Definition frames.hpp:1086
Twist RefPoint(const Vector &v_base_AB) const
Changes the reference point of the twist. The vector v_base_AB is expressed in the same base as the t...
Definition frames.hpp:323
friend Twist operator+(const Twist &lhs, const Twist &rhs)
Definition frames.hpp:382
Twist & operator-=(const Twist &arg)
Definition frames.hpp:333
double operator[](int index) const
Definition frames.hpp:699
Vector vel
The velocity of that point.
Definition frames.hpp:681
static Twist Zero()
Definition frames.hpp:311
friend class Frame
Definition frames.hpp:746
friend bool operator!=(const Twist &a, const Twist &b)
The literal inequality operator!=().
Definition frames.hpp:1380
2D version of Vector
Definition frames.hpp:916
static Vector2 Zero()
Definition frames.hpp:831
friend Vector2 operator-(const Vector2 &lhs, const Vector2 &rhs)
Definition frames.hpp:797
void ReverseSign()
Definition frames.hpp:845
friend Vector2 operator*(const Vector2 &lhs, double rhs)
Definition frames.hpp:802
friend bool Equal(const Vector2 &a, const Vector2 &b, double eps)
do not use operator == because the definition of Equal(.,.) is slightly different....
Definition frames.hpp:1091
void Set3DZX(const Vector &v)
projects v in its ZX plane, and sets *this to these values
Definition frames.hpp:870
Vector2 & operator=(const Vector2 &arg)
Definition frames.hpp:780
double Normalize(double eps=epsilon)
Definition frames.cpp:102
void GetValue(double *xy) const
store vector components in array
Definition frames.hpp:787
void Set3DXY(const Vector &v)
projects v in its XY plane, and sets *this to these values
Definition frames.hpp:858
Vector2()
Does not initialise to Zero().
Definition frames.hpp:920
friend Vector2 operator/(const Vector2 &lhs, double rhs)
Definition frames.hpp:812
double Norm() const
Definition frames.cpp:87
friend class Rotation2
Definition frames.hpp:983
Vector2 & operator+=(const Vector2 &arg)
Definition frames.hpp:817
void Set3DYZ(const Vector &v)
projects v in its YZ plane, and sets *this to these values
Definition frames.hpp:864
friend void SetToZero(Vector2 &v)
Definition frames.hpp:1117
friend Vector2 operator*(const Vector2 &lhs, const Vector2 &rhs)
friend Vector2 operator+(const Vector2 &lhs, const Vector2 &rhs)
Definition frames.hpp:792
Vector2 & operator-=(const Vector2 &arg)
Definition frames.hpp:824
double operator()(int index) const
Access to elements, range checked when NDEBUG is not set, from 0..1.
Definition frames.hpp:835
void Set3DPlane(const Frame &F_someframe_XY, const Vector &v_someframe)
projects v_someframe in the XY plane of F_someframe_XY, and sets *this to these values expressed wrt ...
Definition frames.hpp:877
A concrete implementation of a 3 dimensional vector class.
Definition frames.hpp:143
void Set2DPlane(const Frame &F_someframe_XY, const Vector2 &v_XY)
a 3D vector where the 2D vector v_XY is put in the XY plane of the frame F_someframe_XY.
Definition frames.hpp:741
friend double dot(const Vector &lhs, const Vector &rhs)
Definition frames.hpp:1049
friend bool Equal(const Vector &a, const Vector &b, double eps)
do not use operator == because the definition of Equal(.,.) is slightly different....
Definition frames.hpp:1069
void GetValue(double *xyz) const
store vector components in array
Definition frames.hpp:52
double Norm() const
Definition frames.cpp:115
void ReverseSign()
Reverses the sign of the Vector object itself.
Definition frames.hpp:450
friend void SetToZero(Vector &v)
To have a uniform operator to put an element to zero, for scalar values and for objects.
Definition frames.hpp:1105
Vector & operator-=(const Vector &arg)
subtracts a vector from the Vector object itself
Definition frames.hpp:138
friend Vector operator+(const Vector &lhs, const Vector &rhs)
Definition frames.hpp:66
friend Vector operator/(const Vector &lhs, double rhs)
Scalar division is defined.
Definition frames.hpp:110
Vector & operator*=(double arg)
Multiply by a scalar.
Definition frames.hpp:147
friend bool operator==(const Vector &a, const Vector &b)
The literal equality operator==(), also identical.
Definition frames.hpp:1357
double z() const
Definition frames.hpp:86
double operator[](int index) const
Equivalent to double operator()(int index) const.
Definition frames.hpp:174
double y() const
Definition frames.hpp:85
void Set2DZX(const Vector2 &v)
a 3D vector where the 2D vector v is put in the ZX plane
Definition frames.hpp:485
Vector & operator+=(const Vector &arg)
Adds a vector from the Vector object itself.
Definition frames.hpp:129
Vector & operator=(const Vector &arg)
Assignment operator. The normal copy by value semantics.
Definition frames.hpp:58
double Normalize(double eps=epsilon)
Definition frames.cpp:145
Vector()
Does not initialise the Vector to zero. use Vector::Zero() or SetToZero for that.
Definition frames.hpp:147
double data[3]
Definition frames.hpp:145
double x() const
Definition frames.hpp:84
friend class Rotation
Definition frames.hpp:260
static Vector Zero()
Definition frames.hpp:155
void Set2DXY(const Vector2 &v)
a 3D vector where the 2D vector v is put in the XY plane
Definition frames.hpp:468
double operator()(int index) const
Access to elements, range checked when NDEBUG is not set, from 0..2.
Definition frames.hpp:160
friend Vector operator*(const Vector &lhs, double rhs)
Scalar multiplication is defined.
Definition frames.hpp:92
friend Vector operator-(const Vector &lhs, const Vector &rhs)
Definition frames.hpp:75
friend bool operator!=(const Vector &a, const Vector &b)
The literal inequality operator!=().
Definition frames.hpp:1367
friend class Frame
Definition frames.hpp:261
void Set2DYZ(const Vector2 &v)
a 3D vector where the 2D vector v is put in the YZ plane
Definition frames.hpp:476
represents both translational and rotational acceleration.
Definition frames.hpp:835
friend bool Equal(const Wrench &a, const Wrench &b, double eps)
do not use operator == because the definition of Equal(.,.) is slightly different....
Definition frames.hpp:1081
Wrench & operator+=(const Wrench &arg)
Definition frames.hpp:237
friend Wrench operator+(const Wrench &lhs, const Wrench &rhs)
Definition frames.hpp:279
Wrench & operator-=(const Wrench &arg)
Definition frames.hpp:230
Vector force
Force that is applied at the origin of the current ref frame.
Definition frames.hpp:837
friend bool operator==(const Wrench &a, const Wrench &b)
The literal equality operator==(), also identical.
Definition frames.hpp:1384
friend Wrench operator/(const Wrench &lhs, double rhs)
Scalar division.
Definition frames.hpp:273
Wrench()
Does initialise force and torque to zero via the underlying constructor of Vector.
Definition frames.hpp:842
static Wrench Zero()
Definition frames.hpp:206
Wrench(const Vector &_force, const Vector &_torque)
Definition frames.hpp:843
double & operator()(int i)
index-based access to components, first force(0..2), then torque(3..5)
Definition frames.hpp:244
friend Wrench operator-(const Wrench &lhs, const Wrench &rhs)
Definition frames.hpp:284
friend class Rotation
Definition frames.hpp:907
friend bool operator!=(const Wrench &a, const Wrench &b)
The literal inequality operator!=().
Definition frames.hpp:1393
Vector torque
Torque that is applied at the origin of the current ref frame.
Definition frames.hpp:838
double operator[](int index) const
Definition frames.hpp:856
Wrench RefPoint(const Vector &v_base_AB) const
Changes the reference point of the wrench. The vector v_base_AB is expressed in the same base as the ...
Definition frames.hpp:218
friend Wrench operator*(const Wrench &lhs, double rhs)
Scalar multiplication.
Definition frames.hpp:263
friend void SetToZero(Wrench &v)
Sets the Wrench to Zero, to have a uniform function that sets an object or double to zero.
Definition frames.hpp:1112
friend class Frame
Definition frames.hpp:908
void ReverseSign()
Reverses the sign of the current Wrench.
Definition frames.hpp:212
Frame(const Rotation &R, const Vector &V)
Definition frames.hpp:410
Twist()
The default constructor initialises to Zero via the constructor of Vector.
Definition frames.hpp:686
Vector2()
Does not initialise to Zero().
Definition frames.hpp:920
Vector()
Does not initialise the Vector to zero. use Vector::Zero() or SetToZero for that.
Definition frames.hpp:147
ccl_device_inline float beta(const float x, const float y)
Definition math_base.h:661
#define R
Definition chain.cpp:27
IMETHOD Vector diff(const Vector &a, const Vector &b, double dt=1)
Definition frames.hpp:1167
INLINE Rall1d< T, V, S > sin(const Rall1d< T, V, S > &arg)
Definition rall1d.h:311
bool operator==(const Rotation &a, const Rotation &b)
Definition frames.cpp:377
IMETHOD bool Equal(const VectorAcc &, const VectorAcc &, double=epsilon)
Definition frameacc.hpp:158
IMETHOD Vector addDelta(const Vector &a, const Vector &da, double dt=1)
Definition frames.hpp:1225
INLINE Rall1d< T, V, S > cos(const Rall1d< T, V, S > &arg)
Definition rall1d.h:319
double epsilon
default precision while comparing with Equal(..,..) functions. Initialized at 0.0000001.
Definition utility.cpp:22
Vector Normalize(const Vector &, double eps=epsilon)
Definition frames.hpp:171
const btScalar eps
Definition poly34.cpp:11
i
Definition text_draw.cc:230
#define IMETHOD
Definition utility.h:43
CCL_NAMESPACE_BEGIN struct Window V
int xy[2]
Definition wm_draw.cc:178