-
Notifications
You must be signed in to change notification settings - Fork 522
Closed
Labels
bugSomething isn't workingSomething isn't working
Description
Generated by Generative AI
No response
Operating System:
Ubuntu 24.04 (irrelevant)
ROS version or commit hash:
jazzy
RMW implementation (if applicable):
rmw_fastrtps_cpp
RMW Configuration (if applicable):
In wait_for_message.hpp, the wait set is default constructed so it uses the default global ros context. If an application is using a custom context and wants to use wait_for_message it can't. The global context must be initialized to use wait for message.
Client library (if applicable):
rclcpp
'ros2 doctor --report' output
ros2 doctor --report
<COPY OUTPUT HERE>Steps to reproduce issue
- Create a
rclcpp::Contextand initialize it - Create a node using that context
- Don't initialize the global context (ie don't call
rclcpp::init) - Call
rclcpp::wait_for_message(msg, node, topic, timeout, qos)
Expected behavior
Topic is waited on.
Actual behavior
Segfault as wait_set's context (global default) is not initialized.
Failed to create wait set: context argument is null, at ./src/rcl/wait.c:128
Additional information
The GuardCondition already uses the node's context, but the wait set is default constructed. It should be
rclcpp::WaitSet wait_set({}, {}, {}, {}, {}, {}, context);Reactions are currently unavailable
Metadata
Metadata
Assignees
Labels
bugSomething isn't workingSomething isn't working