ViSP  2.10.0
vpRobotPtu46.h
1 /****************************************************************************
2  *
3  * $Id: vpRobotPtu46.h 4574 2014-01-09 08:48:51Z 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  * 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  static const double defaultPositioningVelocity;
110 
111  vpRobotPtu46 (const char *device="/dev/ttyS0");
112  vpRobotPtu46 (vpRobotPtu46 * pub);
113  virtual ~vpRobotPtu46 (void);
114 
115  void get_cMe(vpHomogeneousMatrix &_cMe) const;
116  void get_cVe(vpVelocityTwistMatrix &_cVe) const;
117  void get_eJe(vpMatrix &_eJe);
118  void get_fJe(vpMatrix &_fJe);
119 
121  void getPosition (const vpRobot::vpControlFrameType frame, vpColVector &q);
122  double getPositioningVelocity (void);
123  void getVelocity (const vpRobot::vpControlFrameType frame, vpColVector & q_dot);
124  vpColVector getVelocity (const vpRobot::vpControlFrameType frame);
125 
126  void init (void);
127 
128  bool readPositionFile(const char *filename, vpColVector &q);
129 
130  void setPosition(const vpRobot::vpControlFrameType frame, const vpColVector &q) ;
131  void setPosition (const vpRobot::vpControlFrameType frame, const double &q1, const double &q2) ;
132  void setPosition(const char *filename) ;
133  void setPositioningVelocity (const double velocity);
135 
136  void setVelocity (const vpRobot::vpControlFrameType frame, const vpColVector & q_dot);
137 
138  void stopMotion() ;
139 
140 private:
141  void getCameraDisplacement(vpColVector &d);
142  void getArticularDisplacement(vpColVector &d);
143 };
144 
145 
146 
147 #endif /* #ifndef __vpROBOT_PTU46_H */
148 
149 
150 /*
151  * Local variables:
152  * c-basic-offset: 2
153  * End:
154  */
155 
156 #endif
Definition of the vpMatrix class.
Definition: vpMatrix.h:98
void get_fJe(const vpColVector &q, vpMatrix &fJe) const
Definition: vpPtu46.cpp:307
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:109
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:78
virtual vpRobotStateType setRobotState(const vpRobot::vpRobotStateType newState)
Definition: vpRobot.cpp:205
void get_cMe(vpHomogeneousMatrix &_cMe) const
Definition: vpPtu46.cpp:236
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) const
Definition: vpPtu46.cpp:218
void get_eJe(const vpColVector &q, vpMatrix &eJe) const
Definition: vpPtu46.cpp:276
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
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:184