ROS driver for Odrive

Hello everyone,

I would like to know if anyone has worked with any drive for ROS, specifically with ROS2. I found some packages on the internet, but only for ROS1.

Hi,
We just created a node for ros2 foxy. It publishes velocity, motor_position, applied voltage, odrive temperature and applied torque and sets desired velocity.
We would welcome some feedback / issues.

3 Likes

Great work! How is the performance?


We use a NanoPi Duo2 and when subscribing to all topics and publishing a speed over wifi, the node uses < 59% of one prozessor and ~4% of the ~500MB RAM.

Ah, sorry, i meant, how fast is the data communicated? How many variables are you requesting, and how many times are you able to update them per second?

Ah, ok. Due to the uart protocol the node can only get one item per request. It is set to 100 requests per second, but that’s arbitrary, as we haven’t tested for maximum speed. We use modulo to decide polling order.
You can change the rate in
‘odrive-ros2-node/odrive_node/src/odrive_node.cpp’
line 80:
timer_ = this->create_wall_timer(10ms, std::bind(&ODriveNode::odrive_callback, this));
replace 10ms with desired speed(using namespace std::chrono_literals)

We haven’t tested for max set time.

2 Likes

Very nice, sir. I’m very beginner at ROS and ROS2. Do you plan to map velocity commands to CMD_VEL topic using geometry_msgs Twist message? Or could you please give me some advices how to do it? Thank you!

What is your setup? Do you want to control two motors using the ODirve? I am not sure the ODrive can handle more than 2D input. You could write a small node taking x,y data from the Twist-message and republishing it on the appropriate topics. If its quite simple i might be able to add it.

Our implementation for ros2_control
https://github.com/Factor-Robotics/odrive_ros2_control