UM-ARM-Lab / pytorch_kinematics

Robot kinematics implemented in pytorch
MIT License
394 stars 34 forks source link

Parallelize fk for build_chain_from_urdf chain #7

Closed prajwalthakur closed 1 year ago

prajwalthakur commented 2 years ago

This function has not been modified for running N batch : https://github.com/UM-ARM-Lab/pytorch_kinematics/blob/d54d034ecbb4e5255b942d53611d972ce56bb0d6/pytorch_kinematics/chain.py#L94 so if I run this script , it will give me error; ` import torch import pytorch_kinematics as pk

d = "cuda" if torch.cuda.is_available() else "cpu" dtype = torch.float64

chain = pk.build_chain_from_urdf(open("kuka_iiwa.urdf").read()) chain = chain.to(dtype=dtype, device=d)

N = 1000 th_batch = torch.rand(N, len(chain.get_joint_parameter_names()), dtype=dtype, device=d) tg_batch = chain.forward_kinematics(th_batch) `

LemonPi commented 1 year ago

Hi, are you still experiencing this issue? I just tested it and didn't have any problems so I'm going to close the issue for now.