SCARA project Odrive+ROS in a raspberry pi

Hi,

A friend and I are making a SCARA with 4 DOF using bldc motors and Odrives. We already bought 2 boards but still haven’t received them so no test have been done yet.

I want to use ROS for this robot so what I plan to do is connect both of the Odrive boards to a Raspberry pi using the neomanic ROS node (https://github.com/neomanic/odrive_ros). I would like to try different control strategies and for that I suppose that should use the Odrive in the current mode, is this possible with the neomanic ROS node?

Do you have any general recommendations when using the Odrive with the Raspberry pi, is there any issue with communication speed or something similar?

I also been reading different post and I noted that there is a CAN BUS interface (CAN Interface Available for Testing) in what case one would need to use this protocol, is it faster?

Thanks a lot for this project, we hope we can make a contribution!

Hi.

I started using a Raspberry Pi with ROS to control an ODrive as well as some Dynamixel Smart Servos.

I used thisimage for the Pi. It already has ROS installed.

I had some issues with Pip here is what I did:

python -m pip uninstall pip

sudo pip install --upgrade pip==9.0.1

or try:

python -m pip install —-upgrade pip==9.0.1

This is needed to install Odrive from Pip:

pip install monotonic --user

Clone ODrive Repository:

git clone https://github.com/madcowswe/ODrive.git

Install Python3 & python-USB

sudo apt install python3 python3-pip
sudo apt install python3-usb

Set up USB permissions:

echo ‘SUBSYSTEM==“usb”, ATTR{idVendor}==“1209”, ATTR{idProduct}==“0d[0-9][0-9]”, MODE=“0666”’ | sudo tee /etc/udev/rules.d/91-odrive.rules
sudo udevadm control --reload-rules
sudo udevadm trigger

instal ipython

sudo apt-get install ipython ipython3

Run ODrive:

cd ODrive/tools
./odrivetool

You can try installing Odrive using pip, but I think I ran into errors which is why I just cloned the repository.

sudo -H pip3 install odrive

there is an ODrive ROS library that I started to play with but then I switched approches altoghter and went with a Windows PC and I’m communicating with the ODrive using the Ascii protocol. But there are some examples and python code you might be able to play with.

the problem I ran into is that Neomanic’s library was built for the ODrive as a two-wheeled vehicle controller and not a robot arm.

Good luck I hope that helps you some

@srFelipes what did you end up doing? I’m looking to use 2 odrives to control a skid steer robot with 4 BLDC motors using ROS. What’s the best approach for this? Were you able to adapt neomanic’s ros package?

Hello! I haven’t been able to connect Odrive with ROS successfully yet, I’ve used a lot of time generating the URDF to run simulations in ROS and the connection between the hardware and ROS will be done in the near future (stay tuned jaja). Since your robot is kind of a differential robot I would highly recommend using the aforementioned package but that is if you want to use ROS as the platform to write your main code, if you want to simulate your robot then this step is not necessary. The main difficulty to do this is to translate from python3 (Odrive uses this) to python2 (ROS uses this), once this is done you can follow the ROS tutorials on how to write a node and just subscribe and publish in the right topics using the recommended ROS messages, I haven’t done this but in my related links I have this two https://medium.com/@beta_b0t/how-to-setup-ros-with-python-3-44a69ca36674 https://answers.ros.org/question/237613/how-to-define-ros-kinetic-to-use-python3-instead-of-python27/ . In the last one they say that the new ROS distro will be python3 oriented so this might be easier to do there. I hope this can help you.

Last but not least, I don’t know how good you are at ROS, if you are a total beginner like me when I first write this post I recommend to do the ROS and Gazebo tutorials.