This file is indexed.

/usr/include/visp/vpFeatureThetaU.h is in libvisp-dev 2.8.0-4.

This file is owned by root:root, with mode 0o644.

The actual contents of the file can be viewed below.

  1
  2
  3
  4
  5
  6
  7
  8
  9
 10
 11
 12
 13
 14
 15
 16
 17
 18
 19
 20
 21
 22
 23
 24
 25
 26
 27
 28
 29
 30
 31
 32
 33
 34
 35
 36
 37
 38
 39
 40
 41
 42
 43
 44
 45
 46
 47
 48
 49
 50
 51
 52
 53
 54
 55
 56
 57
 58
 59
 60
 61
 62
 63
 64
 65
 66
 67
 68
 69
 70
 71
 72
 73
 74
 75
 76
 77
 78
 79
 80
 81
 82
 83
 84
 85
 86
 87
 88
 89
 90
 91
 92
 93
 94
 95
 96
 97
 98
 99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
248
249
250
251
252
253
254
255
256
257
258
259
260
261
262
263
264
265
266
267
268
269
270
271
272
273
274
275
276
277
278
279
280
281
282
283
284
285
286
287
288
289
290
291
292
293
294
295
296
297
298
299
300
301
302
303
304
305
306
307
308
309
310
311
312
313
314
315
316
317
318
319
320
321
322
323
324
325
326
327
328
329
330
331
332
333
334
335
336
337
338
339
340
341
342
343
344
345
346
347
348
349
350
351
352
353
354
355
356
357
358
359
360
361
362
363
364
365
366
367
368
369
370
371
372
373
374
375
376
377
378
379
380
381
382
383
384
385
386
387
388
389
390
391
392
393
394
395
396
397
398
399
400
401
402
/****************************************************************************
 *
 * $Id: vpFeatureThetaU.h 4056 2013-01-05 13:04:42Z fspindle $
 *
 * This file is part of the ViSP software.
 * Copyright (C) 2005 - 2013 by INRIA. All rights reserved.
 * 
 * This software is free software; you can redistribute it and/or
 * modify it under the terms of the GNU General Public License
 * ("GPL") version 2 as published by the Free Software Foundation.
 * See the file LICENSE.txt at the root directory of this source
 * distribution for additional information about the GNU GPL.
 *
 * For using ViSP with software that can not be combined with the GNU
 * GPL, please contact INRIA about acquiring a ViSP Professional 
 * Edition License.
 *
 * See http://www.irisa.fr/lagadic/visp/visp.html for more information.
 * 
 * This software was developed at:
 * INRIA Rennes - Bretagne Atlantique
 * Campus Universitaire de Beaulieu
 * 35042 Rennes Cedex
 * France
 * http://www.irisa.fr/lagadic
 *
 * If you have questions regarding the use of this file, please contact
 * INRIA at visp@inria.fr
 * 
 * This file is provided AS IS with NO WARRANTY OF ANY KIND, INCLUDING THE
 * WARRANTY OF DESIGN, MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE.
 *
 *
 * Description:
 * ThetaU visual feature.
 *
 * Authors:
 * Eric Marchand
 * Fabien Spindler
 *
 *****************************************************************************/


#ifndef vpFeatureThetaU_H
#define vpFeatureThetaU_H

/*!
  \file vpFeatureThetaU.h
  \brief class that defines the ThetaU visual feature
*/

#include <visp/vpMatrix.h>
#include <visp/vpThetaUVector.h>
#include <visp/vpBasicFeature.h>

#include <visp/vpHomogeneousMatrix.h>
#include <visp/vpRGBa.h>


/*!
  \class vpFeatureThetaU
  \ingroup VsFeature3

  \brief Class that defines a 3D visual feature \f$ s\f$ from a \f$ \theta
  u \f$ axis/angle parametrization that represent the rotation between
  to frames.

  Let us denote \f$ \theta u = (\theta u_x, \theta u_y, \theta u_z)\f$ .

  It is convenient to consider two coordinate frames: the current
  camera frame \f$ {\cal{F}}_c \f$ and the desired camera frame \f$
  {\cal{F}}_{c^*} \f$. 

  Let \f$^{c^*}R_c \f$ be the rotation matrix that gives the
  orientation of the current camera frame relative to the desired camera
  frame. Let \f$ \theta u_{^{c^*}R_c} \f$ to corresponding axis/angle
  representation of this rotation.

  Furthermore, let \f$^{c}R_{c^*} \f$ the rotation matrix that gives the
  orientation of the desired camera frame relative to the current
  camera frame. Let \f$ \theta u_{^{c}R_{c^*}} \f$ to corresponding
  axis/angle representation of this rotation.

  This class can be used to manipulate two kind of visual features:

  - \f$ s = \theta u_{^{c^*}R_c} \f$ if the orientation of current
    camera frame relative to the desired frame has to be
    considered. The desired visual feature \f$ s^* \f$ is equal to
    zero. The corresponding error is than equal to \f$ e=(s-s^*) =
    \theta u_{^{c^*}R_c} \f$. In this case, the interaction matrix
    related to \f$ s \f$ is given by \f[ L = \left[ \begin{array}{cc}
    0_3 & L_{\theta u} \end{array} \right] \f] with \f[
    L_{\theta u} = I_3 + \frac{\theta}{2} \; [u]_\times +
    \left(1 - \frac{sinc \theta}{sinc^2 \frac{\theta}{2}}\right)
    [u]^2_\times \f] where \f$ 0_3 \f$ is a \f$ 3 \times 3 \f$ nul
    matrix, \f$ I_3 \f$ is the \f$3 \times 3\f$ identity matrix, and
    for more readability \f$ \theta \f$ and \f$ u \f$ respectively the
    angle and the axis coordinates of the \f$ \theta u_{^{c^*}R_c} \f$
    representation.

  - \f$ s = \theta u_{^{c}R_{c^*}} \f$ if it is more the orientation
    of the desired camera frame relative to the current frame that has
    to be considered. The desired visual feature \f$ s^* \f$ is equal
    to zero. The corresponding error is than equal to \f$e=(s-s^*) =
    \theta u_{^{c}R_{c^*}} \f$. In this case, the interaction matrix
    related to \f$ s \f$ is given by \f[ L = \left[ \begin{array}{cc}
    0_3 & L_{\theta u} \end{array} \right] \f] with \f[
    L_{\theta u} = -I_3 + \frac{\theta}{2} \; [u]_\times
    - \left(1 - \frac{sinc \theta}{sinc^2 \frac{\theta}{2}}\right)
    [u]^2_\times \f] where \f$ 0_3 \f$ is a \f$ 3 \times 3 \f$ nul
    matrix, \f$ I_3 \f$ is the \f$3 \times 3\f$ identity matrix, and
    for more readability \f$ \theta \f$ and \f$ u \f$ respectively the
    angle and the axis coordinates of the \f$ \theta u_{^{c}R_{c^*}}
    \f$ representation.

  The kind of visual feature is to set during the construction of the
  vpFeatureThetaU() object by using the selector
  vpFeatureThetaU::vpFeatureThetaURotationRepresentationType.

  To initialize the feature \f$(\theta u_x, \theta u_y, \theta u_z)\f$
  you may use vpFeatureThetaU member fonctions like set_TUx(),
  set_TUy(), set_TUz(), or also buildFrom() fonctions.

  Depending on the choice of the visual feature representation, the
  interaction() method allows to compute the interaction matrix \f$
  L \f$ associated to the visual feature, while the error()
  method computes the error vector \f$(s - s^*)\f$ between the current
  visual feature and the desired one.

  To know more on the \f$ \theta u \f$ axis/angle representation for a
  3D rotation see the vpThetaUVector class.

  The code below shows how to create a eye-in hand visual servoing
  task using a 3D \f$\theta u\f$ feature \f$(\theta u_x,\theta u_y,
  \theta u_z)\f$ that correspond to the 3D rotation between the
  current camera frame and the desired camera frame. To control six
  degrees of freedom, at least three other features must be considered
  like vpFeatureTranslation visual features. First we create a current
  (\f$s\f$) 3D \f$\theta u\f$ feature, than set the
  task to use the interaction matrix associated to the current feature
  \f$L_s\f$ and than compute the camera velocity \f$v=-\lambda \;
  L_s^+ \; (s-s^*)\f$. The current feature \f$s\f$ is updated in the
  while() loop while \f$s^*\f$ is considered as zero.

  \code
#include <visp/vpFeatureThetaU.h>
#include <visp/vpHomogeneousMatrix.h>
#include <visp/vpServo.h>

int main()
{
  vpServo task; // Visual servoing task

  vpHomogeneousMatrix cMcd;
  // ... cMcd need here to be initialized from for example a pose estimation.

  // Creation of the current feature s that correspond to the rotation
  // in angle/axis parametrization between the current camera frame
  // and the desired camera frame
  vpFeatureThetaU s(vpFeatureThetaU::cRcd);
  s.buildFrom(cMcd); // Initialization of the feature

  // Set eye-in-hand control law. 
  // The computed velocities will be expressed in the camera frame
  task.setServo(vpServo::EYEINHAND_CAMERA);
  // Interaction matrix is computed with the current visual features s
  task.setInteractionMatrixType(vpServo::CURRENT); 

  // Add the 3D ThetaU feature to the task
  task.addFeature(s); // s* is here considered as zero

  // Control loop
  for ( ; ; ) {
    // ... cMcd need here to be initialized from for example a pose estimation.
    
    // Update the current ThetaU visual feature
    s.buildFrom(cMcd);
    
    // compute the control law
    vpColVector v = task.computeControlLaw(); // camera velocity
  }
}
  \endcode

  If you want to deal only with the \f$(\theta u_x,\theta u_y)\f$ subset 
  feature from the 3D \f$\theta u\f$ , you have just to modify the 
  addFeature() call in the previous example by the following line. In 
  that case, the dimension of \f$s\f$ is two.

  \code 
  // Add the (ThetaU_x, ThetaU_y) subset features from the 3D ThetaU
  // rotation to the task
  task.addFeature(s, vpFeatureThetaU::selectTUx() | vpFeatureThetaU::selectTUy());
  \endcode

  If you want to build your own control law, this other example shows
  how to create a current (\f$s\f$) and desired (\f$s^*\f$) 3D
  \f$\theta u\f$ visual feature, compute the corresponding error
  vector \f$(s-s^*)\f$ and finally build the interaction matrix \f$L_s\f$.

  \code
#include <visp/vpFeatureThetaU.h>
#include <visp/vpHomogeneousMatrix.h>
#include <visp/vpMatrix.h>

int main()
{
  vpHomogeneousMatrix cdMc;
  // ... cdMc need here to be initialized from for example a pose estimation.

  // Creation of the current feature s
  vpFeatureThetaU s(vpFeatureThetaU::cdRc);
  s.buildFrom(cdMc); // Initialization of the feature

  // Creation of the desired feature s*. By default this feature is 
  // initialized to zero
  vpFeatureThetaU s_star(vpFeatureThetaU::cdRc); 

  // Compute the interaction matrix L_s for the current ThetaU feature
  vpMatrix L = s.interaction();

  // Compute the error vector (s-s*) for the ThetaU feature
  s.error(s_star);
}
  \endcode
  

*/
class VISP_EXPORT vpFeatureThetaU : public vpBasicFeature
{
public:
  typedef enum
    {
      TUx = 1, /*!< Select the subset \f$ \theta u_x \f$ visual feature
	     from the \f$ \theta u\f$ angle/axis representation. */
      TUy = 2, /*!< Select the subset \f$ \theta u_y \f$ visual feature
	     from the \f$ \theta u\f$ angle/axis representation. */
      TUz = 4  /*!< Select the subset \f$ \theta u_z \f$ visual feature
	     from the \f$ \theta u\f$ angle/axis representation. */
    } vpFeatureThetaUType;
  typedef enum
    {
      cdRc, /*!< Selector used to manipulate the visual feature \f$ s
	      = \theta u_{^{c^*}R_c} \f$. This visual feature
	      represent the orientation of the current camera frame
	      relative to the desired camera frame. */
      cRcd /*!< Selector used to manipulate the visual feature \f$ s = \theta
	     u_{^{c}R_{c^*}} \f$. This visual feature
	      represent the orientation of the desired camera frame
	      relative to the current camera frame. */
    } vpFeatureThetaURotationRepresentationType;
  /*
    attributes and members directly related to the vpBasicFeature needs
    other functionalities are useful but not mandatory
  */

public:
  // Basic construction.
  void init() ;
  // Basic constructor.
  vpFeatureThetaU(vpFeatureThetaURotationRepresentationType r) ;
  vpFeatureThetaU(vpThetaUVector &tu,
		  vpFeatureThetaURotationRepresentationType r) ;
  vpFeatureThetaU(vpRotationMatrix &R,
		  vpFeatureThetaURotationRepresentationType r) ;
  vpFeatureThetaU(vpHomogeneousMatrix &M, 
		  vpFeatureThetaURotationRepresentationType r) ;
  void buildFrom(vpThetaUVector &tu) ;
  // build from a rotation matrix
  void buildFrom(const vpRotationMatrix &R) ;
  // build from an homogeneous  matrix
  void buildFrom(const vpHomogeneousMatrix &M) ;

		  
  //! Destructor. Does nothing.
  virtual ~vpFeatureThetaU() { if (flags != NULL) delete [] flags; /*vpTRACE("0x%x", this)*/ ;}

public:


  void set_TUx(const double tu_x) ;
  void set_TUy(const double tu_y) ;
  void set_TUz(const double tu_z) ;

  double get_TUx()  const ;
  double get_TUy()   const ;
  double get_TUz() const  ;


public:
  /*
    vpBasicFeature method instantiation
  */

  /*! 

    Function used to select the \f$ \theta u_x\f$ subset of the \f$
    \theta u \f$ visual feature.

    This function is to use in conjunction with interaction() in order
    to compute the interaction matrix associated to \f$ \theta u_x\f$.

    See the interaction() method for an usage example.

    This function is also useful in the vpServo class to indicate that
    a subset of the visual feature is to use in the control law:

    \code 
    vpFeatureThetaU tu;
    vpServo task;
    ...
    // Add the (ThetaU_x, ThetaU_y) subset features from the 3D ThetaU
    // rotation to the task
    task.addFeature(tu, vpFeatureThetaU::selectTUx() | vpFeatureThetaU::selectTUy());
    \endcode

    \sa selectTUy(), selectTUz()
  */
  inline static unsigned int selectTUx()  { return FEATURE_LINE[0] ; }
  /*! 

    Function used to select the \f$ \theta u_y\f$ subset of the \f$
    \theta u \f$ visual feature.

    This function is to use in conjunction with interaction() in order
    to compute the interaction matrix associated to \f$ \theta u_y\f$.

    See the interaction() method for an usage example.

    This function is also useful in the vpServo class to indicate that
    a subset of the visual feature is to use in the control law:

    \code 
    vpFeatureThetaU tu;
    vpServo task;
    ...
    // Add the (ThetaU_x, ThetaU_y) subset features from the 3D ThetaU
    // rotation to the task
    task.addFeature(tu, vpFeatureThetaU::selectTUx() | vpFeatureThetaU::selectTUy());
    \endcode

    \sa selectTUx(), selectTUz()
  */
  inline static unsigned int selectTUy()  { return FEATURE_LINE[1] ; }
  /*! 

    Function used to select the \f$ \theta u_z\f$ subset of the \f$
    \theta u \f$ visual feature.

    This function is to use in conjunction with interaction() in order
    to compute the interaction matrix associated to \f$ \theta u_z\f$.

    See the interaction() method for an usage example.

    This function is also useful in the vpServo class to indicate that
    a subset of the visual feature is to use in the control law:

    \code 
    vpFeatureThetaU tu;
    vpServo task;
    ...
    // Add the (ThetaU_z) subset feature from the 3D ThetaU
    // rotation to the task
    task.addFeature(tu, vpFeatureThetaU::selectTUz());
    \endcode

    \sa selectTUx(), selectTUy()
  */
  inline static unsigned int selectTUz()  { return FEATURE_LINE[2] ; }
  // compute the interaction matrix from a subset a the possible features
  vpMatrix  interaction(const unsigned int select = FEATURE_ALL);
  // compute the error between two visual features from a subset
  // a the possible features
  vpColVector error(const vpBasicFeature &s_star,
                    const unsigned int select = FEATURE_ALL)  ;
  void print(const unsigned int select= FEATURE_ALL) const ;

  //! Feature duplication.
  vpFeatureThetaU *duplicate() const ;

public:
  void display(const vpCameraParameters &cam,
               const vpImage<unsigned char> &I,
               const vpColor &color=vpColor::green,
               unsigned int thickness=1) const ;
  void display(const vpCameraParameters &cam,
               const vpImage<vpRGBa> &I,
               const vpColor &color=vpColor::green,
               unsigned int thickness=1) const ;

 private:
  vpFeatureThetaURotationRepresentationType rotation;
} ;


#endif

/*
 * Local variables:
 * c-basic-offset: 2
 * End:
 */