Go to the documentation of this file.
47 _dataBufferMaxSize(
Parameters::defaultRtabmapImageBufferSize()),
48 _rate(
Parameters::defaultRtabmapDetectionRate()),
49 _createIntermediateNodes(
Parameters::defaultRtabmapCreateIntermediateNodes()),
50 _frameRateTimer(new
UTimer()),
131 UDEBUG(
"optimized=%s, full=%s, graphOnly=%s", optimized?
"true":
"false",
full?
"true":
"false", graphOnly?
"true":
"false");
134 std::map<int, Signature> signatures;
135 std::map<int, Transform> poses;
136 std::multimap<int, Link> constraints;
137 std::map<int, int> mapIds;
138 std::map<int, double> stamps;
139 std::map<int, std::string>
labels;
140 std::map<int, std::vector<unsigned char> > userDatas;
159 UERROR(
"Rtabmap is null!");
168 UERROR(
"Cannot start rtabmap thread if no rtabmap object is set! Stopping the thread...");
222 UWARN(
"Closing... %d data still buffered! They will be cleared.", (
int)
_dataBuffer.size());
302 UERROR(
"Failed to find a node with label \"%s\".", cmdEvent.
value1().
toStr().c_str());
312 UERROR(
"Failed to set a goal. ID (%d) should be positive > 0",
id);
317 UERROR(
"Failed to compute a path to goal %d.",
id);
343 if(id <= 0 || !_rtabmap->labelLocation(
id,
""))
359 UFATAL(
"Invalid state !?!?");
374 else if(event->
getClassName().compare(
"SensorEvent") == 0)
386 if(
e->info().odomVelocity.size() == 6)
389 e->info().odomVelocity[0],
390 e->info().odomVelocity[1],
391 e->info().odomVelocity[2],
392 e->info().odomVelocity[3],
393 e->info().odomVelocity[4],
394 e->info().odomVelocity[5]);
413 else if(event->
getClassName().compare(
"OdometryEvent") == 0)
426 else if(event->
getClassName().compare(
"UserDataEvent") == 0)
434 if(!
e->data().empty())
442 UWARN(
"New user data received before the last one was processed... replacing "
443 "user data with this new one. Note that UserDataEvent should be used only "
444 "if the rate of UserDataEvent is lower than RTAB-Map's detection rate (%f Hz).",
_rate);
448 else if(event->
getClassName().compare(
"RtabmapEventCmd") == 0)
453 else if(event->
getClassName().compare(
"ParamEvent") == 0)
476 stats.addStatistic(Statistics::kMemoryImages_buffered(), (
float)
_dataBuffer.size());
489 UERROR(
"RTAB-Map is not initialized! Ignoring received data...");
500 bool ignoreFrame =
false;
515 UWARN(
"Odometry is reset (identity pose detected). Increment map id! (stamp=%fs)", odomEvent.
data().
stamp());
519 UWARN(
"Odometry is reset (high variance (%f >=9999 detected, stamp=%fs). Increment map id!", odomEvent.
info().
reg.
covariance.at<
double>(0,0), odomEvent.
data().
stamp());
540 else if(!ignoreFrame)
561 tmp.
setFeatures(std::vector<cv::KeyPoint>(), std::vector<cv::Point3f>(), cv::Mat());
575 ULOGGER_WARN(
"Data buffer is full, the oldest data is removed to add the new one.");
596 bool dataFilled =
false;
597 bool triggerNewMap =
false;
618 triggerNewMap =
true;
bool acquire(int n=1, int ms=0)
bool isIncremental() const
static void removeHandler(UEventsHandler *handler)
virtual bool handleEvent(UEvent *anEvent)
const Transform & pose() const
void setDataBufferSize(unsigned int bufferSize)
std::vector< int > toIntArray(bool *ok=0) const
const Memory * getMemory() const
const UVariant & value3() const
void join(bool killFirst=false)
RecoveryProgressState state
int getSignatureIdByLabel(const std::string &label, bool lookInDatabase=true) const
void close(bool databaseSaved, const std::string &databasePath="")
void getGraph(std::map< int, Transform > &poses, std::multimap< int, Link > &constraints, bool optimized, bool global, std::map< int, Signature > *signatures=0, bool withImages=false, bool withScan=false, bool withUserData=false, bool withGrid=false, bool withWords=true, bool withGlobalDescriptors=true) const
void setDetectorRate(float rate)
void addNodesToRepublish(const std::vector< int > &ids)
#define ULOGGER_DEBUG(...)
void pushNewState(State newState, const RtabmapEventCmd &cmdEvent=RtabmapEventCmd(RtabmapEventCmd::kCmdUndef))
static bool parse(const ParametersMap ¶meters, const std::string &key, bool &value)
const UVariant & value2() const
void createIntermediateNodes(bool enabled)
const UVariant & value1() const
std::vector< std::string > labels
const Statistics & getStatistics() const
bool _createIntermediateNodes
const UVariant & value4() const
virtual std::string getClassName() const =0
bool computePath(int targetNode, bool global)
void exportPoses(const std::string &path, bool optimized, bool global, int format)
Some conversion functions.
void clearPath(int status)
#define UASSERT(condition)
const OdometryInfo & info() const
std::list< OdometryEvent > _dataBuffer
OdometryInfo copyWithoutData() const
void generateDOTGraph(const std::string &path, int id=0, int margin=5)
void setFeatures(const std::vector< cv::KeyPoint > &keypoints, const std::vector< cv::Point3f > &keypoints3D, const cv::Mat &descriptors)
unsigned int _dataBufferMaxSize
void init(const ParametersMap ¶meters, const std::string &databasePath="", bool loadDatabaseParameters=false)
Point2(* f)(const Point3 &, OptionalJacobian< 2, 3 >)
int getPathStatus() const
static void registerCurrentThread(const std::string &name)
Array< double, 1, 3 > e(1./3., 0.5, 2.)
std::string toStr(bool *ok=0) const
ULogger class and convenient macros.
const std::vector< std::pair< int, Transform > > & getPath() const
void publishMap(bool optimized, bool full, bool graphOnly) const
const ParametersMap & getParameters() const
void parseParameters(const ParametersMap ¶meters)
std::queue< State > _state
bool process(const SensorData &data, Transform odomPose, const cv::Mat &odomCovariance=cv::Mat::eye(6, 6, CV_64FC1), const std::vector< float > &odomVelocity=std::vector< float >(), const std::map< std::string, float > &externalStats=std::map< std::string, float >())
Main loop of rtabmap.
Wrappers of STL for convenient functions.
void close(bool databaseSaved=true, const std::string &ouputDatabasePath="")
bool getData(OdometryEvent &data)
void addData(const OdometryEvent &odomEvent)
virtual void mainLoopKill()
void dumpPrediction() const
std::list< double > _newMapEvents
virtual void mainLoopBegin()
RtabmapThread(Rtabmap *rtabmap)
bool uIsFinite(const T &value)
int toInt(bool *ok=0) const
bool labelLocation(int id, const std::string &label)
#define ULOGGER_WARN(...)
std::queue< RtabmapEventCmd > _stateParam
#define ULOGGER_INFO(...)
void post(UEvent *event, bool async=true) const
rtabmap
Author(s): Mathieu Labbe
autogenerated on Thu Jul 25 2024 02:50:15