non-Catkin build: subscriber can't find msg headers (but can find others)
Dear all,
I'm quite an experienced user of ROS and am used to write ROS applications, however I'm having an issue that I haven't been able to solve yet, and it is really bothering me, I'll explain:
I'm writing a new application, and can successfully have a proper subscriber for the /clock topic working, even though that my IDE claims that #include <rosgraph_msgs/Clock.h> is an unresolved inclusion
just like /ros/ros.h
as instance.
When I try to include my header for a custom made .msg (tested in other applications already), my IDE claims that it is, as well, an unresolved inclusion. However, in this case it doesn't even let me successfully compile:
ROSTrafGen.h:87:31: error: ‘ros_its_msgs’ does not name a type
void SensorCallback(const ros_its_msgs::Sensor &msg);
^~~~~~~~~~~~
ROSTrafGen.h:87:52: error: expected unqualified-id before ‘&’ token
void SensorCallback(const ros_its_msgs::Sensor &msg);
^
ROSTrafGen.h:87:52: error: expected ‘)’ before ‘&’ token
ROSTrafGen.h:87:52: error: expected ‘;’ at end of member declaration
ROSTrafGen.h:87:53: error: ‘msg’ does not name a type
void SensorCallback(const ros_its_msgs::Sensor &msg);
Any idea on why this is happening?
Thanks in advance. Best regards
which IDE?
It is an external tool's dedicated IDE, based of on Eclipse...
Have you ever setup the environment for Eclipse to be able to support code completion? Something like this?
I didn't. As I said, it's a external (has no ROS dependency) tool that uses a dedicated IDE for its projects building and launching... Already did a similar integration between both frameworks, however, t relied on cmake for compiling purposes. This time, this project is done using Makefile environments. This shouldn't be an issue, since I already tested some subscriptions (i.e /clock) under this environment
Well the problem would seem to be one where the IDE is unaware of the include paths it would need to be able to resolve your includes and parse the headers.
I'm not sure how you would fix that with your toolset, but that is something you'd have to setup.
This would be no different from how you would have your IDE be able to code-complete and parse from other libraries. Just that ROS is typically installed into locations that are not on the default search paths, leading to the requirement of telling your IDE where it should look for these headers.
I have my include and library paths all specified correctly during compilation, if not, i wouldn't be able to even make the /clock subscription. So, i'm not worried about what the IDE displays regarding ROS integration, what i'm worried about is on the reason why I can easily subscribe to one topic, while not being able to do it to other one with a different .msg type...
So just for my understanding:
Makefile
s, not CatkinIs this a correct summary?
Exactly! That's a perfect summary of this issue, while adding the strange behaviour of this working 100% for one kind of messages..