ros-foxglove-bridge: Assertion error on read_callback_ in roscpp for ROS1 bridge

Description

We’re getting an assertion error when running the ROS1 bridge

FATAL] [1716982265.933923467]: ASSERTION FAILED
        file = ./clients/roscpp/src/libros/connection.cpp
        line = 274
        cond = !read_callback_
  • Version: 0.77 (15df09892cc2cbea0dd6efc8c53e4f01e0881511)
  • Platform: linux x86_64 (ubuntu jammy)

Steps To Reproduce

Compile and start the ROS1 bridge.

Expected Behavior

This assertion should not be triggered.

We found that when debugging the assertion is not immediately triggered. If we add “sufficient” sleep before the call to getConnection(), the assertion is not triggered, and the ROS1 bridge works, we can get a connection. However at some point later in time we still get the same assertion.

--- ros1_foxglove_bridge/src/service_utils.cpp
+++ ros1_foxglove_bridge/src/service_utils.cpp
@@ -1,5 +1,6 @@
 #include <chrono>
 #include <future>
+#include <thread>
 
 #include <ros/connection.h>
 #include <ros/service_manager.h>
@@ -12,6 +13,10 @@ namespace foxglove_bridge {
 std::string retrieveServiceType(const std::string& serviceName, std::chrono::milliseconds timeout) {
   auto link = ros::ServiceManager::instance()->createServiceServerLink(serviceName, false, "*", "*",
                                                                        {{"probe", "1"}});
+
+  // Wait for connection to be ready
+  std::this_thread::sleep_for(std::chrono::milliseconds(100));
+
   if (!link) {
     throw std::runtime_error("Failed to create service link");
   } else if (!link->getConnection()) {

About this issue

  • Original URL
  • State: closed
  • Created 2 years ago
  • Comments: 18

Commits related to this issue

Most upvoted comments

Just so you know. I am working on trying out. I have some stuff I need to take care of first, but I will test it by today.

Can you run it with --screen, so roslaunch --screen agv_init agv_websocket.launch &> log.txt ?

Sorry, I mis-wrote. I did run it this way.

@achim-k Hi, I am getting the same error. However, I am running on ARM (zcu104 board). Its been a while since I tried running it, so I don’t know any specifics anymore. But I can try running it again tomorrow and see.