Skip to main content

SDK for controlling Vention hardware

Project description

machine-logic-sdk

Provides a programmatic interface in Python to control Vention hardware and coordinate automation programs. This SDK enables developers to build custom applications that interact with Vention's MachineMotion platform, robots, actuators, and I/O devices.

Features

  • Robot Control: Move robots, set tool center points, compute kinematics
  • Machine Automation: Control actuators, pneumatics, and motors
  • I/O Management: Read sensors and control digital outputs
  • Real-time Monitoring: Access live robot positions, states, and sensor data
  • Safety Integration: Built-in safety state monitoring and emergency stops

Table of Contents

  1. Installation
  2. Quick Start
  3. Requirements
  4. Basic Usage
  5. Examples
  6. Development
  7. Documentation
  8. Contributing
  9. Support

Installation

Install the machine-logic-sdk from PyPI:

pip install machine-logic-sdk

Compatibility:

Please pay close attention to the compatibility table provided in the Official machine-logic-sdk Documentation to determine which version of the sdk is compatible with your version of MachineMotion

For development installations, see the Development section below.

Quick Start

Here's a simple example to get started: Assumptions:

  • Robot is configured with friendly name "Robot"
  • Digital Input is configured with friendlt name "Sensor_1"
from machinelogic import Machine

# Connect to your machine
machine = Machine()

# Get a robot and move it
robot = machine.get_robot("Robot")
target_position = [100.0, 200.0, 300.0, 0.0, 90.0, 0.0]  # [x, y, z, rx, ry, rz]
robot.movel(target_position)

# Read a digital input (assuming "Sensor_1" is configured)
input_device = machine.get_input("Sensor_1")
sensor_value = input_device.state
print(f"Sensor reading: {sensor_value}")

Requirements

  • Python 3.10.x (Python 3.10.12 is shipped on MachineMotionAI devices)
  • Python 3.9.x (Python 3.9 is shipped on MachineMotion v2 devices)
  • MachineMotion Controller or compatible Vention hardware
  • Network connection to your MachineMotion device

Note: Higher Python versions (up to 3.11) are supported for development, but Python 3.10 is recommended for compatibility with MachineMotionAI devices.

Basic Usage

Connecting to Your Machine

from machinelogic import Machine

# Connect to local machine (default)
machine = Machine()

or Connect to remote machine

from machinelogic import Machine

# Connect to a remote machine
machine = Machine(ip="192.168.7.2")

Robot Operations

from machinelogic import Machine

machine = Machine()

# Get robot instance
robot = machine.get_robot("Robot")

# Move to position (linear movement)
robot.movel([100, 200, 300, 0, 90, 0])

# Move joints directly
robot.movej([0, -90, 90, 0, 90, 0])

# Get current position
current_pose = robot.state.cartesian_position
joint_angles = robot.state.joint_angles

Actuator Control

from machinelogic import Machine, MotionProfile

machine = Machine()
my_actuator = machine.get_actuator("Actuator")


# Always home the actuator before starting to ensure position is properly calibrated.
my_actuator.home(timeout=10)

TARGET_POSITION = 150.0  # millimeters
VELOCITY = 150.0  # mm/s
ACCELERATION = 150.0  # mm/s^2
JERK = 150.0  # mm/s^3 OPTIONAL PARAMETER

my_actuator.move_absolute(
    position=TARGET_POSITION,  # millimeters
    motion_profile=MotionProfile(
        velocity=VELOCITY, acceleration=ACCELERATION, jerk=JERK
    ),
    timeout=10,  # seconds
)

I/O Operations

from machinelogic import Machine

machine = Machine()

my_input = machine.get_input("Input")

if my_input.state.value:
    print(f"{my_input.configuration.name} is HIGH")
else:
    print(f"{my_input.configuration.name} is LOW")

Examples

The SDK includes comprehensive examples in the examples/ directory.

These examples can also be found in the Official machine-logic-sdk Docs

  • Robot Control: Movement, kinematics, tool center points
  • Automation Sequences: Multi-step operations and coordination
  • I/O Integration: Sensor reading and output control
  • Error Handling: Safety and exception management

Browse the examples directory for complete, runnable** code samples.

**Note: You must ensure the devices in the example have been configured in the CAD and properly identified by the friendly name used in the example code.

Development

System Setup (Ubuntu/MachineMotion)

Install Python 3.10.12 on Ubuntu:

sudo apt install python3.10
python3 --version  # Verify installation

If you have multiple Python versions, ensure python3 points to 3.10:

cd /usr/bin
sudo unlink python3
sudo ln -s /usr/bin/python3.10 python3

Install required packages:

sudo apt-get install python3-apt python3-virtualenv python3.10-venv

Development Environment

Create and activate a virtual environment:

python3 -m venv venv
source venv/bin/activate
pip install --upgrade pip

Documentation


Ready to automate? Install the SDK and check out the examples to get started with your first automation project!

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

machine_logic_sdk-3.0.0.tar.gz (99.3 kB view details)

Uploaded Source

Built Distribution

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

machine_logic_sdk-3.0.0-py3-none-any.whl (150.3 kB view details)

Uploaded Python 3

File details

Details for the file machine_logic_sdk-3.0.0.tar.gz.

File metadata

  • Download URL: machine_logic_sdk-3.0.0.tar.gz
  • Upload date:
  • Size: 99.3 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? No
  • Uploaded via: poetry/2.3.2 CPython/3.10.12 Linux/6.14.0-1017-azure

File hashes

Hashes for machine_logic_sdk-3.0.0.tar.gz
Algorithm Hash digest
SHA256 c8f57c904f6ea6b644937978d1698742ecb431e85474a5bd25e073a55568f0ea
MD5 ac46bdf2ebb4ee8085b52b0abbbd5174
BLAKE2b-256 89b736cd6322e05025388edcb781061a2614b83a142b5c0ec8da81b24e104d20

See more details on using hashes here.

File details

Details for the file machine_logic_sdk-3.0.0-py3-none-any.whl.

File metadata

  • Download URL: machine_logic_sdk-3.0.0-py3-none-any.whl
  • Upload date:
  • Size: 150.3 kB
  • Tags: Python 3
  • Uploaded using Trusted Publishing? No
  • Uploaded via: poetry/2.3.2 CPython/3.10.12 Linux/6.14.0-1017-azure

File hashes

Hashes for machine_logic_sdk-3.0.0-py3-none-any.whl
Algorithm Hash digest
SHA256 4e71a7f8d766495b3e94fad9067b4a000cfc23aac5f1dc37b5db58ba28d5f2cd
MD5 4e22a0e01a7d4950298b59d018e70b1d
BLAKE2b-256 c3a1aa8b49086f83e2e54a9edc4e430986983ad0124bf6e55c7de1cef377f2f1

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