ViSP  2.9.0
vpRobot.h
1 /****************************************************************************
2  *
3  * $Id: vpRobot.h 4632 2014-02-03 17:06:40Z fspindle $
4  *
5  * This file is part of the ViSP software.
6  * Copyright (C) 2005 - 2014 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 
78  typedef enum
79  {
80  REFERENCE_FRAME,
83  CAMERA_FRAME,
85  MIXT_FRAME
88  } vpControlFrameType ;
89 
90 private: /* Membres privees */
91  vpRobot::vpRobotStateType stateRobot;
92  vpRobot::vpControlFrameType frameRobot;
93 
94 protected:
96  static const double maxTranslationVelocityDefault;// = 0.2;
98  static const double maxRotationVelocityDefault;// = 0.7;
99 
101  int nDof ;
110 
112  double *qmin;
113  double *qmax ;
114 
115  bool verbose_;
116 
117 public:
118  vpRobot (void);
119  vpRobot (const vpRobot &robot);
120  virtual ~vpRobot() { ; }
121 
122  //---------- Jacobian -----------------------------
124  virtual void get_eJe(vpMatrix &_eJe) = 0 ;
126  virtual void get_fJe(vpMatrix &_fJe) = 0 ;
127 
129  virtual void getDisplacement(const vpRobot::vpControlFrameType frame,
130  vpColVector &q) = 0 ;
131 
132  double getMaxTranslationVelocity (void) const ;
133  double getMaxRotationVelocity (void) const;
135  virtual void getPosition(const vpRobot::vpControlFrameType frame,
136  vpColVector &q) = 0 ;
137 
138  // Return the robot position (frame has to be specified).
139  vpColVector getPosition (const vpRobot::vpControlFrameType frame);
140  virtual vpRobotStateType getRobotState (void) const { return stateRobot ; }
141 
142  virtual void init() = 0 ;
143 
144  vpRobot & operator=(const vpRobot &robot);
145 
146  static vpColVector saturateVelocities(const vpColVector &v_in, const vpColVector &v_max, bool verbose=false);
147 
148  void setMaxRotationVelocity (const double maxVr);
149  void setMaxTranslationVelocity (const double maxVt);
151  virtual void setPosition(const vpRobot::vpControlFrameType frame,
152  const vpColVector &q) = 0 ;
153  virtual vpRobotStateType setRobotState (const vpRobot::vpRobotStateType newState);
154 
156  virtual void setVelocity(const vpRobot::vpControlFrameType frame,
157  const vpColVector &vel) = 0 ;
158  inline void setVerbose(bool verbose) { verbose_ = verbose; };
159 
160 protected:
161  vpControlFrameType setRobotFrame (vpRobot::vpControlFrameType newFrame);
162  vpControlFrameType getRobotFrame (void) const { return frameRobot ; }
163 } ;
164 
165 #endif
Definition of the vpMatrix class.
Definition: vpMatrix.h:98
double maxTranslationVelocity
Definition: vpRobot.h:95
void setVerbose(bool verbose)
Definition: vpRobot.h:158
double * qmax
Definition: vpRobot.h:113
double maxRotationVelocity
Definition: vpRobot.h:97
Initialize the position controller.
Definition: vpRobot.h:71
class that defines a generic virtual robot
Definition: vpRobot.h:60
vpControlFrameType
Definition: vpRobot.h:78
int eJeAvailable
is the robot Jacobian expressed in the end-effector frame available
Definition: vpRobot.h:105
static const double maxTranslationVelocityDefault
Definition: vpRobot.h:96
Initialize the velocity controller.
Definition: vpRobot.h:70
vpRobotStateType
Definition: vpRobot.h:66
bool verbose_
Definition: vpRobot.h:115
static const double maxRotationVelocityDefault
Definition: vpRobot.h:98
int areJointLimitsAvailable
Definition: vpRobot.h:111
vpControlFrameType getRobotFrame(void) const
Definition: vpRobot.h:162
int nDof
number of degrees of freedom
Definition: vpRobot.h:101
vpMatrix eJe
robot Jacobian expressed in the end-effector frame
Definition: vpRobot.h:103
Class that provides a data structure for the column vectors as well as a set of operations on these v...
Definition: vpColVector.h:72
virtual vpRobotStateType getRobotState(void) const
Definition: vpRobot.h:140
double * qmin
Definition: vpRobot.h:112
int fJeAvailable
is the robot Jacobian expressed in the robot reference frame available
Definition: vpRobot.h:109
vpMatrix fJe
robot Jacobian expressed in the robot reference frame available
Definition: vpRobot.h:107
virtual ~vpRobot()
Definition: vpRobot.h:120