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-2025.0.0.tar.gz (65.3 kB view details)

Uploaded Source

Built Distribution

sr_robot3-2025.0.0-py3-none-any.whl (52.7 kB view details)

Uploaded Python 3

File details

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

File metadata

  • Download URL: sr_robot3-2025.0.0.tar.gz
  • Upload date:
  • Size: 65.3 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? Yes
  • Uploaded via: twine/5.1.1 CPython/3.12.5

File hashes

Hashes for sr_robot3-2025.0.0.tar.gz
Algorithm Hash digest
SHA256 78f8bfde121cb5ae838f59501373bfa7a51903222322a5845e7234552ad491de
MD5 026ac6184fbe3ed301110213139d4dad
BLAKE2b-256 a48156e61727e46c9c6431805574fa017ee133a916a9413b414db6b19c54879b

See more details on using hashes here.

File details

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

File metadata

  • Download URL: sr_robot3-2025.0.0-py3-none-any.whl
  • Upload date:
  • Size: 52.7 kB
  • Tags: Python 3
  • Uploaded using Trusted Publishing? Yes
  • Uploaded via: twine/5.1.1 CPython/3.12.5

File hashes

Hashes for sr_robot3-2025.0.0-py3-none-any.whl
Algorithm Hash digest
SHA256 5043c30d5bb47795a7778ad17b9287b469f4d13e9ddac66d673f34b44eff88a6
MD5 71f57cb1f2ad1f014024b91a3d7a776c
BLAKE2b-256 d0e3c1a78e752b4057a5ae23c26f1c945f564a2466334a17c1c0f2ae7628ec59

See more details on using hashes here.

Supported by

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