Visual Servoing Platform  version 3.0.0
vpRobotBiclops.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  * Interface for the Biclops robot.
32  *
33  * Authors:
34  * Fabien Spindler
35  *
36  *****************************************************************************/
37 
38 #include <visp3/core/vpConfig.h>
39 
40 #ifdef VISP_HAVE_BICLOPS
41 
42 #ifndef __vpROBOT_BICLOPS_H
43 #define __vpROBOT_BICLOPS_H
44 
45 
46 /* ------------------------------------------------------------------------ */
47 /* --- INCLUDES ----------------------------------------------------------- */
48 /* ------------------------------------------------------------------------ */
49 
50 /* --- GENERAL --- */
51 #include <iostream>
52 #include <stdio.h>
53 #include <pthread.h>
54 
55 
56 /* --- ViSP --- */
57 #include <visp3/robot/vpRobot.h>
58 #include <visp3/robot/vpBiclops.h>
59 #include <visp3/core/vpColVector.h>
60 #include <visp3/core/vpVelocityTwistMatrix.h>
61 #include <visp3/robot/vpRobotBiclopsController.h>
62 
63 
64 /* ------------------------------------------------------------------------ */
65 /* --- CLASS -------------------------------------------------------------- */
66 /* ------------------------------------------------------------------------ */
67 
68 
69 
98 class VISP_EXPORT vpRobotBiclops
99  :
100  public vpBiclops,
101  public vpRobot
102 {
103 
104 private:
105 
106  void getCameraDisplacement(vpColVector &d);
107  void getArticularDisplacement(vpColVector &d);
108 
109 private:
110  static bool robotAlreadyCreated;
111  pthread_t control_thread;
112 
113  char configfile[FILENAME_MAX]; // Biclops config file
114 
115  vpRobotBiclopsController controller;
116 
117  double positioningVelocity;
118  vpColVector q_previous;
119  bool controlThreadCreated;
120 
121 //private:
122 //#ifndef DOXYGEN_SHOULD_SKIP_THIS
123 // /*! \brief No copy constructor allowed. */
124 // vpRobotBiclops(const vpRobotBiclops &)
125 // : vpBiclops(), vpRobot(), control_thread(), controller(),
126 // positioningVelocity(0), q_previous(), controlThreadCreated(false)
127 // {
128 // throw vpException(vpException::functionNotImplementedError, "Not implemented!");
129 // }
130 // vpRobotBiclops &operator=(const vpRobotBiclops &){
131 // throw vpException(vpException::functionNotImplementedError, "Not implemented!");
132 // return *this;
133 // }
134 //#endif
135 
136 public:
137 
138  static const double defaultPositioningVelocity;
139 
140  vpRobotBiclops (void);
141  vpRobotBiclops (const char * filename);
142  virtual ~vpRobotBiclops (void);
143 
144  void init (void);
145 
146  void get_cMe(vpHomogeneousMatrix &_cMe) const;
147  void get_cVe(vpVelocityTwistMatrix &_cVe) const;
148  void get_eJe(vpMatrix &_eJe) ;
149  void get_fJe(vpMatrix &_fJe) ;
150 
152  void getPosition (const vpRobot::vpControlFrameType frame, vpColVector &q);
153  double getPositioningVelocity (void);
154  void getVelocity (const vpRobot::vpControlFrameType frame, vpColVector & q_dot);
155  vpColVector getVelocity (const vpRobot::vpControlFrameType frame);
156 
157  bool readPositionFile(const char *filename, vpColVector &q) ;
158 
159  void setConfigFile (const char * filename="/usr/share/BiclopsDefault.cfg");
160  void setPosition(const vpRobot::vpControlFrameType frame, const vpColVector &q) ;
161  void setPosition (const vpRobot::vpControlFrameType frame, const double &q1, const double &q2) ;
162  void setPosition(const char *filename) ;
163  void setPositioningVelocity (const double velocity);
165  void setVelocity (const vpRobot::vpControlFrameType frame, const vpColVector & q_dot);
166 
167  void stopMotion() ;
168 
169  static void * vpRobotBiclopsSpeedControlLoop (void * arg);
170 };
171 
172 
173 
174 #endif /* #ifndef __vpROBOT_BICLOPS_H */
175 
176 
177 /*
178  * Local variables:
179  * c-basic-offset: 2
180  * End:
181  */
182 
183 #endif
Jacobian, geometric model functionnalities... for biclops, pan, tilt head.
Definition: vpBiclops.h:74
Implementation of a matrix and operations on matrices.
Definition: vpMatrix.h:92
virtual void getDisplacement(const vpRobot::vpControlFrameType frame, vpColVector &q)=0
Get a displacement (frame as to ve specified) between two successive position control.
Implementation of an homogeneous matrix and operations on such kind of matrices.
void get_cVe(vpVelocityTwistMatrix &_cVe) const
Definition: vpBiclops.cpp:332
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:58
vpControlFrameType
Definition: vpRobot.h:76
static const double defaultPositioningVelocity
No copy constructor allowed.
virtual vpRobotStateType setRobotState(const vpRobot::vpRobotStateType newState)
Definition: vpRobot.cpp:201
vpRobotStateType
Definition: vpRobot.h:64
virtual void getPosition(const vpRobot::vpControlFrameType frame, vpColVector &q)=0
Get the robot position (frame has to be specified).
Implementation of a velocity twist matrix and operations on such kind of matrices.
Interface for the biclops, pan, tilt head control.
void get_fJe(const vpColVector &q, vpMatrix &fJe) const
Definition: vpBiclops.cpp:425
void get_eJe(const vpColVector &q, vpMatrix &eJe) const
Definition: vpBiclops.cpp:385
Implementation of column vector and the associated operations.
Definition: vpColVector.h:72
void init(void)
Definition: vpBiclops.cpp:298
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:152