{"id":15149244,"url":"https://github.com/ezauton/ezauton","last_synced_at":"2025-07-14T18:14:04.780Z","repository":{"id":149957185,"uuid":"140008964","full_name":"ezAuton/ezAuton","owner":"ezAuton","description":"🤖 A collection of tools to help with FRC/FTC autonomous for Kotlin robots","archived":false,"fork":false,"pushed_at":"2022-10-24T05:27:08.000Z","size":9185,"stargazers_count":25,"open_issues_count":26,"forks_count":3,"subscribers_count":2,"default_branch":"convert-kotlin","last_synced_at":"2025-04-06T23:22:58.964Z","etag":null,"topics":["autonomous-driving","frc","robotics"],"latest_commit_sha":null,"homepage":"","language":"Kotlin","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/ezAuton.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":"2018-07-06T16:41:48.000Z","updated_at":"2024-09-09T16:31:44.000Z","dependencies_parsed_at":"2023-08-22T07:46:24.638Z","dependency_job_id":null,"html_url":"https://github.com/ezAuton/ezAuton","commit_stats":null,"previous_names":[],"tags_count":1,"template":false,"template_full_name":null,"purl":"pkg:github/ezAuton/ezAuton","repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/ezAuton%2FezAuton","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/ezAuton%2FezAuton/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/ezAuton%2FezAuton/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/ezAuton%2FezAuton/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/ezAuton","download_url":"https://codeload.github.com/ezAuton/ezAuton/tar.gz/refs/heads/convert-kotlin","sbom_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/ezAuton%2FezAuton/sbom","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":265328155,"owners_count":23747845,"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":["autonomous-driving","frc","robotics"],"created_at":"2024-09-26T13:43:19.118Z","updated_at":"2025-07-14T18:14:04.772Z","avatar_url":"https://github.com/ezAuton.png","language":"Kotlin","funding_links":[],"categories":[],"sub_categories":[],"readme":"[![travis-ci](https://travis-ci.org/ezAuton/ezAuton.svg?branch=master)](https://travis-ci.org/ezAuton/ezAuton)\n[![codecov](https://codecov.io/gh/ezAuton/ezAuton/branch/master/graph/badge.svg?token=mDoht49dKM)](https://codecov.io/gh/ezAuton/ezAuton)\n[![jitpack](https://jitpack.io/v/ezAuton/ezAuton.svg)](https://jitpack.io/#ezAuton/ezAuton)\n[![discord](https://img.shields.io/badge/chat-on%20discord-7289DA.svg?logo=discord\u0026style=flat)](https://discord.gg/u8rmxxy)\n\n# ezAuton\n\n- [Target Audience](#target-audience)\n- [Showcase](#showcase)\n    - [Network Table Modification](#modifications--network-tables)\n\n## Target Audience\n\nHere are some use cases where ezAuton would and wouldn't be a good idea to use\n\n- ✅ **Creating a codebase that will run on FTC, FRC, and simulations without modifications**\n- ✅ **Type safety—designed around units**\n- ❌ **Using a Java only codebase.** ezAuton uses Kotlin heavily due to the multiple advantages it gives, particularly with suspending functions (approximately equivalent to async/await), and DSLs\n- ✅ **Likes the idea of structured concurrency and coroutines**\n- ✅ **Wanting to work on robot code without a physical robot**\n- ✅ **Recording/streaming robot telemetry data**\n- ✅ **Playing back or live viewing robot telemetry data**\n- ✅ **Using trajectory control algorithms with minimum boilerplate**\n- ✅ **Programming an FTC Robot**\n- ✅ **Programming an FRC Robot**\n\n## Showcase\nThe following example is all that is needed for a simulation running pure pursuit that is \nrecorded. Note **this is very similar for any trajectory algorithm, I am aware pure pursuit is inferior to other methods like ramsete**.\n![Example](.github/main-example.png)\n\n```kotlin\nsuspend fun run() {\n\n  // (1) a straight line trajectory starting at (0,0) going to (0,20) with a max speed of 3 m/s.\n  val trajectory = trajectory(samplePeriod = 5.ms) {\n    point(0.m, 0.m, speed = 0.mps, acceleration = 13.0.mps / s, deceleration = 12.0.mps / s)\n    point(0.m, 10.m, speed = 3.mps, acceleration = 13.0.mps / s, deceleration = 12.0.mps / s)\n    point(0.m, 20.m, speed = 0.mps, acceleration = 13.0.mps / s, deceleration = 12.0.mps / s)\n  }\n\n  // (2) a simulated robot\n  val robot = SimulatedTankRobot.create(lateralWheelDistance = 1.m, maxAccel = 14.0.mpss, minVel = 0.3.mps, maxVel = 16.0.mps)\n\n  // (3) a lookahead that scales with the velocity of the robot\n  val lookahead = ScalingLookahead(distanceRange = 1.0.m..5.0.m, speedRange = 2.0.mps..10.0.mps, velocityEstimator = robot)\n\n  // (4) pure pursuit\n  val purePursuit = robot.purePursuit(period = 10.ms, trajectory, lookahead)\n\n  // (4) the action we will actually be running\n  val action = action {\n\n    // (5) record everything inside this\n    val recording = recording {\n\n      // (6) include data about the path\n      include(trajectory.path.simpleRepr)\n\n      // (7) run pure pursuit in parallel\n      parallel(purePursuit)\n\n      // (8) every 10ms sample data from the robot (like location) and include in recording\n      sample(10.ms, robot)\n    }\n\n    // (9) save the recording to ~/.ezauton/test.json\n    recording.save(\"test.json\")\n  }\n\n  action.run()\n}\n```\n\n1. Create a trajectory. \n   - Note the use of extension properties like `.m, .mps, .mps/s = .mpss`. The library uses \n     units, and they can *usually* be multiplied, added, or divided together as one would do in maths or physics. The values stored in each container is the SI value. If someone wanted\n     to use feet instead of meters, they could use `.ft` and likewise for other units.\n   - Trajectories contain a path which is comprised of path segments (in this case linear path segments)\n   - Trajectories also contain a speed at any distance along the path\n    - We specify starting, stopping points, and acceleration/decelerations.\n    - The trajectory will attempt to optimize time for given constraints (deceleration at last moment)\n    - The trajectory generates sub-trajectories every 5ms which are linearly interpolated between\n    \n2. Create a simulated robot. \n   - A simulated robot implements **a lot** of interfaces. This is useful\n   because this library is built around interface and not implementation. Trajectory algorithms\n   and other functions almost always accept an interface, so the library is flexible to any implementation. \n   ![Interfaces](.github/interfaces.png)\n   \n    -  Notice that some of the interfaces are oddly named. Generally, abbreviations are used at a minimum, but to avoid extraordinarily long names, a few are used. For example \n        -  Rot = Rotation\n       -  Vel = Velocity\n       -  Trans = Translational\n       -  Loc = Location\n       -  Est = Estimator\n\n3. Create a lookahead that scales with the speed of the robot\n    - `robot` implements `TankRobotVelEst`, an interface which in \n    turn implements `VelocityEst`, so it can be passed into velocity estimator \n      \n4. Create a pure pursuit action. \n   - This uses a useful extension function to allow for less\nboilerplate.\n   - The extension function depends on any classes which implement both \n    `TransLocEst` and `TransLocDrivable`. This means that the robot can estimate\n     its translational location _and_ drive towards any given translational location. \n     The tank robot implementation of `TransLocDrivable` implements this by driving in arcs.\n     \n    - If there is no common interface, it is easy to use the regular non-extension version\n   ![Common](.github/common.png)\n\n      \n5. Record anything inside the scope into a _Recording_ object which can be saved\n6. Include the data of the path. Currently, only a simple representation of the path which \nis just a list of points can be serialized. This is because paths can contain any type of\n   path segments---including weird shapes such as curves, which might be hard to serialize\n   and even harder to display in a visualizer\n   \n7. Run pure pursuit in parallel (so we can sample and run pure pursuit at the same time). \n   - Pure pursuit sees that it is in a recording scope and records data each time it loops\n8. Sample data (such as location) every 10 milliseconds.\n   - robot implements `Sampler\u003cData.TankRobotState\u003e`, so it can be sampled\n9. Save the data to a json file located in `test.json`\n\n### Modifications — Network Tables\n\n- If we wanted to send over network tables, we would not want to serialize all the data\nat once. We would instead want to have a packet-approach. In reality, both recording \n  and packet approaches are very similar, as the way this library is designed the \n  recording is just a list of packets.\n  ![Network Tables](.github/nt.png)\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fezauton%2Fezauton","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fezauton%2Fezauton","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fezauton%2Fezauton/lists"}