Constrain gravity to be positive. (#1756)

This makes sure gravity never flips the sign and becomes negative.

Signed-off-by: Wolfgang Hess <whess@lyft.com>
master
Wolfgang Hess 2020-10-07 11:48:53 +02:00 committed by GitHub
parent 1b31c017c4
commit ca8a866996
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
1 changed files with 3 additions and 0 deletions

View File

@ -441,6 +441,9 @@ void OptimizationProblem3D::Solve(
C_nodes.at(second_node_id).rotation(), C_nodes.at(second_node_id).rotation(),
trajectory_data.imu_calibration.data()); trajectory_data.imu_calibration.data());
} }
// Force gravity constant to be positive.
problem.SetParameterLowerBound(&trajectory_data.gravity_constant, 0, 0.0);
} }
} }