ROS Resources: Documentation | Support | Discussion Forum | Index | Service Status | ros @ Robotics Stack Exchange
Ask Your Question

Revision history [back]

There are some limitations on automatic type deduction of custom callbacks that can be worked around by explicitly declaring the std::function, e.g.:

  std::function<void()> callback_func = std::bind(&Talker::on_timer, this, 95);
  timer_ = create_wall_timer(1s, callback_func);

Or if you want to pass a variable in you might use std::cref in place of the 95.