My code is like bellow! I want to change to get the RANGES[i] always at the same time.
Someone knows?!
while(ros::ok()) {
for (i = 0; i < 540; i++) {
if (!clustersScan.laserMsg.ranges.empty()) {
RANGES[i] = clustersScan.laserMsg.ranges[i];
}
}

I have some code that get the messages and break after there is something inside, but laser ranges data change every time I execute my code. This happens probably cause I get the msg in different periodo of time. I want set a specific time to get it, I mean get the ranges always at the same time.