Homepage | Demos | Overview | Downloads | Tutorials | Reference | Credits |
00001 //-*-c++-*- 00002 //This class is ported from Carnegie Mellon's 2001 Robosoccer entry, and falls under their license: 00003 /*========================================================================= 00004 CMPack'02 Source Code Release for OPEN-R SDK v1.0 00005 Copyright (C) 2002 Multirobot Lab [Project Head: Manuela Veloso] 00006 School of Computer Science, Carnegie Mellon University 00007 ------------------------------------------------------------------------- 00008 This software is distributed under the GNU General Public License, 00009 version 2. If you do not have a copy of this licence, visit 00010 www.gnu.org, or write: Free Software Foundation, 59 Temple Place, 00011 Suite 330 Boston, MA 02111-1307 USA. This program is distributed 00012 in the hope that it will be useful, but WITHOUT ANY WARRANTY, 00013 including MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. 00014 ------------------------------------------------------------------------- 00015 Additionally licensed to Sony Corporation under the following terms: 00016 00017 This software is provided by the copyright holders AS IS and any 00018 express or implied warranties, including, but not limited to, the 00019 implied warranties of merchantability and fitness for a particular 00020 purpose are disclaimed. In no event shall authors be liable for 00021 any direct, indirect, incidental, special, exemplary, or consequential 00022 damages (including, but not limited to, procurement of substitute 00023 goods or services; loss of use, data, or profits; or business 00024 interruption) however caused and on any theory of liability, whether 00025 in contract, strict liability, or tort (including negligence or 00026 otherwise) arising in any way out of the use of this software, even if 00027 advised of the possibility of such damage. 00028 ========================================================================= 00029 */ 00030 00031 #ifndef __KINEMATICS_H__ 00032 #define __KINEMATICS_H__ 00033 00034 #include "Geometry.h" 00035 #include "Shared/Util.h" 00036 00037 #define RAD(deg) (((deg) * M_PI ) / 180.0) 00038 #define DEG(rad) (((rad) * 180.0) / M_PI ) 00039 00040 extern const double rotator_min ; 00041 extern const double rotator_max ; 00042 extern const double shoulder_min; 00043 extern const double shoulder_max; 00044 extern const double knee_max ; 00045 extern const double knee_min ; 00046 00047 extern const double rotator_kmin ; 00048 extern const double rotator_kmax ; 00049 extern const double shoulder_kmin; 00050 extern const double shoulder_kmax; 00051 extern const double knee_kmax ; 00052 extern const double f_knee_kmin ; 00053 extern const double h_knee_kmin ; 00054 00055 extern const double tail_min; 00056 extern const double tail_max; 00057 00058 extern const double head_tilt_min; 00059 extern const double head_tilt_max; 00060 extern const double head_pan_min ; 00061 extern const double head_pan_max ; 00062 extern const double head_roll_min; 00063 extern const double head_roll_max; 00064 00065 //! holds the current location of the body, as a delta from when walking started 00066 /*! @todo get rid of this */ 00067 struct BodyPosition{ 00068 //! constructor 00069 BodyPosition() : loc(), angle() {} 00070 vector3d loc; //!< position of the center of the body 00071 vector3d angle; //!< angle of the center of the body 00072 }; 00073 00074 const vector3d body_to_neck ( 75.00, 0.00, 50.00); 00075 const vector3d neck_to_camera ( 65.00, 0.00, 48.00); 00076 00077 void KinClearErrors(); 00078 int KinGetErrors(); 00079 00080 void GetLegAngles(double *angles,vector3d target,int leg); 00081 void GetLegAngles(double *angles,vector3d target[4], 00082 double body_angle,double body_height); 00083 void GetLegAngles(double *angles,vector3d target[4],BodyPosition &bp); 00084 00085 void GetLegAngles(double *angles,vector3d target,BodyPosition &bp,int leg); 00086 void GetLegPosition(vector3d& p,const double* ang,int leg); 00087 00088 void GetBodyLocation(vector3d &ball,vector3d &toe,const double *ang,int leg); 00089 00090 // get the tilt,pan,roll angles to point the head towards the target assuming 00091 // the given body_angle/body_height 00092 void GetHeadAngles(double *angles,vector3d target, 00093 double body_angle,double body_height); 00094 // converts the camera relative position "point" to a robot centric (under base of neck) position 00095 // using the given head angles (tilt/pan/roll) and body_angle and body_height 00096 vector3d RunForwardModel(double *angles, 00097 double body_angle, double body_height, 00098 vector3d point); 00099 // gets the location of the camera and basis vectors corresponding to the directions of the camera's 00100 // z,-y,x corrdinate axis 00101 void GetHeadPosition(vector3d &location, vector3d &direction, vector3d &up, vector3d &right, 00102 double *angles, double body_angle, double body_height); 00103 00104 00105 /*! @file 00106 * @brief Functions to provide kinematics calculations 00107 * @author CMU RoboSoccer 2001-2002 (Creator) 00108 * 00109 * @verbinclude CMPack_license.txt 00110 * 00111 * $Author: ejt $ 00112 * $Name: tekkotsu-1_4_1 $ 00113 * $Revision: 1.6 $ 00114 * $State: Exp $ 00115 * $Date: 2003/03/03 01:18:13 $ 00116 */ 00117 00118 #endif 00119 // __KINEMATICS_H__
Tekkotsu v1.4 |
Generated Sat Jul 19 00:06:30 2003 by Doxygen 1.3.2 |