{"id":22497233,"url":"https://github.com/armgits/beginner_tutorials","last_synced_at":"2025-03-27T21:26:23.106Z","repository":{"id":205396055,"uuid":"713980935","full_name":"armgits/beginner_tutorials","owner":"armgits","description":"My ROS2 programming assignments for the ENPM808X course.","archived":false,"fork":false,"pushed_at":"2023-11-23T07:46:45.000Z","size":1010,"stargazers_count":0,"open_issues_count":0,"forks_count":0,"subscribers_count":1,"default_branch":"main","last_synced_at":"2025-02-01T23:45:44.775Z","etag":null,"topics":["cpp","ros2","tutorials"],"latest_commit_sha":null,"homepage":"","language":"C++","has_issues":false,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":"apache-2.0","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/armgits.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":"2023-11-03T16:43:11.000Z","updated_at":"2023-11-15T03:43:03.000Z","dependencies_parsed_at":"2023-11-07T02:09:12.801Z","dependency_job_id":"c4a6b9fa-5a7e-46ae-934f-2b2a497d00cd","html_url":"https://github.com/armgits/beginner_tutorials","commit_stats":null,"previous_names":["armgits/beginner_tutorials"],"tags_count":3,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/armgits%2Fbeginner_tutorials","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/armgits%2Fbeginner_tutorials/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/armgits%2Fbeginner_tutorials/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/armgits%2Fbeginner_tutorials/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/armgits","download_url":"https://codeload.github.com/armgits/beginner_tutorials/tar.gz/refs/heads/main","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":245925968,"owners_count":20694986,"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":["cpp","ros2","tutorials"],"created_at":"2024-12-06T20:17:31.814Z","updated_at":"2025-03-27T21:26:23.074Z","avatar_url":"https://github.com/armgits.png","language":"C++","funding_links":[],"categories":[],"sub_categories":[],"readme":"# `tf2`, Unit Testing and Bag Files\n\nENPM808X - Abhishekh Reddy Munnangi, 119399002\n\n## Get started\n\n### Environment and dependencies\n\n#### Operating system, ROS installation and additional software\n\n- Ubuntu Jammy (22.04)\n- ROS2 Humble Hawksbill (Even base installation is sufficient)\n- Git\n\n#### Package dependencies\n\n- `rclcpp` - ROS2 C++ Client Library\n- `std_msgs` - Standard Messages Library\n- `std_srvs` - Standard Services Library\n- `ros2launch` - ROS2 Launch Library for Launch file support\n- `tf2` - Package API for working with reference frames and transformations\n- `tf2_ros` - Command line tools for using the tf2 package\n- `ament_cmake_gtest` - GTest for testing the package\n\n#### Additional notes and considerations\n\n- Frames PDF, rosbag outputs are in the results folder, this folder has been\n  reorganized in this release\n\n- Screenshots of the `rqt_console` GUI showing log messages are in the\n`results/` folder.\n\n- The following section assumes that you have an existing ROS2 workspace. If not,\nsee [how to create one](https://docs.ros.org/en/humble/Tutorials/Beginner-Client-Libraries/Creating-A-Workspace/Creating-A-Workspace.html#create-a-new-directory).\n\n### Cloning the repository\n\nThe root directory of this repository are contents of a ROS2 package. Hence,\nthis needs to be cloned to a folder in the `src/` directory of a ROS2 project\nworkspace.\n\n```console\n\u003cYour ROS2 Workspace\u003e/\n├── build/\n├── install/\n├── log/\n└── src/\n    └── beginner_tutorials/ \u003c-- Repository clones to this folder\n        └── \u003cRepository contents\u003e\n```\n\n\u003cp align=\"center\"\u003eWorkspace directory tree with this repository contents in it\u003c/p\u003e\n\nRun this command in the `src/` directory of your ROS2 workspace\n\n```bash\ngit clone https://github.com/armgits/beginner_tutorials.git beginner_tutorials\n```\n\n\u003e**Before the next step:** For the first time, ensure that the package\n\u003e dependencies are installed. Run these commands from the **root workspace directory**.\n\n```bash\nrosdep init \u0026\u0026 rosdep update\n```\n\n```bash\nrosdep install --from-paths src -y --ignore-src\n```\n\nBuild the package in the **root directory** of your ROS2 workspace.\n\n```bash\ncolcon build --packages-select beginner_tutorials\n```\n\nSource the freshly built package\n\n```bash\nsource install/setup.bash\n```\n\n## Testing a node\n\nGTest test case has been added in this homework to test the `first_astronaut` node.\n\n```bash\ncolcon test --packages-select beginner_tutorials\n```\n\nDetailed outputs could be found in the `build/beginner_tutorials/Testing` and\n`build/beginner_tutorials/test_results` folders.\n\n## Running the nodes for demonstration\n\nIn this exercise, the nodes could either be started individually or together\nusing a launch file.\n\n### Running the nodes individually\n\nStart the `first_astronaut` node in the first terminal\n\n```bash\nros2 run beginner_tutorials talker\n```\n\nStart the `second_astronaut` node in a new, second terminal\n\n```bash\nros2 run beginner_tutorials listener\n```\n\n\u003e**Note:** You might need to source the package in the new terminal as well\n\u003e before running the above command\n\nHit `Crtl + C` in both the terminals to stop the nodes.\n\n### Running the nodes together using launch file (Recommended)\n\nLaunch file unifies the above steps into a single line command for convenience.\n\nBoth the nodes could be launched together with the desired parameters as arguments,\ncreating the perfect meme template.\n\n```bash\nros2 launch beginner_tutorials launch.py record_bag:=\u003cYour option\u003e realization:=\u003cYour text\u003e dramatic_end:=\u003cYour option\u003e\n```\n\n\u003e **Entry format for arguments:**\n\u003e\n\u003e `record_bag:=` True/False \u003cbr\u003e\n\u003e `realization:=` \"double quotes\" \u003cbr\u003e\n\u003e `dramatic_end:=` true/false\n\nTo learn more about the launch arguments, use this command\n\n```bash\nros2 launch beginner_tutorials launch.py --show-args\n```\n\n### Recording messages on topics to rosbag\n\n\u003e **Note:** The recorded rosbag will be saved to the **current working directory**.\n\u003e i.e. The directory in which the launch file is executed in the terminal.\n\nUse the `record_bag` launch argument in the launch command which accepts a\nboolean value of `True` or `False` to record the message activity to a rosbag.\n\n### TF Frames\n\nTwo frames `world` and its child frame `talk` are broadcasted using a\n`StaticTransformBroadcaster` from the `tf2` package. They can be checked and viewed\nwhile at least the `first_astronaut` node is running.\n\nRead the stamped transform messages\n\n```bash\nros2 run tf2_ros tf2_echo world talk\n```\n\nView the frames in a PDF (File is saved in a similar fashion as recording rosbag)\n\n```bash\nros2 run tf2_tools view_frames\n```\n\nSee the [documentaion](https://docs.ros.org/en/humble/Tutorials/Intermediate/Tf2/Debugging-Tf2-Problems.html#checking-the-frames) for\nmore information.\n\n## Reference\n\nThis ROS2 package is a template for the \"Always has been\" meme.\n\n\u003cp align=\"center\"\u003e\u003cimg src=\"https://media.tenor.com/R7iJGnaKOjgAAAAd/lol.gif\" height=\"250\"\u003e\u003c/p\u003e\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Farmgits%2Fbeginner_tutorials","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Farmgits%2Fbeginner_tutorials","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Farmgits%2Fbeginner_tutorials/lists"}