ceres_pose.cc
Go to the documentation of this file.
1 /*
2  * Copyright 2016 The Cartographer Authors
3  *
4  * Licensed under the Apache License, Version 2.0 (the "License");
5  * you may not use this file except in compliance with the License.
6  * You may obtain a copy of the License at
7  *
8  * http://www.apache.org/licenses/LICENSE-2.0
9  *
10  * Unless required by applicable law or agreed to in writing, software
11  * distributed under the License is distributed on an "AS IS" BASIS,
12  * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
13  * See the License for the specific language governing permissions and
14  * limitations under the License.
15  */
16 
18 
19 namespace cartographer {
20 namespace mapping_3d {
21 
23  const transform::Rigid3d& rigid,
24  std::unique_ptr<ceres::LocalParameterization> translation_parametrization,
25  std::unique_ptr<ceres::LocalParameterization> rotation_parametrization,
26  ceres::Problem* problem)
27  : translation_({{rigid.translation().x(), rigid.translation().y(),
28  rigid.translation().z()}}),
29  rotation_({{rigid.rotation().w(), rigid.rotation().x(),
30  rigid.rotation().y(), rigid.rotation().z()}}) {
31  problem->AddParameterBlock(translation_.data(), 3,
32  translation_parametrization.release());
33  problem->AddParameterBlock(rotation_.data(), 4,
34  rotation_parametrization.release());
35 }
36 
38  return transform::Rigid3d(
39  Eigen::Map<const Eigen::Vector3d>(translation_.data()),
40  Eigen::Quaterniond(rotation_[0], rotation_[1], rotation_[2],
41  rotation_[3]));
42 }
43 
44 } // namespace mapping_3d
45 } // namespace cartographer
Rigid3< double > Rigid3d
std::array< double, 4 > rotation_
Definition: ceres_pose.h:49
std::array< double, 3 > translation_
Definition: ceres_pose.h:47
const transform::Rigid3d ToRigid() const
Definition: ceres_pose.cc:37
CeresPose(const transform::Rigid3d &rigid, std::unique_ptr< ceres::LocalParameterization > translation_parametrization, std::unique_ptr< ceres::LocalParameterization > rotation_parametrization, ceres::Problem *problem)
Definition: ceres_pose.cc:22
const Vector & translation() const


cartographer
Author(s):
autogenerated on Mon Jun 10 2019 12:51:38