diff --git a/src/node.cpp b/src/node.cpp index 4b12ea6b..86c96bbc 100644 --- a/src/node.cpp +++ b/src/node.cpp @@ -334,7 +334,12 @@ int main(int argc, char * argv[]) { int angle_value = (int)(angle * angle_compensate_multiple); if ((angle_value - angle_compensate_offset) < 0) angle_compensate_offset = angle_value; for (j = 0; j < angle_compensate_multiple; j++) { - angle_compensate_nodes[angle_value-angle_compensate_offset+j] = nodes[i]; + int index = angle_value - angle_compensate_offset + j; + if (index >= angle_compensate_nodes_count) { + //ROS_WARN("skipping out of range compensate index %d for i %d",index,i); + continue; + } + angle_compensate_nodes[index] = nodes[i]; } } }