micro_ros_arduino
                                
                                 micro_ros_arduino copied to clipboard
                                
                                    micro_ros_arduino copied to clipboard
                            
                            
                            
                        Support class member function for callbak of subscriber
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?
@JanStaschulat do you know any way of adding an object method as callback for RCLC sub?
Is there any news or plan?
You just need to make the functions public members of your class and declare them static.
Then you can pass them to the add subscription function as &MyClass::callback.