Obstacle avoidance with kinect [closed]
Hi, I am new in coding, and I was analyzing a code of obstacle avoidance with kinect, and I can't really understand what this piece of code means, especially this line angle = ((double)i*scan_msg->angle_increment)+scan_msg->angle_min. If anyone could help me, I would appreciate it!
void scanCallback (const sensor_msgs::LaserScan::ConstPtr& scan_msg) {
for (unsigned int i=0;i< scan_msg->ranges.size();i++){
if (scan_msg->ranges[i]<distance){
distance=scan_msg->ranges[i];
angle = ((double)i*scan_msg->angle_increment)+scan_msg->angle_min;
}
std::cout << distance <<" ------ "<< angle << std::endl;
}
}
Did you mean to close this question? There aren't any answers...
@allenh1 Yes, I solved the question by myself so there was no reason to keep the question open =)