Go to the documentation of this file.
4 import pinocchio
as pin
6 from test_case
import PinocchioTestCase
as TestCase
16 self.
model = pin.buildSampleModelHumanoidRandom()
19 qmax = np.full((self.
model.nq, 1), np.pi)
33 self.
model.getJointId(
"lleg6_joint"),
40 self.
model.gravity = pin.Motion.Zero()
44 self.assertLess(np.linalg.norm(ddq), self.
tolerance)
52 M, np.linalg.inv(KKT_inverse)[: self.
model.nv, : self.
model.nv]
59 self.assertLess(np.linalg.norm(ddq_no_q), self.
tolerance)
61 self.assertApprox(ddq, ddq_no_q)
65 data = model.createData()
66 data_ref = model.createData()
79 self.assertApprox(KKT_inverse, KKT_inverse_ref)
80 self.assertApprox(KKT_inverse2, KKT_inverse_ref)
85 self.
model.gravity = pin.Motion.Zero()
96 self.assertLess(np.linalg.norm(ddq), self.
tolerance)
102 self.assertLess(np.linalg.norm(ddq_no_q), self.
tolerance)
104 self.assertApprox(ddq, ddq_no_q)
117 self.assertTrue((ddq7 == ddq8).all())
130 self.assertTrue((ddq5 == ddq6).all())
136 self.assertLess(np.linalg.norm(vnext), self.
tolerance)
140 self.assertLess(np.linalg.norm(vnext_no_q), self.
tolerance)
142 self.assertApprox(vnext, vnext_no_q)
150 self.assertLess(np.linalg.norm(vnext), self.
tolerance)
154 self.
model, data_no_q, self.
v0, self.
J, r_coeff
156 self.assertLess(np.linalg.norm(vnext_no_q), self.
tolerance)
158 self.assertApprox(vnext, vnext_no_q)
164 self.
model, self.
data, self.
q, self.
v0, self.
J, r_coeff, inv_damping
166 self.assertLess(np.linalg.norm(vnext), self.
tolerance)
170 self.
model, data_no_q, self.
v0, self.
J, r_coeff, inv_damping
172 self.assertLess(np.linalg.norm(vnext_no_q), self.
tolerance)
174 self.assertApprox(vnext, vnext_no_q)
184 self.
model, data7, self.
q, self.
v, self.
J, r_coeff, inv_damping
186 self.assertTrue((vnext5 == vnext6).all())
187 self.assertTrue((vnext5 == vnext7).all())
188 self.assertTrue((vnext6 == vnext7).all())
202 self.
model, data6, self.
v, self.
J, r_coeff, inv_damping
205 self.assertTrue((vnext4 == vnext5).all())
206 self.assertTrue((vnext4 == vnext6).all())
207 self.assertTrue((vnext5 == vnext6).all())
210 if __name__ ==
"__main__":
PINOCCHIO_DEPRECATED void getKKTContactDynamicMatrixInverse(const ModelTpl< Scalar, Options, JointCollectionTpl > &model, const DataTpl< Scalar, Options, JointCollectionTpl > &data, const Eigen::MatrixBase< ConstraintMatrixType > &J, const Eigen::MatrixBase< KKTMatrixType > &KKTMatrix_inv)
Computes the inverse of the KKT matrix for dynamics with contact constraints.
def test_impulseDynamics_default(self)
void randomConfiguration(const LieGroupGenericTpl< LieGroupCollection > &lg, const Eigen::MatrixBase< ConfigL_t > &q0, const Eigen::MatrixBase< ConfigR_t > &q1, const Eigen::MatrixBase< ConfigOut_t > &qout)
def test_impulseDynamics_r(self)
const DataTpl< Scalar, Options, JointCollectionTpl >::MatrixXs & crba(const ModelTpl< Scalar, Options, JointCollectionTpl > &model, DataTpl< Scalar, Options, JointCollectionTpl > &data, const Eigen::MatrixBase< ConfigVectorType > &q, const Convention convention=Convention::LOCAL)
Computes the upper triangular part of the joint space inertia matrix M by using the Composite Rigid B...
def test_forwardDynamics_default(self)
def test_impulseDynamics_rd(self)
void computeKKTContactDynamicMatrixInverse(const ModelTpl< Scalar, Options, JointCollectionTpl > &model, DataTpl< Scalar, Options, JointCollectionTpl > &data, const Eigen::MatrixBase< ConfigVectorType > &q, const Eigen::MatrixBase< ConstraintMatrixType > &J, const Eigen::MatrixBase< KKTMatrixType > &KKTMatrix_inv, const Scalar &inv_damping=0.)
Computes the inverse of the KKT matrix for dynamics with contact constraints. It computes the followi...
def test_computeKKTMatrix(self)
ConstraintDataTpl< Scalar, Options, ConstraintCollectionTpl > createData(const ConstraintModelTpl< Scalar, Options, ConstraintCollectionTpl > &cmodel)
const DataTpl< Scalar, Options, JointCollectionTpl >::TangentVectorType & impulseDynamics(const ModelTpl< Scalar, Options, JointCollectionTpl > &model, DataTpl< Scalar, Options, JointCollectionTpl > &data, const Eigen::MatrixBase< ConfigVectorType > &q, const Eigen::MatrixBase< TangentVectorType1 > &v_before, const std::vector< RigidConstraintModelTpl< Scalar, Options >, ConstraintModelAllocator > &contact_models, std::vector< RigidConstraintDataTpl< Scalar, Options >, ConstraintDataAllocator > &contact_datas, const Scalar r_coeff, const ProximalSettingsTpl< Scalar > &settings)
Compute the impulse dynamics with contact constraints. Internally, pinocchio::crba is called.
def test_forwardDynamics_q(self)
void computeJointJacobian(const ModelTpl< Scalar, Options, JointCollectionTpl > &model, DataTpl< Scalar, Options, JointCollectionTpl > &data, const Eigen::MatrixBase< ConfigVectorType > &q, const JointIndex joint_id, const Eigen::MatrixBase< Matrix6Like > &J)
Computes the Jacobian of a specific joint frame expressed in the local frame of the joint and store t...
def test_forwardDynamics_rcoeff(self)
const PINOCCHIO_DEPRECATED DataTpl< Scalar, Options, JointCollectionTpl >::TangentVectorType & forwardDynamics(const ModelTpl< Scalar, Options, JointCollectionTpl > &model, DataTpl< Scalar, Options, JointCollectionTpl > &data, const Eigen::MatrixBase< TangentVectorType > &tau, const Eigen::MatrixBase< ConstraintMatrixType > &J, const Eigen::MatrixBase< DriftVectorType > &gamma, const Scalar inv_damping=0.)
Compute the forward dynamics with contact constraints, assuming pinocchio::computeAllTerms has been c...
def test_forwardDynamics_no_q(self)
void computeAllTerms(const ModelTpl< Scalar, Options, JointCollectionTpl > &model, DataTpl< Scalar, Options, JointCollectionTpl > &data, const Eigen::MatrixBase< ConfigVectorType > &q, const Eigen::MatrixBase< TangentVectorType > &v)
Computes efficiently all the terms needed for dynamic simulation. It is equivalent to the call at the...
def test_impulseDynamics_q(self)
def test_impulseDynamics_no_q(self)
pinocchio
Author(s):
autogenerated on Wed May 28 2025 02:41:14