From nswoboda at clip.dia.fi.upm.es Fri May 18 10:29:19 2007 From: nswoboda at clip.dia.fi.upm.es (nswoboda@clip.dia.fi.upm.es) Date: Fri May 18 10:29:23 2007 Subject: [Pyro-developers] Erratic enable motors Message-ID: Hello. More on getting Pyro to work with the Erratic. In the Erratic manual it says that you need to call Player's Position2dProxy's SetMotorEnable(bool) to enable the motors. (A light changes colors on the robot when they are enabled which isn't happening when running Pyro, but is with playerjoy.) In playerc.py there is an enable method in position2d which seems to be what I want. However when I try self._dev.enable(1) or self._client_.__class__.__dict__["enable"] in startDevice (robot/player.py) I get errors. Any hints? Nik ____________________________________________________ This matter[i.e. zen] is like a great mass of fire; when you approach it your face is sure to be scorched. It is again like a sword about to be drawn; when it is once out of the scabbard, someone is sure to lose his life. But if you neither fling away the scabbard nor approach the fire, you are no better than a piece of rock or of wood. Coming to this pass, one has to be quite a resolute character full of spirit. -Tai-Hui From dblank at brynmawr.edu Fri May 18 10:55:51 2007 From: dblank at brynmawr.edu (Douglas S. Blank) Date: Fri May 18 10:55:54 2007 Subject: [Pyro-developers] Erratic enable motors In-Reply-To: References: Message-ID: <45538.76.98.12.59.1179500151.squirrel@webmail.brynmawr.edu> On Fri, May 18, 2007 10:29 am, nswoboda@clip.dia.fi.upm.es said: > Hello. > > More on getting Pyro to work with the Erratic. > > In the Erratic manual it says that you need to call Player's > Position2dProxy's SetMotorEnable(bool) to enable the motors. (A > light changes colors on the robot when they are enabled which > isn't happening when running Pyro, but is with playerjoy.) > > In playerc.py there is an enable method in position2d which > seems to be what I want. However when I try > > self._dev.enable(1) Nik, Did you try: self.position[0]._dev.enable(1) (that is, you were calling enable() on the right object?) What errors do you get when you try these? I looked at the lower level playerc.py and there is an enable() on the Python playerc_position2d object that looks like it should do the right thing. You are using the latest Pyro out of CVS? With the latest Player/Stage? -Doug > or > > self._client_.__class__.__dict__["enable"] > > in startDevice (robot/player.py) I get errors. > > Any hints? > > Nik > ____________________________________________________ From nswoboda at clip.dia.fi.upm.es Fri May 18 11:21:26 2007 From: nswoboda at clip.dia.fi.upm.es (nswoboda@clip.dia.fi.upm.es) Date: Fri May 18 11:21:31 2007 Subject: [Pyro-developers] Erratic enable motors In-Reply-To: <45538.76.98.12.59.1179500151.squirrel@webmail.brynmawr.edu> from "Douglas S. Blank" at May 18, 2007 10:55:51 AM Message-ID: > Did you try: > > self.position[0]._dev.enable(1) I just added that to line 46 of robot/player.pl and I get an attribute error. But putting self.robot.position[0]._dev.enable(1) in setup of Joystick.pl causes the robot's light to change the right color (the motors are enabled) but still can't get motor movement when using the joystick gui. This couldn't be related to the port 7000 simulation error that I get on the console? In any case I assume that the fix needs to go into pyro to keep the brains neutral. > You are using the latest Pyro out of CVS? With the latest Player/Stage? I'm using the patched (by videre) version of player/stage 2.0.3 which shipped with the Erratic and pyrobot-5.0.0-fc6 (rpm converted to deb). Nik ____________________________________________________ Just think of the trees; they let the birds perch and fly, with no intention to call them when they come and no longing for their return when they fly away. If people's hearts can be like the trees, they will not be off the way. -Langya From dblank at brynmawr.edu Fri May 18 11:34:58 2007 From: dblank at brynmawr.edu (Douglas S. Blank) Date: Fri May 18 11:35:02 2007 Subject: [Pyro-developers] Erratic enable motors In-Reply-To: References: <45538.76.98.12.59.1179500151.squirrel@webmail.brynmawr.edu> from "Douglas S. Blank" at May 18, 2007 10:55:51 AM Message-ID: <17486.76.98.12.59.1179502498.squirrel@webmail.brynmawr.edu> On Fri, May 18, 2007 11:21 am, nswoboda@clip.dia.fi.upm.es said: >> Did you try: >> >> self.position[0]._dev.enable(1) > > I just added that to line 46 of robot/player.pl and I get an > attribute error. Right, because you are in the position object at that point. Simply doing a self._dev.enable(1) should work (but you might have to wait a bit to make sure that the connection is going). > But putting > > self.robot.position[0]._dev.enable(1) > > in setup of Joystick.pl causes the robot's light to change the right > color (the motors are enabled) but still can't get motor movement when > using the joystick gui. Ok, then that is a different problem. So, good, you can turn the motors on and off (and I think we have code to make self.robot.position[0].enable(1) work as well... let me know if that doesn't). > This couldn't be related to the port 7000 > simulation error that I get on the console? Shouldn't be---that is only used in simulations. Can you type expressions into the Python Command box in the main Pyro GUI: robot.move(1, 0) That should send a move full speed ahead command. If that doesn't work, then the issue is with position2d. If it does work, then the problem is with the joystick GUI. > In any case I assume that the fix needs to go into pyro to keep the > brains neutral. We haven't put an automatic "motors on" command in the turning on the position interface for safety reasons, but you can add that to yours (or make it an option that could be set). >> You are using the latest Pyro out of CVS? With the latest Player/Stage? > > I'm using the patched (by videre) version of player/stage 2.0.3 which > shipped with the Erratic and pyrobot-5.0.0-fc6 (rpm converted to deb). That sounds like all the right stuff! I think that you are close. -Doug > Nik > ____________________________________________________ > > Just think of the trees; they let the birds perch and fly, with > no intention to call them when they come and no longing for > their return when they fly away. If people's hearts can be like > the trees, they will not be off the way. > -Langya > -- Douglas S. Blank Associate Professor, Bryn Mawr College http://cs.brynmawr.edu/~dblank/ Office: 610 526 6501 From nswoboda at clip.dia.fi.upm.es Fri May 18 11:51:39 2007 From: nswoboda at clip.dia.fi.upm.es (nswoboda@clip.dia.fi.upm.es) Date: Fri May 18 11:51:42 2007 Subject: [Pyro-developers] Erratic enable motors In-Reply-To: <17486.76.98.12.59.1179502498.squirrel@webmail.brynmawr.edu> from "Douglas S. Blank" at May 18, 2007 11:34:58 AM Message-ID: > Right, because you are in the position object at that point. Simply doing > a self._dev.enable(1) should work (but you might have to wait a bit to > make sure that the connection is going). Maybe not waiting was the problem. > Can you type expressions into the Python Command box in the main Pyro GUI= > : > > robot.move(1, 0) That works! Strange that the GUI is the problem. Thanks. > We haven't put an automatic "motors on" command in the turning on the > position interface for safety reasons, but you can add that to yours (or > make it an option that could be set). OK, I understand. Our other robot, the amigobot, has a 'motors on' button but the erratic doesn't so it needs to be done through software. Once I get a few more kinks worked out and redo the install on robot #2 I'll send step-by-step instructions for installing pyro on an erratic just out of the box. Nik ____________________________________________________ The believer is happy, the doubter wise. -Greek Proverb