Student received an ENOMEM error when trying to run his code.
Stack Trace:
Traceback (most recent call last):
File "/lib/XRPLib/imu.py", line 537, in <lambda>
File "/lib/XRPLib/imu.py", line 544, in _update_imu_readings
File "/lib/XRPLib/imu.py", line 282, in get_gyro_rates
File "/lib/XRPLib/imu.py", line 142, in _raw_to_mdps
RuntimeError: maximum recursion depth exceeded
Traceback (most recent call last):
File "<stdin>", line 5, in <module>
File "grid_pathing.py", line 1, in <module>
File "xrp.py", line 2, in <module>
File "drive_code.py", line 1, in <module>
File "lib/XRPLib/defaults.py", line 17, in <module>
File "lib/XRPLib/encoded_motor.py", line 27, in get_default_encoded_motor
File "lib/XRPLib/encoder.py", line 27, in __init__
OSError: [Errno 12] ENOMEM
I tried checking the state machines manually, and saw the following message:
rp2.PIO(0).state_machine(0).active(): False
rp2.PIO(0).state_machine(1).active(): False
rp2.PIO(0).state_machine(2).active(): False
rp2.PIO(0).state_machine(3).active(): False
Traceback (most recent call last):
File "<stdin>", line 5, in <module>
File "debug.py", line 12, in <module>
File "debug.py", line 10, in report_state_machines
ValueError: StateMachine claimed by external resource
debug.py is as follows:
def report_state_machines():
for p in (0, 1):
for sm_c in range(4):
fmt = "rp2.PIO(%d).state_machine(%d).active(): %s"
print( fmt % (p, sm_c, rp2.PIO(p).state_machine(sm_c).active()))
report_state_machines()
I’ve seen this error pop up before, but I don’t remember how I solved it then.