ViSP  2.8.0
vpRobot.h
1 /****************************************************************************
2  *
3  * $Id: vpRobot.h 4056 2013-01-05 13:04:42Z fspindle $
4  *
5  * This file is part of the ViSP software.
6  * Copyright (C) 2005 - 2013 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  virtual ~vpRobot() { ; }
120 
121  //---------- Jacobian -----------------------------
123  virtual void get_eJe(vpMatrix &_eJe) = 0 ;
125  virtual void get_fJe(vpMatrix &_fJe) = 0 ;
126 
128  virtual void getDisplacement(const vpRobot::vpControlFrameType frame,
129  vpColVector &q) = 0 ;
130 
131  double getMaxTranslationVelocity (void) const ;
132  double getMaxRotationVelocity (void) const;
134  virtual void getPosition(const vpRobot::vpControlFrameType frame,
135  vpColVector &q) = 0 ;
136 
137  // Return the robot position (frame has to be specified).
138  vpColVector getPosition (const vpRobot::vpControlFrameType frame);
139  virtual vpRobotStateType getRobotState (void) { return stateRobot ; }
140 
141  virtual void init() = 0 ;
142 
143  static vpColVector saturateVelocities(const vpColVector &v_in, const vpColVector &v_max, bool verbose=false);
144 
145  void setMaxRotationVelocity (const double maxVr);
146  void setMaxTranslationVelocity (const double maxVt);
148  virtual void setPosition(const vpRobot::vpControlFrameType frame,
149  const vpColVector &q) = 0 ;
150  virtual vpRobotStateType setRobotState (const vpRobot::vpRobotStateType newState);
151 
153  virtual void setVelocity(const vpRobot::vpControlFrameType frame,
154  const vpColVector &vel) = 0 ;
155  inline void setVerbose(bool verbose) { verbose_ = verbose; };
156 
157 protected:
158  vpControlFrameType setRobotFrame (vpRobot::vpControlFrameType newFrame);
159  vpControlFrameType getRobotFrame (void) { return frameRobot ; }
160 } ;
161 
162 #endif
Definition of the vpMatrix class.
Definition: vpMatrix.h:96
double maxTranslationVelocity
Definition: vpRobot.h:95
void setVerbose(bool verbose)
Definition: vpRobot.h:155
double * qmax
Definition: vpRobot.h:113
virtual vpRobotStateType getRobotState(void)
Definition: vpRobot.h:139
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
vpControlFrameType getRobotFrame(void)
Definition: vpRobot.h:159
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
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
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:119