00001
00002
00003
00004
00005
00006
00007
00008
00009
00010
00011
00012
00013
00014
00015
00016
00017
00018
00019
00020
00021
00022
00023
00024
00025
00026
00027
00028 #ifndef ROBOTGL_H
00029 #define ROBOTGL_H
00030
00036
00037 static const char header_robotgl_rcsid[] = "$Id: robotgl.h,v 1.7 2006/12/19 18:22:18 gourdeau Exp $";
00038
00039 #if defined __BORLANDC__
00040 #include <mem.h>
00041 #endif
00042 #include "config.h"
00043 #include "enviro.h"
00044 #include "stl.h"
00045
00046 const unsigned short NbParametresPerLink = 6;
00047
00048
00049
00064 class Linkgl : public Basic_object, public STL_obj
00065 {
00066 friend class Robotgl_basic;
00067 friend class Robotgl;
00068 friend class mRobotgl;
00069 public:
00070 Linkgl(bool DH = false);
00071 Linkgl(const std::vector<double> & parameters, const ColumnVector & pos,
00072 double jnt_radius, const bool DH = false,
00073 const double stl_translation_x=0, const double stl_translation_y=0,
00074 const double stl_translation_z=0, const double stl_rotation_x=0,
00075 const double stl_rotation_y=0, const double stl_rotation_z=0,
00076 const double stl_scalling_x=1, const double stl_scalling_y=1,
00077 const double stl_scalling_z=1, const float red=0.5,
00078 const float green=0, const float blue=0, const string stl_file="");
00079 Linkgl(const Linkgl & x);
00080 ~Linkgl();
00081 Linkgl & operator=(const Linkgl & x);
00082 double get_radius()const{ return radius; }
00083 bool get_STL()const{ return STL; }
00084 void create_list();
00085 private:
00086 bool DH,
00087 STL;
00088 double a,
00089 d,
00090 alpha,
00091 radius;
00092 };
00093
00107 class Jointgl : public Basic_object, public STL_obj
00108 {
00109 friend class Robotgl_basic;
00110 friend class Robotgl;
00111 friend class mRobotgl;
00112 public:
00113 Jointgl(bool DH = false);
00114 Jointgl(const std::vector<double> & parameters, const ColumnVector & pos,
00115 const bool DH = false, const double stl_translation_x=0,
00116 const double stl_translation_y=0, const double stl_translation_z=0,
00117 const double stl_rotation_x=0, const double stl_rotation_y=0,
00118 const double stl_rotation_z=0, const double stl_scalling_x=1,
00119 const double stl_scalling_y=1, const double stl_scalling_z=1,
00120 const float red=0.5, const float green=0,
00121 const float blue=0, const string stl_file="");
00122 Jointgl(const Jointgl & x);
00123 ~Jointgl();
00124 Jointgl & operator=(const Jointgl & x);
00125 bool get_STL(){ return STL; }
00126 void create_list();
00127 private:
00128 bool DH,
00129 STL;
00130 short prismatic;
00131 double radius,
00132 hight;
00133 };
00134
00140 class Robotgl_basic: public Basic_object
00141 {
00142 public:
00143 Robotgl_basic(const short ndof=1);
00144 Robotgl_basic(const Robotgl_basic & x);
00145 virtual ~Robotgl_basic();
00146 Robotgl_basic & operator=(const Robotgl_basic & x);
00147 void set_dof(const short dof);
00148 bool Is_STL();
00149 void create_list();
00150 virtual void draw()=0;
00151
00152 Linkgl *linkgl;
00153 Jointgl *jointgl;
00154
00155 short dof;
00156 ColumnVector pos;
00157 Axis *axis;
00158 };
00159
00160
00169 class Robotgl : public Robot, public Robotgl_basic
00170 {
00171 public:
00172 Robotgl(const short ndof=1);
00173 Robotgl(const Matrix & initrob, const ColumnVector & position);
00174 Robotgl(const Matrix & initrob, const Matrix & initrobm,
00175 const ColumnVector & position);
00176 Robotgl(const string & filename, const string & robotName,
00177 const ColumnVector & position);
00178 Robotgl(const Robotgl & x);
00179 ~Robotgl(){}
00180 Robotgl & operator=(const Robotgl & x);
00181 virtual void draw();
00182 };
00183
00192 class mRobotgl : public mRobot, public Robotgl_basic
00193 {
00194 public:
00195 mRobotgl(const short ndof=1);
00196 mRobotgl(const Matrix & initrob, const ColumnVector & position);
00197 mRobotgl(const Matrix & initrob, const Matrix & initrobm,
00198 const ColumnVector & position);
00199 mRobotgl(const string & filename, const string & robotName,
00200 const ColumnVector & position);
00201 mRobotgl(const mRobotgl & x);
00202 ~mRobotgl(){};
00203 mRobotgl & operator=(const mRobotgl & x);
00204 virtual void draw();
00205 };
00206
00207 #endif