few corrections

This commit is contained in:
Brian Delhaisse
2019-08-24 03:43:39 +02:00
parent 8c2516d169
commit b1cfa487dc
9 changed files with 78 additions and 18 deletions
@@ -22,6 +22,7 @@ robot = prl.robots.RRBot(sim)
robot.disable_motor() # disable motors; comment the `robot.set_joint_torques(torques)` to see what happens
robot.print_info()
robot.change_transparency()
world.load_robot(robot)
# define variables
link_id = robot.get_link_ids('hokuyo_link') # the link we are interested to
@@ -22,6 +22,7 @@ robot = prl.robots.RRBot(sim)
robot.disable_motor() # disable motors; comment the `robot.set_joint_torques(torques)` to see what happens
robot.print_info()
robot.change_transparency()
world.load_robot(robot)
# run simulator
+1
View File
@@ -22,6 +22,7 @@ robot = prl.robots.RRBot(sim)
robot.disable_motor() # disable motors
robot.print_info()
robot.change_transparency()
world.load_robot(robot)
# run simulator
+2 -2
View File
@@ -19,6 +19,7 @@ world = BasicWorld(sim)
# create robot
robot = KukaIIWA(sim)
robot.print_info()
world.load_robot(robot)
# define useful variables for IK
dt = 1./240
@@ -61,7 +62,7 @@ for t in count():
else:
J = robot.get_linear_jacobian(link_id, q=q)[:, qIdx]
# Pseudo-inverse
# Pseudo-inverse: \hat{J} = J^T (JJ^T + k^2 I)^{-1}
Jp = robot.get_damped_least_squares_inverse(J, damping)
# evaluate damped-least-squares IK
@@ -72,5 +73,4 @@ for t in count():
robot.set_joint_positions(q, joint_ids=joint_ids)
# step in simulation
robot.step()
world.step(sleep_dt=dt)