You can use ANY hardware with ros2_control

  Переглядів 44,602

Articulated Robotics

Articulated Robotics

День тому

In this video we see how to create our own custom hardware interface/hardware component for ros2_control.
Check out PCBWay at pcbway.com/g/59QIMe
📃 Companion blog post coming
👨‍💻️ GitHub code (note this is the humble branch) github.com/joshnewans/diffdri...
💬 Join the discussion at the Articulated Robotics Community discourse.articulatedrobotics...
❤️ Support me on Patreon! www.patreon.com/bePatron?u=55...
Official ros2_control documentation control.ros.org/master/index....
ros2_control demos github.com/ros-controls/ros2_...
00:00 - Intro
01:02 - Recap of concepts
03:23 - Running the demo code
06:17 - Stepping through the demo code
18:33 - PCBWay
19:10 - Modifying the demo code
41:05 - Renaming & Improvements
46:30 - Outro

КОМЕНТАРІ: 89
@sport99421
@sport99421 5 місяців тому
You call yourself a hobbyist while acting more like a professor to most of us. Hope you get the recognition you deserve and continue to grow.
@adamwatts16
@adamwatts16 Рік тому
This video couldn't have come at a better time! I stared building my first robot last weekend and this weekends job is building the hardware internet for my motor controller. Great tutorial
@evanlane1690
@evanlane1690 Рік тому
These tutorials are making ROS accessible for a ton of people, including me. I'm a hobbyist, and I don't always have the time to do deep dives into documentation and codebases. Being able to use these tutorials to get a good foundation has been extremely helpful.
@ArticulatedRobotics
@ArticulatedRobotics Рік тому
Thanks so much, I love to be able to help!
@techcracker4566
@techcracker4566 Рік тому
Great job! Thanks for all of your eye opening videos, keep it going🎉
@ArticulatedRobotics
@ArticulatedRobotics Рік тому
Thanks!
@kevinkipkorir3132
@kevinkipkorir3132 7 місяців тому
An awesome 45 minute thank you
@weeklyrobotics7884
@weeklyrobotics7884 Рік тому
Awesome work Josh! Many thanks for sharing and going into the nitty gritty details!
@ArticulatedRobotics
@ArticulatedRobotics Рік тому
Thanks!!
@_a_x_s_
@_a_x_s_ Рік тому
Wow, this was commented 3 days before this video was published...
@weeklyrobotics7884
@weeklyrobotics7884 Рік тому
@@_a_x_s_ We are in a business of finding all quality robotics content before it even comes out, but let's keep this a secret! On a more serious note, If you are a Patreon supporter of Josh, you get early access to the content. I highly recommend this as Josh is doing an amazing service for everyone looking to learn some advanced ROS.
@tscosef
@tscosef Рік тому
Best tutorial about hardware interfaces. Was craving for this👍
@ArticulatedRobotics
@ArticulatedRobotics Рік тому
Thanks!
@martijnmartijn
@martijnmartijn 2 місяці тому
This video is truly a lifesaver, thanks!
@pranavshevkar269
@pranavshevkar269 2 місяці тому
Your videos have helped me tremendously in my career as a robotics engineer. Could you please make a series on Movit2
@slimsh4dy115
@slimsh4dy115 Рік тому
is the process similar for ros1_control too ?? glad to see that you are getting sponsors ( meaning you will keep uploading ) , you deserve it.
@atticusrussell1225
@atticusrussell1225 Рік тому
Josh this is literally the task I have to do for my project today. I haven't watched the video yet but I was dreading the task due to the lack of documentation. Have been putting it off for a bit. You're an absolute legend and a hero. Can't even express how excited I was to see the title.
@juandvergara
@juandvergara Рік тому
So do i, its amazing how he reads our minds, hahaha.
@ArticulatedRobotics
@ArticulatedRobotics Рік тому
Haha thanks guys I'm so glad to hear it - and I hope it was helpful once you did watch it!
@atticusrussell1225
@atticusrussell1225 Рік тому
@@ArticulatedRobotics Yeah it was very helpful. Thank you! I'm wondering if you've seen the tool ros_team_workspace which can generate templates for hardware interfaces, controllers, URDF, and many other things interactively from the command line, and in addition adds CI testing to a GitHub repo. Also adds useful aliases. I think you'd find it useful, and if you do a short video exploring it might help many more people be aware of it.
@8bit711
@8bit711 Рік тому
Cheers Josh! I know how im spending my Sat night.
@ArticulatedRobotics
@ArticulatedRobotics Рік тому
Haha nice one!
@user-ml4rq3tc4i
@user-ml4rq3tc4i 10 місяців тому
Good day and thanks for the video!
@quentinmalfroid5406
@quentinmalfroid5406 4 місяці тому
Incredible video !
@scotver377
@scotver377 Рік тому
You are amazing, thank you very much !!
@leonardogarberoglio3611
@leonardogarberoglio3611 6 місяців тому
I saw all of your videos about ros2_control and they are really good material. I think that you should make a video using microROS on your microcontroller and so you will have everithing under ROS2
@ricardocasimiro6424
@ricardocasimiro6424 Рік тому
i love this video series!!
@ArticulatedRobotics
@ArticulatedRobotics Рік тому
Thanks
@kumarnaveen
@kumarnaveen 10 місяців тому
Great job!
@DavidNewmon
@DavidNewmon Рік тому
Performance here is critical, and especially on the Arduino side. Make sure you read the Serial I/O data one byte at a time, and make sure you loop through the bytes: while(Serial.available()) { char ch = Serial.read(); } ... calculate, and control the motors as quickly as possible in loop() and keep everything straightforward (no classes, data structures, etc). All simple functions and global variables. I learned the hard way and my robot was jerky, twitchy, and not good at driving around.
@dmranganath
@dmranganath 6 місяців тому
HI, It was a great lecture, thanks for sharing with us. I was able to follow most part of it, but i was unable to understand where input and output ports to arduino are connected in the hardware interface plugin. thanks a lot for sharing with us.
@ngocainguyen1664
@ngocainguyen1664 6 місяців тому
Thank you for your wonderful video. Can i ask you a question about how the robot on rviz2 moving even though the wheel does not rotate?
@pete_handy
@pete_handy 11 місяців тому
Hello! a big fan here. May i ask if what is the point of this if I can just use a calculation to convert cmd_vel (from Twist) to left and right motor velocity? And with a Lidar, I'll just use a laser scan matcher for the odometry of the robot.
@jonathanr4242
@jonathanr4242 4 місяці тому
fantastic. thank you, Josh. I should also mention that example_2 was updated on the repo a couple of weeks ago to use TwistStamped messages, which means it might not work with the teleop_twist_keyboard. I tried to map the cmd_vel to cmd_vel_stamped, but it didn't work. I ended up sending messages from the cli. Maybe try to insert this line into the /config/diffbot_controllers.yaml file (under ros parameters). use_stamped_vel: false
@AhmedMagdy-xb8bl
@AhmedMagdy-xb8bl 2 місяці тому
Exactly the same.
@RoboMech48
@RoboMech48 15 днів тому
jonathanar can you help me?
@matteocarlone6503
@matteocarlone6503 Рік тому
So cool! As all of your videos.. Can you do something about OpenRMF framework from open robotics! I would love it
@ArticulatedRobotics
@ArticulatedRobotics Рік тому
Thanks! I'll put it on the list, but OpenRMF is something I know very little about, and is also fairly low in terms of things I plan to learn more about, so you'll probably be waiting a while before I do a tutorial on it I'm afraid!
@isrg7221
@isrg7221 8 місяців тому
Hi Josh, can you clarify how you are getting the connection string to the robot " /dev/serial/by-path/platform-fd500000.pcie-pci-0000:01:00.0-usb-0:1.3:1.0-port0", my serial connection is failing when connecting to the arduino, also is there a way to simulate serial connection so I can see it on a terminal instead of receiving the string in an actual device. Great Tutorial by the way
@nunobartolo2908
@nunobartolo2908 11 місяців тому
the cpp code that is processing the encoder counts is running in the py or in the arduino? didn't see you flash the arduino
@XONAPA01
@XONAPA01 6 місяців тому
Awesome videos sir! I have a question, you have been writing all the nodes as a .launch.py file but not as a pub/sub Python file. Is there any specific reason? Thank you so much sir.
@patrickwasp
@patrickwasp 7 місяців тому
Is there any special integration between ros control and micro Ros?
@user-pn2km5bk1s
@user-pn2km5bk1s 8 місяців тому
Hey Josh, can I add additional sensors to the interface? how do I add IMU to this? I just need to know if I'm editing the right file. I'm a noob, please help.
@simonlop
@simonlop Рік тому
First of all, congratulations on this great video. I have been working on something for several days now. I am trying to create a hardware interface that reads data from a topic (I am using micro-ROS and cannot find another way to do it). The only idea I had was to implement a socket to another node acting as a server. Do you have any ideas if it is possible to use topics directly in the hardware interface?
@DavidNewmon
@DavidNewmon Рік тому
This can be done, I made all of the I/O with the hardware itself async (running in another process). It really didn't work very well... data just got backed up into a queue in the DDS implementation and I ended up sending commands to the motors that were very old. I need to change the QoS settings on the topic so that it discards older messages automatically. My setup used a control hardware interface like in the video, but I published the commands to a topic. Then I created another node/script that subscribed to that topic and handled the hardware device.
@DavidNewmon
@DavidNewmon Рік тому
You can create Nodes directly, and from there call create_subscriber, create_publisher. I did this inside of a background thread function: rclcpp::Node::SharedPtr processing_node = rclcpp::Node::SharedPtr(new rclcpp::Node("MyControlHardwareBackgroundNode")); velocity_publisher_ = processing_node->create_publisher(ASYNC_VELOCITY_TOPIC, 10); encoder_subscription_ = processing_node->create_subscription(ASYNC_ENCODER_TOPIC, 10, std::bind(&MyControlHardware::on_encoder, this, std::placeholders::_1)); while (!thread_exit_ && rclcpp::ok()) { rclcpp::spin_some(processing_node); }
@diystudio1778
@diystudio1778 4 місяці тому
Please make video on tricycle controller 🙏
@Build_the_Future
@Build_the_Future 11 місяців тому
In the future, I hope you can cover Nvida Isaac Sim.
@ArticulatedRobotics
@ArticulatedRobotics 11 місяців тому
Yeah one day I would like to!
@connor2729
@connor2729 2 місяці тому
I have a question, does this ros control code needs to run on Linux with ros or needs to run on the microcontroller with microros or rosserial. And if the code run on Linux what should run on the microcontroller to allow the ros comunication and wich topics should it publish/subscribe
@mr.p215
@mr.p215 2 місяці тому
Hi Josh, I doubt you will see this but I wanted to ask, The robot we are building for a project does not have encoders on the wheels instead we get the odometry with the lidar, this means that the motors only take an input, what do I need to change for the hardware interface for this to actually function?
@karimyasser230
@karimyasser230 Рік тому
Thank you Josh for the best videos as always! I just have a question tho, if I were using a robot with a mecanum drive, would I just expand the plugin to account 4 motors? How does ros know how to deal with the very different kinematics then, I feel like I don't really grasp where the kinematics of a mecanum drive should be written
@ArticulatedRobotics
@ArticulatedRobotics Рік тому
Yeah great question! If you check out my other video on ros2_control there are two halves to the solution, the hardware interface and the controller. So yep for the hardware interface you just expand it to 4 motors, but you'll need a completely different controller. Here are the ones that come with ros2_control, you'd probably need to copy one and write your own (or find someone else who's done it) github.com/ros-controls/ros2_controllers
@karimyasser230
@karimyasser230 Рік тому
​@@ArticulatedRobotics Aha, that makes a lot more sense now, thank you so much Josh very grateful for your help!
@mr.p215
@mr.p215 2 місяці тому
If I don't have wheel encoders and am instead generating the odometry with a lidar, how should I go about creating the controller?
@DavidNewmon
@DavidNewmon Рік тому
I'm curious if you know of any systems that are "bigger" than rviz2, which can do more mission-level stuff. There's the "Commander API" in ros-navigation, but is there anything more big-picture out there that would make it easy to create some repeatable mission route of some sort?
@russhall1097
@russhall1097 11 місяців тому
You can use waypoint navigation, and read in data from a text file for the waypoints.
@rahultom4310
@rahultom4310 21 день тому
Hii, Can I control and communication with Pioneer 3DX robot using ros2_control which designed to supported by the ARIA, a C++, package or library? Your reply will be very helpful for me.
@kieblade4316
@kieblade4316 Рік тому
Can you make a video that involve c++ algorithm to control real robot with ros
@prathamgyanani5132
@prathamgyanani5132 2 місяці тому
Which ros version are you using for this , ros2-focy or any other ??
@vireakman2066
@vireakman2066 Рік тому
update your course to humble please! Lastly, I would like to grateful to you for your teaching
@thenoobinventor
@thenoobinventor Рік тому
He already did, check out the previous video on the channel.
@Ducerobot
@Ducerobot 11 місяців тому
I installed ros2 humble on pi 4 it runs the examples but wont open with ros2 command even if I source bash first . It's there but wont open thanks for any help.😁👍cool video!
@user-bo1qg2hj8t
@user-bo1qg2hj8t 10 місяців тому
I need an ROS2 control plugin for the Open Manipulator-X arm (hardware). I'm trying to write it because I haven't found it open-source. However, I'm new to this, so any help would be appreciated.
@juanpaez8039
@juanpaez8039 6 місяців тому
Hi. I'm new here but i got a problem with diff controller. When I use the teleop_keyboards, it seems nodes are correctly but my robot doesn't move. I don't understand what happend
@MG.102
@MG.102 Рік тому
Hi josh one question is the pi3 with 1GB ram enough for uploading ros
@russhall1097
@russhall1097 11 місяців тому
I would say, "No." Even 2 GB is sketchy. 4 GB works much better. PI 4 with 4GB is good.
@ArticulatedRobotics
@ArticulatedRobotics 11 місяців тому
As Russ says below, unfortunately it isn't really. Maybe if you used a different OS but that is not properly supported. I'd also recommend the 4GB Pi 4. But if that's what you've got, try installing Debian. I think people have run it on arch too but that's a bit harder.
@ArticulatedRobotics
@ArticulatedRobotics 11 місяців тому
Oh and make sure you use an OS without a gui - Ubuntu Server may even be ok? But Debian headless would be better.
@oscarbest5744
@oscarbest5744 11 місяців тому
Does anyone else get the TextSubstitution error when running the diffbot.launch example? I'm just running the example_2 launch file but i haven't edited anything yet, was wondering if there's been a recent update?
@oscarbest5744
@oscarbest5744 11 місяців тому
Installing xacro sorted it 😊
@quentinmalfroid5406
@quentinmalfroid5406 4 місяці тому
Hi, thank you for your auto answer ! That help me to resolve this error ! Thank you so much to help community
@quentinmalfroid5406
@quentinmalfroid5406 4 місяці тому
@@oscarbest5744 Tank you !
@letianwang8049
@letianwang8049 Рік тому
for hardware_interface, seems on_deactive, on_cleanup and on_shutdown will not be called and can not be graceful shutdown. do you know how they work?
@ArticulatedRobotics
@ArticulatedRobotics Рік тому
This is a great question and I almost covered it in the video. So those will be called IF you use the appropriate service call to deactivate/shutdown the hardware interface. This WON'T happen if you just interrupt it in the terminal with Ctrl-C, but would be used as part of a broader, structured system.
@letianwang8049
@letianwang8049 Рік тому
@@ArticulatedRobotics thanks for the answer. but why they don't implement auto graceful shutdown for hardware interface? is their any concern for that?
@yenyuthnea631
@yenyuthnea631 11 місяців тому
Hi @JoshNewans How could i do if i am using in Foxy ?
@ArticulatedRobotics
@ArticulatedRobotics 11 місяців тому
The same ros2_control demo code is available for foxy so you can find the appropriate branch/commit and start from there, but the rest of my instructions will be harder to follow as things have changed. The concepts are the same though. But you should swap to humble as foxy is EOL now!
@christophermacier
@christophermacier 11 місяців тому
Is there a way to do the hardware setup using Python?
@ArticulatedRobotics
@ArticulatedRobotics 11 місяців тому
Unfortunately not with ros2_control. You could create the entire control system in python though (i.e. a node that takes a twist or other command in, calculates drive commands, and sends them tot he motors)
@robertvirnau6990
@robertvirnau6990 2 місяці тому
hello! thanks for this great video! I am new to ROS2. When building then running the example 2 package I get : [ERROR] [launch]: Caught exception in launch (see debug for traceback): executed command failed. Command: /opt/ros/humble/bin/xacro /home/bobby/control_ws/install/ros2_control_demo_example_2/share/ros2_control_demo_example_2/urdf/diffbot.urdf.xacro use_mock_hardware:=false Captured stderr output: error: package not found: "package 'ros2_control_demo_description' not found, searching: ['/home/bobby/control_ws/install/ros2_control_demo_example_2', '/opt/ros/humble']" when processing file: /home/bobby/control_ws/install/ros2_control_demo_example_2/share/ros2_control_demo_example_2/urdf/diffbot.urdf.xacro rosdep gives me: rosdep install -i --from-path src --rosdistro $ROS_DISTRO -y ERROR: the following packages/stacks could not have their rosdep keys resolved to system dependencies: ros2_control_demo_example_2: Cannot locate rosdep definition for [ros2_control_demo_description] any ideas on what to do to fix this. A quick internet search sent me many directions... I am going to try going through the ros2_control docs and tutorials as well.
@robertvirnau6990
@robertvirnau6990 2 місяці тому
figured out. sometimes you just have to keep swimming :). I saw that ros2_control for humble was failing on the website, so I upgraded to iron. Not sure if that was my issue, but it works now.
@AhmedMagdy-xb8bl
@AhmedMagdy-xb8bl 2 місяці тому
Just copy the ros2_control_demo_description folder to control_ws/src then build your work space and you will get rid of this error.
@RoboMech48
@RoboMech48 15 днів тому
@@AhmedMagdy-xb8bl hello sir can you help me? i am facing issues?
Are you ready to Humble?
16:50
Articulated Robotics
Переглядів 18 тис.
Solving the problem EVERY robot has (with ros2_control)
24:36
Articulated Robotics
Переглядів 68 тис.
GADGETS VS HACKS || Random Useful Tools For your child #hacks #gadgets
00:35
BMW просто издевается над нами! Силы на исходе…
1:34:41
ИЛЬДАР АВТО-ПОДБОР
Переглядів 3,6 млн
Ах Ты Ж Су... Не Провоцируй Меня! @NutshellAnimations
00:15
Глеб Рандалайнен
Переглядів 1,6 млн
If you're not developing with this, you're wasting your time
14:30
Articulated Robotics
Переглядів 234 тис.
Compiling MS-DOS 4.0 using DOSbox & Qemu
17:59
Neozeed
Переглядів 2,5 тис.
Building a ROS Robot for Mapping and Navigation #1
19:53
James Bruton
Переглядів 210 тис.
Using ros2_control to drive our robot (off the edge of the bench...)
31:38
Articulated Robotics
Переглядів 45 тис.
The Ultimate Guide to using Motors in Robotics (including ROS, Raspberry Pi)
25:56
Articulated Robotics
Переглядів 292 тис.
Has Generative AI Already Peaked? - Computerphile
12:48
Computerphile
Переглядів 135 тис.
Docker 101
20:01
Articulated Robotics
Переглядів 16 тис.
you need to stop using print debugging (do THIS instead)
7:07
Low Level Learning
Переглядів 387 тис.
Raspberry Pi for Robotics with ROS2 : Headless Development Setup
10:26
Muhammad Luqman
Переглядів 2 тис.
GADGETS VS HACKS || Random Useful Tools For your child #hacks #gadgets
00:35