ViSP  2.6.2
vpRobotPtu46.h
1 /****************************************************************************
2  *
3  * $Id: vpRobotPtu46.h 3530 2012-01-03 10:52:12Z 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  * Interface for the ptu-46 robot.
36  *
37  * Authors:
38  * Fabien Spindler
39  *
40  *****************************************************************************/
41 
42 
43 #include <visp/vpConfig.h>
44 #ifdef VISP_HAVE_PTU46
45 
46 
47 #ifndef __vpROBOT_PTU46_H
48 #define __vpROBOT_PTU46_H
49 
50 
51 /* ------------------------------------------------------------------------ */
52 /* --- INCLUDES ----------------------------------------------------------- */
53 /* ------------------------------------------------------------------------ */
54 
55 /* --- GENERAL --- */
56 #include <iostream>
57 #include <stdio.h>
58 
59 
60 /* --- ViSP --- */
61 #include <visp/vpRobot.h>
62 #include <visp/vpPtu46.h>
63 #include <visp/vpColVector.h>
64 #include <visp/vpDebug.h>
65 #include <visp/vpVelocityTwistMatrix.h>
66 
67 #include <ptu.h> // Contrib for Ptu-46 robot
68 
69 /* ------------------------------------------------------------------------ */
70 /* --- CLASS ------------------------------------------------------------- */
71 /* ------------------------------------------------------------------------ */
72 
73 
88 class VISP_EXPORT vpRobotPtu46
89  :
90  public vpPtu46,
91  public vpRobot
92 {
93 
94 private:
95 
97  vpRobotPtu46 (const vpRobotPtu46 & ass);
98 
100  Ptu ptu;
101 
102 private:
103  static bool robotAlreadyCreated;
104  double positioningVelocity;
105  int velocityMesureTempo;
106  char *device;
107 
108 public:
109 
110  static const double defaultPositioningVelocity;
111 
112  vpRobotPtu46 (const char *device="/dev/ttyS0");
113  vpRobotPtu46 (vpRobotPtu46 * pub);
114  virtual ~vpRobotPtu46 (void);
115 
116  void init (void);
117 
118 
119  /* --- STATE ------------------------------------------------------------- */
120 
122 
123  /* --- POSITION --------------------------------------------------- */
124 
125  void setPosition(const vpRobot::vpControlFrameType frame,
126  const vpColVector &q) ;
127  void setPosition (const vpRobot::vpControlFrameType frame,
128  const double &q1, const double &q2) ;
129  void setPosition(const char *filename) ;
130  void getPosition (const vpRobot::vpControlFrameType frame,
131  vpColVector &q);
132 
133 
134  void setPositioningVelocity (const double velocity);
135  double getPositioningVelocity (void);
136 
137 
138  /* --- SPEED ---------------------------------------------------------- */
139 
140  void setVelocity (const vpRobot::vpControlFrameType frame,
141  const vpColVector & q_dot);
142 
143 
144  void getVelocity (const vpRobot::vpControlFrameType frame,
145  vpColVector & q_dot);
146 
147  vpColVector getVelocity (const vpRobot::vpControlFrameType frame);
148 
149 public:
150  void get_cMe(vpHomogeneousMatrix &_cMe) ;
151  void get_cVe(vpVelocityTwistMatrix &_cVe) ;
152  void get_eJe(vpMatrix &_eJe) ;
153  void get_fJe(vpMatrix &_fJe) ;
154 
155  void stopMotion() ;
156 
160 
161  bool readPositionFile(const char *filename, vpColVector &q);
162 };
163 
164 
165 
166 #endif /* #ifndef __vpROBOT_PTU46_H */
167 
168 
169 /*
170  * Local variables:
171  * c-basic-offset: 2
172  * End:
173  */
174 
175 #endif
Definition of the vpMatrix class.
Definition: vpMatrix.h:96
virtual void getDisplacement(const vpRobot::vpControlFrameType frame, vpColVector &q)=0
Get a displacement (frame as to ve specified) between two successive position control.
The class provides a data structure for the homogeneous matrices as well as a set of operations on th...
static const double defaultPositioningVelocity
Definition: vpRobotPtu46.h:110
virtual void setPosition(const vpRobot::vpControlFrameType frame, const vpColVector &q)=0
Set a displacement (frame has to be specified) in position control.
class that defines a generic virtual robot
Definition: vpRobot.h:60
vpControlFrameType
Definition: vpRobot.h:83
virtual vpRobotStateType setRobotState(const vpRobot::vpRobotStateType newState)
Definition: vpRobot.cpp:152
virtual void getArticularDisplacement(vpColVector &qdot)=0
Get a displacement expressed in the joint space between two successive position control.
void get_cMe(vpHomogeneousMatrix &_cMe)
Definition: vpPtu46.cpp:242
virtual void getCameraDisplacement(vpColVector &v)=0
Get a displacement expressed in the camera frame between two successive position control.
Interface for the Directed Perception ptu-46 pan, tilt head .
Definition: vpRobotPtu46.h:88
vpRobotStateType
Definition: vpRobot.h:66
virtual void getPosition(const vpRobot::vpControlFrameType frame, vpColVector &q)=0
Get the robot position (frame has to be specified).
Class that consider the particular case of twist transformation matrix that allows to transform a vel...
void get_cVe(vpVelocityTwistMatrix &_cVe)
Definition: vpPtu46.cpp:224
Jacobian, geometric model functionnalities... for ptu46, pan, tilt head from Directed Perception...
Definition: vpPtu46.h:80
Class that provides a data structure for the column vectors as well as a set of operations on these v...
Definition: vpColVector.h:72
void get_fJe(const vpColVector &q, vpMatrix &fJe)
Definition: vpPtu46.cpp:314
void get_eJe(const vpColVector &q, vpMatrix &eJe)
Definition: vpPtu46.cpp:282
virtual void setVelocity(const vpRobot::vpControlFrameType frame, const vpColVector &vel)=0
Set the velocity (frame has to be specified) that will be applied to the velocity controller...
void init(void)
Definition: vpPtu46.cpp:188