{"id":18456465,"url":"https://github.com/pollen-robotics/hello-world","last_synced_at":"2025-04-15T15:38:26.883Z","repository":{"id":37393439,"uuid":"437891556","full_name":"pollen-robotics/hello-world","owner":"pollen-robotics","description":null,"archived":false,"fork":false,"pushed_at":"2025-03-27T16:34:16.000Z","size":3551,"stargazers_count":3,"open_issues_count":3,"forks_count":1,"subscribers_count":3,"default_branch":"main","last_synced_at":"2025-03-27T17:38:36.516Z","etag":null,"topics":[],"latest_commit_sha":null,"homepage":null,"language":"Python","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/pollen-robotics.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-12-13T13:51:27.000Z","updated_at":"2025-03-27T16:34:20.000Z","dependencies_parsed_at":"2024-11-06T08:11:49.254Z","dependency_job_id":"6b5bdf88-1099-4f32-834b-8d8c26a42721","html_url":"https://github.com/pollen-robotics/hello-world","commit_stats":null,"previous_names":[],"tags_count":0,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/pollen-robotics%2Fhello-world","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/pollen-robotics%2Fhello-world/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/pollen-robotics%2Fhello-world/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/pollen-robotics%2Fhello-world/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/pollen-robotics","download_url":"https://codeload.github.com/pollen-robotics/hello-world/tar.gz/refs/heads/main","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":249099694,"owners_count":21212715,"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":[],"created_at":"2024-11-06T08:11:37.217Z","updated_at":"2025-04-15T15:38:26.864Z","avatar_url":"https://github.com/pollen-robotics.png","language":"Python","readme":"# hello-world\n\nThe helloworld project defines an idle mode for Reachy.  \nThis project has been thought to:\n* be able to make Reachy move immediately after the robot setup, without having to do any code\n* start to elaborate a way to define behaviors for human-robot interaction, making independant components that can be reused and integrated in more complex programs. The idea is to be able to integrate this idle mode in any project requiring such a state, without having to re-code this behavior again and again.\n\n## Discover helloworld\n\n### Install the project\n\nClone the repository or download and extract the source code.  \nThen install the project by going in the repo and doing: `pip3 install -e .`  \n\n### Try the Idle mode\n\nMake sure your robot is in the correct position: it needs to have space around it and the arms straight towards the floor, with no table under it.\n\nTry it finally with the following command:  \n`bash launch.bash`\n\n### Project organization\n\nThe project is organized as following:\n* **hello-world/behaviors**: contains the defined idle behaviors\n* **movements**: contains the .npy of movements recorded that are called in some behaviors\n* **sounds**: contains sounds to be play in some behaviors\n\n## Add new behaviors\n\nEach new behavior should inherite from the Behavior class. \nIt should as well define at least the __init__, calling the super().__init__ inherited from the Behavior class, an async run function and an async teardown, calling the inheritied super().teardown function of Behavior.\nA prototype is shown below:\n\n```python\nclass NewBehavior(Behavior):\n    def __init__(self, name: str, reachy, sub_behavior: bool = False) -\u003e None:\n        super().__init__(name, reachy, sub_behavior=sub_behavior)\n\n        # Initialize any other element relevant for your behavior\n\n\n    async def run(self):\n        for j in self.reachy.r_arm.joints.values():\n            j.torque_limit = 100.0\n        for j in self.reachy.l_arm.joints.values():\n            j.torque_limit = 100.0\n\n        # Your behavior code here\n\n        self.reachy.turn_off_smoothly('r_arm')\n        self.reachy.turn_off_smoothly('l_arm')\n\n    async def teardown(self):\n        return await super().teardown()\n```\n\nIn order to have your behavior called in the idle function, you should then add an entry for your function in the behaviors dictionary of the Idle class:\nin `hello_world/behaviors/idle.py`, setting sub_behavior to True:  \n```python\nclass Idle(Behavior):\n    \"\"\"Idle class.\"\"\"\n\n    def __init__(self, name: str, reachy, sub_behavior: bool = False) -\u003e None:\n        super().__init__(name, reachy=reachy, sub_behavior=sub_behavior)\n        self.reachy = reachy\n        self.asleep_behavior = Asleep(name='asleep', reachy=self.reachy, sub_behavior=True)\n        self.behaviors = {\n            'look_hand': LookHand(name='look_hand', reachy=self.reachy, sub_behavior=True),\n            'lonely': Lonely(name='lonely', reachy=self.reachy, sub_behavior=True),\n            'scratch': Scratch(name='scratch', reachy=self.reachy, sub_behavior=True),\n            'tshirt': Tshirt(name='tshirt', reachy=self.reachy, sub_behavior=True),\n            'sweat_head': SweatHead(name='sweat_head', reachy=self.reachy, sub_behavior=True),\n            'sneeze': Sneeze(name='sneeze', reachy=self.reachy, sub_behavior=True),\n            'whistle': Whistle(name='whistle', reachy=self.reachy, sub_behavior=True),\n            'hello': Hello(name='hello', reachy=self.reachy, sub_behavior=True),\n            # Add your new behavior here :\n            # 'NEW_BEHAVIOR': NewBehavior(name='new_behavior', reachy=self.reachy, sub_behavior=True),\n        }\n```\n","funding_links":[],"categories":[],"sub_categories":[],"project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fpollen-robotics%2Fhello-world","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fpollen-robotics%2Fhello-world","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fpollen-robotics%2Fhello-world/lists"}