how to load the configuration file in package in ros2
Hi !
I’m writing a package that needs to read a configuration file .(like .yaml
)
I useinstall(FILES xxx.yaml DESTINATION share/${PROJECT_NAME})
to copy the configuration file to the path : /shr/package-name
But i have no idea how to get the right relative path to load it
i’m using the absolute path
to read the file now but i want to make it relative so the package can be used in different environment .
looking forward to some suggestions !
I want to know the same thing, but it sounds like you know something I don't know. When you say you use
install(...)
what are you talking about? Isinstall()
a method of some python module? Where did you get it, or more precisely, how can I use it?Ohhh... Found it myself... Use
install()
in CMakelists.txt. Good to know, thanks...