Cheetah Software  1.0
ContactConstraint.cpp
Go to the documentation of this file.
1 
6 
7 template <typename T>
9  _cp_pos_list.clear();
10  _cp_local_force_list.clear();
11  _cp_penetration_list.clear();
12 
13  _cp_frame_list.clear();
14  _cp_resti_list.clear();
15  _cp_mu_list.clear();
16  _idx_list.clear();
17 
18  Vec3<T> tmp_vec;
19  Mat3<T> cp_frame;
20 
21  T penetration;
22  for (size_t i(0); i < _model->_nGroundContact; ++i) {
23  _cp_force_list[i].setZero();
24  for (size_t j(0); j < _nCollision; ++j) {
25  if (_collision_list[j]->ContactDetection(_model->_pGC[i], penetration,
26  cp_frame)) {
27  // Contact Happens
28  _cp_pos_list.push_back(_model->_pGC[i]);
29  _cp_local_force_list.push_back(Vec3<T>::Zero());
30  _cp_frame_list.push_back(cp_frame);
31  _cp_penetration_list.push_back(penetration);
32 
33  _idx_list.push_back(i);
34 
35  _cp_resti_list.push_back(_collision_list[j]->getRestitutionCoeff());
36  _cp_mu_list.push_back(_collision_list[j]->getFrictionCoeff());
37  }
38  }
39  }
40  return _cp_pos_list.size();
41 }
42 
43 template class ContactConstraint<double>;
44 template class ContactConstraint<float>;
typename Eigen::Matrix< T, 3, 3 > Mat3
Definition: cppTypes.h:54
typename Eigen::Matrix< T, 3, 1 > Vec3
Definition: cppTypes.h:26
Virtual class of Contact Constraint logic.