stack-of-tasks / pinocchio

A fast and flexible implementation of Rigid Body Dynamics algorithms and their analytical derivatives
http://stack-of-tasks.github.io/pinocchio/
BSD 2-Clause "Simplified" License
1.7k stars 366 forks source link

AttributeError: module 'pinocchio' has no attribute 'buildModelFromUrdf' #2180

Closed RitishShailly closed 4 months ago

RitishShailly commented 4 months ago

Is 'buildModelFromUrdf' feature deprecated? If so, are there any alternatives I can use?

I am using this code:

import pinocchio as pin
import numpy as np

model = pin.buildModelFromUrdf('~/home/rshailly/Documents/ur10_urdf.urdf')
data = model.createData()

# Specify joint configuration
q = pin.neutral(model)

# Compute Jacobian at the end-effector
frame_id = model.getFrameId('tool0')  # Adjust as needed
J = pin.computeFrameJacobian(model, data, q, frame_id)

# Compute pseudo-inverse of Jacobian
pseudo_inverse_J = np.linalg.pinv(J)

and I am getting this error: image

fabinsch commented 4 months ago

Hi @RitishShailly , this function should be available. How did you install pinocchio and which version do you have now ?

You could maybe check your conda or pip list or just do in python:

import pinocchio
print(pinocchio.__version__)