Create a ROS2 Node with Python and OOP - ROS2 Tutorial 5

preview_player
Показать описание
In this ROS2 tutorial you will create your first ROS2 Node with Python. We will directly use OOP (Object Oriented Programming) to write the node.

⏱️ Chapters
(0:00) Create a Python file for your node
(2:35) Install ROS extension on VS Code
(4:06) Hello world node
(10:53) Make the node spin
(12:49) Install the node
(19:03) Add a timer and a callback inside the node
(22:25) Introspect the node you’ve created

Рекомендации по теме
Комментарии
Автор

Thank you for watching!
🔥 To go further with ROS2, check out this complete and step-by-step ROS2 course

RoboticsBackEnd
Автор

I have been reading articles, docs and watching other tutorials for three days. This series got me up and going in a few minutes. I just wanted to add if the a KeyboardInterrupt error bothers you you can use "ctrl+z" || new output => [1]+ Stopped ros2 run my_robot_controller test_node

impostercoding
Автор

My man I watched all the playlist 3 month ago to work on my graduation project, I only skipped this video and had to always type colcon build during these 3 months 😆, I even tried searching for a solution online but none actually helped. Your content is really simple and straight forward

MohamadAlajouz
Автор

Love this! For a ROS beginner like myself it’s been very helpful

codewithdominic
Автор

I am learning ROS2 for a project and this video really helped me! Thank you!

saikeertanareddy
Автор

Merhaba ; Ben ilk ROS neotikle başladım ve eksiksiz öğrettiklerinizi tamamladım. Şimdide ROS2 başladım ve beşinci derse kadar eksiksiz devam ediyorum .Eğitimin için sana cok teşekkür ederim . python yeni öğrenen biriyim ama buna rağmen tüm derslerini eksiksiz yerine getirebiliyorum . Ama herşeyi bakarak yapıyorum ilerde tek başımada yapabilirmiyim bilmiyorum.

SA-ecuo
Автор

good course, one note though: the dark blue path part of the prompt in bash is not readable, so it makes it harder to follow.

pyakpepyak
Автор

the rclpy is not working for me. I downloaded the extentsion and there is an error in the code

abhinavmathew
Автор

Good Day, firstly great video series. I, however got stuck on 9:54, I run the my_first_node.py but the terminal does not print anything. would you be able to assist
Thank you

SihleTrolly
Автор

you are a real hero, thank you for the content

hemrajpandeya
Автор

At 10:13, how did you execute a python file using "./" ?
I tried the cmd "./my_first_node.py" but it didn't work.
It only works if I do "python3 my_first_node.py".
Please explain, thank you!

jerryhsieh
Автор

Hi, thanks for the excellent tutorial! I am a newer of the terminal. And when I run 'ros2 run my_robot_controller test_node' it says 'Package 'my_robot_controller' not found'. I don't know if it is related that I used zsh and run 'source ~/.zshrc' rather than 'source ~/.bashrc'. Or it is about 'colcon build' (no error appeared from this command)? thanks!

zhuozhang
Автор

First of all thank you for the wonderful explanation.
I have an error when I am trying to run node as ros2 functionality(ros2 run) as per video time line 15.25. Th error saying that "Package 'my_robot_controller' not found". Can you please help me?

NB: 1). Usually the auto completion is available in my terminal, but not during this terminal session.
2). I am able to run the same node as python script from the same terminal.

rahultom
Автор

Hi! I'm running into a problem at 15:26 where after having source ~/.bashrc, I could not run the command ros2 run because it reported an error because it oculd not find any executable. Does anyone know why?
I have been trying to find searching it but I havent been successful at all.

spaghettiman
Автор

Hey When i am running the my_frist_node,
i found an error : No module Named " rclpy._rclpy_pybind11"

ashoksaini
Автор

i have a problem at 3:54 bcs rclpy is still not found in my code even though i installed the extention and checked the python version as well as if rclpy is correctly installed :/

drawingninja
Автор

heyy thats a good tutorial for a newbie like me, thnaks for making these videos
though I’m running into a slight problem at 15:12, ros2 run my_robot_cotroller, this aint working for me, it says the following arguements require executable_name, though i have give the executable _name which is test_node, executable name and the package_name put togather it is ros2 run my_robot_controller test_name as youve shown in the video, still it says error and package my_robot_controller not found
can you pls help me with this

reziepaul
Автор

Hi, what happens If I use colcon build inside the src directory ? I was mistakenly doing this and I was so anxious that the updated code was not being tracked. Later on carefully watching the blue text, I realized you were doing it inside ros2_ws and not inside src. It fixed the problem of updates. But, what are the consequences ?

MrEngineer_
Автор

22:15 suppose you want to automatically exit the Python program after receiving 10 counts, how can you do that? Basically break out the rclpy.spin? What’s the best solution for that? rclpy.shutdown() doesn’t work for me as the “context is not initiated”

blokpm
Автор

If source ~/.bashrc doesn't work, use source install/setup.bash instead

thebasementengineer