2.6.1 - ROS2 Node Basics - Node creation

In section 2.6.1 of Ros 2 basic course, I have followed and copied all the steps to verify that the node is running but it does not. How am i supposed to solve this issue?
The While loop seems not running (why?) and therefore the node doesn’t appear on terminal 2

Furthermore I have notice that executing the program with command “python3 heartbeat.py” directly into the folder where the file is located, the node runs. The problem could be the setup.py file, why? I copied it from the courselecture

Please review the lesson again and ensure you did not skip any steps. Any minor details missed could cause this.

Also, did you start the node? Did it start successfully?

If you still need help, please share relevant screenshots (showing how you started the node) and files (like setup.py).

Hey @Davide-Bros if you can go directly to the folder where the file is located and run it, but can’t from anywhere else this implies either of two things to me

  1. The ros workspace that this project was created was not sourced since a new terminal was opened, the files was created/saved, or even in the cases of interfaces a code change was made.
  2. The directory structure was not setup which can easily happen a number of different ways.

While copying the file exactly can correctly create the node the things that are easy to miss are the steps that have to be followed carefully when using ROS to ensure that it can do what it does best. So like what @bayodesegun said, it would likely be good to step back through the tutorial. Keep any eye our for steps that might have been forgotten.

This topic was automatically closed 5 days after the last reply. New replies are no longer allowed.