14 CC::_nContact = CC::_CheckContact();
15 for (
size_t i(0); i < _nGC; ++i) {
17 deflectionRate[i] = (-K / D) * _tangentialDeflections[i];
19 if (CC::_nContact > 0) {
20 _groundContactWithOffset(K, D);
21 for (
size_t i(0); i < CC::_nContact; ++i) {
22 CC::_model->_externalForces.at(CC::_model->_gcParent[CC::_idx_list[i]]) +=
33 for (
size_t i(0); i < _nGC; ++i) {
34 _tangentialDeflections[i] += dt * deflectionRate[i];
43 for (
size_t i = 0; i < CC::_nContact; i++) {
45 CC::_cp_frame_list[i].transpose() *
46 CC::_model->_vGC[CC::_idx_list[i]];
47 T z = CC::_cp_penetration_list[i];
49 T zr = std::sqrt(std::max(T(0), -z));
56 CC::_cp_local_force_list[i][0] = 0;
57 CC::_cp_local_force_list[i][1] = 0;
58 CC::_cp_local_force_list[i][2] = 0;
60 if (normalForce > 0) {
61 CC::_cp_local_force_list[i][2] =
67 deflectionRate[CC::_idx_list[i]] = v.template topLeftCorner<2, 1>();
70 _tangentialDeflections[CC::_idx_list[i]];
73 -tangentialSpringForce -
74 D * zr * deflectionRate[CC::_idx_list[i]];
78 T slipForce = CC::_cp_mu_list[i] *
80 T tangentialForceMagnitude =
83 T r = tangentialForceMagnitude / slipForce;
89 deflectionRate[CC::_idx_list[i]] =
90 -(tangentialForce + tangentialSpringForce) / (D * zr);
93 CC::_cp_local_force_list[i][0] = tangentialForce[0];
94 CC::_cp_local_force_list[i][1] = tangentialForce[1];
97 CC::_cp_force_list[CC::_idx_list[i]] =
98 CC::_cp_frame_list[i] * CC::_cp_local_force_list[i];
auto forceToSpatialForce(const Eigen::MatrixBase< T > &f, const Eigen::MatrixBase< T2 > &p)
typename Eigen::Matrix< T, 3, 1 > Vec3
typename Eigen::Matrix< T, 2, 1 > Vec2
Implementation of Rigid Body Floating Base model data structure.