17 #ifndef CARTOGRAPHER_MAPPING_INTERNAL_OPTIMIZATION_COST_FUNCTIONS_LANDMARK_COST_FUNCTION_3D_H_ 18 #define CARTOGRAPHER_MAPPING_INTERNAL_OPTIMIZATION_COST_FUNCTIONS_LANDMARK_COST_FUNCTION_3D_H_ 21 #include "Eigen/Geometry" 27 #include "ceres/ceres.h" 28 #include "ceres/jet.h" 32 namespace optimization {
44 return new ceres::AutoDiffCostFunction<
57 const T*
const prev_node_translation,
58 const T*
const next_node_rotation,
59 const T*
const next_node_translation,
60 const T*
const landmark_rotation,
61 const T*
const landmark_translation, T*
const e)
const {
62 const std::tuple<std::array<T, 4>, std::array<T, 3>>
64 prev_node_rotation, prev_node_translation, next_node_rotation,
69 std::get<0>(interpolated_rotation_and_translation).data(),
70 std::get<1>(interpolated_rotation_and_translation).data(),
71 landmark_rotation, landmark_translation),
73 std::copy(std::begin(error), std::end(error), e);
82 observation.landmark_to_tracking_transform),
99 #endif // CARTOGRAPHER_MAPPING_INTERNAL_OPTIMIZATION_COST_FUNCTIONS_LANDMARK_COST_FUNCTION_3D_H_
const double interpolation_parameter_
const transform::Rigid3d landmark_to_tracking_transform_
const double translation_weight_
static ceres::CostFunction * CreateAutoDiffCostFunction(const LandmarkObservation &observation, const NodeSpec3D &prev_node, const NodeSpec3D &next_node)
LandmarkCostFunction3D(const LandmarkObservation &observation, const NodeSpec3D &prev_node, const NodeSpec3D &next_node)
std::tuple< std::array< T, 4 >, std::array< T, 3 > > InterpolateNodes3D(const T *const prev_node_rotation, const T *const prev_node_translation, const T *const next_node_rotation, const T *const next_node_translation, const double interpolation_parameter)
const double rotation_weight_
std::array< T, 3 > ScaleError(const std::array< T, 3 > &error, double translation_weight, double rotation_weight)
double ToSeconds(const Duration duration)
static std::array< T, 3 > ComputeUnscaledError(const transform::Rigid2d &relative_pose, const T *const start, const T *const end)
bool operator()(const T *const prev_node_rotation, const T *const prev_node_translation, const T *const next_node_rotation, const T *const next_node_translation, const T *const landmark_rotation, const T *const landmark_translation, T *const e) const