Go to the documentation of this file.
40 "rtabmap-globalBundleAdjustment database.db\n"
55 for(
int i=1;
i<argc-1; ++
i)
57 if(std::strcmp(
argv[
i],
"--help") == 0)
64 std::string dbPath =
argv[argc-1];
67 printf(
"Database %s doesn't exist!\n", dbPath.c_str());
77 printf(
"Database is too old (%s), we cannot save back optimized poses. "
78 "Consider upgrading the database with:\n"
79 "rtabmap-reprocess --Db/TargetVersion \"\" \"%s\" \"output.db\"\n",
95 UERROR(
"Cannot open database %s!", dbPath.c_str());
99 for(ParametersMap::iterator
iter=inputParams.begin();
iter!=inputParams.end(); ++
iter)
101 printf(
"Added custom parameter %s=%s\n",
iter->first.c_str(),
iter->second.c_str());
106 printf(
"Loading database \"%s\"...\n", dbPath.c_str());
109 uInsert(parameters, inputParams);
110 rtabmap.init(parameters, dbPath);
111 printf(
"Loading database \"%s\"... done (%fs).\n", dbPath.c_str(),
timer.ticks());
113 std::map<int, Signature>
nodes;
114 std::map<int, Transform> optimizedPoses;
115 std::multimap<int, Link> links;
116 printf(
"Optimizing the map...\n");
117 rtabmap.getGraph(optimizedPoses, links,
true,
true, &
nodes,
true,
true,
true,
true);
118 printf(
"Optimizing the map... done (%fs, poses=%d).\n",
timer.ticks(), (
int)optimizedPoses.size());
120 printf(
"Global bundle adjustment...\n");
122 optimizedPoses = optimizer->
optimizeBA(optimizedPoses.lower_bound(1)->first, optimizedPoses, links,
nodes,
true);
124 printf(
"Global bundle adjustment... done (%fs).\n",
timer.ticks());
126 if(!optimizedPoses.empty())
128 rtabmap.setOptimizedPoses(optimizedPoses, links);
132 UERROR(
"Returned empty poses!");
ParametersMap getLastParameters() const
virtual std::map< int, Transform > optimizeBA(int rootId, const std::map< int, Transform > &poses, const std::multimap< int, Link > &links, const std::map< int, std::vector< CameraModel > > &models, std::map< int, cv::Point3f > &points3DMap, const std::map< int, std::map< int, FeatureBA > > &wordReferences, std::set< int > *outliers=0)
bool openConnection(const std::string &url, bool overwritten=false)
static ParametersMap parseArguments(int argc, char *argv[], bool onlyParameters=false)
static void setLevel(ULogger::Level level)
static Optimizer * create(const ParametersMap ¶meters)
std::map< std::string, std::string > ParametersMap
void save2DMap(const cv::Mat &map, float xMin, float yMin, float cellSize) const
void uInsert(std::map< K, V > &map, const std::pair< K, V > &pair)
int uStrNumCmp(const std::string &a, const std::string &b)
std::string getDatabaseVersion() const
static void setType(Type type, const std::string &fileName=kDefaultLogFileName, bool append=true)
static const char * showUsage()
int main(int argc, char *argv[])
iterator iter(handle obj)
Wrappers of STL for convenient functions.
void closeConnection(bool save=true, const std::string &outputUrl="")
void saveOptimizedMesh(const cv::Mat &cloud, const std::vector< std::vector< std::vector< RTABMAP_PCL_INDEX > > > &polygons=std::vector< std::vector< std::vector< RTABMAP_PCL_INDEX > > >(), const std::vector< std::vector< Eigen::Vector2f > > &texCoords=std::vector< std::vector< Eigen::Vector2f > >(), const cv::Mat &textures=cv::Mat()) const
static DBDriver * create(const ParametersMap ¶meters=ParametersMap())
rtabmap
Author(s): Mathieu Labbe
autogenerated on Thu Jul 25 2024 02:50:12