{"id":25560771,"url":"https://github.com/aj1904/ros2-occupancy-grid-maps","last_synced_at":"2026-03-03T15:30:19.586Z","repository":{"id":270376426,"uuid":"910167400","full_name":"AJ1904/ROS2-Occupancy-Grid-Maps","owner":"AJ1904","description":"Software that produces occupancy grid maps based on robot sensor data. The purpose is to have additional experience designing and implementing algorithms that overcome sensor data that is noisy and incomplete.","archived":false,"fork":false,"pushed_at":"2024-12-30T17:01:04.000Z","size":0,"stargazers_count":0,"open_issues_count":0,"forks_count":0,"subscribers_count":1,"default_branch":"main","last_synced_at":"2024-12-30T17:39:36.264Z","etag":null,"topics":["occupancy-grid-map","python","ros2","ubuntu"],"latest_commit_sha":null,"homepage":"https://github.com/AJ1904/ROS2-Occupancy-Grid-Maps","language":null,"has_issues":true,"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/AJ1904.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":"2024-12-30T16:54:32.000Z","updated_at":"2024-12-30T17:25:45.000Z","dependencies_parsed_at":"2024-12-30T17:39:38.699Z","dependency_job_id":"7af78679-2e15-444c-9b7b-37f0a6bc4e9a","html_url":"https://github.com/AJ1904/ROS2-Occupancy-Grid-Maps","commit_stats":null,"previous_names":["aj1904/ros2-occupancy-grid-maps"],"tags_count":0,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/AJ1904%2FROS2-Occupancy-Grid-Maps","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/AJ1904%2FROS2-Occupancy-Grid-Maps/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/AJ1904%2FROS2-Occupancy-Grid-Maps/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/AJ1904%2FROS2-Occupancy-Grid-Maps/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/AJ1904","download_url":"https://codeload.github.com/AJ1904/ROS2-Occupancy-Grid-Maps/tar.gz/refs/heads/main","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":239884257,"owners_count":19713087,"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":["occupancy-grid-map","python","ros2","ubuntu"],"created_at":"2025-02-20T17:38:48.823Z","updated_at":"2026-03-03T15:30:19.520Z","avatar_url":"https://github.com/AJ1904.png","language":null,"funding_links":[],"categories":[],"sub_categories":[],"readme":"# ROS2-Occupancy-Grid-Maps\nSoftware that produces occupancy grid maps based on robot sensor data. The purpose is to have additional experience designing and implementing algorithms that overcome sensor data that is noisy and incomplete.\n\n## How the Program Works\n\n### Overview\nOur project utilizes a **ROS2 launch file** to orchestrate multiple nodes that simulate a differential drive robot. The launch file takes the argument `robot_file`, specifying the robot's configuration, and incorporates two additional arguments, `bag_in` and `bag_out`, for managing ROS bag files. The system runs the built-in `robot_state_publisher` node alongside our custom `simulator_node` and `velocity_translator_node`.\n\n#### Sample Command\n```bash\nros2 launch project4a start.launch.py \\\n  robot_file:=project4a/robot_files/bad.robot \\\n  bag_in:=project4a/input_bags/input4 \\\n  bag_out:=project4a/output_bags/output5\n```\n\n---\n\n### Key Components of `start.launch.py`\n\n1. **Launch Arguments**\n   - **`robot_file`:** Specifies the robot configuration file. The value is accessed using `sys.argv` for flexibility without hardcoding.\n   - **`bag_in` and `bag_out`:** Used for input and output ROS bag files.\n\n2. **Loading Robot Parameters**\n   - The function `load_disc_robot` reads the robot's details (e.g., URDF, radius, wheel distance, error parameters) from the specified file, making them accessible across nodes.\n\n3. **Robot State Publisher Node**\n   - Publishes the robot's state using the URDF description for integration with the ROS2 ecosystem.\n\n4. **Simulator Node**\n   - Simulates the robot's motion, handling parameters like radius, height, and wheel distance, along with error characteristics.\n\n5. **Velocity Translator Node**\n   - Translates velocity commands into wheel velocities (`/vl` and `/vr`) to interface with the simulator node.\n\n6. **ROS Bag Playback and Recording**\n   - **`ros2 bag play`:** Plays input bag files specified by `bag_in`.\n   - **`ros2 bag record`:** Records all topics to the file specified by `bag_out`.\n\n---\n\n### `velocity_translator_node.py`\n\nThis node handles velocity translation for the robot's wheels.\n\n- **Subscriptions:**\n  - Listens to `/cmd_vel` (Twist messages) for angular and linear velocities.\n- **Publications:**\n  - Publishes wheel velocities to `/vl` and `/vr` as `Float64` messages.\n- **Key Functions:**\n  - **Parameters:** Reads `distance` and `radius` from the robot file.\n  - **Callback:** Computes wheel velocities (`vl`, `vr`) using differential drive equations and publishes them.\n\n---\n\n### `simulator_node.py`\n\nThis node simulates the robot's motion using wheel velocities.\n\n- **Subscriptions:**\n  - Reads `/vl` and `/vr` for left and right wheel velocities.\n- **Timers:**\n  - A 0.1-second periodic callback manages velocity updates and pose calculations.\n- **Key Functions:**\n  1. **Error Handling:** Multiplies velocities by error multipliers calculated using a Gaussian distribution.\n  2. **Pose Updates:** Computes new pose based on velocities using differential drive equations.\n  3. **Transform Broadcasting:** Updates the robot's position via tf2 transformations.\n\n---\n\n### Results and Reflection\n\n#### Did the Results Meet Expectations?\nYes, the results met our expectations. While it was initially challenging to implement tf broadcasting and calculate pose updates, our system successfully simulated the robot's motion and accurately responded to input commands. The calculated wheel velocities and transformations aligned with theoretical expectations.\n\n---\n\n### Screenshots of Test Cases\n\n#### Test Case 1\n\u003cimg width=\"378\" alt=\"image\" src=\"https://github.com/user-attachments/assets/b34fae60-6964-42d4-9368-8d7b2c09a60a\" /\u003e\n\n#### Test Case 2\n\u003cimg width=\"378\" alt=\"image\" src=\"https://github.com/user-attachments/assets/28f6db3d-41a1-473d-a16c-434009bde394\" /\u003e\n\n#### Test Case 3\n\u003cimg width=\"378\" alt=\"image\" src=\"https://github.com/user-attachments/assets/e07d452d-a49d-4897-9427-fc18c48cefd4\" /\u003e\n\n\n#### Test Case 4\n\u003cimg width=\"378\" alt=\"image\" src=\"https://github.com/user-attachments/assets/73a05c68-fe92-4aa3-a6b6-29cd3b8f6135\" /\u003e\n\n\n#### Test Case 5\n\u003cimg width=\"378\" alt=\"image\" src=\"https://github.com/user-attachments/assets/8bced15b-0bca-4ecb-8bd1-3eab9f1cec18\" /\u003e\n\n\n---\n\n### Team Members\n- Jonas Land\n- Ayushri Jain\n```\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Faj1904%2Fros2-occupancy-grid-maps","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Faj1904%2Fros2-occupancy-grid-maps","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Faj1904%2Fros2-occupancy-grid-maps/lists"}