Hi, I am struggling to #include my new Age.msg.
Age.msg is in topic_subscriber_pkg package under topic_subscriber_pkg/msg/Age.msg
I have tried
It just can’t seem to find it. Do I need the msg file to be in a seperate pkg to the cpp I am trying to include it in?
Thanks for contacting us and welcome to the Community!
The right way to include the message would be:
Please ensure that:
- You have carefully followed the instructions to create your custom message.
- You have run
- You have run
source ~/catkin_ws/devel/setup.bash on every terminal where you are trying to use the message. This is a common problem.
Please let us know.
Thank you for your response. Still having issues I am afraid. I have done the #include correctly. I have the source and have catkin_make also. If I use rosmsg info Age, I am getting the response showing the msg information. However the #include is still flagging that it cannot find the Age.h file! I have shown this below.
Thank you for the update.
Please ignore that flag and try to use your message and see. It might be a problem with the IDE. Sorry for the confusion.
We’ll look into why the IDE might be giving such false positives.
I seem to meet the same problem, the file can be successfully compiled and publish the data. I use the command source ~/catkin_ws/devel/setup.bash after catkin_make. While I have the error saying age.h not found. Have you found the reason to cause this issue?
Are you able to do
rosmsg info Age
If not, then your message is not properly compiled yet. Please go over the process to get it compiled again.
If you are able to show the message, is this preventing you from running the program? If not please ignore that warning for now (sorry for the trouble). We’ll look again into why the IDE is not recognizing the message.
I’m able to run rosmsg info Age and I’ll just ignore the flag.
Thanks for the help!