Groups | Search | Server Info | Keyboard shortcuts | Login | Register [http] [https] [nntp] [nntps]


Groups > comp.lang.python > #98021

Re: GoPiGo script

Path csiph.com!fu-berlin.de!uni-berlin.de!not-for-mail
From MRAB <python@mrabarnett.plus.com>
Newsgroups comp.lang.python
Subject Re: GoPiGo script
Date Sat, 31 Oct 2015 19:42:30 +0000
Lines 80
Message-ID <mailman.1.1446320553.4463.python-list@python.org> (permalink)
References <mailman.0.1446313334.4463.python-list@python.org> <nc8Zx.6937$Ct7.770@fe48.am1>
Mime-Version 1.0
Content-Type text/plain; charset=utf-8; format=flowed
Content-Transfer-Encoding 7bit
X-Trace news.uni-berlin.de sXAYMvp/P75V2E/dtADICQcZEqlMiEqfHdo51sjT24YQ==
Return-Path <python@mrabarnett.plus.com>
X-Original-To python-list@python.org
Delivered-To python-list@mail.python.org
X-Spam-Status OK 0.004
X-Spam-Evidence '*H*': 0.99; '*S*': 0.00; 'extends': 0.07; 'line:': 0.07; 'subject:script': 0.09; 'from:addr:mrabarnett.plus.com': 0.16; 'from:addr:python': 0.16; 'from:name:mrab': 0.16; 'message- id:@mrabarnett.plus.com': 0.16; 'received:192.168.1.4': 0.16; 'received:84.93': 0.16; 'received:84.93.230': 0.16; 'received:io': 0.16; 'received:psf.io': 0.16; 'repeatedly.': 0.16; 'test():': 0.16; 'true:': 0.16; 'wrote:': 0.16; 'detect': 0.18; 'wrote': 0.23; 'import': 0.24; 'header:In-Reply-To:1': 0.24; 'script': 0.25; 'header:User-Agent:1': 0.26; 'skip:# 10': 0.27; '---': 0.28; 'skip:( 20': 0.28; 'print': 0.30; 'rules': 0.31; 'received:84': 0.32; 'run': 0.33; 'skip:p 30': 0.35; 'to:addr:python-list': 0.36; 'subject:: ': 0.37; 'mean': 0.38; 'does': 0.39; 'received:192': 0.39; 'to:addr:python.org': 0.40; 'body': 0.61; 'forward': 0.66; 'reply': 0.68; "'while'": 0.84; 'wheels': 0.84
X-CM-Score 0.00
X-CNFS-Analysis v=2.1 cv=MbeRwMLf c=1 sm=1 tr=0 a=0nF1XD0wxitMEM03M9B4ZQ==:117 a=0nF1XD0wxitMEM03M9B4ZQ==:17 a=0Bzu9jTXAAAA:8 a=EBOSESyhAAAA:8 a=IkcTkHD0fZMA:10 a=-UnxzCWO7a_Q1h29mbsA:9 a=QEXdDO2ut3YA:10
X-AUTH mrabarnett@:2500
User-Agent Mozilla/5.0 (Windows NT 10.0; WOW64; rv:38.0) Gecko/20100101 Thunderbird/38.3.0
In-Reply-To <nc8Zx.6937$Ct7.770@fe48.am1>
X-BeenThere python-list@python.org
X-Mailman-Version 2.1.20+
Precedence list
List-Id General discussion list for the Python programming language <python-list.python.org>
List-Unsubscribe <https://mail.python.org/mailman/options/python-list>, <mailto:python-list-request@python.org?subject=unsubscribe>
List-Archive <http://mail.python.org/pipermail/python-list/>
List-Post <mailto:python-list@python.org>
List-Help <mailto:python-list-request@python.org?subject=help>
List-Subscribe <https://mail.python.org/mailman/listinfo/python-list>, <mailto:python-list-request@python.org?subject=subscribe>
Xref csiph.com comp.lang.python:98021

Show key headers only | View raw


On 2015-10-31 18:59, input/ldompeling@casema.nl wrote:
>> The body of the 'while' loop extends from the line:
>>
>>      enable_servo()
>>
>> to the line:
>>
>>      print ("forward1x")
>>
>> Would that explain it?
>
> When i run this scipt its only print a lot off print1x.
> Do you mean that ?
>
It does not only print; it also calls enable_servo, servo and fwd
repeatedly.

>
> In reply to "MRAB" who wrote the following:
>
>> On 2015-10-31 10:28, input/ldompeling@casema.nl wrote:
>> > I intended the rules under while True:
>> > The script is working now only the wheels go's only forward "(fwd)",so the
>> > sensor not detect any obstacles.(sensor=us_dist(15).
>> >
>> >
> ----------------------------------------------------------------------------
>> > ---
>> >
>> > from gopigo import *
>> > import time
>> >
>> >
>> > set_right_speed(150)
>> > set_left_speed(105)
>> >
>> The body of the 'while' loop extends from the line:
>>
>>      enable_servo()
>>
>> to the line:
>>
>>      print ("forward1x")
>>
>> Would that explain it?
>>
>> > while True:
>> > #def test():
>> >      enable_servo()
>> >      mindist = 80
>> >      servo(90)
>> >      fwd()
>> >      print ("forward1x")
>> > #time.sleep(5)
>> > #stop()
>> >
>> > if mindist > us_dist(15):
>> >       #enc_tgt(1,1,72)
>> >      bwd()
>> >      print ("backward1x",us_dist(15))
>> >      time.sleep(2)
>> >      left_rot()
>> >      print("left rot",us_dist(15))
>> >      time.sleep(3)
>> >      stop()
>> >
>> > if mindist < us_dist(15):
>> >     #enc_tgt(1,1,72)
>> >      fwd()
>> >      print("forward2x",us_dist(15))
>> >      time.sleep(2)
>> >      stop()
>> >
>> > for x in range(3):
>> >
>> >      if mindist > us_dist(15):
>> >           bwd()
>> >           print("backward2x",us_dist(15))
>> >

Back to comp.lang.python | Previous | NextPrevious in thread | Next in thread | Find similar | Unroll thread


Thread

GoPiGo script input/ldompeling@casema.nl - 2015-10-30 16:58 +0000
  Re: GoPiGo script Peter Pearson <pkpearson@nowhere.invalid> - 2015-10-30 17:27 +0000
    Re: GoPiGo script input/ldompeling@casema.nl - 2015-11-02 13:29 +0000
      Re: GoPiGo script hakugin.gin@gmail.com - 2015-11-02 05:45 -0800
        Re: GoPiGo script hakugin.gin@gmail.com - 2015-11-02 05:49 -0800
          Re: GoPiGo script input/ldompeling@casema.nl - 2015-11-02 14:28 +0000
            Re: GoPiGo script hakugin.gin@gmail.com - 2015-11-02 07:19 -0800
            Re: GoPiGo script MRAB <python@mrabarnett.plus.com> - 2015-11-02 15:21 +0000
              Re: GoPiGo script hakugin.gin@gmail.com - 2015-11-02 07:30 -0800
      Re: GoPiGo script Dennis Lee Bieber <wlfraed@ix.netcom.com> - 2015-11-02 09:10 -0500
        Re: GoPiGo script input/ldompeling@casema.nl - 2015-11-02 14:32 +0000
          Re: GoPiGo script Robin Koch <robin.koch@t-online.de> - 2015-11-02 20:31 +0100
            Re: GoPiGo script Larry Hudson <orgnut@yahoo.com> - 2015-11-02 13:06 -0800
              Re: GoPiGo script Robin Koch <robin.koch@t-online.de> - 2015-11-03 01:45 +0100
  Re: GoPiGo script hakugin.gin@gmail.com - 2015-10-30 10:32 -0700
    Re: GoPiGo script input/ldompeling@casema.nl - 2015-10-30 18:18 +0000
      Re: GoPiGo script hakugin.gin@gmail.com - 2015-10-30 12:59 -0700
        Re: GoPiGo script input/ldompeling@casema.nl - 2015-10-31 10:28 +0000
          Re: GoPiGo script MRAB <python@mrabarnett.plus.com> - 2015-10-31 17:42 +0000
            Re: GoPiGo script input/ldompeling@casema.nl - 2015-10-31 18:59 +0000
              Re: GoPiGo script MRAB <python@mrabarnett.plus.com> - 2015-10-31 19:42 +0000
                Re: GoPiGo script input/ldompeling@casema.nl - 2015-10-31 20:18 +0000
                Re: GoPiGo script MRAB <python@mrabarnett.plus.com> - 2015-10-31 21:12 +0000

csiph-web