Open giuli13 opened 2 years ago
Thanks for the bug report! Can you paste a copy of the code you're running that's leading to the seg-fault, so I can reproduce the issue?
smpl_skel = nimble.dynamics.Skeleton()
Pelvis, PelvisNode = smpl_skel.createTranslationalJointAndBodyNodePair()
LHip, LHipNode = smpl_skel.createTranslationalJointAndBodyNodePair()
RHip, RHipNode = smpl_skel.createTranslationalJointAndBodyNodePair()
Spine1, Spine1Node = smpl_skel.createTranslationalJointAndBodyNodePair()
LKnee, LKneeNode =smpl_skel.createTranslationalJointAndBodyNodePair()
RKnee, RKneeNode = smpl_skel.createTranslationalJointAndBodyNodePair()
Spine2, Spine2Node = smpl_skel.createTranslationalJointAndBodyNodePair()
LAnkle, LAnkleNode = smpl_skel.createTranslationalJointAndBodyNodePair()
RAnkle, RAnkleNode = smpl_skel.createTranslationalJointAndBodyNodePair()
Spine3, Spine3Node = smpl_skel.createTranslationalJointAndBodyNodePair()
LFoot, LFootNode = smpl_skel.createTranslationalJointAndBodyNodePair()
RFoot, RFootNode = smpl_skel.createTranslationalJointAndBodyNodePair()
Neck, NeckNode = smpl_skel.createTranslationalJointAndBodyNodePair()
LCollar, LCollarNode = smpl_skel.createTranslationalJointAndBodyNodePair()
RCollar, RCollarNode = smpl_skel.createTranslationalJointAndBodyNodePair()
Jaw, JawNode = smpl_skel.createTranslationalJointAndBodyNodePair()
LShoulder, LShoulderNode = smpl_skel.createTranslationalJointAndBodyNodePair()
RShoulder, RShoulderNode = smpl_skel.createTranslationalJointAndBodyNodePair()
LElbow, LElbowNode = smpl_skel.createTranslationalJointAndBodyNodePair()
RElbow, RElbowNode = smpl_skel.createTranslationalJointAndBodyNodePair()
LWrist, LWristNode = smpl_skel.createTranslationalJointAndBodyNodePair()
RWrist, RWristNode = smpl_skel.createTranslationalJointAndBodyNodePair()
LHand, LHandNode = smpl_skel.createTranslationalJointAndBodyNodePair()
RHand, RHandNode = smpl_skel.createTranslationalJointAndBodyNodePair()
smpl_Node = [PelvisNode, LHipNode, RHipNode, Spine1Node, LKneeNode, RKneeNode, Spine2Node, LAnkleNode, RAnkleNode, Spine3Node, LFootNode, RFootNode, NeckNode, LCollarNode, RCollarNode,
JawNode, LShoulderNode, RShoulderNode, LElbowNode, RElbowNode, LHandNode, RHandNode]
smpl_bones = [Pelvis, LHip, RHip, Spine1, LKnee, RKnee, Spine2, LAnkle, RAnkle, Spine3, LFoot, RFoot, Neck, LCollar, RCollar,
Jaw, LShoulder, RShoulder, LElbow, RElbow, LHand, RHand]
for bone in smpl_bones:
bone.setName(str(bone))
panoptic_skel = nimble.dynamics.Skeleton()
Neck, NeckNode = panoptic_skel.createTranslationalJointAndBodyNodePair()
Nose, NoseNode = panoptic_skel.createTranslationalJointAndBodyNodePair()
Pelvis, PelvisNode = panoptic_skel.createTranslationalJointAndBodyNodePair()
LShoulder, LShoulderNode = panoptic_skel.createTranslationalJointAndBodyNodePair()
LElbow, LElbowNode = panoptic_skel.createTranslationalJointAndBodyNodePair()
LWrist, LWristNode = panoptic_skel.createTranslationalJointAndBodyNodePair()
LHip, LHipNode = panoptic_skel.createTranslationalJointAndBodyNodePair()
LKnee, LKneeNode = panoptic_skel.createTranslationalJointAndBodyNodePair()
LAnkle, LAnkleNode = panoptic_skel.createTranslationalJointAndBodyNodePair()
RShoulder, RShoulderNode = panoptic_skel.createTranslationalJointAndBodyNodePair()
RElbow, RElbowNode = panoptic_skel.createTranslationalJointAndBodyNodePair()
RWrist, RWristNode = panoptic_skel.createTranslationalJointAndBodyNodePair()
RHip, RHipNode = panoptic_skel.createTranslationalJointAndBodyNodePair()
RKnee, RKneeNode = panoptic_skel.createTranslationalJointAndBodyNodePair()
RAnkle, RAnkleNode = panoptic_skel.createTranslationalJointAndBodyNodePair()
LEye, LEyeNode = panoptic_skel.createTranslationalJointAndBodyNodePair()
LEar, LEarNode = panoptic_skel.createTranslationalJointAndBodyNodePair()
REye, REyeNode = panoptic_skel.createTranslationalJointAndBodyNodePair()
REar, REarNode = panoptic_skel.createTranslationalJointAndBodyNodePair()
panoptic_Node = [NeckNode, NoseNode, PelvisNode, LShoulderNode, LElbowNode, LWristNode, LHipNode, LKneeNode, LAnkleNode, RShoulderNode,
RElbowNode,RWristNode, RHipNode, RKneeNode, RAnkleNode, LEyeNode, LEarNode, REyeNode, REarNode]
panoptic_bones = [Neck, Nose, Pelvis, LShoulder, LElbow, LWrist, LHip, LKnee, LAnkle, RShoulder,
RElbow,RWrist, RHip, RKnee, RAnkle, LEye, LEar, REye, REar]
for bone in panoptic_bones:
bone.setName(str(bone))
panoptic_poses = np.empty(shape=(57,300))
for idx in range(300):
panoptic_initial_position = joints_extraction_panoptic(idx+300)
panoptic_initial_position = scaler.fit_transform(panoptic_initial_position)
panoptic_poses[:,idx] = panoptic_initial_position.flatten()
smpl_poses = np.empty(shape=(72,300))
for idx in range(300):
smpl_initial_position = joints_extraction_smpl(idx)
smpl_initial_position = scaler.fit_transform(smpl_initial_position)
smpl_poses[:,idx] = smpl_initial_position.flatten()
joints_panoptic = np.empty(shape=(57,1))
joints_smpl = np.empty(shape=(72,1))
for i in range(1):
panoptic_skel.fitJointsToWorldPositions(panoptic_bones, panoptic_poses[:,i])
joints_panoptic[:,i] = panoptic_skel.getPositions()
smpl_skel.fitJointsToWorldPositions(smpl_bones, smpl_poses[:,i])
joints_smpl[:,i] = smpl_skel.getPositions()
print("Panoptic Skel Pos :", panoptic_skel.getPositions())
print("Panoptic Joints: ",joints_panoptic[:,i])
print("SMPL Skel Pos :", smpl_skel.getPositions())
print("SMPL Joints: ",joints_smpl[:,i])
converter: nimble.biomechanics.SkeletonConverter = nimble.biomechanics.SkeletonConverter(smpl_skel, panoptic_skel)
converter.linkJoints(smpl_skel.getJoint("LShoulder"), panoptic_skel.getJoint("LShoulder"))
converter.linkJoints(smpl_skel.getJoint("RShoulder"), panoptic_skel.getJoint("RShoulder"))
converter.linkJoints(smpl_skel.getJoint("RElbow"), panoptic_skel.getJoint("RElbow"))
converter.linkJoints(smpl_skel.getJoint("LElbow"), panoptic_skel.getJoint("LElbow"))
converter.linkJoints(smpl_skel.getJoint("RWrist"), panoptic_skel.getJoint("RWrist"))
converter.linkJoints(smpl_skel.getJoint("LWrist"), panoptic_skel.getJoint("LWrist"))
converter.linkJoints(smpl_skel.getJoint("RKnee"), panoptic_skel.getJoint("RKnee"))
converter.linkJoints(smpl_skel.getJoint("LKnee"), panoptic_skel.getJoint("LKnee"))
converter.linkJoints(smpl_skel.getJoint("LAnkle"), panoptic_skel.getJoint("LAnkle"))
converter.linkJoints(smpl_skel.getJoint("RAnkle"), panoptic_skel.getJoint("RAnkle"))
converter.rescaleAndPrepTarget()
mySkeletonPoses = converter.convertMotion(joints_panoptic, logProgress=True)`
Hi! I am having troubles with the convertion between skeleton types. After creating two skeletons with different number (and order) of joints, I followed the docs creating a converter between the two skeletons. However, when Python executes the code's row
converter.rescaleAndPrepTarget()
, it crashes and gives me the error "segmentation fault (core dumped)".