Subject:
|
Re: TachoSpeed.nqc
|
Newsgroups:
|
lugnet.robotics
|
Date:
|
Mon, 12 Mar 2007 22:28:35 GMT
|
Original-From:
|
linmix <linmix@gmail#spamless#.com>
|
Viewed:
|
3885 times
|
| |
| |
Dean Hystad wrote:
> 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.
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, because I hade the bot pushing
against the wall for several seconds, with 'watching the brick'
reporting values of around 57 and still the if statement wasn't executed.
|
|
Message has 1 Reply: | | Re: TachoSpeed.nqc
|
| (...) For the RCX wait times are in 1/100 of a second. Is that the same for the Cybermaster? If so the reverse and turn times are a little short (as well as the motor ramp up period). I could see how it would be difficult to notice the robot backup (...) (18 years ago, 13-Mar-07, to lugnet.robotics)
|
Message is in Reply To:
| | Re: TachoSpeed.nqc
|
| Doesn't this make more sense. (...) 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 (...) (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
|
|
|
|