Skip to content

Commit 8893f19

Browse files
committed
fix other instances of grav
1 parent 17068c5 commit 8893f19

File tree

2 files changed

+7
-10
lines changed

2 files changed

+7
-10
lines changed

roboticstoolbox/robot/Dynamics.py

Lines changed: 6 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -467,7 +467,7 @@ def accel(self, q, qd, torque):
467467
qdI = np.zeros((self.n, self.n))
468468
qddI = np.eye(self.n)
469469

470-
M = self.rne(qI, qdI, qddI, grav=[0, 0, 0])
470+
M = self.rne(qI, qdI, qddI, gravity=[0, 0, 0])
471471

472472
# Compute gravity and coriolis torque torques resulting from zero
473473
# acceleration at given velocity & with gravity acting.
@@ -625,7 +625,7 @@ def jointdynamics(self, q, qd=None):
625625
zero = np.zeros((self.n))
626626
qdd = np.zeros((self.n))
627627
qdd[j] = 1
628-
M = self.rne(q, zero, qdd, grav=[0, 0, 0])
628+
M = self.rne(q, zero, qdd, gravity=[0, 0, 0])
629629
J = link.Jm + M[j] / abs(link.G) ** 2
630630

631631
# compute friction
@@ -738,7 +738,7 @@ def inertia(self, q=None):
738738
(np.c_[qk] @ np.ones((1, self.n))).T,
739739
np.zeros((self.n, self.n)),
740740
np.eye(self.n),
741-
grav=[0, 0, 0])
741+
gravity=[0, 0, 0])
742742

743743
if q.shape[0] == 1:
744744
return In[0, :, :]
@@ -807,7 +807,7 @@ def coriolis(self, q, qd):
807807
QD = np.zeros(self.n)
808808
QD[i] = 1
809809
tau = r1.rne(
810-
qk, QD, np.zeros(self.n), grav=[0, 0, 0])
810+
qk, QD, np.zeros(self.n), gravity=[0, 0, 0])
811811
Csq[k, :, i] = Csq[k, :, i] + tau
812812

813813
# Find the torques that depend on a pair of finite joint speeds,
@@ -821,7 +821,7 @@ def coriolis(self, q, qd):
821821
QD = np.zeros(self.n)
822822
QD[i] = 1
823823
QD[j] = 1
824-
tau = r1.rne(qk, QD, np.zeros(self.n), grav=[0, 0, 0])
824+
tau = r1.rne(qk, QD, np.zeros(self.n), gravity=[0, 0, 0])
825825

826826
C[k, :, j] = C[k, :, j] + \
827827
(tau - Csq[k, :, j] - Csq[k, :, i]) * qdk[i] / 2
@@ -882,7 +882,7 @@ def itorque(self, q, qdd):
882882

883883
for k, (qk, qddk) in enumerate(zip(q, qdd)):
884884
taui[k, :] = self.rne(
885-
qk, np.zeros(self.n), qddk, grav=[0, 0, 0])
885+
qk, np.zeros(self.n), qddk, gravity=[0, 0, 0])
886886

887887
if q.shape[0] == 1:
888888
return taui[0, :]

tests/test_DHRobot.py

Lines changed: 1 addition & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -902,7 +902,7 @@ def test_rne(self):
902902
t1 = puma.rne(puma.qn, z, o)
903903
t2 = puma.rne(puma.qn, o, o)
904904
t3 = puma.rne(puma.qn, o, z)
905-
t4 = puma.rne(puma.qn, o, o, grav=[0, 0, 0])
905+
t4 = puma.rne(puma.qn, o, o, gravity=[0, 0, 0])
906906
t5 = puma.rne(puma.qn, z, z, fext=fext)
907907

908908
nt.assert_array_almost_equal(t0, tr0, decimal=4)
@@ -1028,13 +1028,10 @@ def test_gravload(self):
10281028

10291029
tau0 = puma.gravload(q)
10301030
tau1 = puma.gravload(np.c_[q, q].T)
1031-
tau2 = puma.gravload(q=np.c_[q, q].T, grav=np.c_[grav, grav].T)
10321031

10331032
nt.assert_array_almost_equal(tau0, taur, decimal=4)
10341033
nt.assert_array_almost_equal(tau1[0, :], taur, decimal=4)
10351034
nt.assert_array_almost_equal(tau1[1, :], taur, decimal=4)
1036-
nt.assert_array_almost_equal(tau2[0, :], taur, decimal=4)
1037-
nt.assert_array_almost_equal(tau2[1, :], taur, decimal=4)
10381035

10391036
def test_itorque(self):
10401037
puma = rp.models.DH.Puma560()

0 commit comments

Comments
 (0)