#emc-devel | Logs for 2010-10-04

Back
[02:30:55] <ries_> ries_ is now known as ries
[10:00:47] <psha> Is there any 'public' api for function like 'halcmd getp'?
[10:15:37] <alex_joni> api?
[10:17:29] <psha> there is api (libhal) for creating pins
[10:17:42] <psha> but no one for accessing already created
[10:18:31] <alex_joni> from what language?
[10:18:32] <psha> But i'm happy with hal_priv now :)
[10:18:34] <psha> C
[10:19:27] <alex_joni> only the hal .h files
[10:21:15] <psha> I was afraid that hal_priv.h is 'not allowed' to use
[10:46:51] <SWPadnos> it's required, if you want to go messing around with the HAL metadata
[11:05:20] <psha> Want to put axis positions over video stream as a proof of concept
[11:05:35] <psha> I've already embeded it into axis :)
[11:05:50] <psha> Via ~15 lines of code
[11:06:19] <psha> hm, 30
[11:09:36] <SWPadnos> you don't need hal_priv for that, you only need to read and/or change pin values, which "import hal" already gives you
[11:10:16] <SWPadnos> it also gives you the ability to create additional pins and parameters (which does mess with metadata, I guess)
[11:17:35] <psha> i'm unable to use 'import hal'
[11:17:44] <psha> Axis serves only as 'parent window'
[11:18:18] <psha> Any subrocess capable of embeding into windows (xterm, rxvt, mplayer,....) may reparent there
[11:18:28] <psha> Axis process is left intact
[11:18:39] <psha> That's why changes are so small
[11:19:02] <psha> Embeded window is camview (a bit fixed) program from camunits project
[11:19:14] <psha> With video filter that's messing with hal
[11:19:53] <SWPadnos> ok. then you need to use hal_priv (for C) or import hal (for python)
[11:20:03] <SWPadnos> I think someone made pascal bindings too, but I don't know where they are
[11:20:15] <SWPadnos> oh, and tcl/tk as well, I think
[11:20:48] <psha> Yes, i've already found it... Already catching bugs :)
[11:20:57] <SWPadnos> gseundheit
[11:21:04] <psha> I'll post screenshot when it'll be ready :)
[11:21:10] <SWPadnos> cool
[11:26:37] <psha> May i ask another dummy question about pins/signals
[11:26:43] <SWPadnos> yes
[11:26:51] <psha> So I'll looking into halui.axis.0.pos-feedback
[11:26:53] <SWPadnos> (was that it?)
[11:26:58] <psha> :)
[11:27:13] <psha> pin->signal is NULL
[11:27:30] <psha> You said that real value is stored in signal
[11:27:49] <psha> So when signal is 0 there is no value?
[11:27:55] <psha> But it seem that it's in dummysig
[11:28:15] <SWPadnos> no, if the pin points to a signal, and that value is 0, the signal is at zero
[11:28:20] <SWPadnos> a signal is never a pointer
[11:28:43] <SWPadnos> the pin is initialized to point to dummysig, so there is never a problem with dereferencing it
[11:28:46] <psha> O, forgot to do SHMPTR
[11:29:31] <SWPadnos> that's important too :)
[11:29:36] <psha> if (pin->signal != 0) {
[11:29:36] <psha> sig = SHMPTR(pin->signal);
[11:29:36] <psha> d_ptr = SHMPTR(sig->data_ptr);
[11:29:36] <psha> } else {
[11:29:36] <psha> sig = 0;
[11:29:38] <psha> d_ptr = &(pin->dummysig);
[11:29:41] <psha> }
[11:29:43] <psha> it's from halcmd
[11:30:00] <SWPadnos> hmmm
[11:30:45] <SWPadnos> ah right. if you connect the pin to a signal, it points there, else point it to the dummysig
[11:31:00] <psha> yea
[11:31:02] <psha> it's working!
[11:31:09] <SWPadnos> yea!
[11:31:27] <SWPadnos> does it work with any old camera supported by v4l or similar?
[11:32:26] <psha> it's working with everything supported by camunits
[11:32:46] <psha> e'g v4l, v4l2, dc1394, etc...
[11:33:00] <SWPadnos> nice
[11:33:15] <psha> also there is emerging support for digicam/gige cameras
[11:34:33] <SWPadnos> cool. I imagine the preview mode in gphoto (with certain Nikon and Canon cameras) could be used for rough positioning, then use high res captures for fine positioning
[11:35:51] <psha> I'll throw screenshot after dinner
[11:56:34] <alex_joni> you sound like an exception
[12:01:13] <SWPadnos> you're closest, you have to catch him
[12:10:12] <psha> http://psha.org.ru/p/axis-camera.png
[12:10:35] <psha> SWPadnos: only camera I have is mounted in notebook
[12:11:08] <psha> probe gcode is running
[12:11:24] <SWPadnos> cool
[12:13:04] <psha> http://psha.org.ru/p/0001-axis-Add-dynamic-tabs.patch
[12:13:09] <psha> and that's all needed in axis
[12:20:10] <alex_joni> psha: maybe this can be done from axis_rc ?
[12:20:29] <alex_joni> or .axisrc or whatever it's called?
[12:23:04] <psha> sure
[12:23:12] <psha> if there is such file )
[12:23:23] <psha> it's python, everything may be done from everywhere :)
[12:26:36] <psha> alex_joni: tested, working like charm
[12:27:05] <psha> thanks for tip
[12:38:49] <alex_joni> psha: then you don't need to patch axis, and everyone can do it easily
[12:39:02] <alex_joni> s/everyone/anyone/
[12:39:03] <psha> already writing to wiki
[12:43:22] <psha> May you point me to the page with wiki syntax?
[12:47:12] <psha> http://wiki.linuxcnc.org/cgi-bin/emcinfo.pl?Axis_Embed_Video
[13:05:07] <alex_joni> http://www.usemod.com/cgi-bin/wiki.pl?TextFormattingRules
[13:05:41] <psha> thanks
[13:15:46] <alex_joni> sure