Repository navigation
Description
Hello,
how can I use the Objekt "wait_for_bump" in the Button Class.
I become the following Errormessage.
Wait for Bump
Traceback (most recent call last):
File "test.py", line 22, in
btnb.wait_for_bump(left, 500)
File "/usr/lib/python3/dist-packages/ev3dev2/button.py", line 203, in wait_for_bump
if self.wait_for_pressed(buttons, timeout_ms):
File "/usr/lib/python3/dist-packages/ev3dev2/button.py", line 191, in wait_for_pressed
return self._wait(buttons, [], timeout_ms)
File "/usr/lib/python3/dist-packages/ev3dev2/button.py", line 168, in _wait
for event in self.evdev_device.read_loop():
File "/usr/lib/python3/dist-packages/ev3dev2/button.py", line 122, in evdev_device
if device.name == self.evdev_device_name:
AttributeError: 'ButtonBase' object has no attribute 'evdev_device_name'
• MobaXterm 11.0 • │
│ (SSH client, X-server and networking tools) │
│ │
│ ➤ SSH session to robot@192.168.137.3 │
│ • SSH compression : ✔ │
│ • SSH-browser : ✔ │
│ • X11-forwarding : ✘ (disabled or not supported by server) │
│ • DISPLAY : 192.168.2.152:0.0 │
│ │
│ ➤ For more info, ctrl+click on help or visit our website │
└────────────────────────────────────────────────────────────────────┘
Linux ev3dev 4.14.61-ev3dev-2.2.2-ev3 #1 PREEMPT Mon Aug 6 14:22:31 CDT 2018 armv5tejl
_____ _
_____ |__ / | | _____ __
/ _ \ \ / / | \ / ` |/ _ \ \ / /
| __/\ V / ) | (| | /\ V /
_| _/ |/ _,_|__| _/
Debian stretch on LEGO MINDSTORMS EV3!
Last login: Tue Aug 7 08:30:48 2018 from 192.168.137.2
robot@ev3dev:~$
Thanks
Activity
ndward commentedon Dec 29, 2018
I also continue to have problems with wait_for_bump, wait_for_pressed and wait_for_released. For example this script (launched from VS Code):
gives this error:
Traceback (most recent call last):
File "/home/robot/park/wait_for_bump.py", line 13, in
btn.wait_for_bump('left')
File "/usr/lib/python3/dist-packages/ev3dev2/button.py", line 203, in wait_for_bump
if self.wait_for_pressed(buttons, timeout_ms):
File "/usr/lib/python3/dist-packages/ev3dev2/button.py", line 191, in wait_for_pressed
return self._wait(buttons, [], timeout_ms)
File "/usr/lib/python3/dist-packages/ev3dev2/button.py", line 168, in _wait
for event in self.evdev_device.read_loop():
File "/usr/lib/python3/dist-packages/ev3dev2/button.py", line 125, in evdev_device
raise Exception("%s: could not find evdev device '%s'" % (self, self.evdev_device_name))
Exception: Button: could not find evdev device 'EV3 brick buttons'
dwalton76 commentedon Mar 24, 2019
@dickric can you post your
test.pycode?wait_for_bumpon an EV3 is working for me.dwalton76 commentedon Mar 24, 2019
@ndward are you still seeing this? If so what if you remove
VS Codefrom the picture? I am able to run your script on an EV3, it works as expected.ndward commentedon Mar 24, 2019
I'm no longer having this problem (launching from VS Code). I'm using kernel 4.14.96-ev3dev-2.3.2-ev3. Thanks to whoever fixed it.