3d_embedding.hpp
Go to the documentation of this file.
1 // Copyright 2024 Ekumen, Inc.
2 //
3 // Licensed under the Apache License, Version 2.0 (the "License");
4 // you may not use this file except in compliance with the License.
5 // You may obtain a copy of the License at
6 //
7 // http://www.apache.org/licenses/LICENSE-2.0
8 //
9 // Unless required by applicable law or agreed to in writing, software
10 // distributed under the License is distributed on an "AS IS" BASIS,
11 // WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
12 // See the License for the specific language governing permissions and
13 // limitations under the License.
14 
15 #ifndef BELUGA_3D_EMBEDDING_HPP
16 #define BELUGA_3D_EMBEDDING_HPP
17 
18 #include <sophus/se2.hpp>
19 #include <sophus/se3.hpp>
20 
21 namespace beluga {
22 
24 inline Sophus::SE2d To2d(const Sophus::SE3d& tf) {
25  return Sophus::SE2d{tf.angleZ(), tf.translation().head<2>()};
26 }
27 
29 inline Sophus::SE3d To3d(const Sophus::SE2d& tf) {
30  return Sophus::SE3d{
31  Sophus::SO3d::rotZ(tf.so2().log()), Eigen::Vector3d{tf.translation().x(), tf.translation().y(), 0.0}};
32 }
33 
34 } // namespace beluga
35 
36 #endif
beluga::To2d
Sophus::SE2d To2d(const Sophus::SE3d &tf)
Transforms a SE3 transform into a SE2 transform, by flattening the Z axis.
Definition: 3d_embedding.hpp:24
beluga::To3d
Sophus::SE3d To3d(const Sophus::SE2d &tf)
Embed a SE2 transform into 3D space with zero Z translation and only rotation about the Z axis.
Definition: 3d_embedding.hpp:29
Sophus::SE2::so2
SOPHUS_FUNC SO2Member & so2()
se2.hpp
Sophus::SE2
Sophus::SE3::translation
SOPHUS_FUNC TranslationMember & translation()
Sophus::SE3
Sophus::SO3::rotZ
static SOPHUS_FUNC SO3 rotZ(Scalar const &z)
Sophus::SE2::translation
SOPHUS_FUNC TranslationMember & translation()
beluga
The main Beluga namespace.
Definition: 3d_embedding.hpp:21
se3.hpp


beluga
Author(s):
autogenerated on Tue Jul 16 2024 02:59:53