8000 fix examples · eetuna/robotics-toolbox-python@62cfaf1 · GitHub
[go: up one dir, main page]

Skip to content
8000

Commit 62cfaf1

Browse files
committed
fix examples
1 parent ac9ebc7 commit 62cfaf1

File tree

2 files changed

+14
-14
lines changed

2 files changed

+14
-14
lines changed

roboticstoolbox/examples/holistic_mm_non_holonomic.py

Lines changed: 7 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -12,9 +12,9 @@
1212
import math
1313

1414

15-
def step_robot(r, Tep):
15+
def step_robot(r: rtb.ERobot, Tep):
1616

17-
wTe = r.fkine(r.q, fast=True)
17+
wTe = r.fkine(r.q)
1818

1919
eTep = np.linalg.inv(wTe) @ Tep
2020

@@ -39,7 +39,7 @@ def step_robot(r, Tep):
3939
v[3:] *= 1.3
4040

4141
# The equality contraints
42-
Aeq = np.c_[r.jacobe(r.q, fast=True), np.eye(6)]
42+
Aeq = np.c_[r.jacobe(r.q), np.eye(6)]
4343
beq = v.reshape((6,))
4444

4545
# The inequality constraints for joint limit avoidance
@@ -64,7 +64,7 @@ def step_robot(r, Tep):
6464

6565
# Get base to face end-effector
6666
= 0.5
67-
bTe = r.fkine(r.q, include_base=False, fast=True)
67+
bTe = r.fkine(r.q, include_base=False).A
6868
θε = math.atan2(bTe[1, -1], bTe[0, -1])
6969
ε = * θε
7070
c[0] = -ε
@@ -107,7 +107,7 @@ def step_robot(r, Tep):
107107
wTep.A[:3, :3] = np.diag([-1, 1, -1])
108108
wTep.A[0, -1] -= 4.0
109109
wTep.A[2, -1] -= 0.25
110-
ax_goal.base = wTep
110+
ax_goal.T = wTep
111111
env.step()
112112

113113

@@ -117,8 +117,8 @@ def step_robot(r, Tep):
117117
env.step(dt)
118118

119119
# Reset bases
120-
base_new = frankie.fkine(frankie._q, end=frankie.links[2], fast=True)
121-
frankie._base.A[:] = base_new
120+
base_new = frankie.fkine(frankie._q, end=frankie.links[2])
121+
frankie._T = base_new.A
122122
frankie.q[:2] = 0
123123

124124
env.hold()

roboticstoolbox/examples/holistic_mm_omni.py

Lines changed: 7 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -12,9 +12,9 @@
1212
import math
1313

1414

15-
def step_robot(r, Tep):
15+
def step_robot(r: rtb.ERobot, Tep):
1616

17-
wTe = r.fkine(r.q, fast=True)
17+
wTe = r.fkine(r.q)
1818

1919
eTep = np.linalg.inv(wTe) @ Tep
2020

@@ -39,7 +39,7 @@ def step_robot(r, Tep):
3939
v[3:] *= 1.3
4040

4141
# The equality contraints
42-
Aeq = np.c_[r.jacobe(r.q, fast=True), np.eye(6)]
42+
Aeq = np.c_[r.jacobe(r.q), np.eye(6)]
4343
beq = v.reshape((6,))
4444

4545
# The inequality constraints for joint limit avoidance
@@ -64,7 +64,7 @@ def step_robot(r, Tep):
6464

6565
# Get base to face end-effector
6666
= 0.5
67-
bTe = r.fkine(r.q, include_base=False, fast=True)
67+
bTe = r.fkine(r.q, include_base=False).A
6868
θε = math.atan2(bTe[1, -1], bTe[0, -1])
6969
ε = * θε
7070
c[0] = -ε
@@ -107,7 +107,7 @@ def step_robot(r, Tep):
107107
wTep.A[:3, :3] = np.diag([-1, 1, -1])
108108
wTep.A[0, -1] -= 4.0
109109
wTep.A[2, -1] -= 0.25
110-
ax_goal.base = wTep
110+
ax_goal.T = wTep
111111
env.step()
112112

113113

@@ -117,8 +117,8 @@ def step_robot(r, Tep):
117117
env.step(dt)
118118

119119
# Reset bases
120-
base_new = frankie.fkine(frankie._q, end=frankie.links[3], fast=True)
121-
frankie._base.A[:] = base_new
120+
base_new = frankie.fkine(frankie._q, end=frankie.links[3]).A
121+
frankie._T = base_new
122122
frankie.q[:3] = 0
123123

124124
env.hold()

0 commit comments

Comments
 (0)
0