Cheetah Software  1.0
ContactImpulse.h
Go to the documentation of this file.
1 
8 #ifndef CONTACT_IMPULSE_H
9 #define CONTACT_IMPULSE_H
10 
11 #include "ContactConstraint.h"
13 
14 template <typename T>
15 class ContactImpulse : public ContactConstraint<T> {
16  public:
18  _iter_lim = 10;
19  _nDof = CC::_model->_nDof;
20  _b_debug = false;
21  }
22  virtual ~ContactImpulse() {}
23 
32  virtual void UpdateExternalForces(T K, T D, T dt) {
33  (void)K;
34  (void)D;
35  // Set penetration recovery ration here
36  _penetration_recover_ratio = 0.0 / dt;
37  _dt = dt;
38  }
39 
45  virtual void UpdateQdot(FBModelState<T>& state);
46 
47  protected:
48  size_t _iter_lim;
49  bool _b_debug;
50  T _tol = 1.e-6;
52  size_t _nDof;
53  void _UpdateVelocity(DVec<T>& qdot);
54  void _UpdateQdotOneDirection(size_t idx,
55  const vectorAligned<D3Mat<T> >& Jc_list,
56  const T* lambda_list,
57  const vectorAligned<DVec<T> > AinvB_list,
58  const T* des_vel_list, const T* min_list,
59  const T* max_list, DVec<T>& qdot);
60  size_t _iter_sum;
61 
62  private:
63  T _dt;
64 };
65 
66 #endif
void _UpdateVelocity(DVec< T > &qdot)
void _UpdateQdotOneDirection(size_t idx, const vectorAligned< D3Mat< T > > &Jc_list, const T *lambda_list, const vectorAligned< DVec< T > > AinvB_list, const T *des_vel_list, const T *min_list, const T *max_list, DVec< T > &qdot)
virtual void UpdateQdot(FBModelState< T > &state)
virtual ~ContactImpulse()
ContactImpulse(FloatingBaseModel< T > *model)
typename Eigen::Matrix< T, 3, Eigen::Dynamic > D3Mat
Definition: cppTypes.h:114
typename std::vector< T, Eigen::aligned_allocator< T >> vectorAligned
Definition: cppTypes.h:118
Virtual class of Contact Constraint logic.
typename Eigen::Matrix< T, Eigen::Dynamic, 1 > DVec
Definition: cppTypes.h:102
virtual void UpdateExternalForces(T K, T D, T dt)
Implementation of Rigid Body Floating Base model data structure.