micro-ROS / micro-ROS/micro_ros_arduino

Support class member function for callbak of subscriber

Open
#1,508 3 comments 0 reactions 0 assignees View on GitHub

Nobody has claimed this yet.

Dominant language
C
Stars
576
Forks
146
PR merge metrics
No merged PRs in 30d

Description

Is there any way to use class member function for callback of subscriber?
If there is not now, do you plan to support it?

I'm going to replace ros1 rosserial to ros2 microros.
The ros1 rosserial supports registering class member function as callback of subscriber so I use classes to manage rosserial.
https://answers.ros.org/question/258249/publisher-or-subscriber-inside-a-class-rosserial/
https://github.com/ros-drivers/rosserial/blob/c169ae2173dcfda7cee567d64beae45198459400/rosserial_client/src/ros_lib/ros/subscriber.h#L66
If microros does not support it, complicated change is needed for my project.

Could you give me some advice or future plan?

Contributor guide

Open the contributing guide

First steps

  1. Read the whole issue, then the project's contributing guide.
  2. Comment on the issue to say you are picking it up — it saves two people doing the same work.
  3. Fork the repository and make your change on a branch.
  4. Open a pull request that references the issue number.

Research direction

Begin with the subscriber callback registration API in micro_ros_arduino and compare it with the rosserial_client/src/ros_lib/ros/subscriber.h entry cited in the issue. Determine the supported callback forms, the compatibility requirements for class member functions, and the tests or examples needed to demonstrate the intended behavior.

Written by the indexing model from the issue text.

Assessment

Tech stack
arduino, cpp
Domain
embedded-iot, robotics
Issue type
Feature
Difficulty
5/5
Estimated time
Over a week
Activity status
Stale
Clarity
Needs clarification
Newbie friendliness
25/100

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.