Subject:
|
Painful details on RCX.pm problems
|
Newsgroups:
|
lugnet.robotics.rcx
|
Date:
|
Mon, 6 Nov 2000 22:26:36 GMT
|
Viewed:
|
1617 times
|
| |
| |
More RCX.pm stuff in case John Quillan (to whom I'll be forever indebted, if
this ever works) shows up.
So I have this code:
#!/usr/bin/perl
use LEGO::RCX;
my $rcx = new LEGO::RCX();
$rcx->ping();
$k = 0;
while($k ne 10)
{
print($k.") ".$rcx->getSensor(1)."\n");
sleep(5);
$k++;
}
This should turn on the robot, ask the bot for the sensor value, wait long
enough for the tower to turn off, and then turn it back on to get another
value. Almost without fail I get this:
0)
1) 2322
2)
3)
4)
5)
6)
7)
8)
9)
After #1, the tower just turns off and never turns itself back on. I've tried
to look through RCX.pm to see what could be going wrong, but my very cursory
glance reveals nothing.
Additionally, this isn't a problem with the tower or the port (at least not
directly) since I can start a second copy of this script while the first one is
still running, and it will initialize the tower just fine.
Anyway, any suggestions are appreciated- this may be the last chance I have to
hack on this for some time, so while I'll look deeper at RCX.pm tonight, any
time that can be saved will be appreciated.
Thanks!
Luis
In lugnet.robotics.rcx, Luis Villa writes:
> So, I have some more questions to anyone who wants to answer them :) (John,
> hope you are listening ;)
>
> 1) Do I need to recreate $rcx after a while? It looks to me that under many
> circumstances, repeated calls to the RCX will fail to cause the tower to turn
> on. Is this a known bug? feature? Anyone?
>
> 2) If anyone cares, I'm attempting to teach myself the GTK GUI tools by
> building a GUI for RCX.pm which would allow linux users to control their RCX
> remotely. If anyone has any feature requests, now is the time to get them in :)
> Of course, if I can't figure out why RCX.pm is flaking on me then I can't see
> the project getting finished any time soon (no time to recreate the
> functionality of RCX.pm in LNP :|
>
> Anyway, hope someone can enlighten me...
> Luis
>
>
> In lugnet.robotics.rcx, Luis Villa writes:
> > So, I've finally found a little bit of time to play with RCX.pm, and it is
> > pretty cool. However, I'm having lots of problems convincing the RCX to
> > actually do things :) it appears that in many cases, the first signal sent to
> > the RCX is always ignored. Additionally, it appears that multiple commands sent
> > in succession will all be ignored unless there are sleeps between them (I'm
> > trying to experiment to see how long the sleeps need to be.)
> > Anyone have any suggestions as to what I might be doing wrong? Or is this
> > normal behavior?
> > Luis
|
|
Message has 1 Reply: | | Re: Painful details on RCX.pm problems
|
| Luis, I am here. I tryed your code. The interesting this is the first time I tryed it I got the following results with the towwer turning off after 5. But repeated runs of the program dont seem to have any problems. 0) 41 1) 41 2) 44 3) 45 4) 40 (...) (24 years ago, 7-Nov-00, to lugnet.robotics.rcx)
|
Message is in Reply To:
| | Re: RCX.pm questions [and Linux RCX GUI question]
|
| So, I have some more questions to anyone who wants to answer them :) (John, hope you are listening ;) 1) Do I need to recreate $rcx after a while? It looks to me that under many circumstances, repeated calls to the RCX will fail to cause the tower (...) (24 years ago, 6-Nov-00, to lugnet.robotics.rcx)
|
10 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
|
|
|
|