Visual Servoing Platform  version 3.0.0
vpRobot.h
1 /****************************************************************************
2  *
3  * This file is part of the ViSP software.
4  * Copyright (C) 2005 - 2015 by Inria. All rights reserved.
5  *
6  * This software is free software; you can redistribute it and/or
7  * modify it under the terms of the GNU General Public License
8  * ("GPL") version 2 as published by the Free Software Foundation.
9  * See the file LICENSE.txt at the root directory of this source
10  * distribution for additional information about the GNU GPL.
11  *
12  * For using ViSP with software that can not be combined with the GNU
13  * GPL, please contact Inria about acquiring a ViSP Professional
14  * Edition License.
15  *
16  * See http://visp.inria.fr for more information.
17  *
18  * This software was developed at:
19  * Inria Rennes - Bretagne Atlantique
20  * Campus Universitaire de Beaulieu
21  * 35042 Rennes Cedex
22  * France
23  *
24  * If you have questions regarding the use of this file, please contact
25  * Inria at visp@inria.fr
26  *
27  * This file is provided AS IS with NO WARRANTY OF ANY KIND, INCLUDING THE
28  * WARRANTY OF DESIGN, MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE.
29  *
30  * Description:
31  * Generic virtual robot.
32  *
33  * Authors:
34  * Eric Marchand
35  *
36  *****************************************************************************/
37 
38 #ifndef vpRobot_H
39 #define vpRobot_H
40 
46 #include <visp3/core/vpHomogeneousMatrix.h>
47 #include <visp3/core/vpMatrix.h>
48 #include <visp3/core/vpColVector.h>
49 #include <visp3/core/vpPoseVector.h>
50 
51 
58 class VISP_EXPORT vpRobot
59 {
60 public:
64  typedef enum
65  {
66  STATE_STOP,
70  STATE_ACCELERATION_CONTROL
71  } vpRobotStateType ;
72 
76  typedef enum
77  {
78  REFERENCE_FRAME,
81  CAMERA_FRAME,
83  MIXT_FRAME
86  } vpControlFrameType ;
87 
88 private: /* Membres privees */
89  vpRobot::vpRobotStateType stateRobot;
90  vpRobot::vpControlFrameType frameRobot;
91 
92 protected:
94  static const double maxTranslationVelocityDefault;// = 0.2;
96  static const double maxRotationVelocityDefault;// = 0.7;
97 
99  int nDof ;
108 
110  double *qmin;
111  double *qmax ;
112 
113  bool verbose_;
114 
115 public:
116  vpRobot (void);
117  vpRobot (const vpRobot &robot);
118  virtual ~vpRobot();
119 
120  //---------- Jacobian -----------------------------
122  virtual void get_eJe(vpMatrix &_eJe) = 0 ;
124  virtual void get_fJe(vpMatrix &_fJe) = 0 ;
125 
127  virtual void getDisplacement(const vpRobot::vpControlFrameType frame,
128  vpColVector &q) = 0 ;
129 
130  double getMaxTranslationVelocity (void) const ;
131  double getMaxRotationVelocity (void) const;
133  virtual void getPosition(const vpRobot::vpControlFrameType frame,
134  vpColVector &q) = 0 ;
135 
136  // Return the robot position (frame has to be specified).
137  vpColVector getPosition (const vpRobot::vpControlFrameType frame);
138  virtual vpRobotStateType getRobotState (void) const { return stateRobot ; }
139 
140  virtual void init() = 0 ;
141 
142  vpRobot & operator=(const vpRobot &robot);
143 
144  static vpColVector saturateVelocities(const vpColVector &v_in, const vpColVector &v_max, bool verbose=false);
145 
146  void setMaxRotationVelocity (const double maxVr);
147  void setMaxTranslationVelocity (const double maxVt);
149  virtual void setPosition(const vpRobot::vpControlFrameType frame,
150  const vpColVector &q) = 0 ;
151  virtual vpRobotStateType setRobotState (const vpRobot::vpRobotStateType newState);
152 
154  virtual void setVelocity(const vpRobot::vpControlFrameType frame,
155  const vpColVector &vel) = 0 ;
156  inline void setVerbose(bool verbose) { verbose_ = verbose; };
157 
158 protected:
159  vpControlFrameType setRobotFrame (vpRobot::vpControlFrameType newFrame);
160  vpControlFrameType getRobotFrame (void) const { return frameRobot ; }
161 } ;
162 
163 #endif
Implementation of a matrix and operations on matrices.
Definition: vpMatrix.h:92
double maxTranslationVelocity
Definition: vpRobot.h:93
void setVerbose(bool verbose)
Definition: vpRobot.h:156
double * qmax
Definition: vpRobot.h:111
double maxRotationVelocity
Definition: vpRobot.h:95
Initialize the position controller.
Definition: vpRobot.h:69
class that defines a generic virtual robot
Definition: vpRobot.h:58
vpControlFrameType
Definition: vpRobot.h:76
int eJeAvailable
is the robot Jacobian expressed in the end-effector frame available
Definition: vpRobot.h:103
static const double maxTranslationVelocityDefault
Definition: vpRobot.h:94
Initialize the velocity controller.
Definition: vpRobot.h:68
vpRobotStateType
Definition: vpRobot.h:64
bool verbose_
Definition: vpRobot.h:113
static const double maxRotationVelocityDefault
Definition: vpRobot.h:96
int areJointLimitsAvailable
Definition: vpRobot.h:109
vpControlFrameType getRobotFrame(void) const
Definition: vpRobot.h:160
int nDof
number of degrees of freedom
Definition: vpRobot.h:99
vpMatrix eJe
robot Jacobian expressed in the end-effector frame
Definition: vpRobot.h:101
Implementation of column vector and the associated operations.
Definition: vpColVector.h:72
virtual vpRobotStateType getRobotState(void) const
Definition: vpRobot.h:138
double * qmin
Definition: vpRobot.h:110
int fJeAvailable
is the robot Jacobian expressed in the robot reference frame available
Definition: vpRobot.h:107
vpMatrix fJe
robot Jacobian expressed in the robot reference frame available
Definition: vpRobot.h:105