A Python library for robot control
Project description
ropy
A robotics library for Python
- GitHub repository https://github.com/jhavl/ropy
- Documentation https://jhavl.github.io/ropy
Used in
J. Haviland and P. Corke, "Maximising manipulability during resolved-rate motion control," arXiv preprint arXiv:2002.11901, 2020. [arxiv] [project website] [video]
Installing
Requires Python ≥ 3.5.
git clone https://github.com/jhavl/ropy.git
cd ropy
pip3 install -e .
Usage
Arm-Type Robots
import ropy as rp
import numpy as np
# Initialise a Franka-Emika Panda robot
panda = rp.Panda()
# Set the joint angles of the robot
q0 = np.array([0, -1.57, -1.57, 1.57, 0, -1.57, 1.57])
panda.q = q0
# Calculate the forward kinematics of the robot at joint angles q0
panda.fkine(q0)
# or
panda.fkine() # Use the robot's attribute q set by panda.q =
# Calculate the Kinematic Jacobian (in the world frame) at joint angles q0
panda.jacob0(q0)
# or
panda.jacob0()
# Calculate the manipulability of the robot at joint angles q0
panda.manipulability(q0)
# or
panda.manipulability()
# Calculate the Kinematic Hessian (in the world frame) at joint angles q0
panda.hessian0(q0)
# or
panda.hessian0()
# Print the Elementary Transform Sequence (ETS) of the robot
print(panda)
Manipulability Motion Control Example
This example implements Manipulability Motion Control from this paper within a position-based servoing scheme. We use the library qpsolvers to solve the optimisation function. However, you can use whichever solver you wish.
import ropy as rp
import numpy as np
import spatialmath as sm
import qpsolvers as qp
# Initialise a Franka-Emika Panda Robot
panda = rp.Panda()
# The current joint angles of the Panda
# You need to obtain these from however you interfave with your robot
# eg. ROS messages, PyRep etc.
panda.q = np.array([0, -3, 0, -2.3, 0, 2, 0])
# The current pose of the robot
wTe = panda.fkine()
# The desired pose of the robot
# = Current pose offset 20cm in the x-axis
wTep = wTe * sm.SE3.Tx(0.2)
# Gain term (lambda) for control minimisation
Y = 0.005
# Quadratic component of objective function
Q = Y * np.eye(7)
arrived = False
while not arrived:
# The current joint angles of the Panda
# You need to obtain these from however you interfave with your robot
# eg. ROS messages, PyRep etc.
panda.q = np.array([0, -3, 0, -2.3, 0, 2, 0])
# The desired end-effecor spatial velocity
v, arrived = rp.p_servo(wTe, wTep)
# Form the equality constraints
# The kinematic Jacobian in the end-effecor frame
Aeq = panda.jacobe()
beq = v.reshape((6,))
# Linear component of objective function: the manipulability Jacobian
c = -panda.jacobm().reshape((7,))
# Solve for the joint velocities dq
dq = qp.solve_qp(Q, c, None, None, Aeq, beq)
# Send the joint velocities to the robot
# eg. ROS messages, PyRep etc.
Resolved-Rate Motion Control Example
This example implements resolved-rate motion control within a position-based servoing scheme
import ropy as rp
import numpy as np
import spatialmath as sm
# Initialise a Franka-Emika Panda Robot
panda = rp.Panda()
# The current joint angles of the Panda
# You need to obtain these from however you interfave with your robot
# eg. ROS messages, PyRep etc.
panda.q = np.array([0, -3, 0, -2.3, 0, 2, 0])
# The current pose of the robot
wTe = panda.fkine()
# The desired pose of the robot
# = Current pose offset 20cm in the x-axis
wTep = wTe * sm.SE3.Tx(0.2)
arrived = False
while not arrived:
# The current joint angles of the Panda
# You need to obtain these from however you interfave with your robot
# eg. ROS messages, PyRep etc.
panda.q = np.array([0, -3, 0, -2.3, 0, 2, 0])
# The desired end-effecor spatial velocity
v, arrived = rp.p_servo(wTe, wTep)
# Solve for the joint velocities dq
# Perfrom the pseudoinverse of the manipulator Jacobian in the end-effector frame
dq = np.linalg.pinv(panda.jacobe()) @ v
# Send the joint velocities to the robot
# eg. ROS messages, PyRep etc.
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
Built Distributions
File details
Details for the file ropy-0.3.7.tar.gz
.
File metadata
- Download URL: ropy-0.3.7.tar.gz
- Upload date:
- Size: 92.4 kB
- Tags: Source
- Uploaded using Trusted Publishing? No
- Uploaded via: twine/3.2.0 pkginfo/1.5.0.1 requests/2.24.0 setuptools/50.1.0 requests-toolbelt/0.9.1 tqdm/4.48.2 CPython/3.7.9
File hashes
Algorithm | Hash digest | |
---|---|---|
SHA256 | 2f4a343e08c6983ccc6ccdb53e73de2d0bf24ac15b5f02f4363b8736c2e40332 |
|
MD5 | 3dd57bc1addb43cca0e16e078a095c6f |
|
BLAKE2b-256 | 9cbf1395e9c4a3dceb006587fa6d89b006e5f836312d5f2cb8a97ee944683a9f |
File details
Details for the file ropy-0.3.7-cp38-cp38-win_amd64.whl
.
File metadata
- Download URL: ropy-0.3.7-cp38-cp38-win_amd64.whl
- Upload date:
- Size: 15.8 MB
- Tags: CPython 3.8, Windows x86-64
- Uploaded using Trusted Publishing? No
- Uploaded via: twine/3.2.0 pkginfo/1.5.0.1 requests/2.24.0 setuptools/50.1.0 requests-toolbelt/0.9.1 tqdm/4.48.2 CPython/3.8.5
File hashes
Algorithm | Hash digest | |
---|---|---|
SHA256 | 2383aa29597a3fb0b8aaf92adb0dd747ec2318fcad2fd52199c1a8355b8af58c |
|
MD5 | 2dd03dd9b2d52b29e6350787fb335a6c |
|
BLAKE2b-256 | f985efe38c920f4e7e4c79286ed96fb6e18e8cd64f21572253f90f58d3b18d64 |
File details
Details for the file ropy-0.3.7-cp38-cp38-manylinux2010_x86_64.whl
.
File metadata
- Download URL: ropy-0.3.7-cp38-cp38-manylinux2010_x86_64.whl
- Upload date:
- Size: 15.8 MB
- Tags: CPython 3.8, manylinux: glibc 2.12+ x86-64
- Uploaded using Trusted Publishing? No
- Uploaded via: twine/3.2.0 pkginfo/1.5.0.1 requests/2.24.0 setuptools/50.1.0 requests-toolbelt/0.9.1 tqdm/4.48.2 CPython/3.7.9
File hashes
Algorithm | Hash digest | |
---|---|---|
SHA256 | 005f89665a56391fcf15cff793710fd7a0ec796d5fb9a39107ad47d92445a466 |
|
MD5 | e0fdcecf83d22791d8f8b621572fbabd |
|
BLAKE2b-256 | cceb06314d6946c9645ca423aedc5b6d9024347b8ebe478511c3bcdf6b2b156b |
File details
Details for the file ropy-0.3.7-cp38-cp38-manylinux1_x86_64.whl
.
File metadata
- Download URL: ropy-0.3.7-cp38-cp38-manylinux1_x86_64.whl
- Upload date:
- Size: 15.8 MB
- Tags: CPython 3.8
- Uploaded using Trusted Publishing? No
- Uploaded via: twine/3.2.0 pkginfo/1.5.0.1 requests/2.24.0 setuptools/50.1.0 requests-toolbelt/0.9.1 tqdm/4.48.2 CPython/3.7.9
File hashes
Algorithm | Hash digest | |
---|---|---|
SHA256 | f0b101278c9baa0a037b823baa5953a739647bc41fc58a2724b2ad8122718d63 |
|
MD5 | 56e45cf8d600519c348f4a82ffcba8c8 |
|
BLAKE2b-256 | 27f7f8cc7c83333cb219de4adfb2e1dcaf056074aa0b838325a70c9ff721ae75 |
File details
Details for the file ropy-0.3.7-cp38-cp38-macosx_10_14_x86_64.whl
.
File metadata
- Download URL: ropy-0.3.7-cp38-cp38-macosx_10_14_x86_64.whl
- Upload date:
- Size: 15.8 MB
- Tags: CPython 3.8, macOS 10.14+ x86-64
- Uploaded using Trusted Publishing? No
- Uploaded via: twine/3.2.0 pkginfo/1.5.0.1 requests/2.24.0 setuptools/50.1.0 requests-toolbelt/0.9.1 tqdm/4.48.2 CPython/3.8.5
File hashes
Algorithm | Hash digest | |
---|---|---|
SHA256 | 275d09b3a7132711b285d94f398cf82ecf9e1222eeba8a894c8dceb7cffebbc8 |
|
MD5 | 469bc15ad6d241c3308240f00dfd1d94 |
|
BLAKE2b-256 | d0525bd7ba6d3eab3a775c452229d37f80ba8c9344e37b79f781de99d614d3b0 |
File details
Details for the file ropy-0.3.7-cp37-cp37m-win_amd64.whl
.
File metadata
- Download URL: ropy-0.3.7-cp37-cp37m-win_amd64.whl
- Upload date:
- Size: 15.8 MB
- Tags: CPython 3.7m, Windows x86-64
- Uploaded using Trusted Publishing? No
- Uploaded via: twine/3.2.0 pkginfo/1.5.0.1 requests/2.24.0 setuptools/50.1.0 requests-toolbelt/0.9.1 tqdm/4.48.2 CPython/3.7.9
File hashes
Algorithm | Hash digest | |
---|---|---|
SHA256 | e317bd5a469572f2e547e12e373e100cca5f76ae1b445ce4160ad9408c481e29 |
|
MD5 | e9b033e744483a1174887469c422e080 |
|
BLAKE2b-256 | 135b04d5c146cc9bfc3b5b2e533cdcfdf7f04a39f9656f3883ed03148fa7e7fc |
File details
Details for the file ropy-0.3.7-cp37-cp37m-manylinux2010_x86_64.whl
.
File metadata
- Download URL: ropy-0.3.7-cp37-cp37m-manylinux2010_x86_64.whl
- Upload date:
- Size: 15.9 MB
- Tags: CPython 3.7m, manylinux: glibc 2.12+ x86-64
- Uploaded using Trusted Publishing? No
- Uploaded via: twine/3.2.0 pkginfo/1.5.0.1 requests/2.24.0 setuptools/50.1.0 requests-toolbelt/0.9.1 tqdm/4.48.2 CPython/3.7.9
File hashes
Algorithm | Hash digest | |
---|---|---|
SHA256 | e746c08bff134ab843923b14bd0df5023441e2e06de58937ebe65ba18fd43b6f |
|
MD5 | c7316c945d16fbc87329efac815d123b |
|
BLAKE2b-256 | f852dea02df7c5946563b13873679aecebb8a7ec4c36d11ec28b3ae1bd7c1fcd |
File details
Details for the file ropy-0.3.7-cp37-cp37m-manylinux1_x86_64.whl
.
File metadata
- Download URL: ropy-0.3.7-cp37-cp37m-manylinux1_x86_64.whl
- Upload date:
- Size: 15.9 MB
- Tags: CPython 3.7m
- Uploaded using Trusted Publishing? No
- Uploaded via: twine/3.2.0 pkginfo/1.5.0.1 requests/2.24.0 setuptools/50.1.0 requests-toolbelt/0.9.1 tqdm/4.48.2 CPython/3.7.9
File hashes
Algorithm | Hash digest | |
---|---|---|
SHA256 | 634603b3e1e55f620c406a5b0ef3656d664db4b8e6608325365cfa2823fc0fe5 |
|
MD5 | ae100f411e9bb40f379b88e091535a06 |
|
BLAKE2b-256 | 1f70f6f7f3e86f585392ca4eae832f7a4f7d800fbc46592e5f88743fa0841704 |
File details
Details for the file ropy-0.3.7-cp37-cp37m-macosx_10_14_x86_64.whl
.
File metadata
- Download URL: ropy-0.3.7-cp37-cp37m-macosx_10_14_x86_64.whl
- Upload date:
- Size: 15.8 MB
- Tags: CPython 3.7m, macOS 10.14+ x86-64
- Uploaded using Trusted Publishing? No
- Uploaded via: twine/3.2.0 pkginfo/1.5.0.1 requests/2.24.0 setuptools/50.1.0 requests-toolbelt/0.9.1 tqdm/4.48.2 CPython/3.7.9
File hashes
Algorithm | Hash digest | |
---|---|---|
SHA256 | 22ddaede605391ab474752f8be1d383bbce22a04fa35d0da174a0be5ffdd106c |
|
MD5 | 7b6177926ff4629100e7a21f22f9ea97 |
|
BLAKE2b-256 | 1ffcd529d3af505bbde88992043cfce940dc053915858e1c42219c6cb5b429a2 |
File details
Details for the file ropy-0.3.7-cp36-cp36m-win_amd64.whl
.
File metadata
- Download URL: ropy-0.3.7-cp36-cp36m-win_amd64.whl
- Upload date:
- Size: 15.8 MB
- Tags: CPython 3.6m, Windows x86-64
- Uploaded using Trusted Publishing? No
- Uploaded via: twine/3.2.0 pkginfo/1.5.0.1 requests/2.24.0 setuptools/50.1.0 requests-toolbelt/0.9.1 tqdm/4.48.2 CPython/3.6.8
File hashes
Algorithm | Hash digest | |
---|---|---|
SHA256 | f96142c987143dfb78e73cc210f67ed40bc97a1c536ebbc1c3f0f2a3c1b3e7f4 |
|
MD5 | fcea90e58025148d79fecef58a42d3bb |
|
BLAKE2b-256 | 21a82d3b2f0032f532ad92f190e8a0c71e55f3af57195808c25845fea352697a |
File details
Details for the file ropy-0.3.7-cp36-cp36m-manylinux2010_x86_64.whl
.
File metadata
- Download URL: ropy-0.3.7-cp36-cp36m-manylinux2010_x86_64.whl
- Upload date:
- Size: 15.8 MB
- Tags: CPython 3.6m, manylinux: glibc 2.12+ x86-64
- Uploaded using Trusted Publishing? No
- Uploaded via: twine/3.2.0 pkginfo/1.5.0.1 requests/2.24.0 setuptools/50.1.0 requests-toolbelt/0.9.1 tqdm/4.48.2 CPython/3.7.9
File hashes
Algorithm | Hash digest | |
---|---|---|
SHA256 | 344d180e5b165149d6c849a13f71fb889bbda0cc34352078970dc5a3f3a18e93 |
|
MD5 | e34f67899eb6e265670efb327c4366b3 |
|
BLAKE2b-256 | 4e681b6d622bc0a3ad647e62a39777d54edbf78a8ae8256ccc903f1d18b18edb |
File details
Details for the file ropy-0.3.7-cp36-cp36m-manylinux1_x86_64.whl
.
File metadata
- Download URL: ropy-0.3.7-cp36-cp36m-manylinux1_x86_64.whl
- Upload date:
- Size: 15.8 MB
- Tags: CPython 3.6m
- Uploaded using Trusted Publishing? No
- Uploaded via: twine/3.2.0 pkginfo/1.5.0.1 requests/2.24.0 setuptools/50.1.0 requests-toolbelt/0.9.1 tqdm/4.48.2 CPython/3.7.9
File hashes
Algorithm | Hash digest | |
---|---|---|
SHA256 | b79e93f2cfb7ab4a89003d87552a069487b047dfbc8c30f3e11ffc174453b2ea |
|
MD5 | 8bf88bb55a6d0337487f6776e338bb00 |
|
BLAKE2b-256 | 507381ae95fe095bb84c2aea014308e79e1ba7ae0f0b665b3210a2c0661d3403 |
File details
Details for the file ropy-0.3.7-cp36-cp36m-macosx_10_14_x86_64.whl
.
File metadata
- Download URL: ropy-0.3.7-cp36-cp36m-macosx_10_14_x86_64.whl
- Upload date:
- Size: 15.8 MB
- Tags: CPython 3.6m, macOS 10.14+ x86-64
- Uploaded using Trusted Publishing? No
- Uploaded via: twine/3.2.0 pkginfo/1.5.0.1 requests/2.24.0 setuptools/50.1.0 requests-toolbelt/0.9.1 tqdm/4.48.2 CPython/3.6.12
File hashes
Algorithm | Hash digest | |
---|---|---|
SHA256 | 6e517665ca98b621b6bcb26ed82ae5a12483a5cc569217b263c7b41498821b5e |
|
MD5 | b8db21fd3cc050d63b54ae9a4852f9fa |
|
BLAKE2b-256 | bfa6074105433bb1726f81a23d22069149974b7aedceba10bba5f7697d73d3d8 |
File details
Details for the file ropy-0.3.7-cp35-cp35m-win_amd64.whl
.
File metadata
- Download URL: ropy-0.3.7-cp35-cp35m-win_amd64.whl
- Upload date:
- Size: 15.8 MB
- Tags: CPython 3.5m, Windows x86-64
- Uploaded using Trusted Publishing? No
- Uploaded via: twine/1.15.0 pkginfo/1.5.0.1 requests/2.24.0 setuptools/50.1.0 requests-toolbelt/0.9.1 tqdm/4.48.2 CPython/3.5.4
File hashes
Algorithm | Hash digest | |
---|---|---|
SHA256 | 7f036252fed6d442ae0e274a46bcfd37e1a0f6fffb6ef318a496069fae0154a4 |
|
MD5 | 2882d6efa896455d5ab39e58b52739e3 |
|
BLAKE2b-256 | 8b08ae8c1e3563dc0e5df47a8c3b9077055901a2bdc1351d52f7198a7c20e631 |
File details
Details for the file ropy-0.3.7-cp35-cp35m-manylinux2010_x86_64.whl
.
File metadata
- Download URL: ropy-0.3.7-cp35-cp35m-manylinux2010_x86_64.whl
- Upload date:
- Size: 15.8 MB
- Tags: CPython 3.5m, manylinux: glibc 2.12+ x86-64
- Uploaded using Trusted Publishing? No
- Uploaded via: twine/3.2.0 pkginfo/1.5.0.1 requests/2.24.0 setuptools/50.1.0 requests-toolbelt/0.9.1 tqdm/4.48.2 CPython/3.7.9
File hashes
Algorithm | Hash digest | |
---|---|---|
SHA256 | c277e635916856e16aa917637d603736507ec5114bc2d1dc9919484b1b42cd34 |
|
MD5 | 0b1d8f70b1b94e8edf4037e161412f1e |
|
BLAKE2b-256 | 6d64a04584cf7122595f6320ab97096b0a0c0ad574b6f528b9d1c694b39631a7 |
File details
Details for the file ropy-0.3.7-cp35-cp35m-manylinux1_x86_64.whl
.
File metadata
- Download URL: ropy-0.3.7-cp35-cp35m-manylinux1_x86_64.whl
- Upload date:
- Size: 15.8 MB
- Tags: CPython 3.5m
- Uploaded using Trusted Publishing? No
- Uploaded via: twine/3.2.0 pkginfo/1.5.0.1 requests/2.24.0 setuptools/50.1.0 requests-toolbelt/0.9.1 tqdm/4.48.2 CPython/3.7.9
File hashes
Algorithm | Hash digest | |
---|---|---|
SHA256 | 94d145eee67538c38081b1e2ea1667737e0d45604f0d78cb1715aeb13e157b17 |
|
MD5 | cb90be35125a4779b01dfc0775b15037 |
|
BLAKE2b-256 | ff29b08b46447da0556a8bdadba8e5f02131dbb8550732624a858ff482d46a22 |
File details
Details for the file ropy-0.3.7-cp35-cp35m-macosx_10_14_x86_64.whl
.
File metadata
- Download URL: ropy-0.3.7-cp35-cp35m-macosx_10_14_x86_64.whl
- Upload date:
- Size: 15.8 MB
- Tags: CPython 3.5m, macOS 10.14+ x86-64
- Uploaded using Trusted Publishing? No
- Uploaded via: twine/1.15.0 pkginfo/1.5.0.1 requests/2.24.0 setuptools/50.1.0 requests-toolbelt/0.9.1 tqdm/4.48.2 CPython/3.5.9
File hashes
Algorithm | Hash digest | |
---|---|---|
SHA256 | f189e9d8975f189b67136837e74f39d328ad03a01e70daedaa79943cdbcba73d |
|
MD5 | 66d5e330dd8c527cbabcbf6feb5864e5 |
|
BLAKE2b-256 | 01cdb55eaf12bf0a752f89172204d0e5f763a58870a89b39cf9daa27eb94a1fb |