Skip to main content

screwmpcpy

Actions Status Documentation Status PyPI version PyPI platforms GitHub Discussion

Generate smooth motions for a n-DOF robot arm end effector using Dual Quaternions while enforcing velocity-, acceleration- and jerk constraints. The package includes a base optimization scheme and a base motion generator, which can be easily extended for custom robot arms. A motion generator for the Franka Emika Panda robot is included.

Install

The package is available in PyPI, you can install it via pip:

pip install screwmpcpy

Getting started

The motion generators yield velocity commands for an n-DoF robot arm. For the basic usage have a look at examples/motiongenerator.py. You can also use the dual quaternions to generate waypoints. Check it out the example for the panda robot at examples/panda_screwmotion_ik.py. To install the required package dependencies execute pip install screwmpcpy[examples]. You can find advanced usage examples here. We include two generators for the panda robot:
The basic screw motion generator and a modified variant, which includes manipulability maximization from [1].

Extending the available robots

You can easily extend the base class by adding your custom robot arm. Ensure the forward kinematics of your robot are available.
Create a new file your_robot_mg.py in folder src/screwmpc.py.

Custom robot example

from dqrobotics import DQ
from .basemg import BaseMotionGenerator
from .screwmpc import BOUND


class YourRobotMotionGenerator(BaseMotionGenerator):

    def __init__(
                self,
                n_p: int,
                n_c: int,
                q_mpc: float,
                r_mpc: float,
                lu_bound_vel: BOUND,
                lu_bound_acc: BOUND,
                lu_bound_jerk: BOUND,
                ) -> None:
        super().__init__(
            n_p, n_c, q_mpc, r_mpc, lu_bound_vel, lu_bound_acc, lu_bound_jerk
        )
        # custom attributes here
        self._kin = YourRobotKinematics()

    def step(self, q_robot: np.ndarray, goal: DQ) -> np.ndarray:

        # Initialize Dual Quaternion with 6D pose
        x_current = DQ(self._kin.your_forward_kinematics(q_robot))
        error, smooth_traj = super()._step(x_current, goal)
        # calculate commanded dq here
        ...
        return dq

References

[1] Haviland, J., & Corke, P. (2020). A Purely-Reactive Manipulability-Maximising Motion Controller. ArXiv. /abs/2002.11901

Metadata

Release files for screwmpcpy 0.5.3

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

Source distribution (sdist)

Source distribution for screwmpcpy 0.5.3
File Size Uploaded Provenance Actions
screwmpcpy-0.5.3.tar.gz 48.3 kB Without provenance Details for screwmpcpy-0.5.3.tar.gz

Built distribution (wheel)

Table of built distributions (wheels) for screwmpcpy 0.5.3
File Interpreter ABI Platform Actions
screwmpcpy-0.5.3-py3-none-any.whl Python 3 none any Details for screwmpcpy-0.5.3-py3-none-any.whl

Total release size: 67.2 kB

Release files / screwmpcpy-0.5.3.tar.gz

Download URL screwmpcpy-0.5.3.tar.gz
Size 48.3 kB
Tags Source
SHA-256 checksum
How to use checksums
931e8ffd53a3e3d74ef9fa997d30a941db797a7e54d44c5972c3855c87adde4e
BLAKE2b-256 checksum
How to use checksums
bc91482e7b2691268de10bb3f7249c7aa6b62ac556f8ceab50bb77e788e13813
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No
Uploaded via twine/5.1.0 CPython/3.12.4

Release files / screwmpcpy-0.5.3-py3-none-any.whl

Download URL screwmpcpy-0.5.3-py3-none-any.whl
Size 18.8 kB
Tags Python 3
SHA-256 checksum
How to use checksums
64fb07b00d07bad66feaf1f15a1ace49c7673061a264085eaebb532510ce100b
BLAKE2b-256 checksum
How to use checksums
f2876889b5ddbc06643938f8be8060390e3bb587539d407177ad4366e8a19426
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No
Uploaded via twine/5.1.0 CPython/3.12.4

Security for screwmpcpy 0.5.3

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.

No provenance found

None of the files in this release were uploaded with provenance metadata.

A note on package security

PyPI is a repository for distributing packages, not a service for auditing them. While third-party security researchers and our staff do their best to detect and remove malicious packages, PyPI cannot guarantee the quality, security or suitability of any given package.

To learn more about protecting yourself from malicious actors, visit our package security documentation.

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