Skip to content

Commit efa1cd0

Browse files
committed
fix example
1 parent 81dc874 commit efa1cd0

File tree

1 file changed

+7
-6
lines changed

1 file changed

+7
-6
lines changed

roboticstoolbox/examples/mexican-wave.py

Lines changed: 7 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -9,25 +9,26 @@
99
import numpy as np
1010
from spatialmath import SE3
1111
import roboticstoolbox as rtb
12-
from roboticstoolbox.backends.swift import Swift
12+
from swift import Swift
1313
import time
1414

15-
swift = Swift()
16-
swift.launch()
15+
env = Swift()
16+
env.launch()
1717

18-
puma0 = rtb.models.URDF.Puma560()
18+
puma0 = rtb.models.Puma560()
1919
pumas = []
2020
num_robots = 15
2121
rotation = 2 * np.pi * ((num_robots - 1) / num_robots)
2222

23+
2324
for theta in np.linspace(0, rotation, num_robots):
2425
base = SE3.Rz(theta) * SE3(2, 0, 0)
2526

2627
# Clone the robot
2728
puma = rtb.ERobot(puma0)
2829
puma.base = base
2930
puma.q = puma0.qz
30-
swift.add(puma)
31+
env.add(puma)
3132
pumas.append(puma)
3233

3334
# The wave is a Gaussian that moves around the circle
@@ -46,7 +47,7 @@ def gaussian(x, mu, sig):
4647
k = (t + i * 10) % len(tt)
4748
puma.q = np.r_[0, g[k], -g[k], 0, 0, 0]
4849

49-
swift.step(0)
50+
env.step(0)
5051
time.sleep(0.001)
5152

5253
t += 1

0 commit comments

Comments
 (0)
pFad - Phonifier reborn

Pfad - The Proxy pFad of © 2024 Garber Painting. All rights reserved.

Note: This service is not intended for secure transactions such as banking, social media, email, or purchasing. Use at your own risk. We assume no liability whatsoever for broken pages.


Alternative Proxies:

Alternative Proxy

pFad Proxy

pFad v3 Proxy

pFad v4 Proxy