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.1.tar.gz (99.4 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.1-py3-none-any.whl (150.5 kB view details)

Uploaded Python 3

File details

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

File metadata

  • Download URL: machine_logic_sdk-3.0.1.tar.gz
  • Upload date:
  • Size: 99.4 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? No
  • Uploaded via: poetry/2.3.2 CPython/3.10.12 Linux/6.17.0-1008-azure

File hashes

Hashes for machine_logic_sdk-3.0.1.tar.gz
Algorithm Hash digest
SHA256 2b604d7d3362b0330c510b540b60b57a6c7bf62fec7a5227d6d86fe1b45ef459
MD5 9791c2a28f61ef76eba886c1715d68c1
BLAKE2b-256 f848dced020738ec55ce469b2dcdcc1a63af8a93377e0b3bdfb15182c67f80bb

See more details on using hashes here.

File details

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

File metadata

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

File hashes

Hashes for machine_logic_sdk-3.0.1-py3-none-any.whl
Algorithm Hash digest
SHA256 e9231d17ff8eff8683d71f26f2023c7ddd9f17d141e0a3c88cae72f23f3f8ea1
MD5 fbbbb63cf041a8c08dbb65acb29fd0ff
BLAKE2b-256 116e1d2efc05c18e8bfc3183c66930118a9294d3b7557da490490a5fdab2fe71

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