To LUGNET HomepageTo LUGNET News HomepageTo LUGNET Guide Homepage
 Help on Searching
 
Post new message to lugnet.roboticsOpen lugnet.robotics in your NNTP NewsreaderTo LUGNET News Traffic PageSign In (Members)
 Robotics / 26949
26948  |  26950
Subject: 
Re: TachoSpeed.nqc
Newsgroups: 
lugnet.robotics
Date: 
Mon, 12 Mar 2007 15:24:04 GMT
Viewed: 
3908 times
  
Doesn't this make more sense.

task main()
     {
     OnFwd (OUT_L+OUT_R);
     Wait (20);
     while (true)
          {
          if (TachoSpeed(OUT_R) < threshold) //default behaviour
             {
             reverse (50);
             clockwise (30);
             OnFwd (OUT_L+OUT_R);
             Wait (20);
             }
          if (TachoSpeed(OUT_L) < threshold) // alternate behaviour
             {
             reverse (50);
             c_clockwise (30);
             OnFwd (OUT_L+OUT_R);
             Wait (20);
             }
          }
     }


The way it was written you hardly ever checked the TachoSpeed because most of
the time was spent in the Wait(20).  I assume the Wait is in there to allow the
robot to get up to speed before you start checking for a stall.



Message has 1 Reply:
  Re: TachoSpeed.nqc
 
(...) You assumed correctly. Without the wait the if statement is always executed immediately. I see what you mean: by taking the wait out of the start of the loop the sensors are checked more frequently. That doesn't solve the riddle though, (...) (18 years ago, 12-Mar-07, to lugnet.robotics)

Message is in Reply To:
  Re: TachoSpeed.nqc
 
(...) I 've done just that, but the problem I describe persists: When the TachoSpeed reported by watching the brick is around 57, the brick doesn't do anything if the response value is set to 62. It does at 66 or 67 but that also makes it impossible (...) (18 years ago, 12-Mar-07, to lugnet.robotics)

13 Messages in This Thread:



Entire Thread on One Page:
Nested:  All | Brief | Compact | Dots
Linear:  All | Brief | Compact

This Message and its Replies on One Page:
Nested:  All | Brief | Compact | Dots
Linear:  All | Brief | Compact
    
Active threads in Robotics

 
Verified and Trusted Team of Hackers
6 hours ago
Custom Search

©2005 LUGNET. All rights reserved. - hosted by steinbruch.info GbR