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

from pyaseba.client.thymio import Thymio

import thymio_behaviors

behavior = thymio_behaviors.ExplorerBehavior()
thymio = Thymio()
if thymio.connect(start_mirroring=True):
    thymio.set_controller(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
from pyenki.adapters import make_controller_from_thymio_behavior

import thymio_behaviors

behavior = thymio_behaviors.ExplorerBehavior()
thymio = pyenki.Thymio2()
thymio.control_step_callback = make_controller_from_thymio_behavior(
    thymio, behavior)
world = pyenki.World(radius=50)
world.add_object(thymio)
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.1-py3-none-any.whl (13.4 kB view details)

Uploaded Python 3

File details

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

File metadata

File hashes

Hashes for thymio_behaviors-0.0.1-py3-none-any.whl
Algorithm Hash digest
SHA256 0cdb9fc2dce6ce13abadff939e9733291559a3ecb9941297d800069a42fe0914
MD5 e34adbdd7afb6cf1f85dcb173dcc0fd2
BLAKE2b-256 c8fb87a6a08c13c30c1357758fb153b0d72aef9f2961161d032e189a3a645937

See more details on using hashes here.

Provenance

The following attestation bundles were made for thymio_behaviors-0.0.1-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