ros2 / ros2/rclcpp

std::runtime_error what(): 'data' is empty with component container multithread

Open
#2,423 10 comments 0 reactions 0 assignees View on GitHub

Nobody has claimed this yet.

more-information-needed
Dominant language
C++
Stars
805
Forks
564
Avg merge
1d 17h
Merged PRs (30d)
27

Description

My setup:

  • Operating System:
    • Ubuntu 22.04
  • Installation type:
    • ROS2 Iron from source
  • Version or commit hash:
  • DDS implementation:
    • rmw_fastrtps_cpp
  • Client library (if applicable):
    • rclcpp

I am developing a state estimation application based on fuse package on my robot. I would like to have two separate callback groups, a dedicated one for a rclpp::Timer here, and the node default one for handling callbacks from rclcpp::Subscriptions. In order for the two to work in parallel, I would like to use a multithreaded executor with num_threads = 2. However, when I launch my node inside a component_container_mt it shuts down with the following error:

[component_container_mt-3] terminate called after throwing an instance of 'std::runtime_error' [component_container_mt-3] what(): 'data' is empty

I am running into this issue while deploying the package on my robot architecture, which is a VersaLogic Copperhead VL-EBX-41.

Contributor guide

Open the contributing guide

First steps

  1. Read the whole issue, then the project's contributing guide.
  2. Comment on the issue to say you are picking it up — it saves two people doing the same work.
  3. Fork the repository and make your change on a branch.
  4. Open a pull request that references the issue number.

Research direction

Start by reviewing the linked fuse_optimizers/src/fixed_lag_smoother.cpp timer setup and reproduce the failure in a ROS 2 Iron component_container_mt using rclcpp and rmw_fastrtps_cpp. Trace the source of the 'data' is empty exception; done means identifying the multithreaded component-container failure and providing a verified fix or a minimal reproducible case.

Written by the indexing model from the issue text.

Assessment

Tech stack
cpp
Domain
robotics
Issue type
Bug
Difficulty
4/5
Estimated time
3-5 days
Activity status
Stale
Clarity
Needs clarification
Newbie friendliness
35/100

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.