Society of Robots - Robot Forum

Software => Software => Topic started by: SUTO the G on February 27, 2013, 08:40:44 AM

Title: 50_robot_sharoIR software questions
Post by: SUTO the G on February 27, 2013, 08:40:44 AM
How does this  "if(scan_angle > 57) robot_turn_left();"  make sense? when scan_angle`s max value is 57.
         
Title: Re: 50_robot_sharoIR software questions
Post by: SUTO the G on February 27, 2013, 09:05:55 AM
   if (sharp_IR_reading > scan_thresh)//object detected
      {
      if (scan_angle>41) //overflow protection
         scan_angle-=2;//scan right
      }
Here why do we need to make that overflow protection? I mean couldn`t we just say
   if (sharp_IR_reading > scan_thresh)//object detected
      {
      scan_angle=scan_angle
      }
Title: Re: 50_robot_sharoIR software questions
Post by: Admin on March 02, 2013, 08:17:46 PM
Please do not double post.

Your answer is here:
http://www.societyofrobots.com/robotforum/index.php?topic=8420.msg116891#msg116891 (http://www.societyofrobots.com/robotforum/index.php?topic=8420.msg116891#msg116891)

When the angle is at 57, the robot will turn left. :P
(not sure what your question is exactly)