{"id":20491092,"url":"https://github.com/mataruzz/libhcsr04","last_synced_at":"2025-10-04T04:57:10.840Z","repository":{"id":203356147,"uuid":"708410392","full_name":"mataruzz/libHCSR04","owner":"mataruzz","description":"Library for ultrasonic HCSR04, with relative ROS2 wrapper","archived":false,"fork":false,"pushed_at":"2023-10-24T16:56:24.000Z","size":69,"stargazers_count":7,"open_issues_count":0,"forks_count":2,"subscribers_count":1,"default_branch":"humble","last_synced_at":"2025-09-25T05:41:17.607Z","etag":null,"topics":[],"latest_commit_sha":null,"homepage":null,"language":"C++","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":null,"status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/mataruzz.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":null,"funding":null,"license":null,"code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null,"governance":null}},"created_at":"2023-10-22T13:40:21.000Z","updated_at":"2025-07-31T11:38:02.000Z","dependencies_parsed_at":null,"dependency_job_id":"a0e11669-d894-4494-b69a-56c74078847b","html_url":"https://github.com/mataruzz/libHCSR04","commit_stats":null,"previous_names":["mataruzz/libhcsr04"],"tags_count":0,"template":false,"template_full_name":null,"purl":"pkg:github/mataruzz/libHCSR04","repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/mataruzz%2FlibHCSR04","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/mataruzz%2FlibHCSR04/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/mataruzz%2FlibHCSR04/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/mataruzz%2FlibHCSR04/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/mataruzz","download_url":"https://codeload.github.com/mataruzz/libHCSR04/tar.gz/refs/heads/humble","sbom_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/mataruzz%2FlibHCSR04/sbom","scorecard":null,"host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":278266895,"owners_count":25958733,"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","status":"online","status_checked_at":"2025-10-04T02:00:05.491Z","response_time":63,"last_error":null,"robots_txt_status":"success","robots_txt_updated_at":"2025-07-24T06:49:26.215Z","robots_txt_url":"https://github.com/robots.txt","online":true,"can_crawl_api":true,"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":[],"created_at":"2024-11-15T17:19:52.706Z","updated_at":"2025-10-04T04:57:10.826Z","avatar_url":"https://github.com/mataruzz.png","language":"C++","funding_links":[],"categories":[],"sub_categories":[],"readme":"# Ultrasonic HCSR04 Sensor Library and ROS 2 Wrapper\n\u003cp align=\"center\"\u003e\n  \u003cimg width = \"200\" src=\"./doc/images/HC-SR04-Ultrasonic-Sensor.jpg\"\u003e\n\u003c/p\u003e\nThis repository provides a library and a ROS 2 wrapper for using the HC-SR04 ultrasonic sensor with a Raspberry Pi 3B+.\n\n\n## Introduction\n\nThe HC-SR04 ultrasonic sensor is a popular choice for measuring distances using ultrasonic waves. This repository offers a library that allows you to interface with the sensor on a Raspberry Pi 3B+. It also provide a ROS 2 wrapper that makes it easy to integrate the sensor data into your ROS 2 applications.\n\n## Library\n\nThe library provided here offers low-level access to the HC-SR04 sensor for Raspberry Pi 3B+. It includes functions for reading distance and velocity measurements (veocity computed as difference in time between 2 distance measurements). You can use this library in your non-ROS applications or as a foundation for ROS-based projects.\n\n## ROS 2 Wrapper\n\nThe ROS 2 wrapper simplifies the integration of the HC-SR04 sensor with ROS 2 Humble. It creates ROS 2 topics to publish distance and velocity data, allowing you to utilize the sensor in your ROS 2 robotic systems.\n\n## Prerequisites\n\nTo use the provided library and ROS 2 wrapper, you'll need:\n\n- A Raspberry Pi (3B+).\n- The HC-SR04 ultrasonic sensor.\n- ROS 2 Humble installed on your Raspberry Pi.\n- WiringPi library to be installed on your Raspberry Pi (clone using [this](https://github.com/WiringPi/WiringPi) repository and build it with: ```cd ~/WiringPi/WiringPi \u0026\u0026 ./build```).\n\n\n## Usage\n\n1. Clone this repository to your Raspberry Pi:\n\n    ```bash\n    git clone https://github.com/mataruzz/libHCSR04.git\n    ```\n2. Build and source the wrapper:\n    ```bash\n    cd libHCSR04/libHCSR04_ros\n    colcon build --symlink-install --parallel-workers 2 --executor sequential\n    . install/setup.bash\n    ```\n3. Run the ultrasonic HC-SR04 wrapper:\n    ```bash\n    ros2 run lib_hcsr04_ros RunUltrasonicHCSR04Wrapper \n    ```\n\n## Reference\n- http://wiki.ros.org/Drivers/Tutorials/DistanceMeasurementWithUltrasonicSensorHC-SR04Cpp","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fmataruzz%2Flibhcsr04","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fmataruzz%2Flibhcsr04","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fmataruzz%2Flibhcsr04/lists"}