mirror of
https://github.com/introlab/rtabmap.git
synced 2026-10-03 16:47:47 +08:00
fixing home dir
This commit is contained in:
@@ -5001,7 +5001,14 @@ void Rtabmap::setMemoryThreshold(int maxMemoryAllowed)
|
|||||||
|
|
||||||
void Rtabmap::setWorkingDirectory(std::string path)
|
void Rtabmap::setWorkingDirectory(std::string path)
|
||||||
{
|
{
|
||||||
path = uReplaceChar(path, '~', UDirectory::homeDir());
|
// Expand leading "~" to the user's home directory (shell convention).
|
||||||
|
// We do NOT replace every "~" in the path -- Windows 8.3 short names
|
||||||
|
// embed "~" in the middle (e.g. C:\Users\RUNNER~1\...), and a blanket
|
||||||
|
// uReplaceChar would corrupt those.
|
||||||
|
if(!path.empty() && path[0] == '~')
|
||||||
|
{
|
||||||
|
path = UDirectory::homeDir() + path.substr(1);
|
||||||
|
}
|
||||||
if(!path.empty() && UDirectory::exists(path))
|
if(!path.empty() && UDirectory::exists(path))
|
||||||
{
|
{
|
||||||
ULOGGER_DEBUG("Comparing new working directory path \"%s\" with \"%s\"", path.c_str(), _wDir.c_str());
|
ULOGGER_DEBUG("Comparing new working directory path \"%s\" with \"%s\"", path.c_str(), _wDir.c_str());
|
||||||
|
|||||||
Reference in New Issue
Block a user