8000 Merged itorque and ospace into dynamics.py · ljthink/robotics-toolbox-python@708f43b · GitHub
[go: up one dir, main page]

Skip to content

Commit 708f43b

Browse files
committed
Merged itorque and ospace into dynamics.py
Added new author/credits line to each file. Removed some obsolete files.
1 parent 1060dec commit 708f43b

21 files changed

+220
-366
lines changed

robotics-toolbox-python/robot/Link.py

Lines changed: 6 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,8 +1,12 @@
11
"""
22
Link object.
33
4-
@author: Peter Corke
5-
@copyright: Peter Corke
4+
Python implementation by: Luis Fernando Lara Tobar and Peter Corke.
5+
Based on original Robotics Toolbox for Matlab code by Peter Corke.
6+
Permission to use and copy is granted provided that acknowledgement of
7+
the authors is made.
8+
9+
@author: Luis Fernando Lara Tobar and Peter Corke
610
"""
711

812
from numpy import *

robotics-toolbox-python/robot/Quaternion.py

Lines changed: 6 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -1,17 +1,19 @@
11
"""
22
Quaternion class.
33
4-
@author: Peter Corke
5-
@copyright: Peter Corke 1999-2008
4+
Python implementation by: Luis Fernando Lara Tobar and Peter Corke.
5+
Based on original Robotics Toolbox for Matlab code by Peter Corke.
6+
Permission to use and copy is granted provided that acknowledgement of
7+
the authors is made.
8+
9+
@author: Luis Fernando Lara Tobar and Peter Corke
610
"""
711

812
from numpy import *
913
from utility import *
1014
import transform as T
1115
import copy
1216

13-
print "in Quaternion"
14-
1517
# Copyright (C) 1999-2002, by Peter I. Corke
1618

1719
class quaternion:

robotics-toolbox-python/robot/Robot.py

Lines changed: 6 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,8 +1,12 @@
11
"""
22
Robot object.
33
4-
@author: Peter Corke
5-
@copyright: Peter Corke
4+
Python implementation by: Luis Fernando Lara Tobar and Peter Corke.
5+
Based on original Robotics Toolbox for Matlab code by Peter Corke.
6+
Permission to use and copy is granted provided that acknowledgement of
7+
the authors is made.
8+
9+
@author: Luis Fernando Lara Tobar and Peter Corke
610
"""
711

812
from numpy import *

robotics-toolbox-python/robot/demos.py

Lines changed: 0 additions & 34 deletions
This file was deleted.

robotics-toolbox-python/robot/dh.py

Lines changed: 0 additions & 33 deletions
This file was deleted.

robotics-toolbox-python/robot/diff2tr.py

Lines changed: 0 additions & 8 deletions
This file was deleted.

robotics-toolbox-python/robot/dyn.py

Lines changed: 0 additions & 46 deletions
This file was deleted.

robotics-toolbox-python/robot/dynamics.py

Lines changed: 60 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,8 +1,12 @@
11
"""
22
Robot dynamics operations.
33
4-
@author: Peter Corke
5-
@copyright: Peter Corke
4+
Python implementation by: Luis Fernando Lara Tobar and Peter Corke.
5+
Based on original Robotics Toolbox for Matlab code by Peter Corke.
6+
Permission to use and copy is granted provided that acknowledgement of
7+
the authors is made.
8+
9+
@author: Luis Fernando Lara Tobar and Peter Corke
610
"""
711

812
from numpy import *
@@ -174,6 +178,60 @@ def gravload(robot, q, gravity=None):
174178
return tg
175179

176180

181+
182+
def itorque(robot, q, qdd):
183+
"""
184+
Compute the manipulator inertia torque
185+
186+
tau = itorque(robot, q, qdd)
187+
188+
Returns the n-element inertia torque vector at the specified pose and
189+
acceleration, that is,
190+
191+
taui = inertia(q)*qdd
192+
193+
C{robot} describes the manipulator dynamics and kinematics.
194+
If C{q} and C{qdd} are row vectors, the result is a row vector of joint
195+
torques.
196+
If C{q} and C{qdd} are matrices, each row is interpretted as a joint state
197+
vector, and the result is a matrix each row being the corresponding joint
198+
torques.
199+
200+
If C{robot} contains non-zero motor inertia then this will included in the
201+
result.
202+
203+
@see: rne, coriolis, inertia, gravload.
204+
"""
205+
206+
return rne(robot, q, zeros(shape(q)), qdd, [[0],[0],[0]])
207+
208+
209+
210+
def ospace(robot, q, qd):
211+
"""
212+
Return Operational Space dynamic matrices
213+
214+
(Lambda, mu, p) = ospace(robot, q, qd)
215+
@see: rne
216+
@bug: not tested
217+
"""
218+
q = mat(q)
219+
qd = mat(qd)
220+
M = inertia(robot, q)
221+
C = coriolis(robot, q, qd)
222+
g = gravload(robot, q)
223+
J = jacob0(robot, q)
224+
Ji = inv(J)
225+
print 'Ji\n',Ji,'\n\n'
226+
print 'J\n',J,'\n\n'
227+
print 'M\n',M,'\n\n'
228+
print 'C\n',C,'\n\n'
229+
print 'g\n',g,'\n\n'
230+
Lambda = Ji.T*M*Ji
231+
mu = J.T*C - Lamba*H*qd
232+
p = J.T*g
233+
return Lambda, mu, p
234+
177235
def rne(robot, *args, **options):
178236
"""
179237
Compute inverse dynamics via recursive Newton-Euler formulation.

robotics-toolbox-python/robot/gravload.py

Lines changed: 0 additions & 37 deletions
This file was deleted.

robotics-toolbox-python/robot/itorque.py

Lines changed: 0 additions & 36 deletions
This file was deleted.

robotics-toolbox-python/robot/jacobian.py

Lines changed: 6 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,8 +1,12 @@
11
"""
22
Jacobian matrix operations.
33
4-
@author: Peter Corke
5-
@copyright: Peter Corke
4+
Python implementation by: Luis Fernando Lara Tobar and Peter Corke.
5+
Based on original Robotics Toolbox for Matlab code by Peter Corke.
6+
Permission to use and copy is granted provided that acknowledgement of
7+
the authors is made.
8+
9+
@author: Luis Fernando Lara Tobar and Peter Corke
610
"""
711

812
from numpy import *

robotics-toolbox-python/robot/kinematics.py

Lines changed: 6 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,8 +1,12 @@
11
"""
22
Robot kinematic operations.
33
4-
@author: Peter Corke
5-
@copyright: Peter Corke
4+
Python implementation by: Luis Fernando Lara Tobar and Peter Corke.
5+
Based on original Robotics Toolbox for Matlab code by Peter Corke.
6+
Permission to use and copy is granted provided that acknowledgement of
7+
the authors is made.
8+
9+
@author: Luis Fernando Lara Tobar and Peter Corke
610
"""
711

812
from numpy import *

robotics-toolbox-python/robot/manipulability.py

Lines changed: 6 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,8 +1,12 @@
11
"""
22
Robot manipulability operations.
33
4-
@author: Peter Corke
5-
@copyright: Peter Corke
4+
Python implementation by: Luis Fernando Lara Tobar and Peter Corke.
5+
Based on original Robotics Toolbox for Matlab code by Peter Corke.
6+
Permission to use and copy is granted provided that acknowledgement of
7+
the authors is made.
8+
9+
@author: Luis Fernando Lara Tobar and Peter Corke
610
"""
711

812

0 commit comments

Comments
 (0)
0