Skip to content
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

roscpp: Empty connection header topic #543

Closed
tonybaltovski opened this issue Jan 3, 2015 · 4 comments
Closed

roscpp: Empty connection header topic #543

tonybaltovski opened this issue Jan 3, 2015 · 4 comments
Labels

Comments

@tonybaltovski
Copy link

I am trying to use a driver that reads the name of the incoming topic from the connection header. When I publish data from a C++ node, it is always empty but when I use rostopic pub or python it works just fine. Is there a way to ensure the connection header is populated?

OS: Ubuntu 14.04

ROS:indigo 1.11.9

roscpp: 1.11.9-0trusty-20141029-0127-+0000

roscpp_core: 0.5.4-0trusty-20140724-0053-+0000

The subscriber is in C++ and is here

Here is the code in python and the C++ node

@wjwwood
Copy link
Member

wjwwood commented Jan 5, 2015

I can confirm what @tonybaltovski is describing, I used this package: https://github.com/wjwwood/conn_header_test

When listening (from C++) to a talker in Python I get something like this:

[INFO] [WallTime: 1420488403.278505] Publishing 'hello world 9' on topic '/chatter'
Header:
  callerid has value /talker_71570_1420488402228
  latching has value 0
  md5sum has value 992ce8a1687cec8c8bd883ec73ca41d1
  message_definition has value string data


  topic has value /chatter
  type has value std_msgs/String
[ INFO] [1420488403.292841000]: I heard: [hello world 9]

When the talker is C++, the topic filed is missing from the connection header:

[ INFO] [1420487965.160992000]: Publishing 'hello world 9' on topic '/chatter'
Header:
  callerid has value /talker
  latching has value 0
  md5sum has value 992ce8a1687cec8c8bd883ec73ca41d1
  message_definition has value string data

  type has value std_msgs/String
[ INFO] [1420487965.162136000]: I heard: [hello world 9]

I don't see anything in the documentation which indicates that this should be the case.

@gerkey
Copy link
Contributor

gerkey commented Apr 2, 2015

Also, thanks much to @wjwwood for the easy-to-use test case.

@wjwwood
Copy link
Member

wjwwood commented Apr 3, 2015

Also, thanks much to @wjwwood for the easy-to-use test case.

Sure, no problem. Like my mom always said: "Do unto others".

dirk-thomas added a commit that referenced this issue Apr 3, 2015
Pass through the topic field of an incoming connection header, issue #543.
@dirk-thomas dirk-thomas added the bug label Apr 3, 2015
@tonybaltovski
Copy link
Author

Thanks guys!

rsinnet pushed a commit to MisoRobotics/ros_comm that referenced this issue Jun 19, 2017
Pass through the topic field of an incoming connection header, issue ros#543.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

No branches or pull requests

4 participants