45 SLAMScanWrapper::SLAMScanWrapper(
ScanPtr scan)
46 : m_scan(scan), m_deltaPose(
Transformd::Identity())
58 #pragma omp parallel for schedule(static) 97 double sqDist = minDistance * minDistance;
102 if (
m_points[cur].squaredNorm() <= sqDist)
117 double sqDist = maxDistance * maxDistance;
122 if (
m_points[cur].squaredNorm() >= sqDist)
144 Vector4d extended(p.x(), p.y(), p.z(), 1.0);
145 return (
pose() * extended).block<3, 1>(0, 0);
160 return m_scan->registration;
170 return m_scan->poseEstimation;
175 return pose().block<3, 1>(0, 3);
196 for (
const std::pair<Transformd, FrameUse>&
frame :
m_frames)
198 for (
int i = 0; i < 16; i++)
200 out <<
frame.first(i) <<
" ";
203 out << (int)
frame.second << endl;
const std::pair< Transformd, FrameUse > & frame(size_t index) const
Returns a Frame consisting of a Pose and a FrameUse.
int octreeReduce(Vector3f *points, int n, double voxelSize, int maxLeafSize)
Reduces a Point Cloud using an Octree with a minimum Voxel size.
virtual void transform(const Transformd &transform, bool writeFrame=true, FrameUse use=FrameUse::UPDATED)
Applies a relative Transformation to the Scan.
virtual Vector3d point(size_t index) const
Returns the Point at the specified index in global Coordinates.
void setMaxDistance(double maxDistance)
Reduces the Scan by removing all Points farther away than maxDistance to the origin.
Eigen::Vector3d Vector3d
Eigen 3D vector, double precision.
std::shared_ptr< Scan > ScanPtr
Shared pointer to scans.
Transform< double > Transformd
4x4 double precision transformation matrix
void setMinDistance(double minDistance)
Reduces the Scan by removing all Points closer than minDistance to the origin.
Vector3d getPosition() const
Get the Position of the Scan. Can also be obtained from pose()
std::vector< Vector3f > m_points
Eigen::Vector3f Vector3f
Eigen 3D vector, single precision.
const Transformd & pose() const
Returns the current Pose of the Scan.
ScanPtr innerScan()
Access to the Scan that this instance is wrapped around.
void reduce(double voxelSize, int maxLeafSize)
Reduces the Scan using Octree Reduction.
boost::shared_array< float > floatArr
size_t numPoints() const
Returns the number of Points in the Scan.
Eigen::Vector4d Vector4d
Eigen 4D vector, double precision.
size_t frameCount() const
Returns the number of Frames generated.
const Vector3f & rawPoint(size_t index) const
Returns the Point at the specified index in local Coordinates.
const Transformd & initialPose() const
Returns the initial Pose of the Scan.
void writeFrame(const Transform< T > &transform, const boost::filesystem::path &framesOut)
Writes a Eigen transformation into a .frames file.
const Transformd & deltaPose() const
Returns the difference between pose() and initialPose()
void addFrame(FrameUse use=FrameUse::UNUSED)
Adds a new animation Frame with the current Pose.
std::vector< std::pair< Transformd, FrameUse > > m_frames
FrameUse
Annotates the use of a Scan when creating an slam6D .frames file.
void trim()
Reduces Memory usage by getting rid of Points removed with reduction Methods.
void writeFrames(std::string path) const
Writes the Frames to the specified location.