fix bug in scanid computing
parent
c7cc12fab2
commit
7584eee1f9
|
@ -1,3 +1,4 @@
|
|||
/.vscode
|
||||
/.log
|
||||
*.pcd
|
||||
/build
|
6
main.cc
6
main.cc
|
@ -1,3 +1,4 @@
|
|||
#include <pcl/io/pcd_io.h>
|
||||
#include <pcl_conversions/pcl_conversions.h>
|
||||
#include <ros/ros.h>
|
||||
#include <sensor_msgs/PointCloud2.h>
|
||||
|
@ -44,6 +45,7 @@ void PointCloudHandler(const sensor_msgs::PointCloud2ConstPtr& msg,
|
|||
OhMyLoam* const slam) {
|
||||
PointCloud cloud;
|
||||
pcl::fromROSMsg(*msg, cloud);
|
||||
AINFO << "Timestamp = " << LOG_TIMESTAMP(msg->header.stamp.toSec());
|
||||
slam->Run(cloud, 0.0);
|
||||
double timestamp = msg->header.stamp.toSec();
|
||||
AINFO << "Timestamp = " << LOG_TIMESTAMP(timestamp);
|
||||
slam->Run(cloud, timestamp);
|
||||
}
|
|
@ -3,15 +3,7 @@
|
|||
namespace oh_my_loam {
|
||||
|
||||
int ExtractorVLP16::GetScanID(const Point& pt) const {
|
||||
double omega = std::atan2(pt.z, Distance(pt)) * 180 * M_1_PI + 15.0;
|
||||
// static int i = 0;
|
||||
// if (i++ < 10) {
|
||||
// ADEBUG << "OMEGA: " << std::atan2(pt.z, Distance(pt)) * 180 * M_1_PI
|
||||
// + 15.0
|
||||
// << " id = " << static_cast<int>(std::round(omega / 2.0) + 0.01)
|
||||
// << " z = " << pt.z << " "
|
||||
// << " d = " << Distance(pt) << std::endl;
|
||||
// }
|
||||
double omega = std::atan2(pt.z, std::hypot(pt.x, pt.y)) * 180 * M_1_PI + 15.0;
|
||||
return static_cast<int>(std::round(omega / 2.0) + 1.e-5);
|
||||
};
|
||||
|
||||
|
|
Loading…
Reference in New Issue