How to assign the result returned by the bash command to the arg parameter or the param parameter?
When I use rtabmap_ros
, I need to specify the database save path.The feasible method is to use the following method to assign values in rtabmap node:
param name = "database_path" type = "string" value = "~ / .ros / rtabmap.db"
But I want to add the current time to the generated database file name.For example, when I execute date + '~ / rtabmap_databases / rtabmap_% Y-% m-% d-% Ih-% Mm-% Ss.db'
in bash, the screen prints ~ / rtabmap_databases / rtabmap_2020-01-10 -10h-02m-04s.db
. I want to pass this string to the database_path
parameter of rtabmap
node. Therefore, I use the following methods for parameter assignment:
param name="database_path" command="date +'~/rtabmap_databases/rtabmap_%Y-%m-%d-%Ih-%Mm-%Ss.db'"
but the following error occurs:
[FATAL] (2020-01-10 10:12:27.004) Rtabmap.cpp:298::init() Condition (UFile::getExtension(_databasePath).compare("db") == 0) not met!