From kay at elvis.rowan.edu Sat Oct 9 17:38:34 2010 From: kay at elvis.rowan.edu (Jennifer Kay) Date: Sat Oct 9 17:00:44 2010 Subject: [Pyro-users] Using Pyro with a Hemisson without Bluetooth (more info) In-Reply-To: <50034.69.119.239.113.1253584023.squirrel@mail.slc.edu> References: <50034.69.119.239.113.1253584023.squirrel@mail.slc.edu> Message-ID: <4CB0E0DA.3080605@elvis.rowan.edu> Is it possible to use Pyro with a Hemisson without bluetooth? I used the Hemisson Uploader to download the updated control program and then plugged the hemisson into my machine via the serial cable. I use the knoppix CD. I start pyro, skip the server (that's for the simulator, right?) select the hemisson under robot but can't connect. I've tried the default ports as well as as many permutations on tty0 /dev/tty0 tty1 etc. Any ideas? Thanks, -- Jennie -- Jennifer Kay Associate Professor Rowan University email: kay@elvis.rowan.edu Computer Science Department voice: 856-256-4593 201 Mullica Hill Road fax: 856-256-4741 Glassboro, NJ 08028 web: http://www.rowan.edu/~kay/ From kay at elvis.rowan.edu Sat Oct 9 21:48:34 2010 From: kay at elvis.rowan.edu (Jennifer Kay) Date: Sat Oct 9 21:10:33 2010 Subject: [Pyro-users] Using Pyro with a Hemisson without Bluetooth (more info) In-Reply-To: <4CB0E0DA.3080605@elvis.rowan.edu> References: <50034.69.119.239.113.1253584023.squirrel@mail.slc.edu> <4CB0E0DA.3080605@elvis.rowan.edu> Message-ID: <4CB11B72.10109@elvis.rowan.edu> Big never mind .... eventually I figured out that under knoppix I was supposed to use /dev/ttyS0 for my com1 port and all is well. As a bonus I got to play with old modem commands while I was testing the port just to make sure knoppix was playing well with my machine! -- Jennie Jennifer Kay wrote: > > Is it possible to use Pyro with a Hemisson without bluetooth? > > I used the Hemisson Uploader to download the updated control program > and then plugged the hemisson into my machine via the serial cable. > > I use the knoppix CD. I start pyro, skip the server (that's for the > simulator, right?) select the hemisson under robot but can't connect. > I've tried the default ports as well as as many permutations on tty0 > /dev/tty0 tty1 etc. > > Any ideas? > > Thanks, > > -- Jennie > From kay at elvis.rowan.edu Sun Oct 10 01:31:20 2010 From: kay at elvis.rowan.edu (Jennifer Kay) Date: Sun Oct 10 00:53:27 2010 Subject: [Pyro-users] usb to db9 cable that works with Hemisson under Knoppix? In-Reply-To: <4CB11B72.10109@elvis.rowan.edu> References: <50034.69.119.239.113.1253584023.squirrel@mail.slc.edu> <4CB0E0DA.3080605@elvis.rowan.edu> <4CB11B72.10109@elvis.rowan.edu> Message-ID: <4CB14FA8.60305@elvis.rowan.edu> Anyone have any success running the Hemisson's using the Pyro live CD via a usb to db9 cable? If so, what brand/model cable do you use? Thanks, -- Jennie -- Jennifer Kay Associate Professor Rowan University email: kay@elvis.rowan.edu Computer Science Department voice: 856-256-4593 201 Mullica Hill Road fax: 856-256-4741 Glassboro, NJ 08028 web: http://www.rowan.edu/~kay/ From kay at elvis.rowan.edu Sun Oct 10 02:23:50 2010 From: kay at elvis.rowan.edu (Jennifer Kay) Date: Sun Oct 10 01:45:56 2010 Subject: [Pyro-users] Hemisson Help In-Reply-To: <4CB14FA8.60305@elvis.rowan.edu> References: <50034.69.119.239.113.1253584023.squirrel@mail.slc.edu> <4CB0E0DA.3080605@elvis.rowan.edu> <4CB11B72.10109@elvis.rowan.edu> <4CB14FA8.60305@elvis.rowan.edu> Message-ID: <4CB15BF6.1040109@elvis.rowan.edu> Sorry to flood the list tonight with emails. I'm so very very close ... trying to run with a "real" Hemisson From the command line, I say, > robot.move(0.5,0) and my goes forward (yay!) Then I say > robot.stop() and it (usually) stops. Yay again So I write a simple brain: > from pyrobot.brain import Brain > > class StopWhenClose(Brain): > > > def step(self): > front = self.robot.ir[0][0].distance() > print "front ir: ",front > > if front > 0.4: > self.robot.move(0.5,0) > print "moving ..." > else: > print "stopping" > self.robot.stop() > > > def INIT(engine): > return StopWhenClose('StopWhenClose', engine) And my output looks promising: > front ir: 0.5 > moving ... > front ir: 0.5 > moving ... > front ir: 0.5 > moving ... > front ir: 0.5 > moving ... > front ir: 0.5 > moving ... > front ir: 0.49853372434 > moving ... > front ir: 0.477028347996 > moving ... > front ir: 0.379276637341 > stopping > front ir: 0.379765395894 > stopping > front ir: 0.399804496579 > stopping > front ir: 0.396383186706 > stopping except my motors never actually start or stop. So what am I doing wrong??? Thanks, -- Jennie -- Jennifer Kay Associate Professor Rowan University email: kay@elvis.rowan.edu Computer Science Department voice: 856-256-4593 201 Mullica Hill Road fax: 856-256-4741 Glassboro, NJ 08028 web: http://www.rowan.edu/~kay/ From kay at elvis.rowan.edu Mon Oct 11 11:07:18 2010 From: kay at elvis.rowan.edu (Jennifer Kay) Date: Mon Oct 11 10:29:06 2010 Subject: [Pyro-users] Progress, but still some problems using Hemisson over serial port In-Reply-To: <4CB11B72.10109@elvis.rowan.edu> References: <50034.69.119.239.113.1253584023.squirrel@mail.slc.edu> <4CB0E0DA.3080605@elvis.rowan.edu> <4CB11B72.10109@elvis.rowan.edu> Message-ID: <4CB32826.8060405@elvis.rowan.edu> Again my apologies to spamming you guys. At least someone's using the stuff, yes? I switched machines (still running the same pyro live knoppix CD) and now my code works (phew). Though sometimes it appears (and this is true with the joystick interface too) that the Hemisson isn't getting the command to move. Specifically: * Occasionally I click on the joystick interface to go forward and get no response. Repeat the click and the robot moves * I step through my program. It prints "moving" on the screen but the robot doesn't move * I need to run my robot at an incredibly slow speed to get it to stop before bumping into something. I suspect this is because not all of the "stop" commands are being received. My current code: (have tried permutations of self.robot.ir / self.ir and self.robot.move and self.move -- they seem equivalent. Am I missing something?) # robot goes forward and then slows to a stop when it detects something from pyrobot.brain import Brain class StopWhenClose(Brain): def step(self): front = self.robot.ir[0][0].distance() print "front ir: ",front if front > 0.488: self.robot.move(0.2,0) print "moving ..." else: print "stopping" self.robot.stop() def INIT(engine): return StopWhenClose('StopWhenClose', engine) -------------- next part -------------- An HTML attachment was scrubbed... URL: http://emergent.brynmawr.edu/pipermail/pyro-users/attachments/20101011/d0106adb/attachment.htm From dblank at cs.brynmawr.edu Mon Oct 11 13:12:17 2010 From: dblank at cs.brynmawr.edu (Douglas S. Blank) Date: Mon Oct 11 12:34:05 2010 Subject: [Pyro-users] Progress, but still some problems using Hemisson over serial port In-Reply-To: <4CB32826.8060405@elvis.rowan.edu> References: <50034.69.119.239.113.1253584023.squirrel@mail.slc.edu> <4CB0E0DA.3080605@elvis.rowan.edu> <4CB11B72.10109@elvis.rowan.edu> <4CB32826.8060405@elvis.rowan.edu> Message-ID: <37171.76.98.34.255.1286817137.squirrel@cs.brynmawr.edu> > Again my apologies to spamming you guys. At least someone's using the > stuff, yes? Yes! :) > I switched machines (still running the same pyro live knoppix CD) and > now my code works (phew). Though sometimes it appears (and this is true > with the joystick interface too) that the Hemisson isn't getting the > command to move. > > Specifically: > > * Occasionally I click on the joystick interface to go forward and > get no response. Repeat the click and the robot moves > * I step through my program. It prints "moving" on the screen but > the robot doesn't move > * I need to run my robot at an incredibly slow speed to get it to > stop before bumping into something. I suspect this is because not > all of the "stop" commands are being received. > > > My current code: (have tried permutations of self.robot.ir / self.ir and > self.robot.move and self.move -- they seem equivalent. Am I missing > something?) > > # robot goes forward and then slows to a stop when it detects something > > from pyrobot.brain import Brain > > class StopWhenClose(Brain): > > > def step(self): > front = self.robot.ir[0][0].distance() > print "front ir: ",front > > if front > 0.488: > self.robot.move(0.2,0) > print "moving ..." > else: > print "stopping" > self.robot.stop() > This code may be a little odd... 10 times a second (at most) you are either moving forward, or telling it to briefly not move. I suspect that the sensor readings have enough noise that it is always moving some. That is, if you take 10 readings, chances are that at least one (per second) is going to have enough noise to make it move forward. Eventually, it may be too close to get an accurate reading. self is a brain, and there is a convenience method for move there. Compare: pyrobot/robot/__init__.py pyrobot/brain/__init__.py -Doug > def INIT(engine): > return StopWhenClose('StopWhenClose', engine) > > > _______________________________________________ > Pyro-users mailing list > Pyro-users@pyrorobotics.org > http://emergent.brynmawr.edu/mailman/listinfo/pyro-users > From dblank at cs.brynmawr.edu Mon Oct 11 13:20:23 2010 From: dblank at cs.brynmawr.edu (Douglas S. Blank) Date: Mon Oct 11 12:42:11 2010 Subject: [Pyro-users] Hemisson Help In-Reply-To: <4CB15BF6.1040109@elvis.rowan.edu> References: <50034.69.119.239.113.1253584023.squirrel@mail.slc.edu> <4CB0E0DA.3080605@elvis.rowan.edu> <4CB11B72.10109@elvis.rowan.edu> <4CB14FA8.60305@elvis.rowan.edu> <4CB15BF6.1040109@elvis.rowan.edu> Message-ID: <45819.76.98.34.255.1286817623.squirrel@cs.brynmawr.edu> > And my output looks promising: > >> front ir: 0.5 >> moving ... >> front ir: 0.5 >> moving ... >> front ir: 0.5 >> moving ... >> front ir: 0.5 >> moving ... >> front ir: 0.5 >> moving ... >> front ir: 0.49853372434 >> moving ... >> front ir: 0.477028347996 >> moving ... >> front ir: 0.379276637341 >> stopping >> front ir: 0.379765395894 >> stopping >> front ir: 0.399804496579 >> stopping >> front ir: 0.396383186706 >> stopping > > > except my motors never actually start or stop. So what am I doing wrong??? > > Thanks, > > -- Jennie Three possibilities: 1) The serial port commands are being eaten. I seem to recall that we had a hard time trying to get robust serial communication with the Hemisson. 2) You are sending commands so fast that you don't actually see the robot stop. 3) You are using old code. The CD-ROM code might not be up to date. Also, computers are much faster than when we wrote that code years ago. Maybe some timing in the code is off. There are a few FIXME's in pyrobot/robot/khepera.py... perhaps you can try tweaking some values? Hope that helps, -Doug From dblank at cs.brynmawr.edu Mon Oct 11 13:32:56 2010 From: dblank at cs.brynmawr.edu (Douglas S. Blank) Date: Mon Oct 11 12:54:44 2010 Subject: [Pyro-users] Using Pyro with a Hemisson without Bluetooth (more info) In-Reply-To: <4CB0E0DA.3080605@elvis.rowan.edu> References: <50034.69.119.239.113.1253584023.squirrel@mail.slc.edu> <4CB0E0DA.3080605@elvis.rowan.edu> Message-ID: <33119.76.98.34.255.1286818376.squirrel@cs.brynmawr.edu> Just for completeness: > > Is it possible to use Pyro with a Hemisson without bluetooth? Yes. Either way, it is a serial connection. > I used the Hemisson Uploader to download the updated control program and > then plugged the hemisson into my machine via the serial cable. > > I use the knoppix CD. I start pyro, skip the server (that's for the > simulator, right?) The server is for simulators, and for those robots that need to start a server (Player/Stage comes to mind). > select the hemisson under robot but can't connect. > I've tried the default ports as well as as many permutations on tty0 > /dev/tty0 tty1 etc. > > Any ideas? I presume that you realized that it is probably something like: /dev/ttyS0 /dev/ttyUSB0 -Doug > Thanks, > > -- Jennie > > -- > Jennifer Kay > Associate Professor > Rowan University email: kay@elvis.rowan.edu > Computer Science Department voice: 856-256-4593 > 201 Mullica Hill Road fax: 856-256-4741 > Glassboro, NJ 08028 web: http://www.rowan.edu/~kay/ > > _______________________________________________ > Pyro-users mailing list > Pyro-users@pyrorobotics.org > http://emergent.brynmawr.edu/mailman/listinfo/pyro-users > From kay at elvis.rowan.edu Mon Oct 11 22:22:37 2010 From: kay at elvis.rowan.edu (Jennifer Kay) Date: Mon Oct 11 21:44:24 2010 Subject: [Pyro-users] More details: Problems with communication using the Hemisson over serial port Message-ID: <4CB3C66D.10408@elvis.rowan.edu> Hello again folks. I'm having some weird behavior that I can't explain. Kim Wheeler from Road Narrows has been trying to help me with this, but I think it's time for pyro wizards to help too. The problems (always when using the Hemisson over a serial cable) 1. When using the joystick, occasionally a command will appear not to be sent. e.g. I'll click as if to make the robot go forward, but it won't move. I'll click again and it'll work fine. 2. I will load a very simple brain with the following step function: def step(self): front = self.robot.ir[0][0].distance() print "front ir: ",front if front > 0.4: self.robot.move(0.5,0) print "moving ..." else: print "stopping" self.robot.stop() If I "step" through this using pyro, sometimes it will print "moving" but the motors will not turn on. Other times it prints "moving" and moves. Sure seems like these are related and presumably messages not making it across the serial port. Kim suggests that it might be intra-character delay. We're now way beyond my expertise, but she's pointed at the following links: http://www.mail-archive.com/pyro-users@emergent.brynmawr.edu/msg00040.html http://emergent.brynmawr.edu/pipermail/pyro-users/2006-August.txt Doug or anyone else have any ideas? Thanks, -- Jennie -------------- next part -------------- An HTML attachment was scrubbed... URL: http://emergent.brynmawr.edu/pipermail/pyro-users/attachments/20101011/099e4eff/attachment.htm From kay at elvis.rowan.edu Mon Oct 11 23:06:43 2010 From: kay at elvis.rowan.edu (Jennifer Kay) Date: Mon Oct 11 22:28:30 2010 Subject: [Pyro-users] Some tips on using the Pyro Live CD 5.0.0 Message-ID: <4CB3D0C3.6060908@elvis.rowan.edu> Just so that this is searchable for others who are trying to run of the Pyro Live CD 5.0.0, a couple of comments: *Problem*: Emacs doesn't appear to be on the CD anywhere and so you can't click edit from within pyro. *Easy fix*: In the shell window before starting pyro, type: export EDITOR=kwrite (note there is a space after the word export but nowhere else) Of course, with kwrite you can't run towers of hanoi, so you /could/ install emacs every time you run the CD, but kwrite is sufficient for most tasks. *Problem*: To connect to the Hemisson you need to pick a port *Fix*: If you're plugged into the serial port otherwise known as com1, try: /dev/ttyS0 If you're plugged into a USB port, try /dev/ttyUSB0 etc. -- Jennie -- Jennifer Kay Associate Professor Rowan University email: kay@elvis.rowan.edu Computer Science Department voice: 856-256-4593 201 Mullica Hill Road fax: 856-256-4741 Glassboro, NJ 08028 web: http://www.rowan.edu/~kay/ -------------- next part -------------- An HTML attachment was scrubbed... URL: http://emergent.brynmawr.edu/pipermail/pyro-users/attachments/20101011/fab13716/attachment.htm