MyRobotLab / myrobotlab

Open Source Java Framework for Robotics and Creative Machine Control
Apache License 2.0
230 stars 109 forks source link

Python tab freezes #166

Closed scognito closed 2 years ago

scognito commented 6 years ago

Hi, thanks for the awesome work with MRL. I noticed that that the python tab freezes often, so my development process is very slow and stressful. Also the lack of some basic functions like find/replace, and the prompt for overwriting exisiting file on save make it even more difficult.

Is there a chance to run python scripts without using myrobotlab? Maybe importing libraries and such. Would be awesome, then I can use myrobotlab when my code is stable enough.

Thanks

ghost commented 6 years ago

Hi Scognito

The way I work with python and mrl is using rpyc to send messages from a python "def" section in MRL and control the robot through it's REST api. This allows also to run MRL and the python task on different machines. Take care to use the same python version (2.x, 3.x) and architecture (32/64 bits) on both machines.

I use the free Visual Studio 2017 on my desktop windows machine and run MRL on a laptop mounted on my InMoov cart. Of course that python task can also run on the laptop once you are happy with it.

If you are interested in more details of the setup drop me a note.

Juerg

2018-03-02 23:55 GMT+01:00 scognito notifications@github.com:

Hi, thanks for the awesome work with MRL. I noticed that that the python tab freezes often, so my development process is very slow and stressful. Also the lack of some basic functions like find/replace, and the prompt for overwriting exisiting file on save make it even more difficult.

Is there a chance to run python scripts without using myrobotlab? Maybe importing libraries and such. Would be awesome, then I can use myrobotlab when my code is stable enough.

Thanks

— You are receiving this because you are subscribed to this thread. Reply to this email directly, view it on GitHub https://github.com/MyRobotLab/myrobotlab/issues/166, or mute the thread https://github.com/notifications/unsubscribe-auth/AD0_CKwzepmgHzKOc0Wv2UsZIV_SSaIKks5tac3dgaJpZM4SanXI .

-- Jürg Maier Trungerstrasse 33 9543 St. Margarethen Schweiz juerg.maier@pobox.ch

scognito commented 6 years ago

Yes I'm interested, even if my tablet is 32 bit and my pc is 64. I'll find a solution (VM?). Can you share some information?

ghost commented 6 years ago

Give this a try:

on your pc (64 bit) you can run vs 2017 and select in the project plane the python environment to use. Microsoft has a nice tutorial how to change the python version in the project. I use Anaconda as it comes with lots of libs preinstalled.

for making rpyc available to MRL download the zip from https://pypi.python.org/pypi/rpyc/3.2.3, unzip it and copy the whole rpyc folder into my MRL "pythonModules" folder. RESTART MRL to make it see it!

In MRL:

def callRemotePythonMethod():

needs unzipped rpyc folder in mrl/pythonModules

and a restart of mrl

import rpyc

use of localhost or IP address of machine running the

receiving python task. This task needs to run the rpyc listener

on the referenced port (20001) and it must be running

connRemote = rpyc.connect("localhost", 20001)

call the exposed function of the python task e.g.

orientation = connRemote.root.getOrientation()

In Python task:

import rpyc

CART_PORT = 20001

class cartCommands(rpyc.Service):

def exposed_getOrientation(self):

    return 123

if name == 'main':

from rpyc.utils.server import ThreadedServer

t = ThreadedServer(cartCommands, port=CART_PORT)

t.start()

2018-03-03 10:21 GMT+01:00 scognito notifications@github.com:

Yes I'm interested, even if my tablet is 32 bit and my pc is 64. I'll find a solution (VM?). Can you share some information?

— You are receiving this because you commented. Reply to this email directly, view it on GitHub https://github.com/MyRobotLab/myrobotlab/issues/166#issuecomment-370133476, or mute the thread https://github.com/notifications/unsubscribe-auth/AD0_CH2nfz-mCRX4p4ca51c30xr1iTCHks5tamCUgaJpZM4SanXI .

-- Jürg Maier Trungerstrasse 33 9543 St. Margarethen Schweiz juerg.maier@pobox.ch

supertick commented 2 years ago

swing ui no longer supported - webgui has asynchronous updates, so long scripts should not freeze ui