Probe Basic backplot error when loading file

More
1 year 1 week ago #336860 by Unlogic
It's been a long time since I found any bugs in Probe Basic but this morning I came across a backplot error.

To trigger this bug I loaded the attached g-code file and probed 3 work offsets using the built in probing functionality (G54, G55, G56).

As soon as I probed the final offset G56 I got the first error below.

 

Attachment not found


Code:
[qtpyvcp.widgets.input_widgets.gcode_text_edit][INFO] File encoding: ascii (gcode_text_edit.py:538) [qtpyvcp.widgets.display_widgets.vtk_backplot.vtk_backplot][INFO] -------Draw time 1.4562861919403076 seconds --- (vtk_backplot.py:762) [qtpyvcp.app.launcher][CRITICAL] Unhandled exception in vtk_backplot.py line 849 (launcher.py:37) Traceback (most recent call last): File "/usr/lib/python3/dist-packages/qtpyvcp/widgets/display_widgets/vtk_backplot/vtk_backplot.py", line 849, in load_program point_01_pos = self.path_offset_start_point[prev_wcs_index] ~~~~~~~~~~~~~~~~~~~~~~~~~~~~^^^^^^^^^^^^^^^^ KeyError: 1

I pressed the ignore button but after that the GUI became partially unresponsive and for example the jog buttons would not work.

Pressing the stop button on the machine gave me the following error.

 

Attachment not found


Code:
[qtpyvcp.widgets.input_widgets.gcode_text_edit][INFO] File encoding: ascii (gcode_text_edit.py:538) qt.qpa.xcb: QXcbConnection: XCB error: 3 (BadWindow), sequence: 7081, resource id: 8480708, major code: 40 (TranslateCoords), minor code: 0 [qtpyvcp.app.launcher][CRITICAL] Unhandled exception in vtk_backplot.py line 1174 (launcher.py:37) Traceback (most recent call last): File "/usr/lib/python3/dist-packages/qtpyvcp/widgets/display_widgets/vtk_backplot/vtk_backplot.py", line 1174, in on_offset_table_changed self.rotate_and_translate() File "/usr/lib/python3/dist-packages/qtpyvcp/widgets/display_widgets/vtk_backplot/vtk_backplot.py", line 1289, in rotate_and_translate self.offset_change_start_actor[wcs_index].SetUserTransform(actor_transform) ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~^^^^^^^^^^^ KeyError: 2

I did some further testing and discovered that if I do the probing first and then open the file I get the same error. However if I do the probing, close Probe Basic and then start it again and open the file I get no error but on the other hand this forces me to rehome the machine which is not optimal from an accuracy perspective.

Seems like the probing routine somehow causes the backplot to crash or leave a bade state somewhere. I tired poking around in the code myself but I'm too inexperienced to put my finger on the exact cause.

If you need any information don't hesitate to contact me here on the forums or via e-mail (unlogic@unlogic.se).
 

Please Log in to join the conversation.

More
1 year 1 week ago #336861 by Unlogic
Noticed that the code tags in the editor completely mangled the stack traces, here they are in a more readable form.

Error 1:

[qtpyvcp.widgets.input_widgets.gcode_text_edit][INFO]  File encoding: ascii (gcode_text_edit.py:538)
[qtpyvcp.widgets.display_widgets.vtk_backplot.vtk_backplot][INFO] 
Draw time 1.4562861919403076 seconds --- (vtk_backplot.py:762)
[qtpyvcp.app.launcher][CRITICAL]  Unhandled exception in vtk_backplot.py line 849 (launcher.py:37)
Traceback (most recent call last):
  File "/usr/lib/python3/dist-packages/qtpyvcp/widgets/display_widgets/vtk_backplot/vtk_backplot.py", line 849, in load_program
    point_01_pos = self.path_offset_start_point[prev_wcs_index]
                   ~~~~~~~~~~~~~~~~~~~~~~~~~~~~^^^^^^^^^^^^^^^^
KeyError: 1


Error 2:

[qtpyvcp.widgets.input_widgets.gcode_text_edit][INFO]  File encoding: ascii (gcode_text_edit.py:538)
qt.qpa.xcb: QXcbConnection: XCB error: 3 (BadWindow), sequence: 7081, resource id: 8480708, major code: 40 (TranslateCoords), minor code: 0
[qtpyvcp.app.launcher][CRITICAL]  Unhandled exception in vtk_backplot.py line 1174 (launcher.py:37)
Traceback (most recent call last):
  File "/usr/lib/python3/dist-packages/qtpyvcp/widgets/display_widgets/vtk_backplot/vtk_backplot.py", line 1174, in on_offset_table_changed
    self.rotate_and_translate()
  File "/usr/lib/python3/dist-packages/qtpyvcp/widgets/display_widgets/vtk_backplot/vtk_backplot.py", line 1289, in rotate_and_translate
    self.offset_change_start_actor[wcs_index].SetUserTransform(actor_transform)
    ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~^^^^^^^^^^^
KeyError: 2

Please Log in to join the conversation.

More
1 year 1 week ago #336863 by Unlogic
I realized that I forgot to mention which version and branch I'm running.

LinuxCNC: 2.9.4
ProbeBasic: stable branch

Please Log in to join the conversation.

More
1 year 1 week ago #336880 by Lcvette
I think this was resolved in the develop branch, multiple offsets but was something we found also, you can upgrade to the develop version which should resolve the issue

Please Log in to join the conversation.

More
1 year 1 week ago #336886 by Unlogic
Thank you for a quick reply!

Just as a precaution is there anything special I need to take into consideration when upgrading to the development version?

Please Log in to join the conversation.

More
1 year 1 week ago #336899 by Lcvette
the docs are actually for the develop version, so just use the docs and configuration page information for any changes required

Please Log in to join the conversation.

More
1 year 1 week ago #336951 by Unlogic
I upgraded to the development version and did the required config changes and copied over the new routines etc.

However the bug is still there. The stack trace has changed to another line but it seems to be the same error:

 

Attachment not found



[qtpyvcp.widgets.input_widgets.gcode_text_edit][INFO]  File encoding: ascii (gcode_text_edit.py:538)
[qtpyvcp.widgets.display_widgets.vtk_backplot.vtk_backplot][INFO] 
Draw time 1.025238275527954 seconds --- (vtk_backplot.py:831)
[qtpyvcp.app.launcher][CRITICAL]  Unhandled exception in vtk_backplot.py line 917 (launcher.py:37)
Traceback (most recent call last):
  File "/usr/lib/python3/dist-packages/qtpyvcp/widgets/display_widgets/vtk_backplot/vtk_backplot.py", line 917, in load_program
    point_01_pos = self.path_offset_start_point[prev_wcs_index]
                   ~~~~~~~~~~~~~~~~~~~~~~~~~~~~^^^^^^^^^^^^^^^^
KeyError: 1

This is the setup I'm probing.

 

Attachment not found



I've tried probing the parts in different order etc but as soon as G56 finishes probing the error pop up. Now in the development version pressing the stop button after the error has appeared doesn't do anything instead the GUI mostly frozen for any user input however it still updates if I use my physical button for e-stop etc.

Could there be a typo somewhere relating to G56?

Please Log in to join the conversation.

More
1 year 1 week ago #336956 by Unlogic
I started looking into to this and while I haven't been able to pinpoint the cause yet I found these lines of code in vtk_backplot.py

 

Attachment not found



The lines highlighted red and yellow seem to be duplicates of each other and the ones marked green don't seem to be used anywhere.


Digging a bit further it seems that the path_offset_start_point dictionary where the KeyError comes from only gets written to in one location (marked orange below).

 

Attachment not found



So I assume that the dictonary is supposed to be populated with values via the VTKCanon class.

 

Please Log in to join the conversation.

More
1 year 1 week ago #337015 by Lcvette
did you try fixing the missing parenthesis and retesting?

Please Log in to join the conversation.

More
1 year 1 week ago #337016 by Lcvette
im not probing but i can set 54 55 56 work offsets with mdi in the same command in the probe routine and am getting no error in the develop version, let me go back through your post and read the triggering description again to see if i missed something.

Please Log in to join the conversation.

Time to create page: 0.072 seconds
Powered by Kunena Forum