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:
```
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)
```
Here is [Baxter's URDF](https://github.com/RethinkRobotics/baxter_common/blob/master/baxter_description/urdf/baxter.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!
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 https://github.com/stack-of-tasks/pinocchio/discussions/2311