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.2-py3-none-any.whl (13.5 kB view details)

Uploaded Python 3

File details

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

File metadata

File hashes

Hashes for thymio_behaviors-0.0.2-py3-none-any.whl
Algorithm Hash digest
SHA256 61d8cc1d2bb9ec89af1c4176fe6fb1b38ee1ae6fdd2b8cbb10e4d7a34e6dde7c
MD5 8c37c6ed260b4993b5e0122868ff9e04
BLAKE2b-256 c54eccfc3e49d1a5b7ff7fee27509384524ec97c4197daa32ac14fb84d868d63

See more details on using hashes here.

Provenance

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