2#include <opencv2/core/core.hpp>
3#include <opencv2/features2d/features2d.hpp>
4#include "OrbTrackingInfo.h"
5#include "OrbSLAM/Headers/Optimizer.h"
6#include "OrbSLAM/Headers/Frame.h"
7#include "OrbSLAM/Headers/SLAMParameters.h"
8#include "OrbSLAM/Headers/ORBmatcher.h"
9#include "Base/Headers/Vector.hpp"
10#include <NDEVR/GlobalPosition.h>
54 EIGEN_MAKE_ALIGNED_OPERATOR_NEW
170 Frame m_pending_frame;
171 Frame m_current_frame;
173 Frame m_mono_initial_frame;
190 bool mbOnlyTracking =
false;
192 void reset(
bool bLocMap =
false);
193 void ResetActiveMap(
bool bLocMap =
false);
197 bool mFastInit =
false;
203 bool hugechangeornot(
const cv::Mat& depth1,
const cv::Mat& depth2);
207 void mergeImg(cv::Mat& dst, cv::Mat& src1, cv::Mat& src2);
211 void RGBDInitialiuliu();
212 void updateStateIMU();
221 void StereoInitialization();
224 void MonocularInitialization();
226 void CreateInitialMapMonocular();
228 void CheckReplacedInLastFrame();
230 void UpdateLastFrame();
232 bool PredictStateIMU();
236 void UpdateLocalMap();
237 void UpdateLocalPoints();
238 void UpdateLocalKeyFrames();
241 void SearchLocalPoints();
243 bool needsNewKeyFrame();
244 void createNewKeyFrame();
247 void preIntegrateIMU();
250 void ResetFrameIMU();
253 fltp08 m_last_sensor_pose_time = Constant<fltp08>::Invalid;
254 fltp08 m_sensor_pose_time = Constant<fltp08>::Invalid;
255 Sophus::SE3<g_type> m_sensor_pose;
256 Sophus::SE3<g_type> m_last_sensor_pose;
258 bool mbMapUpdated =
false;
261 IMU::Preintegrated* mpImuPreintegratedFromLastKF;
265 std::mutex m_mutex_imu_queue;
266 std::mutex m_mutex_gps_queue;
267 std::mutex m_mutex_current_image;
269 IMU::Calib* m_imu_calib;
292 bool m_mono_ready_to_initialize =
false;
304 Atlas* m_atlas =
nullptr;
316 uint04 mnFramesToResetIMU = 0;
321 fltp04 near_far_threshold = 0.0f;
324 fltp04 m_depth_map_factor = 1.0f;
327 uint04 mnMatchesInliers = 0;
330 KeyFrame* m_last_keyframe =
nullptr;
331 uint04 m_frame_id_of_last_kf = 0U;
332 uint04 mnLastRelocFrameId = 0U;
333 fltp08 m_time_stamp_lost = 0.0;
334 fltp08 time_recently_lost = 0.0;
336 uint04 mn_first_frame_ID = 0U;
337 uint04 mnInitialFrameId = 0U;
339 bool mbCreatedMap =
false;
342 bool mbVelocity =
false;
343 Sophus::SE3<g_type>::Tangent mVelocity;
348 const GlobalPosition* globalPositionOrigin;
349 bool m_set_global_pos_origin =
false;
350 GPSCalib mpGlobalMeasCalib;
359 uint04 m_last_monocular_ID = 0;
361 Sophus::SE3f m_stereo_tlr;
363 bool mInsertKFsLost =
false;
Manages a collection of maps for the ORB-SLAM system.
The equivelent of std::vector but with a bit more control.
Represents a single image frame with extracted features and pose information.
Abstract interface for geometric camera models (pinhole, fisheye, etc.).
A light-weight base class for Log that allows processes to update, without the need for additional in...
Database of keyframes for place recognition and relocalization.
A keyframe in the SLAM map, derived from Frame.
Manages local map building, keyframe processing, and local bundle adjustment.
A light-weight wrapper that will be a no-op if there is not a valid log reference,...
Detects and corrects loop closures and map merges.
Represents a single SLAM map containing keyframes and map points.
Matches ORB features between frames, keyframes, and map points.
Provides graph optimization routines for the ORB-SLAM system.
Main entry point for the ORB-SLAM3 system.
Configuration parameters for the ORB-SLAM system.
eTrackingState state() const
Returns the current tracking state.
bool parseIMUParamFile(const SLAMParameters ¶ms)
Parses IMU parameters from SLAM configuration.
void UpdateFrameIMU(fltp04 scale, const IMU::Bias &b, KeyFrame *pCurrentKeyFrame)
Updates frame IMU data after scale/bias refinement.
KeyFrame * GetLastKeyFrame()
Returns the last keyframe.
Sophus::SE3f GrabImageMonocular(OrbTrackingInfo &info)
Processes a monocular image and returns the estimated pose.
EIGEN_MAKE_ALIGNED_OPERATOR_NEW Tracking(OrbSLAM *pSys, ORBVocabulary *pVoc, Atlas *pAtlas, KeyFrameDatabase *pKFDB, const SLAMParameters ¶ms, LogPtr log)
Constructs the tracker.
Sophus::SE3f GrabImageRGBD(OrbTrackingInfo &info)
Processes an RGB-D frame and returns the estimated pose.
void setState(eTrackingState state)
Sets the tracking state.
eTrackingState
Tracking state enumeration.
@ OK
Tracking is successful.
@ OK_KLT
Tracking via KLT optical flow.
@ NOT_INITIALIZED
Map not yet initialized.
@ RECENTLY_LOST
Recently lost tracking.
@ SYSTEM_NOT_READY
System not yet ready.
@ NO_IMAGES_YET
No images have been received.
bool parseCamParamFile(const SLAMParameters ¶ms)
Parses camera parameters from SLAM configuration.
void CreateMapInAtlas()
Creates a new map in the Atlas.
void appendGPSData(const Buffer< GlobalPosition * > gps_measurements, fltp08 time_offset)
Appends GPS measurements to the processing queue.
void appendImuData(Buffer< IMU::Point > imu_measurements, fltp08 time_offset)
Appends IMU measurements to the processing queue.
bool ensureValidData(const cv::Mat &imRectLeft) const
Validates that the input image data is usable.
int GetMatchesInliers()
Returns the number of inlier matches in the current frame.
void SetLocalMapper(LocalMapping *pLocalMapper)
Sets the local mapper reference.
void InformOnlyTracking(bool flag)
Enables or disables localization-only tracking.
GlobalFrameAlignmentState
State of global frame alignment (GPS/global position).
@ NO_MEAS_YET
No global measurements received.
@ FIRST_GLOBAL_MEAS_SET
First global measurement has been set.
@ ALIGNING
Alignment in progress.
@ ALIGNED
Global alignment complete.
bool parseORBParamFile(const SLAMParameters ¶ms)
Parses ORB extractor parameters from SLAM configuration.
const Sensor & sensor() const
Returns the sensor configuration.
void SetLoopClosing(LoopClosing *pLoopClosing)
Sets the loop closer reference.
Sophus::SE3f GrabImageStereo(OrbTrackingInfo &info)
Processes a stereo image pair and returns the estimated pose.
void setParams(const SLAMParameters ¶ms)
Updates SLAM parameters.
A fixed-size array with N dimensions used as the basis for geometric and mathematical types.
The primary namespace for the NDEVR SDK.
float fltp04
Defines an alias representing a 4 byte floating-point number Bit layout is as follows: -Sign: 1 bit a...
TemplatedVocabulary< FORB::TDescriptor, FORB > ORBVocabulary
ORB visual vocabulary type for Bag-of-Words place recognition.
uint32_t uint04
-Defines an alias representing a 4 byte, unsigned integer -Can represent exact integer values 0 throu...
double fltp08
Defines an alias representing an 8 byte floating-point number.
Shared camera intrinsic and image metadata for frames.
Aggregates input and output data for a single tracking frame.
Describes the input sensor type and IMU usage.