Skip to content

Commit f332027

Browse files
committed
Fixed q
1 parent 13e4e55 commit f332027

File tree

3 files changed

+18
-11
lines changed

3 files changed

+18
-11
lines changed

examples/RRMC_swift.py

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -13,7 +13,7 @@
1313
panda = rp.models.Panda()
1414
panda.q = panda.qr
1515

16-
Tep = panda.fkine() * sm.SE3.Tx(0.2) * sm.SE3.Ty(0.2) * sm.SE3.Tz(0.45)
16+
Tep = panda.fkine(panda.q) * sm.SE3.Tx(0.2) * sm.SE3.Ty(0.2) * sm.SE3.Tz(0.45)
1717

1818
arrived = False
1919
env.add(panda)
@@ -22,8 +22,8 @@
2222

2323
while not arrived:
2424

25-
v, arrived = rp.p_servo(panda.fkine(), Tep, 1)
26-
panda.qd = np.linalg.pinv(panda.jacobe()) @ v
25+
v, arrived = rp.p_servo(panda.fkine(panda.q), Tep, 1)
26+
panda.qd = np.linalg.pinv(panda.jacobe(panda.q)) @ v
2727
env.step(dt)
2828

2929
# Uncomment to stop the browser tab from closing

examples/park.py

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -32,17 +32,17 @@
3232
n = 7
3333

3434
# Set the desired end-effector pose
35-
Tep = panda.fkine() * sm.SE3(0.3, 0.2, 0.3)
35+
Tep = panda.fkine(panda.q) * sm.SE3(0.3, 0.2, 0.3)
3636

3737
arrived = False
3838

3939
while not arrived:
4040

4141
# The pose of the Panda's end-effector
42-
Te = panda.fkine()
42+
Te = panda.fkine(panda.q)
4343

4444
# The manipulator Jacobian in the end-effecotr frame
45-
Je = panda.jacobe()
45+
Je = panda.jacobe(panda.q)
4646

4747
# Calulate the required end-effector spatial velocity for the robot
4848
# to approach the goal. Gain is set to 1.0
@@ -52,7 +52,7 @@
5252
Y = 0.01
5353

5454
# The manipulability Jacobian
55-
Jm = panda.jacobm()
55+
Jm = panda.jacobm(panda.q)
5656

5757
# Project the gradient of manipulability into the null-space of the
5858
# differential kinematics

examples/ros.py

Lines changed: 11 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -8,11 +8,18 @@
88
import numpy as np
99
import os
1010

11-
# Launch the simulator Swift
12-
env = rtb.backends.ROS()
13-
env.launch(ros_master_uri='http://localhost:11311')
11+
env = rtb.backends.Swift()
12+
env.launch()
1413

15-
os.system('rostopic list')
14+
r = rtb.models.UR5()
15+
env.add(r)
16+
env.hold()
17+
18+
# # Launch the simulator Swift
19+
# env = rtb.backends.ROS()
20+
# env.launch(ros_master_uri='http://localhost:11311')
21+
22+
# os.system('rostopic list')
1623

1724
# # Create a Panda robot object
1825
# panda = rtb.models.Panda()

0 commit comments

Comments
 (0)