ROS Resources: Documentation | Support | Discussion Forum | Index | Service Status | ros @ Robotics Stack Exchange
Ask Your Question
0

What motors can I use that are compatible with ROS2?

asked 2022-01-26 06:59:06 -0500

Py gravatar image

I'm looking for some servo motors that I can use on a ROS2-based robot and am unsure what my options are. Ideally the motors would have integrated controllers that I could plug straight into the robots onboard computer and interfacing them with an available ROS2 package would be easy.

The trouble is that I really don't know if such a thing exists or exactly what makes a particular motor or controller ROS2 compatible. Could anybody advise where to start?

edit retag flag offensive close merge delete

1 Answer

Sort by ยป oldest newest most voted
1

answered 2022-02-04 16:02:24 -0500

ChuiV gravatar image

Any motor can be "compatible" with ROS2. You just may need to make some interface (hardware and/or software) between that motor and ROS2. That being said, I think your question is really 1) How do I interface my motor hardware to my computer running ros2? and 2) How do I control that motor from ros2?

I'm no expert on what packages exist for this, I can only speak to my own experience with my own projects. Depending on what kind of onboard computer you have will change how you'd want to make that interface:

How to Connect Motor Hardware to Ros2 Computer

If your on-board computer has GPIO pins that can produce a PWM (or other) signal to control your servos, then you can just wire your motor driver directly to your on-board computer.

If your on-board computer doesn't have GPIO pins then you can use a micro-controller to interface the hardware and software. I've used arduinos, teensys, flight controllers, etc before with good success here.

How to Control Motor From Ros2

This part kinda depends on what you're needing to do with the motor. If have a motor position sensor like an encoder, or potentiometer, then you may want to work with the ros2_control stack. With ros2_control, you need to provide some urdf and other configuration files, and (most likely) a hardware interface plugin. This hardware interface plugin is responsible for reading feedback from and writing commands to your motor via your GPIO pins, arduino, teensy, etc.

If you don't need the full ros2_control stack, you'll probably want to write some node to accept motor commands via a ros2 topic, service or action, and set the motor control signal accordingly. Again that'l either be via GPIO pins, arduino, teensy, etc

For example, I've been integrating the 3D printed Moveo robotic arm into the MoveIt2 stack. I ended up using a teensy 4.1 with micro-ros to control my motors, and the ros2 control stack with a custom hardware interface plugin to send the right joint positions to the teensy. Micro-ros is great because you can make the micro-controller itself a ros2 node able to publish, subscribe, etc to ros2 via the micro-ros agent.

edit flag offensive delete link more

Question Tools

2 followers

Stats

Asked: 2022-01-26 06:59:06 -0500

Seen: 2,118 times

Last updated: Feb 04 '22