question-mark
Stuck on an issue?

Lightrun Answers was designed to reduce the constant googling that comes with debugging 3rd party libraries. It collects links to all the places you might be looking at while hunting down a tough bug.

And, if you’re still stuck at the end, we’re happy to hop on a call to see how we can help out.

Studio publisher does not connect to C++ subscriber (ROS1 live connection)

See original GitHub issue

When publishing messages via Studio, python subscribers can receive the messages no problem. But a subscriber written using C++ does not receive messages.

  • Version: Studio 1.4.0
  • OS: Ubuntu (but i don’t think this matters)
  • ROS 1, live connection, all on one host

Steps To Reproduce

  1. Create a simple ROS subscriber in C++
    • I just used the one from the ROS tutorials: Writing the Subscriber Node
    • Any time it receives a message on /chatter, it writes it as a WARN message to the log
  2. Launch the subscriber node
  3. Verify the subscriber works – run rostopic pub /chatter std_msgs/String "data: 'hi from rostopic pub'" and check that the message shows up in the log
  4. Launch Studio
  5. Attempt to send a message via Studio

Expected Behavior

  • The message is received by the C++ subscriber, and shows up in the log.

Actual Behavior

  • No message is received
  • There is an error in the node log: Failed to contact publisher [hostname:43047] for topic [/chatter] – this is the foxglove studio publisher

Screenshots and logs

Selection_999(352)

Full node log:

1648577826.702250150  Node Startup
1648577826.710711478 DEBUG /chatter_listener [/tmp/binarydeb/ros-melodic-roscpp-1.14.10/src/libros/subscription.cpp:244(Subscription::pubUpdate)] [topics: /rosout] Publisher update for [/chatter]:  already have these connections: 
1648577826.930959538 DEBUG /chatter_listener [/tmp/binarydeb/ros-melodic-roscpp-1.14.10/src/libros/transport/transport_tcp.cpp:645(TransportTCPPtr ros::TransportTCP::accept)] [topics: /rosout] Accepted connection on socket [7], new socket [11]
1648577826.931075062 DEBUG /chatter_listener [/tmp/binarydeb/ros-melodic-roscpp-1.14.10/src/libros/transport/transport_tcp.cpp:142(TransportTCP::initializeSocket)] [topics: /rosout] Adding tcp socket [11] to pollset
1648577826.931091639 DEBUG /chatter_listener [/tmp/binarydeb/ros-melodic-roscpp-1.14.10/src/libros/connection_manager.cpp:188(ConnectionManager::tcprosAcceptConnection)] [topics: /rosout] TCPROS received a connection from [127.0.0.1:57050]
1648577826.931134390 DEBUG /chatter_listener [/tmp/binarydeb/ros-melodic-roscpp-1.14.10/src/libros/connection_manager.cpp:203(ConnectionManager::onConnectionHeaderReceived)] [topics: /rosout] Connection: Creating TransportSubscriberLink for topic [/rosout] connected to [callerid=[/rosout] address=[TCPROS connection on port 45159 to [127.0.0.1:57050 on socket 11]]]
1648577829.534235544 DEBUG /chatter_listener [/tmp/binarydeb/ros-melodic-roscpp-1.14.10/src/libros/topic_manager.cpp:561(TopicManager::pubUpdate)] [topics: /rosout] Received update for topic [/chatter] (1 publishers)
1648577829.534251940 DEBUG /chatter_listener [/tmp/binarydeb/ros-melodic-roscpp-1.14.10/src/libros/subscription.cpp:244(Subscription::pubUpdate)] [topics: /rosout] Publisher update for [/chatter]: http://mimir:44265/,  already have these connections: 
1648577829.534336646 DEBUG /chatter_listener [/tmp/binarydeb/ros-melodic-roscpp-1.14.10/src/libros/subscription.cpp:421(Subscription::negotiateConnection)] [topics: /rosout] Began asynchronous xmlrpc connection to [mimir:44265]
1648577829.734995483 DEBUG /chatter_listener [/tmp/binarydeb/ros-melodic-roscpp-1.14.10/src/libros/subscription.cpp:509(Subscription::pendingConnectionDone)] [topics: /rosout] Connecting via tcpros to topic [/chatter] at host [mimir:35493]
1648577829.735163047 DEBUG /chatter_listener [/tmp/binarydeb/ros-melodic-roscpp-1.14.10/src/libros/transport/transport_tcp.cpp:326(TransportTCP::connect)] [topics: /rosout] Resolved publisher host [mimir] to [127.0.1.1] for socket [13]
1648577829.735217721 DEBUG /chatter_listener [/tmp/binarydeb/ros-melodic-roscpp-1.14.10/src/libros/transport/transport_tcp.cpp:142(TransportTCP::initializeSocket)] [topics: /rosout] Adding tcp socket [13] to pollset
1648577829.735234714 DEBUG /chatter_listener [/tmp/binarydeb/ros-melodic-roscpp-1.14.10/src/libros/transport/transport_tcp.cpp:365(TransportTCP::connect)] [topics: /rosout] Async connect() in progress to [mimir:35493] on socket [13]
1648577829.735284236 DEBUG /chatter_listener [/tmp/binarydeb/ros-melodic-roscpp-1.14.10/src/libros/subscription.cpp:525(Subscription::pendingConnectionDone)] [topics: /rosout] Connected to publisher of topic [/chatter] at [mimir:35493]
1648577829.736062366 WARN /chatter_listener [/home/jessica/dev/personal/ros_tutorials/catkin_ws/src/beginner_tutorials/src/listener.cpp:6(chatterCallback)] [topics: /rosout] I heard: [hi from rostopic pub]
1648577837.847345296 DEBUG /chatter_listener [/tmp/binarydeb/ros-melodic-roscpp-1.14.10/src/libros/topic_manager.cpp:561(TopicManager::pubUpdate)] [topics: /rosout] Received update for topic [/chatter] (2 publishers)
1648577837.847374225 DEBUG /chatter_listener [/tmp/binarydeb/ros-melodic-roscpp-1.14.10/src/libros/subscription.cpp:244(Subscription::pubUpdate)] [topics: /rosout] Publisher update for [/chatter]: http://mimir:44265/, http://mimir:43047/,  already have these connections: http://mimir:44265/, 
1648577837.847490289 DEBUG /chatter_listener [/tmp/binarydeb/ros-melodic-roscpp-1.14.10/src/libros/subscription.cpp:421(Subscription::negotiateConnection)] [topics: /rosout] Began asynchronous xmlrpc connection to [mimir:43047]
1648577838.049727037 DEBUG /chatter_listener [/tmp/binarydeb/ros-melodic-roscpp-1.14.10/src/libros/xmlrpc_manager.cpp:208(XMLRPCManager::validateXmlrpcResponse)] [topics: /rosout] XML-RPC call [requestTopic] didn't return an array
1648577838.049748993 DEBUG /chatter_listener [/tmp/binarydeb/ros-melodic-roscpp-1.14.10/src/libros/subscription.cpp:471(Subscription::pendingConnectionDone)] [topics: /rosout] Failed to contact publisher [mimir:43047] for topic [/chatter]

Topic info:

mimir:~$ rostopic info /chatter
Type: std_msgs/String

Publishers: 
 * /rostopic_31441_1648577829324 (http://mimir:44265/)
 * /foxglovestudio_31584 (http://mimir:43047/)

Subscribers: 
 * /chatter_listener (http://mimir:40991/)
 * /foxglovestudio_31584 (http://mimir:43047/)

Issue Analytics

  • State:closed
  • Created a year ago
  • Comments:17 (9 by maintainers)

github_iconTop GitHub Comments

1reaction
jhurlimancommented, Apr 25, 2022
1reaction
jhurlimancommented, Apr 22, 2022

@jessicaaustin I just updated my examples/ros1-chatter to use @foxglove/xmlrpc 1.2.0 instead of 1.1.9 and I can reproduce your issue now. Looking into the actual cause now, thank you!

Read more comments on GitHub >

github_iconTop Results From Across the Web

[ROS Q&A] 190 - How to subscribe with a C++ ... - The Construct
In the post, you will learn how to create a C++ subscriber to a custom msg array published with Python publisher. This answers...
Read more >
How do subscriber - publisher communicate each other?
Instead, both the subscriber and publisher will be connecting to the ROS master.
Read more >
Combine Publisher and Subscriber in a Closed Loop System
In this ROS tutorial you will learn how to combine a publisher and a subscriber in the same node, so that you can...
Read more >
Message definitions at runtime ("on-the-wire") #1159 - GitHub
When a subscriber connects to a publisher, the publisher sends the message definition for the topic.
Read more >
ROS node subscription not connected - Stack Overflow
This means that your node roscpp_pcl_example is subscribed to a topic /camera/depth/points nobody is actually publishing.
Read more >

github_iconTop Related Medium Post

No results found

github_iconTop Related StackOverflow Question

No results found

github_iconTroubleshoot Live Code

Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free

github_iconTop Related Reddit Thread

No results found

github_iconTop Related Hackernoon Post

No results found

github_iconTop Related Tweet

No results found

github_iconTop Related Dev.to Post

No results found

github_iconTop Related Hashnode Post

No results found