Skip to main content

marinholab-sas-core

Python bindings for the ROS-free SmartArmStack C++ core.

This repository wraps MarinhoLab/sas_cpp (the pure-C++ part of SmartArmStack/sas_core) with pybind11, exposing it to Python as the marinholab.sas.core package.

More information about SmartArmStack is available in smartarmstack.github.io.

Contents

  • marinholab/sas/core/ — the Python package.
    • _core.* — compiled pybind11 extension (the C++ bindings live in src/).
    • modeling/ — kinematic modeling bindings (re-exported from _core).
    • papers/ — reference implementations from published work.
      • papers/icra2019/ — the task-space Controller (RCM + joint-limit constraints as a QP) from "A Unified Framework for the Teleoperation of Surgical Robots in Constrained Workspaces" (ICRA 2019).
    • example_*.py — example scripts (also installed as commands).
  • src/ — the C++ binding sources (ported from SmartArmStack/sas_core).
  • submodules/sas_cpp — the C++ core (git submodule, consumed via CMake).
  • submodules/pybind11 — pybind11 (git submodule, pinned to v3.0.4).
  • docker/ — ubuntu:noble build environment and full test pipeline.

The C++ core depends on Eigen3 and dqrobotics (the latter is located by CMake at build time; on Debian/Ubuntu it comes from the DQ Robotics PPA). The Python package additionally depends on the dqrobotics Python package, which registers the dual-quaternion types the bindings expose.

Installation

From source:

git clone --recursive https://github.com/MarinhoLab/sas_py.git
cd sas_py
pip install . --no-build-isolation

Building requires cmake (>= 3.16), ninja, a C++17 compiler, Eigen3, and dqrobotics. On Debian/Ubuntu:

sudo apt install build-essential g++ cmake ninja-build python3-dev libeigen3-dev
# dqrobotics from the DQ Robotics PPA:
sudo add-apt-repository -y ppa:dqrobotics-dev/development
sudo apt install libdqrobotics

Usage

from marinholab.sas.core import (
    Clock,
    Statistics,
    RobotDriver,
    ShutdownSignaler,
)

# High-resolution sampling clock
clock = Clock(0.01)          # 10 ms sampling period
clock.init()
for _ in range(100):
    clock.update_and_sleep()
print(clock.get_statistics(Statistics.Mean, Clock.TimeType.Computational))

# Subclass RobotDriver to drive hardware
class MyDriver(RobotDriver):
    def __init__(self, ss):
        super().__init__(ss)
    def get_joint_positions(self):
        return np.zeros(6)
    def set_target_joint_positions(self, target):
        ...
    def connect(self):
        ...
    def disconnect(self):
        ...
    def initialize(self):
        ...
    def deinitialize(self):
        ...

Kinematic modeling

import numpy as np
from dqrobotics import DQ
from marinholab.sas.core import SerialManipulatorSimulatorFriendly

# 3 revolute joints about X, Y, Z with zero per-joint offsets.
arm = SerialManipulatorSimulatorFriendly(
    offset_before=[DQ(1), DQ(1), DQ(1)],
    offset_after=[DQ(1), DQ(1), DQ(1)],
    actuation_types=[
        SerialManipulatorSimulatorFriendly.ActuationType.RX,
        SerialManipulatorSimulatorFriendly.ActuationType.RY,
        SerialManipulatorSimulatorFriendly.ActuationType.RZ,
    ],
)
q = np.array([0.1, -0.2, 0.3])
x = arm.raw_fkm(q, 2)                 # dual-quaternion pose of the end-effector
J = arm.raw_pose_jacobian(q, 2)       # 8 x 3 pose Jacobian

The examples are installed as commands:

  • sas_core_clock_example — a 10 ms Clock with timing statistics.
  • sas_core_clock_sched_fifo_example — a 1 ms Clock under SCHED_FIFO.
  • sas_core_robot_driver_subclass_example — subclass RobotDriver in Python and exercise the trampoline (connect / initialize / targets / limits).

Versioning

The version is computed from git tags at build time by setuptools-git-versioning. A monthly version tag of the form YY.MM (e.g. 26.09) plus the number of commits since that tag yields a rolling YY.MM.NN version (e.g. 26.09.3), mirroring MarinhoLab/sas_cpp. An untagged checkout builds as 0.0.1 (a development version).

Testing

A full build + test pipeline runs in an ubuntu:noble container:

cd docker
docker compose run --rm marinholab_sas_core

License

See LICENSE for details (LGPLv3).

Metadata

Release files for marinholab-sas-core 26.9.8

For a detailed explanation of source distributions (sdists) and built distributions (wheels), please see the package formats documentation.

Built distributions (wheels)

Table of built distributions (wheels) for marinholab-sas-core 26.9.8
File
marinholab_sas_core-26.9.8-cp312-cp312-win_amd64.whl CPython 3.12 CPython 3.12 Windows x86-64 Details
marinholab_sas_core-26.9.8-cp312-cp312-manylinux_2_39_x86_64.whl CPython 3.12 CPython 3.12 Linux glibc 2.39+ x86-64 Details
marinholab_sas_core-26.9.8-cp312-cp312-manylinux_2_39_aarch64.whl CPython 3.12 CPython 3.12 Linux glibc 2.39+ ARM64 Details
marinholab_sas_core-26.9.8-cp311-cp311-win_amd64.whl CPython 3.11 CPython 3.11 Windows x86-64 Details
marinholab_sas_core-26.9.8-cp311-cp311-manylinux_2_39_x86_64.whl CPython 3.11 CPython 3.11 Linux glibc 2.39+ x86-64 Details
marinholab_sas_core-26.9.8-cp311-cp311-manylinux_2_39_aarch64.whl CPython 3.11 CPython 3.11 Linux glibc 2.39+ ARM64 Details
marinholab_sas_core-26.9.8-cp310-cp310-win_amd64.whl CPython 3.10 CPython 3.10 Windows x86-64 Details
marinholab_sas_core-26.9.8-cp310-cp310-manylinux_2_39_x86_64.whl CPython 3.10 CPython 3.10 Linux glibc 2.39+ x86-64 Details
marinholab_sas_core-26.9.8-cp310-cp310-manylinux_2_39_aarch64.whl CPython 3.10 CPython 3.10 Linux glibc 2.39+ ARM64 Details

Total release size: 94.1 MB

Release files / marinholab_sas_core-26.9.8-cp312-cp312-win_amd64.whl

Download URL marinholab_sas_core-26.9.8-cp312-cp312-win_amd64.whl
Size 192.6 kB
Tags CPython 3.12 Windows x86-64
SHA-256 checksum
How to use checksums
89eac494920280f7abd8d4c260362fc9311c41dd227b09b21c7cd7c522fc856e
BLAKE2b-256 checksum
How to use checksums
84d2b0fbe18dd07363b9e5f0b77d26fc6e7be88b6459abc5daffbb0d7cf1dea5
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
Yes
Uploaded via twine/7.0.0 CPython/3.13.14

Provenance

Provenance describes where a file came from. On PyPI, provenance is shared via attestations, which provide a verifiable record of the build or publishing details. View details, limitations and caveats.

PyPI Publish Attestation

PyPI verified that this artifact, at this checksum, originated from the publisher listed below.

Signed by GitHub Actions, verified by PyPI on Sep 24, 2026.

Transparency log

Release files / marinholab_sas_core-26.9.8-cp312-cp312-manylinux_2_39_x86_64.whl

Download URL marinholab_sas_core-26.9.8-cp312-cp312-manylinux_2_39_x86_64.whl
Size 15.7 MB
Tags CPython 3.12 Linux glibc 2.39+ x86-64
SHA-256 checksum
How to use checksums
691785083c564feeec8448d5f9446aeb258c74966c4282a2b4e5d44bf1e76d9b
BLAKE2b-256 checksum
How to use checksums
be439fcca3e14aaa996386fb3d977ba1e4e01961147761ae5d443826af59ca34
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
Yes
Uploaded via twine/7.0.0 CPython/3.13.14

Provenance

Provenance describes where a file came from. On PyPI, provenance is shared via attestations, which provide a verifiable record of the build or publishing details. View details, limitations and caveats.

PyPI Publish Attestation

PyPI verified that this artifact, at this checksum, originated from the publisher listed below.

Signed by GitHub Actions, verified by PyPI on Sep 24, 2026.

Transparency log

Release files / marinholab_sas_core-26.9.8-cp312-cp312-manylinux_2_39_aarch64.whl

Download URL marinholab_sas_core-26.9.8-cp312-cp312-manylinux_2_39_aarch64.whl
Size 15.5 MB
Tags CPython 3.12 Linux glibc 2.39+ ARM64
SHA-256 checksum
How to use checksums
c6f880682355a504cb9042c14ca18c28c16e6ef60da437a380c0fd00da97bce4
BLAKE2b-256 checksum
How to use checksums
bb22f7a41ca7f7f8a20690aa1fffa89b0d3fe570ae8267f60fb073ace7e99dbd
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
Yes
Uploaded via twine/7.0.0 CPython/3.13.14

Provenance

Provenance describes where a file came from. On PyPI, provenance is shared via attestations, which provide a verifiable record of the build or publishing details. View details, limitations and caveats.

PyPI Publish Attestation

PyPI verified that this artifact, at this checksum, originated from the publisher listed below.

Signed by GitHub Actions, verified by PyPI on Sep 24, 2026.

Transparency log

Release files / marinholab_sas_core-26.9.8-cp311-cp311-win_amd64.whl

Download URL marinholab_sas_core-26.9.8-cp311-cp311-win_amd64.whl
Size 189.5 kB
Tags CPython 3.11 Windows x86-64
SHA-256 checksum
How to use checksums
16f64b2f6970ad4da7ad260e498cf6480414992f9a51e0e11b1504003dedd647
BLAKE2b-256 checksum
How to use checksums
474765a705aa497e18cd89e1aa930b005b0fe62f15b852c4d8e3c301ee3e4f2a
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
Yes
Uploaded via twine/7.0.0 CPython/3.13.14

Provenance

Provenance describes where a file came from. On PyPI, provenance is shared via attestations, which provide a verifiable record of the build or publishing details. View details, limitations and caveats.

PyPI Publish Attestation

PyPI verified that this artifact, at this checksum, originated from the publisher listed below.

Signed by GitHub Actions, verified by PyPI on Sep 24, 2026.

Transparency log

Release files / marinholab_sas_core-26.9.8-cp311-cp311-manylinux_2_39_x86_64.whl

Download URL marinholab_sas_core-26.9.8-cp311-cp311-manylinux_2_39_x86_64.whl
Size 15.7 MB
Tags CPython 3.11 Linux glibc 2.39+ x86-64
SHA-256 checksum
How to use checksums
54e2f241963f3e206a9ce505c57f51d02d45a18de7790f683dbb93e97b2b0491
BLAKE2b-256 checksum
How to use checksums
70ffffb969ed397afcbb2f07aca9247165b5af3e09bbfba530513be0ba1e2dac
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
Yes
Uploaded via twine/7.0.0 CPython/3.13.14

Provenance

Provenance describes where a file came from. On PyPI, provenance is shared via attestations, which provide a verifiable record of the build or publishing details. View details, limitations and caveats.

PyPI Publish Attestation

PyPI verified that this artifact, at this checksum, originated from the publisher listed below.

Signed by GitHub Actions, verified by PyPI on Sep 24, 2026.

Transparency log

Release files / marinholab_sas_core-26.9.8-cp311-cp311-manylinux_2_39_aarch64.whl

Download URL marinholab_sas_core-26.9.8-cp311-cp311-manylinux_2_39_aarch64.whl
Size 15.5 MB
Tags CPython 3.11 Linux glibc 2.39+ ARM64
SHA-256 checksum
How to use checksums
f5b14555f8372dae28888a1f895ba8c945fc972e72f29d9f74653f4234a8477f
BLAKE2b-256 checksum
How to use checksums
f6294b7be789c604794186d42f4bdd905fe6499933f4d96b94331617f5b4ac50
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
Yes
Uploaded via twine/7.0.0 CPython/3.13.14

Provenance

Provenance describes where a file came from. On PyPI, provenance is shared via attestations, which provide a verifiable record of the build or publishing details. View details, limitations and caveats.

PyPI Publish Attestation

PyPI verified that this artifact, at this checksum, originated from the publisher listed below.

Signed by GitHub Actions, verified by PyPI on Sep 24, 2026.

Transparency log

Release files / marinholab_sas_core-26.9.8-cp310-cp310-win_amd64.whl

Download URL marinholab_sas_core-26.9.8-cp310-cp310-win_amd64.whl
Size 186.6 kB
Tags CPython 3.10 Windows x86-64
SHA-256 checksum
How to use checksums
7db6883473456f7738478ab39e13d838458b6208a457ad311c9ff5994b0928bf
BLAKE2b-256 checksum
How to use checksums
ebb681ce7e9f58da9c0028f3d0c2f5d420f4a49801bd6689119892888a660919
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
Yes
Uploaded via twine/7.0.0 CPython/3.13.14

Provenance

Provenance describes where a file came from. On PyPI, provenance is shared via attestations, which provide a verifiable record of the build or publishing details. View details, limitations and caveats.

PyPI Publish Attestation

PyPI verified that this artifact, at this checksum, originated from the publisher listed below.

Signed by GitHub Actions, verified by PyPI on Sep 24, 2026.

Transparency log

Release files / marinholab_sas_core-26.9.8-cp310-cp310-manylinux_2_39_x86_64.whl

Download URL marinholab_sas_core-26.9.8-cp310-cp310-manylinux_2_39_x86_64.whl
Size 15.7 MB
Tags CPython 3.10 Linux glibc 2.39+ x86-64
SHA-256 checksum
How to use checksums
f6ef2b95cbf4923ec12401f8c1b5f1a2d8d069b30ed4c88794f6f433ed880718
BLAKE2b-256 checksum
How to use checksums
ce974f48aef20aff8773c9cb5a5213d4f481edf85e7da688a906968bf3862d00
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
Yes
Uploaded via twine/7.0.0 CPython/3.13.14

Provenance

Provenance describes where a file came from. On PyPI, provenance is shared via attestations, which provide a verifiable record of the build or publishing details. View details, limitations and caveats.

PyPI Publish Attestation

PyPI verified that this artifact, at this checksum, originated from the publisher listed below.

Signed by GitHub Actions, verified by PyPI on Sep 24, 2026.

Transparency log

Release files / marinholab_sas_core-26.9.8-cp310-cp310-manylinux_2_39_aarch64.whl

Download URL marinholab_sas_core-26.9.8-cp310-cp310-manylinux_2_39_aarch64.whl
Size 15.5 MB
Tags CPython 3.10 Linux glibc 2.39+ ARM64
SHA-256 checksum
How to use checksums
80ba18bcb2474c75a8db0fafa010c9896f1eee12fb3d6496823ec71c897bb6c8
BLAKE2b-256 checksum
How to use checksums
ce6662e8694b7919e78a7b17b2c9603c42ae3d4cf28e9f0b7358483c2b470209
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
Yes
Uploaded via twine/7.0.0 CPython/3.13.14

Provenance

Provenance describes where a file came from. On PyPI, provenance is shared via attestations, which provide a verifiable record of the build or publishing details. View details, limitations and caveats.

PyPI Publish Attestation

PyPI verified that this artifact, at this checksum, originated from the publisher listed below.

Signed by GitHub Actions, verified by PyPI on Sep 24, 2026.

Transparency log

Release history Release notifications | RSS feed

This release

26.9.8 This release

9 release files

26.9.6

9 release files

26.9.5

9 release files

26.9.4

6 release files

Anthropic, PBC Visionary sponsor Bloomberg Visionary sponsor Hudson River Trading Visionary sponsor Meta Visionary sponsor NVIDIA Visionary sponsor Microsoft Sustainability sponsor Depot Continuous Integration AWS Cloud computing and Security Sponsor Datadog Monitoring Fastly CDN Google Download Analytics Sentry Error logging StatusPage Status page