Hi,
I'm trying to use msgs from the current package. So usually it's like this, when I'm using a different package:
#include package_name/msg_name
pub_ = nh_.advertise<project_name::msg_name>("topic", 1);
But I'm trying to use the msg I created in the same project package Let's say my package name is first_package and msg is first_msg, but doing so:
#include first_package/first_msg
pub_ = nh_.advertise<first_project::first_msg>("topic", 1);
Doesnt seem to work. Well why should I import something that is already in my package. What is the correct syntax here?
Originally posted by RosFan19 on ROS Answers with karma: 107 on 2015-05-14
Post score: 0
Original comments
Comment by gvdhoorn on 2015-05-15:
It is always a good idea to include verbatim any error messages or warnings that you receive. Just stating that it doesn't work is making it really difficult for us to help you.
Comment by gvdhoorn on 2015-05-15:
Also: for almost all msg pkgs, the package_name
is used as the namespace for the messages, so in your example package_name
and project_name
should probably be identical?
Comment by Reiner on 2015-06-02:
I know, it's not a big help, but it may be worthwhile to move your message definition to a separate package (see ros best practices).
Also, try simply copying the tutorial (see tutorials understanding topics) and analysing the differences, helps me usually.