5#include <yaml-cpp/yaml.h>
8#include "smooth_fwd.hpp"
13bool convert<smooth::SO2<T>>::decode(
const Node & yaml, smooth::SO2<T> & obj)
17 obj = smooth::SO2<T>(yaml[
"qz"].
template as<T>(), yaml[
"qw"].
template as<T>());
18 }
else if (yaml[
"z"]) {
19 obj = smooth::SO2<T>(yaml[
"z"].
template as<T>(), yaml[
"w"].
template as<T>());
23 obj = smooth::SO2<T>(yaml.template as<T>());
29bool convert<smooth::SE2<T>>::decode(
const Node & yaml, smooth::SE2<T> & obj)
31 if (yaml[
"qw"] || yaml[
"w"]) {
32 obj.so2() = yaml.as<smooth::SO2<T>>();
33 obj.r2() = yaml.as<Eigen::Vector2<T>>();
34 }
else if (yaml[
"yaw"]) {
35 obj.so2() = yaml[
"yaw"].as<smooth::SO2<T>>();
36 obj.r2() = yaml.as<Eigen::Vector2<T>>();
38 obj.so2() = yaml[
"orientation"].as<smooth::SO2<T>>();
39 obj.r2() = yaml[
"translation"].as<Eigen::Vector2<T>>();
45bool convert<smooth::SO3<T>>::decode(
const Node & yaml, smooth::SO3<T> & obj)
47 obj = smooth::SO3<T>(yaml.as<Eigen::Quaternion<T>>());
52bool convert<smooth::SE3<T>>::decode(
const Node & yaml, smooth::SE3<T> & obj)
55 obj.so3() = yaml.as<smooth::SO3<T>>();
56 obj.r3() = yaml.as<Eigen::Vector3<T>>();
58 obj.so3() = yaml[
"orientation"].as<smooth::SO3<T>>();
59 obj.r3() = yaml[
"translation"].as<Eigen::Vector3<T>>();
YAML forward declarations.