Package: ropy
ropyA robotics library for PythonGitHub repositoryhttps://github.com/jhavl/ropyDocumentationhttps://jhavl.github.io/ropyUsed inJ. Haviland and P. Corke, "Maximising  manipulability  during  resolved-rate  motion control,"arXiv preprint arXiv:2002.11901, 2020.
[arxiv] [project website] [video]InstallingRequires Python ≥ 3.5.gitclonehttps://github.com/jhavl/ropy.gitcdropy
pip3install-e.UsageArm-Type Robotsimportropyasrpimportnumpyasnp# Initialise a Franka-Emika Panda robotpanda=rp.Panda()# Set the joint angles of the robotq0=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 q0panda.fkine(q0)# orpanda.fkine()# Use the robot's attribute q set by panda.q =# Calculate the Kinematic Jacobian (in the world frame) at joint angles q0panda.jacob0(q0)# orpanda.jacob0()# Calculate the manipulability of the robot at joint angles q0panda.manipulability(q0)# orpanda.manipulability()# Calculate the Kinematic Hessian (in the world frame) at joint angles q0panda.hessian0(q0)# orpanda.hessian0()# Print the Elementary Transform Sequence (ETS) of the robotprint(panda)Manipulability Motion Control ExampleThis example implements Manipulability Motion Control fromthis paperwithin a position-based servoing scheme. We use the libraryqpsolversto solve the optimisation function. However, you can use whichever solver you wish.importropyasrpimportnumpyasnpimportspatialmathassmimportqpsolversasqp# Initialise a Franka-Emika Panda Robotpanda=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 robotwTe=panda.fkine()# The desired pose of the robot# = Current pose offset 20cm in the x-axiswTep=wTe*sm.SE3.Tx(0.2)# Gain term (lambda) for control minimisationY=0.005# Quadratic component of objective functionQ=Y*np.eye(7)arrived=Falsewhilenotarrived:# 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 velocityv,arrived=rp.p_servo(wTe,wTep)# Form the equality constraints# The kinematic Jacobian in the end-effecor frameAeq=panda.jacobe()beq=v.reshape((6,))# Linear component of objective function: the manipulability Jacobianc=-panda.jacobm().reshape((7,))# Solve for the joint velocities dqdq=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 ExampleThis example implements resolved-rate motion control within a position-based servoing schemeimportropyasrpimportnumpyasnpimportspatialmathassm# Initialise a Franka-Emika Panda Robotpanda=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 robotwTe=panda.fkine()# The desired pose of the robot# = Current pose offset 20cm in the x-axiswTep=wTe*sm.SE3.Tx(0.2)arrived=Falsewhilenotarrived:# 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 velocityv,arrived=rp.p_servo(wTe,wTep)# Solve for the joint velocities dq# Perfrom the pseudoinverse of the manipulator Jacobian in the end-effector framedq=np.linalg.pinv(panda.jacobe())@v# Send the joint velocities to the robot# eg. ROS messages, PyRep etc.