Skip to main content

Python port of the behaviors implemented in the Thymio firmware.

Project description

thymio-python-behaviors

Python port of the behaviors implemented in the Thymio firmware.

Use pyaseba or pyenki to apply the behaviors to real and simulated robots.

Example with real Thymio (pyaseba)

import time

import thymio_behaviors
from pyaseba.client.thymio import Thymio

behavior = thymio_behaviors.ExplorerBehavior()
thymio = Thymio()
if thymio.connect(start_mirroring=True):
    thymio.set_behavior(behavior, time_step=0.1)
    time.sleep(10)
thymio.close(reset=True)

Have a look at the complete example that selects which behavior to run.

Example with simulated Thymio (pyenki)

import pyenki
import pyenki.viewer
import thymio_behaviors
from pyenki.adapters import Thymio2AsebaAdapter

behavior = thymio_behaviors.ExplorerBehavior()
robot = pyenki.Thymio2()
world = pyenki.World(radius=50)
world.add_object(robot)
thymio = Thymio2AsebaAdapter(robot)
thymio.set_behavior(behavior)
pyenki.viewer.init()
pyenki.viewer.run_in_viewer(world, duration=10)
pyenki.viewer.cleanup()

Have a look at the complete example that selects which behavior to run.

Project details


Download files

Download the file for your platform. If you're not sure which to choose, learn more about installing packages.

Source Distributions

No source distribution files available for this release.See tutorial on generating distribution archives.

Built Distribution

If you're not sure about the file name format, learn more about wheel file names.

thymio_behaviors-0.0.3-py3-none-any.whl (13.5 kB view details)

Uploaded Python 3

File details

Details for the file thymio_behaviors-0.0.3-py3-none-any.whl.

File metadata

File hashes

Hashes for thymio_behaviors-0.0.3-py3-none-any.whl
Algorithm Hash digest
SHA256 b4f5f3575fc2b5e1426f0821d7984468c830935e3d3fc209d16f0a4472152921
MD5 a626d06490f083ab981af525d5e0a586
BLAKE2b-256 35bb0810a064042dbc46662ce3b66b662da9cfbf6e031b817f168289d04c6917

See more details on using hashes here.

Provenance

The following attestation bundles were made for thymio_behaviors-0.0.3-py3-none-any.whl:

Publisher: release.yml on jeguzzi/thymio-python-behaviors

Attestations: Values shown here reflect the state when the release was signed and may no longer be current.

Supported by

AWS Cloud computing and Security Sponsor Datadog Monitoring Depot Continuous Integration Fastly CDN Google Download Analytics Pingdom Monitoring Sentry Error logging StatusPage Status page