{"id":28628358,"url":"https://github.com/lalywr2000/piracer-gazebo-simulation","last_synced_at":"2026-04-13T20:31:51.084Z","repository":{"id":226061960,"uuid":"767620118","full_name":"lalywr2000/PiRacer-Gazebo-Simulation","owner":"lalywr2000","description":"Gazebo simulation model for PiRacer control and experimentation","archived":false,"fork":false,"pushed_at":"2024-03-21T03:33:38.000Z","size":63338,"stargazers_count":1,"open_issues_count":0,"forks_count":1,"subscribers_count":1,"default_branch":"main","last_synced_at":"2025-07-01T15:12:46.890Z","etag":null,"topics":["digital-twin","gazebo","gazebo-models","gazebo-ros","gazebo-simulation","gazebo-simulator","linux","piracer","raspberry-pi","ros2"],"latest_commit_sha":null,"homepage":"","language":"Python","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":"mit","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/lalywr2000.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,"zenodo":null}},"created_at":"2024-03-05T16:12:21.000Z","updated_at":"2025-02-03T13:10:16.000Z","dependencies_parsed_at":"2024-03-21T04:33:40.354Z","dependency_job_id":"a5629dce-5667-4090-93d4-b1daa2c500b3","html_url":"https://github.com/lalywr2000/PiRacer-Gazebo-Simulation","commit_stats":null,"previous_names":["lalywr2000/piracer-gazebo-simulation"],"tags_count":0,"template":false,"template_full_name":null,"purl":"pkg:github/lalywr2000/PiRacer-Gazebo-Simulation","repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/lalywr2000%2FPiRacer-Gazebo-Simulation","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/lalywr2000%2FPiRacer-Gazebo-Simulation/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/lalywr2000%2FPiRacer-Gazebo-Simulation/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/lalywr2000%2FPiRacer-Gazebo-Simulation/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/lalywr2000","download_url":"https://codeload.github.com/lalywr2000/PiRacer-Gazebo-Simulation/tar.gz/refs/heads/main","sbom_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/lalywr2000%2FPiRacer-Gazebo-Simulation/sbom","scorecard":null,"host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":286080680,"owners_count":31770718,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2026-04-13T20:17:16.280Z","status":"ssl_error","status_checked_at":"2026-04-13T20:17:08.216Z","response_time":93,"last_error":"SSL_read: unexpected eof while reading","robots_txt_status":"success","robots_txt_updated_at":"2025-07-24T06:49:26.215Z","robots_txt_url":"https://github.com/robots.txt","online":false,"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":["digital-twin","gazebo","gazebo-models","gazebo-ros","gazebo-simulation","gazebo-simulator","linux","piracer","raspberry-pi","ros2"],"created_at":"2025-06-12T10:12:17.856Z","updated_at":"2026-04-13T20:31:51.061Z","avatar_url":"https://github.com/lalywr2000.png","language":"Python","funding_links":[],"categories":[],"sub_categories":[],"readme":"# PiRacer Simulation with ROS2 and Gazebo\n\n\u003cdiv width=\"100%\" align=\"center\"\u003e\n    \u003cimg width=\"49%\" src=\"/images/design.png\"\u003e\n    \u003cimg width=\"49%\" src=\"/images/model.png\"\u003e\n\u003c/div\u003e\n\n---\n\nThis repository provides tools and examples for controlling and experimenting with **PiRacer model vehicle** in Gazebo. The Gazebo model, designed to match the hardware specifications of PiRacer, can be controlled via ROS2 topic communication. The included teleoperation example is a simple demonstration using the WASD keys on the keyboard, allowing simultaneous control of both the real PiRacer and the PiRacer in Gazebo.\n\nThe idea is to utilize this repository as a template for **digital twin** research. By equipping PiRacer with sensors such as odometer, IMU, LiDAR, etc., and implementing closed-loop feedback control, it would be possible to more accurately replicate the behavior of the real-world PiRacer in Gazebo.\n\n| ![Throttle](/images/throttle.gif) | ![Steering](/images/steering.gif) |\n|:---:|:---:|\n| Throttle | Steering |\n\n## ROS2 Packages\n\n```shell\n./\n ├── simulation_ws/src/\n │   └── sim        # Description and launch file for PiRacer model\n │\n └── teleoperation_ws/src/\n     └── teleop     # Remote control example including a controller and a receiver\n```\n\n## Requirements\n\nBefore using this package, ensure the following prerequisites are installed:\n\n| Device           | Software/Framework                                                                 | Functionality              |\n|------------------|------------------------------------------------------------------------------------|----------------------------|\n| **Local**        | [Gazebo 11](https://fdeantoni.medium.com/ros2-dev-with-gazebo-11-3f1795bba33)      | Simulation environment     |\n| **Local**        | [ROS2 Foxy](https://docs.ros.org/en/foxy/Installation/Ubuntu-Install-Debians.html) | Robotics middleware        |\n| **Local**        | [pygame](https://pypi.org/project/pygame/)                                         | Keyboard input for control |\n| **Raspberry Pi** | [ROS2 Foxy](https://docs.ros.org/en/foxy/Installation/Ubuntu-Install-Debians.html) | Robotics middleware        |\n| **Raspberry Pi** | [piracer](https://github.com/twyleg/piracer_py)                                    | Physical PiRacer control   |\n\nThis package has been developed and tested on both local machine and Raspberry Pi 4, using Ubuntu 20.04.\n\n## Usage\n\n**Gazebo Simulator and Teleoperation Controller are for local environment. While this controller can simultaneously control physical PiRacer, if the purpose is solely simulation, the setup on Raspberry Pi can be disregarded, and only the local environment is utilized.**\n\n### 0. Package Configuration\n\nChange the `gazebo_model_path` in the **package.xml** located in `simulation_ws/src/sim` to suit your local environment.\n\n### 1. Launch Gazebo Simulator\n\n```bash\n# Local\ncd simulation_ws\ncolcon build\n\nsource install/local_setup.bash\nros2 launch sim sim.launch.py\n```\n\nYou should see the PiRacer model inside the Gazebo simulation window.\n\n### 2. Run Teleoperation Receiver\n\n```bash\n# Raspberry Pi\ncd teleoperation_ws\ncolcon build\n\nsource install/local_setup.bash\nros2 run teleop receiver\n```\n\n### 3. Run Teleoperation Controller\n\n```bash\n# Local\ncd teleoperation_ws\n\nsource install/local_setup.bash\nros2 run teleop controller\n```\n\nWhen you run the controller, a small pygame window like the following will appear.\n\n\u003cdiv width=\"100%\" align=\"center\"\u003e\u003cimg src=\"/images/controller.png\" align=\"center\" width=\"30%\"\u003e\u003c/div\u003e\n\nClick on this window and press the WASD keys on the keyboard. Observe the movement of both Gazebo PiRacer and physical PiRacer.\n\n## Note\n\nThe communication between controller node and receiver node is machine-to-machine. Make sure that local machine and Raspberry Pi are connected to the same WLAN. If connection is not successful, disable the firewall using the following command.\n\n```bash\n# Local \u0026 Raspberry Pi\nsudo ufw disable\n```\n\n## Explore\n\nDesign various experiments and developments using the Gazebo PiRacer. This package provides an example with the PiRacer camera. Check the view of the PiRacer's camera using **RViz2**. For instance, you can use this image data to implement autonomous driving in the simulation.\n\n\u003cdiv width=\"100%\" align=\"center\"\u003e\u003cimg src=\"/images/camera.png\" align=\"center\" width=\"70%\"\u003e\u003c/div\u003e\n\n## References\n\n- [Waveshare PiRacer](https://www.waveshare.com/wiki/PiRacer_AI_Kit)\n- [ROS2 Foxy](https://docs.ros.org/en/foxy/index.html)\n- [Gazebo](https://classic.gazebosim.org/)\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Flalywr2000%2Fpiracer-gazebo-simulation","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Flalywr2000%2Fpiracer-gazebo-simulation","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Flalywr2000%2Fpiracer-gazebo-simulation/lists"}