Skip to main content

Pure-Python MOOS-IvP application framework

Project description

pymoos2

Pure-Python MOOS-IvP application framework. Write MOOS apps in Python with full AppCasting, wire protocol, and pAntler integration.

Install

pip install pymoos2

Quick Start

Generate a new app:

cd moos-ivp-myproject/src
python3 -m pymoos2 --GenAppCastingMOOSApp MyApp p "Your Name"

This creates pMyApp/ with a ready-to-edit Python MOOS app that:

  • Connects to MOOSDB over the native wire protocol
  • Supports AppCasting (shows up in uMAC/pMarineViewer)
  • Reads ProcessConfig from .moos files
  • Installs to bin/ via CMake alongside C++ apps
  • Responds to ktm shutdown signals
  • Handles time warp correctly

Example Mission

Generate a complete working example with two apps and a mission:

cd moos-ivp-myproject
python3 -m pymoos2 --example

Writing an App

from pymoos2 import AppCastingMOOSApp, ACTable

class MyApp(AppCastingMOOSApp):

    def on_startup(self):
        self.radius = self.config("radius", default=50.0, type=float)
        self.register("NAV_X")
        self.register("NAV_Y")

    def on_new_mail(self, mail):
        for msg in mail:
            if msg.name == "NAV_X":
                self.nav_x = msg.double()

    def iterate(self):
        self.notify("MY_OUTPUT", self.nav_x * 2.0)

    def build_report(self):
        tab = ACTable(["Variable", "Value"])
        tab.add("NAV_X", f"{self.nav_x:.2f}")
        self.report(tab)
        return True

Features

  • Pure Python — no C++ compilation, no pybind11
  • Full MOOS wire protocol (binary TCP, same as C++ clients)
  • AppCasting and RealmCasting support
  • Time warp support (MOOSTimeWarp)
  • ktm (kill the moos) UDP multicast listener
  • Mission file parsing (ProcessConfig blocks, global params)
  • Geometry DTOs for all VIEW_* types (XYPoint, XYPolygon, XYCircle, etc.)
  • NodeRecord parsing
  • py_compile syntax checking at build time
  • Works with pAntler — shebang'd scripts in bin/

Requirements

  • Python >= 3.8
  • MOOSDB running (from moos-ivp)
  • No other dependencies for core functionality
  • flask for web-based viewer apps (optional)

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

pymoos2-0.1.0.tar.gz (41.4 kB view details)

Uploaded Source

Built Distribution

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

pymoos2-0.1.0-py3-none-any.whl (61.7 kB view details)

Uploaded Python 3

File details

Details for the file pymoos2-0.1.0.tar.gz.

File metadata

  • Download URL: pymoos2-0.1.0.tar.gz
  • Upload date:
  • Size: 41.4 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/6.2.0 CPython/3.12.7

File hashes

Hashes for pymoos2-0.1.0.tar.gz
Algorithm Hash digest
SHA256 8b06054a3fd99193956a98d5ea39e6b6ea1eab1103413d0c2dfe2f7bb1504d06
MD5 04edcbd0be1201cefc0c3955bd58290d
BLAKE2b-256 b0716223cb89a7aedc887e91d6e88142101bdb4642df1de1fb4195e82cb0ec43

See more details on using hashes here.

File details

Details for the file pymoos2-0.1.0-py3-none-any.whl.

File metadata

  • Download URL: pymoos2-0.1.0-py3-none-any.whl
  • Upload date:
  • Size: 61.7 kB
  • Tags: Python 3
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/6.2.0 CPython/3.12.7

File hashes

Hashes for pymoos2-0.1.0-py3-none-any.whl
Algorithm Hash digest
SHA256 76304b439372687deb68ab2c3ddd21e94bdb7f40f63366f3899e8b1ec3a96b9a
MD5 2b4a54c3b8ca4195d4284ffa8371dfa5
BLAKE2b-256 90ca9ad8d063a2ae622dff58b298328d51d73654e78892a5cc6c3ca51647af97

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