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.0rc4.tar.gz (9.0 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.0rc4-py3-none-any.whl (9.6 kB view details)

Uploaded Python 3

File details

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

File metadata

  • Download URL: fms_robot_plugin-0.7.0rc4.tar.gz
  • Upload date:
  • Size: 9.0 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.0rc4.tar.gz
Algorithm Hash digest
SHA256 c040bdaf5186822f6f90a95fac644916f4e6e27d789e4ce8b232fba6e87c38f4
MD5 55bcb53bd6827d5cc6bcfa448a78f0e4
BLAKE2b-256 9b352efa8a18d67862f081a4855857319c15af83ff0a6d3ec5818c51e1f38214

See more details on using hashes here.

File details

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

File metadata

  • Download URL: fms_robot_plugin-0.7.0rc4-py3-none-any.whl
  • Upload date:
  • Size: 9.6 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.0rc4-py3-none-any.whl
Algorithm Hash digest
SHA256 3d29ea3edbc7be4ae44fc0efc90252b190d9b8f31bc857053876e0e73e28d9d4
MD5 f84befd17ac1acccccecbe71a4b16ade
BLAKE2b-256 0d790355b9400b45f23c12b751a321743cc96b2bee65f8a4cd49076dc155abe5

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