{"id":50736879,"url":"https://github.com/lostbean/bb_policy","last_synced_at":"2026-06-10T14:32:05.525Z","repository":{"id":362152444,"uuid":"1257625919","full_name":"lostbean/bb_policy","owner":"lostbean","description":null,"archived":false,"fork":false,"pushed_at":"2026-06-02T21:32:20.000Z","size":144,"stargazers_count":0,"open_issues_count":0,"forks_count":0,"subscribers_count":0,"default_branch":"main","last_synced_at":"2026-06-02T23:17:15.561Z","etag":null,"topics":[],"latest_commit_sha":null,"homepage":null,"language":"Elixir","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":"other","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/lostbean.png","metadata":{"files":{"readme":"README.md","changelog":"CHANGELOG.md","contributing":null,"funding":null,"license":"LICENSE.txt","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,"notice":null,"maintainers":null,"copyright":null,"agents":"AGENTS.md","dco":null,"cla":null}},"created_at":"2026-06-02T21:23:49.000Z","updated_at":"2026-06-02T21:32:26.000Z","dependencies_parsed_at":null,"dependency_job_id":null,"html_url":"https://github.com/lostbean/bb_policy","commit_stats":null,"previous_names":["lostbean/bb_policy"],"tags_count":null,"template":false,"template_full_name":null,"purl":"pkg:github/lostbean/bb_policy","repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/lostbean%2Fbb_policy","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/lostbean%2Fbb_policy/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/lostbean%2Fbb_policy/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/lostbean%2Fbb_policy/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/lostbean","download_url":"https://codeload.github.com/lostbean/bb_policy/tar.gz/refs/heads/main","sbom_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/lostbean%2Fbb_policy/sbom","scorecard":null,"host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":286080680,"owners_count":34157453,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2026-05-26T15:22:16.424Z","status":"online","status_checked_at":"2026-06-10T02:00:07.152Z","response_time":89,"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":"2026-06-10T14:32:01.482Z","updated_at":"2026-06-10T14:32:05.518Z","avatar_url":"https://github.com/lostbean.png","language":"Elixir","funding_links":[],"categories":[],"sub_categories":[],"readme":"\u003c!--\nSPDX-FileCopyrightText: 2026 Edgar Gomes de Araujo \u003ctalktoedgar@gmail.com\u003e\n\nSPDX-License-Identifier: Apache-2.0\n--\u003e\n\n# BB.Policy\n\n[![CI](https://github.com/lostbean/bb_policy/actions/workflows/ci.yml/badge.svg)](https://github.com/lostbean/bb_policy/actions/workflows/ci.yml)\n[![Hex version](https://img.shields.io/hexpm/v/bb_policy.svg)](https://hex.pm/packages/bb_policy)\n\nLearned policies for [Beam Bots](https://github.com/beam-bots/bb). `bb_policy`\nlets robots execute neural-network behaviours that map observations to actions —\ntrain a policy from demonstrations or simulation, export it to ONNX, and deploy\nit on real hardware with full safety-system integration.\n\nA policy is a function `π: observation → action`. Given what the robot perceives\n(joint positions, velocities, camera frames, forces), the policy outputs what it\nshould do (target positions, velocities, gripper commands). Inference runs on the\nBEAM, in the same runtime as control — so a crashed or slow policy can't take the\nrobot down with it.\n\n## Status\n\n🚧 **Early scaffold.** The `BB.Policy` behaviour and project conventions are in\nplace; implementations are landing in phases. See\n[`PROJECT_PLAN.md`](https://github.com/lostbean/bb_policy/blob/main/PROJECT_PLAN.md)\nfor the roadmap and the design decisions behind it.\n\n## Installation\n\n```elixir\ndef deps do\n  [\n    {:bb_policy, \"~\u003e 0.1\"},\n    # ONNX inference is optional — add ortex when you deploy a real model:\n    {:ortex, \"~\u003e 0.1\"}\n  ]\nend\n```\n\n## Usage\n\n```elixir\n{:ok, result} =\n  BB.Policy.run(MyRobot, BB.Policy.ONNX, %{task: :pick_mug},\n    policy_opts: [\n      model: \"priv/models/pick_mug.onnx\",\n      normalizer: \"priv/models/pick_mug.json\",\n      observation_keys: [:joint_positions, :joint_velocities, :gripper],\n      action_keys: [:target_positions, :target_gripper]\n    ],\n    rate_hz: 20,\n    timeout: :timer.seconds(30)\n  )\n```\n\n## How it fits the framework\n\n| Concern | Where it lives |\n|---------|----------------|\n| Map observation → action | `BB.Policy` behaviour |\n| Fixed-rate control loop | `BB.Policy.Runner` |\n| Input/output scaling | `BB.Policy.Normalizer` |\n| ONNX model loading \u0026 inference | `BB.Policy.ONNX` (via [Ortex](https://github.com/elixir-nx/ortex)) |\n| Safety | `BB.Safety` — the runner only applies commands while armed |\n| Observability | `[:bb, :policy, …]` telemetry events |\n\n## Documentation\n\nGenerated docs live at \u003chttps://hexdocs.pm/bb_policy\u003e. Architecture, decisions,\nand the phased roadmap are in\n[`PROJECT_PLAN.md`](https://github.com/lostbean/bb_policy/blob/main/PROJECT_PLAN.md);\ncontributor conventions are in\n[`AGENTS.md`](https://github.com/lostbean/bb_policy/blob/main/AGENTS.md).\n\n## Licence\n\nApache-2.0. See [`LICENSES/`](https://github.com/lostbean/bb_policy/tree/main/LICENSES)\nand the SPDX headers on each file ([REUSE](https://reuse.software/)-compliant).\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Flostbean%2Fbb_policy","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Flostbean%2Fbb_policy","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Flostbean%2Fbb_policy/lists"}