-
Notifications
You must be signed in to change notification settings - Fork 728
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
1 parent
33fcdb9
commit 9418377
Showing
676 changed files
with
38,698 additions
and
13,473 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file was deleted.
Oops, something went wrong.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
58 changes: 58 additions & 0 deletions
58
algorithms/ceres-error-terms/include/ceres-error-terms/block-pose-prior-error-term-v2-inl.h
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,58 @@ | ||
#ifndef CERES_ERROR_TERMS_BLOCK_POSE_PRIOR_ERROR_TERM_V2_INL_H_ | ||
#define CERES_ERROR_TERMS_BLOCK_POSE_PRIOR_ERROR_TERM_V2_INL_H_ | ||
|
||
namespace ceres_error_terms { | ||
|
||
template <typename T> | ||
bool BlockPosePriorErrorTermV2::operator()( | ||
const T* const q_G_M_jpl_p_G_M, const T* const q_B_M_jpl_p_M_B, | ||
const T* const q_S_B_jpl_p_S_B, T* residuals) const { | ||
// Define Quaternion and Position of type T. | ||
typedef typename Eigen::Matrix<T, 3, 3> RotationMatrixT; | ||
typedef aslam::PositionTemplate<T> PositionT; | ||
|
||
const Eigen::Map<const Eigen::Matrix<T, 3, 1>> p_G_M_map( | ||
q_G_M_jpl_p_G_M + kOrientationBlockSize); | ||
const Eigen::Map<const Eigen::Matrix<T, 3, 1>> p_M_B_map( | ||
q_B_M_jpl_p_M_B + kOrientationBlockSize); | ||
const Eigen::Map<const Eigen::Matrix<T, 3, 1>> p_S_B_map( | ||
q_S_B_jpl_p_S_B + kOrientationBlockSize); | ||
|
||
const Eigen::Map<const Eigen::Matrix<T, 4, 1>> q_G_M_jpl_map(q_G_M_jpl_p_G_M); | ||
RotationMatrixT R_G_M_jpl; | ||
common::toRotationMatrixJPL(q_G_M_jpl_map, &R_G_M_jpl); | ||
const RotationMatrixT R_G_M = R_G_M_jpl; | ||
|
||
const Eigen::Map<const Eigen::Matrix<T, 4, 1>> q_B_M_jpl_map(q_B_M_jpl_p_M_B); | ||
RotationMatrixT R_B_M_jpl; | ||
common::toRotationMatrixJPL(q_B_M_jpl_map, &R_B_M_jpl); | ||
const RotationMatrixT R_M_B = R_B_M_jpl.transpose(); | ||
|
||
const Eigen::Map<const Eigen::Matrix<T, 4, 1>> q_S_B_jpl_map(q_S_B_jpl_p_S_B); | ||
RotationMatrixT R_S_B_jpl; | ||
common::toRotationMatrixJPL(q_S_B_jpl_map, &R_S_B_jpl); | ||
const RotationMatrixT R_B_S = R_S_B_jpl.transpose(); | ||
|
||
const RotationMatrixT R_G_S = R_G_M * R_M_B * R_B_S; | ||
|
||
// TODO(mfehr): DOUBLE CHECK IF THIS IS CORRECT!! | ||
const Eigen::Matrix<T, 3, 1> p_B_S = -(R_B_S * p_S_B_map); | ||
|
||
const PositionT p_G_S = R_G_M * R_M_B * p_B_S + R_G_M * p_M_B_map + p_G_M_map; | ||
|
||
const Eigen::Quaternion<T> q_G_S_estimated(R_G_S); | ||
const Eigen::Quaternion<T> q_S_G_measured(q_S_G_measured_); | ||
const Eigen::Quaternion<T> q_diff = q_G_S_estimated * q_S_G_measured; | ||
|
||
Eigen::Map<Eigen::Matrix<T, kResidualBlockSize, 1>> error(residuals); | ||
error.head(3) = p_G_S - p_G_S_measured_.cast<T>(); | ||
error.tail(3) = Eigen::Matrix<T, 3, 1>( | ||
static_cast<T>(2.0) * q_diff.x(), static_cast<T>(2.0) * q_diff.y(), | ||
static_cast<T>(2.0) * q_diff.z()); | ||
error = error.transpose() * sqrt_information_matrix_.cast<T>(); | ||
|
||
return true; | ||
} | ||
|
||
} // namespace ceres_error_terms | ||
#endif // CERES_ERROR_TERMS_BLOCK_POSE_PRIOR_ERROR_TERM_V2_INL_H_ |
57 changes: 57 additions & 0 deletions
57
algorithms/ceres-error-terms/include/ceres-error-terms/block-pose-prior-error-term-v2.h
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,57 @@ | ||
#ifndef CERES_ERROR_TERMS_BLOCK_POSE_PRIOR_ERROR_TERM_V2_H_ | ||
#define CERES_ERROR_TERMS_BLOCK_POSE_PRIOR_ERROR_TERM_V2_H_ | ||
|
||
#include <memory> | ||
|
||
#include <Eigen/Core> | ||
#include <aslam/common/pose-types.h> | ||
#include <ceres-error-terms/common.h> | ||
#include <ceres-error-terms/parameterization/quaternion-param-jpl.h> | ||
#include <ceres/ceres.h> | ||
#include <ceres/sized_cost_function.h> | ||
#include <maplab-common/quaternion-math.h> | ||
|
||
namespace ceres_error_terms { | ||
|
||
// Note: this error term accepts rotations expressed as quaternions | ||
// in JPL convention [x, y, z, w]. This convention corresponds to the internal | ||
// coefficient storage of Eigen so you can directly pass pointer to your | ||
// Eigen quaternion data, e.g. your_eigen_quaternion.coeffs().data(). | ||
class BlockPosePriorErrorTermV2 { | ||
public: | ||
BlockPosePriorErrorTermV2( | ||
const aslam::Transformation& T_G_S_measured, | ||
const Eigen::Matrix<double, 6, 6>& covariance); | ||
|
||
~BlockPosePriorErrorTermV2() {} | ||
|
||
template <typename T> | ||
bool operator()( | ||
const T* const q_G_M_jpl_p_G_M, const T* const q_B_M_jpl_p_M_B, | ||
const T* const q_S_B_jpl_p_S_B, T* residuals) const; | ||
|
||
static constexpr int kResidualBlockSize = 6; | ||
static constexpr int kOrientationBlockSize = 4; | ||
|
||
EIGEN_MAKE_ALIGNED_OPERATOR_NEW | ||
|
||
private: | ||
// Don't change the ordering of the enum elements, they have to be the | ||
// same as the order of the parameter blocks. | ||
enum { | ||
kIdxBaseframePose, | ||
kIdxVertexPose, | ||
kIdxSensorPose, | ||
}; | ||
|
||
Eigen::Matrix<double, 6, 6> sqrt_information_matrix_; | ||
|
||
Eigen::Quaterniond q_S_G_measured_; | ||
Eigen::Vector3d p_G_S_measured_; | ||
}; | ||
|
||
} // namespace ceres_error_terms | ||
|
||
#include "ceres-error-terms/block-pose-prior-error-term-v2-inl.h" | ||
|
||
#endif // CERES_ERROR_TERMS_BLOCK_POSE_PRIOR_ERROR_TERM_V2_H_ |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,7 +1,7 @@ | ||
<?xml version="1.0" encoding="UTF-8"?> | ||
<package format="2"> | ||
<name>ceres_error_terms</name> | ||
<version>0.0.0</version> | ||
<version>2.2.0</version> | ||
<description>The ceres_error_terms package</description> | ||
<maintainer email="[email protected]">maplab-developers</maintainer> | ||
<license>Apache 2.0</license> | ||
|
29 changes: 29 additions & 0 deletions
29
algorithms/ceres-error-terms/src/block-pose-prior-error-term-v2.cc
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,29 @@ | ||
#include <memory> | ||
|
||
#include <Eigen/Core> | ||
#include <aslam/common/pose-types.h> | ||
#include <ceres-error-terms/common.h> | ||
#include <ceres-error-terms/parameterization/quaternion-param-jpl.h> | ||
#include <ceres/ceres.h> | ||
#include <ceres/sized_cost_function.h> | ||
|
||
#include "ceres-error-terms/block-pose-prior-error-term-v2.h" | ||
|
||
namespace ceres_error_terms { | ||
|
||
BlockPosePriorErrorTermV2::BlockPosePriorErrorTermV2( | ||
const aslam::Transformation& T_G_S_measured, | ||
const Eigen::Matrix<double, 6, 6>& covariance) | ||
: q_S_G_measured_( | ||
T_G_S_measured.getRotation().toImplementation().inverse()), | ||
p_G_S_measured_(T_G_S_measured.getPosition()) { | ||
// Getting inverse square root of covariance matrix. | ||
Eigen::Matrix<double, 6, 6> L = covariance.llt().matrixL(); | ||
sqrt_information_matrix_.setIdentity(); | ||
L.triangularView<Eigen::Lower>().solveInPlace(sqrt_information_matrix_); | ||
|
||
// inverse_orientation_prior_ = | ||
// Eigen::Quaterniond(orientation_prior_).inverse().coeffs(); | ||
} | ||
|
||
} // namespace ceres_error_terms |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
14 changes: 6 additions & 8 deletions
14
interfaces/voxblox_interface/CMakeLists.txt → ...truction/depth_integration/CMakeLists.txt
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,22 +1,20 @@ | ||
cmake_minimum_required (VERSION 2.8) | ||
project(voxblox_interface) | ||
project(depth_integration) | ||
|
||
find_package(catkin_simple REQUIRED) | ||
catkin_simple(ALL_DEPS_REQUIRED) | ||
|
||
add_definitions(--std=c++11) | ||
|
||
cs_add_library(${PROJECT_NAME} src/integration.cc) | ||
cs_add_library(${PROJECT_NAME} src/depth-integration.cc) | ||
|
||
SET(PROJECT_TEST_DATA "map_resources_test_data") | ||
add_custom_target(${PROJECT_TEST_DATA}) | ||
add_custom_command(TARGET ${PROJECT_TEST_DATA} | ||
COMMAND rm -rf "./${PROJECT_TEST_DATA}/*" && tar -xvzf ${MAPLAB_TEST_DATA_DIR}/${PROJECT_TEST_DATA}/${PROJECT_TEST_DATA}.tar.gz) | ||
|
||
catkin_add_gtest(test_voxblox_interface test/test-voxblox-interface.cc) | ||
target_link_libraries(test_voxblox_interface ${PROJECT_NAME}) | ||
maplab_import_test_maps(test_voxblox_interface) | ||
add_dependencies(test_voxblox_interface ${PROJECT_TEST_DATA}) | ||
catkin_add_gtest(test_voxblox_depth_integration test/test-voxblox-depth-integration.cc) | ||
target_link_libraries(test_voxblox_depth_integration ${PROJECT_NAME}) | ||
maplab_import_test_maps(test_voxblox_depth_integration) | ||
add_dependencies(test_voxblox_depth_integration ${PROJECT_TEST_DATA}) | ||
|
||
cs_install() | ||
cs_export() |
2 changes: 1 addition & 1 deletion
2
interfaces/voxblox_interface/README.md → ...econstruction/depth_integration/README.md
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,4 +1,4 @@ | ||
voxblox_interface | ||
depth_integration | ||
================= | ||
|
||
A collection of methods to integrate pointclouds into voxblox maps. |
Oops, something went wrong.