Skip to main content

InOrbit Python Edge SDK

Project description

InOrbit Python Edge SDK

Build Status Code Coverage

The InOrbit Edge SDK allows Python programs to communicate with InOrbit platform on behalf of robots - providing robot data and handling robot actions. It's goal is to ease the integration between InOrbit and any other software that handles robot data.


Features

  • Robot session handling through a RobotSessionPool.
  • Publish key-values.
  • Publish robot poses.
  • Publish robot odometry.
  • Publish robot path.
  • Publish robot laser.
  • Execute callbacks on Custom Action execution.
  • Execute scripts (or any program) in response to Custom Action execution.

Quick Start

from inorbit_edge.robot import RobotSessionFactory, RobotSessionPool

def my_command_handler(robot_id, command_name, args, options):
    """Callback for processing custom command calls.

    Args:
        robot_id (str): InOrbit robot ID
        command_name (str): InOrbit command e.g. 'customCommand'
        args (list): Command arguments
        options (dict): object that includes
            - `result_function` can be called to report command execution result. It
            has the following signature: `result_function(return_code)`.
            - `progress_function` can be used to report command output and has the
            following signature: `progress_function(output, error)`.
            - `metadata` is reserved for the future and will contains additional
            information about the received command request.
    """
    if command_name == "customCommand":
        print(f"Received '{command_name}' for robot '{robot_id}'!. {args}")
        # Return '0' for success
        options["result_function"]("0")


robot_session_factory = RobotSessionFactory(
    api_key="<YOUR_API_KEY>"
)

# Register commands handlers. Note that all handlers are invoked.
robot_session_factory.register_command_callback(my_command_handler)
robot_session_factory.register_executable_commands("./user_scripts", r".*\.sh")

robot_session_pool = RobotSessionPool(robot_session_factory)

robot_session = robot_session_pool.get_session(
    robot_id="my_robot_id_123", robot_name="Python SDK Quick Start Robot"
)

robot_session.publish_pose(x=0.0, y=0.0, yaw=0.0)

Installation

Stable Release: pip install inorbit-edge
Development Head: pip install git+https://github.com/inorbit-ai/edge-sdk-python.git

Documentation

For full package documentation please visit InOrbit Developer Portal.

Development

See CONTRIBUTING.md for information related to developing the code.

The Three Commands You Need To Know

  1. pip install -e .[dev]

    This will install your package in editable mode with all the required development dependencies (i.e. tox).

  2. make build

    This will run tox which will run all your tests in both Python 3.7 and Python 3.8 as well as linting your code.

  3. make clean

    This will clean up various Python and build generated files so that you can ensure that you are working in a clean environment.

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

inorbit_edge-1.8.1.tar.gz (29.5 kB view details)

Uploaded Source

Built Distribution

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

inorbit_edge-1.8.1-py2.py3-none-any.whl (27.7 kB view details)

Uploaded Python 2Python 3

File details

Details for the file inorbit_edge-1.8.1.tar.gz.

File metadata

  • Download URL: inorbit_edge-1.8.1.tar.gz
  • Upload date:
  • Size: 29.5 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/4.0.2 CPython/3.9.16

File hashes

Hashes for inorbit_edge-1.8.1.tar.gz
Algorithm Hash digest
SHA256 0d5fde29caa8d49b547cfffd87b2fdc60e3b87953f02a980d1d0759d2ef036e6
MD5 4a05e24bc53e0fb35ff8540e38f58360
BLAKE2b-256 91ba4740864ba17dd918a3a8a9816521460d291824ff3ebc20b91af24c0fc774

See more details on using hashes here.

File details

Details for the file inorbit_edge-1.8.1-py2.py3-none-any.whl.

File metadata

  • Download URL: inorbit_edge-1.8.1-py2.py3-none-any.whl
  • Upload date:
  • Size: 27.7 kB
  • Tags: Python 2, Python 3
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/4.0.2 CPython/3.9.16

File hashes

Hashes for inorbit_edge-1.8.1-py2.py3-none-any.whl
Algorithm Hash digest
SHA256 80e691707a53b7c204605d90f02326ca71e61e64526015fa45508558c1d02fe3
MD5 8d4e72b803c68543071a756f56192273
BLAKE2b-256 aec086f92146a4f0052d80971100f5b308cff6bcf957af0b30797629125170bb

See more details on using hashes here.

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