I want to be able to define a callback through a lambda but I can't get any of the function signatures to match.
std::function<void(const sensor_msgs::PointCloud2)> callback =
[&mycapture](const sensor_msgs::PointCloud2 msg) {
// do something with msg and capture
};
auto sub = ros_node.subscribe("/sometopic", 1, callback)
I can't get this to work as subscribe wants a function pointer. Is what I'm trying to do possible with ROS? That is, can I pass into the subscribe method a lambda with a capture?