ViSP  2.6.2
vpRobot.h
1 /****************************************************************************
2  *
3  * $Id: vpRobot.h 3695 2012-05-03 07:20:19Z fspindle $
4  *
5  * This file is part of the ViSP software.
6  * Copyright (C) 2005 - 2012 by INRIA. All rights reserved.
7  *
8  * This software is free software; you can redistribute it and/or
9  * modify it under the terms of the GNU General Public License
10  * ("GPL") version 2 as published by the Free Software Foundation.
11  * See the file LICENSE.txt at the root directory of this source
12  * distribution for additional information about the GNU GPL.
13  *
14  * For using ViSP with software that can not be combined with the GNU
15  * GPL, please contact INRIA about acquiring a ViSP Professional
16  * Edition License.
17  *
18  * See http://www.irisa.fr/lagadic/visp/visp.html for more information.
19  *
20  * This software was developed at:
21  * INRIA Rennes - Bretagne Atlantique
22  * Campus Universitaire de Beaulieu
23  * 35042 Rennes Cedex
24  * France
25  * http://www.irisa.fr/lagadic
26  *
27  * If you have questions regarding the use of this file, please contact
28  * INRIA at visp@inria.fr
29  *
30  * This file is provided AS IS with NO WARRANTY OF ANY KIND, INCLUDING THE
31  * WARRANTY OF DESIGN, MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE.
32  *
33  *
34  * Description:
35  * Generic virtual robot.
36  *
37  * Authors:
38  * Eric Marchand
39  *
40  *****************************************************************************/
41 
42 #ifndef vpRobot_H
43 #define vpRobot_H
44 
50 #include <visp/vpHomogeneousMatrix.h>
51 #include <visp/vpMatrix.h>
52 #include <visp/vpColVector.h>
53 #include <visp/vpPoseVector.h>
54 
55 
60 class VISP_EXPORT vpRobot
61 {
62 public:
66  typedef enum
67  {
68  STATE_STOP,
72  STATE_ACCELERATION_CONTROL
73  } vpRobotStateType ;
74 
77  static const vpRobot::vpRobotStateType
78  defaultEtatRobot = vpRobot::STATE_STOP;
79 
83  typedef enum
84  {
85 
86  REFERENCE_FRAME,
89  CAMERA_FRAME,
91  MIXT_FRAME
94  } vpControlFrameType ;
95 
96  static const vpRobot::vpControlFrameType
97  defaultFrameRobot = vpRobot::CAMERA_FRAME ;
98 
99 private: /* Membres privees */
100  vpRobot::vpRobotStateType stateRobot;
101  vpRobot::vpControlFrameType frameRobot;
102 
103 
104 protected:
106  static const double maxTranslationVelocityDefault;// = 0.2;
108  static const double maxRotationVelocityDefault;// = 0.7;
109 
111  int nDof ;
120 
121 public:
122  vpRobot (void);
123  virtual ~vpRobot() { ; }
124 
125  //---------- Jacobian -----------------------------
127  virtual void get_eJe(vpMatrix &_eJe) = 0 ;
129  virtual void get_fJe(vpMatrix &_fJe) = 0 ;
130 
132  virtual void getArticularDisplacement(vpColVector &qdot) = 0 ;
134  virtual void getCameraDisplacement(vpColVector &v) = 0 ;
136  virtual void getDisplacement(const vpRobot::vpControlFrameType frame,
137  vpColVector &q) = 0 ;
138 
139  double getMaxTranslationVelocity (void) const ;
140  double getMaxRotationVelocity (void) const;
142  virtual void getPosition(const vpRobot::vpControlFrameType frame,
143  vpColVector &q) = 0 ;
144 
146  vpColVector getPosition (const vpRobot::vpControlFrameType frame);
147  vpControlFrameType getRobotFrame (void) { return frameRobot ; }
148  virtual vpRobotStateType getRobotState (void) { return stateRobot ; }
149 
150  virtual void init() = 0 ;
151 
152  static vpColVector saturateVelocities(const vpColVector &v_in, const vpColVector &v_max, bool verbose=false);
153 
154  void setMaxRotationVelocity (const double maxVr);
155  void setMaxTranslationVelocity (const double maxVt);
157  virtual void setPosition(const vpRobot::vpControlFrameType frame,
158  const vpColVector &q) = 0 ;
159  vpControlFrameType setRobotFrame (vpRobot::vpControlFrameType newFrame);
160  virtual vpRobotStateType setRobotState (const vpRobot::vpRobotStateType newState);
161 
163  virtual void setVelocity(const vpRobot::vpControlFrameType frame,
164  const vpColVector &vel) = 0 ;
165 
166  /*
167  Joint limits stuff
168  */
169 private:
170  int areJointLimitsAvailable ;
171  double *qmin;
172  double *qmax ;
173 public:
174  // virtual void getJointLimits() ;
175 } ;
176 
177 #endif
178 
179 /*
180  * Local variables:
181  * c-basic-offset: 2
182  * End:
183  */
Definition of the vpMatrix class.
Definition: vpMatrix.h:96
double maxTranslationVelocity
Definition: vpRobot.h:105
virtual vpRobotStateType getRobotState(void)
Definition: vpRobot.h:148
double maxRotationVelocity
Definition: vpRobot.h:107
Initialize the position controller.
Definition: vpRobot.h:71
class that defines a generic virtual robot
Definition: vpRobot.h:60
vpControlFrameType
Definition: vpRobot.h:83
int eJeAvailable
is the robot Jacobian expressed in the end-effector frame available
Definition: vpRobot.h:115
vpControlFrameType getRobotFrame(void)
Definition: vpRobot.h:147
static const double maxTranslationVelocityDefault
Definition: vpRobot.h:106
Initialize the velocity controller.
Definition: vpRobot.h:70
vpRobotStateType
Definition: vpRobot.h:66
static const double maxRotationVelocityDefault
Definition: vpRobot.h:108
int nDof
number of degrees of freedom
Definition: vpRobot.h:111
vpMatrix eJe
robot Jacobian expressed in the end-effector frame
Definition: vpRobot.h:113
Class that provides a data structure for the column vectors as well as a set of operations on these v...
Definition: vpColVector.h:72
int fJeAvailable
is the robot Jacobian expressed in the robot reference frame available
Definition: vpRobot.h:119
vpMatrix fJe
robot Jacobian expressed in the robot reference frame available
Definition: vpRobot.h:117
virtual ~vpRobot()
Definition: vpRobot.h:123