Communicate with each other through topics, services, and parameters

All node name should be unique!

How to install this file?

we want to make node executable.

Python

in setup.py

we specify the name of executable.

entry_points={
        'console_scripts': [
            "py_node = my_py_pkg.my_first_node:main"
        ],
    }

whenever we need more library in the node, add this line

<depend>{added library}</depend>

Execute node

ros2 run my_py_pkg py_node

C++

in CMakeLists.txt, add these lines.

upper 2 lines, and one line for install list.

# create executable
add_executable(cpp_node src/my_first_node.cpp)
ament_target_dependencies(cpp_node rclcpp)

# make executable run-able.
install (TARGETS
  cpp_node
  DESTINATION lib/${PROJECT_NAME}
)