Skip to main content

uPy-genpy

This 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.

Features

  • uPy files gen with publish availability
  • uPy files gen with subscribe availability
  • Services

Installation

Copying source files

In order to use this package the folder ugenpy from src must be copied to the flash memory. I strongly recommend using rshell for this task.

There 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.

Using upip

You can also install ugenpy with upip but have in mind the .msg files must be copied, located in the corresponding dir:

import upip
import network
from time import sleep
wlan=network.WLAN(network.STA_IF)
wlan.active(True)
wlan.connect('<ssid>', '<password>')
sleep(5)
upip.install('micropython-genpy')

Note: To use upip you must be connected to WiFi and the files with std_msgs dir must be included manually.

Usage

Suppose 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:

from ugenpy.message import MessageGenerator
msg=MessageGenerator('std_msgs/ColorRGBA.msg')
msg.create_message()

You could verify it has been created with the following:

import os
os.listdir('std_msgs')

Classes

ugenpy.message.MessageGenerator

Constructor

ugenpy.message.MessageGenerator(addr)

Class responsible of writing the *.py script and message class from *.msg.

  • addr: address where the .msg file is located inside the microcontroller.

Methods

ugenpy.message.MessageGenerator.create_message()

Creates the message from the address already defined in constructor.

Release files for micropython-genpy 0.0.6

For a detailed explanation of source distributions (sdists) and built distributions (wheels), please see the package formats documentation.

Source distribution (sdist)

Source distribution for micropython-genpy 0.0.6
File Size Uploaded
micropython-genpy-0.0.6.tar.gz 5.1 kB Details

Release files / micropython-genpy-0.0.6.tar.gz

Download URL micropython-genpy-0.0.6.tar.gz
Size 5.1 kB
Tags Source
SHA-256 checksum
How to use checksums
396849f1c051d1cdb4d3a3c16af2a33920167ca3af8cb5575a8cfe2cba6fe368
BLAKE2b-256 checksum
How to use checksums
b0eb24c691b2cfb95c638da4c95585437b2009fb0baa0a3c8bca0791fdf34188
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No
Uploaded via twine/3.2.0 pkginfo/1.5.0.1 requests/2.22.0 setuptools/45.2.0 requests-toolbelt/0.9.1 tqdm/4.48.2 CPython/3.8.2

Release history Release notifications | RSS feed

This release

0.0.6 This release

1 release file

0.0.5

1 release file

0.0.4

2 release files

0.0.3

1 release file

0.0.2

1 release file

0.0.1

1 release file

Anthropic, PBC Visionary sponsor Bloomberg Visionary sponsor Hudson River Trading Visionary sponsor Meta Visionary sponsor NVIDIA Visionary sponsor Microsoft Sustainability sponsor Depot Continuous Integration AWS Cloud computing and Security Sponsor Datadog Monitoring Fastly CDN Google Download Analytics Sentry Error logging StatusPage Status page