NASA Astrobee Robot Software  0.19.1
Flight software for the Astrobee robots operating inside the International Space Station.
se3_local_parameterization.h
Go to the documentation of this file.
1 /* Copyright (c) 2017, United States Government, as represented by the
2  * Administrator of the National Aeronautics and Space Administration.
3  *
4  * All rights reserved.
5  *
6  * The Astrobee platform is licensed under the Apache License, Version 2.0
7  * (the "License"); you may not use this file except in compliance with the
8  * License. You may obtain a copy of the License at
9  *
10  * http://www.apache.org/licenses/LICENSE-2.0
11  *
12  * Unless required by applicable law or agreed to in writing, software
13  * distributed under the License is distributed on an "AS IS" BASIS, WITHOUT
14  * WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the
15  * License for the specific language governing permissions and limitations
16  * under the License.
17  */
18 #ifndef OPTIMIZATION_COMMON_SE3_LOCAL_PARAMETERIZATION_H_
19 #define OPTIMIZATION_COMMON_SE3_LOCAL_PARAMETERIZATION_H_
20 
22 
23 #include <ceres/autodiff_local_parameterization.h>
24 
25 #include <Eigen/Geometry>
26 
27 namespace optimization_common {
28 struct SE3Plus {
29  template <typename T>
30  bool operator()(const T* x, const T* delta, T* x_plus_delta) const {
31  const Eigen::Transform<T, 3, Eigen::Isometry> pose = Isometry3(x);
32  const Eigen::Transform<T, 3, Eigen::Isometry> pose_delta = Isometry3(delta);
33  const Eigen::Transform<T, 3, Eigen::Isometry> updated_pose = pose * pose_delta;
34  const Eigen::Matrix<T, 6, 1> updated_pose_vector = VectorFromIsometry3(updated_pose);
35  for (int i = 0; i < 6; ++i) {
36  x_plus_delta[i] = updated_pose_vector[i];
37  }
38  return true;
39  }
40 };
41 
42 using SE3LocalParameterization = ceres::AutoDiffLocalParameterization<SE3Plus, 6, 6>;
43 } // namespace optimization_common
44 
45 #endif // OPTIMIZATION_COMMON_SE3_LOCAL_PARAMETERIZATION_H_
optimization_common::SE3LocalParameterization
ceres::AutoDiffLocalParameterization< SE3Plus, 6, 6 > SE3LocalParameterization
Definition: se3_local_parameterization.h:42
optimization_common::Isometry3
Eigen::Transform< T, 3, Eigen::Isometry > Isometry3(const T *isometry_data)
Definition: utilities.h:84
optimization_common::SE3Plus
Definition: se3_local_parameterization.h:28
optimization_common
Definition: optimization_params.h:23
utilities.h
optimization_common::SE3Plus::operator()
bool operator()(const T *x, const T *delta, T *x_plus_delta) const
Definition: se3_local_parameterization.h:30
optimization_common::VectorFromIsometry3
Eigen::Matrix< T, 6, 1 > VectorFromIsometry3(const Eigen::Transform< T, 3, Eigen::Isometry > &isometry_3)
Definition: utilities.h:72