ImFusion SDK 4.3
Vector< From, EigenType > Class Template Reference

#include <ImFusion/Core/Vector.h>

Class representing a vector, defined in a Frame. More...

Detailed Description

template<auto From, typename EigenType = Eigen::Vector4d>
class ImFusion::Vector< From, EigenType >

Class representing a vector, defined in a Frame.

See Transform for documentation on Frames

At compilation time, the validity of Vector operations is checked:

  • Assignment can only be from the same Frame
  • From Frame of the Transform right multiplied must match our Frame

An example of Vector with Transform:

enum class Robot { Base = 0, Arm, EndEffector };
Vector<Robot::Base> tipInBase = base_T_ef * tipPosition;
The Transform class provides a transformation from a Frame to another Frame, where each Frame is a co...
Definition Transform.h:94
Class representing a vector, defined in a Frame.
Definition Vector.h:46
Definition Scanner.h:29

The following would not compile:

enum class Robot { Base = 0, Arm, EndEffector };
armPos = Vector<Robot::EndEffector>{}; // Frame does not match
Vector<Robot::Base> armInBase = base_T_ef * armPos; // From-Frame does not match Vector Frame

By default the Vector uses an Eigen::Vector4d. A different Eigen vector can also be used as supporting type, such as Eigen::Vector3d for 2D coordinates.

Template Parameters
FromFrame where the vector originates from
EigenTypeUnderlying type of the Vector, should be an Eigen type
See also
Transform

Public Types

using TypeFrom = decltype(From)
 

Public Member Functions

 Vector (EigenType v)
 
template<auto OtherFrom, typename OtherEigenType>
 Vector (const Vector< OtherFrom, OtherEigenType > &other)
 
template<auto OtherFrom>
 Vector (Vector< OtherFrom > &&other)
 
template<auto OtherFrom>
Vector< FrameFrom, EigenType > & operator= (const Vector< OtherFrom, EigenType > &other)
 
template<auto OtherFrom, typename OtherEigenType>
Vector< FrameFrom, EigenType > & operator= (const Vector< OtherFrom, OtherEigenType > &other)
 
template<auto OtherFrom>
auto operator+ (const Vector< OtherFrom, EigenType > &other) const
 
template<auto OtherFrom>
auto operator- (const Vector< OtherFrom, EigenType > &other) const
 
template<typename Operand, typename = typename std::enable_if<std::is_arithmetic<Operand>::value, Operand>::type>
auto operator* (const Operand &other) const
 
void normalize ()
 
auto normalized () const
 
template<auto OtherFrom>
double dot (const Vector< OtherFrom, EigenType > &other) const
 
template<auto OtherFrom>
auto cross (const Vector< OtherFrom, EigenType > &other) const
 
EigenType & vector ()
 
const EigenType & vector () const
 
 operator EigenType () const
 

Static Public Attributes

static constexpr TypeFrom FrameFrom = From
 

The documentation for this class was generated from the following file:
Search Tab / S to search, Esc to close