#include <ImFusion/Core/Vector.h>
Class representing a vector, defined in a Frame.
More...
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 };
Class representing a vector, defined in a Frame.
Definition Vector.h:46
The following would not compile:
enum class Robot {
Base = 0, Arm, EndEffector };
Vector<Robot::Base> armInBase = base_T_ef * armPos;
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
-
| From | Frame where the vector originates from |
| EigenType | Underlying type of the Vector, should be an Eigen type |
- See also
- Transform
|
|
using | TypeFrom = decltype(From) |
|
|
| 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 constexpr TypeFrom | FrameFrom = From |
The documentation for this class was generated from the following file: