Ask Your Question

Revision history [back]

How to make a callback function for range topic


I am subscribing to a range message but am unsure what to do. I need to save the range value as a double into a global array variable. I have:

void front(const sensor_msgs::Range &msg)
     data[0] = ???;

I am unsure was goes in the ??? obviously. I think it is something like msg->range.size() but I am not sure. Is this correct?