Closed osma closed 7 years ago
Do you have the medium motor connected to port 'A'? Could you also attach the program or a screenshot with the code? You can export the program from the menu, or do "Show code" and take a screenshot.
Yes the medium motor is connected to "A". I can also verify it via the Device Browser -> Motors menu. It shows the medium motor on A and two large motors on B and C.
Here is the visual code:
Here is the robot configuration, matching the Track3r:
Here is the Python code, using "Show code":
#!/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
_brickConfiguration = {
'wheel-diameter': 5.6,
'track-width': 18.0,
'actors': {
},
'sensors': {
},
}
hal = Hal(_brickConfiguration)
def run():
hal.rotateRegulatedMotor('A', 30, 'rotations', 1)
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()
The _brickConfiguration
looks surprisingly empty, I would expect that it would contain the sensor and actuator configurations I've set in the Open Roberta UI.
Yes, that's the problem. I'll take a look where the motor is lost.
This looks better:
_brickConfiguration = {
'wheel-diameter': 5.6,
'track-width': 18.0,
'actors': {
'A':Hal.makeMediumMotor(ev3dev.OUTPUT_A, 'on', 'foreward', 'none'),
},
'sensors': {
},
}
This will be fixed with the next server release.
Wow, that was quick! Thanks!
Hi, I just got started with ev3dev and Open Roberta, so forgive me if I've missed something obvious or am reporting in the wrong place. I have the EV3 basic track3r robot, which in addition to the tracks has a medium motor on port A for controlling various tools. So one of the first things I tried was controlling that motor.
So I logged in to OpenRoberta and set up my robot so it has a medium motor on Port A on the Robot Settings page. I also switched to the expert mode in Open Roberta to be able to access the blocks that control motors directly.
Then I created a very basic Nepo program which simply has one block that turns the motor on port A for 1 turn on speed 30.
Trying to run that program on my EV3 gives this error both on the EV3 screen and in the systemd journal:
The EV3 display says "Press any key" in addition to the KeyError.
I'm using the most recent ev3dev build (ev3dev-jessie-ev3-generic-2016-12-21) and the openrobertalab package is version 1.6.0+1.0.0.