40 T* lambda_list_x =
new T[CC::_nContact];
41 T* lambda_list_y =
new T[CC::_nContact];
42 T* lambda_list_z =
new T[CC::_nContact];
44 T* des_vel_list_z =
new T[CC::_nContact];
45 T* des_vel_list_tan =
new T[CC::_nContact];
47 T* min_list_z =
new T[CC::_nContact];
48 T* max_list_z =
new T[CC::_nContact];
50 T* min_list_tan =
new T[CC::_nContact];
51 T* max_list_tan =
new T[CC::_nContact];
64 CC::_model->contactJacobians();
67 for (
size_t i(0); i < CC::_nContact; ++i) {
69 lambda_list_x[i] = CC::_model->applyTestForce(
70 CC::_idx_list[i], CC::_cp_frame_list[i].
template block<3, 1>(0, 0),
72 lambda_list_x[i] = 1. / lambda_list_x[i];
74 lambda_list_y[i] = CC::_model->applyTestForce(
75 CC::_idx_list[i], CC::_cp_frame_list[i].
template block<3, 1>(0, 1),
77 lambda_list_y[i] = 1. / lambda_list_y[i];
79 lambda_list_z[i] = CC::_model->applyTestForce(
80 CC::_idx_list[i], CC::_cp_frame_list[i].
template block<3, 1>(0, 2),
82 lambda_list_z[i] = 1. / lambda_list_z[i];
86 CC::_cp_frame_list[i].transpose() * CC::_model->_vGC[CC::_idx_list[i]];
89 des_vel_list_tan[i] = 0.;
90 if (cp_local_vel[2] < 0.) {
92 -CC::_cp_resti_list[i] * cp_local_vel[2] -
96 std::max(cp_local_vel[2],
102 CC::_cp_frame_list[i].transpose() * CC::_model->_Jc[CC::_idx_list[i]];
105 max_list_z[i] = 1.e5;
109 for (
size_t iter(0); iter <
_iter_lim; ++iter) {
113 des_vel_list_z, min_list_z, max_list_z, qdot);
116 for (
size_t i(0); i < CC::_nContact; ++i) {
117 max_list_tan[i] = CC::_cp_mu_list[i] * CC::_cp_local_force_list[i][2];
118 min_list_tan[i] = -max_list_tan[i];
121 des_vel_list_tan, min_list_tan, max_list_tan, qdot);
125 des_vel_list_tan, min_list_tan, max_list_tan, qdot);
134 delete[] lambda_list_x;
135 delete[] lambda_list_y;
136 delete[] lambda_list_z;
138 delete[] des_vel_list_z;
139 delete[] des_vel_list_tan;
144 delete[] min_list_tan;
145 delete[] max_list_tan;
typename Eigen::Matrix< T, 3, 1 > Vec3
typename std::vector< T, Eigen::aligned_allocator< T >> vectorAligned
typename Eigen::Matrix< T, Eigen::Dynamic, 1 > DVec