Odrive control from ROS2 via Teensy or Jetson Nano?

Hi everyone,
I have made it through the initial set-up following the getting started guide.
Since, I have wired up the ODrive using UART_A to a teensy 4.1 on RX1/TX1. (Of course Odrive.RX → Teensy.TX and vice-versa)

I’m wondering if anyone has attempted something similar before, controlling an ODrive with a Teensy via Serial!?
Or while I’m writing this and also researching a bit online, I came across
“Factor-Robotics/odrive_ros2_control”
which seems to be a perfect fit.
But that would mean I need to wire the ODrive via USB to the NVIDIA Jetson Nano, as there is no serial implementation as of now.

The Teensy is running microRos and will be the low-level control node of the system, handling all sensors, lights, and motor control.
An NVIDIA Jetson Nano will be the higher level control node, running ROS2 and publishing to the cmd_vel topic, to which the Teensy is subscribed.

Questions regarding ODrive via Teensy 4.1 serial:
The following questions come to mind, that I’m hoping some of you would kindly provide some insight on.

  1. How to reverse one of the odrives axis, so that both spin into forward direction of the bot.
    Meaning axis0 (Right motor = CW), axis1 (Left motor = CCW) looking at the motor shaft where the wheel mounts.
    Or would you simply send the “reversed” command?
  2. What control-mode is best to use? I’m pending between position and velocity control. As Odrive is unaware of position, the higher
    control system will constantly tell the Teensy (which tells the Odrive) to move forward 12mm, 10mm, 9mm, 6mm… until stop.
    But then again, I’m wondering if the bot needs to make a turn and axis1 needs to only move half as fast as axis0 or 1/3rd of the way?? How fast would the Odrive move?
    Argghh. I’m confused!
    a) position control (This is my guess)
    b) velocity control
    c) torque control
  3. Am I right that I constatly going to tell each odrv.axis how fast or to what position it is supposed to move?
    Kind of like this (msg1=axis0.moveX, axis1.moveXX, msg2=axis0.move-X, axis1.moveX, and so on)

Questions regarding ODrive via NVIDIA Jetson Nano USB:

  1. I see the git repository (“Factor-Robotics/odrive_ros2_control”) is currently with ROS2-Humble up to fw 0.5.3 and I just updated to fw 0.5.5 (D’oh)
    Is this going to be a show stopper, or can I downgrade ODrive? Could very well be that it also works, just won’t support all new features?
  2. Does anyone know of another good github repo / ROS2 package for controlling ODrive? I’m sure there are multiple variations?!

Using / controlling the ODrive directly from Jetson Nano would also have benefits:

  1. Advantage in timing, by avoiding going from Jetson → Teensy → ODrive. or is it negliglable?
  2. direct connection to ODrive allows using odrivetool at anytime via the Jetson, without unplugging from Teensy and plugging into PC.

Thanks for any directions on this!

Hi,

I use a Jetson Nano to control two Odrive 56v controllers simultaneously over USB.
I did use the production module which has emmc versus the SD card and works at below freezing temps.
My code GitHub - andyinyakima/w4od is written in Qt C++. I installed Qt on the Jetson Nano and can compile natively and headlessly via ssh.
I thought about ROS but I am comfortable with C/C++. On the Odrive I use ASCII protocol and velocity mode but am looking into position mode.
Just want to state that Jetson Nano is USB compatible.

Good Luck on your project.