Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

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

Open
rahasia86 opened this issue Jul 26, 2019 · 6 comments
Open

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

rahasia86 opened this issue Jul 26, 2019 · 6 comments

Comments

@rahasia86
Copy link

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
Copy link
Owner

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

@rahasia86
Copy link
Author

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
Copy link

wesleysliao commented Jul 30, 2019

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
Copy link
Owner

neomanic commented Aug 6, 2019

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
Copy link

lromor commented Sep 18, 2019

Hi, same problem here.

@DanNeasmith
Copy link

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.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

5 participants