mirror of
https://github.com/wassname/pyrobolearn.git
synced 2026-09-12 12:41:06 +08:00
few corrections
This commit is contained in:
@@ -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
|
||||
|
||||
@@ -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
|
||||
|
||||
@@ -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)
|
||||
|
||||
Reference in New Issue
Block a user