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
The combination of the mechanical arm dynamic model library written in C++ and python requires numpy, but the python program is written in jax.numpy, and an error will be reported if it is used directly(The location of the error is 'H, C = getModelParams(q, dq)', which is caused by 'pinocchio.forwardKinematics(model, data, q)'). How should I solve it? Thank you !
The version of jax is 0.3.24.
The version of pinocchio(a python library Combining with C++) is 2.3.1.
The code is as follows:
def getModelParams(q, dq):
pinocchio.forwardKinematics(model, data, q)
M = pinocchio.crba(model, data, q)
C = pinocchio.computeCoriolisMatrix(model, data, q, dq)
return M, C,
def prior(q, dq, g_acc=g_acc):
nq = 2
H, C = getModelParams(q, dq)
return H, C
reacted with thumbs up emoji reacted with thumbs down emoji reacted with laugh emoji reacted with hooray emoji reacted with confused emoji reacted with heart emoji reacted with rocket emoji reacted with eyes emoji
-
The combination of the mechanical arm dynamic model library written in C++ and python requires numpy, but the python program is written in jax.numpy, and an error will be reported if it is used directly(The location of the error is 'H, C = getModelParams(q, dq)', which is caused by 'pinocchio.forwardKinematics(model, data, q)'). How should I solve it? Thank you !
The version of jax is 0.3.24.
The version of pinocchio(a python library Combining with C++) is 2.3.1.
The code is as follows:
def getModelParams(q, dq):
pinocchio.forwardKinematics(model, data, q)
M = pinocchio.crba(model, data, q)
C = pinocchio.computeCoriolisMatrix(model, data, q, dq)
return M, C,
def prior(q, dq, g_acc=g_acc):
nq = 2
H, C = getModelParams(q, dq)
return H, C
The error messages is as follows:
pinocchio.forwardKinematics(model, data, q)
Boost.Python.ArgumentError: Python argument types in
pinocchio.libpinocchio_pywrap.forwardKinematics(Model, Data, DeviceArray)
did not match C++ signature:
forwardKinematics(pinocchio::ModelTpl<double, 0, pinocchio::JointCollectionDefaultTpl> Model, pinocchio::DataTpl<double, 0, pinocchio::JointCollectionDefaultTpl> {lvalue} Data, Eigen::MatrixBase<Eigen::Matrix<double, -1, 1, 0, -1, 1> > Configuration q (size Model::nq), Eigen::MatrixBase<Eigen::Matrix<double, -1, 1, 0, -1, 1> > Velocity v (size Model::nv), Eigen::MatrixBase<Eigen::Matrix<double, -1, 1, 0, -1, 1> > Acceleration a (size Model::nv))
forwardKinematics(pinocchio::ModelTpl<double, 0, pinocchio::JointCollectionDefaultTpl> Model, pinocchio::DataTpl<double, 0, pinocchio::JointCollectionDefaultTpl> {lvalue} Data, Eigen::MatrixBase<Eigen::Matrix<double, -1, 1, 0, -1, 1> > Configuration q (size Model::nq), Eigen::MatrixBase<Eigen::Matrix<double, -1, 1, 0, -1, 1> > Velocity v (size Model::nv))
forwardKinematics(pinocchio::ModelTpl<double, 0, pinocchio::JointCollectionDefaultTpl> Model, pinocchio::DataTpl<double, 0, pinocchio::JointCollectionDefaultTpl> {lvalue} Data, Eigen::MatrixBase<Eigen::Matrix<double, -1, 1, 0, -1, 1> > Configuration q (size Model::nq))
Beta Was this translation helpful? Give feedback.
All reactions