PHC
PHC copied to clipboard
fit_smpl_motion.py work not well at arms singularity pose
@ZhengyiLuo Hello,When use retarget the current retargeting code I foud that fit_smpl_motion.py cannot handle the situation wherearms at singularity pose well. In this case, the jnt vel(rad/s) suddenly changes.
Can you optimize the code in fit_smpl_motion.py to handle situations where the joint speed suddenly increases in singular poses, such as when the joints are collinear? For example, when a 7-degree-of-freedom robotic arm is raised sideways, the joint speed suddenly increases, and the joint angles change significantly. I tried modifying the code, but it didn't have any effect.
I try to add jnt vel cost ,but it looks like not affect the arms behavior at singularity pose,
here is the reltated code where I add jnt vel cost in fit_smpl_motion.py
dof_pos_new_diff = (dof_pos_new.data[:,1:,:,:] - dof_pos_new.data[:,:-1,:,:])
print('dof_pos_new_diff:', dof_pos_new_diff)
loss_vel = (dof_pos_new_diff/0.0333).norm(dim = -1).mean()
loss_g = diff.norm(dim = -1).mean() + 0.01 * torch.mean(torch.square(dof_pos_new))
loss = loss_g + 100 * loss_vel #add velocity loss
print('loss_g:', loss_g)
print('loss:', loss)
optimizer.zero_grad()
loss.backward()
optimizer.step()
I use the dataset 0-DanceDB_20120807_CliodelaVara_Clio_Haniotikos_C3D_poses test the retarget Could you please have a look at this question about how to optimize the fit motion at arms singularity pose to prevent jnt's vel suddenly increases