Add use_online_imu_extrinsics_in_3d parameter and set it to true by default. (#1217)

Add the parameter `OptimizationProblemOptions.use_online_imu_extrinsincs_in_3d`. Set it to true by default to not change existing behavior.

Using online IMU extrinsics is not always desirable, and particularly during localization, we have determined that it is preferable to turn this feature off.
master
Arno Fleck 2018-07-02 13:40:21 +02:00 committed by Wally B. Feed
parent 22ea782fad
commit 7fcc4576a8
6 changed files with 13 additions and 1 deletions

View File

@ -129,6 +129,7 @@ class PoseGraph2DTest : public ::testing::Test {
fixed_frame_pose_translation_weight = 1e1, fixed_frame_pose_translation_weight = 1e1,
fixed_frame_pose_rotation_weight = 1e2, fixed_frame_pose_rotation_weight = 1e2,
log_solver_summary = true, log_solver_summary = true,
use_online_imu_extrinsics_in_3d = true,
ceres_solver_options = { ceres_solver_options = {
use_nonmonotonic_steps = false, use_nonmonotonic_steps = false,
max_num_iterations = 200, max_num_iterations = 200,

View File

@ -367,6 +367,10 @@ void OptimizationProblem3D::Solve(
problem.AddParameterBlock(trajectory_data.imu_calibration.data(), 4, problem.AddParameterBlock(trajectory_data.imu_calibration.data(), 4,
new ceres::QuaternionParameterization()); new ceres::QuaternionParameterization());
if (!options_.use_online_imu_extrinsics_in_3d()) {
problem.SetParameterBlockConstant(
trajectory_data.imu_calibration.data());
}
CHECK(imu_data_.HasTrajectory(trajectory_id)); CHECK(imu_data_.HasTrajectory(trajectory_id));
const auto imu_data = imu_data_.trajectory(trajectory_id); const auto imu_data = imu_data_.trajectory(trajectory_id);
CHECK(imu_data.begin() != imu_data.end()); CHECK(imu_data.begin() != imu_data.end());

View File

@ -49,6 +49,7 @@ class OptimizationProblem3DTest : public ::testing::Test {
fixed_frame_pose_translation_weight = 1e1, fixed_frame_pose_translation_weight = 1e1,
fixed_frame_pose_rotation_weight = 1e2, fixed_frame_pose_rotation_weight = 1e2,
log_solver_summary = true, log_solver_summary = true,
use_online_imu_extrinsics_in_3d = true,
ceres_solver_options = { ceres_solver_options = {
use_nonmonotonic_steps = false, use_nonmonotonic_steps = false,
max_num_iterations = 200, max_num_iterations = 200,

View File

@ -44,6 +44,8 @@ proto::OptimizationProblemOptions CreateOptimizationProblemOptions(
parameter_dictionary->GetDouble("fixed_frame_pose_rotation_weight")); parameter_dictionary->GetDouble("fixed_frame_pose_rotation_weight"));
options.set_log_solver_summary( options.set_log_solver_summary(
parameter_dictionary->GetBool("log_solver_summary")); parameter_dictionary->GetBool("log_solver_summary"));
options.set_use_online_imu_extrinsics_in_3d(
parameter_dictionary->GetBool("use_online_imu_extrinsics_in_3d"));
*options.mutable_ceres_solver_options() = *options.mutable_ceres_solver_options() =
common::CreateCeresSolverOptionsProto( common::CreateCeresSolverOptionsProto(
parameter_dictionary->GetDictionary("ceres_solver_options").get()); parameter_dictionary->GetDictionary("ceres_solver_options").get());

View File

@ -18,7 +18,7 @@ package cartographer.mapping.optimization.proto;
import "cartographer/common/proto/ceres_solver_options.proto"; import "cartographer/common/proto/ceres_solver_options.proto";
// NEXT ID: 18 // NEXT ID: 19
message OptimizationProblemOptions { message OptimizationProblemOptions {
// Scaling parameter for Huber loss function. // Scaling parameter for Huber loss function.
double huber_scale = 1; double huber_scale = 1;
@ -54,6 +54,9 @@ message OptimizationProblemOptions {
// 3D only: fix Z. // 3D only: fix Z.
bool fix_z_in_3d = 13; bool fix_z_in_3d = 13;
// 3D only: activate online IMU extrinsics.
bool use_online_imu_extrinsics_in_3d = 18;
// If true, the Ceres solver summary will be logged for every optimization. // If true, the Ceres solver summary will be logged for every optimization.
bool log_solver_summary = 5; bool log_solver_summary = 5;

View File

@ -72,6 +72,7 @@ POSE_GRAPH = {
fixed_frame_pose_translation_weight = 1e1, fixed_frame_pose_translation_weight = 1e1,
fixed_frame_pose_rotation_weight = 1e2, fixed_frame_pose_rotation_weight = 1e2,
log_solver_summary = false, log_solver_summary = false,
use_online_imu_extrinsics_in_3d = true,
ceres_solver_options = { ceres_solver_options = {
use_nonmonotonic_steps = false, use_nonmonotonic_steps = false,
max_num_iterations = 50, max_num_iterations = 50,