{"id":25491498,"url":"https://github.com/woolfrey/tutorial_ros2","last_synced_at":"2025-11-08T17:30:37.809Z","repository":{"id":276986943,"uuid":"930315116","full_name":"Woolfrey/tutorial_ros2","owner":"Woolfrey","description":"Coding tutorials on ROS2 publishers \u0026 subscribers, client \u0026 service, and action servers.","archived":false,"fork":false,"pushed_at":"2025-02-18T16:19:12.000Z","size":1990,"stargazers_count":0,"open_issues_count":0,"forks_count":0,"subscribers_count":1,"default_branch":"main","last_synced_at":"2025-02-18T16:33:08.384Z","etag":null,"topics":["actions","client-server","publisher-subscriber","rclcpp","ros2"],"latest_commit_sha":null,"homepage":"","language":null,"has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":"gpl-3.0","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/Woolfrey.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":null,"funding":null,"license":"LICENSE","code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null,"governance":null,"roadmap":null,"authors":null,"dei":null,"publiccode":null,"codemeta":null}},"created_at":"2025-02-10T12:43:40.000Z","updated_at":"2025-02-16T17:09:21.000Z","dependencies_parsed_at":"2025-02-11T14:41:39.243Z","dependency_job_id":"17661d29-9d88-4502-9c3a-431fa338969b","html_url":"https://github.com/Woolfrey/tutorial_ros2","commit_stats":null,"previous_names":["woolfrey/tutorial_ros2"],"tags_count":0,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/Woolfrey%2Ftutorial_ros2","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/Woolfrey%2Ftutorial_ros2/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/Woolfrey%2Ftutorial_ros2/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/Woolfrey%2Ftutorial_ros2/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/Woolfrey","download_url":"https://codeload.github.com/Woolfrey/tutorial_ros2/tar.gz/refs/heads/main","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":239558934,"owners_count":19658934,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2022-07-04T15:15:14.044Z","host_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub","repositories_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories","repository_names_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repository_names","owners_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners"}},"keywords":["actions","client-server","publisher-subscriber","rclcpp","ros2"],"created_at":"2025-02-18T22:17:44.994Z","updated_at":"2025-02-18T22:17:45.644Z","avatar_url":"https://github.com/Woolfrey.png","language":null,"funding_links":[],"categories":[],"sub_categories":[],"readme":"# ROS2 C++ Tutorials\n\nThis repository contains a series of coding tutorials based on the 3 communication protocols in ROS2:\n\n- [Publishers \u0026 subscribers](https://github.com/Woolfrey/tutorial_ros2/blob/publisher/README.md#publishers--subscribers),\n- [Clients \u0026 services](https://github.com/Woolfrey/tutorial_ros2/blob/service/README.md#service--client), and\n- [Action servers \u0026 action clients](https://github.com/Woolfrey/tutorial_ros2/blob/action/README.md#action-servers--action-clients).\n\n### Contents:\n - [What Are They?](#what-are-they-thinking)\n - [Getting Started](#getting-started-checkered_flag)\n\n## What Are They? :thinking:\n\nThese classes, clients, and servers are embedded within a `Node` which processes / sends / receives different types of data being sent over the ROS2 network.\n\n\u003cp align=\"center\"\u003e\n  \u003cimg src=\"doc/NodeInteraction.png\" width=250 height=\"auto\" alt=\"Node interactions.\"/\u003e\n  \u003cbr\u003e\n  \u003cem\u003eFigure 1: Nodes in ROS2 combine different communication protocols to achieve complex tasks.\u003c/em\u003e\n\u003c/p\u003e\n\nAny number of these communicators may combined within a `Node` to achieve a desired task. The type of communication method depends on the type of data being transmitted, and how it is expected to be processed:\n\n**_Table 1: Properties of ROS2 Communication Protocols._**\n| Sender | Receiver | Node Interaction | Periodicity | Example(s) |\n|--------|----------|------------------|-------------|------------|\n| Publisher | Subscriber | One ➡️ Many | Frequent | Sensor data, joystick inputs 🕹️ |\n| Client | Service | One ↔️ One| Upon request | Retreiving map updates 🗺️ |\n| (Action) Client | (Action) Server | One ↔️ One | Upon request, with frequent updates. | Moving a robot to a target location :dart: |\n\nThe `Publisher` and `Subcriber` protocol is analogous to the role of a news agency, or book store. A printing press will publish magazines and/or books that are sent to a store. They are made publically available for people to purchase of their own volition. The type of data being communicated is fast, frequent, and numerous.\n\n\u003cp align=\"center\"\u003e\n  \u003cimg src=\"doc/PublisherSubscriberModel.png\" width=\"400\" height=\"auto\" alt=\"Publisher/Subscriber Model.\"/\u003e\n  \u003cbr\u003e\n  \u003cem\u003eFigure 2: Publishers make data publicly available for any number of subscribers.\u003c/em\u003e\n\u003c/p\u003e\n\nThe `Client` and `Service` protocol is more akin to a postal service. A request is sent by a `Client` directly to a `Server`, who will process said request and send a reponse. The type of data being communicated is fast, infrequent, and sparse.\n\n\u003cp align=\"center\"\u003e\n  \u003cimg src=\"doc/ClientServerModel.png\" width=\"300\" height=\"auto\" alt=\"Client/Service Model.\"/\u003e\n  \u003cbr\u003e\n  \u003cem\u003eFigure 3: Clients and services exchange information privately and directly.\u003c/em\u003e\n\u003c/p\u003e\n\nThe `Action Client` and `Action Server` protocol is analogous to requesting transport with Uber. The request is made, a driver confirms the response, and updates are given in real time on how close the driver is to arrival. The interaction is infrequent, like the `Server` \u0026 `Client` protocol, but frequent updates are provided like the `Publisher` \u0026 `Subscriber`.\n\n\u003cp align=\"center\"\u003e\n  \u003cimg src=\"doc/ActionServerModel.png\" width=\"400\" height=\"auto\" alt=\"Action Server Model.\"/\u003e\n  \u003cbr\u003e\n  \u003cem\u003eFigure 4: Actions carry out goals over an extended period of time, providing feedback.\u003c/em\u003e\n\u003c/p\u003e\n\n[⬆️ Back to top.](https://github.com/Woolfrey/tutorial_ros2/blob/main/README.md#ros2-c-tutorials)\n\n## Getting Started :checkered_flag:\n\nMake a directory for your ROS2 workspace, for example `ros2_workspace`:\n```\nmkdir ros2_workspace\n```\nNavigate inside of this new folder, and create a `src` directory:\n```\ncd ros2_workspace/ \u0026\u0026 mkdir src\n```\nNow navigate inside this new folder:\n```\ncd src/\n```\nand create the new package:\n```\nros2 pkg create --dependencies rclcpp -- tutorial_ros2\n```\n\n\u003cp align=\"center\"\u003e\n  \u003cimg src=\"doc/create_package.png\" width=\"600\" height=\"auto\" alt=\"Create ROS2 package.\"/\u003e\n  \u003cbr\u003e\n  \u003cem\u003e Figure 5: Creating a new package for the tutorial in ROS2.\u003c/em\u003e\n\u003c/p\u003e\n\nThe folder structure should look something like this:\n```\nros2_workspace/\n└── src/\n    ├── include/\n    |    └── tutorial_ros/\n    ├── src/\n    ├── CMakeLists.txt\n    └── package.xml\n```\nThe important files for a functional ROS2 package are `CMakeLists.txt` and `package.xml`.\n\nMore information can be found in the [official ROS2 tutorial page](https://docs.ros.org/en/foxy/Tutorials/Beginner-Client-Libraries/Creating-Your-First-ROS2-Package.html).\n\n\n[⬆️ Back to top.](https://github.com/Woolfrey/tutorial_ros2/blob/main/README.md#ros2-c-tutorials)\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fwoolfrey%2Ftutorial_ros2","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fwoolfrey%2Ftutorial_ros2","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fwoolfrey%2Ftutorial_ros2/lists"}