Skip to content
Snippets Groups Projects

WIP: Resolve "Eigen::Matrix::cast<ceres::Jet>() not needed if upgrading to Eigen 3.3"

2 files
+ 5
12
Compare changes
  • Side-by-side
  • Inline
Files
2
@@ -104,26 +104,19 @@ inline bool FactorDiffDrive::operator ()(const T* const _p1, const T* const _o1,
@@ -104,26 +104,19 @@ inline bool FactorDiffDrive::operator ()(const T* const _p1, const T* const _o1,
Eigen::Map<const Eigen::Matrix<T, INTRINSICS_SIZE, 1> > c(_c);
Eigen::Map<const Eigen::Matrix<T, INTRINSICS_SIZE, 1> > c(_c);
// Compute corrected delta
/// Is this my delta_preint ? Yes!
// Correct delta due to changes in the calibration parameters
const Eigen::Matrix<T, 3, 1> delta_preint = getMeasurement().cast<T>();
auto delta_corrected = getMeasurement() + J_delta_calib_ * (c - calib_preint_);
Matrix<T, 3, 1> c_preint = calib_preint_.cast<T>();
Eigen::Matrix<T, 3, 1> delta_corrected = delta_preint + J_delta_calib_.cast<T>() * (c - c_preint);
// 2d pose residual
 
// Predict delta from states
Eigen::Matrix<T, 3, 1> delta_predicted;
Eigen::Matrix<T, 3, 1> delta_predicted;
// position
// position
delta_predicted.head(2) = Eigen::Rotation2D<T>(-_o1[0]) * (p2 - p1);
delta_predicted.head(2) = Eigen::Rotation2D<T>(-_o1[0]) * (p2 - p1);
// orientation
// orientation
delta_predicted(2) = pi2pi(_o2[0] - _o1[0]);
delta_predicted(2) = pi2pi(_o2[0] - _o1[0]);
// residual
// 2d pose residual
residuals = delta_corrected - delta_predicted;
residuals = delta_corrected - delta_predicted;
// angle remapping
// angle remapping
Loading