Skip to content

How to solve forward kinematics for a robot arm whose base is not at the origin of the robot ? #2074

Closed Answered by jorisv
threedee003 asked this question in Q&A
Discussion options

You must be logged in to vote

You can add the following code at the end your file to see all the transformations between universe and the end effector :

model = ik_solver.reduced_model
data = ik_solver.model_data
end_effector_id = ik_solver.id_end_effector

id = end_effector_id
# store frame name and transformation in reverse order since the end effector
frame_transform = []
while True:
    frame = model.frames[id]
    previous_frame = frame.previousFrame
    frame_transform.append((frame.name, data.oMf[id]))
    if id == previous_frame:
        break
    id = previous_frame

# Display frame from universe to end effector
for ft in reversed(frame_transform):
    print(f"frame: {ft[0]}")
    print(f"transform: {ft[1]}")

T…

Replies: 2 comments 5 replies

Comment options

You must be logged in to vote
0 replies
Comment options

You must be logged in to vote
5 replies
@jorisv
Comment options

Answer selected by threedee003
@threedee003
Comment options

@jorisv
Comment options

@threedee003
Comment options

@jorisv
Comment options

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Category
Q&A
Labels
None yet
2 participants