-
Notifications
You must be signed in to change notification settings - Fork 5
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
397cd9d
commit e95bdd4
Showing
13 changed files
with
2,229 additions
and
126 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
Large diffs are not rendered by default.
Oops, something went wrong.
Large diffs are not rendered by default.
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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1 @@ | ||
442644.940007 4428711.144783 40.834135 |
Empty file.
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
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,38 @@ | ||
#include <ceres/ceres.h> | ||
#include <Eigen/Dense> | ||
#include "util.h" | ||
|
||
class HeightFactor : public ceres::SizedCostFunction<1, 7> | ||
{ | ||
public: | ||
HeightFactor(const double &measure, const double & sensor_plane_to_body) : | ||
measure_(measure), sensor_plane_to_body_(sensor_plane_to_body) { | ||
sqrt_info = 100.0; | ||
} | ||
|
||
virtual bool Evaluate(double const *const *parameteres, double *residuals, double **jacobians) const { | ||
|
||
Eigen::Vector3d Pi = Eigen::Vector3d(parameteres[0][0], parameteres[0][1], parameteres[0][2]); | ||
Eigen::Quaterniond Qi = Eigen::Quaterniond(parameteres[0][6], parameteres[0][3], parameteres[0][4], parameteres[0][5]); | ||
|
||
double Pi_est = Pi.z() - sensor_plane_to_body_; | ||
|
||
residuals[0] = sqrt_info * (measure_ - Pi_est); | ||
|
||
if (jacobians) { | ||
Eigen::Matrix3d Ri = Qi.toRotationMatrix(); | ||
|
||
if (jacobians[0]) { | ||
Eigen::Map<Eigen::Matrix<double, 1, 7, Eigen::RowMajor> > jacobian_pose_i(jacobians[0]); | ||
jacobian_pose_i.setZero(); | ||
jacobian_pose_i(0, 2) = -1; | ||
jacobian_pose_i = sqrt_info * jacobian_pose_i; | ||
} | ||
} | ||
return true; | ||
} | ||
|
||
double measure_; | ||
double sensor_plane_to_body_; | ||
double sqrt_info; | ||
}; |
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
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
Oops, something went wrong.