UM-ARM-Lab / pytorch_kinematics

Robot kinematics implemented in pytorch

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

Parallelize fk for build_chain_from_urdf chain

prajwalthakur opened this issue · comments

This function has not been modified for running N batch :

def forward_kinematics(self, th, world=tf.Transform3d()):

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)
`

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.