Feature Request: Dynamic Type Handling for Generic Subscriptions
Maintainer thường phản hồi trong vòng 1 ngày
@Barry-Xu-2018 đang làm issue này rồi.
Từ ngày 22/6/2024.
Đánh giá
Issue này chưa được đánh giá.
Mô tả
Feature request
Feature description
I am developing an application where I need to subscribe to topics with unknown message types (similar to rosbag2). In the subscription callback, I need access to the deserialized message and its fields without knowing the type in advance.
There is a related example here, but it requires specifying the type (T2) beforehand. I am looking for a way to use only the topic type as a string to dynamically obtain the message class.
Using snippets here and there from rclcpp I put together this incomplete example:
node->create_generic_subscription(
topic_name,
topic_type,
qos,
[this, topic_name, topic_type](std::shared_ptr<const rclcpp::SerializedMessage> message,
const rclcpp::MessageInfo & mi) {
void* deserialized_msg = nullptr;
auto ts_lib = rclcpp::get_typesupport_library(topic_type, "rosidl_typesupport_cpp");
auto type_support = rclcpp::get_message_typesupport_handle(topic_type, "rosidl_typesupport_cpp", *ts_lib);
rmw_deserialize(&message->get_rcl_serialized_message(), type_support, deserialized_msg);
});
The issue is that deserialized_msg is a null pointer ('void *'), and I am unsure how to proceed from here.
If there is currently no way to achieve this, please consider this a feature request. I am open to contributing with some guidance on the implementation. Thanks!
Related:
https://answers.ros.org/question/405796/deserialize-message-with-topic-name-ros2/
https://github.com/ros2/rclcpp/issues/2260
https://github.com/ros2/ros2/issues/1374
https://github.com/facontidavide/rosx_introspection
- Ngôn ngữ chính
- C++
- Star
- 829
- Fork
- 587
- Merge trung bình
- 4 ngày 6 giờ
- Pull request đã merge (30 ngày)
- 30
Chuẩn bị môi trường
- Không có Dockerfile hay tệp Docker Compose
- Không có mẫu pull request
- Đọc hướng dẫn đóng góp
Bắt đầu từ đâu
- Đọc hết issue, rồi đọc hướng dẫn đóng góp của dự án.
- Bình luận trên issue rằng bạn sẽ nhận — tránh hai người làm cùng một việc.
- Fork repository và làm thay đổi trên một nhánh.
- Mở pull request có tham chiếu số hiệu của issue.
Issue khác của ros2/rclcpp
-
enhancement
Độ khó 2/5 1-3 giờ Mức phù hợp với người mới 70/100
Maintainer thường phản hồi trong vòng 1 ngày
-
Độ khó 4/5 3-5 ngày Mức phù hợp với người mới 48/100
Maintainer thường phản hồi trong vòng 1 ngày
-
Memory grows per callback group created and destroyed on long lived nodesCó thể đã có người làm @jwallace42 đã nhận 1 ngày trước. Đang mởbug
Độ khó 4/5 3-5 ngày Mức phù hợp với người mới 28/100
ros2/rclcpp#3428 · 1 bình luận · 1 người được giao ·
Maintainer thường phản hồi trong vòng 1 ngày
-
removing and immediately re-adding a node to the EventsCBGExecutor leaves its entities unregisteredCó thể đã có người làm @skyegalaxy đã nhận 10 ngày trước. Đang mởbug
ros2/rclcpp#3418 · 1 người được giao ·
Maintainer thường phản hồi trong vòng 1 ngày
-
[Humble] Removing a node with more than one auto-added callback group leaves a dangling guard condition in the executorCó thể đã có người làm Có pull request liên kết đang mở hoặc đã được merge. Đang mở
Độ khó 4/5 3-5 ngày Mức phù hợp với người mới 55/100
ros2/rclcpp#3410 · 2 bình luận ·
Maintainer thường phản hồi trong vòng 1 ngày
Issue tương tự
-
arch-based bug niri
Độ khó 2/5 1-3 giờ Mức phù hợp với người mới 68/100
noctalia-dev/noctalia#5552 ·
Maintainer thường phản hồi trong vòng 1 ngày
-
bug
Độ khó 1/5 1-3 giờ Mức phù hợp với người mới 82/100
EchoTools/nevr-runtime#2912 ·
Maintainer thường phản hồi trong vòng 1 ngày
-
area/docdb kind/failing-test priority/medium status/awaiting-triage
Độ khó 2/5 1-3 giờ Mức phù hợp với người mới 82/100
yugabyte/yugabyte-db#39462 ·
Maintainer thường phản hồi trong vòng 1 ngày
-
Độ khó 2/5 1-3 giờ Mức phù hợp với người mới 78/100
meshtastic/firmware#12519 ·
Maintainer thường phản hồi trong vòng 1 ngày
-
Độ khó 2/5 1-3 giờ Mức phù hợp với người mới 79/100
Maintainer thường phản hồi trong vòng 1 ngày