Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Talk about spinning #381

Open
wants to merge 4 commits into
base: foxy
Choose a base branch
from
Open
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Original file line number Diff line number Diff line change
Expand Up @@ -134,6 +134,8 @@ Your goal is to create your first ROS node:
* To use a different logging level, replace INFO in `RCLCPP_INFO` or `RCLCPP_INFO_STREAM` with the appropriate level.
* Use `RCLCPP_INFO` for printf-style logging, and `RCLCPP_INFO_STREAM` for cout-style logging.

`rclcpp::spin(node)` instructs the node to listen for any activity on subscribed topics or requested service connections. Without it, your callback functions won't ever run. Don't worry if some of this language doesn't yet make sense, we'll cover topics and services in the next sections. (More technical details [here](https://docs.ros.org/en/rolling/Concepts/About-Executors.html).)

1. Now that you have created the source code for the node, we need to add instructions for building it into an executable program. In the package folder, edit the _CMakeLists.txt_ file using _gedit_. Define an executable node named vision_node (_add_executable_), with the source file _vision_node.cpp_. Also within the _CMakeLists.txt_, make sure your new vision_node gets linked to the required dependencies.

``` cmake
Expand Down