Error when running a task file with position tracking sensor

25 views
Skip to first unread message

CGomes

unread,
May 26, 2022, 4:50:41 AM5/26/22
to pyControl

Hi!

I'm trying to measure x and y positions using the sensor PMW3360. I'm loading the hardware definition file attached below and running the task 'task.py' also attached. Inside my devices folder, I have the code 'sensor.py'.

When I run the task I get the following error, which I'm not sure how to solve. Any help would be greatly appreciated. Thank you very much!


Error: Unable to setup state machine.

 

Traceback (most recent call last):

File "<stdin>", line 1, in <module>

File "task_file.py", line 16, in <module>

File "devices/_sensor.py", line 368, in __init__

AttributeError: 'MotionDetector_2ch' object has no attribute 'data_channel'

 

 

Micropython version: 1.16

pyControl Framework: OK

 

Transfering hardware definition to pyboard.

 

Error importing hardware definition:

 

Traceback (most recent call last):

File "<stdin>", line 1, in <module>

File "hardware_definition.py", line 11, in <module>

File "devices/_sensor.py", line 368, in __init__

AttributeError: 'MotionDetector_2ch' object has no attribute 'data_channel'

 

sensor.py
task.py
hardware_definition.py

thoma...@neuro.fchampalimaud.org

unread,
May 26, 2022, 7:52:48 AM5/26/22
to pyControl
Hi,

I think the issue is occurring because the MotionDetector_2ch class in the file sensor.py is designed to work with a modified version of the pyControl framework developed by Mostafa (see discuss thread here), so when you try and use it with standard pyControl you get this error.   I suggest you contact him or the person who provided the sensor.py code, to ask for help in getting it working.  I think the version of pyControl you need is in this branch of Mostafa's github but i'm not 100% sure as i did not develop this code. 

best,

Thomas
Reply all
Reply to author
Forward
0 new messages