How do I retrieve the current package name from a cpp node?

asked 2017-02-10 06:59:48 -0500

VictorLamoine gravatar image

updated 2017-02-10 11:15:39 -0500

gvdhoorn gravatar image

ros::this_node::getName() allows me to know in which node my code is running but there is no package equivalent that would look lile ros::this_package::getName().

I would like to be able to programmatically know in which package my code is running.

Is there a solution or work-around?

edit retag flag offensive close merge delete


If it would be OK to get a hardcoded reference (ie: not something resolved at runtime), then perhaps my answer to #q341432 could be useful.

gvdhoorn gravatar image gvdhoorn  ( 2020-01-10 08:15:31 -0500 )edit