gladevcp crashes with a segfault after working properly

More
11 Feb 2017 18:47 #87833 by robottom
After playing around with the vismach I'm now in favor of using this option instead of working with matplotlib.
There is one thing I do not understand - but this is most probably because I do not know enough about linuxcnc:
In the puma560_sim_6.hal the line:
loadusr -W ./puma560gui
initiates the vismach gui via the puma560gui.py
From that code the model itself is loaded via:
link1 = AsciiSTL(filename="torso.stl");
After that there is a AsciiSTL object with the faces and normals of the 3D model.

On the other side I have a gladeVCP tab inside AXIS where I need to get access to the data of the link1 to calculate things and control the robot.
My question is: how can I get access from the gladeVCP python code to the link1 (AsciiSTL object with it data of the 3D model). Is there some possibility to access these data of the vismach objects inside gladeVCP python code?
More
11 Feb 2017 19:05 #87834 by cmorley
I don't know vismach at all but unless it exports info in someway that you can get into gladevcp then you would need to modify vismach to either do that or better to be a library module that you could import into glapdevcp (via the handler file) - then you would have access to everything.

Chris M
More
11 Feb 2017 19:29 #87836 by cmorley
looking quickly at the code, I see no standard way to send into to gladevcp.
If it is a small amount of info then you could modify puma560gui.py to calculate the data and add HAL pins for the info.

Otherwise coding a puma560 to be a loadable library would be the best way - but way require changes to vismach too.

Chris M
More
11 Feb 2017 19:50 #87839 by robottom
Hi Chris,

thanks for your quick reply. "coding a puma560 to be a loadable library" does not sound very easy - especially because the new library would need to keep all the current pins from HAL connected to still have the puma simulation correctly running.
The data I would need from the vismach instances is big - not just a few values I could get via connected pins.
The only way that looks feasible currently is the duplicative load of the 3D model into gladeVCP via numpy-stl python module (as I do it today). Hope that I can get the two models (one displayed via vismach and one loaded into gladeVCP) easily in sync so the display is not deviating from the calculating.
I assume that there is still a need to trigger some code during runtime (not only at startup of vismach) when I use new pins and change them from gladeVCP. Any idea how this could work from an arbitrary python module just like puma560gui.py (register some events from vismach). Is there any general framework in linuxcnc python part that I can use?
More
12 Feb 2017 19:59 #87882 by cmorley

robottom wrote: Hi Chris,


I assume that there is still a need to trigger some code during runtime (not only at startup of vismach) when I use new pins and change them from gladeVCP. Any idea how this could work from an arbitrary python module just like puma560gui.py (register some events from vismach). Is there any general framework in linuxcnc python part that I can use?


I am not understanding what you are saying here.
vismach uses tkinter to display based on the HAL pins it creates - it runs in it's own mainloop.
gladeVCP of course uses GTK and has it's own mainloop.
to uses vismach as a library module you would probably have to have vismach in it's own thread.

If you have gladeVCP load the 3d model what info do you need to keep it in sync?
looks to me that joint position from HAL pins is used. You could have gladevcp make some HAL pins to get the same info.

I would suggest that you get on the dev mail list or better linuxcnc IRC and talk to Jeff Epler.
He built mismach and is very good with tkinter and probably will have better suggestions.

I tend to just hack on something till it does what I want :)

Chris M
More
13 Feb 2017 19:32 #87924 by newbynobi
@robottom,

Please update you glade to be 3.8.5! I hade also some segment fault crashes with 3.8.0 building a cam widget with opencv. After updating no more problems.

Just get the source from ftp.gnome.org/pub/GNOME/sources/glade3/3.8/
and compile it yourself. After that you would need to update the gladevcp part again, meaning the catalogs.

Norbert
Moderators: mhaberler
Time to create page: 0.166 seconds
Powered by Kunena Forum