You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
I recently started using Pinocchio and am interested in building a reduced model for a single arm of a Baxter robot.
I followed the example in the wiki. But, I get the following error: ValueError: Several frames match the filter - please specify the FrameType
Here is a minimum working example of my code:
import pinocchio as pin
import numpy as np
# Build the model
pinocchio_model_dir = "./models/"
mesh_dir = pinocchio_model_dir
urdf_filename = ("./baxter.urdf")
# Load the urdf model
model, collision_model, visual_model = pin.buildModelsFromUrdf(urdf_filename, mesh_dir)
# Build the reduced model
relevantJoints = ['right_s0',
'right_s1',
'right_e0',
'right_e1',
'right_w0',
'right_w1',
'right_w2']
jointsToLockIDs = []
initialJointConfig = np.array([0, #head
0, 0,0, 0.1,0,0,0, # Left arm
0, 0,0, 0.1,0,0,0 ])# Right arm
for name in model.names:
if not name in relevantJoints:
if model.existJointName(name):
jointsToLockIDs.append(model.getFrameId(name))
else:
print('Warning: joint ' + str(name) + ' does not belong to the model!')
model_reduced = pin.buildReducedModel(model, visual_model, jointsToLockIDs, initialJointConfig)
I haven't looked at your URDF file in detail, but it's probably because some names of joint in the URDF are same as some names of link. You need to check the urdf in detail.
In case anyone else has the same issue, I changed the joint names of the following joints by adding the suffix "_fixed": head_camera, right_hand, right_hand_camera, right_hand_camera_axis, right_hand_range, right_hand_accelerometer, right_gripper_base, left_hand, left_hand_camera, left_hand_camera_axis, left_hand_range, left_hand_accelerometer, left_gripper_base.
My modified URDF file can be found on my fork of the Rethink SDK.
I can reproduce the issue from the discussion below using this minimal example:
It seems related to the Baxter description (if we replace
baxter_description
with e.g.upkie_description
, thenbuildReducedModel
returns normally).Discussed in #2311
Originally posted by maymohan July 2, 2024
Hello,
I recently started using Pinocchio and am interested in building a reduced model for a single arm of a Baxter robot.
I followed the example in the wiki. But, I get the following error:
ValueError: Several frames match the filter - please specify the FrameType
Here is a minimum working example of my code:
Here is Baxter's URDF.
I looked around quite a bit and could not find anyway to resolve the issue. I would appreciate any help in resolving the issue.
Please let me know if I can provide any other information. Thank you for your help!
The text was updated successfully, but these errors were encountered: