-
Notifications
You must be signed in to change notification settings - Fork 72
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Gencpp bug in Hydro #21
Comments
I just ran a simple test with a message that ONLY contains a Header and the .h file created by gencpp leaves out the HasHeader template that message filters use. |
Actually, looking further this may be a bug in genmsg. |
Can you please describe in more detail what you are trying to do, what the current result/behavior is and what you are expecting instead? At best with an easy to reproduce example. |
Easy to see the issue:
ros message_filter policies like ExactTime and ApproximateTime use HasHeader() to determine whether or not the message has a header field that can be synched to another message. Without the HasHeader template (which is in sensors_msgs/Image.h for example) these policies will not compile. So any non-standard ros message that includes a header field is no longer usable with the message_filter synchronization. This used to not be the case (don't know how long ago, but at some point in the past) |
When I build the following message which has a header field: the generated code contains the
So do the currently generated Debian packages: e.g. the file |
Well I'm just using ros-hydro-desktop-full install on precise 12.04, so I On Wednesday, October 15, 2014, Dirk Thomas notifications@github.com
|
Please provide a complete sequence of commands you invoke, including all exact sources, which might allow to reproduce the problem you are facing. |
|
@pbeeson Please use a gist.github.com or format your code into a code block when posting something like this. For example, I have tried to reproduce what you were talking about myself: https://gist.github.com/wjwwood/489ffcc4ecca797b54b3 However, I was using catkin and not rosbuild as you appear to be (these are the kinds of details we need to know in order to help out). I think @dirk-thomas is going to try and reproduce your issue with rosbuild. |
|
I can also verify that this behavior DOES NOT happen when using catkin. It only occurs when using rosbuild. But lots of people still use rosbuild for various reasons. |
With Anyway this is definitely not a As far as I am aware the May be you could describe in detail what you actually want to do with the |
Look up the Time Synchorinzer examples. Plug in that Test.msg to any example instead of Image and PointCloud. When using rosbuild, essentially you get the EXACT same compile error as if you tried to set up a Time Synchronizer for a pair of messages that had no header at all. http://answers.ros.org/question/84456/trying-to-write-test-pgm-for-timesync/ But I DO have a header. This used to work, so maybe This is a pretty big problem in my opinion. Essentially, I can only use custom messages with the message filter synchronizers if I use catkin (or go in and manually add these HasHeader template lines to headers), which is impractical for many of my projects (controlled by large governmental agencies or third parties) that still use rosbuild. BTW, I CAN actually get this working by adding the two HasHeader templates to my node's header, but that's SUPER inconvient when tools like rosbuild exist and worked (at least in Fuerte). Maybe move over to an issue with |
Also, I'm on travel in Sweden, so I will soon be out of contact for the night, as I'm 9 hours ahead of you guys at OSRF. Hopefully you have enough info to look into this further. I'll just assume this will be fixed and in the repo by the time I wake up ;) Thanks!! |
GOT IT!!!! When using rosbuild, it works if the message has this line: It's a parsing error. (I knew I had used this before.) |
When I try this example (http://wiki.ros.org/message_filters#Example_.28C.2B-.2B-.29-1) it fails to compile with the following error:
Do you have a custom definition of the template specialization for your message type? Btw |
Yep that's the error. If you use the Test.msg from above (that had only I wonder if this fragile parse has been in rosbuild forever? Usually I leave off That one |
That is indeed the reason. I have never seen any example using Since you can easily work around it by using:
instead of:
I won't do a new release of the package in question but schedule it only for the next patch release. I will close this ticket. Thank you for the help looking into it. |
I was having an issue with compiling when using the message-filter sync policies with custom messages that all contain std-msgs/Header fields. Poking around further, it became clear that the .h file generated for my custom messages do not have HasHeader templates. Cutting and pasting the HasHeader() template from Sensor-msgs/Image.h and changing the names, my code compiles. Look like this is a bug in gencpp for hydro???
The text was updated successfully, but these errors were encountered: