Hello, I am trying to run some tests using python instead of the ODrive tool. This is on a Rasp Pi 3B+, the odrivetool finds it fine, from python 3.7.3 it does not, just sits forever… any ideas? I did a test import of odrive2 just to make sure it failed, then did an import of odrive.
Here is sample of tests:
Please connect your ODrive.
You can also type help() or quit().
Connected to ODrive 20773596524B as odrv0
In [1]: odrv0.axis0.requested_state = AXIS_STATE_CLOSED_LOOP_CONTROL
In [2]: odrv0.axis0.controller.vel_setpoint = 120
In [3]: odrv0.axis0.controller.vel_setpoint = 0
In [4]: odrv0.axis0.requested_state = AXIS_STATE_IDLE
In [5]: quit
pi@garbo:~ $ sudo odrivetool
ODrive control utility v0.4.11
Please connect your ODrive.
You can also type help() or quit().
Connected to ODrive 20773596524B as odrv0
In [1]: quit()
pi@garbo:~ lsusb
Bus 001 Device 004: ID 1209:0d32 Generic ODrive Robotics ODrive v3
Bus 001 Device 003: ID 0424:ec00 Standard Microsystems Corp. SMSC9512/9514 Fast Ethernet Adapter
Bus 001 Device 002: ID 0424:9514 Standard Microsystems Corp. SMC9514 Hub
Bus 001 Device 001: ID 1d6b:0002 Linux Foundation 2.0 root hub
pi@garbo:~ python3
Python 3.7.3 (default, Apr 3 2019, 05:39:12)
[GCC 8.2.0] on linux
Type “help”, “copyright”, “credits” or “license” for more information.
import odrive2
Traceback (most recent call last):
File “”, line 1, in
ModuleNotFoundError: No module named ‘odrive2’import odrive
from odrive.enums import *
odrv0=odrive.find_any()
At this point it just sits there, never finds any odrive. Have tried this multiple times, even with serial number as parameter, it just doesn’t find any odrive.
UPDATE:
I noticed that there is no /dev/ttyUSB0 or /dev/ttyUSB1 etc… the odrive id is listed as:
/dev/serial/by-id/usb-ODrive_Robotics_ODrive_3.6_CDC_Interface_20773596524B-if00
and also as:
/dev/serial/by-path/platform-3f980000.usb-usb-0:1.3:1.0
Tried using both those paths in the odrive.find_any(“serial:”) but still doesn’t find the odrive