global header file.

asked 2014-06-13 18:05:29 -0500

Dpp_coder gravatar image

updated 2014-06-14 16:19:46 -0500

I wanted to make a header in cpp that just contains all my topics names as "const string"s. I want this header file to be visible globally to all stacks and packages. What is the best way to do this?

edit retag flag offensive close merge delete

Comments

I don't think there is one way to do this. Why do you need that header, for which purpose ? It would help to know that kind of things to give a solution.

Maya gravatar image Maya  ( 2014-06-15 10:43:37 -0500 )edit

@Maya I wanted to store all my topic names as strings in a .h file so that I'll able be using it for two or more packages instead of defining the topic names in a cpp file this would be better.

Dpp_coder gravatar image Dpp_coder  ( 2014-06-15 11:00:57 -0500 )edit

This is not how you usually do it. I don't really think it's going to make your projects any easier and people will not be able to use them because of that. Usually one define a very generic topic name and then use remapping (either in launch file or command line) to rename them.

Maya gravatar image Maya  ( 2014-06-15 11:30:05 -0500 )edit

okay! but is there a way to do that?

Dpp_coder gravatar image Dpp_coder  ( 2014-06-15 12:42:09 -0500 )edit

Not that I know.

Maya gravatar image Maya  ( 2014-06-15 13:07:59 -0500 )edit