Back
[04:10:31] <fenn_> fenn_ is now known as fenn
[16:34:04] <cradek> jmkasunich: control.c:2157 is what lets you reenable after a following error on a normal machine. I think it's wrong for any kins machine. If there are forward kins, it seems like we should use those. If there aren't, I'm not sure what to do - maybe drop back to joint mode and unhome?
[16:35:37] <cradek> as it is now, I get another joint following error forever when I try to reenable - I have to restart emc. (I have KINS_INVERSE_ONLY)
[16:38:58] <cradek> hmm, I see there is carte_pos_fb_ok but that is not being checked, not sure how it should all fit together
[16:57:49] <cradek> if anyone is interested: I have andy's configuration files but have not tried it yet
[16:58:13] <cradek> http://timeguy.com/cradek-files/emc/andy-sherline5000.tar.gz
[16:58:56] <CIA-20> EMC: 03jepler 07TRUNK * 10emc2/src/emc/usr_intf/axis/scripts/axis.py: allow the G92 coordinate system offset to be zeroed from the menu
[16:59:05] <CIA-20> EMC: 03jepler 07TRUNK * 10emc2/share/axis/tcl/axis.tcl: allow the G92 coordinate system offset to be zeroed from the menu
[16:59:21] <cradek> neat
[17:00:01] <jepler> cradek: what about the gcode program -- is that in one of the messages that went on the list?
[17:00:07] <cradek> yes
[17:00:20] <jepler> ah I found it now
[17:03:14] <alex_joni> hi guys
[17:03:44] <cradek> hi alex
[17:04:10] <alex_joni> cradek: I believe you are right
[17:04:24] <cradek> which thing?
[17:04:43] <alex_joni> if carte-pos-fb-ok, it should take carte-pos-fb
[17:04:50] <alex_joni> and update that as carte-pos-cmd
[17:05:06] <alex_joni> and carte-pos-fb should be updated constantly from joint-pos-fb
[17:05:16] <alex_joni> through inverse kins I think..
[17:05:34] <cradek> forward
[17:05:46] <alex_joni> forward then :)
[17:28:27] <alex_joni> jepler: around?
[17:28:42] <alex_joni> I managed to get AXIS to run connected remotely to another emc2
[17:29:08] <alex_joni> but the display doesn't update automatically (it only happens if I trigger an update somehow on the remote GUI)
[17:30:31] <alex_joni> I see the positions update if I drag the display around, but the cone doesn't move from the position I commanded on the remote GUI
[17:32:57] <jepler> alex_joni: beats me -- I have never run axis that way
[17:33:17] <jepler> andy's .ngc file completed for me and all the arcs are drawn properly
[17:33:31] <jepler> preview and backplot matched 100%
[17:33:49] <cradek> with his ini/varfile?
[17:33:51] <alex_joni> I do get an "error emcStatusBuffer invalid"
[17:33:52] <jepler> yes
[17:34:00] <cradek> well crap
[17:34:32] <jepler> static bool check_stat(RCS_STAT_CHANNEL *emcStatusBuffer) {
[17:34:32] <jepler> if(!emcStatusBuffer->valid()) {
[17:34:32] <jepler> PyErr_Format( error, "emcStatusBuffer invalid" );
[17:34:32] <jepler> return false;
[17:34:40] <cradek> did you see his screen cap? it's definitely as he describes.
[17:34:47] <jepler> yes I saw his screen cap
[17:37:03] <jepler> alex_joni: after any error in LivePlotter.update(), the live plotter stops
[17:37:20] <jepler> alex_joni: i think that's what you're getting
[17:37:23] <alex_joni> I only get the emcStatusBuffer invalid error after a while
[17:37:41] <alex_joni> at startup (s = emc.stat(), s.poll()) there's no error
[17:37:51] <jepler> well, you could try changing the handling of that error (around line 1369 of my axis.py)
[17:38:06] <jepler> remove 'del self.stat', 'return' so that it goes on trying to continue updating
[17:38:15] <jepler> or, figure out why the update fails
[17:38:23] <jepler> (self.stat.poll())
[17:39:19] <alex_joni> what's with the extra () ?
[17:39:39] <jepler> which extra () ?
[17:39:46] <alex_joni> (self.stat.poll())
[17:40:00] <jepler> nothing
[17:40:10] <alex_joni> oh, I thought it might mean something in python
[17:40:12] <jepler> no
[17:40:39] <alex_joni> if I let it go on (remove the stuff above), I get lots of errors .. nothing else
[17:41:34] <alex_joni> the odd thing is that the beginning things work
[17:41:49] <alex_joni> AXIS starts up enabled and with estop-reset (just like on the server machine)
[17:41:56] <jepler> well, it looks like you could look at emcStatusBuffer->error_type (in C++) to find out more about the error
[17:42:58] <alex_joni> * alex_joni tries that
[17:47:46] <alex_joni> can I put some if clause around import ?
[17:48:01] <alex_joni> in python I mean.. something like #ifdef ..
[17:50:13] <jepler> sure -- import is just another statement. You can write this: if external_temperature < 65: import winter_clothes
[17:50:21] <jepler> (of course, you wouldn't write that since you're in europe..)
[17:50:27] <cradek> ha
[17:50:38] <alex_joni> :)
[17:50:48] <cradek> and an american writing that would have a l10n bug
[17:54:18] <alex_joni> error_type is 5
[17:55:02] <jepler> "NML_INTERNAL_CMS_ERROR",
[17:56:53] <alex_joni> humm..
[17:56:59] <alex_joni> EMC Status seems to work ok
[17:57:26] <jepler> in axis, there are two threads which may both be polling the status buffer
[17:57:30] <lerneaen_hydra> l10n?
[17:57:34] <jepler> I wonder if that's broken for non-local transport
[17:57:48] <jepler> lerneaen_hydra:
http://www.google.com/search?q=define:l10n
[17:58:12] <lerneaen_hydra> ah right
[18:00:33] <jepler> lunchtime
[18:00:33] <jepler> !
[18:12:29] <alex_joni> set_rcs_print_flag(PRINT_EVERYTHING) :)
[18:14:33] <alex_joni> libnml/buffer/tcpmem.cc 1386: TCPMEM: Returned serial number(0) does not match expected serial number(53).
[18:18:48] <alex_joni> jepler: I see 2 channels get created that listen from emcStatus
[18:22:02] <alex_joni> bbl
[19:06:18] <jepler> hm -- and it's actually the *same* RCS_STAT_CHANNEL that is used from both threads of axis (the position logger thread and the gui thread)
[19:06:32] <jepler> the other one is a part of the command object, and is used to verify reception or completion of commands
[19:07:10] <jepler> I bet that eventually you can get a call to .peek() in both threads on the same RCS_STAT_CHANNEL
[19:08:22] <jepler> around line 1326 you could try sending in a separate stat object as the first argument to emc.positionlogger: emc.stat() instead of self.stat)
[19:10:12] <alex_joni> * alex_joni tries that
[19:11:38] <alex_joni> that gives me a Segmentation fault :)
[19:12:33] <jepler> how interesting
[19:12:55] <alex_joni> but line 1318 or so is self.stat = emc.stat()
[19:13:10] <alex_joni> does emc.stat() return a new stat everytime?
[19:13:13] <jepler> yes
[19:13:16] <jepler> it's the constructor
[19:13:29] <alex_joni> I see..
[19:13:41] <jepler> try self.otherstat = emc.stat() and then pass self.otherstat as the first argument to emc.positionlogger
[19:14:25] <alex_joni> LivePlotter craps out
[19:14:32] <alex_joni> it doesn't have a stat attribute
[19:14:46] <jepler> I meant you'd add self.otherstat = emc.stat() and keep self.stat = emc.stat()
[19:14:55] <alex_joni> doing that now
[19:18:41] <CIA-20> EMC: 03jepler 07TRUNK * 10emc2/src/emc/usr_intf/axis/extensions/emcmodule.cc: keep proper reference count of the internal stat object of position logger objects. This fixes a segfault encountered by alex_joni when trying to use a different stat object than liveplotter.stat in positionlogger.
[19:18:57] <jepler> OK the segfault when you use 'emc.stat()' is a real bug; that checkin should fix it
[19:19:45] <alex_joni> it works like this..
[19:20:15] <jepler> with 'self.otherstat'?
[19:20:48] <jepler> when you update emcmodule.cc, the other variation (that has a separate emc.stat object but doesn't bother to store it in self.otherstat) should work just as well
[19:20:58] <alex_joni> with self otherstat
[19:21:14] <alex_joni> oh, ok.. will try it now
[19:21:37] <alex_joni> wonder how many conflicts I'll get :D
[19:21:42] <jepler> then you can point me at the documentation on the thread safety of RCS :-P
[19:21:45] <alex_joni> * alex_joni hugs CIA-20
[19:21:46] <CIA-20> * CIA-20 hugs alex_joni
[19:21:58] <alex_joni> jepler: I have a book around here
[19:22:04] <jepler> book? what's that?
[19:22:10] <jepler> maybe you mean a pdf?
[19:22:14] <alex_joni> some strange pdf
[19:22:21] <alex_joni> it's on some white supports
[19:22:23] <jepler> crazy hungarians with their "T-books"
[19:22:25] <alex_joni> and search doesn't work
[19:22:43] <alex_joni> it only has a poor index
[19:22:54] <alex_joni> and copy/paste is disabled
[19:23:47] <alex_joni> huh.. no merging errors :)
[19:24:16] <alex_joni> but I still get the emcStatusBuffer invalid
[19:25:27] <jepler> darn
[19:25:39] <alex_joni> it works when I pass emc.stat()
[19:25:49] <alex_joni> to emc.positionlogger()
[19:25:57] <alex_joni> YAY
[19:26:08] <alex_joni> * alex_joni is watching 2 AXIS'es running the splash code
[19:26:19] <alex_joni> line colouring works
[19:26:23] <alex_joni> all the buttons seem to work
[19:26:30] <alex_joni> and the previews match up
[19:26:48] <alex_joni> (had to manually erase some offsets forgot in the remote gui var file)
[19:28:07] <alex_joni> jepler: found one thing that doesn't work.. (the Vel estimate)
[19:29:32] <jepler> huh -- that just comes out of the stat buffer like everything else
[19:30:29] <alex_joni> * alex_joni might have borked unwillingly
[19:31:52] <alex_joni> http://dsplabs.utt.ro/~juve/blog/index.cgi-files/sandbox/vm-axis-remote.PNG
[19:33:36] <jepler> how does axis obtain the .var file that is used in generating the preview?
[19:34:20] <alex_joni> I put a var file in the remote config folder
[19:34:38] <alex_joni> obviously when I start to change things it won't work anymore
[19:35:02] <alex_joni> (on the first touch-off only the server will change the var file, and the remote AXIS won't ..)
[19:35:07] <alex_joni> I think at least..
[19:35:39] <jepler> before it (re)generates the preview, axis relies on a trick to be sure that the interpreter has written the var file to disk with current values
[19:36:50] <alex_joni> I bet it would work if I nfsshare the config folder
[19:37:06] <alex_joni> and have both inis in the same folder referencign the same files
[19:38:10] <alex_joni> hmm.. when I use touch-off something unexpected happens
[19:38:41] <alex_joni> on both GUIs the coordinate reference gets moved (the XYZ lines), yet the program stays where it was
[19:39:34] <jepler> yes I am sure that's what happens
[19:40:23] <alex_joni> so as long as GUIs try to write/read to the var file directly, the remote stuff won't work properly
[19:40:39] <jepler> two reasons: first, the program only is automatically reloaded in the gui where reload or touch off was actually performed. second, while axis gets the current offset in effect from the stat buffer, the preview uses offset coordinates from the var file which as we discussed wouldn't get updated
[19:40:57] <jepler> so hitting reload in the remote gui won't help
[19:41:08] <alex_joni> right.. only in the server gui it might
[19:41:15] <alex_joni> s/might/would/
[19:41:35] <alex_joni> but the server gui doesn't relead cause it didn't see the touch-poff
[19:41:40] <alex_joni> off :)
[19:42:43] <jepler> I understand that it's problematic to use the var file from the gui -- I've certainly argued against manipulating it! -- but I don't see how you're going to avoid it when generating a preview plot.
[19:42:43] <alex_joni> anyways.. are you sure vel comes from the stat ?
[19:43:01] <cradek> yes
[19:43:03] <alex_joni> jepler: reading/writing through task
[19:43:07] <jepler> pretty sure. spd = to_internal_linear_unit(s.current_vel)
[19:43:19] <alex_joni> cradek: I ran EMC Status on the server machine
[19:43:25] <jepler> alex_joni: you mean, using some magical calls that don't exist yet?
[19:43:41] <alex_joni> jepler: yes
[19:44:14] <jepler> alex_joni: well you can certainly imagine why I am not doing that at present :-P
[19:44:18] <alex_joni> hmm.. current_vel stays 0 on the remote EMC Status, but it changes on the server EMC status
[19:44:36] <jepler> perhaps there's an update() call missing
[19:44:38] <alex_joni> jepler: hmm would you if they would exist?
[19:44:49] <alex_joni> jepler: all other things change in EMC Status
[19:45:04] <alex_joni> not all.. but a lot of them do :)
[19:45:23] <jepler> alex_joni: no, I would let someone else do it though
[19:45:36] <alex_joni> I see position, actual_position, inpos, etc.. change
[19:54:43] <alex_joni> jepler: mind looking at a patch?
[19:56:32] <jepler> I can glance at it but I should be working on other stuff now..
[19:57:30] <alex_joni> no hurry.. I'll pastebin the changes I did to axis and emcmodule.cc
[19:57:39] <alex_joni> maybe they are nonintrusive enough to be included :)
[19:59:18] <alex_joni> pastebin.ca/832920
[20:01:08] <jepler> does 'import hal' fail if hal is not available?
[20:01:33] <jepler> 'global hal_present' shouldn't be needed in 'def forget()'.
[20:01:51] <alex_joni> import hal errors out
[20:02:14] <alex_joni> if it can't init hal
[20:02:15] <jepler> really? what error does it print?
[20:02:21] <alex_joni> RTAPI ..
[20:02:25] <alex_joni> let me rerun it
[20:02:28] <jepler> $ halcmd show
[20:02:28] <jepler> RTAPI: ERROR: could not open shared memory (errno=2)
[20:02:44] <jepler> $ python -c 'import hal; print "succeeded"'
[20:02:44] <jepler> succeeded
[20:02:57] <alex_joni> any idea how to remove a export from bash?
[20:03:57] <alex_joni> you're right.. the import succeeds
[20:04:07] <alex_joni> but hal.error: Operation failed
[20:04:21] <jepler> unset VARNAME? export -n VARNAME ?
[20:04:34] <alex_joni> it errors out at: comp = hal.component("axisui")
[20:05:01] <jepler> sure, but that is now conditional on hal_present
[20:05:12] <alex_joni> right.. I saw no reason to import hal..
[20:05:17] <alex_joni> so I conditioned that too
[20:05:33] <alex_joni> I somehow thought it saves some memory :D
[20:05:40] <alex_joni> & startup time :P
[20:05:51] <alex_joni> but that's just me guessing ..
[20:06:01] <jepler> + if not 'comp' in globals(): return # this is called once during startup before comp exists
[20:06:34] <jepler> surely this comment doesn't reflect why you added this line now
[20:06:44] <alex_joni> I saw that later, thought it's a cleaner conditional
[20:06:52] <alex_joni> err.. no, I copied the whole line
[20:06:56] <jepler> surely 'if not hal_present: return' would be better
[20:06:57] <alex_joni> let me fix the comment
[20:10:05] <jepler> probably axis should skip running the postgui halfile if not hal_present
[20:10:23] <alex_joni> jepler: well.. one could remove it from the ini
[20:15:36] <CIA-20> EMC: 03alex_joni 07TRUNK * 10emc2/src/emc/usr_intf/axis/extensions/emcmodule.cc: include error_type (src/libnml/nml.hh: NML_ERROR_TYPE) together with emcStatusBuffer invalid message
[20:19:23] <alex_joni> jepler: regarding the emc.stat() vs. self.stat
[20:19:27] <alex_joni> should I condition that too?
[20:20:47] <jepler> alex_joni: no, even if it seems to work for the 'local' case it is probably more correct to have separate stat buffers
[20:24:36] <alex_joni> I verified that AXIS still works for regular setups
[20:42:47] <jepler> then I don't see a problem with checking it in..
[20:43:06] <alex_joni> ok, I massaged the comments a bit :)
[20:44:48] <CIA-20> EMC: 03alex_joni 07TRUNK * 10emc2/src/emc/usr_intf/axis/scripts/axis.py: added check for env(AXIS_NO_HAL), if that's present no hal specific stuff will be done - like exporting jog-related pins and such.