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

Allow passing context to subscription callbacks #50

Closed
BrettRD opened this issue Feb 17, 2021 · 4 comments
Closed

Allow passing context to subscription callbacks #50

BrettRD opened this issue Feb 17, 2021 · 4 comments

Comments

@BrettRD
Copy link
Contributor

BrettRD commented Feb 17, 2021

Following from #35 add context pointers to service calls, I'd like to use subscriptions with context pointers too

The change would re-use (and re-name) the void * service_context; added in #45, and add the following:

typedef void (* rclc_subscription_callback_with_context_t)(const void *, void *);
rcl_ret_t
rclc_executor_add_subscription_with_context(
  rclc_executor_t * executor,
  rcl_subscription_t * subscription,
  void * msg,
  rclc_callback_t callback,
  void * context,
  rclc_executor_handle_invocation_t invocation);

I have most of a patch, I'll re-base it onto #45 in the next couple of weeks and submit a pull to micro-ros

@JanStaschulat
Copy link
Contributor

Just for information: in future create a feature branch from ros2/rclc and create a pull request directly to ros2/rclc.
See also ticket micro-ROS#75

@BrettRD
Copy link
Contributor Author

BrettRD commented Jun 30, 2021

implemented in #107, but needs #106 first
sorry about the pull to foxy, that's the only branch I'm set up to test on.

@JanStaschulat
Copy link
Contributor

@BrettRD, just let me know, when you are done, then I'll do a code review.

@BrettRD
Copy link
Contributor Author

BrettRD commented Jun 30, 2021

I think it's ready, I was expecting way more merge conflicts

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants