
creating nodes. Note that we used ament_python
as the build type, which tells ROS 2 that we intend
to use Python to create nodes in this package.
We will write our source code in my_first_pkg/
my_first_pkg/. The other files in my_first_pkg/
help ROS understand how to build and install our
package.
The workspace contains a number of other
example packages from the GitHub repository,
such as my_bringup and my_cpp_pkg. You
are welcome to explore those to see how to
implement other nodes and features in ROS.
CREATE PUBLISHER AND SUBSCRIBER
NODES
Create a new file named my_publisher.py in my_
first_pkg/my_first_pkg/ and open it in VS Code:
code ...