Need somebody schmardter than me

G

Gene Heskett

Greetings all;

I am trying to make a machine vision kit of modules work in linuxcnc, which
uses a lot of python for scripts and gui controls in the user interface.

This is on a Ubu 10.04.4 LTS install, which because linuxcnc is intimately
married to an RTAI equipt kernel version, has not been updated past
2.6.32-12x-RTAI. Those patches are very invasive but a 3.8.something
version is being worked on as we speak.

But in the meantime, in an effort to debug the failure of the camera
application to work WITH linuxcnc, I ran the debug level up to maximum to
see if I might find the first point of failure, and get this on the console
when linuxcnc is launched from the cli:
================

Xlib.protocol.request.QueryExtension
parse error?
unable to instantiate [/dev/video0]

================

Then it reverts to the normal traceback reporting the same thing but
quoting the line numbers of the two scripts that led to the failed call.

/dev/video0 exists, is created when the usb cable from the camera is
plugged in, and the program "cheese" can display this cameras output just
fine using /dev/video0 as the src device.

When cheese runs this camera, there is a several second delay while cheese
is apparently talking to it to establish the correct output format before
cheese starts displaying its output, so I am wondering if an initialization
time delay might be the fix, but I haven't a clue about how to go about
that in python despite my copying the list for what, a year or more now?

So, where should I start?

Heck, maybe I might learn a bit of python while running this one down. ;-)

Thanks all.

Cheers, Gene
--
"There are four boxes to be used in defense of liberty:
soap, ballot, jury, and ammo. Please use in that order."
-Ed Howdershelt (Author)
My web page: <http://coyoteden.dyndns-free.com:85/gene> is up!
My views
<http://www.armchairpatriot.com/What Has America Become.shtml>
From 0 to "what seems to be the problem officer" in 8.3 seconds.
-- Ad for the new VW Corrado
A pen in the hand of this president is far more
dangerous than 200 million guns in the hands of
law-abiding citizens.
 
R

Roy Smith

[much that doesn't appear to have anything to do with Python elided]
When cheese runs this camera, there is a several second delay while cheese
is apparently talking to it to establish the correct output format before
cheese starts displaying its output, so I am wondering if an initialization
time delay might be the fix,

In general, when you have some sort of synchronization problem, i.e.,
"this piece of code must not start running until that other thing is
completed", sticking in a time delay is:

1) Almost always the wrong thing to do.

2) Very often the most simple solution.

How it can simultaneously be both of these is left as an exercise for
the reader :)
but I haven't a clue about how to go about that in python

import time
time.sleep(1.5)

will sleep for 1.5 seconds.
 
G

Gene Heskett

[much that doesn't appear to have anything to do with Python elided]
When cheese runs this camera, there is a several second delay while
cheese is apparently talking to it to establish the correct output
format before cheese starts displaying its output, so I am wondering
if an initialization time delay might be the fix,

In general, when you have some sort of synchronization problem, i.e.,
"this piece of code must not start running until that other thing is
completed", sticking in a time delay is:

1) Almost always the wrong thing to do.

2) Very often the most simple solution.

How it can simultaneously be both of these is left as an exercise for
the reader :)
Oh Loverly...
import time

That of course goes near the top of the script.
time.sleep(1.5)

I'll see if I can see a sensible place to add this one.
will sleep for 1.5 seconds.

Thanks. Its likely I'll be back because now that I think about it, that
first line I quoted is quite likely from the function itself, and doesn't
serve to establish the context of the call, hence the actual arguments to
it.

Its one of those cases where, if the function were to also echo the
arguments it was handed, the troubleshooting would be a lot more
straightforward because you could then see the error causer right up front.

Cheers, Gene
--
"There are four boxes to be used in defense of liberty:
soap, ballot, jury, and ammo. Please use in that order."
-Ed Howdershelt (Author)
My web page: <http://coyoteden.dyndns-free.com:85/gene> is up!
My views
<http://www.armchairpatriot.com/What Has America Become.shtml>
Automobile, n.:
A four-wheeled vehicle that runs up hills and down pedestrians.
A pen in the hand of this president is far more
dangerous than 200 million guns in the hands of
law-abiding citizens.
 
C

Chris Angelico

That of course goes near the top of the script.


I'll see if I can see a sensible place to add this one.

The import doesn't have to happen near the top of the script; it's an
executable statement like any other. If you want to keep it near the
time.sleep() call, that'll work fine. It's up to you to decide what
goes where.

ChrisA
 
G

Gene Heskett

The import doesn't have to happen near the top of the script; it's an
executable statement like any other. If you want to keep it near the
time.sleep() call, that'll work fine. It's up to you to decide what
goes where.

ChrisA

Actually, I just found the authors names in the manpage. They wrote this
thing back in Ubuntu Hardy 8.04 LTS days, so I have posted a note and a
screen shot pix to them as I am now convinced its a Hardy to Lucid thing.

Thank you for taking the time to try & sort me, I know most have better
things to do.

Cheers, Gene
--
"There are four boxes to be used in defense of liberty:
soap, ballot, jury, and ammo. Please use in that order."
-Ed Howdershelt (Author)
My web page: <http://coyoteden.dyndns-free.com:85/gene> is up!
My views
<http://www.armchairpatriot.com/What Has America Become.shtml>
All things are possible, except for skiing through a revolving door.
A pen in the hand of this president is far more
dangerous than 200 million guns in the hands of
law-abiding citizens.
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Members online

No members online now.

Forum statistics

Threads
473,995
Messages
2,570,230
Members
46,819
Latest member
masterdaster

Latest Threads

Top