Length of the ranges array in a LaserScan msg
Hi,
I'm having this programming problem: I'm cycling through the ranges
array in LaserScan
messages and accessing its values. I'm using just this simple for cycle:
for (int i = 0; i < sizeof(scan->ranges)/sizeof(scan->ranges[0]); i++)
But the expression for getting the array length returns the value of 6
, although the scan contains many more values (seen them through rostopic echo
). What am I doing wrong? Isn't this the normal way of obtaining the length of an array in C++?