Getting Started with ROS2 Navigation - Episode 7 - How not to build a Motor ROS Node

preview_player
Показать описание
In this video, I'll share how NOT to build a Motor ROS node, because sometimes you just need it to work, not work "correctly". This is a basic node for the Sparkfun Qwiic motor controller which directly consumes cmd_vel messages.

Hardware Referenced:
Sparkfun Hobby Motor with Encoders

Sparkfun Auto Phat

Software Referenced:
WIP ROS Node for Sparkfun Auto Phat Encoder

ROS node for Sparkfun Qwiic Motor Controller

Other references:
Finagle Constant
Рекомендации по теме
Комментарии
Автор

Nice video, I have been enjoying your content. As a relative noob to ROS2, motors have been my undoing since the start (about 18 months ago)! I am still fighting this issue today, waiting for a new part to arrive.

The problem I had as a newbie was the closed loop control and the encoders. I modified a wheelchair base that has no encoders so I bought some. I then had to integrate this into the code I butchered ros2_differential_drive package and a python library for my sabertooth motor controller I used. It needed to be big and it was expensive! I chose this before I ever heard of ROS and was writing everything in pure python.

I got the whole stack going pretty well, Lidar, IMU, NAV2 it was great.... in RVIZ! But ulimetly if your wheel ODOM is off, nothing will ever be correct. As this channel is aimed at beginners please allow me to voice my experience and suggestions. I do NOT have the experience or qualification to call this advice.

For small indoor robots maybe PID is easier to implement? Smaller wheels, less travel, generally more around to have Lidar help with localisation? I have no experience with ROS small robots.

I found an upgrade for the Dimension Engineering Sabertooth range of motor controllers that uses hardware and a set of encoders. It can "self tune" the Sabertooth to perform the PID and keep the wheels at a constant speed. PID code and tuning (which I understand is not easy) is handled in hardware. They have small and large units ranging from 50-200 dollars and the Kagaroo module is about 20.


I always knew I wanted and should be using ros2_control for the motion and wanted to move away from a standalone node and use a "stack" written by professionals for the purpose of movement. Problem is in months of searching I never found a "hardware interface" [AKA Driver] for my sabertooth or any other motor controller I could just plugin.


I found a hardware controller for the L298N Motor Drive Controller - diffdrive_arduino for the ROS system and ROS Ardunio Bridge that runs on an arduino to interface the board:


One the ROS side it just uses serial commands to the Ardunio so I think josh has a very eligent solution for smaller robots that use the PWD motor controller with ros2_control. He has a great video on it here:


I am not knocking anything said in this video it is 100% correct to the best of my knowledge and this is just a cautionary tale from my side on the big motor problems that I got hung up on.

Hopefully I can use his hardware interface (with a little hacking) to control the Arduino which has a library by the manufacturer for the Sabertooth modules. For me that's my ideal solution but for others who might wish to use the L298N Motor Drive Controller for a project I would recommend ROS2 control for even a beginner as it masks a lot of the deep complexity behind robot kinematics.

I have forked* Joshes project and it can be found here:


Use the original project not mine for the L298N. I have not really started work on the actual code yet and still working through basic setting of the motion controller but wanted to add a place holder for anyone who is interested in the Sabertooth. I will get this Hardware interface working - Watch this space! :)

carldraper
Автор

Very good and useful
Your work is very cool
please continue and make video as often as you can)))

KaktusChannel
Автор

Your video is very helpful. Thanks for sharing your experience

MertOzdag
Автор

cant wait for the nav stuff. keep it coming great videos.

robotswithpersonalityandag