23 return Rigid2d({transform.translation().x(), transform.translation().y()},
24 transform.rotation());
27 Eigen::Vector2d
ToEigen(
const proto::Vector2d& vector) {
28 return Eigen::Vector2d(vector.x(), vector.y());
31 Eigen::Vector3f
ToEigen(
const proto::Vector3f& vector) {
32 return Eigen::Vector3f(vector.x(), vector.y(), vector.z());
35 Eigen::Vector4f
ToEigen(
const proto::Vector4f& vector) {
36 return Eigen::Vector4f(vector.x(), vector.y(), vector.z(), vector.t());
39 Eigen::Vector3d
ToEigen(
const proto::Vector3d& vector) {
40 return Eigen::Vector3d(vector.x(), vector.y(), vector.z());
43 Eigen::Quaterniond
ToEigen(
const proto::Quaterniond& quaternion) {
44 return Eigen::Quaterniond(quaternion.w(), quaternion.x(), quaternion.y(),
50 proto.mutable_translation()->set_x(transform.
translation().x());
51 proto.mutable_translation()->set_y(transform.
translation().y());
52 proto.set_rotation(transform.
rotation().angle());
58 proto.mutable_translation()->set_x(transform.
translation().x());
59 proto.mutable_translation()->set_y(transform.
translation().y());
60 proto.set_rotation(transform.
rotation().angle());
83 proto::Vector2d
ToProto(
const Eigen::Vector2d& vector) {
84 proto::Vector2d proto;
85 proto.set_x(vector.x());
86 proto.set_y(vector.y());
90 proto::Vector3f
ToProto(
const Eigen::Vector3f& vector) {
91 proto::Vector3f proto;
92 proto.set_x(vector.x());
93 proto.set_y(vector.y());
94 proto.set_z(vector.z());
98 proto::Vector4f
ToProto(
const Eigen::Vector4f& vector) {
99 proto::Vector4f proto;
100 proto.set_x(vector.x());
101 proto.set_y(vector.y());
102 proto.set_z(vector.z());
103 proto.set_t(vector.w());
107 proto::Vector3d
ToProto(
const Eigen::Vector3d& vector) {
108 proto::Vector3d proto;
109 proto.set_x(vector.x());
110 proto.set_y(vector.y());
111 proto.set_z(vector.z());
115 proto::Quaternionf
ToProto(
const Eigen::Quaternionf& quaternion) {
116 proto::Quaternionf proto;
117 proto.set_w(quaternion.w());
118 proto.set_x(quaternion.x());
119 proto.set_y(quaternion.y());
120 proto.set_z(quaternion.z());
124 proto::Quaterniond
ToProto(
const Eigen::Quaterniond& quaternion) {
125 proto::Quaterniond proto;
126 proto.set_w(quaternion.w());
127 proto.set_x(quaternion.x());
128 proto.set_y(quaternion.y());
129 proto.set_z(quaternion.z());