Name 'axis' is not defined

Hello reader,

I am very new with regards to using the odrive controller. I have the odrivetool running in my command prompt. I am able to get through all of the getting started. However when I go to try and control the velocity of the motor by starting with the command:

axis.controller.config.control_mode = CONTROL_MODE_VELOCITY_CONTROL

I get the following error:

name 'axis' is not defined

I am running on python version 3.8.6 on a windows computer. How can I go about solving this problem. Thank you!


You must choose which axis you’d want to command: axis0 or axis1

and you need to specify the odrive too, because you might have more than one connected. e.g. odrv0.axis0.controller.config.control_mode = CONTROL_MODE_VELOCITY_CONTROL

But if you want to be less verbose, you can define ‘axis’ as a variable:
axis = odrv0.axis0

Then your code above will work. :slight_smile:

Thank you very much for the help I am now able to run the command with the various changes!