Skip to content
Snippets Groups Projects
Commit 96c3a57d authored by Andrei's avatar Andrei
Browse files

Smaller refactoring

parent 00101c40
No related branches found
No related tags found
No related merge requests found
......@@ -293,7 +293,7 @@ ZMPVelocityReferencedQP::InitOnLine(deque<ZMPPosition> & FinalZMPTraj_deq,
void
ZMPVelocityReferencedQP::OnLine(double time,
ZMPVelocityReferencedQP::OnLine(double Time,
deque<ZMPPosition> & FinalZMPTraj_deq,
deque<COMState> & FinalCOMTraj_deq,
deque<FootAbsolutePosition> &FinalLeftFootTraj_deq,
......@@ -306,7 +306,7 @@ ZMPVelocityReferencedQP::OnLine(double time,
// Testing if we are reaching the end of the online mode.
if ((EndingPhase_) &&
(time>=TimeToStopOnLineMode_))
(Time>=TimeToStopOnLineMode_))
{ m_OnLineMode = false; }
......@@ -322,7 +322,7 @@ ZMPVelocityReferencedQP::OnLine(double time,
// UPDATE WALKING TRAJECTORIES:
// ----------------------------
if(time + 0.00001 > UpperTimeLimitToUpdate_)
if(Time + 0.00001 > UpperTimeLimitToUpdate_)
{
double TotalAmountOfCPUTime=0.0,CurrentCPUTime=0.0;
struct timeval start,end;
......@@ -332,7 +332,7 @@ ZMPVelocityReferencedQP::OnLine(double time,
// UPDATE INTERNAL DATA:
// ---------------------
VRQPGenerator_->Reference(VelRef_);
VRQPGenerator_->CurrentTime(time+TimeBuffer_);
VRQPGenerator_->CurrentTime(Time+TimeBuffer_);
VRQPGenerator_->CoM(CoM_());
......@@ -364,7 +364,7 @@ ZMPVelocityReferencedQP::OnLine(double time,
// COMPUTE ORIENTATIONS OF FEET FOR WHOLE PREVIEW PERIOD:
// ------------------------------------------------------
deque<double> PreviewedSupportAngles_deq;
OrientPrw_->preview_orientations(time+TimeBuffer_,
OrientPrw_->preview_orientations(Time+TimeBuffer_,
VelRef_,
SupportFSM_->StepPeriod(), CurrentSupport,
FinalLeftFootTraj_deq, FinalRightFootTraj_deq,
......@@ -418,7 +418,7 @@ ZMPVelocityReferencedQP::OnLine(double time,
// COMPUTE ORIENTATION OF TRUNK:
// -----------------------------
OrientPrw_->interpolate_trunk_orientation(time+TimeBuffer_, CurrentIndex,
OrientPrw_->interpolate_trunk_orientation(Time+TimeBuffer_, CurrentIndex,
m_SamplingPeriod,
CurrentSupport,
FinalCOMTraj_deq);
......@@ -426,8 +426,8 @@ ZMPVelocityReferencedQP::OnLine(double time,
// INTERPOLATE THE COMPUTED FEET POSITIONS:
// ----------------------------------------
unsigned NumberStepsPrwd = PrwSupportStates_deq.back().StepNumber;
OFTG_->interpolate_feet_positions(time+TimeBuffer_,
unsigned int NumberStepsPrwd = PrwSupportStates_deq.back().StepNumber;
OFTG_->interpolate_feet_positions(Time+TimeBuffer_,
CurrentIndex, CurrentSupport,
Result.Solution_vec[2*QP_N_], Result.Solution_vec[2*QP_N_+NumberStepsPrwd],
PreviewedSupportAngles_deq,
......
......@@ -192,6 +192,7 @@ GeneratorVelRef::initialize_matrices()
void
GeneratorVelRef::initialize_matrices( linear_inequality_t & Inequalities)
{
switch(Inequalities.type)
{
case IntermedQPMat::INEQ_COP:
......@@ -285,10 +286,10 @@ GeneratorVelRef::build_inequalities_cop(linear_inequality_t & Inequalities,
//set constraints for the whole preview window
double SupportAngle = CurrentSupportAngle;
const int nEdges = 4;
double D_x[nEdges] = {0.0, 0.0, 0.0, 0.0};
double D_y[nEdges] = {0.0, 0.0, 0.0, 0.0};
double dc[nEdges] = {0.0, 0.0, 0.0, 0.0};
const int NbEdges = 4;
double D_x[NbEdges] = {0.0, 0.0, 0.0, 0.0};
double D_y[NbEdges] = {0.0, 0.0, 0.0, 0.0};
double dc[NbEdges] = {0.0, 0.0, 0.0, 0.0};
for( int i=1;i<=N_;i++ )
{
const support_state_t & PrwSupport = SupportStates_deq[i];
......@@ -304,11 +305,11 @@ GeneratorVelRef::build_inequalities_cop(linear_inequality_t & Inequalities,
RFI->compute_linear_system( ZMPFeasibilityEdges, D_x, D_y, dc, PrwSupport );
for(int j = 0;j < nEdges; j++)
for(int j = 0;j < NbEdges; j++)
{
Inequalities.D.x.push_back((i-1)*nEdges+j,i-1,D_x[j]);
Inequalities.D.y.push_back((i-1)*nEdges+j,i-1,D_y[j]);
Inequalities.dc((i-1)*nEdges+j) = dc[j];
Inequalities.D.x.push_back((i-1)*NbEdges+j,i-1,D_x[j]);
Inequalities.D.y.push_back((i-1)*NbEdges+j,i-1,D_y[j]);
Inequalities.dc((i-1)*NbEdges+j) = dc[j];
}
}
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment