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

Revision history [back]

click to hide/show revision 1
initial version

Quick answer:

float x = scan -> range_max;

The callback function receives a 'LaserScan' message as a parameter. In order to access its fields, you need to resolve/access it correctly.

Alternatively, were you to access, say the 'seq', int i = scan -> header.seq

In the answer linked, "scan->ranges[] are laser readings" refers to the data from the message that you would process.