ISO C++ forbids taking the address of an unqualified or parenthesized non-static member function to form a pointer to member function This question comes on the heels of this question
In the last question I learned how to use an initializer list to solve my issue, but working with ros::Subscriber is requiring a different solution.
I'm dealing with a callback in this scenario. If I leave the callback as a standalone function then the program runs but I have no access to class members and methods inside the function which defeats the purpose. Here is my standalone callback:
void setPRYCallback( const std_msgs::Empty&amp; toggle_msg) {}

Once I move this into my class is when I encounter the error.
steps to implementing into class
// add member variable for callback
protected:
  void setPRYCallback( const std_msgs::Empty&amp; );

...

// ass method
void ROSController::setPRYCallback( const std_msgs::Empty&amp; toggle_msg) {}

...

// set initializer list
ROSController::ROSController() : sub(&quot;setPRY&quot;, &amp;setPRYCallback )

How do I thwart this error while keeping my callback as a class method?
Program with Standalone Function Callback (program runs)
#include &lt;ros.h&gt; // https://github.com/ros-drivers/rosserial/blob/jade-devel/rosserial_arduino/src/ros_lib/ros.h
#include &lt;std_msgs/Empty.h&gt;

class ROSController {
  protected:
    ros::Subscriber&lt;std_msgs::Empty&gt; sub;
    ros::NodeHandle _nh;
  public:
    void loop();
    ROSController();
};

void setPRYCallback( const std_msgs::Empty&amp; toggle_msg) {}

ROSController::ROSController()  {
  this-&gt;_nh.initNode();
  this-&gt;_nh.subscribe(sub);
}

void ROSController::loop() {
  this-&gt;_nh.spinOnce();
  delay(1000);
}

Program with Method Callback (program fails)
#include &lt;ros.h&gt; // https://github.com/ros-drivers/rosserial/blob/jade-devel/rosserial_arduino/src/ros_lib/ros.h
#include &lt;std_msgs/Empty.h&gt;

class ROSController {
  protected:
    ros::Subscriber&lt;std_msgs::Empty&gt; sub;
    ros::NodeHandle _nh;
    void setPRYCallback( const std_msgs::Empty&amp; );
  public:
    void loop();
    ROSController();
};

void ROSController::setPRYCallback( const std_msgs::Empty&amp; toggle_msg) {}

ROSController::ROSController() : sub(&quot;setPRY&quot;, &amp;setPRYCallback )  {
  this-&gt;_nh.initNode();
  this-&gt;_nh.subscribe(sub);
}

void ROSController::loop() {
  this-&gt;_nh.spinOnce();
  delay(1000);
}

arduino mega
When you move the setPRUCallback function into your class you change the prototype (well, C++ changes the prototype) from:

void setPRYCallback( const std_msgs::Empty&amp; toggle_msg) {}


to:

void setPRYCallback( ROSController *this, const std_msgs::Empty&amp; toggle_msg) {}


That is now not what the callback registering function expects, and so it breaks.

By making the method static it removes that *this parameter, but also means that the function can only access static data within your class (variables also marked static) and there is only one copy of the function (and static variables) shared between all instances of the class (maybe not what you want).