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.0rc5.tar.gz (9.1 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.0rc5-py3-none-any.whl (9.7 kB view details)

Uploaded Python 3

File details

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

File metadata

  • Download URL: fms_robot_plugin-0.7.0rc5.tar.gz
  • Upload date:
  • Size: 9.1 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.0rc5.tar.gz
Algorithm Hash digest
SHA256 83a48cdb40497b93dfdddf86b14eb5ed9fb58ca59e005367f5c3b34d497e920f
MD5 f46de36ffe20788ae079140502c72057
BLAKE2b-256 b337ae9f4aed9e29f8095910eedde3428f2b1049cd14bf4e7308da0db42c6e06

See more details on using hashes here.

File details

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

File metadata

  • Download URL: fms_robot_plugin-0.7.0rc5-py3-none-any.whl
  • Upload date:
  • Size: 9.7 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.0rc5-py3-none-any.whl
Algorithm Hash digest
SHA256 b5513a8aeb9016f3a48ae030124e7d6b730d9a8b46b9e319c7d33456e47963cb
MD5 a9744b887e2124e9c627eb74b77a9508
BLAKE2b-256 ba6cd5668f6c35b43f597ae3c58f6fa8d03f224bd95a6b6f2421d317707ac0f7

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