TypeAdapted publishing doesn't use provided allocator
维护者通常 1 天内回复
@clalancette 已经在做这个了。
开始于 2024年4月18日。
评估
这个 Issue 还没有评估数据。
描述
Bug report
Required Info:
- Operating System:
- Ubuntu 20.04
- Installation type:
- From source
- Version or commit hash:
- DDS implementation:
- Fast-RTPS, RTI Connext
- Client library (if applicable):
- rclcpp
Steps to reproduce issue
Create a publisher using an adapted type and a custom allocator
using AdaptedType = rclcpp::adapt_type<std::string>::as<std_msgs::msg::String>;
auto alloc = std::make_shared<MyAllocator<void>>();
rclcpp::PublisherOptionsWithAllocator<MyAllocator<void>> publisher_options;
publisher_options.allocator = alloc;
auto publisher = node->create_publisher<AdaptedType>(
"allocator_tutorial", 10, publisher_options);
publisher->publish("A string");
Expected behavior
The ROS message that is created by Publisher::publish() will be allocated using the provided allocator.
Actual behavior
The ROS message is allocated using std::make_unique<ROSMessageType>()
Additional information
Rather than using std::make_unique<ROSMessageType>(), the create_ros_message_unique_ptr() can be used instead in the following two locations:
- https://github.com/ros2/rclcpp/blob/f9c4894f96ea083fc5acfcea4f1ea83850759e63/rclcpp/include/rclcpp/publisher.hpp#L323
- https://github.com/ros2/rclcpp/blob/f9c4894f96ea083fc5acfcea4f1ea83850759e63/rclcpp/include/rclcpp/publisher.hpp#L370
- auto ros_msg_ptr = std::make_unique<ROSMessageType>();
+ auto ros_msg_ptr = create_ros_message_unique_ptr();
- 主要语言
- C++
- 星标
- 829
- 派生
- 587
- 平均合并
- 4 天 6 小时
- 30 天内合并 PR
- 30
环境准备
- 没有 Dockerfile 或 Docker Compose 文件
- 没有 Pull Request 模板
- 阅读贡献指南
从这里开始
- 先读完整个 Issue,再读项目的贡献指南。
- 在 Issue 下留言说明你要接手 —— 这能避免两个人做同样的事。
- Fork 仓库,在一个分支上完成修改。
- 提交 Pull Request,并在描述里引用这个 Issue 编号。
ros2/rclcpp 的其他 Issue
-
enhancement
难度 2/5 1-3 小时 新手友好度 70/100
维护者通常 1 天内回复
-
难度 4/5 3-5 天 新手友好度 48/100
维护者通常 1 天内回复
-
Memory grows per callback group created and destroyed on long lived nodes可能已有人在做 @jwallace42 于 1 天前认领。 未关闭bug
难度 4/5 3-5 天 新手友好度 28/100
ros2/rclcpp#3428 · 1 条评论 · 已指派 1 人 ·
维护者通常 1 天内回复
-
removing and immediately re-adding a node to the EventsCBGExecutor leaves its entities unregistered可能已有人在做 @skyegalaxy 于 10 天前认领。 未关闭bug
维护者通常 1 天内回复
-
[Humble] Removing a node with more than one auto-added callback group leaves a dangling guard condition in the executor可能已有人在做 关联的 PR 仍在进行中或已合并。 未关闭
难度 4/5 3-5 天 新手友好度 55/100
维护者通常 1 天内回复
相似的 Issue
-
bug
难度 1/5 1-3 小时 新手友好度 82/100
EchoTools/nevr-runtime#2912 ·
维护者通常 1 天内回复
-
难度 2/5 1-3 小时 新手友好度 79/100
维护者通常 1 天内回复
-
category:port-update
难度 2/5 1-3 小时 新手友好度 72/100
维护者通常 2 天内回复
-
bug-unconfirmed
难度 1/5 1 小时以内 新手友好度 75/100
维护者通常 1 天内回复
-
libc++
难度 1/5 1 小时以内 新手友好度 88/100
llvm/llvm-project#246508 ·
维护者通常 1 天内回复