ViSP  2.8.0
vpRobotBiclops.h
1 /****************************************************************************
2  *
3  * $Id: vpRobotBiclops.h 4317 2013-07-17 09:40:17Z 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  * Interface for the Biclops robot.
36  *
37  * Authors:
38  * Fabien Spindler
39  *
40  *****************************************************************************/
41 
42 #include <visp/vpConfig.h>
43 
44 #ifdef VISP_HAVE_BICLOPS
45 
46 #ifndef __vpROBOT_BICLOPS_H
47 #define __vpROBOT_BICLOPS_H
48 
49 
50 /* ------------------------------------------------------------------------ */
51 /* --- INCLUDES ----------------------------------------------------------- */
52 /* ------------------------------------------------------------------------ */
53 
54 /* --- GENERAL --- */
55 #include <iostream>
56 #include <stdio.h>
57 #include <pthread.h>
58 
59 
60 /* --- ViSP --- */
61 #include <visp/vpRobot.h>
62 #include <visp/vpBiclops.h>
63 #include <visp/vpColVector.h>
64 #include <visp/vpVelocityTwistMatrix.h>
65 #include <visp/vpRobotBiclopsController.h>
66 
67 
68 /* ------------------------------------------------------------------------ */
69 /* --- CLASS -------------------------------------------------------------- */
70 /* ------------------------------------------------------------------------ */
71 
72 
73 
104 class VISP_EXPORT vpRobotBiclops
105  :
106  public vpBiclops,
107  public vpRobot
108 {
109 
110 private:
111 
113  vpRobotBiclops (const vpRobotBiclops & ass);
114  void getCameraDisplacement(vpColVector &d);
115  void getArticularDisplacement(vpColVector &d);
116 
117 private:
118  static bool robotAlreadyCreated;
119  pthread_t control_thread;
120 
121  char configfile[FILENAME_MAX]; // Biclops config file
122 
123  vpRobotBiclopsController controller;
124 
125  double positioningVelocity;
126  vpColVector q_previous;
127  bool controlThreadCreated;
128 
129 public:
130 
131  static const double defaultPositioningVelocity;
132 
133  vpRobotBiclops (void);
134  vpRobotBiclops (const char * filename);
135  virtual ~vpRobotBiclops (void);
136 
137  void init (void);
138 
139  void get_cMe(vpHomogeneousMatrix &_cMe) ;
140  void get_cVe(vpVelocityTwistMatrix &_cVe) ;
141  void get_eJe(vpMatrix &_eJe) ;
142  void get_fJe(vpMatrix &_fJe) ;
143 
145  void getPosition (const vpRobot::vpControlFrameType frame, vpColVector &q);
146  double getPositioningVelocity (void);
147  void getVelocity (const vpRobot::vpControlFrameType frame, vpColVector & q_dot);
148  vpColVector getVelocity (const vpRobot::vpControlFrameType frame);
149 
150  bool readPositionFile(const char *filename, vpColVector &q) ;
151 
152  void setConfigFile (const char * filename="/usr/share/BiclopsDefault.cfg");
153  void setPosition(const vpRobot::vpControlFrameType frame, const vpColVector &q) ;
154  void setPosition (const vpRobot::vpControlFrameType frame, const double &q1, const double &q2) ;
155  void setPosition(const char *filename) ;
156  void setPositioningVelocity (const double velocity);
158  void setVelocity (const vpRobot::vpControlFrameType frame, const vpColVector & q_dot);
159 
160  void stopMotion() ;
161 
162  static void * vpRobotBiclopsSpeedControlLoop (void * arg);
163 };
164 
165 
166 
167 #endif /* #ifndef __vpROBOT_BICLOPS_H */
168 
169 
170 /*
171  * Local variables:
172  * c-basic-offset: 2
173  * End:
174  */
175 
176 #endif
Jacobian, geometric model functionnalities... for biclops, pan, tilt head.
Definition: vpBiclops.h:78
Definition of the vpMatrix class.
Definition: vpMatrix.h:96
void get_eJe(const vpColVector &q, vpMatrix &eJe)
Definition: vpBiclops.cpp:389
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...
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
static const double defaultPositioningVelocity
virtual vpRobotStateType setRobotState(const vpRobot::vpRobotStateType newState)
Definition: vpRobot.cpp:154
vpRobotStateType
Definition: vpRobot.h:66
void get_fJe(const vpColVector &q, vpMatrix &fJe)
Definition: vpBiclops.cpp:431
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...
Interface for the biclops, pan, tilt head control.
void get_cVe(vpVelocityTwistMatrix &_cVe)
Definition: vpBiclops.cpp:336
Class that provides a data structure for the column vectors as well as a set of operations on these v...
Definition: vpColVector.h:72
Interface to Biclops, pan, tilt, verge head for computer vision applications.
void init(void)
Definition: vpBiclops.cpp:301
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...
vpHomogeneousMatrix get_cMe() const
Definition: vpBiclops.h:154