Skip to main content

No project description provided

Project description

FMS Robot Plugin Library

Installation

pip install fms-robot-plugin

Quickstart

from fms_robot_plugin.robot import Robot
from fms_robot_plugin.constants import Capability
from fms_robot_plugin.typings import Twist

capabilities = [
    "on_teleop",
    "on_stop",
    "set_pose",
    "set_lidar",
]

robot = Robot(
    plugin_name="custom_plugin",
    plugin_version="v1",
    robot_key="secret_robot_key",
    broker_host="mqtt-broker.movelrobotics.com",
    broker_port=1883,
    broker_use_tls=False,
    broker_ca_certs=None,
    api_hostname="fms-api.movelrobotics.com",
    capabilities=capabilities,
)

def handle_teleop(payload: Twist):
    pass

def handle_stop():
    pass


robot.on_teleop(handle_teleop)
robot.on_stop(handle_stop)
robot.run()

Reconnect Behavior example

from fms_robot_plugin.robot import Robot
from fms_robot_plugin.constants import Capability
from fms_robot_plugin.typings import ReconnectBehavior

capabilities = [
    "on_teleop",
    "on_stop",
    "set_pose",
    "set_lidar",
]

robot = Robot(
    plugin_name="custom_plugin",
    plugin_version="v1",
    robot_key="secret_robot_key",
    broker_host="mqtt-broker.movelrobotics.com",
    broker_port=1883,
    broker_use_tls=False,
    broker_ca_certs=None,
    api_hostname="fms-api.movelrobotics.com",
    capabilities=capabilities,
)

def handle_on_connect(payload: dict):
    print(f"Connected to FMS at {payload['sent_at']}")

def handle_on_disconnect(payload: dict):
    print(f"Disconnected from FMS at {payload['sent_at']}")

    if robot.reconnect_behavior == ReconnectBehavior.CANCEL_QUEUE:
        print("Stopping robot active task")
    elif robot.reconnect_behavior == ReconnectBehavior.PAUSE_QUEUE:
        print("Pausing robot active task")
    elif robot.reconnect_behavior == ReconnectBehavior.PAUSE_THEN_RESUME_QUEUE:
        print("Pausing robot active task, will resume after reconnect")

robot.on_connect = handle_on_connect
robot.on_disconnect = handle_on_disconnect
robot.run()

Project details


Release history Release notifications | RSS feed

Download files

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

Source Distribution

fms_robot_plugin-0.7.0rc3.tar.gz (8.5 kB view details)

Uploaded Source

Built Distribution

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

fms_robot_plugin-0.7.0rc3-py3-none-any.whl (9.0 kB view details)

Uploaded Python 3

File details

Details for the file fms_robot_plugin-0.7.0rc3.tar.gz.

File metadata

  • Download URL: fms_robot_plugin-0.7.0rc3.tar.gz
  • Upload date:
  • Size: 8.5 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? No
  • Uploaded via: poetry/1.3.2 CPython/3.10.13 Linux/5.4.0-187-generic

File hashes

Hashes for fms_robot_plugin-0.7.0rc3.tar.gz
Algorithm Hash digest
SHA256 ddefaa9121fe6063450fb806da859ef07c0ec3d5834ba06a7251efb8f5b6fd47
MD5 b090faba6a3ab0dad1945d4d27f42b45
BLAKE2b-256 cddc69d1470a23e14667e1c1f73ff74eee960a8a146e40bd6910ac736abe227d

See more details on using hashes here.

File details

Details for the file fms_robot_plugin-0.7.0rc3-py3-none-any.whl.

File metadata

  • Download URL: fms_robot_plugin-0.7.0rc3-py3-none-any.whl
  • Upload date:
  • Size: 9.0 kB
  • Tags: Python 3
  • Uploaded using Trusted Publishing? No
  • Uploaded via: poetry/1.3.2 CPython/3.10.13 Linux/5.4.0-187-generic

File hashes

Hashes for fms_robot_plugin-0.7.0rc3-py3-none-any.whl
Algorithm Hash digest
SHA256 f817aa213c7e25d83056dad4c27f6986de4689d69c997dd51a4ed66319f47e12
MD5 c359f65b6bb0d2cb3b56b3a7b63bbfd6
BLAKE2b-256 39633a175a2d965c477412a9927c90a0163b41a76133eb91ed922008ea9dd5ce

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