neomanic / odrive_ros

ROS driver for the ODrive motor drive
Other
72 stars 48 forks source link

ROS 'module' object has no attribute 'start_odrive' #12

Open rahasia86 opened 5 years ago

rahasia86 commented 5 years ago

I've run odrive v3.5 on ROS kinetic ubuntu 16.04 and i got this error

Screenshot from 2019-07-26 16-20-02

Any help appreciated ^_^ Thank you.

neomanic commented 5 years ago

Have you run a catkin_make and sourced the relevant setup.bash for your catkin workspace?

rahasia86 commented 5 years ago

I did following steps:

Installing ODrive Python tools: New terminal: git clone https://github.com/neomanic/ODrive -b py27compat cd ODrive/tools sudo pip install monotonic python setup.py sdist sudo pip install dist/odrive-0.4.4.dev0.tar.gz

Include the odrive_ros into my workspace: New terminal: cd catkin_ws/src/ git clone https://github.com/neomanic/odrive_ros.git cd .. catkin_make source devel/setup.bash

Then I run the ROS: New terminal: roscore New terminal: roslaunch odrive_ros odrive.launch

and yet I still got same error. However odrivetool shell works well so I can control the motors as usual using odrivetool command.

wesleysliao commented 5 years ago

I get the same error with ROS Melodic in Ubuntu 18.04, for some reason odrive_node in odrive_ros/nodes isn't recognized, but running odrive_node.py directly is fine.

I can get the node to start by adding ".py" to the node type in odrive.launch.

This line: <node pkg="odrive_ros" type="odrive_node" name="odrive" ns="odrive" output="$(arg output)" respawn="$(arg respawn)">

With the .py extension added: <node pkg="odrive_ros" type="odrive_node.py" name="odrive" ns="odrive" output="$(arg output)" respawn="$(arg respawn)">

neomanic commented 5 years ago

Oops, sorry @rahasia86. I added a comment that you just use the main ODrive source tree now, and not my branch, but forgot to take the line out of the instructions.

lromor commented 5 years ago

Hi, same problem here.

DanNeasmith commented 3 years ago

I was having the same issue, the fix I found was to put '.' in front of the odrive_node in __init__.py.

(from odrive_node import ...-> from .odrive_node import ...) Idea came from this post: https://stackoverflow.com/questions/24722212/python-cant-find-module-in-the-same-folder

I also had to do the same for the odrive_interface and odrive_simulator imports in odrive_node.py.

I'm using Python 3.8 and ROS Noetic, still having issues getting it to connect (odrivetool works fine) but this atleast gets rid of any errors, and I can see it searching for the odrive.