Skip to content

Commit

Permalink
Fixed small bug with forward kinematics
Browse files Browse the repository at this point in the history
  • Loading branch information
ricburli committed Jun 28, 2024
1 parent 1ae5426 commit b33dd38
Show file tree
Hide file tree
Showing 2 changed files with 2 additions and 3 deletions.
3 changes: 1 addition & 2 deletions invariants_py/kinematics/robot_forward_kinematics.py
Original file line number Diff line number Diff line change
Expand Up @@ -9,13 +9,12 @@
from invariants_py.kinematics.rigidbody_kinematics import rotate_z
from math import pi

def robot_forward_kinematics(q, path_to_urdf, root = 'base_link', tip = 'tool0'):
def robot_forward_kinematics(q, path_to_urdf, root = 'world', tip = 'tool0'):
ur10 = u2c.URDFparser()
ur10.from_file(path_to_urdf)
fk_dict = ur10.get_forward_kinematics(root, tip)
robot_forward_kinematics = fk_dict["T_fk"]
T_rob = robot_forward_kinematics(q.T)
T_rob = rotate_z(pi) @ T_rob
p_obj = T_rob[:3,3]
R_obj = T_rob[:3,:3]

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -87,7 +87,7 @@ def inv_kin(q_init, q_joint_lim, des_p_obj, des_R_obj, path_to_urdf, root = 'bas
trajectory,time = dh.read_pose_trajectory_from_txt(data_location)
pose,time_profile,arclength,nb_samples,stepsize = reparam.reparameterize_trajectory_arclength(trajectory)
N = 100
root_link_name = "base_link"
root_link_name = "world"
tip_link_name = "TCP_frame"
path_to_urdf = dh.find_data_path('robot/ur10.urdf')
startpos = [0.3056, 0.0635, 0.441]
Expand Down

0 comments on commit b33dd38

Please sign in to comment.