28 #ifndef DBDRIVERSQLITE3_H_ 29 #define DBDRIVERSQLITE3_H_ 33 #include <opencv2/features2d/features2d.hpp> 45 virtual void parseParameters(
const ParametersMap & parameters);
46 virtual bool isInMemory()
const {
return getUrl().empty() || _dbInMemory;}
47 void setDbInMemory(
bool dbInMemory);
48 void setJournalMode(
int journalMode);
49 void setCacheSize(
unsigned int cacheSize);
50 void setSynchronous(
int synchronous);
51 void setTempStore(
int tempStore);
54 virtual bool connectDatabaseQuery(
const std::string & url,
bool overwritten =
false);
55 virtual void disconnectDatabaseQuery(
bool save =
true,
const std::string & outputUrl =
"");
56 virtual bool isConnectedQuery()
const;
57 virtual unsigned long getMemoryUsedQuery()
const;
58 virtual bool getDatabaseVersionQuery(std::string & version)
const;
59 virtual long getNodesMemoryUsedQuery()
const;
60 virtual long getLinksMemoryUsedQuery()
const;
61 virtual long getImagesMemoryUsedQuery()
const;
62 virtual long getDepthImagesMemoryUsedQuery()
const;
63 virtual long getCalibrationsMemoryUsedQuery()
const;
64 virtual long getGridsMemoryUsedQuery()
const;
65 virtual long getLaserScansMemoryUsedQuery()
const;
66 virtual long getUserDataMemoryUsedQuery()
const;
67 virtual long getWordsMemoryUsedQuery()
const;
68 virtual long getFeaturesMemoryUsedQuery()
const;
69 virtual long getStatisticsMemoryUsedQuery()
const;
70 virtual int getLastNodesSizeQuery()
const;
71 virtual int getLastDictionarySizeQuery()
const;
72 virtual int getTotalNodesSizeQuery()
const;
73 virtual int getTotalDictionarySizeQuery()
const;
75 virtual std::map<std::string, float> getStatisticsQuery(
int nodeId,
double & stamp, std::vector<int> * wmState)
const;
76 virtual std::map<int, std::pair<std::map<std::string, float>,
double> > getAllStatisticsQuery()
const;
77 virtual std::map<int, std::vector<int> > getAllStatisticsWmStatesQuery()
const;
79 virtual void executeNoResultQuery(
const std::string & sql)
const;
81 virtual void getWeightQuery(
int signatureId,
int & weight)
const;
83 virtual void saveQuery(
const std::list<Signature *> & signatures);
84 virtual void saveQuery(
const std::list<VisualWord *> & words)
const;
85 virtual void updateQuery(
const std::list<Signature *> & signatures,
bool updateTimestamp)
const;
86 virtual void updateQuery(
const std::list<VisualWord *> & words,
bool updateTimestamp)
const;
88 virtual void addLinkQuery(
const Link & link)
const;
89 virtual void updateLinkQuery(
const Link & link)
const;
91 virtual void updateOccupancyGridQuery(
93 const cv::Mat & ground,
94 const cv::Mat & obstacles,
95 const cv::Mat & empty,
97 const cv::Point3f & viewpoint)
const;
99 virtual void updateDepthImageQuery(
101 const cv::Mat & image)
const;
103 void updateLaserScanQuery(
107 virtual void addStatisticsQuery(
const Statistics & statistics,
bool saveWmState)
const;
108 virtual void savePreviewImageQuery(
const cv::Mat & image)
const;
109 virtual cv::Mat loadPreviewImageQuery()
const;
110 virtual void saveOptimizedPosesQuery(
const std::map<int, Transform> & optimizedPoses,
const Transform & lastlocalizationPose)
const;
111 virtual std::map<int, Transform> loadOptimizedPosesQuery(
Transform * lastlocalizationPose = 0)
const;
112 virtual void save2DMapQuery(
const cv::Mat & map,
float xMin,
float yMin,
float cellSize)
const;
113 virtual cv::Mat load2DMapQuery(
float & xMin,
float & yMin,
float & cellSize)
const;
114 virtual void saveOptimizedMeshQuery(
115 const cv::Mat & cloud,
116 const std::vector<std::vector<std::vector<RTABMAP_PCL_INDEX> > > & polygons,
117 #
if PCL_VERSION_COMPARE(>=, 1, 8, 0)
118 const std::vector<std::vector<Eigen::Vector2f, Eigen::aligned_allocator<Eigen::Vector2f> > > & texCoords,
120 const std::vector<std::vector<Eigen::Vector2f> > & texCoords,
122 const cv::Mat & textures)
const;
123 virtual cv::Mat loadOptimizedMeshQuery(
124 std::vector<std::vector<std::vector<RTABMAP_PCL_INDEX> > > * polygons,
125 #
if PCL_VERSION_COMPARE(>=, 1, 8, 0)
126 std::vector<std::vector<Eigen::Vector2f, Eigen::aligned_allocator<Eigen::Vector2f> > > * texCoords,
128 std::vector<std::vector<Eigen::Vector2f> > * texCoords,
130 cv::Mat * textures)
const;
133 virtual void loadQuery(
VWDictionary * dictionary,
bool lastStateOnly =
true)
const;
134 virtual void loadLastNodesQuery(std::list<Signature *> & signatures)
const;
135 virtual void loadSignaturesQuery(
const std::list<int> & ids, std::list<Signature *> & signatures)
const;
136 virtual void loadWordsQuery(
const std::set<int> & wordIds, std::list<VisualWord *> & vws)
const;
137 virtual void loadLinksQuery(
int signatureId, std::multimap<int, Link> & links,
Link::Type type =
Link::kUndef)
const;
139 virtual void loadNodeDataQuery(std::list<Signature *> & signatures,
bool images=
true,
bool scan=
true,
bool userData=
true,
bool occupancyGrid=
true)
const;
140 virtual bool getCalibrationQuery(
int signatureId, std::vector<CameraModel> & models, std::vector<StereoCameraModel> & stereoModels)
const;
141 virtual bool getLaserScanInfoQuery(
int signatureId,
LaserScan & info)
const;
142 virtual bool getNodeInfoQuery(
int signatureId,
Transform & pose,
int & mapId,
int & weight, std::string & label,
double & stamp,
Transform & groundTruthPose, std::vector<float> & velocity,
GPS & gps,
EnvSensors & sensors)
const;
143 virtual void getLastNodeIdsQuery(std::set<int> & ids)
const;
144 virtual void getAllNodeIdsQuery(std::set<int> & ids,
bool ignoreChildren,
bool ignoreBadSignatures,
bool ignoreIntermediateNodes)
const;
145 virtual void getAllLinksQuery(std::multimap<int, Link> & links,
bool ignoreNullLinks,
bool withLandmarks)
const;
146 virtual void getLastIdQuery(
const std::string & tableName,
int &
id,
const std::string & fieldName=
"id")
const;
147 virtual void getInvertedIndexNiQuery(
int signatureId,
int & ni)
const;
148 virtual void getNodesObservingLandmarkQuery(
int landmarkId, std::map<int, Link> & nodes)
const;
149 virtual void getNodeIdByLabelQuery(
const std::string & label,
int &
id)
const;
150 virtual void getAllLabelsQuery(std::map<int, std::string> & labels)
const;
153 std::string queryStepNode()
const;
154 std::string queryStepImage()
const;
155 std::string queryStepDepth()
const;
156 std::string queryStepDepthUpdate()
const;
157 std::string queryStepScanUpdate()
const;
158 std::string queryStepSensorData()
const;
159 std::string queryStepLinkUpdate()
const;
160 std::string queryStepLink()
const;
161 std::string queryStepWordsChanged()
const;
162 std::string queryStepKeypoint()
const;
163 std::string queryStepGlobalDescriptor()
const;
164 std::string queryStepOccupancyGridUpdate()
const;
166 void stepImage(
sqlite3_stmt * ppStmt,
int id,
const cv::Mat & imageBytes)
const;
168 void stepDepthUpdate(
sqlite3_stmt * ppStmt,
int nodeId,
const cv::Mat & imageCompressed)
const;
172 void stepWordsChanged(
sqlite3_stmt * ppStmt,
int signatureId,
int oldWordId,
int newWordId)
const;
173 void stepKeypoint(
sqlite3_stmt * ppStmt,
int nodeID,
int wordId,
const cv::KeyPoint & kp,
const cv::Point3f & pt,
const cv::Mat & descriptor)
const;
177 const cv::Mat & ground,
178 const cv::Mat & obstacles,
179 const cv::Mat & empty,
181 const cv::Point3f & viewpoint)
const;
184 void loadLinksQuery(std::list<Signature *> & signatures)
const;
185 int loadOrSaveDb(
sqlite3 *pInMemory,
const std::string & fileName,
int isSave)
const;
struct sqlite3_stmt sqlite3_stmt
std::map< std::string, std::string > ParametersMap
virtual bool isInMemory() const
unsigned long _memoryUsedEstimate
std::map< EnvSensor::Type, EnvSensor > EnvSensors