pinocchio: Compute gravity with c++ api wrong
I use python api to compute the gravity and the result is [-0.11936972 0.98543975 0. 0.9855705 0.03554471 -0.05846138]. That’s what I expected.
q = np.asarray([0, 0, 0, 1.57, 0, 0])
v = pinocchio.utils.zero(model.nv)
a = pinocchio.utils.zero(model.nv)
gravity = pinocchio.rnea(model,data,q,v,a)
I use c++ api to compute the gravity of the same model, but the result is [0 0 0 0 0 0].
const std::string urdf_filename = "six_arm_hand/urdf/six_arm_hand_no_palm.urdf";
pinocchio::urdf::buildModel(urdf_filename, model);
pinocchio::Data data(model);
Eigen::VectorXd q = pinocchio::neutral(model);
Eigen::VectorXd v = Eigen::VectorXd::Zero(model.nv);
Eigen::VectorXd a = Eigen::VectorXd::Zero(model.nv);
q << 0, 0, 0, 1.57, 0, 0;
gravity = pinocchio::rnea(model, data, q, v, a);
What’s wrong in my c++ code? Could you give me some hints?
About this issue
- Original URL
- State: closed
- Created 5 years ago
- Comments: 21 (14 by maintainers)
g++ (Ubuntu 8.4.0-1ubuntu1~18.04) 8.4.0 And here is my ouput:
What is the full python code (including where you load the robot)?