format all .h .cc files
parent
76dfa7f447
commit
12054bf10f
|
@ -21,9 +21,7 @@ class Pose3d {
|
|||
Pose3d(const double *const r_quat, const double *const t_vec)
|
||||
: r_quat_(r_quat), t_vec_(t_vec) {}
|
||||
|
||||
static Pose3d Identity() { return {}; }
|
||||
|
||||
void setIdentity() {
|
||||
void SetIdentity() {
|
||||
r_quat_.setIdentity();
|
||||
t_vec_.setZero();
|
||||
}
|
||||
|
@ -79,11 +77,15 @@ class Pose3d {
|
|||
|
||||
// const Eigen::Quaterniond& r_quat() const { return r_quat_; }
|
||||
|
||||
Eigen::Quaterniond r_quat() const { return r_quat_; }
|
||||
Eigen::Quaterniond r_quat() const {
|
||||
return r_quat_;
|
||||
}
|
||||
|
||||
// const Eigen::Vector3d& t_vec() const { return t_vec_; }
|
||||
|
||||
Eigen::Vector3d t_vec() const { return t_vec_; }
|
||||
Eigen::Vector3d t_vec() const {
|
||||
return t_vec_;
|
||||
}
|
||||
|
||||
protected:
|
||||
Eigen::Quaterniond r_quat_; // orientation/rotation
|
||||
|
|
|
@ -9,9 +9,13 @@ double NormalizeAngle(double ang) {
|
|||
return ang - two_pi * std::floor((ang + M_PI) / two_pi);
|
||||
}
|
||||
|
||||
double Degree2Rad(double degree) { return degree * M_PI / 180.0; }
|
||||
double Degree2Rad(double degree) {
|
||||
return degree * M_PI / 180.0;
|
||||
}
|
||||
|
||||
double Rad2Degree(double rad) { return rad * 180.0 / M_PI; }
|
||||
double Rad2Degree(double rad) {
|
||||
return rad * 180.0 / M_PI;
|
||||
}
|
||||
|
||||
const std::vector<int> Range(int begin, int end, int step) {
|
||||
ACHECK(step != 0) << "Step must non-zero";
|
||||
|
@ -23,6 +27,8 @@ const std::vector<int> Range(int begin, int end, int step) {
|
|||
return seq;
|
||||
}
|
||||
|
||||
const std::vector<int> Range(int end) { return Range(0, end, 1); }
|
||||
const std::vector<int> Range(int end) {
|
||||
return Range(0, end, 1);
|
||||
}
|
||||
|
||||
} // namespace common
|
|
@ -9,9 +9,13 @@ namespace common {
|
|||
|
||||
class Timer {
|
||||
public:
|
||||
Timer() { Tic(); }
|
||||
Timer() {
|
||||
Tic();
|
||||
}
|
||||
|
||||
void Tic() { start_ = std::chrono::system_clock::now(); }
|
||||
void Tic() {
|
||||
start_ = std::chrono::system_clock::now();
|
||||
}
|
||||
|
||||
// unit: 's' = second, 'm' = millisecond, 'u' = microsecond
|
||||
double Toc(char unit = 'm');
|
||||
|
|
|
@ -55,7 +55,9 @@ class LidarVisualizer {
|
|||
is_updated_ = true;
|
||||
}
|
||||
|
||||
std::string name() const { return name_; }
|
||||
std::string name() const {
|
||||
return name_;
|
||||
}
|
||||
|
||||
protected:
|
||||
void Run() {
|
||||
|
|
|
@ -12,7 +12,7 @@ extractor_config:
|
|||
sharp_corner_point_num: 2
|
||||
corner_point_num: 20
|
||||
flat_surf_point_num: 4
|
||||
surf_point_num: 20
|
||||
surf_point_num: 50
|
||||
corner_point_curvature_th: 0.5
|
||||
surf_point_curvature_th: 0.5
|
||||
neighbor_point_dist_th: 0.1
|
||||
|
|
|
@ -18,7 +18,9 @@ class Extractor {
|
|||
void Process(double timestamp, const common::PointCloudConstPtr &cloud,
|
||||
std::vector<Feature> *const features);
|
||||
|
||||
int num_scans() const { return num_scans_; }
|
||||
int num_scans() const {
|
||||
return num_scans_;
|
||||
}
|
||||
|
||||
protected:
|
||||
virtual int GetScanID(const common::Point &pt) const = 0;
|
||||
|
|
|
@ -7,7 +7,9 @@ namespace oh_my_loam {
|
|||
// for VLP-16
|
||||
class ExtractorVLP16 : public Extractor {
|
||||
public:
|
||||
ExtractorVLP16() { num_scans_ = 16; }
|
||||
ExtractorVLP16() {
|
||||
num_scans_ = 16;
|
||||
}
|
||||
|
||||
private:
|
||||
int GetScanID(const common::Point &pt) const override;
|
||||
|
|
|
@ -22,14 +22,14 @@ bool Odometer::Init() {
|
|||
}
|
||||
|
||||
void Odometer::Process(double timestamp, const std::vector<Feature> &features,
|
||||
Pose3d *const pose) {
|
||||
Pose3d *const pose_out) {
|
||||
BLOCK_TIMER_START;
|
||||
if (!is_initialized_) {
|
||||
UpdatePre(features);
|
||||
is_initialized_ = true;
|
||||
pose_curr2last_ = Pose3d::Identity();
|
||||
pose_curr2world_ = Pose3d::Identity();
|
||||
*pose = Pose3d::Identity();
|
||||
pose_curr2last_.SetIdentity();
|
||||
pose_curr2world_.SetIdentity();
|
||||
pose_out->SetIdentity();
|
||||
AWARN << "Odometer initialized....";
|
||||
return;
|
||||
}
|
||||
|
@ -59,7 +59,7 @@ void Odometer::Process(double timestamp, const std::vector<Feature> &features,
|
|||
solver.Solve(5, verbose_, &pose_curr2last_);
|
||||
}
|
||||
pose_curr2world_ = pose_curr2world_ * pose_curr2last_;
|
||||
*pose = pose_curr2world_;
|
||||
*pose_out = pose_curr2world_;
|
||||
AINFO_IF(verbose_) << "Pose increase: " << pose_curr2last_.ToString();
|
||||
AINFO_IF(verbose_) << "Pose after: " << pose_curr2world_.ToString();
|
||||
UpdatePre(features);
|
||||
|
|
|
@ -16,7 +16,7 @@ class Odometer {
|
|||
bool Init();
|
||||
|
||||
void Process(double timestamp, const std::vector<Feature> &features,
|
||||
common::Pose3d *const pose);
|
||||
common::Pose3d *const pose_out);
|
||||
|
||||
protected:
|
||||
void UpdatePre(const std::vector<Feature> &features);
|
||||
|
@ -41,6 +41,8 @@ class Odometer {
|
|||
|
||||
std::vector<TPointCloudPtr> clouds_corn_pre_;
|
||||
std::vector<TPointCloudPtr> clouds_surf_pre_;
|
||||
TPointCloudPtr corn_pre_;
|
||||
TPointCloudPtr surf_pre_;
|
||||
|
||||
std::vector<pcl::KdTreeFLANN<TPoint>> kdtrees_surf_;
|
||||
std::vector<pcl::KdTreeFLANN<TPoint>> kdtrees_corn_;
|
||||
|
|
Loading…
Reference in New Issue