Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Only first say block ist working #66

Open
peacepro opened this issue Aug 2, 2018 · 3 comments
Open

Only first say block ist working #66

peacepro opened this issue Aug 2, 2018 · 3 comments

Comments

@peacepro
Copy link

peacepro commented Aug 2, 2018

If I use more than one say block, only the first say block is working.
The second block is not working.

Package: openrobertalab
Version: 1.7.4+1.0.0
Architecture: all
Maintainer: Stefan Sauer <[email protected]>
Installed-Size: 222
Depends: init-system-helpers (>= 1.18~), python3, python3:any (>= 3.3.2-2~), systemd, python3-bluez, python3-dbus, python3-ev3dev, python3-gi
Enhances: brickman
Homepage: http://lab.open-roberta.org/
Priority: optional
Section: python
Filename: pool/main/o/openrobertalab/openrobertalab_1.7.4+1.0.0_all.deb
#!/usr/bin/python

from __future__ import absolute_import
from roberta.ev3 import Hal
from roberta.BlocklyMethods import BlocklyMethods
from ev3dev import ev3 as ev3dev
import math

class BreakOutOfALoop(Exception): pass
class ContinueLoop(Exception): pass

_brickConfiguration = {
    'wheel-diameter': 5.6,
    'track-width': 18.0,
    'actors': {
    },
    'sensors': {
    },
}
hal = Hal(_brickConfiguration)
hal.setLanguage("de")

def run():
    hal.sayText("Hallo ich bin EV3")
    hal.sayText("Wie war die Schule heute")

def main():
    try:
        run()
    except Exception as e:
        hal.drawText('Fehler im EV3', 0, 0)
        hal.drawText(e.__class__.__name__, 0, 1)
        hal.drawText(str(e), 0, 2)
        hal.drawText('Press any key', 0, 4)
        while not hal.isKeyPressed('any'): hal.waitFor(500)
        raise

if __name__ == "__main__":
    main()
#!/usr/bin/python

from __future__ import absolute_import
from roberta.ev3 import Hal
from roberta.BlocklyMethods import BlocklyMethods
from ev3dev import ev3 as ev3dev
import math

class BreakOutOfALoop(Exception): pass
class ContinueLoop(Exception): pass

_brickConfiguration = {
    'wheel-diameter': 5.6,
    'track-width': 18.0,
    'actors': {
    },
    'sensors': {
    },
}
hal = Hal(_brickConfiguration)
hal.setLanguage("de")

def run():
    hal.sayText("Hallo ich bin EV3")
    hal.drawText("Hallo", 0, 0)
    hal.sayText("Wie war die Schule heute")

def main():
    try:
        run()
    except Exception as e:
        hal.drawText('Fehler im EV3', 0, 0)
        hal.drawText(e.__class__.__name__, 0, 1)
        hal.drawText(str(e), 0, 2)
        hal.drawText('Press any key', 0, 4)
        while not hal.isKeyPressed('any'): hal.waitFor(500)
        raise

if __name__ == "__main__":
    main()
@ensonic
Copy link
Contributor

ensonic commented Aug 17, 2018

@ensonic
Copy link
Contributor

ensonic commented Mar 16, 2019

I have a repro:

_brickConfiguration = {
...     'wheel-diameter': 5.6,
...     'track-width': 18.0,
...     'actors': {},
...     'sensors': {},
... }
hal = Hal(_brickConfiguration)
hal.setVolume(100)
hal.sayText("Hello"); hal.sayText("and"); hal.sayText("good evening");
aplay: main:722: audio open error: Device or resource busy
# more lowlevel, still broken
hal.sound.speak("Hello").wait(); hal.sound.speak("World").wait();
aplay: main:722: audio open error: Device or resource busy
# but this works:
hal.sayText("Hello"); hal.waitFor(200);hal.sayText("and"); hal.waitFor(200); hal.sayText("good evening");
# this is what we essentiall do from python via Popen, but in a shell it works
espeak --stdout "Hello" | aplay -q; espeak --stdout "World" | aplay -q

Somehow closing the device takes longer than the subcommand runs ??

@ensonic
Copy link
Contributor

ensonic commented Mar 20, 2019

Ahhh, ev3dev/ev3dev-lang-python#461 - too bad that there is no new release :/

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants