-
Notifications
You must be signed in to change notification settings - Fork 1.2k
/
bot_core_lcm_encode_decode.h
43 lines (33 loc) · 1.17 KB
/
bot_core_lcm_encode_decode.h
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
#pragma once
#include <Eigen/Core>
#include <Eigen/Geometry>
#include "bot_core/position_3d_t.hpp"
#include "bot_core/quaternion_t.hpp"
#include "bot_core/twist_t.hpp"
#include "bot_core/vector_3d_t.hpp"
#include "drake/common/eigen_types.h"
void EncodeVector3d(
const Eigen::Ref<const Eigen::Vector3d>& vec,
// NOLINTNEXTLINE(runtime/references)
bot_core::vector_3d_t& msg);
Eigen::Vector3d DecodeVector3d(
const bot_core::vector_3d_t& msg);
void EncodeQuaternion(const Eigen::Quaterniond& q,
// NOLINTNEXTLINE(runtime/references)
bot_core::quaternion_t& msg);
Eigen::Vector4d DecodeQuaternion(
const bot_core::quaternion_t& msg);
// Note that bot_core::position_3d_t is badly named.
void EncodePose(
const Eigen::Isometry3d& pose,
// NOLINTNEXTLINE(runtime/references)
bot_core::position_3d_t& msg);
// Note that bot_core::position_3d_t is badly named.
Eigen::Isometry3d DecodePose(
const bot_core::position_3d_t& msg);
void EncodeTwist(
const Eigen::Ref<const drake::TwistVector<double>>& twist,
// NOLINTNEXTLINE(runtime/references)
bot_core::twist_t& msg);
drake::TwistVector<double> DecodeTwist(
const bot_core::twist_t& msg);