Skip to content

Commit

Permalink
temp update for 3d twist
Browse files Browse the repository at this point in the history
  • Loading branch information
hanruihua committed Dec 17, 2024
1 parent 8f813db commit 68c5e6e
Showing 1 changed file with 15 additions and 1 deletion.
16 changes: 15 additions & 1 deletion irsim/lib/algorithm/kinematics.py
Original file line number Diff line number Diff line change
Expand Up @@ -149,7 +149,8 @@ def rigid3d_kinematics(state, velocity, step_time, noise, alpha):

assert velocity.shape[0] >= 6 and state.shape[0] >= 6

current_HT = state_to_homo_trans(state[:3], state[3:])
state_HT = state_to_homo_trans(state[:3], state[3:])
vel_HT = twist_to_homo_trans(velocity, step_time)



Expand Down Expand Up @@ -178,6 +179,19 @@ def state_to_homo_trans(position, euler_angles):

return T

def twist_to_homo_trans(twist, dt):

"""
Convert a twist to a transformation matrix over time dt.
twist: [v_x, v_y, v_z, omega_x, omega_y, omega_z]
dt: time step
"""









0 comments on commit 68c5e6e

Please sign in to comment.