51 #include <ilqgames/constraint/constraint.h> 52 #include <ilqgames/utils/relative_time_tracker.h> 53 #include <ilqgames/utils/types.h> 55 #include <glog/logging.h> 61 float Constraint::mu_ = constants::kDefaultMu;
63 void Constraint::ModifyDerivatives(Time t,
float g,
float* dx,
float* ddx,
64 float* dy,
float* ddy,
float* dxdy)
const {
66 const float lambda = lambdas_[TimeIndex(t)];
67 const float mu = Mu(lambda, g);
71 const float new_dx = lambda * *dx + mu * g * *dx;
72 const float new_ddx = lambda * *ddx + mu * (*dx * *dx + g * *ddx);
78 const float new_dy = lambda * *dy + mu * g * *dy;
79 const float new_ddy = lambda * *ddy + mu * (*dy * *dy + g * *ddy);
80 const float new_dxdy = lambda * *dxdy + mu * (*dy * *dx + g * *dxdy);