{"id":17855584,"url":"https://github.com/nebrius/heya","last_synced_at":"2025-09-20T22:32:54.988Z","repository":{"id":57263852,"uuid":"36194209","full_name":"nebrius/heya","owner":"nebrius","description":"A platform for creating SumoBots","archived":false,"fork":false,"pushed_at":"2017-04-21T07:27:03.000Z","size":272,"stargazers_count":4,"open_issues_count":0,"forks_count":2,"subscribers_count":1,"default_branch":"master","last_synced_at":"2025-08-17T09:39:24.295Z","etag":null,"topics":[],"latest_commit_sha":null,"homepage":null,"language":"JavaScript","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/nebrius.png","metadata":{"files":{"readme":"README.md","changelog":"CHANGELOG.md","contributing":null,"funding":null,"license":"LICENSE","code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null}},"created_at":"2015-05-24T21:16:53.000Z","updated_at":"2021-01-24T11:10:48.000Z","dependencies_parsed_at":"2022-08-25T02:51:52.836Z","dependency_job_id":null,"html_url":"https://github.com/nebrius/heya","commit_stats":null,"previous_names":["bryan-m-hughes/heya"],"tags_count":5,"template":false,"template_full_name":null,"purl":"pkg:github/nebrius/heya","repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/nebrius%2Fheya","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/nebrius%2Fheya/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/nebrius%2Fheya/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/nebrius%2Fheya/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/nebrius","download_url":"https://codeload.github.com/nebrius/heya/tar.gz/refs/heads/master","sbom_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/nebrius%2Fheya/sbom","scorecard":null,"host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":276010688,"owners_count":25569831,"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","status":"online","status_checked_at":"2025-09-19T02:00:09.700Z","response_time":108,"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":"2024-10-28T02:23:40.919Z","updated_at":"2025-09-20T22:32:54.698Z","avatar_url":"https://github.com/nebrius.png","language":"JavaScript","funding_links":[],"categories":[],"sub_categories":[],"readme":"Heya\n====\n\n[![Join the chat at https://gitter.im/bryan-m-hughes/heya](https://badges.gitter.im/Join%20Chat.svg)](https://gitter.im/nebrius/heya?utm_source=badge\u0026utm_medium=badge\u0026utm_campaign=pr-badge\u0026utm_content=badge) [![No Maintenance Intended](http://unmaintained.tech/badge.svg)](http://unmaintained.tech/)\n\n_Note:_ I have a lot of other projects keeping me busy. Someday I'd love to return to this project, but I don't see that happening any time soon unfortunately.\n\n_Note:_ The documentation here is for the next version of heya, tagged ```next``` in NPM. See the [docs in NPM](https://www.npmjs.com/package/heya) for the current version of the docs. THIS IS A WORK IN PROGRESS AND WILL CHANGE! You have been warned :)\n\nnoun. [Heya](https://en.wikipedia.org/wiki/Heya_%28sumo%29): In sumo wrestling, a heya (部屋) is an organization of sumo wrestlers where they train and live.\n\nHeya is a platform for quickly building directly controlled robots, such as a Sumobot. A Heya robot's software is split into two pieces: the controller and the driver. The controller takes input from some source and converts it into a common format. The driver then takes this normalized data and responds accordingly.\n\nSplitting the software this way makes it easy to mix and match various controllers and drivers so that pesky interfacing bugs don't interfere with your path to glory!\n\nInstall with NPM:\n\n```\nnpm install heya@next\n```\n\n## Example\n\nThis example uses the Web Keyboard controller and the Differential Servo driver for controlling an Arduino based [Sumobot Jr](https://github.com/makenai/sumobot-jr).\n\n```JavaScript\nvar heya = require('heya');\nvar controller = new heya.WebKeyboard();\nvar bot = new heya.DifferentialServos({\n  leftServo: 'A0',\n  rightServo: 'A1'\n});\n\nheya.connect({\n  input: {\n    x: controller.direction.x,\n    y: controller.direction.y\n  },\n  output: bot.wheels\n});\n\nheya.run(function() {\n  console.log('Let's Sumo!');\n});\n```\n\nFor more examples, check out the [examples](eg) folder.\n\n## Included Controllers\n\n### Web Keyboard\n\nThe Web Keyboard starts a web server that you access from a browser. Within the browser, use the arrow keys or WASD keys to control the bot.\n\n_Options_:\n\n\u003ctable\u003e\n  \u003cthead\u003e\n    \u003ctr\u003e\n      \u003cth\u003eOption\u003c/th\u003e\n      \u003cth\u003eType\u003c/th\u003e\n      \u003cth\u003eDescription\u003c/th\u003e\n    \u003c/tr\u003e\n  \u003c/thead\u003e\n  \u003ctr\u003e\n    \u003ctd\u003eport (optional)\u003c/td\u003e\n    \u003ctd\u003eNumber\u003c/td\u003e\n    \u003ctd\u003eThe port for the server to listen on\u003c/td\u003e\n  \u003c/tr\u003e\n\u003c/table\u003e\n\n_Available Inputs_:\n\n\u003ctable\u003e\n  \u003cthead\u003e\n    \u003ctr\u003e\n      \u003cth\u003eInput\u003c/th\u003e\n      \u003cth\u003eType\u003c/th\u003e\n      \u003cth\u003eDescription\u003c/th\u003e\n    \u003c/tr\u003e\n  \u003c/thead\u003e\n  \u003ctr\u003e\n    \u003ctd\u003edirection\u003c/td\u003e\n    \u003ctd\u003e2D axis\u003c/td\u003e\n    \u003ctd\u003eThis single input converts four buttons into an 8-way direction, like a d-pad on a game controller\u003c/td\u003e\n  \u003c/tr\u003e\n\u003c/table\u003e\n\n\u003c!--\n### Digital Joystick\n\nThe Digital Joystick uses a microcontroller to read values from a four-way contact joystick, similar to a d-pad on a game controller.\n\n_Options_:\n\n\u003ctable\u003e\n  \u003cthead\u003e\n    \u003ctr\u003e\n      \u003cth\u003eOption\u003c/th\u003e\n      \u003cth\u003eType\u003c/th\u003e\n      \u003cth\u003eDescription\u003c/th\u003e\n    \u003c/tr\u003e\n  \u003c/thead\u003e\n  \u003ctr\u003e\n    \u003ctd\u003eio (optional)\u003c/td\u003e\n    \u003ctd\u003eJohnny-Five IO-plugin instance\u003c/td\u003e\n    \u003ctd\u003eAn instance of a Johnny-Five IO plugin to use to read the joystick values\u003c/td\u003e\n  \u003c/tr\u003e\n  \u003ctr\u003e\n    \u003ctd\u003eleft | right | up | down\u003c/td\u003e\n    \u003ctd\u003eNumber\u003c/td\u003e\n    \u003ctd\u003eThe pin number for each of the four direction contacts\u003c/td\u003e\n  \u003c/tr\u003e\n\u003c/table\u003e\n--\u003e\n\n### Gamepad\n\nThe Gamepad reads from a USB based gaming device, such as a joystick or PlayStation controller. This controller offers a set of gamepad templates for wiring up some common game controllers, although you can also pass in your own custom template.\n\n_Options_:\n\n\u003ctable\u003e\n  \u003cthead\u003e\n    \u003ctr\u003e\n      \u003cth\u003eOption\u003c/th\u003e\n      \u003cth\u003eType\u003c/th\u003e\n      \u003cth\u003eDescription\u003c/th\u003e\n    \u003c/tr\u003e\n  \u003c/thead\u003e\n  \u003ctr\u003e\n    \u003ctd\u003etype\u003c/td\u003e\n    \u003ctd\u003eheya.Gamepad.CYBORG_EVO | custom\u003c/td\u003e\n    \u003ctd\u003eThe controller mapping to use\u003c/td\u003e\n  \u003c/tr\u003e\n  \u003ctr\u003e\n  \u003ctd\u003e\u003c/td\u003e\n  \u003ctd colspan=\"2\"\u003e\n    \u003ctable\u003e\n      \u003cthead\u003e\n        \u003cth\u003eName\u003c/th\u003e\n        \u003cth\u003eDescription\u003c/th\u003e\n      \u003c/thead\u003e\n      \u003ctr\u003e\n        \u003ctd\u003eCYBORG_EVO\u003c/td\u003e\n        \u003ctd\u003e\u003ca href=\"http://gamergear.wikia.com/wiki/Cyborg_Evo_Joystick\"\u003eSaitek Cyborg Evo\u003c/a\u003e USB joystick\u003c/td\u003e\n      \u003c/tr\u003e\n    \u003c/table\u003e\n  \u003c/td\u003e\n  \u003c/tr\u003e\n\u003c/table\u003e\n\n_Available Inputs_:\n\nTHe available inputs are dependent on the ```type``` option passed in. See the table below for the inputs provided by the built-in templates, or the section on template format below to see how custom templates are mapped.\n\n_Cyborg Evo Inputs_:\n\n\u003ctable\u003e\n  \u003cthead\u003e\n    \u003ctr\u003e\n      \u003cth\u003eInput\u003c/th\u003e\n      \u003cth\u003eType\u003c/th\u003e\n      \u003cth\u003eDescription\u003c/th\u003e\n    \u003c/tr\u003e\n  \u003c/thead\u003e\n  \u003ctr\u003e\n    \u003ctd\u003eprimary\u003c/td\u003e\n    \u003ctd\u003e2D axis\u003c/td\u003e\n    \u003ctd\u003eThe main stick movement, i.e. pushing forward, backward, left, or right\u003c/td\u003e\n  \u003c/tr\u003e\n  \u003ctr\u003e\n    \u003ctd\u003eyaw\u003c/td\u003e\n    \u003ctd\u003e1D axis\u003c/td\u003e\n    \u003ctd\u003eTwisting the stick clockwise or counterclockwise\u003c/td\u003e\n  \u003c/tr\u003e\n  \u003ctr\u003e\n    \u003ctd\u003ethrottle\u003c/td\u003e\n    \u003ctd\u003e1D axis\u003c/td\u003e\n    \u003ctd\u003eThis is the lever at the base of the stick\u003c/td\u003e\n  \u003c/tr\u003e\n  \u003ctr\u003e\n    \u003ctd\u003etrigger\u003c/td\u003e\n    \u003ctd\u003eButton\u003c/td\u003e\n    \u003ctd\u003eThe main trigger on the stick\u003c/td\u003e\n  \u003c/tr\u003e\n  \u003ctr\u003e\n    \u003ctd\u003ebutton1 - button5\u003c/td\u003e\n    \u003ctd\u003eButton\u003c/td\u003e\n    \u003ctd\u003eThe buttons labeled \"1\" through \"5\" on the head of the stick\u003c/td\u003e\n  \u003c/tr\u003e\n  \u003ctr\u003e\n    \u003ctd\u003ebuttonF1 - buttonF4\u003c/td\u003e\n    \u003ctd\u003eButton\u003c/td\u003e\n    \u003ctd\u003eTHe function buttons on the sides of the base labeled \"F1\" through \"F4\"\u003c/td\u003e\n  \u003c/tr\u003e\n  \u003ctr\u003e\n    \u003ctd\u003eleftUpButton, rightUpButton\u003c/td\u003e\n    \u003ctd\u003eButton\u003c/td\u003e\n    \u003ctd\u003eThe button above the F buttons labeled as \"^\" on either side of the base\u003c/td\u003e\n  \u003c/tr\u003e\n\u003c/table\u003e\n\n#### Template Format\n\nThe gamepad controller uses [node-gamepad](https://github.com/creationix/node-gamepad) under the hood. I recommend familiarizing yourself with the naming and numbering scheme that it uses when creating a custom template. To create a custom template, pass in an object with the following structure:\n\n\u003ctable\u003e\n  \u003cthead\u003e\n    \u003ctr\u003e\n      \u003cth\u003eProperty\u003c/th\u003e\n      \u003cth\u003eType\u003c/th\u003e\n      \u003cth\u003eDescription\u003c/th\u003e\n    \u003c/tr\u003e\n  \u003c/thead\u003e\n  \u003ctr\u003e\n    \u003ctd\u003eaxes\u003c/td\u003e\n    \u003ctd\u003eObject\u003c/td\u003e\n    \u003ctd\u003eA collection of named 1D or 2D axes on the gamepad. Each key is the name, and the value is an array of one or two numbers for a 1D or 2D input, respectively. The number(s) are the \u003ccode\u003eaxis\u003c/code\u003e options sent by node-gamepad in \u003ccode\u003emove\u003c/code\u003e events\u003c/td\u003e\n  \u003c/tr\u003e\n  \u003ctr\u003e\n    \u003ctd\u003ebuttons\u003c/td\u003e\n    \u003ctd\u003eObject\u003c/td\u003e\n    \u003ctd\u003eA collection of named buttons on the gamepad. Each key is the name, and the value is a number. The number is the \u003ccode\u003enum\u003c/code\u003e option sent by node-gamepad in \u003ccode\u003eup\u003c/code\u003e and \u003ccode\u003edown\u003c/code\u003e events\u003c/td\u003e\n  \u003c/tr\u003e\n\u003c/table\u003e\n\nEach axis or button name gets mapped to an input on the Gamepad instance. Consider the following example:\n\n```JavaScript\n{\n  axes: {\n    primary: [ 0, 1 ]\n  },\n  buttons: {\n    a: 0,\n    b: 1\n  }\n}\n```\n\nThis creates one 2D axis called ```primary``` and two buttons called ```a``` and ```b```. The axis gets mapped as ```myGamepadInstance.primary```, ```myGamepadInstance.a```, and ```myGamepadInstance.b```, respectively.\n\n## Included Drivers\n\n### Differential Servo\n\nThe Differential Servo driver drives any robot that uses two servos in a differential configuration, such as the [Sumobot Jr](https://github.com/makenai/sumobot-jr). Steering is accomplished via throttling the two wheels at different speeds. This driver should be used when the node instance running Heya directly calls Johnny-Five.\n \n_Options_:\n\n\u003ctable\u003e\n  \u003cthead\u003e\n    \u003ctr\u003e\n      \u003cth\u003eOption\u003c/th\u003e\n      \u003cth\u003eType\u003c/th\u003e\n      \u003cth\u003eDescription\u003c/th\u003e\n    \u003c/tr\u003e\n  \u003c/thead\u003e\n  \u003ctr\u003e\n    \u003ctd\u003eio (optional)\u003c/td\u003e\n    \u003ctd\u003eJohnny-Five IO-plugin instance\u003c/td\u003e\n    \u003ctd\u003eAn instance of a Johnny-Five IO plugin to use to drive the motors\u003c/td\u003e\n  \u003c/tr\u003e\n  \u003ctr\u003e\n    \u003ctd\u003eleftServo, rightServo\u003c/td\u003e\n    \u003ctd\u003eNumber | String\u003c/td\u003e\n    \u003ctd\u003eThe pin for each of the two servos\u003c/td\u003e\n  \u003c/tr\u003e\n\u003c/table\u003e\n\n\u003c!--\n### Remote Differential Driver\n\nThe Remote Pawel Bot driver works the same as the normal Pawel Bot driver, except that it connects to a remote host that actually drives the motors, such as a Raspberry Pi, Beagle Bone Black, etc. Use this in conjunction with the [heya-remote-pawel-bot](https://github.com/bryan-m-hughes/heya-remote-pawel-bot) moudle running on the remote host.\n \n_Options_:\n\n\u003ctable\u003e\n  \u003cthead\u003e\n    \u003ctr\u003e\n      \u003cth\u003eOption\u003c/th\u003e\n      \u003cth\u003eType\u003c/th\u003e\n      \u003cth\u003eDescription\u003c/th\u003e\n    \u003c/tr\u003e\n  \u003c/thead\u003e\n  \u003ctr\u003e\n    \u003ctd\u003eurl\u003c/td\u003e\n    \u003ctd\u003estring\u003c/td\u003e\n    \u003ctd\u003eThe base URL of the remote server, minus a trailing slash, e.g. \"http://1.2.3.4:8000\"\u003c/td\u003e\n  \u003c/tr\u003e\n\u003c/table\u003e\n\n```JavaScript\nvar heya = require('heya');\n\nheya.create({\n  controller: ...,\n  driver: new heya.drivers.RemotePawelBot({\n    url: 'http://1.2.3.4:8000'\n  })\n});\n```\n--\u003e\n\n## Custom controllers and drivers\n\nComing soon!\n\nLicense\n=======\n\nThe MIT License (MIT)\n\nCopyright (c) 2015 Bryan Hughes bryan@theoreticalideations.com\n\nPermission is hereby granted, free of charge, to any person obtaining a copy\nof this software and associated documentation files (the \"Software\"), to deal\nin the Software without restriction, including without limitation the rights\nto use, copy, modify, merge, publish, distribute, sublicense, and/or sell\ncopies of the Software, and to permit persons to whom the Software is\nfurnished to do so, subject to the following conditions:\n\nThe above copyright notice and this permission notice shall be included in\nall copies or substantial portions of the Software.\n\nTHE SOFTWARE IS PROVIDED \"AS IS\", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR\nIMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,\nFITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE \nAUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER\nLIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,\nOUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN\nTHE SOFTWARE.\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fnebrius%2Fheya","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fnebrius%2Fheya","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fnebrius%2Fheya/lists"}