8000 Extracted Swift · hzyjerry/robotics-toolbox-python@f5b53b8 · GitHub
[go: up one dir, main page]

Skip to content
8000

Commit f5b53b8

Browse files
committed
Extracted Swift
1 parent cfa4563 commit f5b53b8

File tree

6 files changed

+64
-1200
lines changed

6 files changed

+64
-1200
lines changed

examples/swift2.py

Lines changed: 11 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -65,7 +65,7 @@
6565
# cProfile.run 8000 ('cc(it)')
6666
# cProfile.run('slow(it)')
6767

68-
from roboticstoolbox.backends import Swift
68+
from roboticstoolbox.backends import swift
6969
from math import pi
7070
import roboticstoolbox as rtb
7171
from spatialmath import SO3, SE3
@@ -80,6 +80,8 @@
8080

8181
from spatialmath.base import r2q
8282

83+
# import swift
84+
8385

8486
# num = 500000
8587
# b = np.random.randn(num)
@@ -108,7 +110,7 @@
108110
# k.base = sm.SE3(0.7, 1, 0) * sm.SE3.Rz(np.pi/2)
109111
# env.add(k)
110112

111-
env = Swift.Swift(_dev=True)
113+
env = swift.Swift(_dev=True)
112114
env.launch()
113115

114116

@@ -125,12 +127,12 @@ def checkcb(e):
125127
# select.value = e
126128

127129

128-
label = Swift.Label('Demo')
129-
slider = Swift.Slider(slidercb, 10, 95, 5, 15, 'slider this is', ' d')
130-
select = Swift.Select(selectcb, 'selec', [
130+
label = swift.Label('Demo')
131+
slider = swift.Slider(slidercb, 10, 95, 5, 15, 'slider this is', ' d')
132+
select = swift.Select(selectcb, 'selec', [
131133
'on', 'tw', 'three'], 2)
132134

133-
check = Swift.Checkbox(checkcb, 'checkbox', [
135+
check = swift.Checkbox(checkcb, 'checkbox', [
134136
'on', 'tw', 'three'], [False, True, True])
135137

136138

@@ -141,15 +143,15 @@ def buttoncb(e):
141143
slider.value = 60
142144

143145

144-
button = Swift.Button(buttoncb, 'button')
146+
button = swift.Button(buttoncb, 'button')
145147

146148

147149
def radiocb(e):
148150
print(e)
149151
select.value = e
150152

151153

152-
radio = Swift.Radio(radiocb, 'radio', [
154+
radio = swift.Radio(radiocb, 'radio', [
153155
'on', 'tw', 'three'], 2)
154156

155157
# env.add(label)
@@ -200,7 +202,7 @@ def stepper():
200202
# env.step(0.001)
201203

202204
# # env.remove(box)
203-
# cProfile.run('stepper()')
205+
cProfile.run('stepper()')
204206

205207
# env._run_thread = False
206208
# env.restart()

0 commit comments

Comments
 (0)
0