23 return Rigid2d({pose.translation().x(), pose.translation().y()},
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::Vector3d
ToEigen(
const proto::Vector3d& vector) {
36 return Eigen::Vector3d(vector.x(), vector.y(), vector.z());
39 Eigen::Quaterniond
ToEigen(
const proto::Quaterniond& quaternion) {
40 return Eigen::Quaterniond(quaternion.w(), quaternion.x(), quaternion.y(),
46 proto.mutable_translation()->set_x(transform.
translation().x());
47 proto.mutable_translation()->set_y(transform.
translation().y());
48 proto.set_rotation(transform.
rotation().angle());
54 proto.mutable_translation()->set_x(transform.
translation().x());
55 proto.mutable_translation()->set_y(transform.
translation().y());
56 proto.set_rotation(transform.
rotation().angle());
79 proto::Vector2d
ToProto(
const Eigen::Vector2d& vector) {
80 proto::Vector2d proto;
81 proto.set_x(vector.x());
82 proto.set_y(vector.y());
86 proto::Vector3f
ToProto(
const Eigen::Vector3f& vector) {
87 proto::Vector3f proto;
88 proto.set_x(vector.x());
89 proto.set_y(vector.y());
90 proto.set_z(vector.z());
94 proto::Vector3d
ToProto(
const Eigen::Vector3d& vector) {
95 proto::Vector3d proto;
96 proto.set_x(vector.x());
97 proto.set_y(vector.y());
98 proto.set_z(vector.z());
102 proto::Quaternionf
ToProto(
const Eigen::Quaternionf& quaternion) {
103 proto::Quaternionf proto;
104 proto.set_w(quaternion.w());
105 proto.set_x(quaternion.x());
106 proto.set_y(quaternion.y());
107 proto.set_z(quaternion.z());
111 proto::Quaterniond
ToProto(
const Eigen::Quaterniond& quaternion) {
112 proto::Quaterniond proto;
113 proto.set_w(quaternion.w());
114 proto.set_x(quaternion.x());
115 proto.set_y(quaternion.y());
116 proto.set_z(quaternion.z());