28 double half_step = timestep * 0.5;
41 for(i=0; i<
n_dof; i++)
52 double d, value_error = 0.0, vel_error = 0.0, total_error;
58 for(i=0; i<
n_dof; i++)
65 total_error = sqrt(value_error+vel_error) / (n_value+
n_dof);
67 new_timestep = timestep * sqrt(max_integ_error / total_error);
68 if(new_timestep < min_timestep)
69 new_timestep = min_timestep;
70 if(new_timestep > timestep)
71 new_timestep = timestep;
72 timestep = new_timestep;
77 for(i=0; i<
n_dof; i++)
102 for(i=0; i<
n_dof; i++)
118 for(i=0; i<
n_dof; i++)
175 for(i=0; i<
n_dof; i++)
182 for(i=0; i<
n_dof; i++)
190 for(i=0; i<
n_dof; i++)
197 for(i=0; i<
n_dof; i++)
204 for(i=0; i<
n_dof; i++)
218 double half_step = timestep * 0.5;
224 for(i=0; i<
n_dof; i++)
236 for(i=0; i<
n_dof; i++)
248 for(i=0; i<
n_dof; i++)
259 for(i=0; i<
n_dof; i++)
271 for(i=0; i<
n_dof; i++)
290 p_ang_vel.mul(rel_att, rel_ang_vel);
291 p_ep_dot.angvel2epdot(rel_ep, rel_ang_vel);
292 p_ang_acc.mul(rel_att, rel_ang_acc);
295 p_lin_vel.mul(rel_att, rel_lin_vel);
296 p_ang_vel.mul(rel_att, rel_ang_vel);
297 p_ep_dot.angvel2epdot(rel_ep, rel_ang_vel);
298 p_lin_acc.mul(rel_att, rel_lin_acc);
299 p_ang_acc.mul(rel_att, rel_ang_acc);
304 child->pre_integrate();
305 brother->pre_integrate();
324 rel_ang_vel.
mul(ratt, p_ang_vel);
330 rel_lin_vel.
mul(ratt, p_lin_vel);
331 rel_ang_vel.mul(ratt, p_ang_vel);
336 child->post_integrate();
337 brother->post_integrate();
int IntegrateValue(double timestep)
Integrate value/velocity only.
int SetJointValue(const fVec &values)
Set all joint values.
void mul(const fMat33 &mat1, const fMat33 &mat2)
friend fMat33 tran(const fMat33 &m)
Returns the transpose.
Joint * root
Chain information.
double * j_value_dot[4]
for 4-th order Runge-Kutta
int SetJointVel(const fVec &vels)
Set all joint velocities/accelerations.
int IntegrateRK4Value(double timestep, int step)
int IntegrateAdaptive(double ×tep, int step, double min_timestep=DEFAULT_MIN_TIMESTEP, double max_integ_error=DEFAULT_MAX_INTEG_ERROR)
Performs Euler integration with adaptive timestep.
int IntegrateRK4Velocity(double timestep, int step)
double ** all_value
Pointers to the integration variables.
int IntegrateVelocity(double timestep)
int IntegrateRK4(double timestep, int step)
Performs 4-th order Runge-Kutta integration.
Classes for defining open/closed kinematic chains.
int Integrate(double timestep)
Performs Euler integration with timestep timestep [s].