Python 2.7 Support (for ROS)


I have the python 3.5 odrivetool working with my motor.
However I need it to work with python 2.7 for use with Neomanic’s ROS node.
How do I run the odrivetool in python 2.7? Do I need to install odrive package into python 2.7 too?
The ROS node currently fails to launch due to not being able to import ‘odrive’

When I installed odrive it was as a 3.5 package - pip3 install odrive
My attempt to install it to 2.7 fails - pip install odrive

Any suggestions greatly appreciated.

1 Like

Finally worked this out.
odrive needs to be installed as a python 2 package in order to work.
Note that neomanics 2.7 compatibility patch is no longer required as python 2.7 is now supported by the truck again.

To install as python 2.7 package:
pip install monotonic
pip install IPython==5.0 --user
sudo pip install odrive

See the ROS node itself:

1 Like

Hi - I’m trying to get Odrive to work with Python 2.7. I’m using ROS as well. The Odrive library works fine with Python 3, but when I follow the above steps with Python 2, the script runs, but it hangs when trying to connect to the board. Any ideas?

Here are some details…

  • I have monotonic and ipython 5 installed as described above
  • Specifically the command that hangs is: instance = odrive.find_any()
  • I’m running Ubuntu 18.04
  • Python version = Python 2.7.17
  • Its a new 56 Volt board. HW = v3.6 and looks like firmware is v0.4.11

Note - the problem has nothing to do with ROS. I’m testing with a python test app that is completely separate from ROS. I’ve tried on 2 different machines - same problem on both.

Any ideas would be greatly appreciated.