To LUGNET HomepageTo LUGNET News HomepageTo LUGNET Guide Homepage
 Help on Searching
 
Post new message to lugnet.robotics.rcxOpen lugnet.robotics.rcx in your NNTP NewsreaderTo LUGNET News Traffic PageSign In (Members)
 Robotics / RCX / 756
755  |  757
Subject: 
Re: Dave Baum's scanbot w/ bumper?
Newsgroups: 
lugnet.robotics.rcx
Date: 
Wed, 4 Oct 2000 03:25:58 GMT
Viewed: 
1540 times
  
In article <G1KEyJ.IIp@lugnet.com>, "Christopher"
<czukowsk@pacbell.net> wrote:

I was programming a "scanbot" from the Definitive Guide and wanted to
install a
bumper as I noticed the robot would run into things periocically while
"searching" for the light. I wrote some code as follows:

void check_bump
{
  if (BUMP == 1)
  {
   Rev(RIGHT+LEFT);
   OnFor(RIGHT+LEFT,300);
   Fwd(RIGHT+LEFT);
  }
}

I put this call between the "scan" and "steer" functions and it doesn't
seem to
work right. It detects when it has hit something and backs up, but then
the
robot only will "scan". It quits moving and "steering". I have moved the
function around a bit, but to no avail. Any suggestions on how it can do
all 3
functions basically at the same time.

The problem is subtle.  Scanbot (at least scanbot2.nqc) assumes that the
drive motors are always running.  It only alters their direction during
steering.  In your code you call OnFor(), which turns on the motors,
waits a specified amount of time, then turns them off.  The rest of the
code never turns them back on.

You really don't have to turn on the motors (since they'll already be
running) - call Wait() instead of OnFor() and it should work a lot
better.

Or use scanbot3.nqc which stands still during scanning, and turns the
motors on during each steering operation.

Dave Baum

--
reply to: dbaum at enteract dot com



Message is in Reply To:
  Dave Baum's scanbot w/ bumper?
 
I was programming a "scanbot" from the Definitive Guide and wanted to install a bumper as I noticed the robot would run into things periocically while "searching" for the light. I wrote some code as follows: void check_bump { if (BUMP == 1) { (...) (24 years ago, 27-Sep-00, to lugnet.robotics.rcx)

2 Messages in This Thread:

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

Custom Search

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