ViSP  2.6.2
vpPioneerPan.h
1 /****************************************************************************
2  *
3  * $Id: vpPioneerPan.h 3820 2012-06-27 13:13:29Z 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  * Common features for Pioneer unicycle mobile robots.
36  *
37  * Authors:
38  * Fabien Spindler
39  *
40  *****************************************************************************/
41 #ifndef VPPIONEERPAN_H
42 #define VPPIONEERPAN_H
43 
44 #include <visp/vpRxyzVector.h>
45 #include <visp/vpTranslationVector.h>
46 #include <visp/vpUnicycle.h>
47 
48 
69 class VISP_EXPORT vpPioneerPan: public vpUnicycle
70 {
71 public:
76  {
77  set_mtp();
78  set_cMe();
79  set_eJe(0.);
80  }
81 
85  virtual ~vpPioneerPan() {};
86 
112  void set_eJe(double q_pan)
113  {
114  double px = mtp_[0];
115  double py = mtp_[1];
116  double c1 = cos(q_pan);
117  double s1 = sin(q_pan);
118 
119  eJe_.resize(6,3); // robot jacobian expressed at the pan head end effector
120 
121  eJe_ = 0;
122  eJe_[0][0] = c1;
123  eJe_[0][1] = -c1*py - s1*px;
124 
125  eJe_[2][0] = s1;
126  eJe_[2][1] = -s1*py + c1*px;
127 
128  eJe_[4][1] = -1;
129  eJe_[4][2] = 1;
130  }
131 
132 private:
136  void set_cMe()
137  {
138  // Position of the camera in the pan frame
139  double cx = 0;
140  double cy = -0.065; //-0.13;
141  double cz = 0;
142  vpTranslationVector etc(cx, cy, cz);
143  vpRotationMatrix eRc;
144  eRc[0][0] = eRc[1][1] = eRc[2][2] = 0;
145  eRc[0][2] = 1;
146  eRc[1][1] = 1;
147  eRc[2][0] = -1;
148 
150  eMc.buildFrom(etc, eRc);
151 
152  cMe_ = eMc.inverse();
153 
154  std::cout << "cMe de pan: \n" << cMe_ << std::endl;
155  }
156 
161  void set_mtp()
162  {
163  // Position of the pan head in the mobile platform frame
164  double px = 0.1; // distance between the pan frame and the robot frame
165  double py = 0;
166  double pz = 0.27;
167  mtp_.set(px, py, pz);
168  }
169 
170  vpTranslationVector mtp_;
171 
172 };
173 
174 #endif
175 
void set_cMe(const vpHomogeneousMatrix &cMe)
Definition: vpUnicycle.h:123
The class provides a data structure for the homogeneous matrices as well as a set of operations on th...
void set_eJe(const vpMatrix &eJe)
Definition: vpUnicycle.h:134
Generic functions for Pioneer mobile robots equiped with a pan head.
Definition: vpPioneerPan.h:69
The vpRotationMatrix considers the particular case of a rotation matrix.
Generic functions for unicycle mobile robots.
Definition: vpUnicycle.h:60
void buildFrom(const vpTranslationVector &t, const vpRotationMatrix &R)
Construction from translation vector and rotation matrix.
vpHomogeneousMatrix inverse() const
virtual ~vpPioneerPan()
Definition: vpPioneerPan.h:85
void set_eJe(double q_pan)
Definition: vpPioneerPan.h:112
Class that consider the case of a translation vector.