Movatterモバイル変換


[0]ホーム

URL:


Skip to content

Navigation Menu

Sign in
Appearance settings

Search code, repositories, users, issues, pull requests...

Provide feedback

We read every piece of feedback, and take your input very seriously.

Saved searches

Use saved searches to filter your results more quickly

Sign up
Appearance settings

ROS message python classes generator specifically for uPy.

License

NotificationsYou must be signed in to change notification settings

FunPythonEC/uPy-genpy

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

12 Commits
 
 
 
 
 
 
 
 
 
 

Repository files navigation

This is a little similar implementation ofgenpy 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 withuPy 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 folderugenpy fromsrc must be copied to the flash memory. I strongly recommend usingrshell for this task.

There is also a folder calledstd_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 themsg files in that folder must be copied, only the ones that are going to be used.

Using upip

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

importupipimportnetworkfromtimeimportsleepwlan=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 dirstd_msgs/ColorRGB.msg and we want to create the uPy file for it, then a script like below can be run:

fromugenpy.messageimportMessageGeneratormsg=MessageGenerator('std_msgs/ColorRGBA.msg')msg.create_message()

You could verify it has been created with the following:

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

About

ROS message python classes generator specifically for uPy.

Topics

Resources

License

Stars

Watchers

Forks

Packages

No packages published

Languages


[8]ページ先頭

©2009-2025 Movatter.jp