ropy
A robotics library for Python
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
panda = rp.Panda()
q0 = np.array([0, -1.57, -1.57, 1.57, 0, -1.57, 1.57])
panda.q = q0
panda.fkine(q0)
panda.fkine()
panda.jacob0(q0)
panda.jacob0()
panda.manipulability(q0)
panda.manipulability()
panda.hessian0(q0)
panda.hessian0()
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
panda = rp.Panda()
panda.q = np.array([0, -3, 0, -2.3, 0, 2, 0])
wTe = panda.fkine()
wTep = wTe * sm.SE3.Tx(0.2)
Y = 0.005
Q = Y * np.eye(7)
arrived = False
while not arrived:
panda.q = np.array([0, -3, 0, -2.3, 0, 2, 0])
v, arrived = rp.p_servo(wTe, wTep)
Aeq = panda.jacobe()
beq = v.reshape((6,))
c = -panda.jacobm().reshape((7,))
dq = qp.solve_qp(Q, c, None, None, Aeq, beq)
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
panda = rp.Panda()
panda.q = np.array([0, -3, 0, -2.3, 0, 2, 0])
wTe = panda.fkine()
wTep = wTe * sm.SE3.Tx(0.2)
arrived = False
while not arrived:
panda.q = np.array([0, -3, 0, -2.3, 0, 2, 0])
v, arrived = rp.p_servo(wTe, wTep)
dq = np.linalg.pinv(panda.jacobe()) @ v