Skip to content
Snippets Groups Projects
Commit b4af7b08 authored by Rainer Kartmann's avatar Rainer Kartmann Committed by ARMAR-6 User
Browse files

use explicit namespace qualification

parent c20af0cd
No related branches found
No related tags found
No related merge requests found
......@@ -5,44 +5,41 @@
#include <Eigen/Geometry>
namespace Eigen
void Eigen::from_json(const ::simox::json::json& j, Eigen::Vector3f& vector)
{
void from_json(const ::simox::json::json& j, Eigen::Vector3f& vector)
if (j.is_object())
{
if (j.is_object())
{
vector.x() = j.at("x").get<float>();
vector.y() = j.at("y").get<float>();
vector.z() = j.at("z").get<float>();
}
else // j.is_array()
{
jsonbase::from_json(j, vector);
}
vector.x() = j.at("x").get<float>();
vector.y() = j.at("y").get<float>();
vector.z() = j.at("z").get<float>();
}
else // j.is_array()
{
jsonbase::from_json(j, vector);
}
}
void from_json(const ::simox::json::json& j, Eigen::Matrix4f& matrix)
void Eigen::from_json(const ::simox::json::json& j, Eigen::Matrix4f& matrix)
{
if (j.is_object())
{
if (j.is_object())
const auto& j_ori = j.at("ori");
Eigen::Matrix3f ori;
if (j_ori.is_object())
{
const auto& j_ori = j.at("ori");
Eigen::Matrix3f ori;
if (j_ori.is_object())
{
ori = j_ori.get<Eigen::Quaternionf>().toRotationMatrix();
}
else
{
ori = j_ori.get<Eigen::Matrix3f>();
}
matrix = simox::math::pose(j.at("pos").get<Eigen::Vector3f>(), ori);
ori = j_ori.get<Eigen::Quaternionf>().toRotationMatrix();
}
else
{
jsonbase::from_json(j, matrix);
ori = j_ori.get<Eigen::Matrix3f>();
}
matrix = simox::math::pose(j.at("pos").get<Eigen::Vector3f>(), ori);
}
else
{
jsonbase::from_json(j, matrix);
}
}
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment