armarx::localization_and_mapping::cartographer_adapter::util Namespace Reference

Functions

int64_t fromCarto (::cartographer::common::Time time)
 Convert cartographer time to unix time in [µs]. More...
 
std::unique_ptr<::cartographer::mapping::MapBuilderInterface > loadMap (const std::filesystem::path &mapPath, const std::filesystem::path &configPath)
 Creates a map builder object from a stored map. More...
 
std::unique_ptr<::cartographer::common::LuaParameterDictionary > resolveLuaParameters (const std::string &luaCode, const std::filesystem::path &configPath)
 Helper function to create Lua parameter object from string. More...
 
::cartographer::common::Time toCarto (const int64_t &time)
 Convert unix time in [µs] to cartographer time. More...
 

Function Documentation

◆ fromCarto()

int64_t fromCarto ( ::cartographer::common::Time  time)

Convert cartographer time to unix time in [µs].

Parameters
timecartographer time
Returns
int64_t time in [µs]

Definition at line 22 of file cartographer_utils.cpp.

◆ loadMap()

std::unique_ptr<::cartographer::mapping::MapBuilderInterface > loadMap ( const std::filesystem::path &  mapPath,
const std::filesystem::path &  configPath 
)

Creates a map builder object from a stored map.

Parameters
mapPathThe path to the map (e.g. /path/to/map.carto)
configPathThe path where the lua config files reside.
Returns
std::unique_ptr<cartographer::mapping::MapBuilderInterface>

Definition at line 45 of file cartographer_utils.cpp.

+ Here is the call graph for this function:
+ Here is the caller graph for this function:

◆ resolveLuaParameters()

std::unique_ptr<::cartographer::common::LuaParameterDictionary > resolveLuaParameters ( const std::string &  luaCode,
const std::filesystem::path &  configPath 
)

Helper function to create Lua parameter object from string.

Example:

 const std::string mapBuilderLuaCode = R"text(
       include "map_builder.lua"
       return MAP_BUILDER)text";

 auto paramsDict = resolveLuaParameters(mapBuilderLuaCode, ...);
Parameters
luaCodeThe lua code that will be evaluated.
configPathThe path where the lua config files reside.
Returns
std::unique_ptr<::cartographer::common::LuaParameterDictionary>

Definition at line 11 of file cartographer_utils.cpp.

+ Here is the caller graph for this function:

◆ toCarto()

cartographer::common::Time toCarto ( const int64_t &  time)

Convert unix time in [µs] to cartographer time.

Parameters
timein [µs]
Returns
::cartographer::common::Time

Definition at line 35 of file cartographer_utils.cpp.