odriverobotics / ODrive

High performance motor control
https://odriverobotics.com
MIT License
2.89k stars 1.5k forks source link

KeyError: 'Set_Axis_State' #735

Open Tine11L opened 1 year ago

Tine11L commented 1 year ago

When I run the python script named can_dbc_example, i get the following error:

Requesting AXIS_STATE_FULL_CALIBRATION_SEQUENCE (0x03) on axisID: 0 Traceback (most recent call last): File "/home/pi/Desktop/CAN_CODE_DECODE/can_dbc_example.py", line 14, in <module> msg = db.get_message_by_name('Set_Axis_State') File "/home/pi/.local/lib/python3.9/site-packages/cantools/database/can/database.py", line 384, in get_message_by_name return self._name_to_message[name] KeyError: 'Set_Axis_State'

Im running this python script on Raspberry Pi 4 in IDLE (using Python-3.9.2)

samuelsadok commented 1 year ago

In case you're using this with a recent ODrive Pro/S1 DBC file, as a workaround it should work if you prefix the message name with Axis0_. So Axis0_Set_Axis_State. Same for the other message names too.

I'm not sure if this is actually desirable, I'll have to review whether we should fix the example or the DBC file.