File tree Expand file tree Collapse file tree 3 files changed +18
-11
lines changed
Expand file tree Collapse file tree 3 files changed +18
-11
lines changed Original file line number Diff line number Diff line change 1313panda = rp .models .Panda ()
1414panda .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
1818arrived = False
1919env .add (panda )
2222
2323while 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
Original file line number Diff line number Diff line change 3232n = 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
3737arrived = False
3838
3939while 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
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
Original file line number Diff line number Diff line change 88import numpy as np
99import 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()
You can’t perform that action at this time.
0 commit comments