Skip to main content

Student Robotics API for Python 3

Project description

sr-robot3

Lint & build PyPI version Documentation Status MIT license Bees

sr-robot3 - Python 3 API for Student Robotics Kit

This is the API for Student Robotics, library for writing Robotics APIs. It will first be deployed at Student Robotics 2024.

Installation

If you wish to install openCV from your package manager, you can install the base package with:

pip install sr-robot3

To install the full package, including openCV, you can install with:

pip install sr-robot3[vision]

Usage

The main entry point for the API is the Robot class. Intantiating this class will automatically detect and connect to any SR v4 boards connected to the device. By default, the Robot class will wait for the start button on the power board to be pressed before continuing.

from sr.robot3 import Robot

r = Robot()

To disable the waiting for the start button, you can pass wait_for_start=False to the constructor. The wait_for_start method needs to be called before the metadata is available.

from sr.robot3 import Robot

r = Robot(wait_for_start=False)

# Setup in here

r.wait_start()

Developer Notes

There are a number of considerations that have been made in the design of this API. Some of these may not be immediately obvious, so they are documented below.

  • The API is designed to raise exceptions for incorrect actions, such as trying to modify the output dictionary or assign a value directly to the motor object.
  • MappingProxyType is used to prevent the user from adding, removing or overwriting keys in any parts of the API that return a dictionary.
  • tuple is used to prevent the user from adding, removing or overwriting items in any parts of the API that would return a list.
  • __slots__ is used to prevent the user from adding, removing or overwriting attributes in any parts of the API.
  • sr.robot3.serial_wrapper.SerialWrapper handles automatic reconnection to the serial port if the connection is lost and impleents 3 retries on any serial operation before raising a BoardDisconnectionError.

Project details


Download files

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

Source Distribution

sr_robot3-2026.0.3.tar.gz (65.7 kB view details)

Uploaded Source

Built Distribution

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

sr_robot3-2026.0.3-py3-none-any.whl (53.0 kB view details)

Uploaded Python 3

File details

Details for the file sr_robot3-2026.0.3.tar.gz.

File metadata

  • Download URL: sr_robot3-2026.0.3.tar.gz
  • Upload date:
  • Size: 65.7 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? Yes
  • Uploaded via: twine/6.1.0 CPython/3.13.7

File hashes

Hashes for sr_robot3-2026.0.3.tar.gz
Algorithm Hash digest
SHA256 517b1bd42ca5efa91b18a7f289ea1e8bf86bd7649342e8ec5a7ead865dd4bc5c
MD5 9a1c6b209d20150bb22c7cb7a1d6fec3
BLAKE2b-256 3edbb1719b47aa6bcda328a8a7776824bce584ea32ab1df2fdc72333976318ea

See more details on using hashes here.

Provenance

The following attestation bundles were made for sr_robot3-2026.0.3.tar.gz:

Publisher: test_build.yml on srobo/sr-robot3

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

File details

Details for the file sr_robot3-2026.0.3-py3-none-any.whl.

File metadata

  • Download URL: sr_robot3-2026.0.3-py3-none-any.whl
  • Upload date:
  • Size: 53.0 kB
  • Tags: Python 3
  • Uploaded using Trusted Publishing? Yes
  • Uploaded via: twine/6.1.0 CPython/3.13.7

File hashes

Hashes for sr_robot3-2026.0.3-py3-none-any.whl
Algorithm Hash digest
SHA256 c13857294b7cb45525440818437163014cc1e6c2809bdb4634242023313e2f81
MD5 9afb0f0af926fe43cadf29742106bcdb
BLAKE2b-256 320b24b69aa0385ff2809ace4c19ffd6062db7771c28783039ed939dd3ed5042

See more details on using hashes here.

Provenance

The following attestation bundles were made for sr_robot3-2026.0.3-py3-none-any.whl:

Publisher: test_build.yml on srobo/sr-robot3

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