Robotics StackExchange | Archived questions

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

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?

Asked by VictorLamoine on 2017-02-10 07:59:48 UTC

Comments

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.

Asked by gvdhoorn on 2020-01-10 09:15:31 UTC

Answers