* fix: Use default rcl allocator if allocator is std::allocator
This fixes a bunch of warnings if using ASAN / valgrind on newer
OS versions. It also fixed a real bug, as giving the wrong size
on deallocate is undefined behavior according to the C++ standard.
This version of the patch keeps the behavior for users that
specified an own allocator the same and in therefore back portable.
Signed-off-by: Janosch Machowinski <J.Machowinski@cellumation.com>
* feat: Provide a way to suppress the deprecation warning
This commit adds the feature, that the user can now specify a method
rcl_allocator_t get_rcl_allocator() on the given allocator. This method
will be called if present, to get the rcl allocator.
If the method is not present, the code will fall back to the old
(and faulty) implementation and show a deprecation warning.
Signed-off-by: Janosch Machowinski <J.Machowinski@cellumation.com>
---------
Signed-off-by: Janosch Machowinski <J.Machowinski@cellumation.com>
Co-authored-by: Janosch Machowinski <j.machowinski@cellumation.com>
Fixes#2868
The executable created by rclcpp_components_register_node now depends on
the library target, ensuring the library is rebuilt when the executable
is rebuilt.
Added SKIP_LIBRARY_DEPENDENCY option for cases where the plugin is
provided by a different package.
Signed-off-by: dbwls99706 <yujinhong3@gmail.com>
* Update exception documentation for goal cancellation
The documentation for the canceled function is misleading.
Previously, the description said:
1. "Only call this if the goal is canceling." and
2. "\throws rclcpp::exceptions::RCLError If the goal is in any state besides executing."
This is a contradiction.
Experimentally verified that if the goal is executing and this method is called, an error is thrown. This makes the second statement wrong => correct the statement in the documentation.
Signed-off-by: Andrei Costinescu <AndreiCostinescu@users.noreply.github.com>
* Improve the robustness of the TopicEndpointInfo constructor
Signed-off-by: Barry Xu <barry.xu@sony.com>
* Improve TopicEndpointInfo constructor to validate input parameters
Signed-off-by: Barry Xu <barry.xu@sony.com>
---------
Signed-off-by: Barry Xu <barry.xu@sony.com>
* Add disable(enable)_callbacks() API to the subscriptions
Signed-off-by: Michael Orlov <morlovmr@gmail.com>
* Add test coverage for the disable(enable)_calbacks()
Signed-off-by: Michael Orlov <morlovmr@gmail.com>
* Address code review comments. Add missing includes in tests
Signed-off-by: Michael Orlov <morlovmr@gmail.com>
* Don't trace callback in dispatch methods if callbacks are disabled
Signed-off-by: Michael Orlov <morlovmr@gmail.com>
* Protect enable/disable callbacks and callbacks execution with mutex
Reasoning:
To avoid possible UB when callbacks disabled during callback
execution and callback handler object deleted while execution hasn't
been finished yet.
Signed-off-by: Michael Orlov <morlovmr@gmail.com>
* Renames for shadowed callback_mutex_ from the EventHandlerBase
Note: We can't reuse `on_new_event_callback_mutex_` from the
EventHandlerBase because those mutex used to protect another type of
callbacks.
Signed-off-by: Michael Orlov <morlovmr@gmail.com>
* Temporary removes the on_new_[message]event on disable_callbacks()
Note: While we are temporary removes the on new message callback and all
on new event callbacks from the underlying rmw layer to prevent them
from being called. We can't guarantee that the currently executing
on_new_[message]event callbacks are finished before we exit from the
disable_callbacks().
Signed-off-by: Michael Orlov <morlovmr@gmail.com>
* Use recursive_mutex for callback lock in any_subscription_callback
Signed-off-by: Michael Orlov <morlovmr@gmail.com>
* Address CI warnings about usage of deprecated rclcpp::spin_some(node)
- Use spin_some() from the rclcpp::executors::SingleThreadedExecutor
directly.
Signed-off-by: Michael Orlov <morlovmr@gmail.com>
---------
Signed-off-by: Michael Orlov <morlovmr@gmail.com>