OpenRoberta / robertalab-ev3dev

roberta lab connector for ev3dev
Apache License 2.0
17 stars 14 forks source link

robertalab needs porting for ev3dev-stretch #71

Open deckers opened 5 years ago

deckers commented 5 years ago

After installing the stable ev3dev stretch release (ev3dev-stretch-ev3-generic-2019-03-03.img, Kernel 4.14.96-ev3dev-2.3.2-ev3, followed by sudo apt-get update ; sudo apt-get upgrade => openrobertalab/stable,now 1.7.1+1.0.0 all) I had to notice that OpenRoberta Lab seems to produce incompatible python code. Neither motor movement nor speech works because of missing arguments or methods/attributes:

ERROR:roberta.lab:Ooops: Traceback (most recent call last): File "/usr/lib/python3/dist-packages/roberta/lab.py", line 278, in _exec_code exec(compiled_code, scope) File "/home/robot/NEPOprog.py", line 18, in <module> 'B':Hal.makeLargeMotor(ev3dev.OUTPUT_B, 'on', 'foreward'), TypeError: makeLargeMotor() missing 1 required positional argument: 'side'

The corresponding program: Zwischenablage01

ERROR:roberta.lab:Ooops: Traceback (most recent call last): File "/usr/lib/python3/dist-packages/roberta/lab.py", line 278, in _exec_code exec(compiled_code, scope) File "/home/robot/NEPOprog.py", line 23, in <module> hal.setLanguage("de") AttributeError: 'Hal' object has no attribute 'setLanguage'

Do I have to use the old jessie distribution instead of stretch?

ensonic commented 5 years ago

Yes, this is a known issue. So far ev3dev-strech was marked as beta and now it got marked stable all of a sudden together with a takedown of the link to the ev3dev-jessie image. Unfortunately the ev3dev-python api change in incompatible ways (so it is not us producing 'incompatible code').

We'll port things at some point, but it is a larger effort starting with the logistics of debian packaging :/

deckers commented 5 years ago

Now with a fresh installation of ev3dev-jessie (ev3dev-jessie-ev3-generic-2017-09-14) I get the same error messages when using the motors.

ERROR:roberta.lab:Ooops: ... File "/home/robot/NEPOprog.py", line 18, in <module> 'B':Hal.makeLargeMotor(ev3dev.OUTPUT_B, 'on', 'foreward'), TypeError: makeLargeMotor() missing 1 required positional argument: 'side'

Have a look to issue #1171 in openroberta-lab: I think the previously mandatory parameter side has been deleted on March 22...

So these errors actually should occur on any ev3dev-installation out there, right?

deckers commented 5 years ago

Found in ev3.py:

# TODO(ensonic): remove 'side' param, server will stop using it >=3.3.0 # TODO(ensonic): 'regulated' is unused, it is passed to the motor-functions # direcly, consider making all params after port 'kwargs'

ensonic commented 5 years ago

The jessie image has an old package. If you do apt-get update and then upgrade the package this will work. I had asked to update the jessie image, but on that ask the image was taken down :/

Its really unfortunate for users and I will try to find a solution here. We'll probably put an update jessie image online on the openroberta site for the time being.

deckers commented 5 years ago

I am sure I updated with sudo apt-get update, sudo apt-get install openrobertalab before I posted again... (with stopping/starting the openroberta-service).

But for any reason now it works with the jessie distribution - thank you.

dlech commented 5 years ago

ev3dev-stretch also has an old version of openroberta. I just copied the latest version from jessie to stretch about an hour ago, so sudo apt update && sudo apt upgrade on stretch should get the latest version there too.