Skip to content
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

Fix rolling build #379

Closed
Closed
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
12 changes: 9 additions & 3 deletions fuse_core/include/fuse_core/callback_wrapper.hpp
Original file line number Diff line number Diff line change
Expand Up @@ -166,7 +166,7 @@ class CallbackAdapter : public rclcpp::Waitable
/**
* @brief tell the CallbackGroup that this waitable is ready to execute anything
*/
bool is_ready(rcl_wait_set_t * wait_set) override;
bool is_ready(rcl_wait_set_t const & wait_set) override;


/**
Expand All @@ -175,18 +175,24 @@ class CallbackAdapter : public rclcpp::Waitable
waitable_ptr = std::make_shared<CallbackWrapper>();
node->get_node_waitables_interface()->add_waitable(waitable_ptr, (rclcpp::CallbackGroup::SharedPtr) nullptr);
*/
void add_to_wait_set(rcl_wait_set_t * wait_set) override;
void add_to_wait_set(rcl_wait_set_t & wait_set) override;

std::shared_ptr<void> take_data() override;

void execute(std::shared_ptr<void> & data) override;
void execute(std::shared_ptr<void> const & data) override;

void addCallback(const std::shared_ptr<CallbackWrapperBase> & callback);

void addCallback(std::shared_ptr<CallbackWrapperBase> && callback);

void removeAllCallbacks();

void set_on_ready_callback(std::function<void(size_t, int)>) override {}
void clear_on_ready_callback() override {}
std::shared_ptr<void> take_data_by_entity_id(size_t) override {
return nullptr;
}

private:
rcl_guard_condition_t gc_; //!< guard condition to drive the waitable

Expand Down
8 changes: 4 additions & 4 deletions fuse_core/src/callback_wrapper.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -59,7 +59,7 @@ size_t CallbackAdapter::get_number_of_ready_guard_conditions() {return 1;}
/**
* @brief tell the CallbackGroup that this waitable is ready to execute anything
*/
bool CallbackAdapter::is_ready(rcl_wait_set_t * wait_set)
bool CallbackAdapter::is_ready(rcl_wait_set_t const & wait_set)
{
(void) wait_set;
return !callback_queue_.empty();
Expand All @@ -71,9 +71,9 @@ bool CallbackAdapter::is_ready(rcl_wait_set_t * wait_set)
waitable_ptr = std::make_shared<CallbackAdapter>();
node->get_node_waitables_interface()->add_waitable(waitable_ptr, (rclcpp::CallbackGroup::SharedPtr) nullptr);
*/
void CallbackAdapter::add_to_wait_set(rcl_wait_set_t * wait_set)
void CallbackAdapter::add_to_wait_set(rcl_wait_set_t & wait_set)
{
if (RCL_RET_OK != rcl_wait_set_add_guard_condition(wait_set, &gc_, NULL)) {
if (RCL_RET_OK != rcl_wait_set_add_guard_condition(&wait_set, &gc_, NULL)) {
RCLCPP_WARN(rclcpp::get_logger("fuse"), "Could not add callback waitable to wait set.");
}
}
Expand Down Expand Up @@ -107,7 +107,7 @@ std::shared_ptr<void> CallbackAdapter::take_data()
* @brief hook that allows the rclcpp::waitables interface to run the next callback
*
*/
void CallbackAdapter::execute(std::shared_ptr<void> & data)
void CallbackAdapter::execute(std::shared_ptr<void> const & data)
{
if (!data) {
throw std::runtime_error("'data' is empty");
Expand Down