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.
in setup.py
we specify the name of executable.
entry_points={
'console_scripts': [
"py_node = my_py_pkg.my_first_node:main"
],
}
<depend>{added library}</depend>
ros2 run my_py_pkg py_node
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}
)