Visual Servoing Platform
version 3.7.0
Toggle main menu visibility
Loading...
Searching...
No Matches
vpTranslationVector.h
1
/*
2
* ViSP, open source Visual Servoing Platform software.
3
* Copyright (C) 2005 - 2024 by Inria. All rights reserved.
4
*
5
* This software is free software; you can redistribute it and/or modify
6
* it under the terms of the GNU General Public License as published by
7
* the Free Software Foundation; either version 2 of the License, or
8
* (at your option) any later version.
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 https://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
* Translation vector.
32
*/
33
38
39
#ifndef VP_TRANSLATION_VECTOR_H
40
#define VP_TRANSLATION_VECTOR_H
41
42
#include <visp3/core/vpConfig.h>
43
#include <visp3/core/vpArray2D.h>
44
#include <visp3/core/vpHomogeneousMatrix.h>
45
#include <visp3/core/vpPoseVector.h>
46
47
BEGIN_VISP_NAMESPACE
48
class
vpMatrix
;
49
118
class
VISP_EXPORT
vpTranslationVector
:
public
vpArray2D
<double>
119
{
120
public
:
125
vpTranslationVector
() :
vpArray2D
<double>(3, 1),
m_index
(0) { }
126
vpTranslationVector
(
double
tx,
double
ty,
double
tz);
127
vpTranslationVector
(
const
vpTranslationVector
&tv);
128
VP_EXPLICIT
vpTranslationVector
(
const
vpHomogeneousMatrix
&M);
129
VP_EXPLICIT
vpTranslationVector
(
const
vpPoseVector
&p);
130
VP_EXPLICIT
vpTranslationVector
(
const
vpColVector
&v);
131
132
vpTranslationVector
&buildFrom(
const
double
&tx,
const
double
&ty,
const
double
&tz);
133
vpTranslationVector
&buildFrom(
const
vpHomogeneousMatrix
&M);
134
vpTranslationVector
&buildFrom(
const
vpPoseVector
&p);
135
vpTranslationVector
&buildFrom(
const
vpColVector
&v);
136
137
double
frobeniusNorm()
const
;
138
139
// operators
140
141
// translation vectors additions c = a + b (a, b unchanged)
142
vpTranslationVector
operator+(
const
vpTranslationVector
&tv)
const
;
143
vpTranslationVector
operator+(
const
vpColVector
&v)
const
;
144
// translation vectors subtraction c = a - b (a, b unchanged)
145
vpTranslationVector
operator-(
const
vpTranslationVector
&tv)
const
;
146
// negate t = -a (t is unchanged)
147
vpTranslationVector
operator-()
const
;
148
vpMatrix
operator*(
const
vpRowVector
&v)
const
;
149
// b = x * a (x=scalar)
150
vpTranslationVector
operator*(
double
x)
const
;
151
vpTranslationVector
&operator*=(
double
x);
152
vpTranslationVector
operator/(
double
x)
const
;
153
vpTranslationVector
&operator/=(
double
x);
154
// Copy operator. Allow operation such as A = v
155
vpTranslationVector
&
operator=
(
const
vpColVector
&tv);
156
vpTranslationVector
&
operator=
(
const
vpTranslationVector
&tv);
157
vpTranslationVector
&
operator=
(
double
x);
158
#if (VISP_CXX_STANDARD >= VISP_CXX_STANDARD_11)
159
vpTranslationVector
&
operator=
(
const
std::initializer_list<double> &list);
160
#endif
161
163
inline
double
&
operator[]
(
unsigned
int
n) {
return
*(
data
+ n); }
165
inline
const
double
&
operator[]
(
unsigned
int
n)
const
{
return
*(
data
+ n); }
166
167
vpTranslationVector
&
operator<<
(
double
val);
168
vpTranslationVector
&operator,(
double
val);
169
175
VP_NORETURN
void
resize
(
unsigned
int
nrows,
unsigned
int
ncols,
bool
flagNullify =
true
)
176
{
177
(void)nrows;
178
(void)ncols;
179
(void)flagNullify;
180
throw
(
vpException
(
vpException::fatalError
,
"Cannot resize a translation vector"
));
181
}
182
183
void
set(
double
tx,
double
ty,
double
tz);
184
185
// Skew Symmetric matrix
186
vpMatrix
skew()
const
;
187
188
double
sumSquare()
const
;
189
190
vpRowVector
t
()
const
;
191
192
static
vpTranslationVector
cross(
const
vpTranslationVector
&a,
const
vpTranslationVector
&b);
193
static
vpTranslationVector
mean(
const
std::vector<vpHomogeneousMatrix> &vec_M);
194
static
vpTranslationVector
mean(
const
std::vector<vpTranslationVector> &vec_t);
195
static
vpMatrix
skew(
const
vpTranslationVector
&tv);
196
static
void
skew(
const
vpTranslationVector
&tv,
vpMatrix
&M);
197
198
#if defined(VISP_BUILD_DEPRECATED_FUNCTIONS)
203
VP_DEPRECATED double euclideanNorm() const;
204
//}
205
#endif
206
207
protected
:
208
unsigned
int
m_index
;
// index used for operator<< and operator, to fill a vector
209
private
:
210
static
const
unsigned
int
constr_val_3;
211
};
212
END_VISP_NAMESPACE
213
#endif
vpArray2D< double >::data
double * data
Definition
vpArray2D.h:149
vpArray2D::operator=
vpArray2D< Type > & operator=(Type x)
Set all the elements of the array to x.
Definition
vpArray2D.h:615
vpArray2D< double >::vpArray2D
vpArray2D()
Definition
vpArray2D.h:155
vpArray2D::operator<<
friend std::ostream & operator<<(std::ostream &s, const vpArray2D< Type > &A)
Definition
vpArray2D.h:705
vpArray2D::t
vpArray2D< Type > t() const
Compute the transpose of the array.
Definition
vpArray2D.h:1273
vpColVector
Implementation of column vector and the associated operations.
Definition
vpColVector.h:191
vpException
error that can be emitted by ViSP classes.
Definition
vpException.h:60
vpException::fatalError
@ fatalError
Fatal error.
Definition
vpException.h:72
vpHomogeneousMatrix
Implementation of an homogeneous matrix and operations on such kind of matrices.
Definition
vpHomogeneousMatrix.h:221
vpMatrix
Implementation of a matrix and operations on matrices.
Definition
vpMatrix.h:175
vpPoseVector
Implementation of a pose vector and operations on poses.
Definition
vpPoseVector.h:203
vpRowVector
Implementation of row vector and the associated operations.
Definition
vpRowVector.h:124
vpTranslationVector
Class that consider the case of a translation vector.
Definition
vpTranslationVector.h:119
vpTranslationVector::m_index
unsigned int m_index
Definition
vpTranslationVector.h:208
vpTranslationVector::operator[]
const double & operator[](unsigned int n) const
Operator that allows to get the value of an element : x = t[i].
Definition
vpTranslationVector.h:165
vpTranslationVector::vpTranslationVector
vpTranslationVector()
Definition
vpTranslationVector.h:125
vpTranslationVector::resize
VP_NORETURN void resize(unsigned int nrows, unsigned int ncols, bool flagNullify=true)
Definition
vpTranslationVector.h:175
vpTranslationVector::operator[]
double & operator[](unsigned int n)
Operator that allows to set a value of an element : t[i] = x.
Definition
vpTranslationVector.h:163
BEGIN_VISP_NAMESPACE
Definition
vpMbtDistanceCircle.cpp:55
modules
core
include
visp3
core
vpTranslationVector.h
Generated by
1.17.0