Author Topic: 50_robot_sharoIR software questions  (Read 1988 times)

0 Members and 1 Guest are viewing this topic.

Offline SUTO the GTopic starter

  • Jr. Member
  • **
  • Posts: 42
  • Helpful? 0
50_robot_sharoIR software questions
« 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.
         

Offline SUTO the GTopic starter

  • Jr. Member
  • **
  • Posts: 42
  • Helpful? 0
Re: 50_robot_sharoIR software questions
« Reply #1 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
      }

Offline Admin

  • Administrator
  • Supreme Robot
  • *****
  • Posts: 11,703
  • Helpful? 173
    • Society of Robots
Re: 50_robot_sharoIR software questions
« Reply #2 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

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