{"id":14963437,"url":"https://github.com/funpythonec/upy-genpy","last_synced_at":"2025-10-25T02:30:39.036Z","repository":{"id":37828224,"uuid":"250949382","full_name":"FunPythonEC/uPy-genpy","owner":"FunPythonEC","description":"ROS message python classes generator specifically for uPy.","archived":false,"fork":false,"pushed_at":"2022-06-16T03:19:20.000Z","size":19,"stargazers_count":3,"open_issues_count":0,"forks_count":2,"subscribers_count":4,"default_branch":"master","last_synced_at":"2025-01-31T04:51:35.711Z","etag":null,"topics":["esp32","genpy","message-files","micropython","python","ros"],"latest_commit_sha":null,"homepage":"","language":"Python","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/FunPythonEC.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}},"created_at":"2020-03-29T03:57:34.000Z","updated_at":"2024-05-07T11:43:22.000Z","dependencies_parsed_at":"2022-08-18T23:50:08.134Z","dependency_job_id":null,"html_url":"https://github.com/FunPythonEC/uPy-genpy","commit_stats":null,"previous_names":[],"tags_count":1,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/FunPythonEC%2FuPy-genpy","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/FunPythonEC%2FuPy-genpy/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/FunPythonEC%2FuPy-genpy/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/FunPythonEC%2FuPy-genpy/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/FunPythonEC","download_url":"https://codeload.github.com/FunPythonEC/uPy-genpy/tar.gz/refs/heads/master","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":238059129,"owners_count":19409601,"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":["esp32","genpy","message-files","micropython","python","ros"],"created_at":"2024-09-24T13:31:30.387Z","updated_at":"2025-10-25T02:30:33.735Z","avatar_url":"https://github.com/FunPythonEC.png","language":"Python","funding_links":[],"categories":[],"sub_categories":[],"readme":"# uPy-genpy\n\nThis is a little similar implementation of `genpy` for uPy. In order to use rosserial with it, having messages classes. For that and automation purposes, this package has been done so that this classes can be done easily. This has been done to be used with [uPy rosserial](https://github.com/FunPythonEC/uPy-rosserial).\n\n## Features\n\n- [x] uPy files gen with publish availability\n- [x] uPy files gen with subscribe availability\n- [ ] Services\n\n## Installation\n\n### Copying source files\nIn order to use this package the folder `ugenpy` from `src` must be copied to the flash memory. I strongly recommend using [rshell](https://github.com/dhylands/rshell) for this task. \n\nThere is also a folder called `std_msgs` which has all default `*.msg` files, this folder can also be copied or any other folder with the wanted message types. For memory purposes not all the `msg` files in that folder must be copied, only the ones that are going to be used.\n\n### Using upip\nYou can also install `ugenpy` with upip but have in mind the `.msg` files must be copied, located in the corresponding dir:\n``` python\nimport upip\nimport network\nfrom time import sleep\nwlan=network.WLAN(network.STA_IF)\nwlan.active(True)\nwlan.connect('\u003cssid\u003e', '\u003cpassword\u003e')\nsleep(5)\nupip.install('micropython-genpy')\n```\n\u003eNote: To use upip you must be connected to WiFi and the files with std_msgs dir must be included manually.\n\n## Usage\n\nSuppose there is already the dir `std_msgs/ColorRGB.msg` and we want to create the uPy file for it, then a script like below can be run:\n\n``` python\nfrom ugenpy.message import MessageGenerator\nmsg=MessageGenerator('std_msgs/ColorRGBA.msg')\nmsg.create_message()\n```\n\nYou could verify it has been created with the following:\n``` python\nimport os\nos.listdir('std_msgs')\n```\n\n## Classes\n### `ugenpy.message.MessageGenerator`\n#### Constructor\n##### `ugenpy.message.MessageGenerator(addr)`\nClass responsible of writing the `*.py` script and message class from `*.msg`.\n* `addr`: address where the `.msg` file is located inside the microcontroller.\n\n#### Methods\n##### `ugenpy.message.MessageGenerator.create_message()`\nCreates the message from the address already defined in constructor.\n\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Ffunpythonec%2Fupy-genpy","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Ffunpythonec%2Fupy-genpy","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Ffunpythonec%2Fupy-genpy/lists"}