Simox  2.3.74.0
Eigen Namespace Reference

Namespaces

 jsonbase
 

Typedefs

using Matrix32f = Eigen::Matrix< float, 3, 2 >
 

Functions

template<>
void from_json< Eigen::Vector3f > (const ::simox::json::json &j, Eigen::MatrixBase< Eigen::Vector3f > &vector)
 
template<>
void from_json< Eigen::Matrix4f > (const ::simox::json::json &j, Eigen::MatrixBase< Eigen::Matrix4f > &matrix)
 
template<typename Derived >
void to_json (simox::json::json &j, const Eigen::MatrixBase< Derived > &matrix)
 Writes the matrix as list of rows. More...
 
template<typename Derived >
void from_json (const simox::json::json &j, Eigen::MatrixBase< Derived > &matrix)
 Reads the matrix from list of rows. More...
 
template<>
void from_json< Eigen::Vector3f > (const simox::json::json &j, Eigen::MatrixBase< Eigen::Vector3f > &vector)
 If j is an object, reads vector from x, y, z keys. Otherwise, reads it as matrix. More...
 
template<>
void from_json< Eigen::Matrix4f > (const simox::json::json &j, Eigen::MatrixBase< Eigen::Matrix4f > &matrix)
 Reads a 4x4 matrix from list of rows or pos and ori keys. More...
 
template<typename Derived >
void to_json (simox::json::json &j, const Eigen::QuaternionBase< Derived > &quat)
 Writes the quaternion with qw, qx, qy, qz keys. More...
 
template<typename Derived >
void from_json (const simox::json::json &j, Eigen::QuaternionBase< Derived > &quat)
 Reads the quaternion from qw, qx, qy, qz keys. More...
 
template<typename T , int N, int Type>
void to_json (simox::json::json &j, const Eigen::Transform< T, N, Type > &transform)
 
template<typename T , int N, int Type>
void from_json (const simox::json::json &j, Eigen::Transform< T, N, Type > &transform)
 

Detailed Description

Provide to_json() and from_json() overloads for simox::json::json, which allows simple syntax like:

Eigen::Matrix3f in, out;
j = in;
out = j.get<Eigen::Matrix3f>();
Test:
VirtualRobotJsonEigenConversionTest
See also
https://github.com/nlohmann/json#arbitrary-types-conversions

Typedef Documentation

◆ Matrix32f

using Eigen::Matrix32f = typedef Eigen::Matrix<float, 3, 2>

Function Documentation

◆ from_json() [1/3]

template<typename Derived >
void Eigen::from_json ( const simox::json::json j,
Eigen::MatrixBase< Derived > &  matrix 
)

Reads the matrix from list of rows.

◆ from_json() [2/3]

template<typename Derived >
void Eigen::from_json ( const simox::json::json j,
Eigen::QuaternionBase< Derived > &  quat 
)

Reads the quaternion from qw, qx, qy, qz keys.

◆ from_json() [3/3]

template<typename T , int N, int Type>
void Eigen::from_json ( const simox::json::json j,
Eigen::Transform< T, N, Type > &  transform 
)

◆ from_json< Eigen::Matrix4f >() [1/2]

template<>
void Eigen::from_json< Eigen::Matrix4f > ( const ::simox::json::json j,
Eigen::MatrixBase< Eigen::Matrix4f > &  matrix 
)

◆ from_json< Eigen::Matrix4f >() [2/2]

template<>
void Eigen::from_json< Eigen::Matrix4f > ( const simox::json::json j,
Eigen::MatrixBase< Eigen::Matrix4f > &  matrix 
)

Reads a 4x4 matrix from list of rows or pos and ori keys.

If j is an object, reads matrix as transformation matrix from pos and ori keys. Otherweise, reads it from list of rows.

◆ from_json< Eigen::Vector3f >() [1/2]

template<>
void Eigen::from_json< Eigen::Vector3f > ( const ::simox::json::json j,
Eigen::MatrixBase< Eigen::Vector3f > &  vector 
)

◆ from_json< Eigen::Vector3f >() [2/2]

template<>
void Eigen::from_json< Eigen::Vector3f > ( const simox::json::json j,
Eigen::MatrixBase< Eigen::Vector3f > &  vector 
)

If j is an object, reads vector from x, y, z keys. Otherwise, reads it as matrix.

◆ to_json() [1/3]

template<typename Derived >
void Eigen::to_json ( simox::json::json j,
const Eigen::MatrixBase< Derived > &  matrix 
)

Writes the matrix as list of rows.

◆ to_json() [2/3]

template<typename Derived >
void Eigen::to_json ( simox::json::json j,
const Eigen::QuaternionBase< Derived > &  quat 
)

Writes the quaternion with qw, qx, qy, qz keys.

◆ to_json() [3/3]

template<typename T , int N, int Type>
void Eigen::to_json ( simox::json::json j,
const Eigen::Transform< T, N, Type > &  transform 
)