Obstacle avoidance with kinect [closed]

asked 2014-07-09 10:11:24 -0500

anamcarvalho gravatar image

updated 2014-07-09 11:28:30 -0500

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;
    }
}
edit retag flag offensive reopen merge delete

Closed for the following reason the question is answered, right answer was accepted by anamcarvalho
close date 2014-07-09 12:46:49.374242

Comments

Did you mean to close this question? There aren't any answers...

allenh1 gravatar image allenh1  ( 2014-07-09 14:43:56 -0500 )edit

@allenh1 Yes, I solved the question by myself so there was no reason to keep the question open =)

anamcarvalho gravatar image anamcarvalho  ( 2014-07-10 11:08:38 -0500 )edit