{"id":21228750,"url":"https://github.com/tasrobotics/2021-swerve","last_synced_at":"2026-04-28T19:36:54.887Z","repository":{"id":70278455,"uuid":"330616447","full_name":"TASRobotics/2021-swerve","owner":"TASRobotics","description":"Conventional Swerve drive base code","archived":false,"fork":false,"pushed_at":"2021-03-26T06:51:43.000Z","size":19306,"stargazers_count":0,"open_issues_count":0,"forks_count":0,"subscribers_count":2,"default_branch":"main","last_synced_at":"2026-01-01T23:17:16.790Z","etag":null,"topics":[],"latest_commit_sha":null,"homepage":null,"language":"Java","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/TASRobotics.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,"roadmap":null,"authors":null,"dei":null,"publiccode":null,"codemeta":null}},"created_at":"2021-01-18T09:30:02.000Z","updated_at":"2021-03-26T06:53:34.000Z","dependencies_parsed_at":"2023-02-24T09:30:42.146Z","dependency_job_id":null,"html_url":"https://github.com/TASRobotics/2021-swerve","commit_stats":null,"previous_names":[],"tags_count":0,"template":false,"template_full_name":null,"purl":"pkg:github/TASRobotics/2021-swerve","repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/TASRobotics%2F2021-swerve","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/TASRobotics%2F2021-swerve/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/TASRobotics%2F2021-swerve/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/TASRobotics%2F2021-swerve/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/TASRobotics","download_url":"https://codeload.github.com/TASRobotics/2021-swerve/tar.gz/refs/heads/main","sbom_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/TASRobotics%2F2021-swerve/sbom","scorecard":null,"host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":286080680,"owners_count":32396744,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2026-04-28T14:34:11.604Z","status":"ssl_error","status_checked_at":"2026-04-28T14:32:37.009Z","response_time":56,"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":[],"created_at":"2024-11-20T23:21:40.273Z","updated_at":"2026-04-28T19:36:54.873Z","avatar_url":"https://github.com/TASRobotics.png","language":"Java","funding_links":[],"categories":[],"sub_categories":[],"readme":"# Raid-Zero Swerve code\n\nquick intro to holonomic algorithms\n\n(this was copy pasted from an addressed email, so the formatting is a little weird lol)\nour swerve algorithm is actually fairly simple.\nthe first thing we do is create a module class, and we make a new module object for each swerve module on the bot.\nlet's define a few terms first. Each of the four wheel systems are called modules, which can independently rotate and move at different speeds.\nthere are two motors on each module. one motor, the rotor, controls the direction of the module\nthe other motor, the throttle, controls the actual wheel movement of the module.\nthe module class has a moveVector method, where we input a 2D vector and the module will 1. rotate to the desired direction and 2. move the wheel at the desired speed\nthe rotor needs to be set to a certain direction with closed loop control, while the throttle can be controlled in open loop control\nnow that we have the ability to move each module to match a certain module vector we can then coordinate the modules to move the robot in a certain way.\nthe modules are limited to 2 degrees of motion, so they can be described with a 2d vector. However, the robot moves with 3 degrees of motion (x,y,rotation), so they cant be directly converted. This extra degree of motion makes it more difficult to engineer than a normal tank drive, but it gives it more versatility. \nFortunately, neither the equations nor the implementation of this is specifically difficult to do, but it takes some abstract thinking to understand it.\nyour parameters to this algorithm will be your 1. desired translational velocity\n2. desired angular velocity\nif u need autonomous functionality, you can use closed loop PID on the velocities for positional control\nnow for each module, you describe it using 2 basis vectors, NOT x-y basis vectors but translation-rotation basis vectors. lets call these bases v and w\nv for each is equal to your desired V for your robot. this makes sense, because the physical translation of your modules should be exactly the same as your robot if you dont rotate. if you rotate, the average v of all 4 modules will still equal the desired translational velocity of the robot\n(EQ 1)\nnow, to get the robot to spin at the rotational velocity w, you need to set the modules to spin in different directions. Imagine setting a robot to perform a point turn. To do this, you need to get the modules to point like so (FIG 1)\nthe direction of the modules are always the same for point turns but the speeds are not, so the right equation for turning is like so\n(EQ 2)\nthis equation is a little more complicated, but all you do is get the cross product of the desired angular velocity vector of the robot with the radius vector of each module\n(FIG 2 \u0026 3)\nfinally, to get the output of that specific module, you add the two bases together\n(EQ 3)\n\n!![swervediagram](https://user-images.githubusercontent.com/36722504/112593651-c0e2b200-8e42-11eb-8750-e6d8d210b7f5.png)\n[swervediagram](./swervediagram.png)\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Ftasrobotics%2F2021-swerve","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Ftasrobotics%2F2021-swerve","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Ftasrobotics%2F2021-swerve/lists"}