-
Notifications
You must be signed in to change notification settings - Fork 417
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
std::runtime_error what(): 'data' is empty with component container multithread #2423
Comments
Can you please provide some example code that shows the problem? That would help a lot in debugging this. |
It's difficult to provide a simple example since fuse is a quite articulated package and a lot of its subsytems are needed to reproduce. I can try to explain better: There is a main node, the optimizer, which during construction:
During plugins initialization, a new executor and callback group are created with the same context as the main node, and a new thread is started to let the executor spin. The process can be found here: https://github.com/giafranchini/fuse/blob/25b4b9ec4a36886a726f661818cbff4abeebb7d4/fuse_core/src/async_sensor_model.cpp#L59 |
|
I setted up a minimal example in which I am able to reproduce the error. Please follow these steps:
This will run a simple example using bags already available in the package. container_fuse = ComposableNodeContainer(
name='container_fuse',
namespace='',
package='rclcpp_components',
executable='component_container_mt',
composable_node_descriptions=[
ComposableNode(
package='fuse_optimizers',
plugin='fuse_optimizers::FixedLagSmootherComponent',
name='state_estimator',
parameters=[PathJoinSubstitution([
pkg_dir, 'config', 'fuse_simple_tutorial.yaml'
])],
extra_arguments=[{'use_intra_process_comms': True}],
),
],
output='both',
) |
@giafranchini could you also provide a backtrace for the error? |
Sure, here it is:
I also noticed that the error does not show up immediately every time I launch the container: sometimes the node is able to run for some small time before dying with the same error. |
@giafranchini that's not a backtrace, but just the console log. |
Sorry, here it is:
|
I'm seeing this also with Ubuntu 22.04, ROS Iron from ubuntu binaries, and the multi-threaded executor.
@giafranchini, found a work-around other than not using the multi-threaded executor? I have my own thread publishing JointStates -- is that problematic? |
@dsandber I found out that in my application there is a class which inherits from |
My setup:
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 fromrclcpp::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 acomponent_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.
The text was updated successfully, but these errors were encountered: